Skip to content

Commit b3da2a7

Browse files
gormanmIngo Molnar
authored andcommitted
sched: document profile=sleep requiring CONFIG_SCHEDSTATS
profile=sleep only works if CONFIG_SCHEDSTATS is set. This patch notes the limitation in Documentation/kernel-parameters.txt and prints a warning at boot-time if profile=sleep is used without CONFIG_SCHEDSTAT. Signed-off-by: Mel Gorman <mel@csn.ul.ie> Signed-off-by: Ingo Molnar <mingo@elte.hu>
1 parent 838225b commit b3da2a7

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

‎Documentation/kernel-parameters.txt‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1444,7 +1444,8 @@ and is between 256 and 4096 characters. It is defined in the file
14441444
Param: "schedule" - profile schedule points.
14451445
Param: <number> - step/bucket size as a power of 2 for
14461446
statistical time based profiling.
1447-
Param: "sleep" - profile D-state sleeping (millisecs)
1447+
Param: "sleep" - profile D-state sleeping (millisecs).
1448+
Requires CONFIG_SCHEDSTATS
14481449
Param: "kvm" - profile VM exits.
14491450

14501451
processor.max_cstate= [HW,ACPI]

‎kernel/profile.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ static int __init profile_setup(char * str)
6060
int par;
6161

6262
if (!strncmp(str, sleepstr, strlen(sleepstr))) {
63+
#ifdef CONFIG_SCHEDSTATS
6364
prof_on = SLEEP_PROFILING;
6465
if (str[strlen(sleepstr)] == ',')
6566
str += strlen(sleepstr) + 1;
@@ -68,6 +69,10 @@ static int __init profile_setup(char * str)
6869
printk(KERN_INFO
6970
"kernel sleep profiling enabled (shift: %ld)\n",
7071
prof_shift);
72+
#else
73+
printk(KERN_WARNING
74+
"kernel sleep profiling requires CONFIG_SCHEDSTATS\n");
75+
#endif /* CONFIG_SCHEDSTATS */
7176
} else if (!strncmp(str, schedstr, strlen(schedstr))) {
7277
prof_on = SCHED_PROFILING;
7378
if (str[strlen(schedstr)] == ',')

0 commit comments

Comments
 (0)