[PATCH] profile.c: `schedule' parsing fix
profile=schedule parsing is not quite what it should be. First, str[7] is 'e', not ',', but then even if it did fall through, prof_on = SCHED_PROFILING would be clobbered inside if (get_option(...)) So a small amount of rearrangement is done in this patch to correct it. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
5418b6925c
commit
dfaa9c94b1
|
@ -49,15 +49,19 @@ static DECLARE_MUTEX(profile_flip_mutex);
|
||||||
|
|
||||||
static int __init profile_setup(char * str)
|
static int __init profile_setup(char * str)
|
||||||
{
|
{
|
||||||
|
static char __initdata schedstr[] = "schedule";
|
||||||
int par;
|
int par;
|
||||||
|
|
||||||
if (!strncmp(str, "schedule", 8)) {
|
if (!strncmp(str, schedstr, strlen(schedstr))) {
|
||||||
prof_on = SCHED_PROFILING;
|
prof_on = SCHED_PROFILING;
|
||||||
printk(KERN_INFO "kernel schedule profiling enabled\n");
|
if (str[strlen(schedstr)] == ',')
|
||||||
if (str[7] == ',')
|
str += strlen(schedstr) + 1;
|
||||||
str += 8;
|
if (get_option(&str, &par))
|
||||||
}
|
prof_shift = par;
|
||||||
if (get_option(&str,&par)) {
|
printk(KERN_INFO
|
||||||
|
"kernel schedule profiling enabled (shift: %ld)\n",
|
||||||
|
prof_shift);
|
||||||
|
} else if (get_option(&str, &par)) {
|
||||||
prof_shift = par;
|
prof_shift = par;
|
||||||
prof_on = CPU_PROFILING;
|
prof_on = CPU_PROFILING;
|
||||||
printk(KERN_INFO "kernel profiling enabled (shift: %ld)\n",
|
printk(KERN_INFO "kernel profiling enabled (shift: %ld)\n",
|
||||||
|
|
Reference in New Issue