Column: Embedded design
capture trace data so it can be displayed in Tracealyzer:
lttng create
lttng enable-event -k sched_* lttng add-context -k -t pid lttng add-context -k -t ppid lttng enable-event -u ‘lttng_ust_tracef:*’ lttng add-context -u -t vtid lttng start
<run the userspace application> lttng stop lttng destroy
Figure 2: Tracealyzer confi guration screen
T ese items are the most relevant since they enable capture of userspace data and execute the application. Another interesting point is that, based
on these commands, we’re also capturing kernel traces, and you may wonder why we’re doing that. T ere are two reasons for it: First, having the kernel trace included can oſt en explain the timeline of userspace events. For example, if there is a long delay between two events in our application, kernel events should allow us to see what caused it. Second, Tracealyzer, as of version 4.4.2, actually requires some data in the kernel trace to correctly display UST events, although it doesn’t need to be the full kernel trace; a later release of the soſt ware will address these. Once a capture has been generated, the
Figure 3: User event signal plot
next step is to open it in Tracealyzer for Linux. Aſt er opening the trace, fi rst we must instruct Tracealyzer how to parse and display the userspace events. To do that, select Trace in the top menu and click on Confi gure Event Interpretations; see Figure 1. In the resulting window, highlight
lttng_ust_tracef:event in the Channel Name column, and click the Change button. In the next window that appears, click the User Event Mapping radio button, and then Next, to fi nally arrive at the confi guration screen, shown in Figure 2. T e second column, named Data Type,
Figure 4: Zooming in on Trace View
is the data type of each fi eld as provided by LTTng. T e third column, called Cast to Type, allows for changing (casting) the data type as needed. For instance, if some userspace tracepoint would log a numeric
www.electronicsworld.co.uk May 2021 11
Page 1 |
Page 2 |
Page 3 |
Page 4 |
Page 5 |
Page 6 |
Page 7 |
Page 8 |
Page 9 |
Page 10 |
Page 11 |
Page 12 |
Page 13 |
Page 14 |
Page 15 |
Page 16 |
Page 17 |
Page 18 |
Page 19 |
Page 20 |
Page 21 |
Page 22 |
Page 23 |
Page 24 |
Page 25 |
Page 26 |
Page 27 |
Page 28 |
Page 29 |
Page 30 |
Page 31 |
Page 32 |
Page 33 |
Page 34 |
Page 35 |
Page 36 |
Page 37 |
Page 38 |
Page 39 |
Page 40 |
Page 41 |
Page 42 |
Page 43 |
Page 44