From 32c67b0e9c320395af4235131e34a3953587c03f Mon Sep 17 00:00:00 2001 From: Jiri Olsa Date: Mon, 27 May 2019 13:48:33 +0000 Subject: [PATCH] perf top: Always sample time to satisfy needs of use of ordered queuing mainline inclusion from mainline-5.1-rc6 commit 1e6db2ee86e6a4399fc0ae5689e55e0fd1c43caf category: bugfix bugzilla: NA CVE: NA ------------------------------------------------- Bastian reported broken 'perf top -p PID' command, it won't display any data. The problem is that for -p option we monitor single thread, so we don't enable time in samples, because it's not needed. However since commit 16c66bc167cc we use ordered queues to stash data plus later commits added logic for dropping samples in case there's big load and we don't keep up. All this needs timestamp for sample. Enabling it unconditionally for perf top. Reported-by: Bastian Beischer Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Alexander Shishkin Cc: Namhyung Kim Cc: Peter Zijlstra Cc: bastian beischer Fixes: 16c66bc167cc ("perf top: Add processing thread") Link: http://lkml.kernel.org/r/20190415125333.27160-1-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Chunmei Xu Reviewed-by: Wei Li Signed-off-by: Yang Yingliang --- tools/perf/builtin-top.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index e355bcabac16..4b2cd2d33106 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -1371,6 +1371,7 @@ int cmd_top(int argc, const char **argv) * */ .overwrite = 0, .sample_time = true, + .sample_time_set = true, }, .max_stack = sysctl__max_stack(), .annotation_opts = annotation__default_options, -- GitLab