From: Namhyung Kim <namhyung@kernel.org>
To: Jiri Olsa <jolsa@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@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: Mon, 2 Nov 2020 22:50:00 +0900 [thread overview]
Message-ID: <CAM9d7cj6mfLuZYsXzAP+JBTuRC9F74AxmGbCL2_wyxRWoau-tA@mail.gmail.com> (raw)
In-Reply-To: <20201101233103.3537427-1-jolsa@kernel.org>
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
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
>
next prev parent reply other threads:[~2020-11-02 13:51 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 ` Namhyung Kim [this message]
2020-11-03 12:15 ` [PATCH 1/2] perf tools: Initialize output buffer in build_id__sprintf Arnaldo Carvalho de Melo
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=CAM9d7cj6mfLuZYsXzAP+JBTuRC9F74AxmGbCL2_wyxRWoau-tA@mail.gmail.com \
--to=namhyung@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--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 \
/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).