summaryrefslogtreecommitdiff
path: root/tools/perf/config/feature-checks/test-pthread-attr-setaffinity-np.c
diff options
context:
space:
mode:
authorVineet Gupta <Vineet.Gupta1@synopsys.com>2015-01-13 19:13:24 +0530
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-01-28 12:43:32 -0300
commit459a3df76c99124fd222586be7f10f862547e7a9 (patch)
treeea50de4b0fde454af53b52682aa5b4ea4ba47e32 /tools/perf/config/feature-checks/test-pthread-attr-setaffinity-np.c
parent8d9cbd8f870e1aab00fb0f8a465887877a1d6f82 (diff)
perf tools: Provide stub for missing pthread_attr_setaffinity_np
uClibc Linuxthreads.old doesn't support the pthread_attr_setaffinity_np() functioo: ----------------->8----------------------- CC bench/futex-hash.o CC bench/futex-wake.o bench/futex-hash.c: In function 'bench_futex_hash': bench/futex-hash.c:161:3: error: implicit declaration of function 'pthread_attr_setaffinity_np' [-Werror=implicit-function-declaration] ret = pthread_attr_setaffinity_np(&thread_attr, sizeof(cpu_set_t), &cpu); ^ bench/futex-hash.c:161:3: error: nested extern declaration of 'pthread_attr_setaffinity_np' [-Werror=nested-externs] ----------------->8----------------------- So introduce a test to check that and if not available provide a stub. Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Acked-by: Jiri Olsa <jolsa@kernel.org> Cc: Alexey Brodkin <Alexey.Brodkin@synopsys.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1421156604-30603-6-git-send-email-vgupta@synopsys.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/config/feature-checks/test-pthread-attr-setaffinity-np.c')
-rw-r--r--tools/perf/config/feature-checks/test-pthread-attr-setaffinity-np.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/perf/config/feature-checks/test-pthread-attr-setaffinity-np.c b/tools/perf/config/feature-checks/test-pthread-attr-setaffinity-np.c
new file mode 100644
index 000000000000..0a0d3ecb4e8a
--- /dev/null
+++ b/tools/perf/config/feature-checks/test-pthread-attr-setaffinity-np.c
@@ -0,0 +1,14 @@
+#include <stdint.h>
+#include <pthread.h>
+
+int main(void)
+{
+ int ret = 0;
+ pthread_attr_t thread_attr;
+
+ pthread_attr_init(&thread_attr);
+ /* don't care abt exact args, just the API itself in libpthread */
+ ret = pthread_attr_setaffinity_np(&thread_attr, 0, NULL);
+
+ return ret;
+}