[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210413142431.79331c5a@gandalf.local.home>
Date: Tue, 13 Apr 2021 14:24:31 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: "Yordan Karadzhov (VMware)" <y.karadz@...il.com>
Cc: linux-kernel@...r.kernel.org, tglx@...utronix.de,
peterz@...radead.org
Subject: Re: [PATCH v3 3/5] tracing: Add method for recording "func_repeats"
events
On Fri, 9 Apr 2021 21:10:29 +0300
"Yordan Karadzhov (VMware)" <y.karadz@...il.com> wrote:
> @@ -342,6 +342,12 @@ FTRACE_ENTRY(hwlat, hwlat_entry,
> #define FUNC_REPEATS_GET_DELTA_TS(entry) \
> (((u64)entry->top_delta_ts << 32) | entry->bottom_delta_ts) \
>
> +#define FUNC_REPEATS_SET_DELTA_TS(entry, delta) \
> + do { \
> + entry->bottom_delta_ts = delta & U32_MAX; \
> + entry->top_delta_ts = (delta >> 32); \
> + } while (0); \
> +
This needs the parenthesis around the parameters as well.
Or just make it into a static inline function. The GET_DELTA_TS is used in
printing to of the event for user space where it makes sense to have it as
a macro (it will be expanded in the "print fmt" of the format file for the
event). But the setting doesn't have that limitation.
static inline void
func_repeats_set_delta_ts(struct func_repeats_entry *entry,
unsigned long long delta)
{
entry->bottom_delta_ts = delta & U32_MAX;
entry->top_delta_ts = (delta >> 32);
}
And then you can have the compiler type check everything for you. Macros
are nasty when it comes to build errors.
-- Steve
> FTRACE_ENTRY(func_repeats, func_repeats_entry,
>
> TRACE_FUNC_REPEATS,
> --
Powered by blists - more mailing lists