mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-27 17:11:46 +00:00
perf timechart: Add --highlight option
This option highlights tasks (using different color) that run more than given duration or tasks with given name. Signed-off-by: Stanislav Fomichev <stfomichev@yandex-team.ru> Acked-by: Ingo Molnar <mingo@kernel.org> Cc: Ingo Molnar <mingo@kernel.org> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Ramkumar Ramachandra <artagnon@gmail.com> Link: http://lkml.kernel.org/r/20131217155349.GA13021@stfomichev-desktop Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
ee4e9625c8
commit
e57a2dffbc
4 changed files with 56 additions and 5 deletions
|
@ -841,7 +841,6 @@ static void draw_cpu_usage(struct timechart *tchart)
|
|||
sample->start_time,
|
||||
sample->end_time,
|
||||
p->pid,
|
||||
"sample",
|
||||
c->comm,
|
||||
sample->backtrace);
|
||||
}
|
||||
|
@ -1252,6 +1251,23 @@ parse_process(const struct option *opt __maybe_unused, const char *arg,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
parse_highlight(const struct option *opt __maybe_unused, const char *arg,
|
||||
int __maybe_unused unset)
|
||||
{
|
||||
unsigned long duration = strtoul(arg, NULL, 0);
|
||||
|
||||
if (svg_highlight || svg_highlight_name)
|
||||
return -1;
|
||||
|
||||
if (duration)
|
||||
svg_highlight = duration;
|
||||
else
|
||||
svg_highlight_name = strdup(arg);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int cmd_timechart(int argc, const char **argv,
|
||||
const char *prefix __maybe_unused)
|
||||
{
|
||||
|
@ -1270,6 +1286,9 @@ int cmd_timechart(int argc, const char **argv,
|
|||
OPT_STRING('i', "input", &input_name, "file", "input file name"),
|
||||
OPT_STRING('o', "output", &output_name, "file", "output file name"),
|
||||
OPT_INTEGER('w', "width", &svg_page_width, "page width"),
|
||||
OPT_CALLBACK(0, "highlight", NULL, "duration or task name",
|
||||
"highlight tasks. Pass duration in ns or process name.",
|
||||
parse_highlight),
|
||||
OPT_BOOLEAN('P', "power-only", &tchart.power_only, "output power data only"),
|
||||
OPT_BOOLEAN('T', "tasks-only", &tchart.tasks_only,
|
||||
"output processes data only"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue