perf diff: Don't use hack to skip column length calculation
authorJin Yao <yao.jin@linux.intel.com>
Thu, 7 Nov 2019 07:47:13 +0000 (15:47 +0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 7 Nov 2019 12:08:03 +0000 (09:08 -0300)
Previously we use a nasty hack to skip the hists__calc_col_len for block
since this function is not very suitable for block column length
calculation.

This patch removes the hack code and add a check at the entry of
hists__calc_col_len to skip for block case.

Signed-off-by: Jin Yao <yao.jin@linux.intel.com>
Reviewed-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jin Yao <yao.jin@intel.com>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lore.kernel.org/lkml/20191107074719.26139-2-yao.jin@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-diff.c
tools/perf/util/hist.c

index 5281629c27b1837707a7289349cca814cfd03b01..faf99a81ad3ecd7852c37934c761b10691aa1bb8 100644 (file)
@@ -765,13 +765,6 @@ static void block_hists_match(struct hists *hists_base,
        }
 }
 
-static int filter_cb(struct hist_entry *he, void *arg __maybe_unused)
-{
-       /* Skip the calculation of column length in output_resort */
-       he->filtered = true;
-       return 0;
-}
-
 static void hists__precompute(struct hists *hists)
 {
        struct rb_root_cached *root;
@@ -820,8 +813,8 @@ static void hists__precompute(struct hists *hists)
                                if (bh->valid && pair_bh->valid) {
                                        block_hists_match(&bh->block_hists,
                                                          &pair_bh->block_hists);
-                                       hists__output_resort_cb(&pair_bh->block_hists,
-                                                               NULL, filter_cb);
+                                       hists__output_resort(&pair_bh->block_hists,
+                                                            NULL);
                                }
                                break;
                        default:
index 679a1d75090ce10a9652f93479a0f233037ffc92..daa6eef4fde057cdab4b3adc2a29390639dfe701 100644 (file)
@@ -80,6 +80,8 @@ void hists__calc_col_len(struct hists *hists, struct hist_entry *h)
        int symlen;
        u16 len;
 
+       if (h->block_info)
+               return;
        /*
         * +4 accounts for '[x] ' priv level info
         * +2 accounts for 0x prefix on raw addresses