Re: [PATCH 02/25] bpf: Add size arg to build_id_parse function

From: Jiri Olsa
Date: Fri Dec 04 2020 - 18:32:06 EST


On Thu, Dec 03, 2020 at 09:23:52PM +0000, Song Liu wrote:
>
>
> > On Nov 26, 2020, at 9:00 AM, Jiri Olsa <jolsa@xxxxxxxxxx> wrote:
> >
> > It's possible to have other build id types (other than default SHA1).
> > Currently there's also ld support for MD5 build id.
> >
> > Adding size argument to build_id_parse function, that returns (if defined)
> > size of the parsed build id, so we can recognize the build id type.
> >
> > Cc: Alexei Starovoitov <ast@xxxxxxxxxx>
> > Cc: Song Liu <songliubraving@xxxxxx>
> > Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
>
> Sorry for the late response. The patch looks good to me.
>
> Acked-by: Song Liu <songliubraving@xxxxxx>
>
> with one nitpick below.
>
> > ---
> > include/linux/buildid.h | 3 ++-
> > kernel/bpf/stackmap.c | 2 +-
> > lib/buildid.c | 29 +++++++++++++++++++++--------
> > 3 files changed, 24 insertions(+), 10 deletions(-)
> >
> > diff --git a/include/linux/buildid.h b/include/linux/buildid.h
> > index 3be5b49719f1..72639d433873 100644
> > --- a/include/linux/buildid.h
> > +++ b/include/linux/buildid.h
> > @@ -6,6 +6,7 @@
> >
> > #define BUILD_ID_SIZE 20
>
> Since we are handling build-id with different sizes, how about we
> rename this as BUILD_ID_SIZE_MAX or BUILD_ID_SIZE_DEFAULT?

right, BUILD_ID_SIZE_MAX sounds good to me

thanks,
jirka