Use the right values for CODE_LINE and CODE_FUNC in journal traces

Patrick Williams patrick at stwcx.xyz
Thu May 13 11:51:08 AEST 2021


On Tue, May 11, 2021 at 02:03:19PM +0800, George Liu wrote:
> But for the log method, has defined a variable parameter, so it can
> not receive a default parameter again.
> link: https://github.com/openbmc/phosphor-logging/blob/master/phosphor-logging/log.hpp#L157
> 
> Does everyone have a better way to process it? Please let me know and
> we can discuss it here.

There was similiar discussion in the past of using source_location to
get the real file/line as you suggested.  I don't think anyone put tons
of thought into how to get it into the function though.

source_location isn't supported by GCC until 11 per [1] and we don't
have that in Yocto yet.  I know I was at least holding off until we get
that to do much experimentation.

1. https://en.cppreference.com/w/cpp/compiler_support

-- 
Patrick Williams
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20210512/ea6b84c9/attachment.sig>


More information about the openbmc mailing list