NACK: [SRU][Jammy][PATCH 1/1] perf synthetic-events: Don't sort the task scan result from /proc

Juerg Haefliger juerg.haefliger at canonical.com
Thu Mar 2 06:56:56 UTC 2023


Missing BugLink.

...Juerg


On Thu,  2 Mar 2023 14:32:00 +0800
Chengen Du <chengen.du at canonical.com> wrote:

> From: Namhyung Kim <namhyung at kernel.org>
> 
> 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 <namhyung at kernel.org>
> Acked-by: Ian Rogers <irogers at google.com>
> Cc: Jiri Olsa <jolsa at kernel.org>
> Cc: Peter Zijlstra <peterz at infradead.org>
> Link: http://lore.kernel.org/lkml/20220701205458.985106-1-namhyung@kernel.org
> Signed-off-by: Arnaldo Carvalho de Melo <acme at redhat.com>
> (cherry picked from commit 363afa3aef24f5e08df6a539f5dc3aae4cddcc1a)
> Signed-off-by: Chengen Du <chengen.du at canonical.com>
> ---
>  tools/perf/util/synthetic-events.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/perf/util/synthetic-events.c b/tools/perf/util/synthetic-events.c
> index c69ad7a1a6a7..285802ebc30b 100644
> --- a/tools/perf/util/synthetic-events.c
> +++ b/tools/perf/util/synthetic-events.c
> @@ -764,7 +764,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;
>  
> @@ -994,7 +994,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;
>  

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20230302/1a821334/attachment.sig>


More information about the kernel-team mailing list