From: Borislav Petkov <bp@alien8.de>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Tony Luck <tony.luck@gmail.com>
Subject: Re: [for-next][PATCH] tracing: Add __field_struct macro for TRACE_EVENT()
Date: Sat, 21 Jun 2014 14:07:23 +0200 [thread overview]
Message-ID: <20140621120723.GC25200@pd.tnic> (raw)
In-Reply-To: <20140621075025.1aadb1f6@gandalf.local.home>
On Sat, Jun 21, 2014 at 07:50:25AM -0400, Steven Rostedt wrote:
>
> Updates to the RAS tracepoints found that the __field() macro has a bug
> in it where you can not use it with structures. It only works with
> primitives. This is because of an added check to determine if the field
> is signed or not.
>
> A new macro is created called __field_struct() that can be used to save
> structured data directly in the tracepoint and not have to settle for
> storing as an array with memcpy.
>
> -- Steve
>
>
>
> git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
> for-next
>
> Head SHA1: 4d4c9cc839a308be3289a361ccba4447ee140552
>
>
> Steven Rostedt (1):
> tracing: Add __field_struct macro for TRACE_EVENT()
>
> ----
> include/trace/ftrace.h | 33 ++++++++++++++++++++++++++++++
> samples/trace_events/trace-events-sample.h | 3 ++-
> 2 files changed, 35 insertions(+), 1 deletion(-)
> ---------------------------
> commit 4d4c9cc839a308be3289a361ccba4447ee140552
> Author: Steven Rostedt <rostedt@goodmis.org>
> Date: Tue Jun 17 08:59:16 2014 -0400
>
> tracing: Add __field_struct macro for TRACE_EVENT()
>
> Currently the __field() macro in TRACE_EVENT is only good for primitive
> values, such as integers and pointers, but it fails on complex data types
> such as structures or unions. This is because the __field() macro
> determines if the variable is signed or not with the test of:
>
> (((type)(-1)) < (type)1)
>
> Unfortunately, that fails when type is a structure.
>
> Since trace events should support structures as fields a new macro
> is created for such a case called __field_struct() which acts exactly
> the same as __field() does but it does not do the signed type check
> and just uses a constant false for that answer.
>
> Cc: Tony Luck <tony.luck@gmail.com>
> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Borislav Petkov <bp@suse.de>
--
Regards/Gruss,
Boris.
Sent from a fat crate under my desk. Formatting is fine.
--
prev parent reply other threads:[~2014-06-21 12:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-21 11:50 Steven Rostedt
2014-06-21 12:07 ` Borislav Petkov [this message]
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=20140621120723.GC25200@pd.tnic \
--to=bp@alien8.de \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=rostedt@goodmis.org \
--cc=tony.luck@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®