<?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 I have solved this! Thanks! in Software Tuning, Performance Optimization &amp; Platform Monitoring</title>
    <link>https://community.intel.com/t5/Software-Tuning-Performance/How-to-use-perf-event-open-function-exposed-by-linux-kernel-to/m-p/1048562#M4770</link>
    <description>&lt;P&gt;I have solved this! Thanks!&lt;/P&gt;</description>
    <pubDate>Fri, 06 Nov 2015 00:27:19 GMT</pubDate>
    <dc:creator>LY</dc:creator>
    <dc:date>2015-11-06T00:27:19Z</dc:date>
    <item>
      <title>How to use perf_event_open() function exposed by linux kernel to obtain "Intel Iyy Bridge-EP IMC0-7 uncore" events</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/How-to-use-perf-event-open-function-exposed-by-linux-kernel-to/m-p/1048559#M4767</link>
      <description>&lt;P&gt;Dear All,&lt;/P&gt;

&lt;P&gt;I wanna use perf_event_open function to get the&amp;nbsp;iMC Performance Monitoring Events, but I don't know how to set up the parameters. I tried to set up it but the result I get is inconsistent with the results obtained by perf commands. The function is&amp;nbsp;&lt;/P&gt;

&lt;PRE style="margin-left: 8px; font-family: monospace, courier; color: rgb(24, 24, 24); font-size: 16px;"&gt;&lt;B style="color: rgb(80, 32, 0);"&gt;int perf_event_open(struct perf_event_attr *&lt;/B&gt;&lt;I style="color: rgb(0, 96, 0);"&gt;attr&lt;/I&gt;&lt;B style="color: rgb(80, 32, 0);"&gt;,&lt;/B&gt;
                           &lt;B style="color: rgb(80, 32, 0);"&gt;pid_t &lt;/B&gt;&lt;I style="color: rgb(0, 96, 0);"&gt;pid&lt;/I&gt;&lt;B style="color: rgb(80, 32, 0);"&gt;, int &lt;/B&gt;&lt;I style="color: rgb(0, 96, 0);"&gt;cpu&lt;/I&gt;&lt;B style="color: rgb(80, 32, 0);"&gt;, int &lt;/B&gt;&lt;I style="color: rgb(0, 96, 0);"&gt;group_fd&lt;/I&gt;&lt;B style="color: rgb(80, 32, 0);"&gt;,&lt;/B&gt;
                           &lt;B style="color: rgb(80, 32, 0);"&gt;unsigned long &lt;/B&gt;&lt;I style="color: rgb(0, 96, 0);"&gt;flags&lt;/I&gt;&lt;B style="color: rgb(80, 32, 0);"&gt;);&lt;/B&gt;&lt;/PRE&gt;

&lt;P&gt;For this event&lt;/P&gt;

&lt;P&gt;-&amp;nbsp;CAS_COUNT&lt;BR /&gt;
	• Title: DRAM RD_CAS and WR_CAS Commands.&lt;/P&gt;

&lt;P&gt;• Category: PRE Events&lt;/P&gt;

&lt;P&gt;• Event Code: 0x04&lt;/P&gt;

&lt;P&gt;• Max. Inc/Cyc:. 1, Register Restrictions: 0-3&lt;/P&gt;

&lt;P&gt;• Definition: DRAM RD_CAS and WR_CAS Commands&lt;/P&gt;

&lt;P&gt;I wanna evaluate the subevents RD and WR which umask is 0x03 and 0x0c. But what I know is this is socket-level event monitoring. However, in perf_event_open's parameters, there is no way to set up cpumask for socket-level monitoring (just per-cpu monitoring maybe). Have someone come across the same problems with me? I didn't find useful parameters in perf_event_attr to set up socket-level monitoring.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2015 03:11:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/How-to-use-perf-event-open-function-exposed-by-linux-kernel-to/m-p/1048559#M4767</guid>
      <dc:creator>LY</dc:creator>
      <dc:date>2015-11-05T03:11:46Z</dc:date>
    </item>
    <item>
      <title>Hi Lingyan,</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/How-to-use-perf-event-open-function-exposed-by-linux-kernel-to/m-p/1048560#M4768</link>
      <description>&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Hi Lingyan,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;To understand how perf tool programs iMC events collection over perf_event_open system call you may run this command:&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px; line-height: 15.6096px;"&gt;perf stat -vv -a -e mem_loads,mem_stores&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px; line-height: 15.6096px;"&gt;It will give you detailed content of perf_event_attr structutres and how they are mapped to CPUs.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px; line-height: 15.6096px;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 13.008px; line-height: 15.6096px;"&gt;Alexey&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2015 06:30:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/How-to-use-perf-event-open-function-exposed-by-linux-kernel-to/m-p/1048560#M4768</guid>
      <dc:creator>Alexey_B_Intel</dc:creator>
      <dc:date>2015-11-05T06:30:59Z</dc:date>
    </item>
    <item>
      <title>AMAZING!!! I just found I was</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/How-to-use-perf-event-open-function-exposed-by-linux-kernel-to/m-p/1048561#M4769</link>
      <description>&lt;P&gt;AMAZING!!! I just found I was one step away from this! Very useful!&lt;/P&gt;

&lt;P&gt;But here is another thing. since the read_format is 0x03, so how do I read it? The result I read using&amp;nbsp;&lt;/P&gt;

&lt;P&gt;ioctl(fds&lt;I&gt;&lt;J&gt;, PERF_EVENT_IOC_ENABLE, &lt;SPAN style="font-variant-ligatures: no-common-ligatures; color: #ce7924"&gt;0&lt;/SPAN&gt;);&lt;/J&gt;&lt;/I&gt;&lt;/P&gt;

&lt;P&gt;ret = read(fds&lt;I&gt;&lt;J&gt;, val, sz);&lt;/J&gt;&lt;/I&gt;&lt;/P&gt;

&lt;P&gt;is odd. ret is 24 meaning it has three uint64_t numbers. The first one is 0, the two left are equal to each other. Could you please tell me how to read the counters?&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Alexey Budankov (Intel) wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Hi Lingyan,&lt;/P&gt;

&lt;P&gt;To understand how perf tool programs iMC events collection over perf_event_open system call you may run this command:&lt;/P&gt;

&lt;P&gt;perf stat -vv -a -e mem_loads,mem_stores&lt;/P&gt;

&lt;P&gt;It will give you detailed content of perf_event_attr structutres and how they are mapped to CPUs.&lt;/P&gt;

&lt;P&gt;Regards,&lt;/P&gt;

&lt;P&gt;Alexey&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Nov 2015 07:45:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/How-to-use-perf-event-open-function-exposed-by-linux-kernel-to/m-p/1048561#M4769</guid>
      <dc:creator>LY</dc:creator>
      <dc:date>2015-11-05T07:45:02Z</dc:date>
    </item>
    <item>
      <title>I have solved this! Thanks!</title>
      <link>https://community.intel.com/t5/Software-Tuning-Performance/How-to-use-perf-event-open-function-exposed-by-linux-kernel-to/m-p/1048562#M4770</link>
      <description>&lt;P&gt;I have solved this! Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 06 Nov 2015 00:27:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Tuning-Performance/How-to-use-perf-event-open-function-exposed-by-linux-kernel-to/m-p/1048562#M4770</guid>
      <dc:creator>LY</dc:creator>
      <dc:date>2015-11-06T00:27:19Z</dc:date>
    </item>
  </channel>
</rss>

