From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Davidlohr Bueso <dave@stgolabs.net>
Cc: akpm@linux-foundation.org, jbaron@akamai.com,
linux-kernel@vger.kernel.org, Davidlohr Bueso <dbueso@suse.de>
Subject: Re: [PATCH 1/2] perf-bench: Add epoll parallel epoll_wait benchmark
Date: Sun, 11 Nov 2018 09:33:51 -0800 [thread overview]
Message-ID: <20181111173351.GC1111@kernel.org> (raw)
In-Reply-To: <20181109210719.pr7ohayuwqmfp2wl@linux-r8p5>
Em Fri, Nov 09, 2018 at 01:07:19PM -0800, Davidlohr Bueso escreveu:
> On Thu, 08 Nov 2018, Arnaldo Carvalho de Melo wrote:
>
> > Em Tue, Nov 06, 2018 at 04:13:25PM -0300, Arnaldo Carvalho de Melo escreveu:
> > CC /tmp/build/perf/bench/futex-lock-pi.o
> > CC /tmp/build/perf/bench/epoll-wait.o
> > bench/epoll-wait.c: In function 'do_threads':
> > bench/epoll-wait.c:345:10: error: implicit declaration of function 'pthread_attr_setaffinity_np' [-Werror=implicit-function-declaration]
> > ret = pthread_attr_setaffinity_np(&thread_attr, sizeof(cpu_set_t), &cpuset);
>
> Ah, yes, how about the following?
Gets it a bit further, then we get this, which I think should be fixed
using some PRIu64, etc. I'll try to do that at some point, but in short
vacations now, then plumbers :-)
CC /tmp/build/perf/bench/epoll-wait.o
bench/epoll-wait.c: In function 'bench_epoll_wait':
bench/epoll-wait.c:462:12: error: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'rlim_t {aka long long unsigned int}' [-Werror=format=]
printinfo("Setting RLIMIT_NOFILE rlimit from %lu to: %lu\n", prevrl.rlim_max, rl.rlim_max);
^
bench/epoll-wait.c:85:31: note: in definition of macro 'printinfo'
do { if (__verbose) { printf(fmt, ## arg); fflush(stdout); } } while (0)
^
bench/epoll-wait.c:462:12: error: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'rlim_t {aka long long unsigned int}' [-Werror=format=]
printinfo("Setting RLIMIT_NOFILE rlimit from %lu to: %lu\n", prevrl.rlim_max, rl.rlim_max);
^
bench/epoll-wait.c:85:31: note: in definition of macro 'printinfo'
do { if (__verbose) { printf(fmt, ## arg); fflush(stdout); } } while (0)
^
CC /tmp/build/perf/bench/epoll-ctl.o
bench/epoll-ctl.c: In function 'bench_epoll_ctl':
bench/epoll-ctl.c:343:12: error: format '%lu' expects argument of type 'long unsigned int', but argument 2 has type 'rlim_t {aka long long unsigned int}' [-Werror=format=]
printinfo("Setting RLIMIT_NOFILE rlimit from %lu to: %lu\n",
^
bench/epoll-ctl.c:31:29: note: in definition of macro 'printinfo'
do { if (__verbose) printf(fmt, ## arg); } while (0)
^
bench/epoll-ctl.c:343:12: error: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'rlim_t {aka long long unsigned int}' [-Werror=format=]
printinfo("Setting RLIMIT_NOFILE rlimit from %lu to: %lu\n",
^
bench/epoll-ctl.c:31:29: note: in definition of macro 'printinfo'
do { if (__verbose) printf(fmt, ## arg); } while (0)
^
cc1: all warnings being treated as errors
mv: can't rename '/tmp/build/perf/bench/.epoll-wait.o.tmp': No such file or directory
/git/linux/tools/build/Makefile.build:96: recipe for target '/tmp/build/perf/bench/epoll-wait.o' failed
make[4]: *** [/tmp/build/perf/bench/epoll-wait.o] Error 1
make[4]: *** Waiting for unfinished jobs....
CC /tmp/build/perf/perf.o
cc1: all warnings being treated as errors
mv: can't rename '/tmp/build/perf/bench/.epoll-ctl.o.tmp': No such file or directory
/git/linux/tools/build/Makefile.build:96: recipe for target '/tmp/build/perf/bench/epoll-ctl.o' failed
make[4]: *** [/tmp/build/perf/bench/epoll-ctl.o] Error 1
/git/linux/tools/build/Makefile.build:139: recipe for target 'bench' failed
make[3]: *** [bench] Error 2
make[3]: *** Waiting for unfinished jobs....
CC /tmp/build/perf/tests/attr.o
CC /tmp/build/perf/tests/vmlinux-kallsyms.o
CC /tmp/build/perf/tests/openat-syscall.o
CC /tmp/build/perf/util/map.o
> -----8<-----------------------------------------------------
> perf-bench: Move HAVE_PTHREAD_ATTR_SETAFFINITY_NP into bench.h
>
> Both futex and epoll need this call, and can cause build failure
> on systems that don't have it pthread_attr_setaffinity_np().
>
> Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
> ---
> tools/perf/bench/bench.h | 11 +++++++++++
> tools/perf/bench/futex.h | 12 ------------
> 2 files changed, 11 insertions(+), 12 deletions(-)
>
> diff --git a/tools/perf/bench/bench.h b/tools/perf/bench/bench.h
> index 0e415464931b..fddb3ced9db6 100644
> --- a/tools/perf/bench/bench.h
> +++ b/tools/perf/bench/bench.h
> @@ -51,4 +51,15 @@ int bench_epoll_ctl(int argc, const char **argv);
> extern int bench_format;
> extern unsigned int bench_repeat;
>
> +#ifndef HAVE_PTHREAD_ATTR_SETAFFINITY_NP
> +#include <pthread.h>
> +#include <linux/compiler.h>
> +static inline int pthread_attr_setaffinity_np(pthread_attr_t *attr __maybe_unused,
> + size_t cpusetsize __maybe_unused,
> + cpu_set_t *cpuset __maybe_unused)
> +{
> + return 0;
> +}
> +#endif
> +
> #endif
> diff --git a/tools/perf/bench/futex.h b/tools/perf/bench/futex.h
> index db4853f209c7..31b53cc7d5bc 100644
> --- a/tools/perf/bench/futex.h
> +++ b/tools/perf/bench/futex.h
> @@ -86,16 +86,4 @@ futex_cmp_requeue(u_int32_t *uaddr, u_int32_t val, u_int32_t *uaddr2, int nr_wak
> return futex(uaddr, FUTEX_CMP_REQUEUE, nr_wake, nr_requeue, uaddr2,
> val, opflags);
> }
> -
> -#ifndef HAVE_PTHREAD_ATTR_SETAFFINITY_NP
> -#include <pthread.h>
> -#include <linux/compiler.h>
> -static inline int pthread_attr_setaffinity_np(pthread_attr_t *attr __maybe_unused,
> - size_t cpusetsize __maybe_unused,
> - cpu_set_t *cpuset __maybe_unused)
> -{
> - return 0;
> -}
> -#endif
> -
> #endif /* _FUTEX_H */
> --
> 2.16.4
next prev parent reply other threads:[~2018-11-11 17:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-06 15:22 [PATCH 0/2] perf-bench: introduce epoll benchmarks Davidlohr Bueso
2018-11-06 15:22 ` [PATCH 1/2] perf-bench: Add epoll parallel epoll_wait benchmark Davidlohr Bueso
2018-11-06 18:23 ` Davidlohr Bueso
2018-11-06 19:13 ` Arnaldo Carvalho de Melo
2018-11-08 13:45 ` Arnaldo Carvalho de Melo
2018-11-09 21:07 ` Davidlohr Bueso
2018-11-11 17:33 ` Arnaldo Carvalho de Melo [this message]
2018-11-12 5:38 ` Davidlohr Bueso
2018-11-22 7:10 ` [tip:perf/core] perf bench: Move HAVE_PTHREAD_ATTR_SETAFFINITY_NP into bench.h tip-bot for Davidlohr Bueso
2018-11-22 7:11 ` [tip:perf/core] perf bench: Add epoll parallel epoll_wait benchmark tip-bot for Davidlohr Bueso
2018-11-06 15:22 ` [PATCH 2/2] perf-bench: Add epoll_ctl(2) benchmark Davidlohr Bueso
2018-11-22 7:11 ` [tip:perf/core] perf bench: " tip-bot for Davidlohr Bueso
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=20181111173351.GC1111@kernel.org \
--to=acme@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=dave@stgolabs.net \
--cc=dbueso@suse.de \
--cc=jbaron@akamai.com \
--cc=linux-kernel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.