From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andi Kleen Subject: Re: perf tool/perf_event_open and uncore events Date: Wed, 04 Sep 2013 12:50:38 -0700 Message-ID: <87wqmwnz75.fsf@tassilo.jf.intel.com> References: <52273B1B.4070404@insa-lyon.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from mga09.intel.com ([134.134.136.24]:62955 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755664Ab3IDTuj (ORCPT ); Wed, 4 Sep 2013 15:50:39 -0400 In-Reply-To: <52273B1B.4070404@insa-lyon.fr> (Manuel Selva's message of "Wed, 04 Sep 2013 15:52:27 +0200") Sender: linux-perf-users-owner@vger.kernel.org List-ID: To: Manuel Selva Cc: linux-perf-users@vger.kernel.org Manuel Selva writes: > > + 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 ? Yes uncore counting is per socket counting. > > + 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 ? Yes, the socket associated with the CPU is used. -Andi -- ak@linux.intel.com -- Speaking for myself only