[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YJwP9ByvAcDPixVN@hirez.programming.kicks-ass.net>
Date: Wed, 12 May 2021 19:27:16 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Kajol Jain <kjain@...ux.ibm.com>
Cc: mpe@...erman.id.au, linuxppc-dev@...ts.ozlabs.org,
linux-nvdimm@...ts.01.org, linux-kernel@...r.kernel.org,
maddy@...ux.vnet.ibm.com, santosh@...six.org,
aneesh.kumar@...ux.ibm.com, vaibhav@...ux.ibm.com,
dan.j.williams@...el.com, ira.weiny@...el.com,
atrajeev@...ux.vnet.ibm.com, tglx@...utronix.de
Subject: Re: [RFC 1/4] drivers/nvdimm: Add perf interface to expose nvdimm
performance stats
On Wed, May 12, 2021 at 10:08:21PM +0530, Kajol Jain wrote:
> +static void nvdimm_pmu_read(struct perf_event *event)
> +{
> + struct nvdimm_pmu *nd_pmu = to_nvdimm_pmu(event->pmu);
> +
> + /* jump to arch/platform specific callbacks if any */
> + if (nd_pmu && nd_pmu->read)
> + nd_pmu->read(event, nd_pmu->dev);
> +}
> +
> +static void nvdimm_pmu_del(struct perf_event *event, int flags)
> +{
> + struct nvdimm_pmu *nd_pmu = to_nvdimm_pmu(event->pmu);
> +
> + /* jump to arch/platform specific callbacks if any */
> + if (nd_pmu && nd_pmu->del)
> + nd_pmu->del(event, flags, nd_pmu->dev);
> +}
> +
> +static int nvdimm_pmu_add(struct perf_event *event, int flags)
> +{
> + struct nvdimm_pmu *nd_pmu = to_nvdimm_pmu(event->pmu);
> +
> + if (flags & PERF_EF_START)
> + /* jump to arch/platform specific callbacks if any */
> + if (nd_pmu && nd_pmu->add)
> + return nd_pmu->add(event, flags, nd_pmu->dev);
> + return 0;
> +}
What's the value add here? Why can't you directly set driver pointers? I
also don't really believe ->{add,del,read} can be optional and still
have a sane driver.
Powered by blists - more mailing lists