<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/tools/perf/util/evsel.h, branch linux-3.3.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.3.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.3.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2011-11-28T19:57:40Z</updated>
<entry>
<title>perf tools: Save some loops using perf_evlist__id2evsel</title>
<updated>2011-11-28T19:57:40Z</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
</author>
<published>2011-11-28T19:57:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ee29be625bd7b115d45eba4b0526ff3e24bf3ca0'/>
<id>urn:sha1:ee29be625bd7b115d45eba4b0526ff3e24bf3ca0</id>
<content type='text'>
Since we already ask for PERF_SAMPLE_ID and use it to quickly find the
associated evsel, add handler func + data to struct perf_evsel to avoid
using chains of if(strcmp(event_name)) and also to avoid all the linear
list searches via trace_event_find.

To demonstrate the technique convert 'perf sched' to it:

 # perf sched record sleep 5m

And then:

 Performance counter stats for '/tmp/oldperf sched lat':

        646.929438 task-clock                #    0.999 CPUs utilized
                 9 context-switches          #    0.000 M/sec
                 0 CPU-migrations            #    0.000 M/sec
            20,901 page-faults               #    0.032 M/sec
     1,290,144,450 cycles                    #    1.994 GHz
   &lt;not supported&gt; stalled-cycles-frontend
   &lt;not supported&gt; stalled-cycles-backend
     1,606,158,439 instructions              #    1.24  insns per cycle
       339,088,395 branches                  #  524.151 M/sec
         4,550,735 branch-misses             #    1.34% of all branches

       0.647524759 seconds time elapsed

Versus:

 Performance counter stats for 'perf sched lat':

        473.564691 task-clock                #    0.999 CPUs utilized
                 9 context-switches          #    0.000 M/sec
                 0 CPU-migrations            #    0.000 M/sec
            20,903 page-faults               #    0.044 M/sec
       944,367,984 cycles                    #    1.994 GHz
   &lt;not supported&gt; stalled-cycles-frontend
   &lt;not supported&gt; stalled-cycles-backend
     1,442,385,571 instructions              #    1.53  insns per cycle
       308,383,106 branches                  #  651.195 M/sec
         4,481,784 branch-misses             #    1.45% of all branches

       0.474215751 seconds time elapsed

[root@emilia ~]#

Cc: David Ahern &lt;dsahern@gmail.com&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Mike Galbraith &lt;efault@gmx.de&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
Link: http://lkml.kernel.org/n/tip-1kbzpl74lwi6lavpqke2u2p3@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf evsel: Introduce config attr method</title>
<updated>2011-11-28T12:25:31Z</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
</author>
<published>2011-11-08T16:41:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0f82ebc452f921590e216b28eee0b41f5e434a48'/>
<id>urn:sha1:0f82ebc452f921590e216b28eee0b41f5e434a48</id>
<content type='text'>
Out of the code in 'perf record', so that we can share option parsing,
etc. Eventually will be used by 'perf top', but first 'trace' will use
it.

Cc: David Ahern &lt;dsahern@gmail.com&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Mike Galbraith &lt;efault@gmx.de&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
Link: http://lkml.kernel.org/n/tip-hzjqsgnte1esk90ytq0ap98v@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf evlist: Fix grouping of multiple events</title>
<updated>2011-10-26T12:25:02Z</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
</author>
<published>2011-10-25T12:42:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=727ab04edbc4767711a7aeff5e00249b267ed4c1'/>
<id>urn:sha1:727ab04edbc4767711a7aeff5e00249b267ed4c1</id>
<content type='text'>
The __perf_evsel__open routing was grouping just the threads for that
specific events per cpu when we want to group all threads in all events
to the first fd opened on that cpu.

So pass the xyarray with the first event, where the other events will be
able to get that first per cpu fd.

At some point top and record will switch to using perf_evlist__open that
takes care of this detail and probably will also handle the fallback
from hw to soft counters, etc.

Reported-by: Deng-Cheng Zhu &lt;dczhu@mips.com&gt;
Tested-by: Deng-Cheng Zhu &lt;dczhu@mips.com&gt;
Cc: David Ahern &lt;dsahern@gmail.com&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Mike Galbraith &lt;efault@gmx.de&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
Link: http://lkml.kernel.org/n/tip-ebm34rh098i9y9v4cytfdp0x@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf stat: clarify unsupported events from uncounted events</title>
<updated>2011-06-02T16:26:15Z</updated>
<author>
<name>David Ahern</name>
</author>
<published>2011-05-30T14:55:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2cee77c4505fc581f41b44e18ffc0953b67a414c'/>
<id>urn:sha1:2cee77c4505fc581f41b44e18ffc0953b67a414c</id>
<content type='text'>
perf stat continues running even if the event list contains counters
that are not supported. The resulting output then contains &lt;not counted&gt;
for those events which gets confusing as to which events are supported,
but not counted and which are not supported.

Before:

perf stat -ddd -- sleep 1

      Performance counter stats for 'sleep 1':

          0.571283 task-clock                #    0.001 CPUs utilized
                 1 context-switches          #    0.002 M/sec
                 0 CPU-migrations            #    0.000 M/sec
               157 page-faults               #    0.275 M/sec
         1,037,707 cycles                    #    1.816 GHz
     &lt;not counted&gt; stalled-cycles-frontend
     &lt;not counted&gt; stalled-cycles-backend
           654,499 instructions              #    0.63  insns per cycle
           136,129 branches                  #  238.286 M/sec
     &lt;not counted&gt; branch-misses
     &lt;not counted&gt; L1-dcache-loads
     &lt;not counted&gt; L1-dcache-load-misses
     &lt;not counted&gt; LLC-loads
     &lt;not counted&gt; LLC-load-misses
     &lt;not counted&gt; L1-icache-loads
     &lt;not counted&gt; L1-icache-load-misses
     &lt;not counted&gt; dTLB-loads
     &lt;not counted&gt; dTLB-load-misses
     &lt;not counted&gt; iTLB-loads
     &lt;not counted&gt; iTLB-load-misses
     &lt;not counted&gt; L1-dcache-prefetches
     &lt;not counted&gt; L1-dcache-prefetch-misses

       1.001004836 seconds time elapsed

After:

perf stat -ddd -- sleep 1

 Performance counter stats for 'sleep 1':

          1.350326 task-clock                #    0.001 CPUs utilized
                 2 context-switches          #    0.001 M/sec
                 0 CPU-migrations            #    0.000 M/sec
               157 page-faults               #    0.116 M/sec
            11,986 cycles                    #    0.009 GHz
   &lt;not supported&gt; stalled-cycles-frontend
   &lt;not supported&gt; stalled-cycles-backend
           496,986 instructions              #   41.46  insns per cycle
           138,065 branches                  #  102.246 M/sec
             7,245 branch-misses             #    5.25% of all branches
     &lt;not counted&gt; L1-dcache-loads
     &lt;not counted&gt; L1-dcache-load-misses
     &lt;not counted&gt; LLC-loads
     &lt;not counted&gt; LLC-load-misses
     &lt;not counted&gt; L1-icache-loads
     &lt;not counted&gt; L1-icache-load-misses
     &lt;not counted&gt; dTLB-loads
     &lt;not counted&gt; dTLB-load-misses
     &lt;not counted&gt; iTLB-loads
     &lt;not counted&gt; iTLB-load-misses
     &lt;not counted&gt; L1-dcache-prefetches
   &lt;not supported&gt; L1-dcache-prefetch-misses

       1.002397333 seconds time elapsed

v1-&gt;v2:
changed supported type from int to bool

v2-&gt;v3
fixed vertical alignment of new struct element

Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: http://lkml.kernel.org/r/1306767359-13221-1-git-send-email-dsahern@gmail.com
Signed-off-by: David Ahern &lt;dsahern@gmail.com&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf evlist: Don't die if sample_{id_all|type} is invalid</title>
<updated>2011-06-02T14:04:54Z</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
</author>
<published>2011-06-02T14:04:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c2a70653af45c9cbb0cab900e8931b062e57b1ae'/>
<id>urn:sha1:c2a70653af45c9cbb0cab900e8931b062e57b1ae</id>
<content type='text'>
Fixes two more cases where the python binding would not load:

. Not finding die(), which it shouldn't anyway, not good to just stop the
  world because some particular perf.data file is invalid, just propagate
  the error to the caller.

. Not finding perf_sample_size: fix it by moving it from event.c to evsel,
  where it belongs, as most cases are moving to operate on an evsel object.o

One of the fixed problems:

[root@emilia ~]# python
&gt;&gt;&gt; import perf
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
ImportError: /home/acme/git/build/perf/python/perf.so: undefined symbol: perf_sample_size
&gt;&gt;&gt;
[root@emilia ~]#

Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Mike Galbraith &lt;efault@gmx.de&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
Link: http://lkml.kernel.org/n/tip-1hkj7b2cvgbfnoizsekjb6c9@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf evsel: Fix use of inherit</title>
<updated>2011-04-15T15:52:28Z</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
</author>
<published>2011-04-14T14:20:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5d2cd90922c778908bd0cd669e572a5b5eafd737'/>
<id>urn:sha1:5d2cd90922c778908bd0cd669e572a5b5eafd737</id>
<content type='text'>
perf stat doesn't mmap and its perfectly fine for it to use task-bound
counters with inheritance.

So set the attr.inherit on the caller and leave the syscall itself to
validate it.

When the mmap fails perf_evlist__mmap will just emit a warning if this
is the failure reason.

Reported-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Acked-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Mike Galbraith &lt;efault@gmx.de&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
Cc: Tom Zanussi &lt;tzanussi@gmail.com&gt;
Link: http://lkml.kernel.org/r/20110414170121.GC3229@ghostprotocols.net
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf session: Use evlist/evsel for managing perf.data attributes</title>
<updated>2011-03-10T14:15:54Z</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
</author>
<published>2011-03-10T14:15:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a91e5431d54f5359fccb5ec2512f252eb217707e'/>
<id>urn:sha1:a91e5431d54f5359fccb5ec2512f252eb217707e</id>
<content type='text'>
So that we can reuse things like the id to attr lookup routine
(perf_evlist__id2evsel) that uses a hash table instead of the linear
lookup done in the older perf_header_attr routines, etc.

Also to make evsels/evlist more pervasive an API, simplyfing using the
emerging perf lib.

cc: Arun Sharma &lt;arun@sharma-home.net&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Mike Galbraith &lt;efault@gmx.de&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
Cc: Tom Zanussi &lt;tzanussi@gmail.com&gt;
LKML-Reference: &lt;new-submission&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf tools: Improve support for sessions with multiple events</title>
<updated>2011-03-06T16:13:40Z</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
</author>
<published>2011-03-06T00:40:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e248de331a452f8771eda6ed4bb30d92c82df28b'/>
<id>urn:sha1:e248de331a452f8771eda6ed4bb30d92c82df28b</id>
<content type='text'>
By creating an perf_evlist out of the attributes in the perf.data file
header, so that we can use evlists and evsels when reading recorded
sessions in addition to when we record sessions.

More work is needed to allow tools to allow the user to select which
events are wanted when browsing sessions, be it just one or a subset of
them, aggregated or showed at the same time but with different
indications on the UI to allow seeing workloads thru different views at
the same time.

But the overall goal/trend is to more uniformly use evsels and evlists.

Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Mike Galbraith &lt;efault@gmx.de&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
Cc: Tom Zanussi &lt;tzanussi@gmail.com&gt;
LKML-Reference: &lt;new-submission&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf: make perf stat print user provided full event names</title>
<updated>2011-02-17T12:29:19Z</updated>
<author>
<name>Stephane Eranian</name>
</author>
<published>2011-02-16T13:10:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f0c55bcf4aa41b4b1dbee826513b1acb01bf65e1'/>
<id>urn:sha1:f0c55bcf4aa41b4b1dbee826513b1acb01bf65e1</id>
<content type='text'>
This patch changes the way perf stat prints event names at the end of a
run. Until now, it was trying to reconstruct the event name from its
encoding. The problem is that it would only print generic events without
their modifiers (u, k, pp).

This patch saves the event name as passed by the user in the evsel
struct and uses it to print the final event name.

This would also work in case perf is linked with a library (such as
libpfm4) which provides full PMU event tables.

$ perf stat -e cycles:u,cycles:k date
Wed Feb 16 14:58:52 CET 2011

 Performance counter stats for 'date':

            568600 cycles:u
           2779715 cycles:k

        0.001908182  seconds time elapsed

Cc: Arun Sharma &lt;arun@sharma-home.net&gt;
Cc: David S. Miller &lt;davem@davemloft.net&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Robert Richter &lt;robert.richter@amd.com&gt;
Cc: Stephane Eranian &lt;eranian@gmail.com&gt;
LPU-Reference: &lt;4d5bdc64.98a1df0a.7aa3.06c2@mx.google.com&gt;
Signed-off-by: Stephane Eranian &lt;eranian@google.com&gt;
[ committer note: Fixed a merge problem with 023695d "Add cgroup support" ]
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf tool: Add cgroup support</title>
<updated>2011-02-16T12:30:48Z</updated>
<author>
<name>Stephane Eranian</name>
</author>
<published>2011-02-14T09:20:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=023695d96ee06f36cf5014e286edcd623e9fb847'/>
<id>urn:sha1:023695d96ee06f36cf5014e286edcd623e9fb847</id>
<content type='text'>
This patch adds the ability to filter monitoring based on container groups
(cgroups) for both perf stat and perf record. It is possible to monitor
multiple cgroup in parallel. There is one cgroup per event. The cgroups to
monitor are passed via a new -G option followed by a comma separated list of
cgroup names.

The cgroup filesystem has to be mounted. Given a cgroup name, the perf tool
finds the corresponding directory in the cgroup filesystem and opens it. It
then passes that file descriptor to the kernel.

Example:

$ perf stat -B -a -e cycles:u,cycles:u,cycles:u -G test1,,test2 -- sleep 1
 Performance counter stats for 'sleep 1':

      2,368,667,414  cycles                   test1
      2,369,661,459  cycles
      &lt;not counted&gt;  cycles                   test2

        1.001856890  seconds time elapsed

Signed-off-by: Stephane Eranian &lt;eranian@google.com&gt;
Signed-off-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
LKML-Reference: &lt;4d590290.825bdf0a.7d0a.4890@mx.google.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
</feed>
