diff mbox

[i-g-t] benchmarks/gem_syslatency: Add extra android guard to attr_setaffinity_np

Message ID 1457620025-36438-1-git-send-email-derek.j.morton@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Derek Morton March 10, 2016, 2:27 p.m. UTC
Android defines __USE_GNU but does not provide pthread_attr_setaffinity_np()
so added an extra guard arround pthread_attr_setaffinity_np().

Signed-off-by: Derek Morton <derek.j.morton@intel.com>
---
 benchmarks/gem_syslatency.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Chris Wilson March 11, 2016, 11:35 a.m. UTC | #1
On Thu, Mar 10, 2016 at 02:27:05PM +0000, Derek Morton wrote:
> Android defines __USE_GNU but does not provide pthread_attr_setaffinity_np()
> so added an extra guard arround pthread_attr_setaffinity_np().
> 
> Signed-off-by: Derek Morton <derek.j.morton@intel.com>

Pushed, thanks.
-Chris
diff mbox

Patch

diff --git a/benchmarks/gem_syslatency.c b/benchmarks/gem_syslatency.c
index f09050c..6cad3a0 100644
--- a/benchmarks/gem_syslatency.c
+++ b/benchmarks/gem_syslatency.c
@@ -189,6 +189,7 @@  static void *sys_wait(void *arg)
 static void bind_cpu(pthread_attr_t *attr, int cpu)
 {
 #ifdef __USE_GNU
+#ifndef ANDROID
 	cpu_set_t mask;
 
 	if (cpu == -1)
@@ -199,6 +200,7 @@  static void bind_cpu(pthread_attr_t *attr, int cpu)
 
 	pthread_attr_setaffinity_np(attr, sizeof(mask), &mask);
 #endif
+#endif
 }
 
 static void rtprio(pthread_attr_t *attr, int prio)