X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=include%2Fust%2Fusterr-signal-safe.h;h=998d8d8960d78ae8f039ce21d87ea2cb0827823e;hb=d4419b81b243bc3a6bdd4a09b3ca2216d044a1c7;hp=483e7f541a5b1bb6be916726422737ca167feed6;hpb=1dbfff0c0126804b07e9c11ba2307f65a95a650b;p=lttng-ust.git diff --git a/include/ust/usterr-signal-safe.h b/include/ust/usterr-signal-safe.h index 483e7f54..998d8d89 100644 --- a/include/ust/usterr-signal-safe.h +++ b/include/ust/usterr-signal-safe.h @@ -54,6 +54,8 @@ static inline int ust_debug(void) #define UST_XSTR(d) UST_STR(d) #define UST_STR(s) #s +#define USTERR_MAX_LEN 512 + /* We sometimes print in the tracing path, and tracing can occur in * signal handlers, so we must use a print method which is signal safe. */ @@ -68,8 +70,8 @@ static inline void __attribute__ ((format (printf, 1, 2))) #define sigsafe_print_err(fmt, args...) \ { \ - /* Can't use dynamic allocation. Limit ourselves to 250 chars. */ \ - char ____buf[250]; \ + /* Can't use dynamic allocation. Limit ourselves to USTERR_MAX_LEN chars. */ \ + char ____buf[USTERR_MAX_LEN]; \ int ____saved_errno; \ \ /* Save the errno. */ \ @@ -145,12 +147,12 @@ static inline void __attribute__ ((format (printf, 1, 2))) #define BUG_ON(condition) \ do { \ - if (unlikely(condition)) \ + if (caa_unlikely(condition)) \ ERR("condition not respected (BUG) on line %s:%d", __FILE__, __LINE__); \ } while(0) #define WARN_ON(condition) \ do { \ - if (unlikely(condition)) \ + if (caa_unlikely(condition)) \ WARN("condition not respected on line %s:%d", __FILE__, __LINE__); \ } while(0) #define WARN_ON_ONCE(condition) WARN_ON(condition)