Re: [PATCH v2 07/16] perf stat: Move stat_config into config.c

From: Ian Rogers
Date: Tue Oct 22 2024 - 13:21:55 EST


On Mon, Oct 21, 2024 at 10:55 PM Namhyung Kim <namhyung@xxxxxxxxxx> wrote:
>
> On Tue, Oct 15, 2024 at 09:24:06PM -0700, Ian Rogers wrote:
> > stat_config is accessed by config.c via helper functions, but declared
> > in builtin-stat. Move to util/config.c so that stub functions aren't
> > needed in python.c which doesn't link against the builtin files.
> >
> > To avoid name conflicts change builtin-script to use the same
> > stat_config as builtin-stat. Rename local variables in tests to avoid
> > shadow declaration warnings.
> >
> > Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
[snip]
> > diff --git a/tools/perf/util/path.c b/tools/perf/util/path.c
> > index 00adf872bf00..9712466c51e2 100644
> > --- a/tools/perf/util/path.c
> > +++ b/tools/perf/util/path.c
> > @@ -68,6 +68,16 @@ bool is_directory(const char *base_path, const struct dirent *dent)
> > return S_ISDIR(st.st_mode);
> > }
> >
> > +bool is_directory_at(int dir_fd, const char *path)
> > +{
> > + struct stat st;
> > +
> > + if (fstatat(dir_fd, path, &st, /*flags=*/0))
> > + return false;
> > +
> > + return S_ISDIR(st.st_mode);
> > +}
> > +
>
> It looks like an unrelated change.

Yep. Should have been part of the previous (patch 6) change.

Thanks,
Ian