[PATCH] Write event stream in file

Ravindra Kumar Meena rmeena840 at gmail.com
Fri Jun 21 14:45:35 UTC 2019


>
> > I was able to store the event stream in file. I have sent the patch for
> > the same. It has only one warning that I have to discuss with you.
> >
> > ../misc/record/record-main.c:172:14: warning: ‘ns’ may be used
> > uninitialized in this function [-Wmaybe-uninitialized]
> >     ctf_item.ns=ns;
> >                ^
> > ../misc/record/record-main.c:147:12: note: ‘ns’ was declared here
> >     uint32_t ns;
>
> This is not a warning. It is an error. The ns variable is not set in the
> else path.
>

Should I remove the inner content of if block? Since we are not using
fprintf() anymore.

>
> It should look like this:
>
> static void print_item( FILE *f, const client_item *item )
> {
>    ctf_event ctf_item;
>
>    ctf_item.ns = item->ns;
>    ctf_item.cpu = item->cpu;
>    ctf_item.event = item->event;
>    ctf_item.data = item->data;
>
>    fwrite( &ctf_item, sizeof( ctf_item ), 1, f );
> }
>
Okay


-- 
*Ravindra Kumar Meena*,
B. Tech. Computer Science and Engineering,
Indian Institute of Technology (Indian School of Mines)
<https://www.iitism.ac.in/>, Dhanbad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20190621/63a3e03a/attachment-0002.html>


More information about the devel mailing list