5 ms·
Both static and dynamic histograms can be pretty important, actually. Dynamic ones for performance, static ones -- usually for correctness (imagine developing a
by s_kanev 10y ago
Both static and dynamic histograms can be pretty important, actually. Dynamic ones for performance, static ones -- usually for correctness (imagine developing a tool just like QEMU, which needs to emulate each instruction type).
Performance counters by themselves aren't granular enough for an exact histogram. But you can use them (especially the LBR[1] and the fancy new PT[2]) to reconstruct an approximate control-flow graph, and with a bit of post-processing it's easy to get per-instruction call frequencies.
A long time ago, I wrote a paper on x86 trace compression that needed a dynamic histogram like the one you mentioned. As expected, the CDF rises very very fast [3, Fig. 5] -- you can cover a very large fraction of execution with a very small number of instructions.
[1] http://lwn.net/Articles/680996/ http://lwn.net/Articles/680996/
[2] http://www.halobates.de/pt-tracing-summit15.pdf http://www.halobates.de/pt-tracing-summit15.pdf
[3] http://skanev.org/papers/ispass11zcompr.pdf http://skanev.org/papers/ispass11zcompr.pdf