<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/tools/perf/util/hist.h, branch linux-3.16.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.16.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.16.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2015-01-16T14:34:37Z</updated>
<entry>
<title>perf session: Do not fail on processing out of order event</title>
<updated>2015-01-16T14:34:37Z</updated>
<author>
<name>Jiri Olsa</name>
</author>
<published>2014-11-26T15:39:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=071c830e75ab638d828e2cff90ef647b23140bb9'/>
<id>urn:sha1:071c830e75ab638d828e2cff90ef647b23140bb9</id>
<content type='text'>
commit f61ff6c06dc8f32c7036013ad802c899ec590607 upstream.

Linus reported perf report command being interrupted due to processing
of 'out of order' event, with following error:

  Timestamp below last timeslice flush
  0x5733a8 [0x28]: failed to process type: 3

I could reproduce the issue and in my case it was caused by one CPU
(mmap) being behind during record and userspace mmap reader seeing the
data after other CPUs data were already stored.

This is expected under some circumstances because we need to limit the
number of events that we queue for reordering when we receive a
PERF_RECORD_FINISHED_ROUND or when we force flush due to memory
pressure.

Reported-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
Acked-by: Ingo Molnar &lt;mingo@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: Linus Torvalds &lt;torvalds@linux-foundation.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/1417016371-30249-1-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
[zhangzhiqiang: backport to 3.10:
 - adjust context
 - commit f61ff6c06d struct events_stats was defined in tools/perf/util/event.h
   while 3.10 stable defined in tools/perf/util/hist.h.
 - 3.10 stable there is no pr_oe_time() which used for debug.
 - After the above adjustments, becomes same to the original patch:
   https://github.com/torvalds/linux/commit/f61ff6c06dc8f32c7036013ad802c899ec590607
]
Signed-off-by: Zhiqiang Zhang &lt;zhangzhiqiang.zhang@huawei.com&gt;
[ luis: backported to 3.16: used zhangzhiqiang backport to 3.10 ]
Signed-off-by: Luis Henriques &lt;luis.henriques@canonical.com&gt;
</content>
</entry>
<entry>
<title>perf tools: Add dcacheline sort</title>
<updated>2014-06-09T11:34:49Z</updated>
<author>
<name>Don Zickus</name>
</author>
<published>2014-06-01T13:38:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9b32ba71ba905b90610fc2aad77cb98a373c5624'/>
<id>urn:sha1:9b32ba71ba905b90610fc2aad77cb98a373c5624</id>
<content type='text'>
In perf's 'mem-mode', one can get access to a whole bunch of details specific to a
particular sample instruction.  A bunch of those details relate to the data
address.

One interesting thing you can do with data addresses is to convert them into a unique
cacheline they belong too.  Organizing these data cachelines into similar groups and sorting
them can reveal cache contention.

This patch creates an alogorithm based on various sample details that can help group
entries together into data cachelines and allows 'perf report' to sort on it.

The algorithm relies on having proper mmap2 support in the kernel to help determine
if the memory map the data address belongs to is private to a pid or globally shared.

The alogortithm is as follows:

o group cpumodes together
o group entries with discovered maps together
o sort on major, minor, inode and inode generation numbers
o if userspace anon, then sort on pid
o sort on cachelines based on data addresses

The 'dcacheline' sort option in 'perf report' only works in 'mem-mode'.

Sample output:

 #
 # Samples: 206  of event 'cpu/mem-loads/pp'
 # Total weight : 2534
 # Sort order   : dcacheline,pid
 #
 # Overhead       Samples                                                          Data Cacheline       Command:  Pid
 # ........  ............  ......................................................................  ..................
 #
    13.22%             1  [k] 0xffff88042f08ebc0                                                       swapper:    0
     9.27%             1  [k] 0xffff88082e8cea80                                                       swapper:    0
     3.59%             2  [k] 0xffffffff819ba180                                                       swapper:    0
     0.32%             1  [k] arch_trigger_all_cpu_backtrace_handler_na.23901+0xffffffffffffffe0       swapper:    0
     0.32%             1  [k] timekeeper_seq+0xfffffffffffffff8                                        swapper:    0

Note:  Added a '+1' to symlen size in hists__calc_col_len to prevent the next column
from prematurely tabbing over and mis-aligning.  Not sure what the problem is.

Signed-off-by: Don Zickus &lt;dzickus@redhat.com&gt;
Link: http://lkml.kernel.org/r/1401208087-181977-8-git-send-email-dzickus@redhat.com
Signed-off-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf tools: Move elide bool into perf_hpp_fmt struct</title>
<updated>2014-06-03T19:34:59Z</updated>
<author>
<name>Jiri Olsa</name>
</author>
<published>2014-05-23T15:15:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f29984226978313039d7dfe9b45eaa55a3aad03d'/>
<id>urn:sha1:f29984226978313039d7dfe9b45eaa55a3aad03d</id>
<content type='text'>
After output/sort fields refactoring, it's expensive
to check the elide bool in its current location inside
the 'struct sort_entry'.

The perf_hpp__should_skip function gets highly noticable in
workloads with high number of output/sort fields, like for:

  $ perf report -i perf-test.data -F overhead,sample,period,comm,pid,dso,symbol,cpu --stdio

Performance report:
   9.70%  perf  [.] perf_hpp__should_skip

Moving the elide bool into the 'struct perf_hpp_fmt', which
makes the perf_hpp__should_skip just single struct read.

Got speedup of around 22% for my test perf.data workload.
The change should not harm any other workload types.

Performance counter stats for (10 runs):
  before:
   358,319,732,626      cycles                    ( +-  0.55% )
   467,129,581,515      instructions              #    1.30  insns per cycle          ( +-  0.00% )

     150.943975206 seconds time elapsed           ( +-  0.62% )

  now:
   278,785,972,990      cycles                    ( +-  0.12% )
   370,146,797,640      instructions              #    1.33  insns per cycle          ( +-  0.00% )

     116.416670507 seconds time elapsed           ( +-  0.31% )

Acked-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Arnaldo Carvalho de Melo &lt;acme@kernel.org&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: 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/20140601142622.GA9131@krava.brq.redhat.com
Signed-off-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf tools: Add callback function to hist_entry_iter</title>
<updated>2014-06-01T12:35:05Z</updated>
<author>
<name>Namhyung Kim</name>
</author>
<published>2014-01-07T08:02:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9d3c02d7188866299eebe3c4a652c08140a71f40'/>
<id>urn:sha1:9d3c02d7188866299eebe3c4a652c08140a71f40</id>
<content type='text'>
The new -&gt;add_entry_cb() will be called after an entry was added to
the histogram.  It's used for code sharing between perf report and
perf top.  Note that ops-&gt;add_*_entry() should set iter-&gt;he properly
in order to call the -&gt;add_entry_cb.

Also pass @arg to the callback function.  It'll be used by perf top
later.

Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Tested-by: Arun Sharma &lt;asharma@fb.com&gt;
Tested-by: Rodrigo Campos &lt;rodrigo@sdfg.com.ar&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Link: http://lkml.kernel.org/r/87k393g999.fsf@sejong.aot.lge.com
Signed-off-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf tools: Add more hpp helper functions</title>
<updated>2014-06-01T12:35:03Z</updated>
<author>
<name>Namhyung Kim</name>
</author>
<published>2013-12-16T07:55:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=77284de326e6d8c3b8e866cda5b415c86b522e61'/>
<id>urn:sha1:77284de326e6d8c3b8e866cda5b415c86b522e61</id>
<content type='text'>
Sometimes it needs to disable some columns at runtime.  Add help
functions to support that.

Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Tested-by: Arun Sharma &lt;asharma@fb.com&gt;
Tested-by: Rodrigo Campos &lt;rodrigo@sdfg.com.ar&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Link: http://lkml.kernel.org/r/1401335910-16832-15-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf ui/hist: Add support to accumulated hist stat</title>
<updated>2014-06-01T12:35:00Z</updated>
<author>
<name>Namhyung Kim</name>
</author>
<published>2013-10-30T07:06:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=594dcbf3186e2e1e5c08fa21e8826b90d347f23f'/>
<id>urn:sha1:594dcbf3186e2e1e5c08fa21e8826b90d347f23f</id>
<content type='text'>
Print accumulated stat of a hist entry if requested.

To do that, add new HPP_PERCENT_ACC_FNS macro and generate a
perf_hpp_fmt using it.  The __hpp__sort_acc() function sorts entries
by accumulated period value.  When accumulated periods of two entries
are same (i.e. single path callchain) put the caller above since
accumulation tends to put callers on higher position for obvious
reason.

Also add "overhead_children" output field to be selected by user.

Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Tested-by: Arun Sharma &lt;asharma@fb.com&gt;
Tested-by: Rodrigo Campos &lt;rodrigo@sdfg.com.ar&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Link: http://lkml.kernel.org/r/1401335910-16832-11-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf hists: Accumulate hist entry stat based on the callchain</title>
<updated>2014-06-01T12:34:57Z</updated>
<author>
<name>Namhyung Kim</name>
</author>
<published>2012-09-11T05:13:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=7a13aa28aa268359cee006059731f49bcd1f839e'/>
<id>urn:sha1:7a13aa28aa268359cee006059731f49bcd1f839e</id>
<content type='text'>
Call __hists__add_entry() for each callchain node to get an
accumulated stat for an entry.  Introduce new cumulative_iter ops to
process them properly.

Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Tested-by: Arun Sharma &lt;asharma@fb.com&gt;
Tested-by: Rodrigo Campos &lt;rodrigo@sdfg.com.ar&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Link: http://lkml.kernel.org/r/1401335910-16832-6-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf hists: Check if accumulated when adding a hist entry</title>
<updated>2014-06-01T12:34:56Z</updated>
<author>
<name>Namhyung Kim</name>
</author>
<published>2012-09-11T04:34:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a0b51af367a6831330564c96dc4cc1ac63413701'/>
<id>urn:sha1:a0b51af367a6831330564c96dc4cc1ac63413701</id>
<content type='text'>
To support callchain accumulation, @entry should be recognized if it's
accumulated or not when add_hist_entry() called.  The period of an
accumulated entry should be added to -&gt;stat_acc but not -&gt;stat. Add
@sample_self arg for that.

Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Tested-by: Arun Sharma &lt;asharma@fb.com&gt;
Tested-by: Rodrigo Campos &lt;rodrigo@sdfg.com.ar&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Link: http://lkml.kernel.org/r/1401335910-16832-5-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf tools: Introduce struct hist_entry_iter</title>
<updated>2014-06-01T12:34:55Z</updated>
<author>
<name>Namhyung Kim</name>
</author>
<published>2013-10-30T00:40:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=69bcb019fc809874f518559c8e5b0a90176f0532'/>
<id>urn:sha1:69bcb019fc809874f518559c8e5b0a90176f0532</id>
<content type='text'>
There're some duplicate code when adding hist entries.  They are
different in that some have branch info or mem info but generally do
same thing.  So introduce new struct hist_entry_iter and add callbacks
to customize each case in general way.

The new perf_evsel__add_entry() function will look like:

  iter-&gt;prepare_entry();
  iter-&gt;add_single_entry();

  while (iter-&gt;next_entry())
    iter-&gt;add_next_entry();

  iter-&gt;finish_entry();

This will help further work like the cumulative callchain patchset.

Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Tested-by: Arun Sharma &lt;asharma@fb.com&gt;
Tested-by: Rodrigo Campos &lt;rodrigo@sdfg.com.ar&gt;
Cc: David Ahern &lt;dsahern@gmail.com&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Stephane Eranian &lt;eranian@google.com&gt;
Link: http://lkml.kernel.org/r/1401335910-16832-3-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
</content>
</entry>
<entry>
<title>perf tools: Introduce hists__inc_nr_samples()</title>
<updated>2014-06-01T12:34:55Z</updated>
<author>
<name>Namhyung Kim</name>
</author>
<published>2014-05-28T05:12:18Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1844dbcbe78503e0f4a8996d69da725d5e7a5177'/>
<id>urn:sha1:1844dbcbe78503e0f4a8996d69da725d5e7a5177</id>
<content type='text'>
There're some duplicate code for counting number of samples.  Add
hists__inc_nr_samples() and reuse it.

Suggested-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
Signed-off-by: Namhyung Kim &lt;namhyung@kernel.org&gt;
Link: http://lkml.kernel.org/r/1401335910-16832-2-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
</content>
</entry>
</feed>
