linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Multi-PMU groups with the perf tool
@ 2015-09-08 14:30 Pawel Moll
  2016-03-01 17:22 ` Pawel Moll
  0 siblings, 1 reply; 2+ messages in thread
From: Pawel Moll @ 2015-09-08 14:30 UTC (permalink / raw)
  To: linux-perf-users

Greetings,

I've been recently asked about using "uncore-like" PMUs with "perf
record" command. The issue is that those PMUs are generally
non-sampling, so one can not simply do

# perf record -a -e ccn/cycles/,ccn/xp_valid_flit,xp=1,port=0,vc=1,dir=1/ sleep 1

as the event_init function will return -EINVAL. In most cases, stat
provides a valid equivalent:

# perf stat -a -e ccn/cycles/,ccn/xp_valid_flit,xp=1,port=0,vc=1,dir=1/ sleep 1 

providing diff between counter values "before" and "after", but what if
you're looking at something more complex than "sleep 1" and you want to
observe memory system behaviour over time? Of course no one expects the
samples to be correlated with a particular PC, but sampling and
visualising the data with, say, 1ms period can be useful for certain use
cases.

My initial answer was: create a group with a 1ms cpu-clock (so hrtimer)
as a leader and, with PERF_SAMPLE_READ, attach "uncore" children to it.
That way, you'll get uncore counters read every ms.

I know that this works from the kernel point of view, because my custom
tool does exactly this, but I wanted to provide an example using the
standard perf tool (the user, obviously, already had it). So I spent
some time trying to create such a group with the perf tool and, after
going as far as reading the code :-) must admit defeat. What I would
like to do is something along the lines of (with the parenthesis group
syntax being just a product of my imagination ;-)

# perf record -F 1000 -a \
	-e cpu-clock(ccn/cycles/,ccn/xp_valid_flit,xp=1,port=0,vc=1,dir=1/) \
	sleep 1 

Have I missed something (very likely, given the number of
"not-really-obvious" features of the tool ;-), or is there no way of
creating such a custom group with the perf tool today? It's not a
critique, merely a question.

Cheers!

Pawel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-01 17:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-08 14:30 Multi-PMU groups with the perf tool Pawel Moll
2016-03-01 17:22 ` Pawel Moll

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).