Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf ftrace: Reuse target::initial_delay

Replace perf_ftrace::initial_delay with target::initial_delay.
Specifying a negative initial_delay is meaningless for ftrace in
practice but allowed here.

Signed-off-by: Changbin Du <changbin.du@huawei.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Hui Wang <hw.huiwang@huawei.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20230302031146.2801588-4-changbin.du@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Changbin Du and committed by
Arnaldo Carvalho de Melo
f9f60efb cb4b9e68

+5 -6
+5 -5
tools/perf/builtin-ftrace.c
··· 623 623 /* display column headers */ 624 624 read_tracing_file_to_stdout("trace"); 625 625 626 - if (!ftrace->initial_delay) { 626 + if (!ftrace->target.initial_delay) { 627 627 if (write_tracing_file("tracing_on", "1") < 0) { 628 628 pr_err("can't enable tracing\n"); 629 629 goto out_close_fd; ··· 632 632 633 633 evlist__start_workload(ftrace->evlist); 634 634 635 - if (ftrace->initial_delay) { 636 - usleep(ftrace->initial_delay * 1000); 635 + if (ftrace->target.initial_delay > 0) { 636 + usleep(ftrace->target.initial_delay * 1000); 637 637 if (write_tracing_file("tracing_on", "1") < 0) { 638 638 pr_err("can't enable tracing\n"); 639 639 goto out_close_fd; ··· 1164 1164 "Size of per cpu buffer, needs to use a B, K, M or G suffix.", parse_buffer_size), 1165 1165 OPT_BOOLEAN(0, "inherit", &ftrace.inherit, 1166 1166 "Trace children processes"), 1167 - OPT_UINTEGER('D', "delay", &ftrace.initial_delay, 1168 - "Number of milliseconds to wait before starting tracing after program start"), 1167 + OPT_INTEGER('D', "delay", &ftrace.target.initial_delay, 1168 + "Number of milliseconds to wait before starting tracing after program start"), 1169 1169 OPT_PARENT(common_options), 1170 1170 }; 1171 1171 const struct option latency_options[] = {
-1
tools/perf/util/ftrace.h
··· 25 25 int graph_noirqs; 26 26 int graph_verbose; 27 27 int graph_thresh; 28 - unsigned int initial_delay; 29 28 }; 30 29 31 30 struct filter_entry {