From: compudj Date: Wed, 8 Mar 2006 21:06:26 +0000 (+0000) Subject: thread fix X-Git-Tag: v0.12.20~1867 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=ba017bc3146fe853e1f894c9828b8a08fc21e6ca;p=lttv.git thread fix git-svn-id: http://ltt.polymtl.ca/svn@1622 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/genevent-new/genevent.c b/genevent-new/genevent.c index c62459c3..7408b7e5 100644 --- a/genevent-new/genevent.c +++ b/genevent-new/genevent.c @@ -1905,7 +1905,13 @@ int print_event_logging_function_user_fast(char *basename, facility_t *fac, fprintf(fd, "\n"); print_tabs(1, fd); - fprintf(fd, "if(!trace) ltt_thread_init();\n"); + fprintf(fd, "if(!trace) {\n"); + print_tabs(2, fd); + fprintf(fd, "ltt_thread_init();\n"); + print_tabs(2, fd); + fprintf(fd, "trace = thread_trace_info;\n"); + print_tabs(1, fd); + fprintf(fd, "}\n\n"); fprintf(fd, "\n"); /* Calculate event variable len + event data alignment offset. diff --git a/usertrace-generic/ltt/ltt-facility-user_generic.h b/usertrace-generic/ltt/ltt-facility-user_generic.h index d6a0e301..94a636dc 100644 --- a/usertrace-generic/ltt/ltt-facility-user_generic.h +++ b/usertrace-generic/ltt/ltt-facility-user_generic.h @@ -132,7 +132,11 @@ static inline int trace_user_generic_string( uint64_t tsc; size_t before_hdr_pad, after_hdr_pad, header_size; - if(!trace) ltt_thread_init(); + if(!trace) { + ltt_thread_init(); + trace = thread_trace_info; + } + /* For each field, calculate the field size. */ /* size = *to_base + *to + *len */ @@ -340,7 +344,11 @@ static inline int trace_user_generic_string_pointer( uint64_t tsc; size_t before_hdr_pad, after_hdr_pad, header_size; - if(!trace) ltt_thread_init(); + if(!trace) { + ltt_thread_init(); + trace = thread_trace_info; + } + /* For each field, calculate the field size. */ /* size = *to_base + *to + *len */ @@ -511,7 +519,11 @@ static inline int trace_user_generic_slow_printf( uint64_t tsc; size_t before_hdr_pad, after_hdr_pad, header_size; - if(!trace) ltt_thread_init(); + if(!trace) { + ltt_thread_init(); + trace = thread_trace_info; + } + /* For each field, calculate the field size. */ /* size = *to_base + *to + *len */ @@ -692,7 +704,11 @@ static inline __attribute__((no_instrument_function)) int trace_user_generic_fun uint64_t tsc; size_t before_hdr_pad, after_hdr_pad, header_size; - if(!trace) ltt_thread_init(); + if(!trace) { + ltt_thread_init(); + trace = thread_trace_info; + } + /* For each field, calculate the field size. */ /* size = *to_base + *to + *len */ @@ -918,7 +934,11 @@ static inline __attribute__((no_instrument_function)) int trace_user_generic_fun uint64_t tsc; size_t before_hdr_pad, after_hdr_pad, header_size; - if(!trace) ltt_thread_init(); + if(!trace) { + ltt_thread_init(); + trace = thread_trace_info; + } + /* For each field, calculate the field size. */ /* size = *to_base + *to + *len */