<div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
The<br>
<br>
static void print_item( FILE *f, const client_item *item )<br>
<br>
gets already a file, please use it.<br>
<br>
The file is currently stdout.  This should be changed to an event stream <br>
file.  Add the file pointer to client_context and open the file in main().<br><br></blockquote><div>Are you suggesting to change the client_context from</div><div><br></div><div>typedef struct client_context {<br>  uint64_t                       ns_threshold;<br>  uint64_t                       last_ns;<br>  uint32_t                       last_cpu;<br>  bool                           flush;<br>  bool                           only_one_cpu;<br>  uint64_t                       counter;<br>  SLIST_HEAD( , client_item )    free_items;<br>  RB_HEAD( active, client_item ) active_items;<br>} client_context;<br></div><div> </div><div>to</div><div><br></div>typedef struct client_context {<br>  uint64_t                       ns_threshold;<br>  uint64_t                       last_ns;<br>  uint32_t                       last_cpu;<br>  bool                           flush;<br>  bool                           only_one_cpu;<br>  uint64_t                       counter;<br>  SLIST_HEAD( , client_item )    free_items;<br>  RB_HEAD( active, client_item ) active_items;<br>  FILE                           *fptr;<br><div>} client_context; </div><div><br></div><div>In this case, I have to create global client_context variable to store the file pointer in it. Is that good?</div></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="m_-5981097567799700607gmail_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>