From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 31B9AC433E1 for ; Mon, 27 Jul 2020 20:31:16 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F186A20759 for ; Mon, 27 Jul 2020 20:31:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="zNgSsg6E"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="n1OLq0r/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F186A20759 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=4u7Q7LnlujOEBOA/8pW8XePxZlZG2+4VAyovzSJuI+g=; b=zNgSsg6Eq92JbF/DPuHWs4F2y gqTXTtwr9zQj0usdgs43GzQy1RNc+j35GzoxOxGCDYLGG1F5kmHf4YkjwGMCT8Zpd71Eug7Wr4SbL yn6RDkkB2+YIfU+FqX9GVpt23LKcM9VWYzgC3FFwxRy6qFox/o3zdAjR2KAX/OGMjM2bFze9Rlfg9 IvaJ8v/84DIOGtztTGStzhA1z6L9BlzrvUQD4jxLKAHf5uKQ52ll3AS8HPCdcV7Hz77XK7KeJQYkk YyUBIVfids5X62bgwWayBnoydKrZrRFUCL3Z3nFiASq0vtmRLlm275dXbcdWMfKbKyX8winUfJhsP Ppx6fwiBg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k09kp-00035b-AO; Mon, 27 Jul 2020 20:29:47 +0000 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k09km-00034N-N1 for linux-arm-kernel@lists.infradead.org; Mon, 27 Jul 2020 20:29:45 +0000 Received: by mail-pg1-x542.google.com with SMTP id p3so10575975pgh.3 for ; Mon, 27 Jul 2020 13:29:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ZZE0HZeDL5UBrXoQ+ujG0JHVNwE71GMAkB+NRWsAgu0=; b=n1OLq0r/GKYz8Y0x/eHB+o6erqShH+VRB+ABUFXzEgSJPT6jh0hyCqGULmA5MpQ4NG T/X7y+p8eznBWNfJN0bCY8u9yWE0H9hOm9jBXA0+S73P+cQJYYbFt2Utop3k0kB5mlTL 7mTzIgyQPEaDf5iNXdp1rES9pZ9EZVSZ4mUoTCWOt1l4ABtO7RGucr29xwNNEBMm6f+5 Qu4y1hySX5skV1vNnKqkKi2SXpMpsDObw38lP0eCip/sUn5KEKigD/29xNd6CRyLyWFM x2pJY7fPmSLwlQvmYhic4mash6tRTaaMgnuU0MMeC8MHBAflxWlQQkyyFIgz3FGr39UM nLuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ZZE0HZeDL5UBrXoQ+ujG0JHVNwE71GMAkB+NRWsAgu0=; b=tr3B0jQvhbIke+bnu5w88SnKSDW/8nm/0idYzntW2PwC7ZDrqFn7ua5mYCVIe8srxl eEqnWP+zQWeHmcM44iT3NCyR4UFTb5Svd6zo7fraxNtmenIGUjz2rkzdN0Kv6naqfnl1 UwA+kZHsO06Ms88r8csBPqZbBoFl90oxhQTCM3Zfcji6BCoURXUP+P79Nw/XM2WnzH0s W4ph92VwtrnqdRp2csTm8EZ+oKz3tkAwIwkdNeUKx+8/LBTqjlmnaXav00YajxXSlGZa fRMhIEHLQa4vD9o0trxMyIpUUseLoMLalWtq0qnbeb/2yLxobyCnCmjZKhiToHCLN7el m5iA== X-Gm-Message-State: AOAM530/LORkE9Vp0bGm9l4hW6Ss8x1EiqOfEdr3/yqvZRzOGVcOWpaA c2N8fYd/uZ9oPbvr17MhHaxjHw== X-Google-Smtp-Source: ABdhPJzSYmJD1T3R1Puzm/m1BNEdBF/HDyi984VBuDf0FSSRRh4x/jGO+DmMej430nP+b4o2q5vXXA== X-Received: by 2002:aa7:93bb:: with SMTP id x27mr3317469pff.203.1595881781333; Mon, 27 Jul 2020 13:29:41 -0700 (PDT) Received: from xps15 (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id 141sm16796428pfw.72.2020.07.27.13.29.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jul 2020 13:29:40 -0700 (PDT) Date: Mon, 27 Jul 2020 14:29:38 -0600 From: Mathieu Poirier To: Wei Li Subject: Re: [PATCH v2 1/2] perf tools: Fix record failure when mixed with ARM SPE event Message-ID: <20200727202938.GB2381376@xps15> References: <20200724071111.35593-1-liwei391@huawei.com> <20200724071111.35593-2-liwei391@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200724071111.35593-2-liwei391@huawei.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200727_162944_774408_143A95F3 X-CRM114-Status: GOOD ( 27.69 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Kim Phillips , Suzuki K Poulose , Alexander Shishkin , guohanjun@huawei.com, linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , leo.yan@linaro.org, Namhyung Kim , Jiri Olsa , linux-arm-kernel@lists.infradead.org, Mike Leach Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Jul 24, 2020 at 03:11:10PM +0800, Wei Li wrote: > When recording with cache-misses and arm_spe_x event, i found that > it will just fail without showing any error info if i put cache-misses > after 'arm_spe_x' event. > > [root@localhost 0620]# perf record -e cache-misses -e \ > arm_spe_0/ts_enable=1,pct_enable=1,pa_enable=1,load_filter=1,\ > jitter=1,store_filter=1,min_latency=0/ sleep 1 > [ perf record: Woken up 1 times to write data ] > [ perf record: Captured and wrote 0.067 MB perf.data ] > [root@localhost 0620]# perf record -e \ > arm_spe_0/ts_enable=1,pct_enable=1,pa_enable=1,load_filter=1,jitter=1,\ > store_filter=1,min_latency=0/ -e cache-misses sleep 1 > [root@localhost 0620]# > > The current code can only work if the only event to be traced is an > 'arm_spe_x', or if it is the last event to be specified. Otherwise the > last event type will be checked against all the arm_spe_pmus[i]->types, > none will match and an out of bound 'i' index will be used in > arm_spe_recording_init(). > > We don't support concurrent multiple arm_spe_x events currently, that > is checked in arm_spe_recording_options(), and it will show the relevant > info. So add the check and record of the first found 'arm_spe_pmu' to > fix this issue here. > > Fixes: ffd3d18c20b8d ("perf tools: Add ARM Statistical Profiling Extensions (SPE) support") Usually SHA1 are 12 character long rather than 13. Depending on what Arnaldo wants to do you may have to resend. > Signed-off-by: Wei Li Reviewed-by: Mathieu Poirier > --- > tools/perf/arch/arm/util/auxtrace.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/tools/perf/arch/arm/util/auxtrace.c b/tools/perf/arch/arm/util/auxtrace.c > index 0a6e75b8777a..28a5d0c18b1d 100644 > --- a/tools/perf/arch/arm/util/auxtrace.c > +++ b/tools/perf/arch/arm/util/auxtrace.c > @@ -56,7 +56,7 @@ struct auxtrace_record > struct perf_pmu *cs_etm_pmu; > struct evsel *evsel; > bool found_etm = false; > - bool found_spe = false; > + struct perf_pmu *found_spe = NULL; > static struct perf_pmu **arm_spe_pmus = NULL; > static int nr_spes = 0; > int i = 0; > @@ -74,12 +74,12 @@ struct auxtrace_record > evsel->core.attr.type == cs_etm_pmu->type) > found_etm = true; > > - if (!nr_spes) > + if (!nr_spes || found_spe) > continue; > > for (i = 0; i < nr_spes; i++) { > if (evsel->core.attr.type == arm_spe_pmus[i]->type) { > - found_spe = true; > + found_spe = arm_spe_pmus[i]; > break; > } > } > @@ -96,7 +96,7 @@ struct auxtrace_record > > #if defined(__aarch64__) > if (found_spe) > - return arm_spe_recording_init(err, arm_spe_pmus[i]); > + return arm_spe_recording_init(err, found_spe); > #endif > > /* > -- > 2.17.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel