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> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Stephane Eranian <eranian@google.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-tip-commits@vger.kernel.org Link: http://lkml.kernel.org/r/54F41849.1010906@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
0104fe69e0
commit
543d976fa2
1 changed files with 3 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
#include <sched.h>
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
|
@ -8,7 +9,8 @@ int main(void)
|
||||||
cpu_set_t cs;
|
cpu_set_t cs;
|
||||||
|
|
||||||
pthread_attr_init(&thread_attr);
|
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);
|
ret = pthread_attr_setaffinity_np(&thread_attr, sizeof(cs), &cs);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Add table
Reference in a new issue