diff options
| author | Adrian Bunk <bunk@kernel.org> | 2008-07-25 04:45:35 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-25 13:53:27 -0400 |
| commit | b03f6489f9f27dc519a4c60ebf39cc7b8a58eae7 (patch) | |
| tree | 6329fc91e860f2949d737c611aa846eb2d653103 /kernel | |
| parent | 696adfe84c11c571a1e0863460ff0ec142b4e5a9 (diff) | |
build kernel/profile.o only when requested
Build kernel/profile.o only if CONFIG_PROFILING is enabled.
This makes CONFIG_PROFILING=n kernels smaller.
As a bonus, some profile_tick() calls and one branch from schedule() are
now eliminated with CONFIG_PROFILING=n (but I doubt these are
measurable effects).
This patch changes the effects of CONFIG_PROFILING=n, but I don't think
having more than two choices would be the better choice.
This patch also adds the name of the first parameter to the prototypes
of profile_{hits,tick}() since I anyway had to add them for the dummy
functions.
Signed-off-by: Adrian Bunk <bunk@kernel.org>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/Makefile | 3 | ||||
| -rw-r--r-- | kernel/profile.c | 4 |
2 files changed, 2 insertions, 5 deletions
diff --git a/kernel/Makefile b/kernel/Makefile index 15ab63ffe64d..54f69837d35a 100644 --- a/kernel/Makefile +++ b/kernel/Makefile | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | # Makefile for the linux kernel. | 2 | # Makefile for the linux kernel. |
| 3 | # | 3 | # |
| 4 | 4 | ||
| 5 | obj-y = sched.o fork.o exec_domain.o panic.o printk.o profile.o \ | 5 | obj-y = sched.o fork.o exec_domain.o panic.o printk.o \ |
| 6 | cpu.o exit.o itimer.o time.o softirq.o resource.o \ | 6 | cpu.o exit.o itimer.o time.o softirq.o resource.o \ |
| 7 | sysctl.o capability.o ptrace.o timer.o user.o \ | 7 | sysctl.o capability.o ptrace.o timer.o user.o \ |
| 8 | signal.o sys.o kmod.o workqueue.o pid.o \ | 8 | signal.o sys.o kmod.o workqueue.o pid.o \ |
| @@ -24,6 +24,7 @@ CFLAGS_REMOVE_sched_clock.o = -pg | |||
| 24 | CFLAGS_REMOVE_sched.o = -mno-spe -pg | 24 | CFLAGS_REMOVE_sched.o = -mno-spe -pg |
| 25 | endif | 25 | endif |
| 26 | 26 | ||
| 27 | obj-$(CONFIG_PROFILING) += profile.o | ||
| 27 | obj-$(CONFIG_SYSCTL_SYSCALL_CHECK) += sysctl_check.o | 28 | obj-$(CONFIG_SYSCTL_SYSCALL_CHECK) += sysctl_check.o |
| 28 | obj-$(CONFIG_STACKTRACE) += stacktrace.o | 29 | obj-$(CONFIG_STACKTRACE) += stacktrace.o |
| 29 | obj-y += time/ | 30 | obj-y += time/ |
diff --git a/kernel/profile.c b/kernel/profile.c index 58926411eb2a..cd26bed4cc26 100644 --- a/kernel/profile.c +++ b/kernel/profile.c | |||
| @@ -112,8 +112,6 @@ void __init profile_init(void) | |||
| 112 | 112 | ||
| 113 | /* Profile event notifications */ | 113 | /* Profile event notifications */ |
| 114 | 114 | ||
| 115 | #ifdef CONFIG_PROFILING | ||
| 116 | |||
| 117 | static BLOCKING_NOTIFIER_HEAD(task_exit_notifier); | 115 | static BLOCKING_NOTIFIER_HEAD(task_exit_notifier); |
| 118 | static ATOMIC_NOTIFIER_HEAD(task_free_notifier); | 116 | static ATOMIC_NOTIFIER_HEAD(task_free_notifier); |
| 119 | static BLOCKING_NOTIFIER_HEAD(munmap_notifier); | 117 | static BLOCKING_NOTIFIER_HEAD(munmap_notifier); |
| @@ -203,8 +201,6 @@ void unregister_timer_hook(int (*hook)(struct pt_regs *)) | |||
| 203 | } | 201 | } |
| 204 | EXPORT_SYMBOL_GPL(unregister_timer_hook); | 202 | EXPORT_SYMBOL_GPL(unregister_timer_hook); |
| 205 | 203 | ||
| 206 | #endif /* CONFIG_PROFILING */ | ||
| 207 | |||
| 208 | 204 | ||
| 209 | #ifdef CONFIG_SMP | 205 | #ifdef CONFIG_SMP |
| 210 | /* | 206 | /* |
