Re: [PATCH] tracing/probe: fix typo in pr_fmt in trace_uprobe.c

From: Joe Perches
Date: Thu Nov 16 2017 - 12:06:03 EST


On Wed, 2017-11-15 at 21:55 -0500, Steven Rostedt wrote:
> On Wed, 15 Nov 2017 14:55:19 -0800
> Joe Perches <joe@xxxxxxxxxxx> wrote:
>
> > Maybe use the much more common below instead?
> >
> > #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
>
> Is there someplace this is documented. My git grep foo isn't finding it
> for me.

Not so far as I know.

Maybe Michal Marek or Masahiro Yamada might add some
documentation in the future about these KBUILD defines.

btw, there are about 1800 #define pr_fmt uses and most
of them use KBUILD_MODNAME

$ git grep -P "^\s*#\s*define\s+pr_fmt\b" | \
cut -f2- -d":" | \
sed -r 's/^\s*#\s*define\s+pr_fmt([^ ]+)\s++/#define pr_fmt\1 /' | \
sed -r 's/\)\s+/) /' | sort | uniq -c | sort -rn | head -10
1166 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
134 #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
32 #define pr_fmt(fmt) "%s: " fmt, __func__
22 #define pr_fmt(fmt) KBUILD_MODNAME ":%s: " fmt, __func__
17 #define pr_fmt(fmt) KBUILD_MODNAME ":%s(): " fmt, __func__
13 #define pr_fmt(fmt) "xen:" KBUILD_MODNAME ": " fmt
11 #define pr_fmt(fmt) "arcnet:" KBUILD_MODNAME ": " fmt
10 #define pr_fmt(fmt) KBUILD_MODNAME ": %s: " fmt, __func__
10 #define pr_fmt(fmt) "IPv6: " fmt
9 #define pr_fmt(fmt) fmt