From: Con Kolivas <kernel@kolivas.org>
To: linux <linux-kernel@vger.kernel.org>
Cc: Andrew Morton <akpm@osdl.org>, Ingo Molnar <mingo@elte.hu>,
Peter Williams <pwil3058@bigpond.net.au>,
William Lee Irwin III <wli@holomorphy.com>,
Alexander Nyberg <alexn@dsv.su.se>,
Nick Piggin <nickpiggin@yahoo.com.au>
Subject: [PATCH][plugsched 26/28] Add description to proc
Date: Sun, 31 Oct 2004 00:41:33 +1000 [thread overview]
Message-ID: <4183A81D.7050700@kolivas.org> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 25 bytes --]
Add description to proc
[-- Attachment #1.2: add_proc_description.diff --]
[-- Type: text/x-patch, Size: 1458 bytes --]
Add an entry in /proc/scheduler which reads out the running cpu scheduler's
name.
Signed-off-by: Con Kolivas <kernel@kolivas.org>
Index: linux-2.6.10-rc1-mm2-plugsched1/fs/proc/proc_misc.c
===================================================================
--- linux-2.6.10-rc1-mm2-plugsched1.orig/fs/proc/proc_misc.c 2004-10-30 00:19:30.452320081 +1000
+++ linux-2.6.10-rc1-mm2-plugsched1/fs/proc/proc_misc.c 2004-10-30 00:20:14.086339759 +1000
@@ -45,6 +45,7 @@
#include <linux/sysrq.h>
#include <linux/vmalloc.h>
#include <linux/crash_dump.h>
+#include <linux/sched.h>
#include <asm/uaccess.h>
#include <asm/pgtable.h>
#include <asm/io.h>
@@ -265,6 +266,18 @@ static int version_read_proc(char *page,
return proc_calc_metrics(page, start, off, count, eof, len);
}
+static int scheduler_read_proc(char *page, char **start, off_t off,
+ int count, int *eof, void *data)
+{
+ char *sched_name = scheduler->cpusched_name;
+ int len;
+
+ strcpy(page, sched_name);
+ strcat(page, "\n");
+ len = strlen(page);
+ return proc_calc_metrics(page, start, off, count, eof, len);
+}
+
extern struct seq_operations cpuinfo_op;
static int cpuinfo_open(struct inode *inode, struct file *file)
{
@@ -608,6 +621,7 @@ void __init proc_misc_init(void)
{"cmdline", cmdline_read_proc},
{"locks", locks_read_proc},
{"execdomains", execdomains_read_proc},
+ {"scheduler", scheduler_read_proc},
{NULL,}
};
for (p = simple_ones; p->name; p++)
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 256 bytes --]
reply other threads:[~2004-10-30 14:53 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=4183A81D.7050700@kolivas.org \
--to=kernel@kolivas.org \
--cc=akpm@osdl.org \
--cc=alexn@dsv.su.se \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=nickpiggin@yahoo.com.au \
--cc=pwil3058@bigpond.net.au \
--cc=wli@holomorphy.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
Powered by JetHome