#define pr_fmt(fmt) …
#include <linux/nd.h>
#include <linux/platform_device.h>
#define EVENT(_name, _code) …
EVENT(CTL_RES_CNT, 0x1);
EVENT(CTL_RES_TM, 0x2);
EVENT(POWERON_SECS, 0x3);
EVENT(MEM_LIFE, 0x4);
EVENT(CRI_RES_UTIL, 0x5);
EVENT(HOST_L_CNT, 0x6);
EVENT(HOST_S_CNT, 0x7);
EVENT(HOST_S_DUR, 0x8);
EVENT(HOST_L_DUR, 0x9);
EVENT(MED_R_CNT, 0xa);
EVENT(MED_W_CNT, 0xb);
EVENT(MED_R_DUR, 0xc);
EVENT(MED_W_DUR, 0xd);
EVENT(CACHE_RH_CNT, 0xe);
EVENT(CACHE_WH_CNT, 0xf);
EVENT(FAST_W_CNT, 0x10);
NVDIMM_EVENT_ATTR(ctl_res_cnt, CTL_RES_CNT);
NVDIMM_EVENT_ATTR(ctl_res_tm, CTL_RES_TM);
NVDIMM_EVENT_ATTR(poweron_secs, POWERON_SECS);
NVDIMM_EVENT_ATTR(mem_life, MEM_LIFE);
NVDIMM_EVENT_ATTR(cri_res_util, CRI_RES_UTIL);
NVDIMM_EVENT_ATTR(host_l_cnt, HOST_L_CNT);
NVDIMM_EVENT_ATTR(host_s_cnt, HOST_S_CNT);
NVDIMM_EVENT_ATTR(host_s_dur, HOST_S_DUR);
NVDIMM_EVENT_ATTR(host_l_dur, HOST_L_DUR);
NVDIMM_EVENT_ATTR(med_r_cnt, MED_R_CNT);
NVDIMM_EVENT_ATTR(med_w_cnt, MED_W_CNT);
NVDIMM_EVENT_ATTR(med_r_dur, MED_R_DUR);
NVDIMM_EVENT_ATTR(med_w_dur, MED_W_DUR);
NVDIMM_EVENT_ATTR(cache_rh_cnt, CACHE_RH_CNT);
NVDIMM_EVENT_ATTR(cache_wh_cnt, CACHE_WH_CNT);
NVDIMM_EVENT_ATTR(fast_w_cnt, FAST_W_CNT);
static struct attribute *nvdimm_events_attr[] = …;
static struct attribute_group nvdimm_pmu_events_group = …;
PMU_FORMAT_ATTR(…);
static struct attribute *nvdimm_pmu_format_attr[] = …;
static struct attribute_group nvdimm_pmu_format_group = …;
ssize_t nvdimm_events_sysfs_show(struct device *dev,
struct device_attribute *attr, char *page)
{ … }
static ssize_t nvdimm_pmu_cpumask_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static int nvdimm_pmu_cpu_offline(unsigned int cpu, struct hlist_node *node)
{ … }
static int nvdimm_pmu_cpu_online(unsigned int cpu, struct hlist_node *node)
{ … }
static int create_cpumask_attr_group(struct nvdimm_pmu *nd_pmu)
{ … }
static int nvdimm_pmu_cpu_hotplug_init(struct nvdimm_pmu *nd_pmu)
{ … }
static void nvdimm_pmu_free_hotplug_memory(struct nvdimm_pmu *nd_pmu)
{ … }
int register_nvdimm_pmu(struct nvdimm_pmu *nd_pmu, struct platform_device *pdev)
{ … }
EXPORT_SYMBOL_GPL(…);
void unregister_nvdimm_pmu(struct nvdimm_pmu *nd_pmu)
{ … }
EXPORT_SYMBOL_GPL(…);