<div dir="ltr">I am trying to add a thread timestamp to trace events. By thread timestamp I mean the value returned by clock_gettime(CLOCK_THREAD_CPUTIME_ID):<div><a href="https://linux.die.net/man/3/clock_gettime">https://linux.die.net/man/3/clock_gettime</a><br></div><div><br></div><div>I could do this by creating custom events, but I am wondering if there is already a way to add this information to event context. I have tried using the following arguments to lttng-add-context, but none of them add any additional information:</div><div><div>perf:cpu:cpu-cycles</div><div>perf:cpu:cycles</div></div><div><div>perf:thread:cpu-cycles</div><div>perf:thread:cycles</div></div><div><br></div><div>Note that I have only enabled userspace events. I use the following sequence of commands to capture trace:</div><div><div>lttng create</div><div>lttng enable-event --userspace --all</div><div>lttng add-context --userspace -t vpid -t vtid -t perf:thread:cycles</div><div>lttng start</div><div>lttng stop</div></div><div><br></div></div>