diff options
author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2015-08-09 07:18:44 -0400 |
---|---|---|
committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2015-08-09 06:21:15 -0400 |
commit | 5459c945fd381af0c587a04a7d8d468fa348257d (patch) | |
tree | 9a0804b412623bdbd16235f14cd0e4ab48f24c02 /litmus | |
parent | 6c10dcd2d019bb63026f1fdbd158788cdf7b8b0a (diff) |
Feather-Trace: add platform independent implementation
This patch adds the simple fallback implementation and creates dummy
hooks in the x86 and ARM Kconfig files.
Diffstat (limited to 'litmus')
-rw-r--r-- | litmus/Kconfig | 25 | ||||
-rw-r--r-- | litmus/Makefile | 2 | ||||
-rw-r--r-- | litmus/ft_event.c | 43 |
3 files changed, 70 insertions, 0 deletions
diff --git a/litmus/Kconfig b/litmus/Kconfig index 382b2e426437..70ddbaddc06f 100644 --- a/litmus/Kconfig +++ b/litmus/Kconfig | |||
@@ -1,3 +1,28 @@ | |||
1 | menu "LITMUS^RT" | 1 | menu "LITMUS^RT" |
2 | 2 | ||
3 | menu "Tracing" | ||
4 | |||
5 | config FEATHER_TRACE | ||
6 | bool "Feather-Trace Infrastructure" | ||
7 | default y | ||
8 | help | ||
9 | Feather-Trace basic tracing infrastructure. Includes device file | ||
10 | driver and instrumentation point support. | ||
11 | |||
12 | There are actually two implementations of Feather-Trace. | ||
13 | 1) A slower, but portable, default implementation. | ||
14 | 2) Architecture-specific implementations that rewrite kernel .text at runtime. | ||
15 | |||
16 | If enabled, Feather-Trace will be based on 2) if available (currently only for x86). | ||
17 | However, if DEBUG_RODATA=y, then Feather-Trace will choose option 1) in any case | ||
18 | to avoid problems with write-protected .text pages. | ||
19 | |||
20 | Bottom line: to avoid increased overheads, choose DEBUG_RODATA=n. | ||
21 | |||
22 | Note that this option only enables the basic Feather-Trace infrastructure; | ||
23 | you still need to enable SCHED_TASK_TRACE and/or SCHED_OVERHEAD_TRACE to | ||
24 | actually enable any events. | ||
25 | |||
26 | endmenu | ||
27 | |||
3 | endmenu | 28 | endmenu |
diff --git a/litmus/Makefile b/litmus/Makefile index f0ed31faf582..4c6130b58bae 100644 --- a/litmus/Makefile +++ b/litmus/Makefile | |||
@@ -1,3 +1,5 @@ | |||
1 | # | 1 | # |
2 | # Makefile for LITMUS^RT | 2 | # Makefile for LITMUS^RT |
3 | # | 3 | # |
4 | |||
5 | obj-$(CONFIG_FEATHER_TRACE) += ft_event.o | ||
diff --git a/litmus/ft_event.c b/litmus/ft_event.c new file mode 100644 index 000000000000..399a07becca5 --- /dev/null +++ b/litmus/ft_event.c | |||
@@ -0,0 +1,43 @@ | |||
1 | #include <linux/types.h> | ||
2 | |||
3 | #include <litmus/feather_trace.h> | ||
4 | |||
5 | #if !defined(CONFIG_ARCH_HAS_FEATHER_TRACE) || defined(CONFIG_DEBUG_RODATA) | ||
6 | /* provide dummy implementation */ | ||
7 | |||
8 | int ft_events[MAX_EVENTS]; | ||
9 | |||
10 | int ft_enable_event(unsigned long id) | ||
11 | { | ||
12 | if (id < MAX_EVENTS) { | ||
13 | ft_events[id]++; | ||
14 | return 1; | ||
15 | } else | ||
16 | return 0; | ||
17 | } | ||
18 | |||
19 | int ft_disable_event(unsigned long id) | ||
20 | { | ||
21 | if (id < MAX_EVENTS && ft_events[id]) { | ||
22 | ft_events[id]--; | ||
23 | return 1; | ||
24 | } else | ||
25 | return 0; | ||
26 | } | ||
27 | |||
28 | int ft_disable_all_events(void) | ||
29 | { | ||
30 | int i; | ||
31 | |||
32 | for (i = 0; i < MAX_EVENTS; i++) | ||
33 | ft_events[i] = 0; | ||
34 | |||
35 | return MAX_EVENTS; | ||
36 | } | ||
37 | |||
38 | int ft_is_event_enabled(unsigned long id) | ||
39 | { | ||
40 | return id < MAX_EVENTS && ft_events[id]; | ||
41 | } | ||
42 | |||
43 | #endif | ||