Skip to content

Commit 363afa3

Browse files
namhyungacmel
authored andcommitted
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]>
1 parent 5eb502b commit 363afa3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/perf/util/synthetic-events.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ static int __event__synthesize_thread(union perf_event *comm_event,
754754
snprintf(filename, sizeof(filename), "%s/proc/%d/task",
755755
machine->root_dir, pid);
756756

757-
n = scandir(filename, &dirent, filter_task, alphasort);
757+
n = scandir(filename, &dirent, filter_task, NULL);
758758
if (n < 0)
759759
return n;
760760

@@ -987,7 +987,7 @@ int perf_event__synthesize_threads(struct perf_tool *tool,
987987
return 0;
988988

989989
snprintf(proc_path, sizeof(proc_path), "%s/proc", machine->root_dir);
990-
n = scandir(proc_path, &dirent, filter_task, alphasort);
990+
n = scandir(proc_path, &dirent, filter_task, NULL);
991991
if (n < 0)
992992
return err;
993993

0 commit comments

Comments
 (0)