Re: [PATCH 02/15] tools/events: Add files to create libtraceevent.a

From: Frederic Weisbecker
Date: Wed Apr 11 2012 - 13:47:48 EST


2012/4/11 Steven Rostedt <rostedt@xxxxxxxxxxx>:
> On Wed, 2012-04-11 at 12:20 -0300, Arnaldo Carvalho de Melo wrote:
>> > +int pevent_register_function(struct pevent *pevent, char *func,
>> > +                        unsigned long long addr, char *mod)
>> > +{
>> > +   struct func_list *item;
>> > +
>> > +   item = malloc_or_die(sizeof(*item));
>> > +
>> > +   item->next = pevent->funclist;
>> > +   item->func = strdup(func);
>> > +   if (mod)
>> > +           item->mod = strdup(mod);
>> > +   else
>> > +           item->mod = NULL;
>>
>> strdup can fail, and no, we shouldn't die if that happens :-)
>
> Again, this all needs to be audited. But this isn't much different than
> what perf already does with the tools/perf/util/trace-event-parse.c
>
> Thus, getting the code out can be the first step. Cleaning it up into a
> nice library the second.

I agree. This is essentially moving the existing code in perf (but an
improved version of it) to a standalone
library. This is a big problem on its own already. The big one in fact.

Improving it is certainly a necessary following up step. And in fact
this is one of
the purposes of this library: make the improvements there easier. But
I believe this
should be done incrementally, once we get the migration done.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/