On Tue, Jun 22, 2021 at 4:26 AM Steven Rostedt <rostedt@xxxxxxxxxxx> wrote: > > On Mon, 14 Jun 2021 10:50:01 +0300 > "Tzvetomir Stoyanov (VMware)" <tz.stoyanov@xxxxxxxxx> wrote: > > > If libz is available, use that library to provide trace file compression > > support. The library is detected runtime. > > Why have the library detected at runtime? > > If it is detected, we can then have the library flags include -lz. > > Why use dlopen to load zlib? And not just include it? > > This seems rather fragile to try to get right. The idea of this design is not to bring additional mandatory dependencies. I do not know if libz is available by default, but even if we assume it is - each additional compression library that is added will be a mandatory dependency. The compression is not a mandatory functionality, trace-cmd can work without it. Why do you think it is fragile, I think dlopen() uses the same core linker logic to find and load the library. The only difference I see is that using "-lz" leads to a mandatory dependency, trace-cmd will not run without it. > > -- Steve > > > > > > Signed-off-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@xxxxxxxxx> > > --- -- Tzvetomir (Ceco) Stoyanov VMware Open Source Technology Center