aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-timechart.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/builtin-timechart.c')
-rw-r--r--tools/perf/builtin-timechart.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c
index 8bde57c5c908..20d4212fa337 100644
--- a/tools/perf/builtin-timechart.c
+++ b/tools/perf/builtin-timechart.c
@@ -841,7 +841,6 @@ static void draw_cpu_usage(struct timechart *tchart)
841 sample->start_time, 841 sample->start_time,
842 sample->end_time, 842 sample->end_time,
843 p->pid, 843 p->pid,
844 "sample",
845 c->comm, 844 c->comm,
846 sample->backtrace); 845 sample->backtrace);
847 } 846 }
@@ -1252,6 +1251,23 @@ parse_process(const struct option *opt __maybe_unused, const char *arg,
1252 return 0; 1251 return 0;
1253} 1252}
1254 1253
1254static int
1255parse_highlight(const struct option *opt __maybe_unused, const char *arg,
1256 int __maybe_unused unset)
1257{
1258 unsigned long duration = strtoul(arg, NULL, 0);
1259
1260 if (svg_highlight || svg_highlight_name)
1261 return -1;
1262
1263 if (duration)
1264 svg_highlight = duration;
1265 else
1266 svg_highlight_name = strdup(arg);
1267
1268 return 0;
1269}
1270
1255int cmd_timechart(int argc, const char **argv, 1271int cmd_timechart(int argc, const char **argv,
1256 const char *prefix __maybe_unused) 1272 const char *prefix __maybe_unused)
1257{ 1273{
@@ -1270,6 +1286,9 @@ int cmd_timechart(int argc, const char **argv,
1270 OPT_STRING('i', "input", &input_name, "file", "input file name"), 1286 OPT_STRING('i', "input", &input_name, "file", "input file name"),
1271 OPT_STRING('o', "output", &output_name, "file", "output file name"), 1287 OPT_STRING('o', "output", &output_name, "file", "output file name"),
1272 OPT_INTEGER('w', "width", &svg_page_width, "page width"), 1288 OPT_INTEGER('w', "width", &svg_page_width, "page width"),
1289 OPT_CALLBACK(0, "highlight", NULL, "duration or task name",
1290 "highlight tasks. Pass duration in ns or process name.",
1291 parse_highlight),
1273 OPT_BOOLEAN('P', "power-only", &tchart.power_only, "output power data only"), 1292 OPT_BOOLEAN('P', "power-only", &tchart.power_only, "output power data only"),
1274 OPT_BOOLEAN('T', "tasks-only", &tchart.tasks_only, 1293 OPT_BOOLEAN('T', "tasks-only", &tchart.tasks_only,
1275 "output processes data only"), 1294 "output processes data only"),