]> Git Repo - linux.git/commitdiff
perf synthetic-events: Don't sort the task scan result from /proc
authorNamhyung Kim <[email protected]>
Fri, 1 Jul 2022 20:54:57 +0000 (13:54 -0700)
committerArnaldo Carvalho de Melo <[email protected]>
Sat, 2 Jul 2022 12:21:41 +0000 (09:21 -0300)
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]>
tools/perf/util/synthetic-events.c

index 27acdc5e572360bdcc66358a97249ce75cbb3994..a068f42833c35697796974db682d65ed538ef44c 100644 (file)
@@ -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;
 
This page took 0.059617 seconds and 4 git commands to generate.