[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1273568620.30322.42.camel@minggr.sh.intel.com>
Date: Tue, 11 May 2010 17:03:40 +0800
From: Lin Ming <ming.m.lin@...el.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Ingo Molnar <mingo@...e.hu>,
Corey Ashford <cjashfor@...ux.vnet.ibm.com>,
Frederic Weisbecker <fweisbec@...il.com>,
"eranian@...il.com" <eranian@...il.com>,
"Gary.Mohr@...l.com" <Gary.Mohr@...l.com>,
"arjan@...ux.intel.com" <arjan@...ux.intel.com>,
"Zhang, Yanmin" <yanmin_zhang@...ux.intel.com>,
Paul Mackerras <paulus@...ba.org>,
"David S. Miller" <davem@...emloft.net>,
Russell King <rmk+kernel@....linux.org.uk>,
Paul Mundt <lethal@...ux-sh.org>,
lkml <linux-kernel@...r.kernel.org>,
Arnaldo Carvalho de Melo <acme@...hat.com>,
Will Deacon <will.deacon@....com>,
Maynard Johnson <mpjohn@...ibm.com>,
Carl Love <carll@...ibm.com>
Subject: Re: [RFC][PATCH 3/9] perf: export registerred pmus via sysfs
On Tue, 2010-05-11 at 16:50 +0800, Peter Zijlstra wrote:
> On Tue, 2010-05-11 at 16:20 +0800, Lin Ming wrote:
>
> > How will this sysfs interface be used for userspace tool?
> >
> > /sys/devices/system/node/nodeN/node_events
> > node_events/event_source_id
> >
> > node_events/local_misses/event_id
> > /local_hits/event_id
> > /remote_misses/event_id
> > /remote_hits/event_id
> >
> > For example, to monitor node event local_misses on node 0, does it work
> > as below?
> >
> > 1. perf top -e local_misses -n 0 (-n 0 means node 0)
> >
> > 2. read /sys/devices/system/node/node0/node_events/event_source_id to
> > get the pmu_id
> >
> > 3. read /sys/devices/system/node/node0/node_events/local_misses/event_id
> > to get the event_id
> >
> > 4. event_attr::pmu_id=pmu_id, event::config=event_id
> >
> > 5. other setting...
> >
> > 6. call syscall perf_event_open(....)
>
> No, you'll use event_source_id as perf_event_attr::type, use event_id as
> perf_event_attr::config and then use a cpu-wide counter on a cpu
> contained in node0.
Is event_source_id a link to event_source class?
For example, 2 event sources on Nehalem
/sys/class/event_sources/core_pmu
/sys/class/event_sources/uncore_pmu
Then,
/sys/devices/system/node/nodeN/node_events/event_source_id is a link
to /sys/class/event_sources/uncore_pmu.
/sys/devices/system/cpu/cpuN/cpu_hardware_events/event_source_id is a
link to /sys/class/event_sources/core_pmu.
And, the event_source_id
#cat /sys/class/event_sources/core_pmu
0
#cat /sys/class/event_sources/uncore_pmu
1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists