aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Hunter <[email protected]>2015-03-02 09:59:05 +0200
committerArnaldo Carvalho de Melo <[email protected]>2015-03-02 12:48:16 -0300
commit543d976fa2ebf5543bd07b5d487bf3a6144c0886 (patch)
tree634bb3deae3e158031a9cf159b73a6efea67c184
parent0104fe69e0287cf3635657b4c6b26a18e0091697 (diff)
perf tools: Initialize cpu set in pthread_attr_setaffinity_np feature test
Feature tests are compiled but not executed, however it might avoid a future uninitialized variable warning, so initialize the cpu set. Reported-by: Ingo Molnar <[email protected]> Signed-off-by: Adrian Hunter <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Stephane Eranian <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
-rw-r--r--tools/perf/config/feature-checks/test-pthread-attr-setaffinity-np.c4
1 files changed, 3 insertions, 1 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
index 2b81b72eca23..fdada5e8d454 100644
--- a/tools/perf/config/feature-checks/test-pthread-attr-setaffinity-np.c
+++ b/tools/perf/config/feature-checks/test-pthread-attr-setaffinity-np.c
@@ -1,5 +1,6 @@
#include <stdint.h>
#include <pthread.h>
+#include <sched.h>
int main(void)
{
@@ -8,7 +9,8 @@ int main(void)
cpu_set_t cs;
pthread_attr_init(&thread_attr);
- /* don't care abt exact args, just the API itself in libpthread */
+ CPU_ZERO(&cs);
+
ret = pthread_attr_setaffinity_np(&thread_attr, sizeof(cs), &cs);
return ret;