提交 2960ed6f 编写于 作者: N Namhyung Kim 提交者: Arnaldo Carvalho de Melo

perf tools: Fix alignment on some sort keys

The srcline, srcfile and trace sort keys can have long entries.  With
commit 89fee709 ("perf hists: Do column alignment on the format
iterator"), it now aligns output with hist_entry__snprintf_alignment().
So each (possibly long) sort entries don't need to do it themselves.
Signed-off-by: NNamhyung Kim <namhyung@kernel.org>
Acked-by: NJiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1456101153-14519-1-git-send-email-namhyung@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 cecaec63
...@@ -314,7 +314,7 @@ static int hist_entry__srcline_snprintf(struct hist_entry *he, char *bf, ...@@ -314,7 +314,7 @@ static int hist_entry__srcline_snprintf(struct hist_entry *he, char *bf,
if (!he->srcline) if (!he->srcline)
he->srcline = hist_entry__get_srcline(he); he->srcline = hist_entry__get_srcline(he);
return repsep_snprintf(bf, size, "%-*.*s", width, width, he->srcline); return repsep_snprintf(bf, size, "%-.*s", width, he->srcline);
} }
struct sort_entry sort_srcline = { struct sort_entry sort_srcline = {
...@@ -366,7 +366,7 @@ static int hist_entry__srcfile_snprintf(struct hist_entry *he, char *bf, ...@@ -366,7 +366,7 @@ static int hist_entry__srcfile_snprintf(struct hist_entry *he, char *bf,
if (!he->srcfile) if (!he->srcfile)
he->srcfile = hist_entry__get_srcfile(he); he->srcfile = hist_entry__get_srcfile(he);
return repsep_snprintf(bf, size, "%-*.*s", width, width, he->srcfile); return repsep_snprintf(bf, size, "%-.*s", width, he->srcfile);
} }
struct sort_entry sort_srcfile = { struct sort_entry sort_srcfile = {
...@@ -496,11 +496,11 @@ static int hist_entry__trace_snprintf(struct hist_entry *he, char *bf, ...@@ -496,11 +496,11 @@ static int hist_entry__trace_snprintf(struct hist_entry *he, char *bf,
evsel = hists_to_evsel(he->hists); evsel = hists_to_evsel(he->hists);
if (evsel->attr.type != PERF_TYPE_TRACEPOINT) if (evsel->attr.type != PERF_TYPE_TRACEPOINT)
return scnprintf(bf, size, "%-*.*s", width, width, "N/A"); return scnprintf(bf, size, "%-.*s", width, "N/A");
if (he->trace_output == NULL) if (he->trace_output == NULL)
he->trace_output = get_trace_output(he); he->trace_output = get_trace_output(he);
return repsep_snprintf(bf, size, "%-*.*s", width, width, he->trace_output); return repsep_snprintf(bf, size, "%-.*s", width, he->trace_output);
} }
struct sort_entry sort_trace = { struct sort_entry sort_trace = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册