[PATCH] Write event stream in file

Ravindra Kumar Meena rmeena840 at gmail.com
Fri Jun 21 08:33:29 UTC 2019


>
>
> The
>
> static void print_item( FILE *f, const client_item *item )
>
> gets already a file, please use it.
>
> The file is currently stdout.  This should be changed to an event stream
> file.  Add the file pointer to client_context and open the file in main().
>
> Are you suggesting to change the client_context from

typedef struct client_context {
  uint64_t                       ns_threshold;
  uint64_t                       last_ns;
  uint32_t                       last_cpu;
  bool                           flush;
  bool                           only_one_cpu;
  uint64_t                       counter;
  SLIST_HEAD( , client_item )    free_items;
  RB_HEAD( active, client_item ) active_items;
} client_context;

to

typedef struct client_context {
  uint64_t                       ns_threshold;
  uint64_t                       last_ns;
  uint32_t                       last_cpu;
  bool                           flush;
  bool                           only_one_cpu;
  uint64_t                       counter;
  SLIST_HEAD( , client_item )    free_items;
  RB_HEAD( active, client_item ) active_items;
  FILE                           *fptr;
} client_context;

In this case, I have to create global client_context variable to store the
file pointer in it. Is that good?


-- 
*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/add01eb5/attachment-0002.html>


More information about the devel mailing list