From: Borislav Petkov <bp@alien8.de>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
LKML <linux-kernel@vger.kernel.org>,
Steven Rostedt <srostedt@redhat.com>,
Ingo Molnar <mingo@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Peter Zijlstra <peterz@infradead.org>,
Arnaldo Carvalho de Melo <acme@infradead.org>,
Jiri Olsa <jolsa@redhat.com>, Arun Sharma <asharma@fb.com>,
Namhyung Kim <namhyung.kim@lge.com>
Subject: Re: [PATCH 02/15] tools/events: Add files to create libtraceevent.a
Date: Sat, 7 Apr 2012 11:08:27 +0200 [thread overview]
Message-ID: <20120407090827.GA7966@liondog.tnic> (raw)
In-Reply-To: <1333750544.2920.6.camel@acer.local.home>
On Fri, Apr 06, 2012 at 06:15:44PM -0400, Steven Rostedt wrote:
> > Yeah, the name "do_warning" is awkward. Can we call it emit_warning or
> > _warning or whatever?
>
> As this is just a macro defined as a helper in this file (not global),
> I'm not sure it needs to be changed. "emit" has two more characters to
> type over "do" ;-)
I know you're lazy :-) but "do_warning"? That's just nasty. How about
"_warning" or something?
[..]
> > I see you're using kernel-doc style comments. Is this aimed at providing
> > documentation for this library? If so, good idea!
>
> That was the plan. It also forced me to document the API.
I like that. This'll probably give more users to the lib.
> > > + * pevent_buffer_init - init buffer for parsing
> > > + * @buf: buffer to parse
> > > + * @size: the size of the buffer
> > > + *
> > > + * For use with pevent_read_token(), this initializes the internal
> > > + * buffer that pevent_read_token() will parse.
> > > + */
> > > +void pevent_buffer_init(const char *buf, unsigned long long size)
> > > +{
> > > + init_input_buf(buf, size);
> > > +}
> >
> > Can't we unify pevent_buffer_init and init_input_buf()? I mean, it is
> > useless to have that kind of indirection.
>
> Yeah I agree. This was more of a historical artifact. It use to be just
> init_input_buf() then I needed to export it for other users. Instead of
> doing a full rename, I cheesed out and did this.
:-)
> > In general, is "pevent" the prefix for this library's functions which
> > are getting exported to users?
>
> Yep. It's the "namespace" used. But if people do not like it, we can
> come up with another name. I just want it to be a short prefix.
Agreed, maybe even shorter: "te" for "traceevent" See, the namespace
of the kernel userspace tools is not that polluted yet so two-letter
namespaces are still up for grabs.
[..]
> > > + * pevent_print_funcs - print out the stored functions
> > > + * @pevent: handle for the pevent
> > > + *
> > > + * This prints out the stored functions.
> > > + */
> > > +void pevent_print_funcs(struct pevent *pevent)
> > > +{
> > > + int i;
> > > +
> > > + if (!pevent->func_map)
> > > + func_map_init(pevent);
> > > +
> > > + for (i = 0; i < (int)pevent->func_count; i++) {
> >
> > simply declare i as "unsigned int" and you don't need the cast here.
>
> I think I did that once but it caused problems elsewhere. But we can
> look at it again.
It shouldn't since the 'i' is a local variable to that function and it
doesn't prevent you from keeping pevent->func_count an unsigned int
which is probably visible elsewhere.
[..]
> >
> > Ok, enough for today. I'll review the rest only if you really want me to
> > :-).
> >
>
> Sure thanks for the comments now. The checkpatch clean ups should
> probably be fixed before this goes in, and removing the breakpoint
> function. But the other changes probably should wait. I would like what
> goes in to be as close to what is in trace-cmd as possible. Perhaps, we
> should add the cleanups as a separate patch. Just to have a nice
> transition.
Ok, makes sense. Let's leave those for another day.
--
Regards/Gruss,
Boris.
next prev parent reply other threads:[~2012-04-07 9:08 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-05 22:47 [RFC][PATCH 00/15] tools: Unify perf and trace-cmd trace event format parsing v2 Frederic Weisbecker
2012-04-05 22:47 ` [PATCH 01/15] perf: Separate out trace-cmd parse-events from perf files Frederic Weisbecker
2012-04-06 11:36 ` Borislav Petkov
2012-04-06 15:23 ` Frederic Weisbecker
2012-04-05 22:47 ` [PATCH 02/15] tools/events: Add files to create libtraceevent.a Frederic Weisbecker
2012-04-06 0:08 ` David Ahern
2012-04-06 0:18 ` Steven Rostedt
2012-04-06 0:24 ` David Ahern
2012-04-06 11:40 ` Borislav Petkov
2012-04-06 13:21 ` Borislav Petkov
2012-04-06 22:15 ` Steven Rostedt
2012-04-07 9:08 ` Borislav Petkov [this message]
2012-04-11 15:20 ` Arnaldo Carvalho de Melo
2012-04-11 15:38 ` Steven Rostedt
2012-04-11 17:47 ` Frederic Weisbecker
2012-04-11 17:54 ` Arnaldo Carvalho de Melo
2012-04-05 22:47 ` [PATCH 03/15] perf: Build libtraceevent.a Frederic Weisbecker
2012-04-06 11:45 ` Borislav Petkov
2012-04-06 15:26 ` Frederic Weisbecker
2012-04-06 15:51 ` Borislav Petkov
2012-04-09 17:10 ` Frederic Weisbecker
2012-04-05 22:47 ` [PATCH 04/15] events: Update tools/lib/traceevent to work with perf Frederic Weisbecker
2012-04-06 11:48 ` Borislav Petkov
2012-04-09 17:11 ` Frederic Weisbecker
2012-04-05 22:47 ` [PATCH 05/15] perf: Have perf use the new libtraceevent.a library Frederic Weisbecker
2012-04-05 22:47 ` [PATCH 06/15] perf/events: Add flag to produce nsec output Frederic Weisbecker
2012-04-05 22:47 ` [PATCH 07/15] perf/events: Add flag/symbol format_flags Frederic Weisbecker
2012-04-05 22:47 ` [PATCH 08/15] perf/events: Correct size given to memset Frederic Weisbecker
2012-04-06 11:24 ` Borislav Petkov
2012-04-06 12:00 ` Borislav Petkov
2012-04-06 12:27 ` Steven Rostedt
2012-04-05 22:48 ` [PATCH 09/15] parse-events: Handle invalid opcode parsing gracefully Frederic Weisbecker
2012-04-05 22:48 ` [PATCH 10/15] parse-events: Handle opcode parsing error Frederic Weisbecker
2012-04-05 22:48 ` [PATCH 11/15] parse-events: Let pevent_free() take a NULL pointer Frederic Weisbecker
2012-04-05 22:48 ` [PATCH 12/15] parse-events: Support '+' opcode in print format Frederic Weisbecker
2012-04-05 22:48 ` [PATCH 13/15] parse-events: Allow '*' and '/' operations in TP_printk Frederic Weisbecker
2012-04-05 22:48 ` [PATCH 14/15] parse-event: Fix memset pointer size bug in handle Frederic Weisbecker
2012-04-05 22:48 ` [PATCH 15/15] parse-events: Rename struct record to struct pevent_record Frederic Weisbecker
2012-04-06 3:07 ` [RFC][PATCH 00/15] tools: Unify perf and trace-cmd trace event format parsing v2 David Sharp
2012-04-06 15:11 ` Frederic Weisbecker
2012-04-09 10:13 ` Namhyung Kim
2012-04-23 14:47 ` Our failure on tracing tools unification (Was: Re: [RFC][PATCH 00/15] tools: Unify perf and trace-cmd trace event format parsing v2) Frederic Weisbecker
2012-04-23 15:08 ` Peter Zijlstra
2012-04-23 15:31 ` Steven Rostedt
2012-04-23 16:07 ` Borislav Petkov
2012-04-24 9:10 ` Thomas Gleixner
2012-04-25 8:05 ` Ingo Molnar
2012-04-25 12:39 ` Frederic Weisbecker
2012-04-25 14:19 ` Our failure on tracing tools unification Frank Ch. Eigler
2012-04-25 16:37 ` Arnaldo Carvalho de Melo
2012-04-25 12:26 [PATCH 00/15] tools: Unify perf and trace-cmd trace event format parsing v3 Frederic Weisbecker
2012-04-25 12:26 ` [PATCH 02/15] tools/events: Add files to create libtraceevent.a Frederic Weisbecker
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=20120407090827.GA7966@liondog.tnic \
--to=bp@alien8.de \
--cc=acme@infradead.org \
--cc=asharma@fb.com \
--cc=fweisbec@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung.kim@lge.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=srostedt@redhat.com \
--cc=tglx@linutronix.de \
/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®