Skip to content

Commit

Permalink
sched/debug: Add debugfs knob for "sched_debug"
Browse files Browse the repository at this point in the history
I'm forever late for editing my kernel cmdline, add a runtime knob to
disable the "sched_debug" thing.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20170907150614.142924283@infradead.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Sep 12, 2017
1 parent 4ff9083 commit 9469eb0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions kernel/sched/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,16 @@ static const struct file_operations sched_feat_fops = {
.release = single_release,
};

__read_mostly bool sched_debug_enabled;

static __init int sched_init_debug(void)
{
debugfs_create_file("sched_features", 0644, NULL, NULL,
&sched_feat_fops);

debugfs_create_bool("sched_debug", 0644, NULL,
&sched_debug_enabled);

return 0;
}
late_initcall(sched_init_debug);
Expand Down
2 changes: 2 additions & 0 deletions kernel/sched/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -1954,6 +1954,8 @@ extern struct sched_entity *__pick_first_entity(struct cfs_rq *cfs_rq);
extern struct sched_entity *__pick_last_entity(struct cfs_rq *cfs_rq);

#ifdef CONFIG_SCHED_DEBUG
extern bool sched_debug_enabled;

extern void print_cfs_stats(struct seq_file *m, int cpu);
extern void print_rt_stats(struct seq_file *m, int cpu);
extern void print_dl_stats(struct seq_file *m, int cpu);
Expand Down
4 changes: 1 addition & 3 deletions kernel/sched/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@ cpumask_var_t sched_domains_tmpmask2;

#ifdef CONFIG_SCHED_DEBUG

static __read_mostly int sched_debug_enabled;

static int __init sched_debug_setup(char *str)
{
sched_debug_enabled = 1;
sched_debug_enabled = true;

return 0;
}
Expand Down

0 comments on commit 9469eb0

Please sign in to comment.