Would appreciate any input/suggestion on this. Thanks a lot. Regards, Sudhagar
Visit my blog at: http://sudhagarc.blogspot.com On Tue, Dec 23, 2014 at 3:16 AM, Sudhagar Chinnaswamy <[email protected]> wrote: > Hi: > > I have the same need as discussed in the below mentioned thread. I want to > use LTTng, but most of the cases we need to log different parameters under > the same provider and event. > > http://lists.lttng.org/pipermail/lttng-dev/2013-December/022134.html > > When I tried a simple program to log the variable arguments under same > provider/event as suggested in the above thread using the macro below, I > found that the function "my_snprintf" is called "twice" when the logging > for the event is enabled for each tracepoint call. It seems inefficient to > call the same function twice. Is there something that could be done to make > it efficient or am I missing something? > > — 8< — > > #define tracepoint_for_format_string(provider, name, …) \ > > do { \ > > char msg_buf[MAX_BUFFER_SIZE]; \ > > tracepoint(provider, name, my_snprintf(msg_buf, MAX_BUFFER_SIZE, > __VA_ARGS__)); \ > > } while (0) > > — 8< — > > Alternatively, is there any other approach to achieve my requirement: Need > to use same provider & event name to log variable arguments? > > For e.g., > my_tracepoint(hello_world, test, "argc=%d, argv=%p", argc, argv); > my_tracepoint(hello_world, test, "argv[%u] :: %s", x, argv[x]); > my_tracepoint(hello_world, test, "Quitting now!"); > > Thanks in advance. > > Regards, > Sudhagar > >
_______________________________________________ lttng-dev mailing list [email protected] http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
