Re: [PATCH v4 1/3] tracing: Add array printing helpers

From: Steven Rostedt
Date: Wed Jan 28 2015 - 16:08:49 EST


On Wed, 28 Jan 2015 12:24:03 +0000
Javi Merino <javi.merino@xxxxxxx> wrote:

> > > el_size should not be based on bits, it should be based on bytes. I
> > > passed in "sizeof()" which doesn't work with bits.
>
> Ugh. If you use sizeof() in print_array() then trace-cmd won't be
> able to parse it since it doesn't have an implementation of sizeof().
>
> [thermal_power_allocator:thermal_power_allocator] function sizeof not defined
> Error: expected type 5 but read 0
> *** Error in `./trace-cmd': double free or corruption (fasttop): 0x0000000000e04980 ***
>
> Implementing a fully functional sizeof() in trace-cmd will be a huge
> beast, I guess you will have to limit it to only some types.

Well it shouldn't crash, because people will be using things like
sizeof(). Just default it to 4 or 8 (word length).

We can work on a sizeof routine later. I have ideas on how to do it. Or
at least make it work for the common cases.

-- Steve

>
> > > Please update to "el_size < 1 || el_size > 8".
> > >
> > > and adjust the rest accordingly.
> >
> > Done, I'm testing it now. I'll send a v5 later today.
> >
> > Cheers,
> > Javi

--
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/