<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/tools/perf/util/evsel.c, branch linux-4.1.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-4.1.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-4.1.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2015-04-08T13:06:28Z</updated>
<entry>
<title>perf tools: Merge all perf_event_attr print functions</title>
<updated>2015-04-08T13:06:28Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2015-04-07T09:09:54Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=2c5e8c52c6354f77c4019357be8231bcc34456f8'/>
<id>urn:sha1:2c5e8c52c6354f77c4019357be8231bcc34456f8</id>
<content type='text'>
Currently there's 3 (that I found) different and incomplete
implementations of printing perf_event_attr.

This is quite silly. Merge the lot.

While this patch does not retain the exact form all printing that I
found is debug output and thus it should not be critical.

Also, I cannot find a single print_event_desc() caller.

Pre:

 $ perf record -vv -e cycles -- sleep 1
 ------------------------------------------------------------
 perf_event_attr:
  type                0
  size                104
  config              0
  sample_period       4000
  sample_freq         4000
  sample_type         0x107
  read_format         0
  disabled            1    inherit             1
  pinned              0    exclusive           0
  exclude_user        0    exclude_kernel      0
  exclude_hv          0    exclude_idle        0
  mmap                1    comm                1
  mmap2               1    comm_exec           1
  freq                1    inherit_stat        0
  enable_on_exec      1    task                1
  watermark           0    precise_ip          0
  mmap_data           0    sample_id_all       1
  exclude_host        0    exclude_guest       1
  excl.callchain_kern 0    excl.callchain_user 0
  wakeup_events       0
  wakeup_watermark    0
  bp_type             0
  bp_addr             0
  config1             0
  bp_len              0
  config2             0
  branch_sample_type  0
  sample_regs_user    0
  sample_stack_user   0
  sample_regs_intr    0
 ------------------------------------------------------------

 $ perf evlist  -vv
 cycles: sample_freq=4000, size: 104, sample_type: IP|TID|TIME|PERIOD,
 disabled: 1, inherit: 1, mmap: 1, mmap2: 1, comm: 1, comm_exec: 1,
 freq: 1, enable_on_exec: 1, task: 1, sample_id_all: 1, exclude_guest: 1

 Post:

 $ ./perf record -vv -e cycles -- sleep 1
 ------------------------------------------------------------
 perf_event_attr:
  size                             112
  { sample_period, sample_freq }   4000
  sample_type                      IP|TID|TIME|PERIOD
  disabled                         1
  inherit                          1
  mmap                             1
  comm                             1
  freq                             1
  enable_on_exec                   1
  task                             1
  sample_id_all                    1
  exclude_guest                    1
  mmap2                            1
  comm_exec                        1
------------------------------------------------------------

 $ ./perf evlist  -vv
 cycles: size: 112, { sample_period, sample_freq }: 4000, sample_type:
 IP|TID|TIME|PERIOD, disabled: 1, inherit: 1, mmap: 1, comm: 1, freq:
 1, enable_on_exec: 1, task: 1, sample_id_all: 1, exclude_guest: 1,
 mmap2: 1, comm_exec: 1

Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Acked-by: Ingo Molnar &lt;mingo@kernel.org&gt;
Acked-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: "H. Peter Anvin" &lt;hpa@zytor.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: David Ahern &lt;dsahern@gmail.com&gt;
Cc: John Stultz &lt;john.stultz@linaro.org&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: http://lkml.kernel.org/r/20150407091150.644238729@infradead.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf record: Add clockid parameter</title>
<updated>2015-04-08T13:04:55Z</updated>
<author>
<name>Peter Zijlstra</name>
<email>peterz@infradead.org</email>
</author>
<published>2015-03-30T22:19:31Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=814c8c38e13c7050259c72f89bb01f3fc903f642'/>
<id>urn:sha1:814c8c38e13c7050259c72f89bb01f3fc903f642</id>
<content type='text'>
Teach perf-record about the new perf_event_attr::{use_clockid, clockid}
fields. Add a simple parameter to set the clock (if any) to be used for
the events to be recorded into the data file.

Since we store the entire perf_event_attr in the EVENT_DESC section we
also already store the used clockid in the data file.

Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: David Ahern &lt;dsahern@gmail.com&gt;
Cc: "H. Peter Anvin" &lt;hpa@zytor.com&gt;
Cc: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Cc: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: John Stultz &lt;john.stultz@linaro.org&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Yunlong Song &lt;yunlong.song@huawei.com&gt;
Link: http://lkml.kernel.org/r/20150407154851.GR23123@twins.programming.kicks-ass.net
[ Conditionally define CLOCK_BOOTTIME, at least rhel6 doesn't have it - dsahern
  Ditto for CLOCK_MONOTONIC_RAW, sles11sp2 doesn't have it - yunlong.song ]
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf timechart: Fix SIBGUS error on sparc64</title>
<updated>2015-03-26T13:52:28Z</updated>
<author>
<name>David Ahern</name>
<email>david.ahern@oracle.com</email>
</author>
<published>2015-03-24T20:14:09Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=e94eedab3ab8201fd41480171b2fabbf3c5b1ae0'/>
<id>urn:sha1:e94eedab3ab8201fd41480171b2fabbf3c5b1ae0</id>
<content type='text'>
perf timechart -T on sparc64 is terminating due to SIGBUS. Backtrace:

Program received signal SIGBUS, Bus error.
0x0000000000173d7c in perf_evsel__intval (evsel=&lt;value optimized out&gt;, sample=0x7feffffda28, name=0x289b28 "prev_state")
    at util/evsel.c:1918
1918	util/evsel.c: No such file or directory.
	in util/evsel.c
Missing separate debuginfos, use: debuginfo-install audit-libs-2.3.7-1.0.1.el6.sparc64 bzip2-libs-1.0.5-7.el6_0.sparc64 elfutils-libelf-0.155-2.0.3.el6.sparc64 elfutils-libs-0.155-2.0.3.el6.sparc64 glibc-2.12-1.132.0.8.el6_5.sparc64 numactl-2.0.7-8.el6.sparc64 python-libs-2.6.6-52.0.2.el6.sparc64 slang-2.2.1-1.el6.sparc64 xz-libs-4.999.9-0.3.beta.20091007git.el6.sparc64 zlib-1.2.3-29.el6.sparc64
(gdb) bt
0  0x0000000000173d7c in perf_evsel__intval (evsel=&lt;value optimized out&gt;, sample=0x7feffffda28,
    name=0x289b28 "prev_state") at util/evsel.c:1918
1  0x0000000000123b94 in process_sample_sched_switch (tchart=0x7feffffe040, evsel=0x4ca850, sample=0x7feffffda28,
    backtrace=0xc39010 "") at builtin-timechart.c:627
2  0x0000000000122828 in process_sample_event (tool=0x7feffffe040, event=&lt;value optimized out&gt;, sample=0x7feffffda28,
    evsel=0x4ca850, machine=0x4c9c88) at builtin-timechart.c:569

Another extended load on unaligned pointer. As before fix by copying to
a temporary variable using memcpy.

Signed-off-by: David Ahern &lt;david.ahern@oracle.com&gt;
Link: http://lkml.kernel.org/r/1427228049-51893-1-git-send-email-david.ahern@oracle.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf record: Support recording running/enabled time</title>
<updated>2015-02-25T15:42:23Z</updated>
<author>
<name>Andi Kleen</name>
<email>ak@linux.intel.com</email>
</author>
<published>2015-02-24T23:13:40Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=85c273d2b6569706762cf400079ca0699e007d81'/>
<id>urn:sha1:85c273d2b6569706762cf400079ca0699e007d81</id>
<content type='text'>
Add an option to perf record to record running/enabled time for read
events, similar to what stat does.

This is useful to understand multiplexing problems.

Right now the report support is not great, but at least report -D
already supports it.

Signed-off-by: Andi Kleen &lt;ak@linux.intel.com&gt;
Acked-by: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Link: http://lkml.kernel.org/r/1424819620-16043-1-git-send-email-andi@firstfloor.org
[ Fixed the Documentation entry to match the OPT_BOOLEAN one ]
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf tools: Enable LBR call stack support</title>
<updated>2015-02-18T16:16:17Z</updated>
<author>
<name>Kan Liang</name>
<email>kan.liang@intel.com</email>
</author>
<published>2015-01-05T18:23:04Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=aad2b21c151273fa7abc419dac51a980eff1dd17'/>
<id>urn:sha1:aad2b21c151273fa7abc419dac51a980eff1dd17</id>
<content type='text'>
Currently, there are two call chain recording options, fp and dwarf.

Haswell has a new feature that utilizes the existing LBR facility to
record call chains. Kernel side LBR support code provides this as a
third option to record call chains. This patch enables the lbr call
stack support on the tooling side.

LBR call stack has some limitations:

 - It reuses current LBR facility, so LBR call stack and branch record
   can not be enabled at the same time.

 - It is only available for user-space callchains.

However, it also offers some advantages:

 - LBR call stack can work on user apps which don't have frame-pointers
   or dwarf debug info compiled. It is a good alternative when nothing
   else works.

Tested-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
Signed-off-by: Kan Liang &lt;kan.liang@intel.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Cc: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Cc: Anshuman Khandual &lt;khandual@linux.vnet.ibm.com&gt;
Cc: Arnaldo Carvalho de Melo &lt;acme@kernel.org&gt;
Cc: Cody P Schafer &lt;cody@linux.vnet.ibm.com&gt;
Cc: David Ahern &lt;dsahern@gmail.com&gt;
Cc: Don Zickus &lt;dzickus@redhat.com&gt;
Cc: Jacob Shin &lt;jacob.w.shin@gmail.com&gt;
Cc: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Cc: Masanari Iida &lt;standby24x7@gmail.com&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Rodrigo Campos &lt;rodrigo@sdfg.com.ar&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
Cc: Sukadev Bhattiprolu &lt;sukadev@linux.vnet.ibm.com&gt;
Link: http://lkml.kernel.org/r/1420482185-29830-2-git-send-email-kan.liang@intel.com
Signed-off-by: Ingo Molnar &lt;mingo@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf evsel: Set attr.task bit for a tracking event</title>
<updated>2015-01-29T19:54:59Z</updated>
<author>
<name>Namhyung Kim</name>
<email>namhyung@kernel.org</email>
</author>
<published>2015-01-29T08:06:46Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=62e503b7ed98fcdf16308cda0b5378e7840f4339'/>
<id>urn:sha1:62e503b7ed98fcdf16308cda0b5378e7840f4339</id>
<content type='text'>
The perf_event_attr.task bit is to track task (fork and exit) events but
it missed to be set by perf_evsel__config().  While it was not a problem
in practice since setting other bits (comm/mmap) ended up being in same
result, it'd be good to set it explicitly anyway.

The attr-&gt;task is to track task related events (fork/exit) only but
other meta events like comm and mmap[2] also needs the task events.  So
setting attr-&gt;comm and/or attr-&gt;mmap causes the kernel emits the task
events anyway.  So the attr-&gt;task is only meaningful when other bits are
off but I'd like to set it for completeness.

Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Cc: Andi Kleen &lt;andi@firstfloor.org&gt;
Cc: David Ahern &lt;dsahern@gmail.com&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Jiri Olsa &lt;jolsa@redhat.com&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
Link: http://lkml.kernel.org/r/1422518843-25818-6-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf evsel: Don't rely on malloc working for sz 0</title>
<updated>2015-01-28T15:43:32Z</updated>
<author>
<name>Vineet Gupta</name>
<email>Vineet.Gupta1@synopsys.com</email>
</author>
<published>2015-01-13T13:43:23Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=8d9cbd8f870e1aab00fb0f8a465887877a1d6f82'/>
<id>urn:sha1:8d9cbd8f870e1aab00fb0f8a465887877a1d6f82</id>
<content type='text'>
When running perf on ARC (uClibc based userspace), ran into this issue
   -------------&gt;8----------------
	[ARCLinux]$ ./perf record ls
	bin             etc             perf            sys
	debug           init            perf.data       tmp
	[ perf record: Woken up 1 times to write data ]
	[ perf record: Captured and wrote 0.001 MB perf.data (~24 samples) ]

	[ARCLinux]$ ./perf report
	incompatible file format (rerun with -v to learn more)
   -------------&gt;8----------------

The problem happens in the following call stack when zalloc is called
with size zero

glibc default / uClibc with MALLOC_GLIBC_COMPAT are OK, but not if that
config option is not enabled.

  cmd_report
     perf_session__new
	perf_session__open
	    perf_session__read_header
		read_attr(fd, header, &amp;f_attr)
		nr_ids = f_attr.ids.size / sizeof(u64); &lt;-- 0
		perf_evsel__alloc_id(vsel, 1, nr_ids)
			zalloc(ncpus * nthreads * sizeof(u64)) &lt;-- 0

header.c: read_attr()

(gdb) p *f_attr
$17 = {
  attr = {
    type = 0,
    size = 96,
    config = 0,
    {
      sample_period = 4000,
      sample_freq = 4000
    },
...
  ids = {
    offset = 104,
    size = 0      &lt;------
  }
}

Signed-off-by: Vineet Gupta &lt;vgupta@synopsys.com&gt;
Suggested-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Acked-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: Alexey Brodkin &lt;Alexey.Brodkin@synopsys.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Link: http://lkml.kernel.org/r/1421156604-30603-5-git-send-email-vgupta@synopsys.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf tools: Remove perf_evsel__read interface</title>
<updated>2014-12-01T23:00:30Z</updated>
<author>
<name>Jiri Olsa</name>
<email>jolsa@kernel.org</email>
</author>
<published>2014-11-21T09:31:11Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=a5a7fd76b55a6e6916ff22e5c8fdb39a8381be2c'/>
<id>urn:sha1:a5a7fd76b55a6e6916ff22e5c8fdb39a8381be2c</id>
<content type='text'>
Removing the perf_evsel__read interfaces because we replaced the only
user in the stat command code.

Signed-off-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: Andi Kleen &lt;ak@linux.intel.com&gt;
Cc: Corey Ashford &lt;cjashfor@linux.vnet.ibm.com&gt;
Cc: David Ahern &lt;dsahern@gmail.com&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Matt Fleming &lt;matt.fleming@intel.com&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
Link: http://lkml.kernel.org/r/1416562275-12404-8-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf evsel: Introduce perf_evsel__read_cb function</title>
<updated>2014-11-24T21:03:50Z</updated>
<author>
<name>Jiri Olsa</name>
<email>jolsa@kernel.org</email>
</author>
<published>2014-11-21T09:31:07Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=011dccbdd93b7022c5c67e7c55fa8b5030b5e03d'/>
<id>urn:sha1:011dccbdd93b7022c5c67e7c55fa8b5030b5e03d</id>
<content type='text'>
Adding perf_evsel__read_cb read function that retuns count values via
callback. It will be used later in stat command as single way to
retrieve counter values.

Signed-off-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: Andi Kleen &lt;ak@linux.intel.com&gt;
Cc: Corey Ashford &lt;cjashfor@linux.vnet.ibm.com&gt;
Cc: David Ahern &lt;dsahern@gmail.com&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Matt Fleming &lt;matt.fleming@intel.com&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
Link: http://lkml.kernel.org/r/1416562275-12404-4-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf evsel: Introduce perf_counts_values__scale function</title>
<updated>2014-11-24T21:03:50Z</updated>
<author>
<name>Jiri Olsa</name>
<email>jolsa@kernel.org</email>
</author>
<published>2014-11-21T09:31:06Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=13112bbf595d4081f291f7061bb096dbf4401d41'/>
<id>urn:sha1:13112bbf595d4081f291f7061bb096dbf4401d41</id>
<content type='text'>
Factoring out scale login into perf_counts_values__scale function.

Signed-off-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: Andi Kleen &lt;ak@linux.intel.com&gt;
Cc: Corey Ashford &lt;cjashfor@linux.vnet.ibm.com&gt;
Cc: David Ahern &lt;dsahern@gmail.com&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Ingo Molnar &lt;mingo@kernel.org&gt;
Cc: Matt Fleming &lt;matt.fleming@intel.com&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
Link: http://lkml.kernel.org/r/1416562275-12404-3-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
</feed>
