On Tue, 6 Aug 2019 02:07:02 +0100, Peter Wu wrote: > /proc/config has never existed as far as I can see, but /proc/config.gz > is present on Arch Linux. Execute an external gunzip program to avoid > linking to zlib and rework the option scanning code since a pipe is not > seekable. This also fixes a file handle leak on some error paths.
Please post the fix for the handle leak separately against the bpf tree. > Fixes: 4567b983f78c ("tools: bpftool: add probes for kernel configuration > options") Other than the leak I'm not sure this qualifies as a bug. Reading config.gz was consciously left to be implemented later. > Cc: Quentin Monnet <quentin.mon...@netronome.com> > Signed-off-by: Peter Wu <pe...@lekensteyn.nl> > --- > v2: fix style (reorder vars as reverse xmas tree, rename function, > braces), fallback to /proc/config.gz if uname() fails. > > Hi, > > Although Stanislav and Jakub suggested to use zlib in v1, I have not > implemented that yet since the current patch is quite minimal. > > Using zlib instead of executing an external gzip program would like add > another 100-150 lines. It likely requires a bigger rewrite to avoid > getline() assuming that no temporary file is used for the uncompressed > config. If zlib is desired, I would suggest doing it in another patch. > > Thoughts? I'd rather avoid the fork and pipe. We already implicitly link against zlib for libelf etc.