<div dir="ltr"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> seconds = (uint32_t) ( item->ns / 1000000000 );<br>
> nanoseconds = (uint32_t) ( item->ns % 1000000000 );<br>
> + ns=nanoseconds;<br>
<br>
Why not move the nanoseconds variable into the upper block?<br></blockquote><div>Okay </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> fprintf( f, "%" PRIu32 ".%09" PRIu32 ":", seconds, nanoseconds );<br>
> } else {<br>
<br>
Which value has "ns" in this path?<br></blockquote><div>na does not have a unique value. It is changing eveytime print_item() is called upon</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> fprintf( f, "*:" );<br>
> @@ -153,6 +164,22 @@ static void print_item( FILE *f, const client_item *item )<br>
> rtems_record_event_text( item->event ),<br>
> item->data<br>
> );<br>
> +<br>
> + FILE *fptr = fopen("event", "a");<br>
<br>
How often gets this file opened and closed? Do you think that opening and closing a file is a cheap operation? Could there be a more efficient solution?<br></blockquote><div>I would like to know your approach. I will implement that only. It's better to implement your approach instead of mine. It will save some time.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> +<br>
> + if (fptr == NULL)<br>
> + {<br>
> + printf("Could not open file");<br>
> + return 0;<br>
<br>
Can void functions return something?<br></blockquote><div>Ooops. I didn't see the void. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> + }<br>
> +<br>
> + ctf_item->cpu=item->cpu;<br>
<br>
To which object points the the ctf_item pointer here?<br></blockquote><div>Are you expecting pointer here? </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> + ctf_item->event=item->event;<br>
> + ctf_item->data=item->data;<br>
> + ctf_item->ns=ns;<br>
> +<br>
> + fprintf(fptr,ctf_item);<br>
> + fclose(fptr);<br>
> }<br>
> <br>
> static void flush_items( client_context *cctx )<br>
> --<br>
> 2.7.4<br>
<br>
Did you compile and run the program with this patch?<br>
</blockquote></div><div><br></div>Yes the rtems-tools was building successfully but I was getting nothing in file.<br clear="all"><div><br></div>-- <br><div dir="ltr" class="m_2907901620948031347gmail_signature"><div dir="ltr"><div><div dir="ltr"><font size="4"><b>Ravindra Kumar Meena</b></font>,<div><span style="color:rgb(102,102,102)">B. Tech. Computer Science and Engineering,<br></span></div><div><span style="color:rgb(102,102,102)"><a href="https://www.iitism.ac.in/" style="color:rgb(17,85,204)" target="_blank">Indian Institute of Technology (Indian School of Mines)</a>, Dhanbad</span></div></div></div></div></div></div>