From: tip-bot for Namhyung Kim <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: a.p.zijlstra@chello.nl, tglx@linutronix.de,
linux-kernel@vger.kernel.org, kan.liang@intel.com,
jolsa@redhat.com, hpa@zytor.com, namhyung@kernel.org,
acme@redhat.com, mingo@kernel.org, jolsa@kernel.org
Subject: [tip:perf/core] perf diff: Introduce fmt_to_data_file() helper
Date: Wed, 28 Jan 2015 07:07:29 -0800 [thread overview]
Message-ID: <tip-ff21cef67e85ae77682560973b8c80ef64125221@git.kernel.org> (raw)
In-Reply-To: <1420677949-6719-5-git-send-email-namhyung@kernel.org>
Commit-ID: ff21cef67e85ae77682560973b8c80ef64125221
Gitweb: http://git.kernel.org/tip/ff21cef67e85ae77682560973b8c80ef64125221
Author: Namhyung Kim <namhyung@kernel.org>
AuthorDate: Thu, 8 Jan 2015 09:45:45 +0900
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 21 Jan 2015 13:24:34 -0300
perf diff: Introduce fmt_to_data_file() helper
The fmt_to_data_file() is to retrieve struct data__file from
perf_hpp_fmt which is embedded in diff_hpp_fmt. It'll be used by sort
callback functions later.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1420677949-6719-5-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-diff.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c
index 3f86737..ae8f621 100644
--- a/tools/perf/builtin-diff.c
+++ b/tools/perf/builtin-diff.c
@@ -390,6 +390,15 @@ static void perf_evlist__collapse_resort(struct perf_evlist *evlist)
}
}
+static struct data__file *fmt_to_data_file(struct perf_hpp_fmt *fmt)
+{
+ struct diff_hpp_fmt *dfmt = container_of(fmt, struct diff_hpp_fmt, fmt);
+ void *ptr = dfmt - dfmt->idx;
+ struct data__file *d = container_of(ptr, struct data__file, fmt);
+
+ return d;
+}
+
static struct hist_entry*
get_pair_data(struct hist_entry *he, struct data__file *d)
{
@@ -407,8 +416,7 @@ get_pair_data(struct hist_entry *he, struct data__file *d)
static struct hist_entry*
get_pair_fmt(struct hist_entry *he, struct diff_hpp_fmt *dfmt)
{
- void *ptr = dfmt - dfmt->idx;
- struct data__file *d = container_of(ptr, struct data__file, fmt);
+ struct data__file *d = fmt_to_data_file(&dfmt->fmt);
return get_pair_data(he, d);
}
next prev parent reply other threads:[~2015-01-28 21:23 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-08 0:45 [PATCHSET 0/7] perf diff: Fix and improve output ordering (v2) Namhyung Kim
2015-01-08 0:45 ` [PATCH 1/7] perf diff: Fix to sort by baseline field by default Namhyung Kim
2015-01-08 0:45 ` [PATCH 2/7] perf diff: Get rid of hists__compute_resort() Namhyung Kim
2015-01-08 0:45 ` [PATCH 3/7] perf diff: Print diff result more precisely Namhyung Kim
2015-01-08 0:45 ` [PATCH 4/7] perf diff: Introduce fmt_to_data_file() helper Namhyung Kim
2015-01-28 15:07 ` tip-bot for Namhyung Kim [this message]
2015-01-08 0:45 ` [PATCH 5/7] perf tools: Pass struct perf_hpp_fmt to its callbacks Namhyung Kim
2015-01-12 16:21 ` Arnaldo Carvalho de Melo
2015-01-12 16:27 ` Arnaldo Carvalho de Melo
2015-01-12 16:39 ` Arnaldo Carvalho de Melo
2015-01-12 16:40 ` Jiri Olsa
2015-01-12 16:44 ` Arnaldo Carvalho de Melo
2015-01-14 1:35 ` Namhyung Kim
2015-01-28 15:07 ` [tip:perf/core] " tip-bot for Namhyung Kim
2015-01-08 0:45 ` [PATCH 6/7] perf diff: Fix output ordering to honor next column Namhyung Kim
2015-01-28 15:08 ` [tip:perf/core] " tip-bot for Namhyung Kim
2015-01-08 0:45 ` [PATCH 7/7] perf diff: Fix -o/--order option behavior Namhyung Kim
2015-01-28 15:08 ` [tip:perf/core] " tip-bot for Namhyung Kim
2015-01-08 14:42 ` [PATCHSET 0/7] perf diff: Fix and improve output ordering (v2) Jiri Olsa
2015-01-12 16:40 ` Arnaldo Carvalho de Melo
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-ff21cef67e85ae77682560973b8c80ef64125221@git.kernel.org \
--to=tipbot@zytor.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=hpa@zytor.com \
--cc=jolsa@kernel.org \
--cc=jolsa@redhat.com \
--cc=kan.liang@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.