aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/color.h9
-rw-r--r--include/internal.h5
-rw-r--r--include/litmus.h1
-rw-r--r--include/perfcounters.h36
4 files changed, 51 insertions, 0 deletions
diff --git a/include/color.h b/include/color.h
new file mode 100644
index 0000000..dc1b1cc
--- /dev/null
+++ b/include/color.h
@@ -0,0 +1,9 @@
1#ifndef COLOR_H
2#define COLOR_H
3
4#include <stddef.h> /* for size_t */
5
6int map_color_ctrl(void **);
7void* color_malloc(size_t);
8
9#endif
diff --git a/include/internal.h b/include/internal.h
index 07253b7..f30ce61 100644
--- a/include/internal.h
+++ b/include/internal.h
@@ -18,8 +18,13 @@ int __launch_rt_task(rt_fn_t rt_prog, void *rt_arg,
18 } 18 }
19 19
20 20
21/* taken from the kernel */
22
21#define likely(x) __builtin_expect((x), 1) 23#define likely(x) __builtin_expect((x), 1)
22#define unlikely(x) __builtin_expect((x), 0) 24#define unlikely(x) __builtin_expect((x), 0)
23 25
26#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
27#define BUILD_BUG_ON(condition) ((void)BUILD_BUG_ON_ZERO(condition))
28
24#endif 29#endif
25 30
diff --git a/include/litmus.h b/include/litmus.h
index 045579e..82e2ba2 100644
--- a/include/litmus.h
+++ b/include/litmus.h
@@ -99,6 +99,7 @@ task_class_t str2class(const char* str);
99/* non-preemptive section support */ 99/* non-preemptive section support */
100void enter_np(void); 100void enter_np(void);
101void exit_np(void); 101void exit_np(void);
102int requested_to_preempt(void);
102 103
103/* task system support */ 104/* task system support */
104int wait_for_ts_release(void); 105int wait_for_ts_release(void);
diff --git a/include/perfcounters.h b/include/perfcounters.h
new file mode 100644
index 0000000..03f94fb
--- /dev/null
+++ b/include/perfcounters.h
@@ -0,0 +1,36 @@
1#ifndef PERFCOUNTERS_H
2#define PERFCOUNTERS_H
3
4#include <stdint.h>
5
6#include "../../litmus-rt/include/linux/perf_event.h"
7
8#define NR_PERF_COUNTERS 4
9
10/*
11 * Retain this information with a performance counter file descriptor.
12 */
13struct perf_counter {
14 int fd;
15 enum perf_type_id type;
16 uint64_t config;
17};
18
19
20/*
21 * Initialize a set of counters for a CPU.
22 *
23 * This is NOT thread safe!
24 *
25 * @cpu CPU
26 * @group_leader group leader PID or -1 make a new group
27 * @perf_counter array
28 * @return 0 or error
29 */
30int setup_cpu_perf(const int, const int, struct perf_counter*);
31
32const char* get_perf_name(const struct perf_counter*);
33
34int read_perf_counter(const struct perf_counter*, uint64_t*);
35
36#endif