[lttng-dev] lttng_ust_cyg_profile
Jonathan Rajotte-Julien
jonathan.rajotte-julien at efficios.com
Thu Mar 22 15:25:13 EDT 2018
Hi Alok,
On Thu, Mar 22, 2018 at 06:31:41PM +0000, Alok Priyadarshi wrote:
> I am trying to collect a trace for visualizing callstack using
> lttng_ust_cyg_profile.
>
> Even though I have compiled a single source file with
> -finstrument-functions, I guess it is producing too many events to
> considerably slow down the instrumented process and cause lost events.
Did you have a look at [1]. A "fast" shared object is available.
[1] https://lttng.org/man/3/lttng-ust-cyg-profile/v2.10/
>
> I am using clang, which does not support
> -finstrument-functions-exclude-file-list.
Might want to give gcc a chance then.
> Is there any way to
> filter lttng_ust_cyg_profile events before they are written to the trace? I
> have tried various things:
> 1. lttng-track to only track one process
>
> 2. Only enable lttng_ust_cyg_profile:* events
>
> 3. Increase the subbuffer size:
> lttng enable-channel --userspace --buffers-pid --subbuf-size=2M
> --num-subbuf=2 mychannel
Is there any reason you are using --buffer-pid instead of the default per-uid buffering?
> Using this option is very flaky however. It crashes lttng-sessiond.
>
We will need the log (lttng-sessiond -vvv) (pastebin) and the version of lttng for this.
Does your workflow looks somewhat similar to this?
1) Instrumented app is started with relevant LD_PRELOAD
2) lttng create my_session
3) lttng enable-channel -u --subbuf-size=2M --num-subbuf=8 my_channel
4) lttng enable-event -u -c my_channel 'lttng_ust_cyg_profile:*'
5) lttng track -u -p <PID>
6) lttng start
... some time pass
7) lttng stop
8) lttng destroy
If a discarded events warning is reported the solution is to increase either the
size or the number of subbuffers per cpu. Note that the upper limit for the total
subbuffers size is dictated by the available free memory of the system.
> Any other ideas to filter events?
>
> I am also open to explicitly adding tracepoints to the functions I care
> about. But I am not sure how they can be visualized in trace-compass
> callstack view.
Neither am I, this might be a better question for the tracecompass mailing list.
> I guess it only supports tracepoints generated by
> lttng_ust_cyg_profile?
Cheers
--
Jonathan Rajotte-Julien
EfficiOS
More information about the lttng-dev
mailing list