From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755281AbbLKPU7 (ORCPT ); Fri, 11 Dec 2015 10:20:59 -0500 Received: from mga03.intel.com ([134.134.136.65]:12711 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753023AbbLKPU6 (ORCPT ); Fri, 11 Dec 2015 10:20:58 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,414,1444719600"; d="scan'208";a="871686377" From: Alexander Shishkin To: Mathieu Poirier , gregkh@linuxfoundation.org Cc: zhang.chunyan@linaro.org, mike.leach@arm.com, tor@ti.com, al.grant@arm.com, fainelli@broadcom.com, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Mathieu Poirier Subject: Re: [PATCH V6 21/26] coresight: etm-perf: new PMU driver for ETM tracers In-Reply-To: <1449176702-13213-22-git-send-email-mathieu.poirier@linaro.org> References: <1449176702-13213-1-git-send-email-mathieu.poirier@linaro.org> <1449176702-13213-22-git-send-email-mathieu.poirier@linaro.org> User-Agent: Notmuch/0.21 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Fri, 11 Dec 2015 17:18:46 +0200 Message-ID: <87zixhau95.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 void etm_event_start(struct perf_event *event, int flags) > +{ > + int cpu = smp_processor_id(); > + struct etm_cpu_data *cpu_data; > + struct etm_event_data *event_data; > + struct perf_output_handle *handle = this_cpu_ptr(&ctx_handle); > + struct coresight_device *sink, *csdev = per_cpu(csdev_src, cpu); > + > + if (!csdev) > + goto fail; > + > + /* > + * Deal with the ring buffer API and get a handle on the > + * session's information. > + */ > + event_data = perf_aux_output_begin(handle, event); > + if (WARN_ON_ONCE(!event_data)) > + goto fail; Hmm, perf_aux_output_begin() returning NULL is not WARN-worthy and is actually a normal situation, for example, if the buffer is not configured yet (which like I suggested in the other email should be a separate thing from the *event* configuration). perf_aux_output_begin() will also return NULL if there's no room in the buffer. Regards, -- Alex