<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic reading power via performance counters in Software Tuning, Performance Optimization &amp; Platform Monitoring</title>
    <link>https://community.intel.com/t5/Software-Tuning-Performance/reading-power-via-performance-counters/m-p/1401882#M8084</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have written a trivial application that reads PMA value of cores in Skylake microarchitectures. I&amp;nbsp; programmed performance counters according to the uncore performance monitoring manual.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Manual link:&amp;nbsp;&lt;A href="https://kib.kiev.ua/x86docs/Intel/PerfMon/336274-001.pdf" target="_blank" rel="noopener"&gt;https://kib.kiev.ua/x86docs/Intel/PerfMon/336274-001.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Relevant page:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="aozcan_0-1658314021006.png" style="width: 400px;"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/31783i2E35C9BCE25D2AF6/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="aozcan_0-1658314021006.png" alt="aozcan_0-1658314021006.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I programmed it so that I would read GV value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/ozcanay/pma_core" target="_blank" rel="noopener"&gt;https://github.com/ozcanay/pma_core&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that code is not portable, it assumes that you have 18 CHAs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can build the code with:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;g++ main.cpp -lpthread&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And then run it with &lt;STRONG&gt;SUDO PRIVILEGES&lt;/STRONG&gt; via:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;sudo ./a.out &amp;lt;INSERT CORE NUMBER HERE&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Example:&lt;/STRONG&gt;&lt;/U&gt; ./a.out 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Application fires up a thread and binds it to core 1 in this case. Before keeping the core busy by incrementing a variable in a tight loop, it reads power value of all CHAs. Power value of all CHAs is read again after the incrementing phase is done. The CHA that has the most difference between before and after power values is expected to be co-located with the core the thread is bound to. This was the overview of the application.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The thing is this code was working correctly 6 months ago. You can see the correct example output in github repo. Now that I tried to run the application again, except for CHA0 and CHA16 I am just reading values of 0 from all CHAs. Before and after values of CHA0 and CHA16 are non-zero but same.&amp;nbsp; So, my question is: Is there any possible reasons that would prevent me from reading power values now?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and best regards.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 20 Jul 2022 10:59:06 GMT</pubDate>
    <dc:creator>aozcan</dc:creator>
    <dc:date>2022-07-20T10:59:06Z</dc:date>
    <item>
      <title>reading power via performance counters</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/reading-power-via-performance-counters/m-p/1401882#M8084</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have written a trivial application that reads PMA value of cores in Skylake microarchitectures. I&amp;nbsp; programmed performance counters according to the uncore performance monitoring manual.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Manual link:&amp;nbsp;&lt;A href="https://kib.kiev.ua/x86docs/Intel/PerfMon/336274-001.pdf" target="_blank" rel="noopener"&gt;https://kib.kiev.ua/x86docs/Intel/PerfMon/336274-001.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Relevant page:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="aozcan_0-1658314021006.png" style="width: 400px;"&gt;&lt;img src="https://community.intel.com/t5/image/serverpage/image-id/31783i2E35C9BCE25D2AF6/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400&amp;amp;whitelist-exif-data=Orientation%2CResolution%2COriginalDefaultFinalSize%2CCopyright" role="button" title="aozcan_0-1658314021006.png" alt="aozcan_0-1658314021006.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I programmed it so that I would read GV value.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/ozcanay/pma_core" target="_blank" rel="noopener"&gt;https://github.com/ozcanay/pma_core&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that code is not portable, it assumes that you have 18 CHAs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can build the code with:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;g++ main.cpp -lpthread&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And then run it with &lt;STRONG&gt;SUDO PRIVILEGES&lt;/STRONG&gt; via:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;sudo ./a.out &amp;lt;INSERT CORE NUMBER HERE&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Example:&lt;/STRONG&gt;&lt;/U&gt; ./a.out 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Application fires up a thread and binds it to core 1 in this case. Before keeping the core busy by incrementing a variable in a tight loop, it reads power value of all CHAs. Power value of all CHAs is read again after the incrementing phase is done. The CHA that has the most difference between before and after power values is expected to be co-located with the core the thread is bound to. This was the overview of the application.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The thing is this code was working correctly 6 months ago. You can see the correct example output in github repo. Now that I tried to run the application again, except for CHA0 and CHA16 I am just reading values of 0 from all CHAs. Before and after values of CHA0 and CHA16 are non-zero but same.&amp;nbsp; So, my question is: Is there any possible reasons that would prevent me from reading power values now?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks and best regards.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2022 10:59:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/reading-power-via-performance-counters/m-p/1401882#M8084</guid>
      <dc:creator>aozcan</dc:creator>
      <dc:date>2022-07-20T10:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: reading power via performance counters</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/reading-power-via-performance-counters/m-p/1402051#M8086</link>
      <description>&lt;P&gt;I don't see anything resembling documentation for the GV sub-event of the CHA CORE_PMA event, so it is hard to tell what it is supposed to mean. The other sub-events are C-state-related, which means that BIOS options can change the behavior.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jul 2022 22:29:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/reading-power-via-performance-counters/m-p/1402051#M8086</guid>
      <dc:creator>McCalpinJohn</dc:creator>
      <dc:date>2022-07-20T22:29:04Z</dc:date>
    </item>
  </channel>
</rss>

