On Mon, 14 Jan 2019 17:27:57 +0200 Slavomir Kaslev <kaslevs@xxxxxxxxxx> wrote: > @@ -194,8 +196,9 @@ tracecmd_create_buffer_recorder_fd(int fd, int cpu, unsigned flags, const char * > return tracecmd_create_buffer_recorder_fd2(fd, -1, cpu, flags, buffer, 0); > } > > -struct tracecmd_recorder * > -tracecmd_create_buffer_recorder(const char *file, int cpu, unsigned flags, const char *buffer) > +static struct tracecmd_recorder * > +__tracecmd_create_buffer_recorder(const char *file, int cpu, unsigned flags, > + const char *buffer) > { > struct tracecmd_recorder *recorder; > int fd; > @@ -258,6 +261,26 @@ tracecmd_create_buffer_recorder_maxkb(const char *file, int cpu, unsigned flags, > goto out; > } > > +struct tracecmd_recorder * > +tracecmd_create_buffer_recorder(const char *file, int cpu, unsigned flags, > + const char *buffer) > +{ > + return __tracecmd_create_buffer_recorder(file, cpu, flags, buffer); > +} > + > +struct tracecmd_recorder * > +tracecmd_create_recorder_virt(const char *file, int cpu, int trace_fd) As this looks to be something that may be a library call someday, I would keep flags as a parameter. > +{ > + struct tracecmd_recorder *recorder; > + > + recorder = __tracecmd_create_buffer_recorder( > + file, cpu, TRACECMD_RECORD_NOSPLICE, NULL); Then you could pass this as: recorder = __tracecmd_create_buffer_recorder(file, cpu, flags | TRACECMD_RECORD_NOSPLICE, NULL); -- Steve > + if (recorder) > + recorder->trace_fd = trace_fd; > + > + return recorder; > +} > + > struct tracecmd_recorder *tracecmd_create_recorder_fd(int fd, int cpu, unsigned flags) > { > const char *tracing;