On Tue, Jun 22, 2021 at 4:27 AM Steven Rostedt <rostedt@xxxxxxxxxxx> wrote: > > On Thu, 10 Jun 2021 14:33:52 +0300 > "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@xxxxxxxxx> wrote: > > > The trace-cmd library has no APIs for initialization and free of the > > whole library. Added these new APIs: > > tracecmd_lib_init() > > tracecmd_lib_free() > > This isn't a very use friendly API. > > The reason I see you added this was for zlib, which I don't think is > necessary. I was missing that API when I worked on the host-guest time synch algorithms, to initialize the library time synchronization context. I decided to introduce a new API, for initializing only that part of the library - tracecmd_tsync_init(), as this functionality will not be used commonly. Now with the compression changes, there is a need for an API for initializing the library compression context. As this functionality will be used in almost all use cases, I think it makes sense to introduce this global tracecmd_lib_init() API, instead of something like tracecmd_lib_compression_init(). Personally I do not like the approach to have init APIs for different parts of the library, especially in case of widely used functionality. This will complicate the usage and will force the users to know the library internals. I would even suggest to remove the tracecmd_tsync_init() API and to init time sync context in the tracecmd_lib_init(). > > -- Steve > > > > > and call them in trace-cmd main function. > > -- Tzvetomir (Ceco) Stoyanov VMware Open Source Technology Center