projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tests: Make test_per_application_leaks more robust
[lttng-tools.git]
/
src
/
common
/
error.hpp
diff --git
a/src/common/error.hpp
b/src/common/error.hpp
index d1996384db5c839cd2764e62d36dcb7d26e6499c..66f38bf2eca36e7e9356d9eb3fb837e6db4873bb 100644
(file)
--- a/
src/common/error.hpp
+++ b/
src/common/error.hpp
@@
-47,7
+47,7
@@
struct log_time {
char str[19];
};
char str[19];
};
-extern thread_local const char *
logger_thread_name;
+extern thread_local const char *logger_thread_name;
extern int lttng_opt_quiet;
extern int lttng_opt_verbose;
extern int lttng_opt_quiet;
extern int lttng_opt_verbose;
@@
-226,6
+226,7
@@
static inline void __lttng_print_check_abort(enum lttng_error_level type)
} while (0);
#define _PERROR(fmt, args...) _ERRMSG("PERROR", PRINT_ERR, fmt, ##args)
} while (0);
#define _PERROR(fmt, args...) _ERRMSG("PERROR", PRINT_ERR, fmt, ##args)
+#define _PWARN(fmt, args...) _ERRMSG("PWARN", PRINT_WARN, fmt, ##args)
#if !defined(__GLIBC__) || \
((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE))
#if !defined(__GLIBC__) || \
((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !defined(_GNU_SOURCE))
@@
-239,11
+240,17
@@
static inline void __lttng_print_check_abort(enum lttng_error_level type)
strerror_r(errno, _perror_buf, sizeof(_perror_buf)); \
_PERROR(call ": %s", ##args, _perror_buf); \
} while (0);
strerror_r(errno, _perror_buf, sizeof(_perror_buf)); \
_PERROR(call ": %s", ##args, _perror_buf); \
} while (0);
+
+#define PWARN(call, args...) \
+ do { \
+ char _perror_buf[200]; \
+ strerror_r(errno, _perror_buf, sizeof(_perror_buf)); \
+ _PWARN(call ": %s", ##args, _perror_buf); \
+ } while (0);
#else
/*
* Version using GNU strerror_r, for linux with appropriate defines.
*/
#else
/*
* Version using GNU strerror_r, for linux with appropriate defines.
*/
-const char *error_get_str(int32_t code);
#define PERROR(call, args...) \
do { \
char *_perror_buf; \
#define PERROR(call, args...) \
do { \
char *_perror_buf; \
@@
-251,8
+258,17
@@
const char *error_get_str(int32_t code);
_perror_buf = strerror_r(errno, _perror_tmp, sizeof(_perror_tmp)); \
_PERROR(call ": %s", ##args, _perror_buf); \
} while (0);
_perror_buf = strerror_r(errno, _perror_tmp, sizeof(_perror_tmp)); \
_PERROR(call ": %s", ##args, _perror_buf); \
} while (0);
+#define PWARN(call, args...) \
+ do { \
+ char *_perror_buf; \
+ char _perror_tmp[200]; \
+ _perror_buf = strerror_r(errno, _perror_tmp, sizeof(_perror_tmp)); \
+ _PWARN(call ": %s", ##args, _perror_buf); \
+ } while (0);
#endif
#endif
+const char *error_get_str(int32_t code);
+
namespace lttng {
namespace logging {
namespace details {
namespace lttng {
namespace logging {
namespace details {
@@
-265,7
+281,7
@@
namespace details {
#define DBG_FMT(format_str, args...) \
do { \
try { \
#define DBG_FMT(format_str, args...) \
do { \
try { \
- DBG("%s",
fmt::format(format_str, ##args).c_str());
\
+ DBG("%s",
lttng::format(format_str, ##args).c_str());
\
} catch (const std::exception& _formatting_exception) { \
lttng::logging::details::die_formatting_exception(format_str, \
_formatting_exception); \
} catch (const std::exception& _formatting_exception) { \
lttng::logging::details::die_formatting_exception(format_str, \
_formatting_exception); \
@@
-275,7
+291,7
@@
namespace details {
#define WARN_FMT(format_str, args...) \
do { \
try { \
#define WARN_FMT(format_str, args...) \
do { \
try { \
- WARN("%s",
fmt::format(format_str, ##args).c_str());
\
+ WARN("%s",
lttng::format(format_str, ##args).c_str());
\
} catch (const std::exception& _formatting_exception) { \
lttng::logging::details::die_formatting_exception(format_str, \
_formatting_exception); \
} catch (const std::exception& _formatting_exception) { \
lttng::logging::details::die_formatting_exception(format_str, \
_formatting_exception); \
@@
-285,7
+301,7
@@
namespace details {
#define ERR_FMT(format_str, args...) \
do { \
try { \
#define ERR_FMT(format_str, args...) \
do { \
try { \
- ERR("%s",
fmt::format(format_str, ##args).c_str());
\
+ ERR("%s",
lttng::format(format_str, ##args).c_str());
\
} catch (const std::exception& _formatting_exception) { \
lttng::logging::details::die_formatting_exception(format_str, \
_formatting_exception); \
} catch (const std::exception& _formatting_exception) { \
lttng::logging::details::die_formatting_exception(format_str, \
_formatting_exception); \
This page took
0.03524 seconds
and
4
git commands to generate.