Re: [PATCH 07/10] libperf: Add tests_mmap_cpus test

Jiri Olsa
2019-10-19T17:42:53Z

On Fri, Oct 18, 2019 at 03:16:31PM -0300, Arnaldo Carvalho de Melo wrote:
> Em Fri, Oct 18, 2019 at 03:14:29PM -0300, Arnaldo Carvalho de Melo escreveu:
> > Em Thu, Oct 17, 2019 at 12:59:15PM +0200, Jiri Olsa escreveu:
> > > Adding mmaping tests that generates prctl call on
> > > every cpu validates it gets all the related events
> > > in ring buffer.
> >
> > So _here_ we need _GNU_SOURCE, for this specific test:
>
> Added, to this test:
>
> [acme@quaco perf]$ git diff
> diff --git a/tools/perf/lib/tests/test-evlist.c b/tools/perf/lib/tests/test-evlist.c
> index d8c52ebfa53a..741bc1bb4524 100644
> --- a/tools/perf/lib/tests/test-evlist.c
> +++ b/tools/perf/lib/tests/test-evlist.c
> @@ -1,6 +1,7 @@
> // SPDX-License-Identifier: GPL-2.0
> -#include <stdio.h>
> +#define _GNU_SOURCE // needed for sched.h to get sched_[gs]etaffinity and CPU_(ZERO,SET)
> #include <sched.h>
> +#include <stdio.h>
> #include <stdarg.h>
> #include <unistd.h>
> #include <stdlib.h>
> [acme@quaco perf]$
>
> We can go the big hammer way if this is more generally needed, but first
> lets try to use it only when needed, ok?

ok, thanks

FYI so it's quite easy now to separate the lib and move it under
tools/lib/perf.. I'll post it together with docs/tutorial update

jirka