On Thu, 29 Jul 2021 08:09:09 +0300 "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@xxxxxxxxx> wrote: > Setting the long size to the input tep handler in tracecmd_read_headers() > API may be too late, as this tep handler is used to read and parse data > from the file before that. The most suitable place for that is > tracecmd_alloc_fd() API, right after reading the long size from the > file. > Typo in subject. I was expecting to see some log size get set ;-) -- Steve > Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@xxxxxxxxx> > --- > lib/trace-cmd/trace-input.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/lib/trace-cmd/trace-input.c b/lib/trace-cmd/trace-input.c > index bf56c92a..0ced15a8 100644 > --- a/lib/trace-cmd/trace-input.c > +++ b/lib/trace-cmd/trace-input.c > @@ -976,8 +976,6 @@ int tracecmd_read_headers(struct tracecmd_input *handle, > if (ret < 0) > return -1; > > - tep_set_long_size(handle->pevent, handle->long_size); > - > if (state <= handle->file_state) > return 0; > > @@ -3473,6 +3471,7 @@ struct tracecmd_input *tracecmd_alloc_fd(int fd, int flags) > > do_read_check(handle, buf, 1); > handle->long_size = buf[0]; > + tep_set_long_size(handle->pevent, handle->long_size); > > read4(handle, &page_size); > handle->page_size = page_size;