lkml.org 
[lkml]   [2018]   [Jul]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC 2/4] perf: Pass pmu pointer to perf_paranoid_* helpers
From
Date

Hi Ravi,

On 03/07/18 11:24, Ravi Bangoria wrote:
> Hi Tvrtko,
>
>> @@ -199,7 +199,7 @@ static inline void perf_get_data_addr(struct pt_regs *regs, u64 *addrp)
>> if (!(mmcra & MMCRA_SAMPLE_ENABLE) || sdar_valid)
>> *addrp = mfspr(SPRN_SDAR);
>>
>> - if (perf_paranoid_kernel() && !capable(CAP_SYS_ADMIN) &&
>> + if (perf_paranoid_kernel(ppmu) && !capable(CAP_SYS_ADMIN) &&
>> is_kernel_addr(mfspr(SPRN_SDAR)))
>> *addrp = 0;
>> }
>
> This patch fails for me on powerpc:
>
> arch/powerpc/perf/core-book3s.c: In function ‘perf_get_data_addr’:
> arch/powerpc/perf/core-book3s.c:202:27: error: passing argument 1 of ‘perf_paranoid_kernel’ from incompatible pointer type [-Werror=incompatible-pointer-types]
> if (perf_paranoid_kernel(ppmu) && !capable(CAP_SYS_ADMIN) &&
> ^~~~
> In file included from arch/powerpc/perf/core-book3s.c:13:0:
> ./include/linux/perf_event.h:1191:20: note: expected ‘const struct pmu *’ but argument is of type ‘struct power_pmu *’
> static inline bool perf_paranoid_kernel(const struct pmu *pmu)
> ^~~~~~~~~~~~~~~~~~~~
> arch/powerpc/perf/core-book3s.c: In function ‘power_pmu_bhrb_read’:
> arch/powerpc/perf/core-book3s.c:470:8: error: too few arguments to function ‘perf_paranoid_kernel’
> if (perf_paranoid_kernel() && !capable(CAP_SYS_ADMIN) &&
> ^~~~~~~~~~~~~~~~~~~~
> In file included from arch/powerpc/perf/core-book3s.c:13:0:
> ./include/linux/perf_event.h:1191:20: note: declared here
> static inline bool perf_paranoid_kernel(const struct pmu *pmu)
> ^~~~~~~~~~~~~~~~~~~~
> CC net/ipv6/route.o

Yep, kbuild reported this as well. I will need to re-arrange the code a
bit to a) pass the correct pointer in, and b) I missed one call-site as
well.

I was holding of doing that until some more general feedback arrives.

Regards,

Tvrtko

\
 
 \ /
  Last update: 2018-07-03 12:28    [W:0.051 / U:1.768 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site