Skip to contentSkip to conversation

2.4: export scheduling information from /proc

PATCH New Robert Love 1 participant 1 message Oct 6, 2002 Proc filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 2.4: export scheduling information from /proc

Menacing Marcelo,

Attached patch exports scheduling policy and real-time priority from /proc/<pid>/stats.

This code is in 2.4-ac and 2.5.

This does _not_ break previous versions of procps -- there is no harm and it is fully backward compatible. New versions, starting with 2.0.8, can parse this information.

Patch is against 2.4.20-pre9. Please, apply.

Robert Love

fs/proc/array.c +4 -2
diff -urN linux-2.4.20-pre9/fs/proc/array.c linux/fs/proc/array.c
@@ -347,7 +347,7 @@
 	read_unlock(&tasklist_lock);
 	res = sprintf(buffer,"%d (%s) %c %d %d %d %d %d %lu %lu \
 %lu %lu %lu %lu %lu %ld %ld %ld %ld %ld %ld %lu %lu %ld %lu %lu %lu %lu %lu \
-%lu %lu %lu %lu %lu %lu %lu %lu %d %d\n",
+%lu %lu %lu %lu %lu %lu %lu %lu %d %d %lu %lu\n",
 		task->pid,
 		task->comm,
 		state,
@@ -390,7 +390,9 @@
 		task->nswap,
 		task->cnswap,
 		task->exit_signal,
-		task->processor);
+		task->processor,
+		task->rt_priority,
+		task->policy);
 	if(mm)
 		mmput(mm);
 	return res;