From: tip-bot for Ian Munsie <imunsie@au1.ibm.com>
To: linux-tip-commits@vger.kernel.org
Cc: acme@redhat.com, linux-kernel@vger.kernel.org, paulus@samba.org,
hpa@zytor.com, mingo@redhat.com, peterz@infradead.org,
imunsie@au1.ibm.com, fweisbec@gmail.com, tglx@linutronix.de,
mingo@elte.hu
Subject: [tip:perf/core] perf record,report,annotate,diff: Process events in order
Date: Wed, 22 Dec 2010 11:29:26 GMT [thread overview]
Message-ID: <tip-eac23d1c384b55e4bbb89ea9e5a6bb77fb4d1140@git.kernel.org> (raw)
In-Reply-To: <1291872833-839-1-git-send-email-imunsie@au1.ibm.com>
Commit-ID: eac23d1c384b55e4bbb89ea9e5a6bb77fb4d1140
Gitweb: http://git.kernel.org/tip/eac23d1c384b55e4bbb89ea9e5a6bb77fb4d1140
Author: Ian Munsie <imunsie@au1.ibm.com>
AuthorDate: Thu, 9 Dec 2010 16:33:53 +1100
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 21 Dec 2010 20:17:51 -0200
perf record,report,annotate,diff: Process events in order
This patch changes perf report to ask for the ID info on all events be
default if recording from multiple CPUs.
Perf report, annotate and diff will now process the events in order if
the kernel is able to provide timestamps on all events. This ensures
that events such as COMM and MMAP which are necessary to correctly
interpret samples are processed prior to those samples so that they are
attributed correctly.
Before:
# perf record ./cachetest
# perf report
# Events: 6K cycles
#
# Overhead Command Shared Object Symbol
# ........ ....... ................. ...............................
#
74.11% :3259 [unknown] [k] 0x4a6c
1.50% cachetest ld-2.11.2.so [.] 0x1777c
1.46% :3259 [kernel.kallsyms] [k] .perf_event_mmap_ctx
1.25% :3259 [kernel.kallsyms] [k] restore
0.74% :3259 [kernel.kallsyms] [k] ._raw_spin_lock
0.71% :3259 [kernel.kallsyms] [k] .filemap_fault
0.66% :3259 [kernel.kallsyms] [k] .memset
0.54% cachetest [kernel.kallsyms] [k] .sha_transform
0.54% :3259 [kernel.kallsyms] [k] .copy_4K_page
0.54% :3259 [kernel.kallsyms] [k] .find_get_page
0.52% :3259 [kernel.kallsyms] [k] .trace_hardirqs_off
0.50% :3259 [kernel.kallsyms] [k] .__do_fault
<SNIP>
After:
# perf report
# Events: 6K cycles
#
# Overhead Command Shared Object Symbol
# ........ ....... ................. ...............................
#
44.28% cachetest cachetest [.] sumArrayNaive
22.53% cachetest cachetest [.] sumArrayOptimal
6.59% cachetest ld-2.11.2.so [.] 0x1777c
2.13% cachetest [unknown] [k] 0x340
1.46% cachetest [kernel.kallsyms] [k] .perf_event_mmap_ctx
1.25% cachetest [kernel.kallsyms] [k] restore
0.74% cachetest [kernel.kallsyms] [k] ._raw_spin_lock
0.71% cachetest [kernel.kallsyms] [k] .filemap_fault
0.66% cachetest [kernel.kallsyms] [k] .memset
0.54% cachetest [kernel.kallsyms] [k] .copy_4K_page
0.54% cachetest [kernel.kallsyms] [k] .find_get_page
0.54% cachetest [kernel.kallsyms] [k] .sha_transform
0.52% cachetest [kernel.kallsyms] [k] .trace_hardirqs_off
0.50% cachetest [kernel.kallsyms] [k] .__do_fault
<SNIP>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
LKML-Reference: <1291872833-839-1-git-send-email-imunsie@au1.ibm.com>
Signed-off-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-annotate.c | 2 ++
tools/perf/builtin-diff.c | 2 ++
tools/perf/builtin-record.c | 5 ++++-
tools/perf/builtin-report.c | 2 ++
4 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 48dbab4..c056cdc 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -375,6 +375,8 @@ static struct perf_event_ops event_ops = {
.mmap = event__process_mmap,
.comm = event__process_comm,
.fork = event__process_task,
+ .ordered_samples = true,
+ .ordering_requires_timestamps = true,
};
static int __cmd_annotate(void)
diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c
index af84e1c..97846dc 100644
--- a/tools/perf/builtin-diff.c
+++ b/tools/perf/builtin-diff.c
@@ -61,6 +61,8 @@ static struct perf_event_ops event_ops = {
.exit = event__process_task,
.fork = event__process_task,
.lost = event__process_lost,
+ .ordered_samples = true,
+ .ordering_requires_timestamps = true,
};
static void perf_session__insert_hist_entry_by_name(struct rb_root *root,
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index efd1b3c..5149e3d 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -285,7 +285,7 @@ static void create_counter(int counter, int cpu)
if (system_wide)
attr->sample_type |= PERF_SAMPLE_CPU;
- if (sample_time)
+ if (sample_time || system_wide || !no_inherit || cpu_list)
attr->sample_type |= PERF_SAMPLE_TIME;
if (raw_samples) {
@@ -327,6 +327,9 @@ try_again:
* Old kernel, no attr->sample_id_type_all field
*/
sample_id_all_avail = false;
+ if (!sample_time && !raw_samples)
+ attr->sample_type &= ~PERF_SAMPLE_TIME;
+
goto retry_sample_id;
}
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index fd4c450..4af7ce6 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -244,6 +244,8 @@ static struct perf_event_ops event_ops = {
.event_type = event__process_event_type,
.tracing_data = event__process_tracing_data,
.build_id = event__process_build_id,
+ .ordered_samples = true,
+ .ordering_requires_timestamps = true,
};
extern volatile int session_done;
prev parent reply other threads:[~2010-12-22 11:29 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-07 12:48 [patch 0/9] perf: Consolidate the event handling and ordering Thomas Gleixner
2010-12-07 12:48 ` [patch 1/9] perf: tools: Prevent unbound event__name array access Thomas Gleixner
2010-12-09 23:37 ` [tip:perf/core] perf event: " tip-bot for Thomas Gleixner
2010-12-07 12:48 ` [patch 2/9] perf: session: Dont queue events w/o timestamps Thomas Gleixner
2010-12-09 23:37 ` [tip:perf/core] perf " tip-bot for Thomas Gleixner
2010-12-07 12:48 ` [patch 3/9] perf: session: Consolidate the dump code Thomas Gleixner
2010-12-09 3:54 ` Ian Munsie
2010-12-09 23:37 ` [tip:perf/core] perf " tip-bot for Thomas Gleixner
2010-12-07 12:48 ` [patch 4/9] perf: session: Store file offset in sample_queue Thomas Gleixner
2010-12-09 3:56 ` Ian Munsie
2010-12-09 23:38 ` [tip:perf/core] perf " tip-bot for Thomas Gleixner
2010-12-07 12:48 ` [patch 5/9] perf: session: Add file_offset to event delivery function Thomas Gleixner
2010-12-09 3:57 ` Ian Munsie
2010-12-09 23:38 ` [tip:perf/core] perf " tip-bot for Thomas Gleixner
2010-12-07 12:48 ` [patch 6/9] perf: session: Move dump code to event delivery path Thomas Gleixner
2010-12-09 3:58 ` Ian Munsie
2010-12-09 23:38 ` [tip:perf/core] perf " tip-bot for Thomas Gleixner
2010-12-07 12:48 ` [patch 7/9] perf: session: Split out sample preprocessing Thomas Gleixner
2010-12-09 23:39 ` [tip:perf/core] perf " tip-bot for Thomas Gleixner
2010-12-07 12:49 ` [patch 8/9] perf: session: Split out user event processing Thomas Gleixner
2010-12-09 23:39 ` [tip:perf/core] perf " tip-bot for Thomas Gleixner
2010-12-07 12:49 ` [patch 9/9] pref: session: Break event ordering when timestamps are missing Thomas Gleixner
2010-12-09 3:50 ` Ian Munsie
2010-12-09 13:58 ` Thomas Gleixner
2010-12-09 17:32 ` Arnaldo Carvalho de Melo
2010-12-10 3:36 ` Ian Munsie
2010-12-22 11:29 ` [tip:perf/core] perf session: Fallback to unordered processing if no sample_id_all tip-bot for Ian Munsie
2010-12-08 20:24 ` [patch 0/9] perf: Consolidate the event handling and ordering Arnaldo Carvalho de Melo
2010-12-09 5:54 ` Ian Munsie
2010-12-09 5:33 ` [PATCH v4] perf record,report,annotate,diff: Process events in order Ian Munsie
2010-12-22 11:29 ` tip-bot for Ian Munsie [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-eac23d1c384b55e4bbb89ea9e5a6bb77fb4d1140@git.kernel.org \
--to=imunsie@au1.ibm.com \
--cc=acme@redhat.com \
--cc=fweisbec@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=mingo@redhat.com \
--cc=paulus@samba.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox