From: Jiri Olsa <firstname.lastname@example.org>
To: Alexei Starovoitov <email@example.com>
Cc: Yonghong Song <firstname.lastname@example.org>, Jiri Olsa <email@example.com>,
Arnaldo Carvalho de Melo <firstname.lastname@example.org>,
Alexei Starovoitov <email@example.com>,
Song Liu <firstname.lastname@example.org>,
lkml <email@example.com>, bpf <firstname.lastname@example.org>,
Peter Zijlstra <email@example.com>,
Ingo Molnar <firstname.lastname@example.org>,
Mark Rutland <email@example.com>,
Namhyung Kim <firstname.lastname@example.org>,
Alexander Shishkin <email@example.com>,
Michael Petlan <firstname.lastname@example.org>,
Ian Rogers <email@example.com>,
Stephane Eranian <firstname.lastname@example.org>,
Alexei Budankov <email@example.com>,
Andi Kleen <firstname.lastname@example.org>,
Adrian Hunter <email@example.com>
Subject: Re: [PATCH bpf-next 2/3] bpf: Add size arg to build_id_parse function
Date: Tue, 26 Jan 2021 21:52:36 +0100 [thread overview]
Message-ID: <20210126205236.GD120879@krava> (raw)
On Thu, Jan 14, 2021 at 07:47:20PM -0800, Alexei Starovoitov wrote:
> On Thu, Jan 14, 2021 at 3:44 PM Yonghong Song <firstname.lastname@example.org> wrote:
> > On 1/14/21 2:02 PM, Jiri Olsa wrote:
> > > On Thu, Jan 14, 2021 at 01:05:33PM -0800, Yonghong Song wrote:
> > >>
> > >>
> > >> On 1/14/21 12:01 PM, Jiri Olsa wrote:
> > >>> On Thu, Jan 14, 2021 at 10:56:33AM -0800, Yonghong Song wrote:
> > >>>>
> > >>>>
> > >>>> On 1/14/21 5:40 AM, Jiri Olsa wrote:
> > >>>>> It's possible to have other build id types (other than default SHA1).
> > >>>>> Currently there's also ld support for MD5 build id.
> > >>>>
> > >>>> Currently, bpf build_id based stackmap does not returns the size of
> > >>>> the build_id. Did you see an issue here? I guess user space can check
> > >>>> the length of non-zero bits of the build id to decide what kind of
> > >>>> type it is, right?
> > >>>
> > >>> you can have zero bytes in the build id hash, so you need to get the size
> > >>>
> > >>> I never saw MD5 being used in practise just SHA1, but we added the
> > >>> size to be complete and make sure we'll fit with build id, because
> > >>> there's only limited space in mmap2 event
> > >>
> > >> I am asking to check whether we should extend uapi struct
> > >> bpf_stack_build_id to include build_id_size as well. I guess
> > >> we can delay this until a real use case.
> > >
> > > right, we can try make some MD5 build id binaries and check if it
> > > explodes with some bcc tools, but I don't expect that.. I'll try
> > > to find some time for that
> > Thanks. We may have issues on bcc side. For build_id collected in
> > kernel, bcc always generates a length-20 string. But for user
> > binaries, the build_id string length is equal to actual size of
> > the build_id. They may not match (MD5 length is 16).
> > The fix is probably to append '0's (up to length 20) for user
> > binary build_id's.
> > I guess MD5 is very seldom used. I will wait if you can reproduce
> > the issue and then we might fix it.
> Jiri, please check whether md5 is really an issue.
> Sounds like we have to do something on the kernel side.
> Hopefully zero padding will be enough.
> I would prefer to avoid extending uapi struct to cover rare case.
build_id_parse is already doing the zero padding, so we are ok
I tried several bcc tools over perf bench with md5 buildid and
the results looked ok
next prev parent reply other threads:[~2021-01-26 22:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-14 13:40 [PATCHv7 bpf-next 0/3] perf: Add mmap2 build id support Jiri Olsa
2021-01-14 13:40 ` [PATCH bpf-next 1/3] bpf: Move stack_map_get_build_id into lib Jiri Olsa
2021-01-14 13:40 ` [PATCH bpf-next 2/3] bpf: Add size arg to build_id_parse function Jiri Olsa
2021-01-14 18:56 ` Yonghong Song
2021-01-14 20:01 ` Jiri Olsa
2021-01-14 21:05 ` Yonghong Song
2021-01-14 22:02 ` Jiri Olsa
2021-01-14 23:43 ` Yonghong Song
2021-01-15 3:47 ` Alexei Starovoitov
2021-01-26 20:52 ` Jiri Olsa [this message]
2021-01-26 21:00 ` Yonghong Song
2021-01-14 13:40 ` [PATCH bpf-next 3/3] perf: Add build id data in mmap2 event Jiri Olsa
2021-01-15 3:50 ` [PATCHv7 bpf-next 0/3] perf: Add mmap2 build id support patchwork-bot+netdevbpf
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).