try

#undef pr_fmt
#define pr_fmt(fmt)    "%s.c:%d: %s " fmt, __FILE__, __LINE__, __func__


On Tue, 3 Aug 2021 at 21:44, <[email protected]> wrote:
>
> hi all,
>
> there are many uses of :
>   pr_debug("%s ...\n", __func__, ...)
>
> I tried to do a preprocessor catenation to replace the runtime work,
> but that falls afoul of the def.
>
> from gnu gcc web-page:
>
> The identifier __func__ is implicitly declared by the translator as
> if, immediately following the opening brace of each function
> definition, the declaration
>
> static const char __func__[] = "function-name";
>
> These identifiers are variables, not preprocessor macros, and may not
> be used to initialize char arrays or be concatenated with string
> literals.
>
>
> is there a kernel macro version that would allow this "optimization" ?
>
> _______________________________________________
> Kernelnewbies mailing list
> [email protected]
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



-- 
Constantine Shulyupin

_______________________________________________
Kernelnewbies mailing list
[email protected]
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Reply via email to