Re: [lttng-dev] "Hands-free" tracepoints using LD_PRELOAD

2019-01-29 Thread Brian Rossa
Ok, after further review and some performance analysis on spdlog, I'm considering skipping the tracef(...) step and jumping to a tracepoint-based approach. I believe I can use code generation to create both (1) the tracepoint definitions and (2) function interposition (LD_PRELOAD) shims calling to

Re: [lttng-dev] "Hands-free" tracepoints using LD_PRELOAD

2019-01-25 Thread Philippe Proulx
On Fri, Jan 25, 2019 at 4:05 AM Brian Rossa wrote: > > Francis, > > These are great suggestions, thanks! > >> #Third idea: >> Do you know of tracef() [3] ? Using it, you can save any string to a >> UST trace. As a first step, you could directly replace your calls to >> spdlog by calls to tracef.

Re: [lttng-dev] "Hands-free" tracepoints using LD_PRELOAD

2019-01-25 Thread Brian Rossa
Francis, These are great suggestions, thanks! #Third idea: > Do you know of tracef() [3] ? Using it, you can save any string to a > UST trace. As a first step, you could directly replace your calls to > spdlog by calls to tracef. It's an highly inefficient way of using > LTTng, but it works (and

Re: [lttng-dev] "Hands-free" tracepoints using LD_PRELOAD

2019-01-24 Thread Francis Deslauriers
" Le mer. 23 janv. 2019, à 19 h 20, Brian Rossa a écrit : > > Jonathan, > > Responses below: > >> AFAIK, lttng does not have an equivalent. > > > I believe my code could significantly reduce the need for hand-writing the > tracepoints. But I won't likely take on a port to LTTng immediately, as

Re: [lttng-dev] "Hands-free" tracepoints using LD_PRELOAD

2019-01-24 Thread Brian Rossa
Jonathan, Responses below: AFAIK, lttng does not have an equivalent. > I believe my code could significantly reduce the need for hand-writing the tracepoints. But I won't likely take on a port to LTTng immediately, as a "vanilla" interposition approach seems to be meeting my requirements. > >

Re: [lttng-dev] "Hands-free" tracepoints using LD_PRELOAD

2019-01-22 Thread Jonathan Rajotte-Julien
Hi Brian, On Tue, Jan 22, 2019 at 01:30:23PM -0500, Brian Rossa wrote: >4. Boilerplate that does the typical `log(...); auto return_val = >dlsym(...); log(...); return return_val;` gets generated. As proposed by Francis, this is when you need to "generate" a corresponding tracepoint

Re: [lttng-dev] "Hands-free" tracepoints using LD_PRELOAD

2019-01-22 Thread Brian Rossa
Francis, Thanks for your detailed, helpful reply. I was especially excited to learn about the progress on `--userspace-probe`, but unfortunately I *do* need to extract the function arguments. It would seem, then, that interposition through LD_PRELOAD is really the only option. The decision to

Re: [lttng-dev] "Hands-free" tracepoints using LD_PRELOAD

2019-01-22 Thread Francis Deslauriers
Hi Brian, If I understand correctly, you want developers to provide a whitelist of functions that they want to instrument in an arbitrary shared library, and then have a system that instruments those functions without having to recompile the library with LTTng-UST tracepoints. Can you give us an

[lttng-dev] "Hands-free" tracepoints using LD_PRELOAD

2019-01-18 Thread Brian Rossa
Hello, I have a custom tracing solution that I'm interested in porting to LTTng. It works as follows: 1. Input is a whitelist of mangled names taken from a target library, libfoo.so. 2. For each name, generate a logging shim (example ) for