mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
perf diff: Add -F option to display formula for computation
Adding -F option to display the formula for specified computation. This is mainly to facilitate debugging, but can be useful anyway. Signed-off-by: Jiri Olsa <jolsa@redhat.com> Cc: Andi Kleen <andi@firstfloor.org> Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> 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/r/1349448287-18919-7-git-send-email-jolsa@redhat.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
61949b212e
commit
ed279da2fc
5 changed files with 96 additions and 3 deletions
|
@ -359,6 +359,27 @@ static int hpp__entry_displ(struct perf_hpp *hpp,
|
|||
return scnprintf(hpp->buf, hpp->size, fmt, buf);
|
||||
}
|
||||
|
||||
static int hpp__header_formula(struct perf_hpp *hpp)
|
||||
{
|
||||
const char *fmt = symbol_conf.field_sep ? "%s" : "%70s";
|
||||
|
||||
return scnprintf(hpp->buf, hpp->size, fmt, "Formula");
|
||||
}
|
||||
|
||||
static int hpp__width_formula(struct perf_hpp *hpp __maybe_unused)
|
||||
{
|
||||
return 70;
|
||||
}
|
||||
|
||||
static int hpp__entry_formula(struct perf_hpp *hpp, struct hist_entry *he)
|
||||
{
|
||||
const char *fmt = symbol_conf.field_sep ? "%s" : "%-70s";
|
||||
char buf[96] = " ";
|
||||
|
||||
perf_diff__formula(buf, sizeof(buf), he);
|
||||
return scnprintf(hpp->buf, hpp->size, fmt, buf);
|
||||
}
|
||||
|
||||
#define HPP__COLOR_PRINT_FNS(_name) \
|
||||
.header = hpp__header_ ## _name, \
|
||||
.width = hpp__width_ ## _name, \
|
||||
|
@ -383,7 +404,8 @@ struct perf_hpp_fmt perf_hpp__format[] = {
|
|||
{ .cond = false, HPP__PRINT_FNS(delta) },
|
||||
{ .cond = false, HPP__PRINT_FNS(ratio) },
|
||||
{ .cond = false, HPP__PRINT_FNS(wdiff) },
|
||||
{ .cond = false, HPP__PRINT_FNS(displ) }
|
||||
{ .cond = false, HPP__PRINT_FNS(displ) },
|
||||
{ .cond = false, HPP__PRINT_FNS(formula) }
|
||||
};
|
||||
|
||||
#undef HPP__COLOR_PRINT_FNS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue