Hi Kajol,
[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on powerpc/next]
[also build test ERROR on linus/master linux-nvdimm/libnvdimm-for-next v5.13-rc1
next-20210514]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url:
https://github.com/0day-ci/linux/commits/Kajol-Jain/Add-perf-interface-to...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git next
config: powerpc-randconfig-r011-20210516 (attached as .config)
compiler: clang version 13.0.0 (
https://github.com/llvm/llvm-project
23f7d651b682ea387eaae99f0888e6ca916039cb)
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
# install powerpc cross compiling tool for clang build
# apt-get install binutils-powerpc-linux-gnu
#
https://github.com/0day-ci/linux/commit/ab3efdc432a19e9be03c6cb371dd4d1e5...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
Kajol-Jain/Add-perf-interface-to-expose-nvdimm-performance-stats/20210513-004122
git checkout ab3efdc432a19e9be03c6cb371dd4d1e50cf9917
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:174:1: note: expanded from here
__do_insw
^
arch/powerpc/include/asm/io.h:557:56: note: expanded from macro '__do_insw'
#define __do_insw(p, b, n) readsw((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from drivers/nvdimm/nd_perf.c:12:
In file included from include/linux/nd.h:12:
In file included from include/linux/perf_event.h:49:
In file included from include/linux/ftrace.h:10:
In file included from include/linux/trace_recursion.h:5:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:11:
In file included from arch/powerpc/include/asm/hardirq.h:6:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/powerpc/include/asm/io.h:619:
arch/powerpc/include/asm/io-defs.h:47:1: warning: performing pointer arithmetic on a
null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(insl, (unsigned long p, void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:616:3: note: expanded from macro
'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:176:1: note: expanded from here
__do_insl
^
arch/powerpc/include/asm/io.h:558:56: note: expanded from macro '__do_insl'
#define __do_insl(p, b, n) readsl((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from drivers/nvdimm/nd_perf.c:12:
In file included from include/linux/nd.h:12:
In file included from include/linux/perf_event.h:49:
In file included from include/linux/ftrace.h:10:
In file included from include/linux/trace_recursion.h:5:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:11:
In file included from arch/powerpc/include/asm/hardirq.h:6:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/powerpc/include/asm/io.h:619:
arch/powerpc/include/asm/io-defs.h:49:1: warning: performing pointer arithmetic on a
null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(outsb, (unsigned long p, const void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:616:3: note: expanded from macro
'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:178:1: note: expanded from here
__do_outsb
^
arch/powerpc/include/asm/io.h:559:58: note: expanded from macro '__do_outsb'
#define __do_outsb(p, b, n) writesb((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from drivers/nvdimm/nd_perf.c:12:
In file included from include/linux/nd.h:12:
In file included from include/linux/perf_event.h:49:
In file included from include/linux/ftrace.h:10:
In file included from include/linux/trace_recursion.h:5:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:11:
In file included from arch/powerpc/include/asm/hardirq.h:6:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/powerpc/include/asm/io.h:619:
arch/powerpc/include/asm/io-defs.h:51:1: warning: performing pointer arithmetic on a
null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(outsw, (unsigned long p, const void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:616:3: note: expanded from macro
'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:180:1: note: expanded from here
__do_outsw
^
arch/powerpc/include/asm/io.h:560:58: note: expanded from macro '__do_outsw'
#define __do_outsw(p, b, n) writesw((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from drivers/nvdimm/nd_perf.c:12:
In file included from include/linux/nd.h:12:
In file included from include/linux/perf_event.h:49:
In file included from include/linux/ftrace.h:10:
In file included from include/linux/trace_recursion.h:5:
In file included from include/linux/interrupt.h:11:
In file included from include/linux/hardirq.h:11:
In file included from arch/powerpc/include/asm/hardirq.h:6:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/powerpc/include/asm/io.h:619:
arch/powerpc/include/asm/io-defs.h:53:1: warning: performing pointer arithmetic on a
null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(outsl, (unsigned long p, const void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:616:3: note: expanded from macro
'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:182:1: note: expanded from here
__do_outsl
^
arch/powerpc/include/asm/io.h:561:58: note: expanded from macro '__do_outsl'
#define __do_outsl(p, b, n) writesl((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
~~~~~~~~~~~~~~~~~~~~~^
> drivers/nvdimm/nd_perf.c:18:51: error: no member named
'pmu' in 'struct perf_event'
struct nvdimm_pmu *nd_pmu =
to_nvdimm_pmu(event->pmu);
~~~~~ ^
drivers/nvdimm/nd_perf.c:14:42: note: expanded from macro 'to_nvdimm_pmu'
#define to_nvdimm_pmu(_pmu) container_of(_pmu, struct nvdimm_pmu, pmu)
^~~~
include/linux/kernel.h:701:26: note: expanded from macro 'container_of'
void *__mptr = (void *)(ptr); \
^~~
> drivers/nvdimm/nd_perf.c:18:51: error: no member named
'pmu' in 'struct perf_event'
struct nvdimm_pmu *nd_pmu =
to_nvdimm_pmu(event->pmu);
~~~~~ ^
drivers/nvdimm/nd_perf.c:14:42: note: expanded from macro 'to_nvdimm_pmu'
#define to_nvdimm_pmu(_pmu) container_of(_pmu, struct nvdimm_pmu, pmu)
^~~~
include/linux/kernel.h:702:34: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^~~
include/linux/compiler_types.h:264:63: note: expanded from macro '__same_type'
#define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:328:22: note: expanded from macro
'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^~~~~~~~~
include/linux/compiler_types.h:316:23: note: expanded from macro
'_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^~~~~~~~~
include/linux/compiler_types.h:308:9: note: expanded from macro
'__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
> drivers/nvdimm/nd_perf.c:18:51: error: no member named
'pmu' in 'struct perf_event'
struct nvdimm_pmu *nd_pmu =
to_nvdimm_pmu(event->pmu);
~~~~~ ^
drivers/nvdimm/nd_perf.c:14:42: note: expanded from macro 'to_nvdimm_pmu'
#define to_nvdimm_pmu(_pmu) container_of(_pmu, struct nvdimm_pmu, pmu)
^~~~
include/linux/kernel.h:703:20: note: expanded from macro 'container_of'
!__same_type(*(ptr), void), \
^~~
include/linux/compiler_types.h:264:63: note: expanded from macro '__same_type'
#define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:328:22: note: expanded from macro
'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^~~~~~~~~
include/linux/compiler_types.h:316:23: note: expanded from macro
'_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^~~~~~~~~
include/linux/compiler_types.h:308:9: note: expanded from macro
'__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
> drivers/nvdimm/nd_perf.c:21:13: error: no member named
'attr' in 'struct perf_event'
if (event->attr.type !=
event->pmu->type)
~~~~~ ^
drivers/nvdimm/nd_perf.c:21:33: error: no member named 'pmu' in 'struct
perf_event'
if (event->attr.type != event->pmu->type)
~~~~~ ^
> drivers/nvdimm/nd_perf.c:25:6: error: implicit declaration of
function 'is_sampling_event' [-Werror,-Wimplicit-function-declaration]
if (is_sampling_event(event))
^
> drivers/nvdimm/nd_perf.c:29:6: error: implicit declaration of
function 'has_branch_stack' [-Werror,-Wimplicit-function-declaration]
if (has_branch_stack(event))
^
drivers/nvdimm/nd_perf.c:41:51: error: no member named 'pmu' in 'struct
perf_event'
struct nvdimm_pmu *nd_pmu = to_nvdimm_pmu(event->pmu);
~~~~~ ^
drivers/nvdimm/nd_perf.c:14:42: note: expanded from macro 'to_nvdimm_pmu'
#define to_nvdimm_pmu(_pmu) container_of(_pmu, struct nvdimm_pmu, pmu)
^~~~
include/linux/kernel.h:701:26: note: expanded from macro 'container_of'
void *__mptr = (void *)(ptr); \
^~~
drivers/nvdimm/nd_perf.c:41:51: error: no member named 'pmu' in 'struct
perf_event'
struct nvdimm_pmu *nd_pmu = to_nvdimm_pmu(event->pmu);
~~~~~ ^
drivers/nvdimm/nd_perf.c:14:42: note: expanded from macro 'to_nvdimm_pmu'
#define to_nvdimm_pmu(_pmu) container_of(_pmu, struct nvdimm_pmu, pmu)
^~~~
include/linux/kernel.h:702:34: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^~~
include/linux/compiler_types.h:264:63: note: expanded from macro '__same_type'
#define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:328:22: note: expanded from macro
'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^~~~~~~~~
include/linux/compiler_types.h:316:23: note: expanded from macro
'_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^~~~~~~~~
include/linux/compiler_types.h:308:9: note: expanded from macro
'__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
drivers/nvdimm/nd_perf.c:41:51: error: no member named 'pmu' in 'struct
perf_event'
struct nvdimm_pmu *nd_pmu = to_nvdimm_pmu(event->pmu);
~~~~~ ^
drivers/nvdimm/nd_perf.c:14:42: note: expanded from macro 'to_nvdimm_pmu'
#define to_nvdimm_pmu(_pmu) container_of(_pmu, struct nvdimm_pmu, pmu)
^~~~
include/linux/kernel.h:703:20: note: expanded from macro 'container_of'
!__same_type(*(ptr), void), \
^~~
include/linux/compiler_types.h:264:63: note: expanded from macro '__same_type'
#define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:328:22: note: expanded from macro
'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^~~~~~~~~
include/linux/compiler_types.h:316:23: note: expanded from macro
'_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^~~~~~~~~
include/linux/compiler_types.h:308:9: note: expanded from macro
'__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
drivers/nvdimm/nd_perf.c:50:51: error: no member named 'pmu' in 'struct
perf_event'
struct nvdimm_pmu *nd_pmu = to_nvdimm_pmu(event->pmu);
~~~~~ ^
drivers/nvdimm/nd_perf.c:14:42: note: expanded from macro 'to_nvdimm_pmu'
#define to_nvdimm_pmu(_pmu) container_of(_pmu, struct nvdimm_pmu, pmu)
^~~~
include/linux/kernel.h:701:26: note: expanded from macro 'container_of'
void *__mptr = (void *)(ptr); \
^~~
drivers/nvdimm/nd_perf.c:50:51: error: no member named 'pmu' in 'struct
perf_event'
struct nvdimm_pmu *nd_pmu = to_nvdimm_pmu(event->pmu);
~~~~~ ^
drivers/nvdimm/nd_perf.c:14:42: note: expanded from macro 'to_nvdimm_pmu'
#define to_nvdimm_pmu(_pmu) container_of(_pmu, struct nvdimm_pmu, pmu)
^~~~
include/linux/kernel.h:702:34: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^~~
include/linux/compiler_types.h:264:63: note: expanded from macro '__same_type'
#define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:328:22: note: expanded from macro
'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^~~~~~~~~
include/linux/compiler_types.h:316:23: note: expanded from macro
'_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^~~~~~~~~
include/linux/compiler_types.h:308:9: note: expanded from macro
'__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
drivers/nvdimm/nd_perf.c:50:51: error: no member named 'pmu' in 'struct
perf_event'
struct nvdimm_pmu *nd_pmu = to_nvdimm_pmu(event->pmu);
~~~~~ ^
drivers/nvdimm/nd_perf.c:14:42: note: expanded from macro 'to_nvdimm_pmu'
#define to_nvdimm_pmu(_pmu) container_of(_pmu, struct nvdimm_pmu, pmu)
^~~~
include/linux/kernel.h:703:20: note: expanded from macro 'container_of'
!__same_type(*(ptr), void), \
^~~
include/linux/compiler_types.h:264:63: note: expanded from macro '__same_type'
#define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:328:22: note: expanded from macro
'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^~~~~~~~~
include/linux/compiler_types.h:316:23: note: expanded from macro
'_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^~~~~~~~~
include/linux/compiler_types.h:308:9: note: expanded from macro
'__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
drivers/nvdimm/nd_perf.c:59:51: error: no member named 'pmu' in 'struct
perf_event'
struct nvdimm_pmu *nd_pmu = to_nvdimm_pmu(event->pmu);
~~~~~ ^
drivers/nvdimm/nd_perf.c:14:42: note: expanded from macro 'to_nvdimm_pmu'
#define to_nvdimm_pmu(_pmu) container_of(_pmu, struct nvdimm_pmu, pmu)
^~~~
include/linux/kernel.h:701:26: note: expanded from macro 'container_of'
void *__mptr = (void *)(ptr); \
^~~
drivers/nvdimm/nd_perf.c:59:51: error: no member named 'pmu' in 'struct
perf_event'
struct nvdimm_pmu *nd_pmu = to_nvdimm_pmu(event->pmu);
~~~~~ ^
drivers/nvdimm/nd_perf.c:14:42: note: expanded from macro 'to_nvdimm_pmu'
#define to_nvdimm_pmu(_pmu) container_of(_pmu, struct nvdimm_pmu, pmu)
^~~~
include/linux/kernel.h:702:34: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^~~
include/linux/compiler_types.h:264:63: note: expanded from macro '__same_type'
#define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:328:22: note: expanded from macro
'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^~~~~~~~~
include/linux/compiler_types.h:316:23: note: expanded from macro
'_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^~~~~~~~~
include/linux/compiler_types.h:308:9: note: expanded from macro
'__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
drivers/nvdimm/nd_perf.c:59:51: error: no member named 'pmu' in 'struct
perf_event'
struct nvdimm_pmu *nd_pmu = to_nvdimm_pmu(event->pmu);
~~~~~ ^
drivers/nvdimm/nd_perf.c:14:42: note: expanded from macro 'to_nvdimm_pmu'
#define to_nvdimm_pmu(_pmu) container_of(_pmu, struct nvdimm_pmu, pmu)
^~~~
include/linux/kernel.h:703:20: note: expanded from macro 'container_of'
!__same_type(*(ptr), void), \
^~~
include/linux/compiler_types.h:264:63: note: expanded from macro '__same_type'
#define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:328:22: note: expanded from macro
'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^~~~~~~~~
include/linux/compiler_types.h:316:23: note: expanded from macro
'_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^~~~~~~~~
include/linux/compiler_types.h:308:9: note: expanded from macro
'__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
> drivers/nvdimm/nd_perf.c:92:7: error: implicit declaration of
function 'perf_pmu_register' [-Werror,-Wimplicit-function-declaration]
rc = perf_pmu_register(&nd_pmu->pmu, nd_pmu->name, -1);
^
> drivers/nvdimm/nd_perf.c:109:2: error: implicit declaration of
function 'perf_pmu_unregister' [-Werror,-Wimplicit-function-declaration]
perf_pmu_unregister(nd_pmu);
^
12 warnings and 18 errors generated.
vim +18 drivers/nvdimm/nd_perf.c
15
16 static int nvdimm_pmu_event_init(struct perf_event *event)
17 {
18 struct nvdimm_pmu *nd_pmu = to_nvdimm_pmu(event->pmu);
19
20 /* test the event attr type for PMU enumeration */
21 if (event->attr.type != event->pmu->type)
22 return -ENOENT;
23
24 /* it does not support event sampling mode */
25 if (is_sampling_event(event))
26 return -EINVAL;
27
28 /* no branch sampling */
29 if (has_branch_stack(event))
30 return -EOPNOTSUPP;
31
32 /* jump to arch/platform specific callbacks if any */
33 if (nd_pmu && nd_pmu->event_init)
34 return nd_pmu->event_init(event, nd_pmu->dev);
35
36 return 0;
37 }
38
39 static void nvdimm_pmu_read(struct perf_event *event)
40 {
41 struct nvdimm_pmu *nd_pmu = to_nvdimm_pmu(event->pmu);
42
43 /* jump to arch/platform specific callbacks if any */
44 if (nd_pmu && nd_pmu->read)
45 nd_pmu->read(event, nd_pmu->dev);
46 }
47
48 static void nvdimm_pmu_del(struct perf_event *event, int flags)
49 {
50 struct nvdimm_pmu *nd_pmu = to_nvdimm_pmu(event->pmu);
51
52 /* jump to arch/platform specific callbacks if any */
53 if (nd_pmu && nd_pmu->del)
54 nd_pmu->del(event, flags, nd_pmu->dev);
55 }
56
57 static int nvdimm_pmu_add(struct perf_event *event, int flags)
58 {
59 struct nvdimm_pmu *nd_pmu = to_nvdimm_pmu(event->pmu);
60
61 if (flags & PERF_EF_START)
62 /* jump to arch/platform specific callbacks if any */
63 if (nd_pmu && nd_pmu->add)
64 return nd_pmu->add(event, flags, nd_pmu->dev);
65 return 0;
66 }
67
68 int register_nvdimm_pmu(struct nvdimm_pmu *nd_pmu, struct platform_device *pdev)
69 {
70 int rc;
71
72 if (!nd_pmu || !pdev)
73 return -EINVAL;
74
75 nd_pmu->pmu.task_ctx_nr = perf_invalid_context;
76 nd_pmu->pmu.event_init = nvdimm_pmu_event_init;
77 nd_pmu->pmu.add = nvdimm_pmu_add;
78 nd_pmu->pmu.del = nvdimm_pmu_del;
79 nd_pmu->pmu.read = nvdimm_pmu_read;
80 nd_pmu->pmu.name = nd_pmu->name;
81 nd_pmu->pmu.attr_groups = nd_pmu->attr_groups;
82 nd_pmu->pmu.capabilities = PERF_PMU_CAP_NO_INTERRUPT |
83 PERF_PMU_CAP_NO_EXCLUDE;
84
85 /*
86 * Adding platform_device->dev pointer to nvdimm_pmu, so that we can
87 * access that device data in PMU callbacks and also pass it to
88 * arch/platform specific code.
89 */
90 nd_pmu->dev = &pdev->dev;
91
92 rc = perf_pmu_register(&nd_pmu->pmu, nd_pmu->name, -1);
93 if (rc)
94 return rc;
95
96 pr_info("%s NVDIMM performance monitor support registered\n",
97 nd_pmu->name);
98
99 return 0;
100 }
101 EXPORT_SYMBOL_GPL(register_nvdimm_pmu);
102
103 void unregister_nvdimm_pmu(struct pmu *nd_pmu)
104 {
105 /*
106 * nd_pmu will get free in arch/platform specific code once
107 * corresponding pmu get unregistered.
108 */
109 perf_pmu_unregister(nd_pmu);
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org