Criticality: static profiling for real-time programs

Abstract

With the increasing performance demand in real-time systems it becomes more and more important to provide feedback to programmers and software development tools on the performance-relevant code parts of a real-time program. So far, this information was limited to an estimation of the worst-case execution time (WCET) and its associated worst-case execution path (WCEP) only. However, both, the WCET and the WCEP, only provide partial information. Only code parts that are on one of the WCEPs are indicated to the programmer. No information is provided for all other code parts. To give a comprehensive view covering the entire code base, tools in the spirit of program profiling are required.

This work proposes an efficient approach to compute worst-case timing information for all code parts of a program using a complementary metric, called criticality. Every statement of a program is assigned a criticality value, expressing how critical the code is with respect to the global WCET. This gives valuable information how close the worst execution path passing through a specific program part is to the global WCEP. We formally define the criticality metric and investigate some of its properties with respect to dominance in control-flow graphs. Exploiting some of those properties, we propose an algorithm that reduces the overhead of computing the metric to cover complete programs. We also investigate ways to efficiently find only those code parts whose criticality is above a given threshold.

Experiments using well-established real-time benchmark programs show an interesting distribution of the criticality values, revealing considerable amounts of highly critical as well as uncritical code. The metric thus provides ideal information to programmers and software development tools to optimize the worst-case execution time of these programs.

This is a preview of subscription content, access via your institution.

Fig. 1
Algorithm 1
Algorithm 2
Fig. 2
Algorithm 3
Fig. 3
Algorithm 4
Algorithm 5
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8

Notes

  1. 1.

    For programs with multiple exit points an artificial sink node can be inserted, which is connected to all exit nodes.

  2. 2.

    It is trivial to construct a concrete path, since IPET ensures that Kirchhoff’s law is respected by the execution counts.

  3. 3.

    http://www.rapitasystems.com/rapitime.

  4. 4.

    http://www.absint.com/.

  5. 5.

    http://llvm.org/.

  6. 6.

    http://www.mrtc.mdh.se/projects/WCC/2011/.

  7. 7.

    http://www.coin-or.org/.

References

  1. Agrawal H (1994) Dominators, super blocks, and program coverage. In: Proc. of the symposium on principles of programming languages. ACM, New York, pp 25–34

    Google Scholar 

  2. Aho AV, Lam MS, Sethi R, Ullman JD (2006) Compilers: principles, techniques, and tools, 2nd edn. Addison-Wesley, Reading

    Google Scholar 

  3. Ball T, Eick SG (1996) Software visualization in the large. Computer 29:33–43

    Article  Google Scholar 

  4. Ball T, Larus JR (1994) Optimally profiling and tracing programs. ACM Trans Program Lang Syst 16(4):1319–1360

    Article  Google Scholar 

  5. Brandner F, Hepp S, Jordan A (2012) Static profiling of the worst-case in real-time programs. In: Proceedings of the international conference on real-time and network systems, RTNS ’12. ACM, New York, pp 101–110

    Google Scholar 

  6. Colombet Q, Brandner F, Darte A (2011) Studying optimal spilling in the light of ssa. In: Proceedings of the international conference on compilers, architectures and synthesis for embedded systems, CASES ’11. ACM, New York, pp 25–34

    Google Scholar 

  7. Cormen TH, Leiserson CE, Rivest RL, Stein C (2009) Introduction to algorithms, 3rd edn. MIT Press, Cambridge

    Google Scholar 

  8. Dvorak DL (2009) NASA study on flight software complexity. Technical excellence initiative. NASA Office of Chief Engineer

  9. Georgiadis L, Tarjan RE (2004) Finding dominators revisited: extended abstract. In: Proceedings of the symposium on discrete algorithms, SODA ’04. Society for Industrial and Applied Mathematics, Philadelphia, pp 869–878

    Google Scholar 

  10. Graham SL, Kessler PB, Mckusick MK (1982) Gprof: a call graph execution profiler. In: Proc. of the symposium on compiler construction, CC ’82. ACM, New York, pp 120–126

    Google Scholar 

  11. Gustafsson J, Betts A, Ermedahl A, Lisper B (2010) The Mälardalen WCET benchmarks—past, present and future. In: Proc. of the workshop on worst-case execution time analysis, OCG, pp 137–147

  12. Holsti N, Långbacka T, Saarinen S (2000) Using a worst-case execution-time tool for real-time verification of the DEBIE software. In: Proc. of the Data Systems in Aerospace Conference, ESA, p 307

  13. Lemieux F, Salois M (2006) Visualization techniques for program comprehension a literature review. In: Proc. of the conference on new trends in software methodologies, tools and techniques (SoMeT ’06). IOS Press, Amsterdam, pp 22–47

    Google Scholar 

  14. Lengauer T, Tarjan RE (1979) A fast algorithm for finding dominators in a flowgraph. ACM Trans Program Lang Syst 1(1):121–141

    Article  MATH  Google Scholar 

  15. Li YTS, Malik S (1995) Performance analysis of embedded software using implicit path enumeration. In: Proc. of the design automation conference, DAC ’95. ACM, New York, pp 456–461

    Google Scholar 

  16. Lokuciejewski P, Gedikli F, Marwedel P (2009) Accelerating WCET-driven optimizations by the invariant path paradigm—a case study of loop unswitching. In: Proc. of the workshop on software & compilers for embedded systems (SCOPES ’09), pp 11–20

    Google Scholar 

  17. Lupo C, Wilken KD (2006) Post register allocation spill code optimization. In: Proceedings of the international symposium on code generation and optimization, CGO ’06. IEEE, New York, pp 245–255

    Google Scholar 

  18. Nemer F, Cassé H, Sainrat P, Bahsoun JP, Michiel MD (2006) Papabench: A free real-time benchmark. In: Proc. of the Workshop on Worst-Case Execution Time Analysis, OCG, pp 63–68

  19. Puschner PP, Schedl AV (1997) Computing maximum task execution times—a graph-based approach. Real-Time Syst 13(1):67–91

    Article  Google Scholar 

  20. Samples AD (1991) Profile-driven compilation. PhD thesis, University of California at Berkeley

  21. Stappert F, Ermedahl A, Engblom J (2001) Efficient longest executable path search for programs with complex flows and pipeline effects. In: Proc. of the conference on compilers, architecture, and synthesis for embedded systems. ACM, New York, pp 132–140

    Google Scholar 

  22. Tarjan RE (1972) Depth-first search and linear graph algorithms. SIAM J Comput 1(2):146–160

    Article  MATH  MathSciNet  Google Scholar 

  23. Theiling H, Ferdinand C, Wilhelm R (2000) Fast and precise WCET prediction by separated cache and path analyses. Real-Time Syst 18(2/3):157–179

    Article  Google Scholar 

  24. Wimmer C, Mössenböck H (2005) Optimized interval splitting in a linear scan register allocator. In: Proceedings of the international conference on virtual execution environments, VEE ’05. ACM, New York, pp 132–141

    Google Scholar 

Download references

Acknowledgements

We thank Wolfgang Puffitsch for insightful discussions leading up to this work.

Author information

Affiliations

Authors

Corresponding author

Correspondence to Florian Brandner.

Additional information

This work is an extension of the paper “Static Profiling of the Worst-Case in Real-Time Programs” by Brandner et al. (2012). It was partially funded under the European Union’s 7th Framework Program under grant agreement no. 288008: Time-predictable Multi-Core Architecture for Embedded Systems (T-CREST) and was supported by the Austrian Science Fund (FWF) under contract P21842.

Rights and permissions

Reprints and Permissions

About this article

Cite this article

Brandner, F., Hepp, S. & Jordan, A. Criticality: static profiling for real-time programs. Real-Time Syst 50, 377–410 (2014). https://doi.org/10.1007/s11241-013-9196-y

Download citation

Keywords

  • Criticality
  • Worst-case execution time
  • Program profiling