From: Steven Rostedt <rostedt@goodmis.org>
To: "Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de, peterz@infradead.org
Subject: Re: [PATCH v3 2/5] tracing: Add "last_func_repeats" to struct trace_array
Date: Tue, 13 Apr 2021 14:31:21 -0400 [thread overview]
Message-ID: <20210413143121.236db267@gandalf.local.home> (raw)
In-Reply-To: <20210409181031.26772-3-y.karadz@gmail.com>
On Fri, 9 Apr 2021 21:10:28 +0300
"Yordan Karadzhov (VMware)" <y.karadz@gmail.com> wrote:
> --- a/kernel/trace/trace.h
> +++ b/kernel/trace/trace.h
> @@ -262,6 +262,17 @@ struct cond_snapshot {
> cond_update_fn_t update;
> };
>
> +/*
> + * struct trace_func_repeats - used to keep track of the consecutive
> + * (on the same CPU) calls of a single function.
> + */
> +struct trace_func_repeats {
> + unsigned long ip;
> + unsigned long parent_ip;
> + unsigned long count;
> + u64 ts_last_call;
> +};
> +
> /*
> * The trace array - an array of per-CPU trace arrays. This is the
> * highest level data structure that individual tracers deal with.
> @@ -358,8 +369,15 @@ struct trace_array {
> #ifdef CONFIG_TRACER_SNAPSHOT
> struct cond_snapshot *cond_snapshot;
> #endif
> + struct trace_func_repeats __percpu *last_func_repeats;
> };
>
> +static inline struct trace_func_repeats __percpu *
> +tracer_alloc_func_repeats(struct trace_array *tr)
> +{
> + return tr->last_func_repeats = alloc_percpu(struct trace_func_repeats);
> +}
Also, is there a reason this is in the header file? It's only used in one C
file, and should be a static function there.
-- Steve
> +
> enum {
> TRACE_ARRAY_FL_GLOBAL = (1 << 0)
> };
next prev parent reply other threads:[~2021-04-13 18:31 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-09 18:10 [PATCH v3 0/5] Add "func_no_repete" tracing option Yordan Karadzhov (VMware)
2021-04-09 18:10 ` [PATCH v3 1/5] tracing: Define new ftrace event "func_repeats" Yordan Karadzhov (VMware)
2021-04-13 18:19 ` Steven Rostedt
2021-04-13 19:17 ` Steven Rostedt
2021-04-13 20:48 ` Steven Rostedt
2021-04-14 0:33 ` Steven Rostedt
2021-04-09 18:10 ` [PATCH v3 2/5] tracing: Add "last_func_repeats" to struct trace_array Yordan Karadzhov (VMware)
2021-04-13 18:31 ` Steven Rostedt [this message]
2021-04-09 18:10 ` [PATCH v3 3/5] tracing: Add method for recording "func_repeats" events Yordan Karadzhov (VMware)
2021-04-13 18:24 ` Steven Rostedt
2021-04-09 18:10 ` [PATCH v3 4/5] tracing: Unify the logic for function tracing options Yordan Karadzhov (VMware)
2021-04-09 18:10 ` [PATCH v3 5/5] tracing: Add "func_no_repeats" option for function tracing Yordan Karadzhov (VMware)
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=20210413143121.236db267@gandalf.local.home \
--to=rostedt@goodmis.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=y.karadz@gmail.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
all inboxes | Powered by JetHome®