aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrea Bastoni <bastoni@cs.unc.edu>2010-02-01 23:07:54 -0500
committerAndrea Bastoni <bastoni@cs.unc.edu>2010-02-01 23:07:54 -0500
commita2c9ab80a94d9ad6e506d2f89b2191a45706245a (patch)
tree3ee77572227f11693f341761ab5e5307a6059d85
parentabdabdaf51d26811d5a226de572a6755f2fdfed6 (diff)
Add Feather-Trace x86_64 architecture dependent code
-rw-r--r--arch/x86/include/asm/feather_trace.h3
-rw-r--r--arch/x86/include/asm/feather_trace_64.h69
-rw-r--r--litmus/sched_task_trace.c2
3 files changed, 71 insertions, 3 deletions
diff --git a/arch/x86/include/asm/feather_trace.h b/arch/x86/include/asm/feather_trace.h
index 86a4303fce7a..4fd31633405d 100644
--- a/arch/x86/include/asm/feather_trace.h
+++ b/arch/x86/include/asm/feather_trace.h
@@ -11,8 +11,7 @@ static inline unsigned long long ft_timestamp(void)
11#ifdef CONFIG_X86_32 11#ifdef CONFIG_X86_32
12#include "feather_trace_32.h" 12#include "feather_trace_32.h"
13#else 13#else
14/* not ready for integration yet */ 14#include "feather_trace_64.h"
15//#include "feather_trace_64.h"
16#endif 15#endif
17 16
18#endif 17#endif
diff --git a/arch/x86/include/asm/feather_trace_64.h b/arch/x86/include/asm/feather_trace_64.h
new file mode 100644
index 000000000000..030622daa809
--- /dev/null
+++ b/arch/x86/include/asm/feather_trace_64.h
@@ -0,0 +1,69 @@
1/* Do not directly include this file. Include feather_trace.h instead */
2
3/* regparm is the default on x86_64 */
4#define feather_callback
5
6# define _EVENT_TABLE(id,from,to) \
7 ".section __event_table, \"aw\"\n\t" \
8 ".balign 8\n\t" \
9 ".quad " #id ", 0, " #from ", " #to " \n\t" \
10 ".previous \n\t"
11
12/*
13 * x86_64 callee only owns rbp, rbx, r12 -> r15
14 * the called can freely modify the others
15 */
16#define CLOBBER_LIST "memory", "cc", "rdi", "rsi", "rdx", "rcx", \
17 "r8", "r9", "r10", "r11"
18
19#define ft_event(id, callback) \
20 __asm__ __volatile__( \
21 "1: jmp 2f \n\t" \
22 " call " #callback " \n\t" \
23 _EVENT_TABLE(id,1b,2f) \
24 "2: \n\t" \
25 : : : CLOBBER_LIST)
26
27#define ft_event0(id, callback) \
28 __asm__ __volatile__( \
29 "1: jmp 2f \n\t" \
30 " movq $" #id ", %%rdi \n\t" \
31 " call " #callback " \n\t" \
32 _EVENT_TABLE(id,1b,2f) \
33 "2: \n\t" \
34 : : : CLOBBER_LIST)
35
36#define ft_event1(id, callback, param) \
37 __asm__ __volatile__( \
38 "1: jmp 2f \n\t" \
39 " movq %0, %%rsi \n\t" \
40 " movq $" #id ", %%rdi \n\t" \
41 " call " #callback " \n\t" \
42 _EVENT_TABLE(id,1b,2f) \
43 "2: \n\t" \
44 : : "r" (param) : CLOBBER_LIST)
45
46#define ft_event2(id, callback, param, param2) \
47 __asm__ __volatile__( \
48 "1: jmp 2f \n\t" \
49 " movq %1, %%rdx \n\t" \
50 " movq %0, %%rsi \n\t" \
51 " movq $" #id ", %%rdi \n\t" \
52 " call " #callback " \n\t" \
53 _EVENT_TABLE(id,1b,2f) \
54 "2: \n\t" \
55 : : "r" (param), "r" (param2) : CLOBBER_LIST)
56
57#define ft_event3(id, callback, p, p2, p3) \
58 __asm__ __volatile__( \
59 "1: jmp 2f \n\t" \
60 " movq %2, %%rcx \n\t" \
61 " movq %1, %%rdx \n\t" \
62 " movq %0, %%rsi \n\t" \
63 " movq $" #id ", %%rdi \n\t" \
64 " call " #callback " \n\t" \
65 _EVENT_TABLE(id,1b,2f) \
66 "2: \n\t" \
67 : : "r" (p), "r" (p2), "r" (p3) : CLOBBER_LIST)
68
69#define __ARCH_HAS_FEATHER_TRACE
diff --git a/litmus/sched_task_trace.c b/litmus/sched_task_trace.c
index b59105110d7f..39a543e22d41 100644
--- a/litmus/sched_task_trace.c
+++ b/litmus/sched_task_trace.c
@@ -64,7 +64,7 @@ module_init(init_sched_task_trace);
64 64
65static inline struct st_event_record* get_record(u8 type, struct task_struct* t) 65static inline struct st_event_record* get_record(u8 type, struct task_struct* t)
66{ 66{
67 struct st_event_record* rec; 67 struct st_event_record* rec = NULL;
68 struct local_buffer* buf; 68 struct local_buffer* buf;
69 69
70 buf = &get_cpu_var(st_event_buffer); 70 buf = &get_cpu_var(st_event_buffer);