summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-kernel')
-rw-r--r--meta/recipes-kernel/lttng/lttng-ust/uclibc-sched_getcpu.patch50
-rw-r--r--meta/recipes-kernel/lttng/lttng-ust_0.12.bb4
2 files changed, 53 insertions, 1 deletions
diff --git a/meta/recipes-kernel/lttng/lttng-ust/uclibc-sched_getcpu.patch b/meta/recipes-kernel/lttng/lttng-ust/uclibc-sched_getcpu.patch
new file mode 100644
index 0000000000..7102a69184
--- /dev/null
+++ b/meta/recipes-kernel/lttng/lttng-ust/uclibc-sched_getcpu.patch
@@ -0,0 +1,50 @@
1uClibc does not have sched_getcpu() implemented. So we create a wrapper
2to getcpu syscall when compiling for uclibc.
3
4So far execinfo.h does not exist on uclibc but it turns out to be that
5this header is not needed even in eglibc case so it can be removed
6
7Signed-off-by: Khem Raj <raj.khem@gmail.com>
8
9Upstream-status: Pending
10
11Index: ust-0.12/libust/tracer.h
12===================================================================
13--- ust-0.12.orig/libust/tracer.h
14+++ ust-0.12/libust/tracer.h
15@@ -342,14 +342,22 @@ static __inline__ void ltt_write_trace_h
16 header->start_freq = trace->start_freq;
17 header->freq_scale = trace->freq_scale;
18 }
19-
20+#ifdef __UCLIBC__
21+#define sched_getcpu(cpu, node, cache) syscall(__NR_getcpu, cpu, node, cache)
22+#endif
23 #ifndef UST_VALGRIND
24
25 static __inline__ int ust_get_cpu(void)
26 {
27 int cpu;
28
29+#ifdef __UCLIBC__
30+ int c, s;
31+ s = syscall(__NR_getcpu, &c, NULL, NULL);
32+ cpu = (s == -1) ? s : c;
33+#else
34 cpu = sched_getcpu();
35+#endif
36 if (likely(cpu >= 0))
37 return cpu;
38 /*
39Index: ust-0.12/libustcomm/ustcomm.c
40===================================================================
41--- ust-0.12.orig/libustcomm/ustcomm.c
42+++ ust-0.12/libustcomm/ustcomm.c
43@@ -31,7 +31,6 @@
44 #include <stdio.h>
45 #include <stdlib.h>
46 #include <string.h>
47-#include <execinfo.h>
48
49 #include "ustcomm.h"
50 #include "usterr.h"
diff --git a/meta/recipes-kernel/lttng/lttng-ust_0.12.bb b/meta/recipes-kernel/lttng/lttng-ust_0.12.bb
index 7dadc04745..5fca949f39 100644
--- a/meta/recipes-kernel/lttng/lttng-ust_0.12.bb
+++ b/meta/recipes-kernel/lttng/lttng-ust_0.12.bb
@@ -12,7 +12,9 @@ DEPENDS = "liburcu"
12 12
13PR = "r0" 13PR = "r0"
14 14
15SRC_URI = "http://lttng.org/files/ust/releases/ust-${PV}.tar.gz" 15SRC_URI = "http://lttng.org/files/ust/releases/ust-${PV}.tar.gz \
16 file://uclibc-sched_getcpu.patch \
17 "
16 18
17SRC_URI[md5sum] = "fae6e324a56016658c5b83ec14ba0043" 19SRC_URI[md5sum] = "fae6e324a56016658c5b83ec14ba0043"
18SRC_URI[sha256sum] = "215b05f47d0c9e3a2934926a7d14fa9c67025db917c3a1f641df40b08314ab0c" 20SRC_URI[sha256sum] = "215b05f47d0c9e3a2934926a7d14fa9c67025db917c3a1f641df40b08314ab0c"