From: Ingo Molnar <mingo@elte.hu>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Tom Zanussi <tzanussi@gmail.com>,
linux-kernel@vger.kernel.org, fweisbec@gmail.com,
lizf@cn.fujitsu.com, hch@infradead.org
Subject: Re: [RFC][PATCH 1/9] tracing/events: Add 'signed' field to format files
Date: Sun, 11 Oct 2009 11:00:35 +0200 [thread overview]
Message-ID: <20091011090035.GG14995@elte.hu> (raw)
In-Reply-To: <1254920837.1696.130.camel@gandalf.stny.rr.com>
* Steven Rostedt <rostedt@goodmis.org> wrote:
> On Wed, 2009-10-07 at 00:04 -0500, Tom Zanussi wrote:
> > On Tue, 2009-10-06 at 21:06 -0400, Steven Rostedt wrote:
> > > On Tue, 2009-10-06 at 01:09 -0500, Tom Zanussi wrote:
> > > > The sign info used for filters in the kernel is also useful to
> > > > applications that process the trace stream. Add it to the format
> > > > files and make it available to userspace.
> > > >
> > > > Signed-off-by: Tom Zanussi <tzanussi@gmail.com>
> > > > ---
> > > > include/trace/ftrace.h | 15 +++++++++------
> > > > kernel/trace/ring_buffer.c | 15 +++++++++------
> > > > kernel/trace/trace_events.c | 24 ++++++++++++------------
> > > > kernel/trace/trace_export.c | 25 ++++++++++++++-----------
> > > > kernel/trace/trace_syscalls.c | 20 +++++++++++++-------
> > > > tools/perf/util/trace-event-parse.c | 24 ++++++++++++++++++++++++
> > > > tools/perf/util/trace-event.h | 1 +
> > > > 7 files changed, 82 insertions(+), 42 deletions(-)
> > > >
> > > > diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
> > > > index cc0d966..c9bbcab 100644
> > > > --- a/include/trace/ftrace.h
> > > > +++ b/include/trace/ftrace.h
> > > > @@ -120,9 +120,10 @@
> > > > #undef __field
> > > > #define __field(type, item) \
> > > > ret = trace_seq_printf(s, "\tfield:" #type " " #item ";\t" \
> > > > - "offset:%u;\tsize:%u;\n", \
> > > > + "offset:%u;\tsize:%u;\tsigned:%u;\n", \
> > > > (unsigned int)offsetof(typeof(field), item), \
> > > > - (unsigned int)sizeof(field.item)); \
> > > > + (unsigned int)sizeof(field.item), \
> > > > + (unsigned int)is_signed_type(type)); \
> > > > if (!ret) \
> > > > return 0;
> > >
> > > I don't mind this change, but it makes me nervous. We really need to
> > > solidify the output format file. This is adding a new field and will
> > > already break the parsers in perf and trace_cmd.
> > >
> > > Is there anything else that is needed? I really want to make sure that
> > > we don't need to modify the output of the format files any more.
> > >
> >
> > One of the things I had in mind when writing this patchset was to make
> > sure that what was there already was enough to write something real on
> > top of. The only thing I found I needed to add was the signed field,
> > and that was enough at least for the Perl case, where everything can be
> > mapped into 3 types - signed, unsigned and string.
> >
> > Other languages might demand more - I haven't looked into it - so I
> > couldn't say whether anything else is needed, but it would seem to
> > me that the current combination of type description strings, sizes
> > and signs for each field should be enough information to allow any
> > field to be passed into any scripting interpreter. Actually, you
> > could probably forget about signs and sizes and just manage on type
> > description strings alone, if you had a typemap that mapped from the
> > C type descriptions to the types expected by a given interpreter.
> > That might be what some language implementations would end up doing,
> > but at least for the Perl implementation, it's much more convenient
> > to have the is_signed field.
>
> Actually I was thinking that the print format part of the format file
> would give enough to know if the object was signed or not, or even the
> type (unsigned long, etc). But we are still early in this game, and I
> would like to think that we are still early enough to be able to
> change these formats. But it's getting close that they will soon be
> locked in stone.
Note, the format _must_ be extensible, even if existing bits are cast
into stone. I.e. if a new type or a new sub-type comes up, we want to be
able to add it - and we want to fix all parsers to be ready for that.
Ingo
next prev parent reply other threads:[~2009-10-11 9:01 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-06 6:09 [RFC][PATCH 0/9] perf trace: support for general-purpose scripting Tom Zanussi
2009-10-06 6:09 ` [RFC][PATCH 1/9] tracing/events: Add 'signed' field to format files Tom Zanussi
2009-10-06 13:06 ` [tip:perf/core] " tip-bot for Tom Zanussi
2009-10-06 15:05 ` Frederic Weisbecker
2009-10-07 4:30 ` Tom Zanussi
2009-10-07 1:06 ` [RFC][PATCH 1/9] " Steven Rostedt
2009-10-07 5:04 ` Tom Zanussi
2009-10-07 13:07 ` Steven Rostedt
2009-10-11 9:00 ` Ingo Molnar [this message]
2009-10-06 6:09 ` [RFC][PATCH 2/9] perf trace: Add subsystem string to struct event Tom Zanussi
2009-10-06 13:06 ` [tip:perf/core] " tip-bot for Tom Zanussi
2009-10-06 6:09 ` [RFC][PATCH 3/9] perf trace: Add string/dynamic cases to format_flags Tom Zanussi
2009-10-06 13:07 ` [tip:perf/core] " tip-bot for Tom Zanussi
2009-10-06 6:09 ` [RFC][PATCH 4/9] perf trace: Add trace scripting ops Tom Zanussi
2009-10-06 6:09 ` [RFC][PATCH 5/9] perf trace: Add Perl scripting support Tom Zanussi
2009-10-06 13:00 ` Ingo Molnar
2009-10-07 4:09 ` Tom Zanussi
2009-10-07 14:13 ` Christoph Hellwig
2009-10-08 4:01 ` Tom Zanussi
2009-10-11 8:58 ` Ingo Molnar
2009-10-11 12:16 ` Frederic Weisbecker
2009-10-12 6:03 ` Ingo Molnar
2009-10-06 6:09 ` [RFC][PATCH 6/9] perf trace: Add scripting op for generating empty event handling scripts Tom Zanussi
2009-10-06 6:09 ` [RFC][PATCH 7/9] perf trace: Add FIELD_IS_FLAG/SYMBOLIC cases to format_flags Tom Zanussi
2009-10-06 6:09 ` [RFC][PATCH 8/9] perf trace: Add perf trace scripting support modules for Perl Tom Zanussi
2009-10-06 12:39 ` Ingo Molnar
2009-10-07 4:02 ` Tom Zanussi
2009-10-06 12:45 ` Ingo Molnar
2009-10-07 4:05 ` Tom Zanussi
2009-10-06 6:09 ` [RFC][PATCH 9/9] perf trace: Add throwaway timestamp sorting Tom Zanussi
2009-10-06 9:09 ` [RFC][PATCH 0/9] perf trace: support for general-purpose scripting Ingo Molnar
2009-10-06 13:25 ` Peter Zijlstra
2009-10-06 13:53 ` Ingo Molnar
2009-10-07 4:01 ` Tom Zanussi
2009-10-06 9:40 ` Frédéric Weisbecker
2009-10-06 12:54 ` Ingo Molnar
2009-10-06 13:09 ` Ingo Molnar
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=20091011090035.GG14995@elte.hu \
--to=mingo@elte.hu \
--cc=fweisbec@gmail.com \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lizf@cn.fujitsu.com \
--cc=rostedt@goodmis.org \
--cc=tzanussi@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
Powered by JetHome