[2/2] perf list: Modify the warning message about scandirat(3)

Message ID 20230427230502.1526136-2-namhyung@kernel.org
State New
Headers
Series [1/2] perf list: Fix memory leaks in print_tracepoint_events() |

Commit Message

Namhyung Kim April 27, 2023, 11:05 p.m. UTC
  It should mention scandirat() instead of scandir().

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/util/print-events.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Ian Rogers April 28, 2023, 12:30 a.m. UTC | #1
On Thu, Apr 27, 2023 at 4:05 PM Namhyung Kim <namhyung@kernel.org> wrote:
>
> It should mention scandirat() instead of scandir().
>
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>

Acked-by: Ian Rogers <irogers@google.com>

Fwiw, tracing_events__scandir_alphasort assumes scandir is present
unconditionally.

Thanks,
Ian

> ---
>  tools/perf/util/print-events.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/util/print-events.c b/tools/perf/util/print-events.c
> index 0a97912fd894..299973876550 100644
> --- a/tools/perf/util/print-events.c
> +++ b/tools/perf/util/print-events.c
> @@ -131,7 +131,7 @@ void print_tracepoint_events(const struct print_callbacks *print_cb __maybe_unus
>         free(sys_namelist);
>  }
>  #else
> -       printf("\nWARNING: Your libc doesn't have the scandir function, please ask its maintainers to implement it.\n"
> +       printf("\nWARNING: Your libc doesn't have the scandirat function, please ask its maintainers to implement it.\n"
>                "         As a rough fallback, please do 'ls %s' to see the available tracepoint events.\n", events_path);
>  #endif
>         close(events_fd);
> --
> 2.40.1.495.gc816e09b53d-goog
>
  

Patch

diff --git a/tools/perf/util/print-events.c b/tools/perf/util/print-events.c
index 0a97912fd894..299973876550 100644
--- a/tools/perf/util/print-events.c
+++ b/tools/perf/util/print-events.c
@@ -131,7 +131,7 @@  void print_tracepoint_events(const struct print_callbacks *print_cb __maybe_unus
 	free(sys_namelist);
 }
 #else
-	printf("\nWARNING: Your libc doesn't have the scandir function, please ask its maintainers to implement it.\n"
+	printf("\nWARNING: Your libc doesn't have the scandirat function, please ask its maintainers to implement it.\n"
 	       "         As a rough fallback, please do 'ls %s' to see the available tracepoint events.\n", events_path);
 #endif
 	close(events_fd);