From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754288AbbJSPj7 (ORCPT ); Mon, 19 Oct 2015 11:39:59 -0400 Received: from mga02.intel.com ([134.134.136.20]:43548 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753138AbbJSPj5 (ORCPT ); Mon, 19 Oct 2015 11:39:57 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,702,1437462000"; d="scan'208";a="830088358" From: Alexander Shishkin To: Mathieu Poirier , gregkh@linuxfoundation.org, a.p.zijlstra@chello.nl, acme@kernel.org, mingo@redhat.com, corbet@lwn.net, nicolas.pitre@linaro.org Cc: adrian.hunter@intel.com, zhang.chunyan@linaro.org, mike.leach@arm.com, tor@ti.com, al.grant@arm.com, pawel.moll@arm.com, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, mathieu.poirier@linaro.org Subject: Re: [PATCH V2 22/30] coresight: etm-perf: new PMU driver for ETM tracers In-Reply-To: <1445192687-24112-23-git-send-email-mathieu.poirier@linaro.org> References: <1445192687-24112-1-git-send-email-mathieu.poirier@linaro.org> <1445192687-24112-23-git-send-email-mathieu.poirier@linaro.org> User-Agent: Notmuch/0.20.2 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Mon, 19 Oct 2015 18:37:44 +0300 Message-ID: <87io62hnsn.fsf@ashishki-desk.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mathieu Poirier 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