From mboxrd@z Thu Jan 1 00:00:00 1970 From: Manuel Selva Subject: perf tool/perf_event_open and uncore events Date: Wed, 04 Sep 2013 15:52:27 +0200 Message-ID: <52273B1B.4070404@insa-lyon.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mail-bk0-f53.google.com ([209.85.214.53]:54858 "EHLO mail-bk0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932132Ab3IDNw3 (ORCPT ); Wed, 4 Sep 2013 09:52:29 -0400 Received: by mail-bk0-f53.google.com with SMTP id d7so184339bkh.40 for ; Wed, 04 Sep 2013 06:52:28 -0700 (PDT) Sender: linux-perf-users-owner@vger.kernel.org List-ID: To: linux-perf-users@vger.kernel.org Hi all, I am planning to use the perf tool and maybe directly the perf_event_open system call from code to get access to uncore counters . I am working on a dual socket NUMA platform with 2 Intel Xeon X5650 cpus (Westmer-EP familly and 06_2CH cpu number). I started my experiments with the UNC_QMC_NORMAL_READS.ANY counter only. I want to measure memory traffic for each one of my 2 memory controllers. In this context I got the following questions without being able to answer to them: + It seems impossible to have per thread mode with this uncore event. I have to specify the -a or the -C option to the perf tool to get some results. Looking at the perf_event_open system call happening behind the scene, and calling it myself from code, I noticed that the call succeeded only when the pid parameter is -1 and the cpu one is different from -1. I guess that per thread counting is not available for uncore events because it's impossible for the hardware to measure only the uncore events generated by a given thread (because by definition uncore is shared by all the cores associated to it) Am I right ? + How the cpu parameter to perf_event_open should be interpreted for uncore events ? On my platform I have 12 cores (my two cpus are hexa core ones and hyper threading is disabled). Does providing a cpu value of 5 to the system call along with an uncore event means counting the events on the uncore associated to the core 5 ? Thanks for your inputs, -- Manu