On Thu, 9 Apr 2020 16:28:25 +0300 "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@xxxxxxxxx> wrote: > Add an API to create a tracecmd_handle from a file, > read and parse only the trace headers from the file. > This allows to implement opening a trace file on > stages - reading the trace headers and reading the trace data. > > Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@xxxxxxxxx> > --- > include/trace-cmd/trace-cmd.h | 1 + > lib/trace-cmd/trace-input.c | 28 ++++++++++++++++++++++++++++ > 2 files changed, 29 insertions(+) > > diff --git a/include/trace-cmd/trace-cmd.h b/include/trace-cmd/trace-cmd.h > index 3f96bbde..e22aa251 100644 > --- a/include/trace-cmd/trace-cmd.h > +++ b/include/trace-cmd/trace-cmd.h > @@ -143,6 +143,7 @@ typedef void (*tracecmd_handle_init_func)(struct tracecmd_input *handle, > struct tracecmd_input *tracecmd_alloc(const char *file); > struct tracecmd_input *tracecmd_alloc_fd(int fd); > struct tracecmd_input *tracecmd_open(const char *file); > +struct tracecmd_input *tracecmd_open_head(const char *file); > struct tracecmd_input *tracecmd_open_fd(int fd); > void tracecmd_ref(struct tracecmd_input *handle); > void tracecmd_close(struct tracecmd_input *handle); Hi Tzvetomir, I was thinking, before we release libtracecmd, we should add tracecmd_open() and tracecmd_open_fd() to the library. Just because I find that tracecmd_open_head() is a awkward name to have alone and only makes sense if there's already a tracecmd_open(). It will also help with differentiating the different functions. I know we were going to only have functions that kernelshark uses, but that may be a little too limiting. Thanks! -- Steve
![]() |