From: Adrian Hunter <adrian.hunter@intel.com>
To: acme@redhat.com
Cc: Ingo Molnar <mingo@kernel.org>,
hpa@zytor.com, eranian@google.com, linux-kernel@vger.kernel.org,
tglx@linutronix.de, jolsa@redhat.com,
linux-tip-commits@vger.kernel.org
Subject: [PATCH] perf tools: Initialize cpu set in pthread_attr_setaffinity_np feature test
Date: Mon, 02 Mar 2015 09:59:05 +0200 [thread overview]
Message-ID: <54F41849.1010906@intel.com> (raw)
In-Reply-To: <20150301165235.GA24700@gmail.com>
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
next prev parent reply other threads:[~2015-03-02 8:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-24 10:46 [PATCH] perf tools: Fix pthread_attr_setaffinity_np build error Adrian Hunter
2015-02-24 13:32 ` Josh Boyer
2015-02-24 13:52 ` Adrian Hunter
2015-02-24 14:31 ` Josh Boyer
2015-02-25 6:50 ` Adrian Hunter
2015-03-01 16:50 ` [tip:perf/urgent] " tip-bot for Adrian Hunter
2015-03-01 16:52 ` Ingo Molnar
2015-03-02 7:59 ` Adrian Hunter [this message]
2015-03-03 6:26 ` [tip:perf/core] perf tools: Initialize cpu set in pthread_attr_setaffinity_np feature test tip-bot for Adrian Hunter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54F41849.1010906@intel.com \
--to=adrian.hunter@intel.com \
--cc=acme@redhat.com \
--cc=eranian@google.com \
--cc=hpa@zytor.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox