diff options
author | William Lee Irwin III <wli@holomorphy.com> | 2005-05-17 00:53:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-17 10:59:21 -0400 |
commit | dfaa9c94b13071c9b5f8578d0ae99acc76c60139 (patch) | |
tree | d0ed2827e9c75b9ccb90b5fcc1b854bae51fc44c /kernel | |
parent | 5418b6925c353c8286651b67fdb8559dd9e54e46 (diff) |
[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>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/profile.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/kernel/profile.c b/kernel/profile.c index 0221a50ca867..ad8cbb75ffa2 100644 --- a/kernel/profile.c +++ b/kernel/profile.c | |||
@@ -49,15 +49,19 @@ static DECLARE_MUTEX(profile_flip_mutex); | |||
49 | 49 | ||
50 | static int __init profile_setup(char * str) | 50 | static int __init profile_setup(char * str) |
51 | { | 51 | { |
52 | static char __initdata schedstr[] = "schedule"; | ||
52 | int par; | 53 | int par; |
53 | 54 | ||
54 | if (!strncmp(str, "schedule", 8)) { | 55 | if (!strncmp(str, schedstr, strlen(schedstr))) { |
55 | prof_on = SCHED_PROFILING; | 56 | prof_on = SCHED_PROFILING; |
56 | printk(KERN_INFO "kernel schedule profiling enabled\n"); | 57 | if (str[strlen(schedstr)] == ',') |
57 | if (str[7] == ',') | 58 | str += strlen(schedstr) + 1; |
58 | str += 8; | 59 | if (get_option(&str, &par)) |
59 | } | 60 | prof_shift = par; |
60 | if (get_option(&str,&par)) { | 61 | printk(KERN_INFO |
62 | "kernel schedule profiling enabled (shift: %ld)\n", | ||
63 | prof_shift); | ||
64 | } else if (get_option(&str, &par)) { | ||
61 | prof_shift = par; | 65 | prof_shift = par; |
62 | prof_on = CPU_PROFILING; | 66 | prof_on = CPU_PROFILING; |
63 | printk(KERN_INFO "kernel profiling enabled (shift: %ld)\n", | 67 | printk(KERN_INFO "kernel profiling enabled (shift: %ld)\n", |