aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNamhyung Kim <[email protected]>2022-07-01 13:54:57 -0700
committerArnaldo Carvalho de Melo <[email protected]>2022-07-02 09:21:41 -0300
commit363afa3aef24f5e08df6a539f5dc3aae4cddcc1a (patch)
tree88d79f932f39d6130b1d14ada494763e2a05a136
parent5eb502b2e1ae1ab052cdf6bdd7615217e8517360 (diff)
perf synthetic-events: Don't sort the task scan result from /proc
It should not sort the result as procfs already returns a proper ordering of tasks. Actually sorting the order caused problems that it doesn't guararantee to process the main thread first. Signed-off-by: Namhyung Kim <[email protected]> Acked-by: Ian Rogers <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lore.kernel.org/lkml/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
-rw-r--r--tools/perf/util/synthetic-events.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/util/synthetic-events.c b/tools/perf/util/synthetic-events.c
index 27acdc5e5723..a068f42833c3 100644
--- a/tools/perf/util/synthetic-events.c
+++ b/tools/perf/util/synthetic-events.c
@@ -754,7 +754,7 @@ static int __event__synthesize_thread(union perf_event *comm_event,
snprintf(filename, sizeof(filename), "%s/proc/%d/task",
machine->root_dir, pid);
- n = scandir(filename, &dirent, filter_task, alphasort);
+ n = scandir(filename, &dirent, filter_task, NULL);
if (n < 0)
return n;
@@ -987,7 +987,7 @@ int perf_event__synthesize_threads(struct perf_tool *tool,
return 0;
snprintf(proc_path, sizeof(proc_path), "%s/proc", machine->root_dir);
- n = scandir(proc_path, &dirent, filter_task, alphasort);
+ n = scandir(proc_path, &dirent, filter_task, NULL);
if (n < 0)
return err;