diff options
author | Jiri Olsa <jolsa@redhat.com> | 2013-01-31 17:31:11 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-07-12 12:53:57 -0400 |
commit | 2c5d4b4a087c448d7818b89294c98d4977dfe76c (patch) | |
tree | 78a9c1ae951002fe5861684a8e539cdb4fc4e4a4 /tools/perf/ui/gtk | |
parent | b21484f1a1f300d422cfe5d4f8f50015e22cea24 (diff) |
perf tools: Add struct perf_hpp_fmt into hpp callbacks
Adding 'struct perf_hpp_fmt' into hpp callbacks, so commands can access
their private data.
It'll be handy for diff command in future to be able to access file
related data for each column.
Signed-off-by: Jiri Olsa <jolsa@redhat.com>
Reviewed-by: Namhyung Kim <namhyung@kernel.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-7vy2m18574b1bicoljn8e9lw@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/ui/gtk')
-rw-r--r-- | tools/perf/ui/gtk/hists.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/perf/ui/gtk/hists.c b/tools/perf/ui/gtk/hists.c index 32549035f50d..cb2ed1980147 100644 --- a/tools/perf/ui/gtk/hists.c +++ b/tools/perf/ui/gtk/hists.c | |||
@@ -91,7 +91,8 @@ static u64 he_get_##_field(struct hist_entry *he) \ | |||
91 | return he->stat._field; \ | 91 | return he->stat._field; \ |
92 | } \ | 92 | } \ |
93 | \ | 93 | \ |
94 | static int perf_gtk__hpp_color_##_type(struct perf_hpp *hpp, \ | 94 | static int perf_gtk__hpp_color_##_type(struct perf_hpp_fmt *fmt __maybe_unused, \ |
95 | struct perf_hpp *hpp, \ | ||
95 | struct hist_entry *he) \ | 96 | struct hist_entry *he) \ |
96 | { \ | 97 | { \ |
97 | return __hpp__color_fmt(hpp, he, he_get_##_field); \ | 98 | return __hpp__color_fmt(hpp, he, he_get_##_field); \ |
@@ -244,7 +245,7 @@ static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists, | |||
244 | col_idx = 0; | 245 | col_idx = 0; |
245 | 246 | ||
246 | perf_hpp__for_each_format(fmt) { | 247 | perf_hpp__for_each_format(fmt) { |
247 | fmt->header(&hpp); | 248 | fmt->header(fmt, &hpp); |
248 | 249 | ||
249 | gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view), | 250 | gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view), |
250 | -1, ltrim(s), | 251 | -1, ltrim(s), |
@@ -296,9 +297,9 @@ static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists, | |||
296 | 297 | ||
297 | perf_hpp__for_each_format(fmt) { | 298 | perf_hpp__for_each_format(fmt) { |
298 | if (fmt->color) | 299 | if (fmt->color) |
299 | fmt->color(&hpp, h); | 300 | fmt->color(fmt, &hpp, h); |
300 | else | 301 | else |
301 | fmt->entry(&hpp, h); | 302 | fmt->entry(fmt, &hpp, h); |
302 | 303 | ||
303 | gtk_tree_store_set(store, &iter, col_idx++, s, -1); | 304 | gtk_tree_store_set(store, &iter, col_idx++, s, -1); |
304 | } | 305 | } |