<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/tools/perf/builtin-diff.c, branch v5.4</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.4</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.4'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2019-09-20T18:58:11Z</updated>
<entry>
<title>perf session: Return error code for perf_session__new() function on failure</title>
<updated>2019-09-20T18:58:11Z</updated>
<author>
<name>Mamatha Inamdar</name>
<email>mamatha4@linux.vnet.ibm.com</email>
</author>
<published>2019-08-22T07:20:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6ef81c55a2b6584cb642917f5fdf3632ef44b670'/>
<id>urn:sha1:6ef81c55a2b6584cb642917f5fdf3632ef44b670</id>
<content type='text'>
This patch is to return error code of perf_new_session function on
failure instead of NULL.

Test Results:

Before Fix:

  $ perf c2c report -input
  failed to open nput: No such file or directory

  $ echo $?
  0
  $

After Fix:

  $ perf c2c report -input
  failed to open nput: No such file or directory

  $ echo $?
  254
  $

Committer notes:

Fix 'perf tests topology' case, where we use that TEST_ASSERT_VAL(...,
session), i.e. we need to pass zero in case of failure, which was the
case before when NULL was returned by perf_session__new() for failure,
but now we need to negate the result of IS_ERR(session) to respect that
TEST_ASSERT_VAL) expectation of zero meaning failure.

Reported-by: Nageswara R Sastry &lt;rnsastry@linux.vnet.ibm.com&gt;
Signed-off-by: Mamatha Inamdar &lt;mamatha4@linux.vnet.ibm.com&gt;
Tested-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
Tested-by: Nageswara R Sastry &lt;rnsastry@linux.vnet.ibm.com&gt;
Acked-by: Ravi Bangoria &lt;ravi.bangoria@linux.ibm.com&gt;
Reviewed-by: Jiri Olsa &lt;jolsa@redhat.com&gt;
Reviewed-by: Mukesh Ojha &lt;mojha@codeaurora.org&gt;
Cc: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Alexey Budankov &lt;alexey.budankov@linux.intel.com&gt;
Cc: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Cc: Jeremie Galarneau &lt;jeremie.galarneau@efficios.com&gt;
Cc: Kate Stewart &lt;kstewart@linuxfoundation.org&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Shawn Landden &lt;shawn@git.icu&gt;
Cc: Song Liu &lt;songliubraving@fb.com&gt;
Cc: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Cc: Tzvetomir Stoyanov &lt;tstoyanov@vmware.com&gt;
Link: http://lore.kernel.org/lkml/20190822071223.17892.45782.stgit@localhost.localdomain
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf debug: Remove needless include directives from debug.h</title>
<updated>2019-08-31T22:10:19Z</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
<email>acme@redhat.com</email>
</author>
<published>2019-08-29T19:18:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8520a98dbab61e9e340cdfb72dd17ccc8a98961e'/>
<id>urn:sha1:8520a98dbab61e9e340cdfb72dd17ccc8a98961e</id>
<content type='text'>
All we need there is a forward declaration for 'union perf_event', so
remove it from there and add missing header directives in places using
things from this indirect include.

Cc: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Cc: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Link: https://lkml.kernel.org/n/tip-7ftk0ztstqub1tirjj8o8xbl@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf tools: Remove needless perf.h include directive from headers</title>
<updated>2019-08-29T20:38:32Z</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
<email>acme@redhat.com</email>
</author>
<published>2019-08-29T18:20:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c1a604dff486399ae0be95e6396e0158df95ad5d'/>
<id>urn:sha1:c1a604dff486399ae0be95e6396e0158df95ad5d</id>
<content type='text'>
Its not needed there, add it to the places that need it and were getting
it via those headers.

Cc: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Cc: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Link: https://lkml.kernel.org/n/tip-5yulx1u16vyd0zmrbg1tjhju@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf srcline: Add missing srcline.h header to files needing its defs</title>
<updated>2019-08-26T14:58:29Z</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
<email>acme@redhat.com</email>
</author>
<published>2019-08-22T20:10:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=97b9d866a66cf9884cea623cde3300073815873d'/>
<id>urn:sha1:97b9d866a66cf9884cea623cde3300073815873d</id>
<content type='text'>
When srcline was introduced it wrongly added the include to util/sort.h,
even with that header not needing the definitions it provides, fix it by
adding it to the places that need it as a pre patch to remove srcline.h
from sort.h.

Cc: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Cc: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Link: https://lkml.kernel.org/n/tip-shuebppedtye8hrgxk15qe3x@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf evlist: Rename struct perf_evlist to struct evlist</title>
<updated>2019-07-29T21:34:42Z</updated>
<author>
<name>Jiri Olsa</name>
<email>jolsa@kernel.org</email>
</author>
<published>2019-07-21T11:23:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=63503dba87acfab49280d3b05df6705a6f327e8a'/>
<id>urn:sha1:63503dba87acfab49280d3b05df6705a6f327e8a</id>
<content type='text'>
Rename struct perf_evlist to struct evlist, so we don't have a name
clash when we add struct perf_evlist in libperf.

Committer notes:

Added fixes to build on arm64, from Jiri and from me
(tools/perf/util/cs-etm.c)

Signed-off-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Alexey Budankov &lt;alexey.budankov@linux.intel.com&gt;
Cc: Andi Kleen &lt;ak@linux.intel.com&gt;
Cc: Michael Petlan &lt;mpetlan@redhat.com&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Link: http://lkml.kernel.org/r/20190721112506.12306-6-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf evsel: Rename struct perf_evsel to struct evsel</title>
<updated>2019-07-29T21:34:42Z</updated>
<author>
<name>Jiri Olsa</name>
<email>jolsa@kernel.org</email>
</author>
<published>2019-07-21T11:23:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=32dcd021d004038ca12ac17319da5aa4756e9312'/>
<id>urn:sha1:32dcd021d004038ca12ac17319da5aa4756e9312</id>
<content type='text'>
Rename struct perf_evsel to struct evsel, so we don't have a name clash
when we add struct perf_evsel in libperf.

Committer notes:

Added fixes for arm64, provided by Jiri.

Signed-off-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Alexey Budankov &lt;alexey.budankov@linux.intel.com&gt;
Cc: Andi Kleen &lt;ak@linux.intel.com&gt;
Cc: Michael Petlan &lt;mpetlan@redhat.com&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Link: http://lkml.kernel.org/r/20190721112506.12306-5-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>tools lib: Adopt zalloc()/zfree() from tools/perf</title>
<updated>2019-07-09T13:13:26Z</updated>
<author>
<name>Arnaldo Carvalho de Melo</name>
<email>acme@redhat.com</email>
</author>
<published>2019-07-04T14:32:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7f7c536f23e6afaa5d5d4b0e0958b0be8922491f'/>
<id>urn:sha1:7f7c536f23e6afaa5d5d4b0e0958b0be8922491f</id>
<content type='text'>
Eroding a bit more the tools/perf/util/util.h hodpodge header.

Cc: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Cc: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: Namhyung Kim &lt;namhyung@kernel.org&gt;
Link: https://lkml.kernel.org/n/tip-natazosyn9rwjka25tvcnyi0@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf diff: Print the basic block cycles diff</title>
<updated>2019-07-02T16:20:51Z</updated>
<author>
<name>Jin Yao</name>
<email>yao.jin@linux.intel.com</email>
</author>
<published>2019-06-28T09:23:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b10c78c50964da952e6d4db78a3692ab051e6638'/>
<id>urn:sha1:b10c78c50964da952e6d4db78a3692ab051e6638</id>
<content type='text'>
 $ perf record -b ./div
 $ perf record -b ./div

Following is the default perf diff output

 $ perf diff

 # Event 'cycles'
 #
 # Baseline  Delta Abs  Shared Object     Symbol
 # ........  .........  ................  ..................................
 #
     48.75%     +0.33%  div               [.] main
      8.21%     -0.20%  div               [.] compute_flag
     19.02%     -0.12%  libc-2.23.so      [.] __random_r
     16.17%     -0.09%  libc-2.23.so      [.] __random
      2.27%     -0.03%  div               [.] rand@plt
                +0.02%  [i915]            [k] gen8_irq_handler
      5.52%     +0.02%  libc-2.23.so      [.] rand

This patch creates a new computation selection 'cycles'.

 $ perf diff -c cycles

 # Event 'cycles'
 #
 # Baseline       [Program Block Range] Cycles Diff Shared Object Symbol
 # ........ ....................................... .........................................
 #
     48.75%             [div.c:42 -&gt; div.c:45]  147 div           [.] main
     48.75%             [div.c:31 -&gt; div.c:40]    4 div           [.] main
     48.75%             [div.c:40 -&gt; div.c:40]    0 div           [.] main
     48.75%             [div.c:42 -&gt; div.c:42]    0 div           [.] main
     48.75%             [div.c:42 -&gt; div.c:44]    0 div           [.] main
     19.02% [random_r.c:357 -&gt; random_r.c:360]    0 libc-2.23.so  [.] __random_r
     19.02% [random_r.c:357 -&gt; random_r.c:373]    0 libc-2.23.so  [.] __random_r
     19.02% [random_r.c:357 -&gt; random_r.c:376]    0 libc-2.23.so  [.] __random_r
     19.02% [random_r.c:357 -&gt; random_r.c:380]    0 libc-2.23.so  [.] __random_r
     19.02% [random_r.c:357 -&gt; random_r.c:392]    0 libc-2.23.so  [.] __random_r
     16.17%     [random.c:288 -&gt; random.c:291]    0 libc-2.23.so  [.] __random
     16.17%     [random.c:288 -&gt; random.c:291]    0 libc-2.23.so  [.] __random
     16.17%     [random.c:288 -&gt; random.c:295]    0 libc-2.23.so  [.] __random
     16.17%     [random.c:288 -&gt; random.c:297]    0 libc-2.23.so  [.] __random
     16.17%     [random.c:291 -&gt; random.c:291]    0 libc-2.23.so  [.] __random
     16.17%     [random.c:293 -&gt; random.c:293]    0 libc-2.23.so  [.] __random
      8.21%             [div.c:22 -&gt; div.c:22]  148 div           [.] compute_flag
      8.21%             [div.c:22 -&gt; div.c:25]    0 div           [.] compute_flag
      8.21%             [div.c:27 -&gt; div.c:28]    0 div           [.] compute_flag
      5.52%           [rand.c:26 -&gt; rand.c:27]    0 libc-2.23.so  [.] rand
      5.52%           [rand.c:26 -&gt; rand.c:28]    0 libc-2.23.so  [.] rand
      2.27%         [rand@plt+0 -&gt; rand@plt+0]    0 div           [.] rand@plt
      0.01% [entry_64.S:694 -&gt; entry_64.S:694]   16 [vmlinux]     [k] native_irq_return_iret
      0.00%       [fair.c:7676 -&gt; fair.c:7665]  162 [vmlinux]     [k] update_blocked_averages

"[Program Block Range]" indicates the range of program basic block
(start -&gt; end). If we can find the source line it prints the source line
otherwise it prints the symbol+offset instead.

 v4:
 ---
 Use source lines or symbol+offset to indicate the basic block. It should
 be easier to understand.

 v3:
 ---
 Cast 'struct hist_entry' to 'struct block_hist' in hist_entry__block_fprintf.
 Use symbol_conf.report_block to check if executing hist_entry__block_fprintf.

 v2:
 ---
 Keep standard perf diff format and display the 'Baseline' and
 'Shared Object'.

The output is sorted by "Baseline" and the basic blocks in the same
function are sorted by cycles diff.

Signed-off-by: Jin Yao &lt;yao.jin@linux.intel.com&gt;
Reviewed-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Andi Kleen &lt;ak@linux.intel.com&gt;
Cc: Jin Yao &lt;yao.jin@intel.com&gt;
Cc: Kan Liang &lt;kan.liang@linux.intel.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Link: http://lkml.kernel.org/r/1561713784-30533-7-git-send-email-yao.jin@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf diff: Link same basic blocks among different data</title>
<updated>2019-07-02T16:20:15Z</updated>
<author>
<name>Jin Yao</name>
<email>yao.jin@linux.intel.com</email>
</author>
<published>2019-06-28T09:23:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f3810817b20645ffae809feb30e9fe260fbd6c4d'/>
<id>urn:sha1:f3810817b20645ffae809feb30e9fe260fbd6c4d</id>
<content type='text'>
The target is to compare the performance difference (cycles diff) for
the same basic blocks in different data files.

The same basic block means same function, same start address and same
end address. This patch finds the same basic blocks from different data
files and link them together and resort by the cycles diff.

 v3:
 ---
 The block stuffs are maintained by new structure 'block_hist',
 so this patch is update accordingly.

 v2:
 ---
 Since now the basic block hists is changed to per symbol,
 the patch only links the basic block hists for the same
 symbol in different data files.

Signed-off-by: Jin Yao &lt;yao.jin@linux.intel.com&gt;
Reviewed-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Andi Kleen &lt;ak@linux.intel.com&gt;
Cc: Jin Yao &lt;yao.jin@intel.com&gt;
Cc: Kan Liang &lt;kan.liang@linux.intel.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Link: http://lkml.kernel.org/r/1561713784-30533-6-git-send-email-yao.jin@linux.intel.com
[ sym-&gt;name is an array, not a pointer, so no need to check it for NULL, fixes de build in some distros ]
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
<entry>
<title>perf diff: Use hists to manage basic blocks per symbol</title>
<updated>2019-07-02T15:47:07Z</updated>
<author>
<name>Jin Yao</name>
<email>yao.jin@linux.intel.com</email>
</author>
<published>2019-06-28T09:23:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=99150a1faab2963d3f5bf353354afe79bdddb75f'/>
<id>urn:sha1:99150a1faab2963d3f5bf353354afe79bdddb75f</id>
<content type='text'>
The hist__account_cycles() can account cycles per basic block. The basic
block information is saved in cycles_hist structure.

This patch processes each symbol, get basic blocks from cycles_hist and
add the basic block entries to a new hists (in 'struct block_hist').
Using a hists is because we need to compare, sort and print the basic
blocks later.

 v6:
 ---
 Since 'ops' argument is removed from hists__add_entry_block,
 update the code accordingly. No functional change.

 v5:
 ---
 Since now we still carry block_info in 'struct hist_entry'
 we don't need to use our own new/free ops for hist entries.
 And the block_info is released in hist_entry__delete.

 v3:
 ---
 1. In v2, we put block stuffs in 'struct hist_entry', but
 it's not a good design. In v3, we create a new
 'struct block_hist' and cast the 'struct hist_entry' to
 'struct block_hist' in some places, which can avoid adding
 new stuffs in 'struct hist_entry'.

 2. abs() -&gt; labs(), in block_cycles_diff_cmp().

 v2:
 ---
 v1 adds the basic block entries to per data-file hists
 but v2 adds the basic block entries to per symbol hists.
 That is to keep current perf-diff format. Will show the
 result in next patches.

Signed-off-by: Jin Yao &lt;yao.jin@linux.intel.com&gt;
Reviewed-by: Jiri Olsa &lt;jolsa@kernel.org&gt;
Cc: Alexander Shishkin &lt;alexander.shishkin@linux.intel.com&gt;
Cc: Andi Kleen &lt;ak@linux.intel.com&gt;
Cc: Jin Yao &lt;yao.jin@intel.com&gt;
Cc: Kan Liang &lt;kan.liang@linux.intel.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Link: http://lkml.kernel.org/r/1561713784-30533-5-git-send-email-yao.jin@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo &lt;acme@redhat.com&gt;
</content>
</entry>
</feed>
