diff options
author | Namhyung Kim <namhyung@kernel.org> | 2014-03-18 00:00:59 -0400 |
---|---|---|
committer | Jiri Olsa <jolsa@kernel.org> | 2014-05-21 05:45:36 -0400 |
commit | e67d49a72df9aa50841ad400f7a99405e4980ee4 (patch) | |
tree | 4983f50b79df146a310d3ef1b9bdfa7e2f73aae1 /tools/perf | |
parent | 6fe8c26d7ab9fbd6748fc40ca5fea1e3131e7236 (diff) |
perf tools: Skip elided sort entries
When it converted sort entries to hpp formats, it missed se->elide
handling, so add it for compatibility.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1400480762-22852-16-git-send-email-namhyung@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/ui/browsers/hists.c | 6 | ||||
-rw-r--r-- | tools/perf/ui/gtk/hists.c | 6 | ||||
-rw-r--r-- | tools/perf/ui/stdio/hist.c | 9 | ||||
-rw-r--r-- | tools/perf/util/hist.c | 9 | ||||
-rw-r--r-- | tools/perf/util/hist.h | 1 | ||||
-rw-r--r-- | tools/perf/util/sort.c | 11 |
6 files changed, 42 insertions, 0 deletions
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index 169224c31586..1c331b934ffc 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c | |||
@@ -711,6 +711,9 @@ static int hist_browser__show_entry(struct hist_browser *browser, | |||
711 | ui_browser__gotorc(&browser->b, row, 0); | 711 | ui_browser__gotorc(&browser->b, row, 0); |
712 | 712 | ||
713 | perf_hpp__for_each_format(fmt) { | 713 | perf_hpp__for_each_format(fmt) { |
714 | if (perf_hpp__should_skip(fmt)) | ||
715 | continue; | ||
716 | |||
714 | if (current_entry && browser->b.navkeypressed) { | 717 | if (current_entry && browser->b.navkeypressed) { |
715 | ui_browser__set_color(&browser->b, | 718 | ui_browser__set_color(&browser->b, |
716 | HE_COLORSET_SELECTED); | 719 | HE_COLORSET_SELECTED); |
@@ -1100,6 +1103,9 @@ static int hist_browser__fprintf_entry(struct hist_browser *browser, | |||
1100 | printed += fprintf(fp, "%c ", folded_sign); | 1103 | printed += fprintf(fp, "%c ", folded_sign); |
1101 | 1104 | ||
1102 | perf_hpp__for_each_format(fmt) { | 1105 | perf_hpp__for_each_format(fmt) { |
1106 | if (perf_hpp__should_skip(fmt)) | ||
1107 | continue; | ||
1108 | |||
1103 | if (!first) { | 1109 | if (!first) { |
1104 | ret = scnprintf(hpp.buf, hpp.size, " "); | 1110 | ret = scnprintf(hpp.buf, hpp.size, " "); |
1105 | advance_hpp(&hpp, ret); | 1111 | advance_hpp(&hpp, ret); |
diff --git a/tools/perf/ui/gtk/hists.c b/tools/perf/ui/gtk/hists.c index fd52669018ee..9d90683914d4 100644 --- a/tools/perf/ui/gtk/hists.c +++ b/tools/perf/ui/gtk/hists.c | |||
@@ -178,6 +178,9 @@ static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists, | |||
178 | col_idx = 0; | 178 | col_idx = 0; |
179 | 179 | ||
180 | perf_hpp__for_each_format(fmt) { | 180 | perf_hpp__for_each_format(fmt) { |
181 | if (perf_hpp__should_skip(fmt)) | ||
182 | continue; | ||
183 | |||
181 | fmt->header(fmt, &hpp, hists_to_evsel(hists)); | 184 | fmt->header(fmt, &hpp, hists_to_evsel(hists)); |
182 | 185 | ||
183 | gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view), | 186 | gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(view), |
@@ -222,6 +225,9 @@ static void perf_gtk__show_hists(GtkWidget *window, struct hists *hists, | |||
222 | col_idx = 0; | 225 | col_idx = 0; |
223 | 226 | ||
224 | perf_hpp__for_each_format(fmt) { | 227 | perf_hpp__for_each_format(fmt) { |
228 | if (perf_hpp__should_skip(fmt)) | ||
229 | continue; | ||
230 | |||
225 | if (fmt->color) | 231 | if (fmt->color) |
226 | fmt->color(fmt, &hpp, h); | 232 | fmt->color(fmt, &hpp, h); |
227 | else | 233 | else |
diff --git a/tools/perf/ui/stdio/hist.c b/tools/perf/ui/stdio/hist.c index 49e2e4a7346a..e3fdf4e869fc 100644 --- a/tools/perf/ui/stdio/hist.c +++ b/tools/perf/ui/stdio/hist.c | |||
@@ -318,6 +318,9 @@ static int hist_entry__snprintf(struct hist_entry *he, struct perf_hpp *hpp) | |||
318 | return 0; | 318 | return 0; |
319 | 319 | ||
320 | perf_hpp__for_each_format(fmt) { | 320 | perf_hpp__for_each_format(fmt) { |
321 | if (perf_hpp__should_skip(fmt)) | ||
322 | continue; | ||
323 | |||
321 | /* | 324 | /* |
322 | * If there's no field_sep, we still need | 325 | * If there's no field_sep, we still need |
323 | * to display initial ' '. | 326 | * to display initial ' '. |
@@ -407,6 +410,9 @@ size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows, | |||
407 | fprintf(fp, "# "); | 410 | fprintf(fp, "# "); |
408 | 411 | ||
409 | perf_hpp__for_each_format(fmt) { | 412 | perf_hpp__for_each_format(fmt) { |
413 | if (perf_hpp__should_skip(fmt)) | ||
414 | continue; | ||
415 | |||
410 | if (!first) | 416 | if (!first) |
411 | fprintf(fp, "%s", sep ?: " "); | 417 | fprintf(fp, "%s", sep ?: " "); |
412 | else | 418 | else |
@@ -430,6 +436,9 @@ size_t hists__fprintf(struct hists *hists, bool show_header, int max_rows, | |||
430 | perf_hpp__for_each_format(fmt) { | 436 | perf_hpp__for_each_format(fmt) { |
431 | unsigned int i; | 437 | unsigned int i; |
432 | 438 | ||
439 | if (perf_hpp__should_skip(fmt)) | ||
440 | continue; | ||
441 | |||
433 | if (!first) | 442 | if (!first) |
434 | fprintf(fp, "%s", sep ?: " "); | 443 | fprintf(fp, "%s", sep ?: " "); |
435 | else | 444 | else |
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index ae13c2dbd27a..b262b44b7a65 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c | |||
@@ -436,6 +436,9 @@ hist_entry__cmp(struct hist_entry *left, struct hist_entry *right) | |||
436 | int64_t cmp = 0; | 436 | int64_t cmp = 0; |
437 | 437 | ||
438 | perf_hpp__for_each_sort_list(fmt) { | 438 | perf_hpp__for_each_sort_list(fmt) { |
439 | if (perf_hpp__should_skip(fmt)) | ||
440 | continue; | ||
441 | |||
439 | cmp = fmt->cmp(left, right); | 442 | cmp = fmt->cmp(left, right); |
440 | if (cmp) | 443 | if (cmp) |
441 | break; | 444 | break; |
@@ -451,6 +454,9 @@ hist_entry__collapse(struct hist_entry *left, struct hist_entry *right) | |||
451 | int64_t cmp = 0; | 454 | int64_t cmp = 0; |
452 | 455 | ||
453 | perf_hpp__for_each_sort_list(fmt) { | 456 | perf_hpp__for_each_sort_list(fmt) { |
457 | if (perf_hpp__should_skip(fmt)) | ||
458 | continue; | ||
459 | |||
454 | cmp = fmt->collapse(left, right); | 460 | cmp = fmt->collapse(left, right); |
455 | if (cmp) | 461 | if (cmp) |
456 | break; | 462 | break; |
@@ -570,6 +576,9 @@ static int hist_entry__sort(struct hist_entry *a, struct hist_entry *b) | |||
570 | int64_t cmp = 0; | 576 | int64_t cmp = 0; |
571 | 577 | ||
572 | perf_hpp__for_each_sort_list(fmt) { | 578 | perf_hpp__for_each_sort_list(fmt) { |
579 | if (perf_hpp__should_skip(fmt)) | ||
580 | continue; | ||
581 | |||
573 | cmp = fmt->sort(a, b); | 582 | cmp = fmt->sort(a, b); |
574 | if (cmp) | 583 | if (cmp) |
575 | break; | 584 | break; |
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h index f3713b79742d..f67feb432a44 100644 --- a/tools/perf/util/hist.h +++ b/tools/perf/util/hist.h | |||
@@ -201,6 +201,7 @@ void perf_hpp__append_sort_keys(void); | |||
201 | 201 | ||
202 | bool perf_hpp__is_sort_entry(struct perf_hpp_fmt *format); | 202 | bool perf_hpp__is_sort_entry(struct perf_hpp_fmt *format); |
203 | bool perf_hpp__same_sort_entry(struct perf_hpp_fmt *a, struct perf_hpp_fmt *b); | 203 | bool perf_hpp__same_sort_entry(struct perf_hpp_fmt *a, struct perf_hpp_fmt *b); |
204 | bool perf_hpp__should_skip(struct perf_hpp_fmt *format); | ||
204 | 205 | ||
205 | typedef u64 (*hpp_field_fn)(struct hist_entry *he); | 206 | typedef u64 (*hpp_field_fn)(struct hist_entry *he); |
206 | typedef int (*hpp_callback_fn)(struct perf_hpp *hpp, bool front); | 207 | typedef int (*hpp_callback_fn)(struct perf_hpp *hpp, bool front); |
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c index 5414ba541e47..0fe7cbe47ea3 100644 --- a/tools/perf/util/sort.c +++ b/tools/perf/util/sort.c | |||
@@ -1358,6 +1358,17 @@ static int __setup_sorting(void) | |||
1358 | return ret; | 1358 | return ret; |
1359 | } | 1359 | } |
1360 | 1360 | ||
1361 | bool perf_hpp__should_skip(struct perf_hpp_fmt *format) | ||
1362 | { | ||
1363 | if (perf_hpp__is_sort_entry(format)) { | ||
1364 | struct hpp_sort_entry *hse; | ||
1365 | |||
1366 | hse = container_of(format, struct hpp_sort_entry, hpp); | ||
1367 | return hse->se->elide; | ||
1368 | } | ||
1369 | return false; | ||
1370 | } | ||
1371 | |||
1361 | static void sort_entry__setup_elide(struct sort_entry *se, | 1372 | static void sort_entry__setup_elide(struct sort_entry *se, |
1362 | struct strlist *list, | 1373 | struct strlist *list, |
1363 | const char *list_name, FILE *fp) | 1374 | const char *list_name, FILE *fp) |