lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACV3sb+EoHPqM7ih-5HpiT-o9CqobhaiJJ3E7-8H7N=tR7URig@mail.gmail.com>
Date:	Tue, 17 Jul 2012 13:23:46 +0800
From:	Jovi Zhang <bookjovi@...il.com>
To:	Steven Rostedt <rostedt@...dmis.org>
Cc:	Joe Perches <joe@...ches.com>,
	Frédéric Weisbecker <fweisbec@...il.com>,
	Ingo Molnar <mingo@...hat.com>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] ftrace: using pr_fmt for better printk output

On Tue, Jul 17, 2012 at 12:25 PM, Steven Rostedt <rostedt@...dmis.org> wrote:
> On Mon, 2012-07-16 at 20:42 -0700, Joe Perches wrote:
>
>> > diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
>> []
>> > @@ -13,6 +13,8 @@
>> >   *  Copyright (C) 2004 William Lee Irwin III
>> >   */
>> >
>> > +#define pr_fmt(fmt) "ftrace: " fmt
>>
>> #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
>
> Wouldn't a nicer patch be to move this into a header file and then
> remove all the defines throughout the kernel tree?

Maybe it's hard to achieve that.
subsystem name is unique with each other, it should be visible in source file,
if include into header file, then each .c file might need a own header
file for include pr_fmt
definition, then that header file cannot be reusable(avoid subsystem
name conflicts).

>
> Also, what is KBUILD_MODNAME defined as for non-modules? As ftrace is
> not a module.
Yes, that's why I cannot use KBUILD_MODNAME in patch.

>
> -- Steve

I don't make sure if there have some method or skill to let GCC knows
subsystem name automatically,
use built-in macro __FILE__? but this need condition of subsystem name
is same as file name,
not so easily to guarantee that.


.jovi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ