Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933374AbbLSR1M (ORCPT ); Sat, 19 Dec 2015 12:27:12 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:33831 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932875AbbLSR1K (ORCPT ); Sat, 19 Dec 2015 12:27:10 -0500 Date: Sat, 19 Dec 2015 18:27:05 +0100 From: Rabin Vincent To: Mathieu Poirier Cc: gregkh@linuxfoundation.org, alexander.shishkin@linux.intel.com, 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, Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo Subject: Re: [PATCH V7 24/24] perf tools: adding coresight etm PMU record capabilities Message-ID: <20151219172705.GC2437@debian> References: <1450472361-426-1-git-send-email-mathieu.poirier@linaro.org> <1450472361-426-25-git-send-email-mathieu.poirier@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1450472361-426-25-git-send-email-mathieu.poirier@linaro.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 982 Lines: 34 On Fri, Dec 18, 2015 at 01:59:20PM -0700, Mathieu Poirier wrote: > +struct auxtrace_record > +*auxtrace_record__init(struct perf_evlist *evlist, int *err) > +{ > + struct perf_pmu *cs_etm_pmu; > + struct perf_evsel *evsel; > + bool found_etm = false; > + > + cs_etm_pmu = perf_pmu__find(CORESIGHT_ETM_PMU_NAME); > + > + if (evlist) { > + evlist__for_each(evlist, evsel) { > + if (cs_etm_pmu && > + evsel->attr.type == cs_etm_pmu->type) > + found_etm = true; > + } > + } > + > + if (found_etm) > + return cs_etm_record_init(err); > + > + *err = -EINVAL; This should not set an error code when found_etm is false. Otherwise any attempt to uses perf record without a cs_etm event enabled errors out. > + return NULL; > +} -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/