73 #include <sys/types.h> 97 #define DEBUG_PMSG_ASYNC 0 122 static void create_msg(
char *
buf,
size_t buflen,
bool add_thread_id,
123 const char *tag,
const char *fmt,
va_list_box* box);
147 #ifdef SINGLE_THREAD_LOGGING 148 if ( getenv(
"OT") && (
TD_GET(core_profile_trace_data.id) != THE_THREAD)) {
151 #endif // SINGLE_THREAD_LOGGING 161 const char *fmt ,...)
175 const char *fmt ,...)
220 char buf[MSG_BUF_SIZE];
227 create_msg(&buf[0],
sizeof(buf), add_thread_id, tag, fmt, box);
231 write(2, buf, strlen(buf));
256 #ifndef USE_GCC_THREAD 262 strncpy(buf,
"??", len);
264 #else // USE_GCC_THREAD 265 extern __thread monitor_tid;
266 if (monitor_tid != -1) {
270 strncpy(buf,
"??", len);
272 #endif // USE_GCC_THREAD 280 char fstr[MSG_BUF_SIZE];
300 char* fstr_end = fstr + strlen(fstr);
301 hpcrun_msg_ns(fstr_end,
sizeof(fstr) - strlen(fstr),
"%-5s: ", tag);
304 strncat(fstr, fmt, MSG_BUF_SIZE - strlen(fstr) - 5);
void hpcrun_emsg_valist(const char *fmt, va_list_box *box)
ssize_t MONITOR_EXT_WRAP_NAME() write(int fd, const void *buf, size_t count)
thread_data_t * hpcrun_safe_get_td(void)
#define va_list_boxp_end(box)
int hpcrun_msg_vns(char *buf, size_t len, const char *fmt, va_list_box *box)
bool hpcrun_using_threads_p(void)
void hpcrun_amsg(const char *fmt,...)
static void spinlock_unlock(spinlock_t *l)
static void create_msg(char *buf, size_t buflen, bool add_thread_id, const char *tag, const char *fmt, va_list_box *box)
int messages_logfile_fd(void)
#define va_list_box_start(box, arg)
static char * safely_get_tid_str(char *buf, size_t len)
int hpcrun_sample_prob_active(void)
int hpcrun_msg_ns(char *buf, size_t len, const char *fmt,...)
void hpcrun_nmsg(pmsg_category flag, const char *tag, const char *fmt,...)
core_profile_trace_data_t core_profile_trace_data
static void spinlock_lock(spinlock_t *l)
int debug_flag_get(pmsg_category flag)
void hpcrun_pmsg(const char *tag, const char *fmt,...)
void hpcrun_pmsg_stderr(bool echo_stderr, pmsg_category flag, const char *tag, const char *fmt,...)
void hpcrun_write_msg_to_log(bool echo_stderr, bool add_thread_id, const char *tag, const char *fmt, va_list_box *box)
bool hpcrun_get_disabled(void)
void hpcrun_emsg(const char *fmt,...)
void hpcrun_nmsg_stderr(bool echo_stderr, pmsg_category flag, const char *tag, const char *fmt,...)
static const unsigned int msg_limit
#define SPINLOCK_UNLOCKED
static unsigned int msgs_out