[<prev] [next>] [day] [month] [year] [list]
Message-ID: <161481847514.1478170.15409325926185522779@swboyd.mtv.corp.google.com>
Date: Wed, 03 Mar 2021 16:41:15 -0800
From: Stephen Boyd <swboyd@...omium.org>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, Jiri Olsa <jolsa@...nel.org>,
Alexei Starovoitov <ast@...nel.org>,
Jessica Yu <jeyu@...nel.org>,
Evan Green <evgreen@...omium.org>,
Hsin-Yi Wang <hsinyi@...omium.org>
Subject: Re: [PATCH 1/7] buildid: Add method to get running kernel's build ID
Quoting Stephen Boyd (2021-03-02 15:28:25)
> (HTML mail?)
>
> Quoting Andy Shevchenko (2021-03-01 15:33:06)
> >
> >
> > On Monday, March 1, 2021, Stephen Boyd <swboyd@...omium.org> wrote:
> > @@ -147,3 +158,31 @@ int build_id_parse(struct vm_area_struct *vma,
> > unsigned char *build_id,
> > put_page(page);
> > return ret;
> > }
> > +
> > +static void build_id2hex(char *dst, const unsigned char *src, __u32 size)
> > +{
> > + bin2hex(dst, src, size);
> > + dst[2 * size] = '\0';
> > +}
> > +
> >
> >
> >
> > If you are so only printing this via printf(), just use %20phN. No need for a
> > separate function.
> >
>
> Makes sense. The downside is that we may have to calculate the build ID
> many times then by searching the notes section? Unless we can test the
> whole array very quickly for "not initialized" or stash another bool
> like "build_id_initialized". The kdump code would also need to take a
> printk format then. This seems better as is but let me know if you
> disagree strongly and I can change more code.
I am using memchr_inv() now to check for an all zero array. That seems
fairly cheap so I think it should be OK. We trade-off a small amount of
time for a few more bytes savings.
Powered by blists - more mailing lists