commit 23966e190bd043b50584abd6f5c9204e7b99ee73 parent c62231a33c4a18e54b2885a81b973ead9edba716 Author: Andreas Gruhler <agruhl@gmx.ch> Date: Sun, 26 Jun 2022 20:36:58 +0200 add tracing script example Diffstat:
M | docs/TESTING.md | | | 2 | ++ |
A | docs/trace.sh | | | 12 | ++++++++++++ |
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/docs/TESTING.md b/docs/TESTING.md @@ -82,6 +82,8 @@ Cleanup the session daemon once done: killall lttng-sessiond ``` +An example (script) for viewing the traces is also given in [./trace.sh](./trace.sh). + ## Send stderr to File > :information_source: For proper tracing and logging, start diary with the LTTng tracepoint provider package (tpp) shared object file, see [LTTng](#linux-trace-toolkit-lttng). diff --git a/docs/trace.sh b/docs/trace.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# +# This is an example that shows how to trace logs. +# source: https://github.com/lttng/lttng-ust/blob/master/doc/examples/cmake-multiple-shared-libraries/trace.sh + +lttng create +lttng enable-event --userspace 'diary:*' +lttng start +LD_PRELOAD=./libtpp.so ./diary +lttng stop +lttng view > trace.txt +cat trace.txt