Re: [PATCH V2 22/30] coresight: etm-perf: new PMU driver for ETM tracers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Mathieu Poirier <mathieu.poirier@xxxxxxxxxx> writes:

> +static int etm_event_pmu_start(struct perf_event *event)
> +{
> +	int cpu, ret;
> +	cpumask_t mask;
> +	struct coresight_device *csdev;
> +
> +	cpumask_clear(&mask);
> +	if (event->cpu != -1)
> +		cpumask_set_cpu(event->cpu, &mask);
> +	else
> +		cpumask_copy(&mask, cpu_online_mask);
> +
> +	for_each_cpu(cpu, &mask) {
> +		csdev = per_cpu(csdev_src, cpu);
> +
> +		if (!source_ops(csdev)->perf_start)
> +			continue;
> +
> +		ret = source_ops(csdev)->perf_start(csdev);
> +		if (ret)
> +			goto err;

So long as "perf_start" and "perf_stop" here mean
"pm_runtime_get()/put()", this can work, but in that case maybe a better
name should be used, because no real starting or stopping of anything
takes place here. Since pmu::event_init and event::destroy happen in
allocation/deallocation paths and at event scheduling, it's not a good
idea to actually start anything here.

Regards,
--
Alex
--
To unsubscribe from this list: send the line "unsubscribe linux-doc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux