lkml.org 
[lkml]   [2020]   [Nov]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 02/24] bpf: Add build_id_parse_size function
On Mon, Nov 9, 2020 at 1:54 PM Jiri Olsa <jolsa@kernel.org> 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 build_id_parse_size function, that returns also size of
> the parsed build id, so we can recognize the build id type.
>
> Cc: Alexei Starovoitov <ast@kernel.org>
> Cc: Song Liu <songliubraving@fb.com>
> Signed-off-by: Jiri Olsa <jolsa@kernel.org>
> ---
> include/linux/buildid.h | 2 ++
> lib/buildid.c | 31 ++++++++++++++++++++++++-------
> 2 files changed, 26 insertions(+), 7 deletions(-)
>
> diff --git a/include/linux/buildid.h b/include/linux/buildid.h
> index 3be5b49719f1..edba89834b4c 100644
> --- a/include/linux/buildid.h
> +++ b/include/linux/buildid.h
> @@ -7,5 +7,7 @@
> #define BUILD_ID_SIZE 20
>
> int build_id_parse(struct vm_area_struct *vma, unsigned char *build_id);
> +int build_id_parse_size(struct vm_area_struct *vma, unsigned char *build_id,
> + __u32 *size);

I think it's too many choices for such trivial api.
Just keep one build_id_parse() with two outputs
and fix the callers.

\
 
 \ /
  Last update: 2020-11-10 01:17    [W:0.283 / U:0.612 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site