From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>, lkml <linux-kernel@vger.kernel.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Ingo Molnar <mingo@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Michael Petlan <mpetlan@redhat.com>,
Ian Rogers <irogers@google.com>,
Stephane Eranian <eranian@google.com>
Subject: Re: [PATCH 1/2] perf tools: Initialize output buffer in build_id__sprintf
Date: Tue, 3 Nov 2020 09:15:35 -0300 [thread overview]
Message-ID: <20201103121535.GD151027@kernel.org> (raw)
In-Reply-To: <CAM9d7cj6mfLuZYsXzAP+JBTuRC9F74AxmGbCL2_wyxRWoau-tA@mail.gmail.com>
Em Mon, Nov 02, 2020 at 10:50:00PM +0900, Namhyung Kim escreveu:
> Hi Jiri,
>
> On Mon, Nov 2, 2020 at 8:31 AM Jiri Olsa <jolsa@kernel.org> wrote:
> >
> > We display garbage for undefined build_id objects,
> > because we don't initialize the output buffer.
> >
> > Signed-off-by: Jiri Olsa <jolsa@kernel.org>
>
> Acked-by: Namhyung Kim <namhyung@kernel.org>
Thanks, applied.
- Arnaldo
> Thanks
> Namhyung
>
>
> > ---
> > tools/perf/util/build-id.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c
> > index 8763772f1095..6b410c3d52dc 100644
> > --- a/tools/perf/util/build-id.c
> > +++ b/tools/perf/util/build-id.c
> > @@ -102,6 +102,8 @@ int build_id__sprintf(const struct build_id *build_id, char *bf)
> > const u8 *raw = build_id->data;
> > size_t i;
> >
> > + bf[0] = 0x0;
> > +
> > for (i = 0; i < build_id->size; ++i) {
> > sprintf(bid, "%02x", *raw);
> > ++raw;
> > --
> > 2.26.2
> >
--
- Arnaldo
prev parent reply other threads:[~2020-11-03 12:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-01 23:31 [PATCH 1/2] perf tools: Initialize output buffer in build_id__sprintf Jiri Olsa
2020-11-01 23:31 ` [PATCH 2/2] perf tools: Add missing swap for ino_generation Jiri Olsa
2020-11-02 13:50 ` Namhyung Kim
2020-11-02 13:50 ` [PATCH 1/2] perf tools: Initialize output buffer in build_id__sprintf Namhyung Kim
2020-11-03 12:15 ` Arnaldo Carvalho de Melo [this message]
Reply instructions:
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201103121535.GD151027@kernel.org \
--to=acme@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=alexander.shishkin@linux.intel.com \
--cc=eranian@google.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@kernel.org \
--cc=mpetlan@redhat.com \
--cc=namhyung@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* 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).