[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <7fcf5a01-15f3-5a97-bc1b-74d82f31981f@arm.com>
Date: Mon, 8 Jul 2019 08:10:46 +0100
From: Raphael Gault <raphael.gault@....com>
To: Arnaldo Carvalho de Melo <arnaldo.melo@...il.com>
Cc: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
mingo@...hat.com, peterz@...radead.org, catalin.marinas@....com,
will.deacon@....com, mark.rutland@....com
Subject: Re: [PATCH v2 1/5] perf: arm64: Add test to check userspace access to
hardware counters.
Hi Arnaldo,
On 7/5/19 3:54 PM, Arnaldo Carvalho de Melo wrote:
> Em Fri, Jul 05, 2019 at 09:55:37AM +0100, Raphael Gault escreveu:
>> This test relies on the fact that the PMU registers are accessible
>> from userspace. It then uses the perf_event_mmap_page to retrieve
>> the counter index and access the underlying register.
>>
>> This test uses sched_setaffinity(2) in order to run on all CPU and thus
>> check the behaviour of the PMU of all cpus in a big.LITTLE environment.
>>
>> Signed-off-by: Raphael Gault <raphael.gault@....com>
>> ---
>> tools/perf/arch/arm64/include/arch-tests.h | 6 +
>> tools/perf/arch/arm64/tests/Build | 1 +
>> tools/perf/arch/arm64/tests/arch-tests.c | 4 +
>> tools/perf/arch/arm64/tests/user-events.c | 255 +++++++++++++++++++++
>> 4 files changed, 266 insertions(+)
>> create mode 100644 tools/perf/arch/arm64/tests/user-events.c
>>
>> diff --git a/tools/perf/arch/arm64/include/arch-tests.h b/tools/perf/arch/arm64/include/arch-tests.h
>> index 90ec4c8cb880..a9b17ae0560b 100644
>> --- a/tools/perf/arch/arm64/include/arch-tests.h
>> +++ b/tools/perf/arch/arm64/include/arch-tests.h
>> @@ -2,11 +2,17 @@
>> #ifndef ARCH_TESTS_H
>> #define ARCH_TESTS_H
>>
>> +#define __maybe_unused __attribute__((unused))
>
>
> What is wrong with using:
>
> #include <linux/compiler.h>
>
> ?
>
> [acme@...co perf]$ find tools/perf/ -name "*.[ch]" | xargs grep __maybe_unused | wc -l
> 1115
> [acme@...co perf]$ grep __maybe_unused tools/include/linux/compiler.h
> #ifndef __maybe_unused
> # define __maybe_unused __attribute__((unused))
> [acme@...co perf]$
>
> Also please don't break strings in multiple lines just to comply with
> the 80 column limit. That is ok when you have multiple lines ending with
> a newline, but otherwise just makes it look ugly.
>
You're right, I shall correct those points.
Thanks,
--
Raphael Gault
Powered by blists - more mailing lists