Column: Embedded design
interactions our application has with others and the operating system. For example, there may be another process or thread that preempts our application and hinders its performance. We can use Tracealyzer and LTTng to understand the cause of these performance anomalies and refine the implementation to guard against them. Trough this relatively innocuous
Figure 3: Trace View updates with a new red bar
performance insights of our application while other applications are running. Tis implementation also serves as
a reference on how to evaluate future algorithm implementations’ performance. As shown above, we have isolated the core functions themselves into a separate Python module. Not only is this good programming practice in general, but it lets us focus on the performance of specific functions. Just as we created a more encompassing Python module that made direct calls to the core functions, we can now create a series of test modules that generate similar events before making calls to the functions under test. In addition, since trace overhead is
almost negligible, we can actually generate performance metrics in our production codebase, too. Tis is tremendously useful for regular system testing, wherein the same codebase can be used to ensure that the application is both functionally correct and performant, with only minimal changes.
Minimal overheads In summary, we have demonstrated how Tracealyzer and LTTng can be used to capture performance metrics in a Python application. Due to its minimal overhead, we can retain the instrumentation for use on our target embedded system, which allows us to monitor and understand the
22 July/August 2021
www.electronicsworld.co.uk
example, we’ve also learned a key characteristic of the Python language that can be used in other, more complex implementations. We’ve also shown how to measure and validate the performance of key core functions that may be kept relatively isolated. Finally, we’ve demonstrated how this mechanism can be expanded to ensure that our application is functionally correct and performs with minimal changes in environment and setup.
Figure 4: Interval Plot graph
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 |
Page 45 |
Page 46 |
Page 47 |
Page 48 |
Page 49 |
Page 50 |
Page 51 |
Page 52 |
Page 53 |
Page 54 |
Page 55 |
Page 56 |
Page 57 |
Page 58