Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1423795
| From | tip-bot for Jiri Olsa <tipbot@zytor.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [tip:perf/core] perf hists: Replace perf_evsel arg perf_hpp_fmt's header callback |
| Date | 2016-06-16 10:40 +0200 |
| Message-ID | <rKB0d-5XD-21@gated-at.bofh.it> (permalink) |
| References | <rK1g6-8wa-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Commit-ID: 053721736011ee52e83b8e8794d922d1c511a4d3
Gitweb: http://git.kernel.org/tip/053721736011ee52e83b8e8794d922d1c511a4d3
Author: Jiri Olsa <jolsa@kernel.org>
AuthorDate: Tue, 14 Jun 2016 20:19:19 +0200
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 15 Jun 2016 10:49:18 -0300
perf hists: Replace perf_evsel arg perf_hpp_fmt's header callback
Replacing perf_evsel arg perf_hpp_fmt's header callback with hists
object.
None of the actual callbacks actually use evsel object, also this will
be helpful in future for non evsel related hist browsers.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1465928361-2442-10-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-diff.c | 2 +-
tools/perf/ui/browsers/hists.c | 6 +++---
tools/perf/ui/gtk/hists.c | 2 +-
tools/perf/ui/hist.c | 4 ++--
tools/perf/ui/stdio/hist.c | 6 +++---
tools/perf/util/hist.h | 2 +-
tools/perf/util/sort.c | 6 +++---
7 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c
index 69bad45..b75ea77 100644
--- a/tools/perf/builtin-diff.c
+++ b/tools/perf/builtin-diff.c
@@ -1045,7 +1045,7 @@ static int hpp__entry_global(struct perf_hpp_fmt *_fmt, struct perf_hpp *hpp,
}
static int hpp__header(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp,
- struct perf_evsel *evsel __maybe_unused)
+ struct hists *hists __maybe_unused)
{
struct diff_hpp_fmt *dfmt =
container_of(fmt, struct diff_hpp_fmt, fmt);
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index e21ea52..c20425d 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -1531,7 +1531,7 @@ static int hists_browser__scnprintf_headers(struct hist_browser *browser, char *
if (perf_hpp__should_skip(fmt, hists) || column++ < browser->b.horiz_scroll)
continue;
- ret = fmt->header(fmt, &dummy_hpp, hists_to_evsel(hists));
+ ret = fmt->header(fmt, &dummy_hpp, hists);
if (advance_hpp_check(&dummy_hpp, ret))
break;
@@ -1568,7 +1568,7 @@ static int hists_browser__scnprintf_hierarchy_headers(struct hist_browser *brows
if (column++ < browser->b.horiz_scroll)
continue;
- ret = fmt->header(fmt, &dummy_hpp, hists_to_evsel(hists));
+ ret = fmt->header(fmt, &dummy_hpp, hists);
if (advance_hpp_check(&dummy_hpp, ret))
break;
@@ -1605,7 +1605,7 @@ static int hists_browser__scnprintf_hierarchy_headers(struct hist_browser *brows
}
first_col = false;
- ret = fmt->header(fmt, &dummy_hpp, hists_to_evsel(hists));
+ ret = fmt->header(fmt, &dummy_hpp, hists);
dummy_hpp.buf[ret] = '\0';
start = trim(dummy_hpp.buf);
diff --git a/tools/perf/ui/gtk/hists.c b/tools/perf/ui/gtk/hists.c
index 932adfa..e5c1325 100644
--- a/tools/perf/ui/gtk/hists.c
+++ b/tools/perf/ui/gtk/hists.c
@@ -549,7 +549,7 @@ static void perf_gtk__show_hierarchy(GtkWidget *window, struct hists *hists,
strcat(buf, "+");
first_col = false;
- fmt->header(fmt, &hpp, hists_to_evsel(hists));
+ fmt->header(fmt, &hpp, hists);
strcat(buf, ltrim(rtrim(hpp.buf)));
}
}
diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c
index af07ffb..0b232d6 100644
--- a/tools/perf/ui/hist.c
+++ b/tools/perf/ui/hist.c
@@ -229,9 +229,9 @@ static int hpp__width_fn(struct perf_hpp_fmt *fmt,
}
static int hpp__header_fn(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp,
- struct perf_evsel *evsel)
+ struct hists *hists)
{
- int len = hpp__width_fn(fmt, hpp, evsel);
+ int len = hpp__width_fn(fmt, hpp, hists_to_evsel(hists));
return scnprintf(hpp->buf, hpp->size, "%*s", len, fmt->name);
}
diff --git a/tools/perf/ui/stdio/hist.c b/tools/perf/ui/stdio/hist.c
index 9a972cb..d0534fa 100644
--- a/tools/perf/ui/stdio/hist.c
+++ b/tools/perf/ui/stdio/hist.c
@@ -549,7 +549,7 @@ static int print_hierarchy_header(struct hists *hists, struct perf_hpp *hpp,
struct perf_hpp_list_node, list);
perf_hpp_list__for_each_format(&fmt_node->hpp, fmt) {
- fmt->header(fmt, hpp, hists_to_evsel(hists));
+ fmt->header(fmt, hpp, hists);
fprintf(fp, "%s%s", hpp->buf, sep ?: " ");
}
@@ -569,7 +569,7 @@ static int print_hierarchy_header(struct hists *hists, struct perf_hpp *hpp,
header_width += fprintf(fp, "+");
first_col = false;
- fmt->header(fmt, hpp, hists_to_evsel(hists));
+ fmt->header(fmt, hpp, hists);
header_width += fprintf(fp, "%s", trim(hpp->buf));
}
@@ -658,7 +658,7 @@ hists__fprintf_standard_headers(struct hists *hists,
else
first = false;
- fmt->header(fmt, hpp, hists_to_evsel(hists));
+ fmt->header(fmt, hpp, hists);
fprintf(fp, "%s", hpp->buf);
}
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
index a73fde0..aae932f 100644
--- a/tools/perf/util/hist.h
+++ b/tools/perf/util/hist.h
@@ -215,7 +215,7 @@ struct perf_hpp {
struct perf_hpp_fmt {
const char *name;
int (*header)(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp,
- struct perf_evsel *evsel);
+ struct hists *hists);
int (*width)(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp,
struct perf_evsel *evsel);
int (*color)(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp,
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index ba5b42f..3e52c77 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -1488,7 +1488,7 @@ void perf_hpp__reset_sort_width(struct perf_hpp_fmt *fmt, struct hists *hists)
}
static int __sort__hpp_header(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp,
- struct perf_evsel *evsel)
+ struct hists *hists)
{
struct hpp_sort_entry *hse;
size_t len = fmt->user_len;
@@ -1496,7 +1496,7 @@ static int __sort__hpp_header(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp,
hse = container_of(fmt, struct hpp_sort_entry, hpp);
if (!len)
- len = hists__col_len(evsel__hists(evsel), hse->se->se_width_idx);
+ len = hists__col_len(hists, hse->se->se_width_idx);
return scnprintf(hpp->buf, hpp->size, "%-*.*s", len, len, fmt->name);
}
@@ -1793,7 +1793,7 @@ static void update_dynamic_len(struct hpp_dynamic_entry *hde,
}
static int __sort__hde_header(struct perf_hpp_fmt *fmt, struct perf_hpp *hpp,
- struct perf_evsel *evsel __maybe_unused)
+ struct hists *hists __maybe_unused)
{
struct hpp_dynamic_entry *hde;
size_t len = fmt->user_len;
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 00/11] perf tools: Various fixes Jiri Olsa <jolsa@kernel.org> - 2016-06-14 20:20 +0200
[PATCH 07/11] perf tools stdio: Do not pass hists in hist_entry__fprintf Jiri Olsa <jolsa@kernel.org> - 2016-06-14 20:30 +0200
[tip:perf/core] perf stdio: Do not pass hists in hist_entry__fprintf tip-bot for Jiri Olsa <tipbot@zytor.com> - 2016-06-16 10:40 +0200
[PATCH 05/11] perf tools stdio: Separate hierarchy headers output Jiri Olsa <jolsa@kernel.org> - 2016-06-14 20:30 +0200
[tip:perf/core] perf stdio: Separate hierarchy headers output tip-bot for Jiri Olsa <tipbot@zytor.com> - 2016-06-16 10:40 +0200
[PATCH 06/11] perf tools stdio: Separate standard headers output Jiri Olsa <jolsa@kernel.org> - 2016-06-14 20:30 +0200
[tip:perf/core] perf stdio: Separate standard headers output tip-bot for Jiri Olsa <tipbot@zytor.com> - 2016-06-16 10:40 +0200
[PATCH 09/11] perf tools: Replace perf_evsel arg perf_hpp_fmt's header callback Jiri Olsa <jolsa@kernel.org> - 2016-06-14 20:30 +0200
[tip:perf/core] perf hists: Replace perf_evsel arg perf_hpp_fmt's header callback tip-bot for Jiri Olsa <tipbot@zytor.com> - 2016-06-16 10:40 +0200
[PATCH 08/11] perf tools stdio: Add use_callchain parameter to hists__fprintf Jiri Olsa <jolsa@kernel.org> - 2016-06-14 20:30 +0200
[tip:perf/core] perf stdio: Add use_callchain parameter to hists__fprintf tip-bot for Jiri Olsa <tipbot@zytor.com> - 2016-06-16 10:40 +0200
[PATCH 02/11] perf tools: Fix Data Object sort entry width index Jiri Olsa <jolsa@kernel.org> - 2016-06-14 20:30 +0200
[tip:perf/core] perf tools: Fix Data Object sort entry width index tip-bot for Jiri Olsa <tipbot@zytor.com> - 2016-06-16 10:40 +0200
[PATCH 11/11] perf tools: Rename __hists__add_entry to hists__add_entry Jiri Olsa <jolsa@kernel.org> - 2016-06-14 20:30 +0200
[tip:perf/core] perf hists: Rename __hists__add_entry to hists__add_entry tip-bot for Jiri Olsa <tipbot@zytor.com> - 2016-06-22 09:50 +0200
csiph-web