diff options
author | Changbin Du <changbin.du@huawei.com> | 2023-03-02 11:11:45 +0800 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2023-03-13 14:52:14 -0300 |
commit | cb4b9e6813f9243095932c867ff16a7dffa02102 (patch) | |
tree | 3ab295d765dd5d41f599238ca0a434bdec755fe3 /tools/perf/builtin-record.c | |
parent | 07d85ba9d04e1ebd282f656a29ddf08c5b7b32a2 (diff) |
perf record: Reuse target::initial_delay
This just simply replace record_opts::initial_delay with
target::initial_delay. Nothing else is changed.
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-3-changbin.du@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-record.c')
-rw-r--r-- | tools/perf/builtin-record.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index be7c0c29d15b..fb8aab0cedd0 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -1292,7 +1292,7 @@ static int record__open(struct record *rec) * dummy event so that we can track PERF_RECORD_MMAP to cover the delay * of waiting or event synthesis. */ - if (opts->initial_delay || target__has_cpu(&opts->target) || + if (opts->target.initial_delay || target__has_cpu(&opts->target) || perf_pmu__has_hybrid()) { pos = evlist__get_tracking_event(evlist); if (!evsel__is_dummy_event(pos)) { @@ -1307,7 +1307,7 @@ static int record__open(struct record *rec) * Enable the dummy event when the process is forked for * initial_delay, immediately for system wide. */ - if (opts->initial_delay && !pos->immediate && + if (opts->target.initial_delay && !pos->immediate && !target__has_cpu(&opts->target)) pos->core.attr.enable_on_exec = 1; else @@ -2522,7 +2522,7 @@ static int __cmd_record(struct record *rec, int argc, const char **argv) * (apart from group members) have enable_on_exec=1 set, * so don't spoil it by prematurely enabling them. */ - if (!target__none(&opts->target) && !opts->initial_delay) + if (!target__none(&opts->target) && !opts->target.initial_delay) evlist__enable(rec->evlist); /* @@ -2574,10 +2574,10 @@ static int __cmd_record(struct record *rec, int argc, const char **argv) evlist__start_workload(rec->evlist); } - if (opts->initial_delay) { + if (opts->target.initial_delay) { pr_info(EVLIST_DISABLED_MSG); - if (opts->initial_delay > 0) { - usleep(opts->initial_delay * USEC_PER_MSEC); + if (opts->target.initial_delay > 0) { + usleep(opts->target.initial_delay * USEC_PER_MSEC); evlist__enable(rec->evlist); pr_info(EVLIST_ENABLED_MSG); } |