From: Steven Rostedt <rostedt@goodmis.org>
To: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>
Cc: Tom Zanussi <zanussi@kernel.org>,
linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
akpm@linux-foundation.org, zwisler@google.com,
chinglinyu@google.com
Subject: Re: [PATCH 1/4] tracing/histogram: Don't use strlen to find length of stacktrace variables
Date: Mon, 13 Feb 2023 10:56:33 -0500 [thread overview]
Message-ID: <20230213105633.006a22fc@rorschach.local.home> (raw)
In-Reply-To: <20230214002418.0103b9e765d3e5c374d2aa7d@kernel.org>
On Tue, 14 Feb 2023 00:24:18 +0900
Masami Hiramatsu (Google) <mhiramat@kernel.org> wrote:
> > - e = stack_trace_save((void *)str,
> > + e = stack_trace_save((void *)stack_start,
> > HIST_STACKTRACE_DEPTH,
> > HIST_STACKTRACE_SKIP);
>
> BTW, the size of "str" is enough to store HIST_STACKTRACE_DEPTH?
> In string case,
>
> size = min(val->size, STR_VAR_LEN_MAX);
>
> will limit the max size.
Well, we have:
#define HIST_STACKTRACE_DEPTH 16
And 16 * 8 = 128
#define STR_VAR_LEN_MAX MAX_FILTER_STR_VAL
#define MAX_FILTER_STR_VAL 256U
So 128 < 256, with plenty of room. I wouldn't do this runtime, but we
should add here:
BUILD_BUG_ON((HIST_STACKTRACE_DEPTH + 1) * sizeof(long) >= STR_VAR_LEN_MAX);
-- Steve
next prev parent reply other threads:[~2023-02-13 15:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-10 21:33 [PATCH 0/4] tracing/histogram: Some fixes for new stacktrace variables Tom Zanussi
2023-02-10 21:33 ` [PATCH 1/4] tracing/histogram: Don't use strlen to find length of " Tom Zanussi
2023-02-13 15:24 ` Masami Hiramatsu
2023-02-13 15:56 ` Steven Rostedt [this message]
2023-02-10 21:33 ` [PATCH 2/4] tracing/histogram: Fix a few problems with stacktrace variable printing Tom Zanussi
2023-02-10 21:33 ` [PATCH 3/4] tracing/histogram: Fix stacktrace key Tom Zanussi
2023-02-10 23:07 ` kernel test robot
2023-02-10 21:33 ` [PATCH 4/4] tracing/histogram: Fix stacktrace histogram Documententation Tom Zanussi
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=20230213105633.006a22fc@rorschach.local.home \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=chinglinyu@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=zanussi@kernel.org \
--cc=zwisler@google.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).