linux/drivers/nvdimm/nd_perf.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * nd_perf.c: NVDIMM Device Performance Monitoring Unit support
 *
 * Perf interface to expose nvdimm performance stats.
 *
 * Copyright (C) 2021 IBM Corporation
 */

#define pr_fmt(fmt)

#include <linux/nd.h>
#include <linux/platform_device.h>

#define EVENT(_name, _code)

/*
 * NVDIMM Events codes.
 */

/* Controller Reset Count */
EVENT(CTL_RES_CNT,		0x1);
/* Controller Reset Elapsed Time */
EVENT(CTL_RES_TM,		0x2);
/* Power-on Seconds */
EVENT(POWERON_SECS,		0x3);
/* Life Remaining */
EVENT(MEM_LIFE,		0x4);
/* Critical Resource Utilization */
EVENT(CRI_RES_UTIL,		0x5);
/* Host Load Count */
EVENT(HOST_L_CNT,		0x6);
/* Host Store Count */
EVENT(HOST_S_CNT,		0x7);
/* Host Store Duration */
EVENT(HOST_S_DUR,		0x8);
/* Host Load Duration */
EVENT(HOST_L_DUR,		0x9);
/* Media Read Count */
EVENT(MED_R_CNT,		0xa);
/* Media Write Count */
EVENT(MED_W_CNT,		0xb);
/* Media Read Duration */
EVENT(MED_R_DUR,		0xc);
/* Media Write Duration */
EVENT(MED_W_DUR,		0xd);
/* Cache Read Hit Count */
EVENT(CACHE_RH_CNT,		0xe);
/* Cache Write Hit Count */
EVENT(CACHE_WH_CNT,		0xf);
/* Fast Write Count */
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();