Skip to content

Commit 9a61d08

Browse files
kjain101djbw
authored andcommitted
drivers/nvdimm: Add nvdimm pmu structure
A structure is added called nvdimm_pmu, for performance stats reporting support of nvdimm devices. It can be used to add device pmu data such as pmu data structure for performance stats, nvdimm device pointer along with cpumask attributes. Acked-by: Peter Zijlstra (Intel) <[email protected]> Tested-by: Nageswara R Sastry <[email protected]> Signed-off-by: Kajol Jain <[email protected]> Reviewed-by: Madhavan Srinivasan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dan Williams <[email protected]>
1 parent 754e0b0 commit 9a61d08

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

include/linux/nd.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <linux/ndctl.h>
99
#include <linux/device.h>
1010
#include <linux/badblocks.h>
11+
#include <linux/perf_event.h>
1112

1213
enum nvdimm_event {
1314
NVDIMM_REVALIDATE_POISON,
@@ -23,6 +24,25 @@ enum nvdimm_claim_class {
2324
NVDIMM_CCLASS_UNKNOWN,
2425
};
2526

27+
/**
28+
* struct nvdimm_pmu - data structure for nvdimm perf driver
29+
* @pmu: pmu data structure for nvdimm performance stats.
30+
* @dev: nvdimm device pointer.
31+
* @cpu: designated cpu for counter access.
32+
* @node: node for cpu hotplug notifier link.
33+
* @cpuhp_state: state for cpu hotplug notification.
34+
* @arch_cpumask: cpumask to get designated cpu for counter access.
35+
*/
36+
struct nvdimm_pmu {
37+
struct pmu pmu;
38+
struct device *dev;
39+
int cpu;
40+
struct hlist_node node;
41+
enum cpuhp_state cpuhp_state;
42+
/* cpumask provided by arch/platform specific code */
43+
struct cpumask arch_cpumask;
44+
};
45+
2646
struct nd_device_driver {
2747
struct device_driver drv;
2848
unsigned long type;

0 commit comments

Comments
 (0)