Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp7654927rwr; Wed, 10 May 2023 10:46:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4L3IV+KJuBEXBBWIsmQbMyEPFtssn1BI3jTAxNPVWdHFlxV66YKe8CmsVuJbREjYFYppFA X-Received: by 2002:a05:6a00:180f:b0:645:d02d:9a83 with SMTP id y15-20020a056a00180f00b00645d02d9a83mr16944199pfa.17.1683740797669; Wed, 10 May 2023 10:46:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683740797; cv=none; d=google.com; s=arc-20160816; b=a94Pjj771H/pEvze8iioRf/3N+O/Gy48E46gbB+Ra9a0P+AabmqrcBC9d8pcxygqfU 1xYJqI7DZfI8/Dfz8DY04ssaQT5XFVSTwEuy/xH/hLhSb+9bS+kaRPCmUNmLGdjpPz2x KZe3+fhUA9L9KNYsQtQZxMkZMakyon39bwRkgaKcMOyTiSckx0dMTY7DfVqCO6Y2N3rT zzr13nxPMOBQ6eaFbSOp+pTHcBSb0RMONPX703uY+fSQ2y3FQU9kqVxM1ijPRxlR8iVp Hjhj98xJSdte2eMkghCAsfELWfA0+BBxaIQH1PJP/sBt1EmgpOIBvP26LNLl+90QAuKy JUcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=DIHwtG54kAUTOUalQHo9A+tSCQhPq7ZUZXSgXfHcaZ0=; b=Yum73Or+KTsAwGwu9cx3jX7ZPURRGO21/ICLlBuX7Ta//zt7++jZOFPYmksE/ToVfr 8JFTNH6wn1yfiuSHndict/bj2uiWU8GiZhrhf/NFrafdf/6G6LtRPCr64ST8wJsoNVDq u5bSczL+Ffig8NJ2wUBhVauD4kQRuQl2fQOlouiXstJGL5sudVi+YsIsND4Jt/uyAGf1 rlCk+llGuQEkt2wgTvdL1xMr7+KhHPw0YgHbPp8J+anosvRSiLZjSf0lCwBpGcMnxWPk 9rtwxtFvS/4ed+bvn1Q0Zxl9UUNnxE2+8eLnuVV/hcFXGNFN5UpzVPgP5OQHdDSr0BMm NKAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MYG2Skk+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w63-20020a638242000000b00521075bf591si4560582pgd.534.2023.05.10.10.46.23; Wed, 10 May 2023 10:46:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=MYG2Skk+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233852AbjEJRhO (ORCPT + 99 others); Wed, 10 May 2023 13:37:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232414AbjEJRhM (ORCPT ); Wed, 10 May 2023 13:37:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B79834480; Wed, 10 May 2023 10:37:11 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 49BA261213; Wed, 10 May 2023 17:37:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66B62C433D2; Wed, 10 May 2023 17:37:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683740230; bh=+x+E11GYK8LSZ8F875Waeh17nLuH51uR1wSnDgnlKvY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MYG2Skk+VbgEuquPuxDVEg2EgbjbyzdFwGeyPtZWkEjwE9COQ2fmbTy9fJJq0nSb2 ik+0kKAy39sEunQ3Y+4kbMbydu7VElrJL5ZVZ3uTylekARPX5vNHFbUTSBiemHp73F B/oUusSvQX0+muOGAsBIMEPfWu5LWZAagy5f9yNnC5ed6eepcpYvj92g6oAGrgLqZD xC5kgwg7v+SunUIEDO/LrGhqCxd1rWZCYQhfNClMVjvd34lFuLMaEkHup9VLSP7wtA GVj/+5+slU1aoCw6A9jG6sLkUK5pg96PPmVKveq3EJlktQY7LO7wTry/6P2IrDH3Bd MLnLeLH5qC9bg== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 2CC82403B5; Wed, 10 May 2023 14:37:08 -0300 (-03) Date: Wed, 10 May 2023 14:37:08 -0300 From: Arnaldo Carvalho de Melo To: Namhyung Kim Cc: Sandipan Das , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, peterz@infradead.org, mingo@redhat.com, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org, irogers@google.com, adrian.hunter@intel.com, terrelln@fb.com, ravi.bangoria@amd.com, ananth.narayan@amd.com Subject: Re: [PATCH 1/2] perf script: Skip aggregation for stat events Message-ID: References: <83d6c6c05c54bf00c5a9df32ac160718efca0c7a.1683280603.git.sandipan.das@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Url: http://acmel.wordpress.com X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Fri, May 05, 2023 at 04:43:20PM -0700, Namhyung Kim escreveu: > Hello, > > On Fri, May 5, 2023 at 3:03 AM Sandipan Das wrote: > > > > The script command does not support aggregation modes by itself although > > that can be achieved using post-processing scripts. Because of this, it > > does not allocate memory for aggregated event values. > > > > Upon running perf stat record, the aggregation mode is set in the perf > > data file. If the mode is AGGR_GLOBAL, the aggregated event values are > > accessed and this leads to a segmentation fault since these were never > > allocated to begin with. Set the mode to AGGR_NONE explicitly to avoid > > this. > > > > E.g. > > > > $ perf stat record -e cycles true > > $ perf script > > > > Before: > > Segmentation fault (core dumped) > > > > After: > > CPU THREAD VAL ENA RUN TIME EVENT > > -1 231919 162831 362069 362069 935289 cycles:u > > > > Fixes: 8b76a3188b85 ("perf stat: Remove unused perf_counts.aggr field") > > Signed-off-by: Sandipan Das > > Cc: stable@vger.kernel.org # v6.2+ > > Acked-by: Namhyung Kim Thanks, applied both to perf-tools, for v6.4. - Arnaldo