Created
November 28, 2017 14:30
-
-
Save doughgle/35f06326fe181b581d894514a9c2ab4f to your computer and use it in GitHub Desktop.
hardcode line 1 of /proc/1/sched
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c | |
index 1ca0130..8d4e1fc 100644 | |
--- a/kernel/sched/debug.c | |
+++ b/kernel/sched/debug.c | |
@@ -927,8 +927,11 @@ void proc_sched_show_task(struct task_struct *p, struct pid_namespace *ns, | |
{ | |
unsigned long nr_switches; | |
- SEQ_printf(m, "%s (%d, #threads: %d)\n", p->comm, task_pid_nr_ns(p, ns), | |
- get_nr_threads(p)); | |
+ // always return systemd and PID 1 | |
+ SEQ_printf(m, "systemd (1, #threads: %d)\n", get_nr_threads(p)); | |
+ // SEQ_printf(m, "%s (%d, #threads: %d)\n", p->comm, task_pid_nr_ns(p, ns), | |
+ // get_nr_threads(p)); | |
+ | |
SEQ_printf(m, | |
"---------------------------------------------------------" | |
"----------\n"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment