* [PATCH][plugsched 26/28] Add description to proc
@ 2004-10-30 14:41 Con Kolivas
0 siblings, 0 replies; only message in thread
From: Con Kolivas @ 2004-10-30 14:41 UTC (permalink / raw)
To: linux
Cc: Andrew Morton, Ingo Molnar, Peter Williams, William Lee Irwin III,
Alexander Nyberg, Nick Piggin
[-- 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 --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-10-30 14:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-30 14:41 [PATCH][plugsched 26/28] Add description to proc Con Kolivas
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.