Re: [PATCH v2] libtracefs: Add new API for open trace marker file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 8, 2021 at 3:59 PM Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
>
> On Thu,  8 Apr 2021 11:08:21 +0300
> "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@xxxxxxxxx> wrote:
>
> > Added new APIs for opening trace_marker file of given instance:
> >    tracefs_marker_init()
> >    tracefs_marker_write()
> >    tracefs_marker_vprint()
> >    tracefs_marker_print()
> >    tracefs_marker_close()
>
> I really don't like the name as it's more about the tracefs implementation
> and not what it's used for. I much rather have:
>
>         tracefs_print_init();
>         tracefs_printf();
>         tracefs_vprintf();
>         tracefs_print_close();
>
> And you should never write binary into the trace_marker file, as it always
> expects ascii strings. That's the trace_marker_raw file. In which case we
> could have:
>
>         tracefs_binary_init();
>         tracefs_binary_write();
>         tracefs_binary_close();
>
> For binary writes.
>
I find "tracefs_print_" a little bit confusing, like printing
something on console. I think the name should stress that a user
string/data is written in the trace buffer. I would like to combine
string and binary APIs into one set, something like:

 tracefs_user_trace_init();  /* open both trace_marker and
trace_marker_raw files, or have flags to specify what file to open,
string or data*/
 tracefs_user_trace_printf(); /* write to  trace_marker */
 tracefs_user_trace_vprintf(); /* write to  trace_marker */
 tracefs_user_trace_binary(); /* write to  trace_marker_raw */
 tracefs_user_trace_init(); /* close both string and data fd, if open */


> -- Steve



-- 
Tzvetomir (Ceco) Stoyanov
VMware Open Source Technology Center



[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux