search.noResults

search.searching

saml.title
dataCollection.invalidEmail
note.createNoteMessage

search.noResults

search.searching

orderForm.title

orderForm.productCode
orderForm.description
orderForm.quantity
orderForm.itemPrice
orderForm.price
orderForm.totalPrice
orderForm.deliveryDetails.billingAddress
orderForm.deliveryDetails.deliveryAddress
orderForm.noItems
Column: Embedded design


Using Tracealyzer for Linux to evaluate userspace performance


Mohammed Billoo, founder of MAB Labs, charts his experiences with the new Linux support by Percepio’s Tracealyzer v4.4 tool through real-world projects


Tracepoints Tracepoints are instrumentation points provided by LTTng-UST (i.e., the LTTng userspace tracing library), which basically capture user-specified data as events. Tracepoints can be created in two


I


n previous articles we analysed an embedded system by tracing Linux kernel events. Tis time we demonstrate how to create LTTng tracepoints and how to use Tracealyzer for Linux to


measure certain metrics based on these tracepoints. We will focus on C/C++, and demonstrate similar principles in Python in a future article. While it is important to ensure that


any customisations to the Linux kernel, including device drivers, are correct and performant, it is probably even more important for users to validate their own (“userspace”) applications and ensure that these are working, too. Te vast majority of embedded Linux


soſtware developers write userspace applications. Since these are specific to a certain domain and are most certainly complex, application developers need an easy mechanism to validate the functionality of their applications and measure their performance.


ways: the first, called tracef, is a very simple way to capture all data as a single event. The second allows a developer to create custom events. While the latter mechanism requires significantly more code, it also provides maximum flexibility for collecting data and displaying it in Tracealyzer.


We will use the tracef technique


here, leaving custom events to a later edition. As mentioned, tracef is very straightforward; the following snippet shows how to add tracing to a simple “Hello World” example:


#include <lttng/tracef.h> int main(void) {


int i;


for (i = 0; i < 25; i++) {


tracef(“Hello World: %d”, i); }


return 0; }


These lines are all that’s needed to log an LTTng userspace event: include the appropriate header file and call tracef to emit a userspace event, similar to the classic printf() function. We must first ensure that LTTng


is installed on our target embedded platform, using steps similar to those highlighted in the first article in this series. Then, we need to cross-compile the above snippet, and run the following commands on the target platform to


Figure 1: Instructing Tracealyzer how to parse and display the userspace events


10 May 2021 www.electronicsworld.co.uk


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