<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/tools/perf/builtin-test.c, 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>2012-01-08T15:25:00Z</updated>
<entry>
<title>perf test: Change type of '-v' option to INCR</title>
<updated>2012-01-08T15:25:00Z</updated>
<author>
<name>Namhyung Kim</name>
</author>
<published>2012-01-07T17:25:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c30ab8aa084843159b4679e9a3d7f63187d5906a'/>
<id>urn:sha1:c30ab8aa084843159b4679e9a3d7f63187d5906a</id>
<content type='text'>
The '-v' option is usually defined via OPT_INCR not _INTEGER.  Follow
the trend :).

Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Link: http://lkml.kernel.org/r/1325957132-10600-2-git-send-email-namhyung@gmail.com
Signed-off-by: Namhyung Kim &lt;namhyung@gmail.com&gt;
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf test: Add more automated tests for event parsing</title>
<updated>2011-12-20T16:46:14Z</updated>
<author>
<name>Jiri Olsa</name>
</author>
<published>2011-12-15T15:30:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=65c1e0452a3389f9b7b8c1b23305ed2922fafb2d'/>
<id>urn:sha1:65c1e0452a3389f9b7b8c1b23305ed2922fafb2d</id>
<content type='text'>
Adding automated tests for event parsing to include testing for modifier
and ',' operator.

Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: cjashfor@linux.vnet.ibm.com
Link: http://lkml.kernel.org/r/1323963039-7602-4-git-send-email-jolsa@redhat.com
Signed-off-by: Jiri Olsa &lt;jolsa@redhat.com&gt;
[ committer note: Remove some tests that need group_leader &amp; bison patchkits ]
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf test: Soft errors shouldn't stop the "Validate PERF_RECORD_" test</title>
<updated>2011-12-02T16:00:04Z</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
</author>
<published>2011-12-02T15:53:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f71c49e5e985897850406a152ab99001cfb86f2a'/>
<id>urn:sha1:f71c49e5e985897850406a152ab99001cfb86f2a</id>
<content type='text'>
For errors that don't preclude checking for further errors, aka "soft"
errors, just  continue testing for other errors.

Better coverage in verbose mode.

Suggested-by: David Ahern &lt;dsahern@gmail.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-jafcokbj26m845dsgm2hx6az@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf test: Validate PERF_RECORD_ events and perf_sample fields</title>
<updated>2011-12-02T13:13:50Z</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
</author>
<published>2011-12-02T13:13:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3e7c439a7ce537ed662e347b9e6414d7881fb3dc'/>
<id>urn:sha1:3e7c439a7ce537ed662e347b9e6414d7881fb3dc</id>
<content type='text'>
This new test will validate these new routines extracted from 'perf
record':

 - perf_evlist__config_attrs
 - perf_evlist__prepare_workload
 - perf_evlist__start_workload

In addition to several other perf_evlist methods.

It consists of starting a simple workload, setting up just one event to
monitor ("cycles") requesting that several PERF_SAMPLE_ fields be
present in all events.

It then will check that the expected PERF_RECORD_ events are produced
and will sanity check all its fields.

Some checks performed:

. PERF_SAMPLE_TIME monotonically increases.

. PERF_SAMPLE_CPU is the one requested with sched_setaffinity

. PERF_SAMPLE_TID and PERF_SAMPLE_PID matches the one we forked
  in perf_evlist__prepare_workload and that is stored in
  evlist-&gt;workload.pid

. For the events where these fields are also present in its
  pre-sample_id_all fields (e.g. event-&gt;mmap.pid), that they are what
  is expected too.

. That we get a bunch of mmaps:

  PATH/libcSUFFIX
  PATH/ldSUFFIX
  [vdso]
  PATH/sleep

Example:

  [root@emilia ~]# taskset -c 3,4 perf test -v1 perf_sample
   6: Validate PERF_RECORD_* events &amp; perf_sample fields:
  --- start ---
  7159480799825 3 PERF_RECORD_SAMPLE
  7159480805584 3 PERF_RECORD_SAMPLE
  7159480807814 3 PERF_RECORD_SAMPLE
  7159480810430 3 PERF_RECORD_SAMPLE
  7159480861511 3 PERF_RECORD_MMAP 8086/8086: [0x7fffffffd000(0x2000) @ 0x7fffffffd000]: //anon
  7159481052516 3 PERF_RECORD_COMM: sleep:8086
  7159481070188 3 PERF_RECORD_MMAP 8086/8086: [0x400000(0x6000) @ 0]: /bin/sleep
  7159481077104 3 PERF_RECORD_MMAP 8086/8086: [0x3d06400000(0x221000) @ 0]: /lib64/ld-2.12.so
  7159481092912 3 PERF_RECORD_MMAP 8086/8086: [0x7fff1adff000(0x1000) @ 0x7fff1adff000]: [vdso]
  7159481196779 3 PERF_RECORD_MMAP 8086/8086: [0x3d06800000(0x37f000) @ 0]: /lib64/libc-2.12.so
  7160481558435 3 PERF_RECORD_EXIT(8086:8086):(8086:8086)
  ---- end ----
  Validate PERF_RECORD_* events &amp; perf_sample fields: Ok
  [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-svag18v2z4idas0dyz3umjpq@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf test: Allow running just a subset of the available tests</title>
<updated>2011-11-29T16:04:35Z</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
</author>
<published>2011-11-29T14:52:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e60770a01bd889707faaaeb794f1e278e7160458'/>
<id>urn:sha1:e60770a01bd889707faaaeb794f1e278e7160458</id>
<content type='text'>
To obtain a list of available tests:

[root@emilia linux]# perf test list
 1: vmlinux symtab matches kallsyms
 2: detect open syscall event
 3: detect open syscall event on all cpus
 4: read samples using the mmap interface
 5: parse events tests
[root@emilia linux]#

To list just a subset:

[root@emilia linux]# perf test list syscall
 2: detect open syscall event
 3: detect open syscall event on all cpus
[root@emilia linux]#

To run a subset:

[root@emilia linux]# perf test detect
 2: detect open syscall event: Ok
 3: detect open syscall event on all cpus: Ok
[root@emilia linux]#

Specific tests can be chosen by number:

[root@emilia linux]# perf test 1 3 parse
 1: vmlinux symtab matches kallsyms: Ok
 3: detect open syscall event on all cpus: Ok
 5: parse events tests: Ok
[root@emilia linux]#

Now to write more tests!

Suggested-by: Peter Zijlstra &lt;peterz@infradead.org&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-nqec2145qfxdgimux28aw7v8@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf tools: Simplify debugfs mountpoint handling code</title>
<updated>2011-11-28T12:11:28Z</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
</author>
<published>2011-11-16T16:03:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ebf294bf4f147aff29df5a16bfb0f8ebca15feaa'/>
<id>urn:sha1:ebf294bf4f147aff29df5a16bfb0f8ebca15feaa</id>
<content type='text'>
We don't need to have two PATH_MAX char sized arrays holding it, just
one in util/debugfs.c will do.

Also rename debugfs_path to tracing_events_path, as it is not the path
to debugfs, that is debugfs_mountpoint. Both are now accessible.

This will allow accessing this code in the perf python binding without
having to drag in perf.c and util/parse-events.c.

The defaults for these variables are the canonical "/sys/kernel/debug"
and "/sys/kernel/debug/tracing/events/", removing the need for simple
tools to call debugfs_mount(NULL).

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-ug9jvtjrsqbluuhqqxpvg30f@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 tool: Fix endianness handling of u32 data in samples</title>
<updated>2011-09-23T17:37:27Z</updated>
<author>
<name>David Ahern</name>
</author>
<published>2011-09-06T15:12:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=936be50306a92356367f330ef9d44f1f62478d22'/>
<id>urn:sha1:936be50306a92356367f330ef9d44f1f62478d22</id>
<content type='text'>
Currently, analyzing PPC data files on x86 the cpu field is always 0 and
the tid and pid are backwards. For example, analyzing a PPC file on PPC
the pid/tid fields show:

        rsyslogd  1210/1212

and analyzing the same PPC file using an x86 perf binary shows:

        rsyslogd  1212/1210

The problem is that the swap_op method for samples is
perf_event__all64_swap which assumes all elements in the sample_data
struct are u64s. cpu, tid and pid are u32s and need to be handled
individually. Given that the swap is done before the sample is parsed,
the simplest solution is to undo the 64-bit swap of those elements when
the sample is parsed and do the proper swap.

The RAW data field is generic and perf cannot have programmatic knowledge
of how to treat that data. Instead a warning is given to the user.

Thanks to Anton Blanchard for providing a data file for a mult-CPU
PPC system so I could verify the fix for the CPU fields.

v3 -&gt; v4:
- fixed use of WARN_ONCE

v2 -&gt; v3:
- used WARN_ONCE for message regarding raw data
- removed struct wrapper around union
- fixed whitespace issues

v1 -&gt; v2:
- added a union for undoing the byte-swap on u64 and redoing swap on
  u32's to address compiler errors (see git commit 65014ab3)

Cc: Anton Blanchard &lt;anton@samba.org&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: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: http://lkml.kernel.org/r/1315321946-16993-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 tools: Make test use the preset debugfs path</title>
<updated>2011-07-21T08:41:14Z</updated>
<author>
<name>Jiri Olsa</name>
</author>
<published>2011-07-14T09:25:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=baf040a0d1ac6319725c0fe400503683ac016580'/>
<id>urn:sha1:baf040a0d1ac6319725c0fe400503683ac016580</id>
<content type='text'>
Use preset debugfs path instead of hardcoded one.

Signed-off-by: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: acme@redhat.com
Cc: a.p.zijlstra@chello.nl
Cc: paulus@samba.org
Link: http://lkml.kernel.org/r/1310635534-4013-4-git-send-email-jolsa@redhat.com
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>perf tools: Add automated tests for events parsing</title>
<updated>2011-07-21T08:41:13Z</updated>
<author>
<name>Jiri Olsa</name>
</author>
<published>2011-07-14T09:25:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=13b62567e909125145f90e91625b1062196d1258'/>
<id>urn:sha1:13b62567e909125145f90e91625b1062196d1258</id>
<content type='text'>
Adding builtin test for parse_events function, which is
responsible for parsing/processing "-e" option for
stat/top/record commands.

This new test will run within the builtin test command suite
(perf test).

One or several tests were added for each type of event.
More tests could be added easily if needed.

Signed-off-by: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: acme@redhat.com
Cc: a.p.zijlstra@chello.nl
Cc: paulus@samba.org
Link: http://lkml.kernel.org/r/1310635534-4013-3-git-send-email-jolsa@redhat.com
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
</feed>
