{"id":126,"date":"2023-12-25T04:20:32","date_gmt":"2023-12-25T04:20:32","guid":{"rendered":"https:\/\/mvermeulen.org\/perf\/?p=126"},"modified":"2023-12-25T04:20:33","modified_gmt":"2023-12-25T04:20:33","slug":"potential-interface-and-potential-counter-groups-for-topdown-tool","status":"publish","type":"post","link":"https:\/\/mvermeulen.org\/perf\/2023\/12\/25\/potential-interface-and-potential-counter-groups-for-topdown-tool\/","title":{"rendered":"Potential interface and potential counter groups for topdown tool"},"content":{"rendered":"\n<p>I have looked through the <a href=\"https:\/\/www.amd.com\/content\/dam\/amd\/en\/documents\/processor-tech-docs\/programmer-references\/57019-A0-PUB_3_00.zip\">Family 19h PPR reference<\/a>, output from &#8220;perf list -v &#8211;detail&#8221; and also some <a href=\"https:\/\/github.com\/RRZE-HPC\/likwid\/tree\/master\/groups\/zen4\">likwid counter groups<\/a> to figure out combinations of counters I might be able to add as instrumentation options for a topdown command.  Based on these, I have a potential combination of options to consider and a mocked up usage model as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.\/topdown: invalid option -- '?'\nwarning: unknown option: ?\nfatal error: usage: .\/topdown -&#91;abcistv]&#91;-o &lt;file>] &lt;cmd>&lt;args>...\n\t--per-core or -a          - metrics per core\n\t--rusage or -r            - show getrusage(2) information\n\t--tree                    - print process tree\n\t-o &lt;file>                 - send output to file\n\t--csv                     - create csv output\n\t--verbose or -v           - print verbose information\n\n\t--software or -s          - software counters\n\t--ipc or i                - IPC counters\n\t--branch or -b            - branch counters\n\t--dcache                  - L1 dcache counters\n\t--icache                  - L1 icache counters\n\t--cache2 or -c            - L2 cache counters\n\t--cache3                  - L3 cache counters\n\t--memory                  - memory counters\n\t--opcache                 - opcache counters\n\t--tlb                     - TLB counters\n\t--topdown or -t           - topdown counters, level 1\n\t--topdown2                - topdown counters, level 2<\/code><\/pre>\n\n\n\n<p>The first section is more generic control, e.g. CSV vs tabular, redirected to a file, all cores together vs. core by core, etc.  The section below that are all various combinations of performance counters (typically five or less so we don&#8217;t need to multiplex just that option.  These include the software, topdown and ipc metrics I&#8217;ve already implemented and then the following examples:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>branch miss rate and frequency branches occur<\/li>\n\n\n\n<li>dcache &#8211; L1 data cache rates and miss percentage<\/li>\n\n\n\n<li>icache &#8211; L1 icache rates and misses<\/li>\n\n\n\n<li>cache2 &#8211; L2 cache rates and misses<\/li>\n\n\n\n<li>cache3 &#8211; L3 cache rates and misses<\/li>\n\n\n\n<li>opcache &#8211; op cache rates and misses<\/li>\n\n\n\n<li>memory &#8211; memory bandwidth counters<\/li>\n\n\n\n<li>tlb &#8211; TLB misses for both ITLB and DTLB<\/li>\n\n\n\n<li>topdown &#8211; topdown level 1 metrics &#8211; standardized with Intel and AMD into &lt;retiring, frontend, backend and bad-speculation>; this means taking the smt-contention out of the calculation on AMD<\/li>\n\n\n\n<li>topdown2 &#8211; topdown level 2 metrics; bring back SMT contention and then go the next level: frontend bandwith vs. latency, backend cpu vs. memory, speculation mispredict vs. machine clears and retiring heavy ops vs light ops.<\/li>\n<\/ul>\n\n\n\n<p>This now gives me a set to slowly look at implementing and adding to the topdown tool.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have looked through the Family 19h PPR reference, output from &#8220;perf list -v &#8211;detail&#8221; and also some likwid counter groups to figure out combinations of counters I might be able to add as instrumentation options for a topdown command. <span class=\"excerpt-dots\">&hellip;<\/span> <a class=\"more-link\" href=\"https:\/\/mvermeulen.org\/perf\/2023\/12\/25\/potential-interface-and-potential-counter-groups-for-topdown-tool\/\"><span class=\"more-msg\">Continue reading &rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[7,8],"class_list":["post-126","post","type-post","status-publish","format-standard","hentry","category-tools","tag-performance-counters","tag-topdown"],"_links":{"self":[{"href":"https:\/\/mvermeulen.org\/perf\/wp-json\/wp\/v2\/posts\/126","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mvermeulen.org\/perf\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mvermeulen.org\/perf\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mvermeulen.org\/perf\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mvermeulen.org\/perf\/wp-json\/wp\/v2\/comments?post=126"}],"version-history":[{"count":1,"href":"https:\/\/mvermeulen.org\/perf\/wp-json\/wp\/v2\/posts\/126\/revisions"}],"predecessor-version":[{"id":127,"href":"https:\/\/mvermeulen.org\/perf\/wp-json\/wp\/v2\/posts\/126\/revisions\/127"}],"wp:attachment":[{"href":"https:\/\/mvermeulen.org\/perf\/wp-json\/wp\/v2\/media?parent=126"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mvermeulen.org\/perf\/wp-json\/wp\/v2\/categories?post=126"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mvermeulen.org\/perf\/wp-json\/wp\/v2\/tags?post=126"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}