From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Leo Yan <leo.yan@arm.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>, Ian Rogers <irogers@google.com>,
Adrian Hunter <adrian.hunter@intel.com>,
"Liang, Kan" <kan.liang@linux.intel.com>,
linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/3] perf probe: Use the MAX_EVENT_NAME_LEN macro
Date: Mon, 14 Oct 2024 09:46:08 +0900 [thread overview]
Message-ID: <20241014094608.4b19fc04df6d57b6601c739b@kernel.org> (raw)
In-Reply-To: <20241012204725.928794-2-leo.yan@arm.com>
On Sat, 12 Oct 2024 21:47:23 +0100
Leo Yan <leo.yan@arm.com> wrote:
> The MAX_EVENT_NAME_LEN macro has been defined in the kernel. Use the
> same definition in the tool for more readable.
>
Looks good to me. Thanks!
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> Signed-off-by: Leo Yan <leo.yan@arm.com>
> ---
> tools/perf/util/probe-event.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
> index a17c9b8a7a79..061a0412dec2 100644
> --- a/tools/perf/util/probe-event.c
> +++ b/tools/perf/util/probe-event.c
> @@ -51,6 +51,9 @@
>
> #define PERFPROBE_GROUP "probe"
>
> +/* Defined in kernel/trace/trace.h */
> +#define MAX_EVENT_NAME_LEN 64
> +
> bool probe_event_dry_run; /* Dry run flag */
> struct probe_conf probe_conf = { .magic_num = DEFAULT_PROBE_MAGIC_NUM };
>
> @@ -2841,7 +2844,7 @@ static int probe_trace_event__set_name(struct probe_trace_event *tev,
> bool allow_suffix)
> {
> const char *event, *group;
> - char buf[64];
> + char buf[MAX_EVENT_NAME_LEN];
> int ret;
>
> /* If probe_event or trace_event already have the name, reuse it */
> --
> 2.25.1
>
--
Masami Hiramatsu (Google) <mhiramat@kernel.org>
next prev parent reply other threads:[~2024-10-14 0:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-12 20:47 [PATCH v3 0/3] perf probe: Improve logs for long name string Leo Yan
2024-10-12 20:47 ` [PATCH v3 1/3] perf probe: Use the MAX_EVENT_NAME_LEN macro Leo Yan
2024-10-14 0:46 ` Masami Hiramatsu [this message]
2024-10-12 20:47 ` [PATCH v3 2/3] perf probe: Check group string length Leo Yan
2024-10-12 20:47 ` [PATCH v3 3/3] perf probe: Improve log for long event name failure Leo Yan
2024-10-14 2:24 ` Masami Hiramatsu
2024-10-17 16:39 ` [PATCH v3 0/3] perf probe: Improve logs for long name string Namhyung Kim
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=20241014094608.4b19fc04df6d57b6601c739b@kernel.org \
--to=mhiramat@kernel.org \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=leo.yan@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.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).