1) Drop __KERNEL__ out of profile.h. It contains only internal kernel stuff and
not in exported headers list
2) Put profile.c under CONFIG_PROFILING. You enabled profiling in config, you
will get it.
Removes conditional branch from schedule(). Code savings on myNice savings there. Not that 1.7K is huge, but it's kernel memory is
usual config:
text data bss dec hex filename
2921871 179895 180224 3281990 321446 vmlinux before
2920141 179847 180224 3280212 320d54 vmlinux after
--------------------------------------------------------------
-1730 -48 -1778
3) Make timer_hook static (hi, Adrian!)
4) Convert do {} while (0) into static inline functions
5) minor misc stuff
Signed-off-by: Alexey Dobriyan <adobriyan@xxxxxxxxx>[snip]
---
include/linux/profile.h | 78 +++++++++++++++++++++++++-----------------------
kernel/Makefile | 3 +
kernel/profile.c | 2 -
3 files changed, 44 insertions(+), 39 deletions(-)
+#define prof_on 0
+static inline void profile_init(void)
+{
+}
+static inline void profile_tick(int type)[snip]
+{
+}
+static inline void profile_hits(int type, void *ip, unsigned int nr_hits)
+{
+}
+static inline void profile_hit(int type, void *ip)
+{
+}
+static inline void profile_munmap(unsigned long addr)
+{
+}
+static inline void profile_task_exit(struct task_struct *tsk)
+{
+}
+static inline int profile_handoff_task(struct task_struct *tsk)
+{
+ return 0;
+}