Re: [patch 1/3] dynamic printk - core infrastructure

From: Jason Baron
Date: Wed Apr 02 2008 - 14:22:29 EST


On Tue, Apr 01, 2008 at 07:07:24PM -0700, Joe Perches wrote:
> On Tue, 2008-04-01 at 14:47 -0700, Randy Dunlap wrote:
> > > echo "add file.c" > /sys/kernel/debug/dynamic_printk/files
> > > echo "remove file.c" > /sys/kernel/debug/dynamic_printk/files
>
> I think this would be better by module rather than filename.
> KBUILD_MODNAME would be a better choice.
>
>

agreed. i think 'KBUILD_MODNAME" provides a better interface. The original
implementation was using complete source pathnames, so they were unique. Are
'KBUILD_MODNAME's unique?

I was also thinking of expanding this beyond just 'printk'. ie add the ability
to not only dynamically get printk output, but also tying more general
statistics and debugging infrastructure into this. For example,
CONFIG_SCHEDSTATS, can cause a runtime overhead. However, if we prefaced, the
calls with: if (unlikely(immediate_value)), we could drastically reduce the off
case. We might also need special cleanup and initialization functions, but I
could try and see what the code would look like.

-Jason


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