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

From: Joe Perches
Date: Fri Apr 04 2008 - 14:35:20 EST


On Fri, 2008-04-04 at 14:13 -0400, Jason Baron wrote:
> here is a re-spun patch incorporating comments from the thread.

> +#define dev_dbg(dev, format, arg...) do { \
> + if (unlikely(imv_read(dynamic_debug_on))) \

I think the use of unlikely here and in pr_debug is unnecessary.

> +static struct hlist_head file_table[FILE_TABLE_SIZE] =
> + { [0 ... FILE_TABLE_SIZE-1] = HLIST_HEAD_INIT };
> +static DECLARE_MUTEX(debug_list_mutex);
> +static int nr_entries;

Shouldn't this be a module_table?

I think that hashing may be an unnecessary optimization and
that there's no real need to use a limited FILE_TABLE_SIZE
at all. I think the most likely use cases for this facility
has either one or two modules being debugged or all modules
or no modules.

cheers, Joe

--
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/