From: Ingo Molnar <mingo@elte.hu>
To: Yinghai Lu <yhlu.kernel@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] add sysctl from printk_tag
Date: Thu, 18 Sep 2008 12:06:22 +0200 [thread overview]
Message-ID: <20080918100621.GA19499@elte.hu> (raw)
In-Reply-To: <1221725137-21947-1-git-send-email-yhlu.kernel@gmail.com>
* Yinghai Lu <yhlu.kernel@gmail.com> wrote:
> under /proc/sys/kernel/printk_tag/ will have acpi, apic, dev, pci
nice!
> Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
>
> ---
> init/main.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 56 insertions(+)
>
> Index: linux-2.6/init/main.c
> ===================================================================
> --- linux-2.6.orig/init/main.c
> +++ linux-2.6/init/main.c
> @@ -63,6 +63,8 @@
> #include <linux/idr.h>
> #include <linux/kmemcheck.h>
> #include <linux/ftrace.h>
> +#include <linux/sysctl.h>
> +#include <linux/proc_fs.h>
>
> #include <asm/io.h>
> #include <asm/bugs.h>
> @@ -395,6 +397,60 @@ static int __init quiet_kernel(char *str
> early_param("debug", debug_kernel);
> early_param("quiet", quiet_kernel);
>
> +#ifdef CONFIG_SYSCTL
> +static struct ctl_table printk_tag_ctl_dir[] = {
> + {
> + .procname = "printk_tag",
> + .mode = 0555,
> + },
> + {0, },
> +};
> +
> +static struct ctl_table printk_tag_ctl_root[] = {
> + {
> + .ctl_name = CTL_KERN,
> + .procname = "kernel",
> + .mode = 0555,
> + .child = printk_tag_ctl_dir,
> + },
> + {0, },
> +};
> +
> +static int __init proc_printk_tag_init(void)
> +{
> + int i;
> + struct ctl_table *entry;
> + char buf[32];
magic constant.
> + strncpy(buf, tag_level[i].name, len - 1);
> + entry->procname = kstrdup(buf, GFP_KERNEL);
> + entry->data = &tag_level[i].level;
> + entry->maxlen = sizeof(tag_level[i].level);
> + entry->mode = 0644;
> + entry->proc_handler = proc_dointvec;
> + entry++;
> + }
hm, whitespace damage in every second line.
Ingo
next prev parent reply other threads:[~2008-09-18 11:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-18 8:05 [PATCH] add sysctl from printk_tag Yinghai Lu
2008-09-18 10:06 ` Ingo Molnar [this message]
2008-09-20 23:05 ` Bjorn Helgaas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080918100621.GA19499@elte.hu \
--to=mingo@elte.hu \
--cc=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=yhlu.kernel@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox