From: Gang Li Date: Tue, 23 Nov 2021 07:40:17 +0000 (+0800) Subject: perf trace: Enable ignore_missing_thread for trace X-Git-Tag: v6.6.17~8376^2~111 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b4515ad6e1c8b195e3bd02a5a15b1c74119ea367;p=platform%2Fkernel%2Flinux-rpi.git perf trace: Enable ignore_missing_thread for trace perf already support ignore_missing_thread for -u/-p, but not yet applied to `perf trace`. This patch enables ignore_missing_thread for `perf trace`. Signed-off-by: Gang Li Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/1481538943-21874-6-git-send-email-jolsa@kernel.org Link: http://lkml.kernel.org/r/1513148513-6974-1-git-send-email-zhangmengting@huawei.com Link: http://lore.kernel.org/lkml/20211123074018.11406-1-ligang.bdlg@bytedance.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 0b52e08..94d62a9 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -3950,6 +3950,9 @@ static int trace__run(struct trace *trace, int argc, const char **argv) evlist__add(evlist, pgfault_min); } + /* Enable ignoring missing threads when -u/-p option is defined. */ + trace->opts.ignore_missing_thread = trace->opts.target.uid != UINT_MAX || trace->opts.target.pid; + if (trace->sched && evlist__add_newtp(evlist, "sched", "sched_stat_runtime", trace__sched_stat_runtime)) goto out_error_sched_stat_runtime;