summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-04-11 22:41:20 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-04-11 22:41:20 -0700
commitb283f09cf8f51c29bf90e42e22099f76d0f33378 (patch)
tree7aee46f073ec3c8fc678b64eb430e2958ff0de1e /include
parentee28db843649533f5650186251ae4a8bd49a3da9 (diff)
[PATCH] Fix get_wchan() FIXME wrt. order of functions
From: William Lee Irwin III <wli@holomorphy.com> This addresses the issue with get_wchan() that the various functions acting as scheduling-related primitives are not, in fact, contiguous in the text segment. It creates an ELF section for scheduling primitives to be placed in, and places currently-detected (i.e. skipped during stack decoding) scheduling primitives and others like io_schedule() and down(), which are currently missed by get_wchan() code, into this section also. The net effects are more reliability of get_wchan()'s results and the new ability, made use of by this code, to arbitrarily place scheduling primitives in the source code without disturbing get_wchan()'s accuracy. Suggestions by Arnd Bergmann and Matthew Wilcox regarding reducing the invasiveness of the patch were incorporated during prior rounds of review. I've at least tried to sweep all arches in this patch.
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/vmlinux.lds.h5
-rw-r--r--include/linux/init.h2
-rw-r--r--include/linux/sched.h2
3 files changed, 9 insertions, 0 deletions
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 59c2b950e8b8..a4b6c768cf49 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -51,3 +51,8 @@
*(.security_initcall.init) \
__security_initcall_end = .; \
}
+
+#define SCHED_TEXT \
+ __scheduling_functions_start_here = .; \
+ *(.sched.text) \
+ __scheduling_functions_end_here = .;
diff --git a/include/linux/init.h b/include/linux/init.h
index 45069e275b3d..c6842477243c 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -46,6 +46,8 @@
#define __exitdata __attribute__ ((__section__(".exit.data")))
#define __exit_call __attribute_used__ __attribute__ ((__section__ (".exitcall.exit")))
+#define __sched __attribute__((__section__(".sched.text")))
+
#ifdef MODULE
#define __exit __attribute__ ((__section__(".exit.text")))
#else
diff --git a/include/linux/sched.h b/include/linux/sched.h
index f5fa0c07a7f8..054b3c0d5962 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -170,6 +170,8 @@ extern void update_one_process(struct task_struct *p, unsigned long user,
unsigned long system, int cpu);
extern void scheduler_tick(int user_tick, int system);
extern unsigned long cache_decay_ticks;
+extern const unsigned long scheduling_functions_start_here;
+extern const unsigned long scheduling_functions_end_here;
#define MAX_SCHEDULE_TIMEOUT LONG_MAX