From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751512AbZHHQKY (ORCPT ); Sat, 8 Aug 2009 12:10:24 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751072AbZHHQKX (ORCPT ); Sat, 8 Aug 2009 12:10:23 -0400 Received: from mail4-relais-sop.national.inria.fr ([192.134.164.105]:22884 "EHLO mail4-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750833AbZHHQKX (ORCPT ); Sat, 8 Aug 2009 12:10:23 -0400 X-IronPort-AV: E=Sophos;i="4.43,346,1246831200"; d="scan'208";a="44473557" Message-ID: <4A7DA37A.9010202@inria.fr> Date: Sat, 08 Aug 2009 18:10:34 +0200 From: Brice Goglin User-Agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: Ingo Molnar CC: =?ISO-8859-1?Q?Fr=E9d=E9ric_Weisbecker?= , Mike Galbraith , Arnaldo Carvalho de Melo , Peter Zijlstra , paulus@samba.org, LKML Subject: Re: [PATCH] perf report: Display per-thread event counters References: <20090629192913.GA29295@elte.hu> <4A7B0C02.7060704@inria.fr> <1249580428.4975.14.camel@laptop> <4A7B175B.8030000@inria.fr> <1249585061.4975.17.camel@laptop> <4A7B28EA.20903@inria.fr> <20090806195924.GA22411@elte.hu> <4A7B68C3.7040706@inria.fr> <20090807063226.GA29532@elte.hu> <4A7C162C.1030707@inria.fr> <20090808121456.GA14671@elte.hu> In-Reply-To: <20090808121456.GA14671@elte.hu> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ingo Molnar wrote: >> [...] But I don't see yet where I am suppose to get something like >> PERF_READ_EVENT in builtin-stat.c so I haven't touched it yet. >> > > Yeah. 'perf stat' is not really getting events but is doing a > read-out of the counter value(s) and constructs its 'read event' > that way. So you wont find PERF_READ_EVENT in builtin-stat.c, you'll > find: > > res = read(fd[cpu][counter], single_count, nv * sizeof(u64)); > > in read_counter(). The printout is then done in print_counter(). > Is there a way to get per-thread counters there? I wrote the code to gather per-cpu counters there, but I don't see any way to get the corresponding thread-id. I looked at perf record to get some help. But I don't see where the PERF_EVENT_READ are generated. I guess they are directly generated by the kernel, read by perf record, and written as is to the output file? thanks, Brice