Traditional verification methods are not sufficient to fully verify multi-threaded systems.

Most embedded systems today are powered by multi-threaded software, e.g., running on Linux or a real-time operating system (RTOS). While multi-threading has many advantages over single-threaded designs, it can make the software more complex and the verification more challenging.

Traditional verification methods like code review, static analysis, and functional testing are necessary but not sufficient to fully verify multi-threaded systems where there is an intricate web of dependencies between threads caused by explicit and implicit thread interactions.

Moreover, such dependencies can be affected by software execution time variations, which are not explicit in the code but rather an emergent behavior in runtime. Timing effects on thread interactions are often an uncontrolled factor when testing multi-threaded systems, so even vast amounts of testing might skim only the surface of an ocean of potential execution scenarios. As a result, latent defects may remain undetected, only to surface following deployment.

Embedded software often also needs to meet real-time requirements. For example, a control system might have a requirement to output control signals to a motor controller every 5 milliseconds, where any additional delay is considered a failure. Such requirements are not only affected by the execution time of the specific thread, but also by dependencies on other threads. Thus, verifying real-time requirements is about more than measuring timing metrics. It is also about identifying potential risks from thread interactions that may affect the timing requirements.

So, how do you verify that a design is good from a multi-threading perspective? The de facto solution is runtime observability using software tracing. Percepio Tracealyzer offers a large set of visual analysis features and functionalities for software design analysis and verification of real-time requirements. By adopting system tracing with Tracealyzer, developers can:

  • Collect detailed runtime data on thread execution, thread interactions, and timing over long test runs, without needing any specialized hardware for this purpose.
  • Find anomalies in the real-time behavior using various high-level overviews, such as the CPU load graph or the statistics report, and simply click on an abnormal data point and see the details in the execution trace view.
  • Analyze software timing variations, for example using the Actor Instance Graph showing a plot of various timing metrics for each thread over time.
  • See thread dependencies, for example using the Communication Flow graph that provides a visual overview of thread interactions through IPC objects.

Tracealyzer does not require any particular hardware support, but instead relies on efficient software instrumentation in the target software. The trace data can be transferred to the host computer in various ways, for example by real-time streaming over an ethernet connection or a supported debug probe.

To learn more about Tracealyzer and to try the free evaluation, please visit the Percepio website.

www.percepio.com