3 ms·
If anyone wants to steal a done-tested-and-working userspace variant (for C, and with limitations C++) of this: https://github.com/FRRouting/frr/pull/6766 http
by eqvinox 5y ago
If anyone wants to steal a done-tested-and-working userspace variant (for C, and with limitations C++) of this:
https://github.com/FRRouting/frr/pull/6766 https://github.com/FRRouting/frr/pull/6766
It's pretty much the same thing, all occurences of "zlog_debug" and the like create an entry in a separate ELF section. The section can be accessed both at runtime by the program itself as well as offline by reading the appropriate ELF headers (there's an extraction tool in the codebase that does that, it even works cross-OS cross-CPU cross-endian).
disclaimer: it's my code ;)
disclaimer[2]: this will not work without major overhaul on OSX or Windows. It relies on the binary format being ELF.
disclaimer[3]: the PR linked above is only the "core" of it, you may have to fish out other pieces elsewhere.