public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] Add multiple event support to perf report V2
@ 2010-03-03 15:38 Eric B Munson
  2010-03-03 15:38 ` [PATCH 1/5] Add ID and to recorded event data when recording multiple events Eric B Munson
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Eric B Munson @ 2010-03-03 15:38 UTC (permalink / raw)
  To: a.p.zijlstra; +Cc: paulus, mingo, acme, linux-kernel, Eric B Munson

Currently perf report is unable to handle multiple events even though
perf record is capable of capturing such a stream.  For instance if we run
'perf record -e dtlb-misses -e cache-misses sleep 5'
today and then ask report to show the results we get:

# Samples: 18866
#
# Overhead  Command      Shared Object  Symbol
# ........  .......  .................  ......
#
    47.52%    sleep  [kernel.kallsyms]  [k] page_fault
    32.93%    sleep  [kernel.kallsyms]  [k] locks_remove_posix
     8.52%    sleep  [kernel.kallsyms]  [k] acl_permission_check
     3.46%    sleep  [kernel.kallsyms]  [k] __wake_up_bit
     3.31%    sleep  [kernel.kallsyms]  [k] vfs_read
     3.23%    sleep  [kernel.kallsyms]  [k] kmem_cache_alloc
     0.56%    sleep  [kernel.kallsyms]  [k] get_page_from_freelist
     0.15%    sleep  [kernel.kallsyms]  [k] pipe_read
     0.13%    sleep  [kernel.kallsyms]  [k] pipe_lock_nested
     0.13%    sleep  [kernel.kallsyms]  [k] mm_alloc
     0.06%    sleep  [kernel.kallsyms]  [k] mm_init
#
# (For a higher level overview, try: perf report --sort comm,dso)
#

Worse than only reporting on one of the events, perf report has
summed the two events. i.e. There is no distinguishing between
dtlb-misses and cache-misses.

This set of patches addresses this problem and now when perf report
is run with the same event stream that produced the above report, the
output is this:

# Samples: 8620 cache-misses
#
# Overhead  Command      Shared Object  Symbol
# ........  .......  .................  ......
#
    72.06%    sleep  [kernel.kallsyms]  [k] locks_remove_posix
    18.64%    sleep  [kernel.kallsyms]  [k] acl_permission_check
     7.56%    sleep  [kernel.kallsyms]  [k] __wake_up_bit
     1.22%    sleep  [kernel.kallsyms]  [k] get_page_from_freelist
     0.34%    sleep  [kernel.kallsyms]  [k] pipe_read
     0.13%    sleep  [kernel.kallsyms]  [k] mm_init
     0.02%    sleep  [kernel.kallsyms]  [k] pipe_lock_nested
     0.01%    sleep  [kernel.kallsyms]  [k] mm_alloc
     0.01%    sleep  [kernel.kallsyms]  [k] kmem_cache_alloc


# Samples: 10246 dTLB-load-misses
#
# Overhead  Command      Shared Object  Symbol
# ........  .......  .................  ......
#
    87.51%    sleep  [kernel.kallsyms]  [k] page_fault
     6.10%    sleep  [kernel.kallsyms]  [k] vfs_read
     5.94%    sleep  [kernel.kallsyms]  [k] kmem_cache_alloc
     0.22%    sleep  [kernel.kallsyms]  [k] mm_alloc
     0.22%    sleep  [kernel.kallsyms]  [k] pipe_lock_nested


#
# (For a higher level overview, try: perf report --sort comm,dso)
#

Changlog:
>From V1:
-Removed STREAM_ID from recorded attributes
-Only record SAMPLE_ID if more than one event is requested

Eric B Munson (5):
  Add ID and to recorded event data when recording multiple events
  Change add_hist_entry to take the tree root instead of session
  Add storage for seperating event types in report
  Change perf_session post processing functions to take histogram tree
  Add multiple event support to perf report

 tools/perf/builtin-annotate.c |    6 +-
 tools/perf/builtin-diff.c     |   12 +++--
 tools/perf/builtin-record.c   |    3 +
 tools/perf/builtin-report.c   |  111 ++++++++++++++++++++++++++++++++++++-----
 tools/perf/util/event.h       |    9 +++
 tools/perf/util/hist.c        |   45 +++++++++--------
 tools/perf/util/hist.h        |   12 +++--
 tools/perf/util/session.c     |    1 +
 tools/perf/util/session.h     |    1 +
 9 files changed, 153 insertions(+), 47 deletions(-)


^ permalink raw reply	[flat|nested] 9+ messages in thread
* [PATCH 1/5] Add ID and STREAM_ID to recorded event data
  2010-03-02 14:42     ` [PATCH 0/5] [RFC] Add multiple event support to perf report Eric B Munson
@ 2010-03-02 14:42 Eric B Munson
  2010-03-02 14:42 ` [PATCH 2/5] Change add_hist_entry to take the tree root instead of session Eric B Munson
  0 siblings, 1 reply; 9+ messages in thread
From: Eric B Munson @ 2010-03-02 14:42 UTC (permalink / raw)
  To: a.p.zijlstra; +Cc: paulus, mingo, linux-kernel, Eric B Munson

Currently perf record does not write the ID or the STREAM_ID to disk
for events.  This doesn't allow report to tell if an event stream contains
one or more types of events.  This patch adds these two entries to the list
of data that record will write to disk.

Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
---
 tools/perf/builtin-record.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 771533c..35e4605 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -242,7 +242,8 @@ static void create_counter(int counter, int cpu, pid_t pid)
 				  PERF_FORMAT_TOTAL_TIME_RUNNING |
 				  PERF_FORMAT_ID;
 
-	attr->sample_type	|= PERF_SAMPLE_IP | PERF_SAMPLE_TID;
+	attr->sample_type	|= PERF_SAMPLE_IP | PERF_SAMPLE_TID |
+				   PERF_SAMPLE_ID | PERF_SAMPLE_STREAM_ID;
 
 	if (freq) {
 		attr->sample_type	|= PERF_SAMPLE_PERIOD;
-- 
1.6.3.3


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-03-05 15:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-03 15:38 [PATCH 0/5] Add multiple event support to perf report V2 Eric B Munson
2010-03-03 15:38 ` [PATCH 1/5] Add ID and to recorded event data when recording multiple events Eric B Munson
2010-03-03 15:38 ` [PATCH 2/5] Change add_hist_entry to take the tree root instead of session Eric B Munson
2010-03-03 15:38 ` [PATCH 3/5] Add storage for seperating event types in report Eric B Munson
2010-03-03 15:38 ` [PATCH 4/5] Change perf_session post processing functions to take histogram tree Eric B Munson
2010-03-05 15:09   ` Arnaldo Carvalho de Melo
2010-03-03 15:38 ` [PATCH 5/5] Add multiple event support to perf report Eric B Munson
2010-03-05 15:51 ` [PATCH 0/5] Add multiple event support to perf report V2 Arnaldo Carvalho de Melo
  -- strict thread matches above, loose matches on Subject: below --
2010-03-02 14:42 [PATCH 1/5] Add ID and STREAM_ID to recorded event data Eric B Munson
2010-03-02 14:42 ` [PATCH 2/5] Change add_hist_entry to take the tree root instead of session Eric B Munson
2010-03-02 14:42   ` [PATCH 3/5] Add storage for seperating event types in report Eric B Munson
2010-03-02 14:42     ` [PATCH 0/5] [RFC] Add multiple event support to perf report Eric B Munson
2010-03-02 14:42       ` [PATCH 4/5] Change perf_session post processing functions to take histogram tree Eric B Munson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox