From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
Adrian Hunter <adrian.hunter@intel.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
linux-perf-users@vger.kernel.org,
Masami Hiramatsu <mhiramat@kernel.org>
Subject: Re: [PATCH 1/2] perf dwarf-aux: Fix off-by-one in die_get_varname()
Date: Tue, 13 Jun 2023 11:32:55 -0300 [thread overview]
Message-ID: <ZIh+F8SQePMKfhVZ@kernel.org> (raw)
In-Reply-To: <20230612234102.3909116-1-namhyung@kernel.org>
Em Mon, Jun 12, 2023 at 04:41:01PM -0700, Namhyung Kim escreveu:
> The die_get_varname() returns "(unknown_type)" string if it failed to
> find a type for the variable. But it had a space before the opening
> parenthesis and it made the closing parenthesis cut off due to the
> off-by-one in the string length (14).
Thanks, applied and added:
Fixes: 88fd633cdfa19060 ("perf probe: No need to use formatting strbuf method")
I introduced this long ago :-\
- Arnaldo
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> ---
> tools/perf/util/dwarf-aux.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/perf/util/dwarf-aux.c b/tools/perf/util/dwarf-aux.c
> index e4593a71556b..1ac88b79687d 100644
> --- a/tools/perf/util/dwarf-aux.c
> +++ b/tools/perf/util/dwarf-aux.c
> @@ -1103,7 +1103,7 @@ int die_get_varname(Dwarf_Die *vr_die, struct strbuf *buf)
> ret = die_get_typename(vr_die, buf);
> if (ret < 0) {
> pr_debug("Failed to get type, make it unknown.\n");
> - ret = strbuf_add(buf, " (unknown_type)", 14);
> + ret = strbuf_add(buf, "(unknown_type)", 14);
> }
>
> return ret < 0 ? ret : strbuf_addf(buf, "\t%s", dwarf_diename(vr_die));
> --
> 2.41.0.162.gfafddb0af9-goog
next prev parent reply other threads:[~2023-06-13 14:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-12 23:41 [PATCH 1/2] perf dwarf-aux: Fix off-by-one in die_get_varname() Namhyung Kim
2023-06-12 23:41 ` [PATCH 2/2] perf dwarf-aux: Allow unnamed struct/union/enum Namhyung Kim
2023-06-13 14:32 ` Arnaldo Carvalho de Melo [this message]
2023-06-13 14:34 ` [PATCH 1/2] perf dwarf-aux: Fix off-by-one in die_get_varname() 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=ZIh+F8SQePMKfhVZ@kernel.org \
--to=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.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).