aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDavidlohr Bueso <dave@stgolabs.net>2016-04-20 23:14:07 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2016-04-25 19:24:26 -0400
commit73b1794e252b0476cc6e46461c7612cbaa88be45 (patch)
treebf1c9f639094225f585ee7563200e980bf907d68 /tools
parent8daef508b0a144970e5cbc587525c351663fec63 (diff)
perf bench futex: Simplify wrapper for LOCK_PI
Given that the 'val' parameter is ignored for FUTEX_LOCK_PI, get rid of the bogus deadlock detection flag in the wrapper code and avoid the extra argument, making it resemble its unlock counterpart. And if nothing else, we already only pass 0 anyway. Signed-off-by: Davidlohr Bueso <dbueso@suse.de> Cc: Davidlohr Bueso <dbueso@suse.de> Link: http://lkml.kernel.org/r/1461208447-29328-1-git-send-email-dave@stgolabs.net Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/bench/futex-lock-pi.c2
-rw-r--r--tools/perf/bench/futex.h6
2 files changed, 3 insertions, 5 deletions
diff --git a/tools/perf/bench/futex-lock-pi.c b/tools/perf/bench/futex-lock-pi.c
index 6a18ce21f865..6952db65508a 100644
--- a/tools/perf/bench/futex-lock-pi.c
+++ b/tools/perf/bench/futex-lock-pi.c
@@ -83,7 +83,7 @@ static void *workerfn(void *arg)
83 do { 83 do {
84 int ret; 84 int ret;
85 again: 85 again:
86 ret = futex_lock_pi(w->futex, NULL, 0, futex_flag); 86 ret = futex_lock_pi(w->futex, NULL, futex_flag);
87 87
88 if (ret) { /* handle lock acquisition */ 88 if (ret) { /* handle lock acquisition */
89 if (!silent) 89 if (!silent)
diff --git a/tools/perf/bench/futex.h b/tools/perf/bench/futex.h
index d44de9f44281..b2e06d1190d0 100644
--- a/tools/perf/bench/futex.h
+++ b/tools/perf/bench/futex.h
@@ -57,13 +57,11 @@ futex_wake(u_int32_t *uaddr, int nr_wake, int opflags)
57 57
58/** 58/**
59 * futex_lock_pi() - block on uaddr as a PI mutex 59 * futex_lock_pi() - block on uaddr as a PI mutex
60 * @detect: whether (1) or not (0) to perform deadlock detection
61 */ 60 */
62static inline int 61static inline int
63futex_lock_pi(u_int32_t *uaddr, struct timespec *timeout, int detect, 62futex_lock_pi(u_int32_t *uaddr, struct timespec *timeout, int opflags)
64 int opflags)
65{ 63{
66 return futex(uaddr, FUTEX_LOCK_PI, detect, timeout, NULL, 0, opflags); 64 return futex(uaddr, FUTEX_LOCK_PI, 0, timeout, NULL, 0, opflags);
67} 65}
68 66
69/** 67/**