lkml.org 
[lkml]   [2015]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] 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 <mingo@kernel.org>
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
tools/perf/config/feature-checks/test-pthread-attr-setaffinity-np.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

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 2b81b72..fdada5e 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;
--
1.9.1



\
 
 \ /
  Last update: 2015-03-02 09:21    [W:0.042 / U:1.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site