From: Don Zickus <dzickus@redhat.com>
To: acme@ghostprotocols.net, peterz@infradead.org
Cc: LKML <linux-kernel@vger.kernel.org>,
jolsa@redhat.com, jmario@redhat.com, fowles@inreach.com,
eranian@google.com, andi.kleen@intel.com,
Don Zickus <dzickus@redhat.com>
Subject: [PATCH 6/6] perf, sort: Allow unique sorting instead of combining hist_entries
Date: Mon, 24 Mar 2014 15:34:36 -0400 [thread overview]
Message-ID: <1395689676-214799-7-git-send-email-dzickus@redhat.com> (raw)
In-Reply-To: <1395689676-214799-1-git-send-email-dzickus@redhat.com>
The cache contention tools needs to keep all the perf records unique in order
to properly parse all the data. Currently add_hist_entry() will combine
the duplicate record and add the weight/period to the existing record.
This throws away the unique data the cache contention tool needs (mainly
the data source). Create a flag to force the records to stay unique.
Signed-off-by: Don Zickus <dzickus@redhat.com>
---
tools/perf/util/hist.c | 3 ++-
tools/perf/util/sort.c | 1 +
tools/perf/util/sort.h | 1 +
3 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 81f47ee..69d2cb9 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -378,7 +378,8 @@ static struct hist_entry *add_hist_entry(struct hists *hists,
*/
cmp = hist_entry__cmp(he, entry);
- if (!cmp) {
+ if (!cmp && !sort__wants_unique) {
+
he_stat__add_period(&he->stat, period, weight);
/*
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index be675f4..ca86b23 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -15,6 +15,7 @@ int sort__need_collapse = 0;
int sort__has_parent = 0;
int sort__has_sym = 0;
int sort__has_dso = 0;
+int sort__wants_unique = 0;
enum sort_mode sort__mode = SORT_MODE__NORMAL;
enum sort_type sort__first_dimension;
diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h
index b1f52a8..b005445 100644
--- a/tools/perf/util/sort.h
+++ b/tools/perf/util/sort.h
@@ -33,6 +33,7 @@ extern int have_ignore_callees;
extern int sort__need_collapse;
extern int sort__has_parent;
extern int sort__has_sym;
+extern int sort__wants_unique;
extern enum sort_mode sort__mode;
extern struct sort_entry sort_comm;
extern struct sort_entry sort_dso;
--
1.7.11.7
next prev parent reply other threads:[~2014-03-24 19:37 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-24 19:34 [PATCH 0/6] perf, events: Enable mmap2 support Don Zickus
2014-03-24 19:34 ` [PATCH 1/6] events, perf: Pass protection and flags bits through mmap2 interface Don Zickus
2014-03-24 19:34 ` [PATCH 2/6] perf: Update mmap2 interface with protection and flag bits Don Zickus
2014-04-09 2:17 ` Namhyung Kim
2014-04-09 2:20 ` Namhyung Kim
2014-03-24 19:34 ` [PATCH 3/6] Revert "perf: Disable PERF_RECORD_MMAP2 support" Don Zickus
2014-04-09 2:32 ` Namhyung Kim
2014-03-24 19:34 ` [PATCH 4/6] perf, sort: Add physid sorting based on mmap2 data Don Zickus
2014-03-24 19:54 ` Andi Kleen
2014-03-24 20:17 ` Don Zickus
2014-03-24 20:20 ` Andi Kleen
2014-03-24 20:26 ` Don Zickus
2014-03-24 20:54 ` [PATCH 01/15 V3] perf: Fix stddev calculation Don Zickus
2014-03-24 20:57 ` Don Zickus
2014-03-24 20:57 ` [PATCH 4/6 V2] perf, sort: Add physid sorting based on mmap2 data Don Zickus
2014-03-29 17:11 ` Jiri Olsa
2014-04-01 2:58 ` Don Zickus
2014-04-09 5:21 ` Namhyung Kim
2014-04-09 5:45 ` Peter Zijlstra
2014-04-09 3:06 ` [PATCH 4/6] " Don Zickus
2014-03-24 19:34 ` [PATCH 5/6] perf: Update sort to handle MAP_SHARED bits Don Zickus
2014-03-24 19:34 ` Don Zickus [this message]
2014-04-09 5:31 ` [PATCH 6/6] perf, sort: Allow unique sorting instead of combining hist_entries Namhyung Kim
2014-04-09 13:57 ` Don Zickus
2014-04-10 5:09 ` Namhyung Kim
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=1395689676-214799-7-git-send-email-dzickus@redhat.com \
--to=dzickus@redhat.com \
--cc=acme@ghostprotocols.net \
--cc=andi.kleen@intel.com \
--cc=eranian@google.com \
--cc=fowles@inreach.com \
--cc=jmario@redhat.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
/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
Powered by JetHome