Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3363266pxb; Mon, 17 Jan 2022 18:38:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJzxJq0uRKXIVBYhJ2KvBrxk9o3VLfPPUUWGDaTHcNcd9d2QfC7+eEJCsnoaEPCoFiM8JfRU X-Received: by 2002:a63:8f08:: with SMTP id n8mr21476920pgd.161.1642473539416; Mon, 17 Jan 2022 18:38:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642473539; cv=none; d=google.com; s=arc-20160816; b=n91jj3vkt2ubA7kq1UUroGEmYNy4oAIf6Tsmh8EaxmK0iYynD1BXd3l6ATPwoOXRgO 8YuRitsYuEGlboZxX7DLrqzJ+0ZEFP+96dQjr+Bv5QXugFTprF9B3WCvO6nXQ5hreUlq wI/Z6VgjcPFDmUs2tiCxUXTKCha14WrAHtJAwuoWencrjxunMIJM18AIXGabxE3XR4X3 PUHxM73uxAsgabEq0OKB8L4v8mo1x449wRvzjSSh14U1yVM2GDewNIHgRLKu7JtwlDIA pknNH423ZZessBWgYjUmVR4H3P9iI3tEFLgvMNGcVbk+MOcveFdXbXtrhSdllAgw8Zm1 vTKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=FKuvwksI9n1D5eeZK/jbIF9ogu2ww7rREgxcqTgZGeI=; b=unEeYTfLUaLc+qFuPfgpuYkbjEt2f63+OJ2AcK5R+a9amekEV9WBAEH2iVmsd+sqny hpwddvH1X2iUiIC+nxXDfqImGi5Q5N7OYuO210Py5q/d6GLyRb6hICZ/zYr+QuVNjc/o 0wD70iiNRjKEEGv4/KMyxHTAdgue31XRLwA/xglgpUXGB8p98EypzD4LIYPftK/CMTRV 36IzcW4/B26F5fdXL8+W8rbhrLra6Z/n5yhYm8P4RWUmxVNVtZ9L3EHD2JgiPn0BV8qd 8ef2UP2ZyZGh7G5xxFv5uLFwPzIlvRtuZANPxwAlQmDRsLyd8BE14XVlZNdeO+uxO9UX Ks7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=nAl0JX0X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rm9si1397655pjb.0.2022.01.17.18.38.47; Mon, 17 Jan 2022 18:38:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=nAl0JX0X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240872AbiAQQ2X (ORCPT + 99 others); Mon, 17 Jan 2022 11:28:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237589AbiAQQ2V (ORCPT ); Mon, 17 Jan 2022 11:28:21 -0500 Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AF8FC061574 for ; Mon, 17 Jan 2022 08:28:21 -0800 (PST) Received: by mail-io1-xd34.google.com with SMTP id a12so17326961iod.9 for ; Mon, 17 Jan 2022 08:28:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FKuvwksI9n1D5eeZK/jbIF9ogu2ww7rREgxcqTgZGeI=; b=nAl0JX0XnfUvDUPXDdh1iHLGq3wdf7wV9/LL4pUDu+twKRqjsXcp1AWzBjAFNdncQh qWiRBJGxtWuKgSEkkE8uu44o8gQL7gZWM4inggeEkJnw1jOMSnBFSBtzZr0R1DFEXsre kHIwcNGp+4OOR3qHrWvmxzLH8FnOuqsIR3bmv3s/3mALN18EasUgsWUyehsrDLE1/EqV 69xSBOCFDW3zxrx/HRS2S1bMIIZJ1uaYA7erczDjD29CDR/X4+V2UpU1+0/9lyF/92Ng fPkjOn+5d6z4A6EVw0R0imOyC8/rLDpJZ+EGS6nRoCCWBeQA1ACx0KZGt2J4jk5HMx+k f1AA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FKuvwksI9n1D5eeZK/jbIF9ogu2ww7rREgxcqTgZGeI=; b=L6jMLQayzmqpofUZyANgpXD/UDmTBvxNsx59pu1QjXMAxxMGZLGwopmhMsCRV9Fu+P mWBjQybqd2LeOaqK0OvMJKAm3wze9cJAN+azrpfd6cdgtKWAeRJoXC60HYkB9m9B45vV byt2i4u8Z2nH9jYTeAPmXN8LhB3OLEgxP6nDsl2dVOPgojzKNKxU1nGldJVXzJDeOtjk l2Zeg79Nr5d3xVGpRNo9S/7zpoYK/oXStKSidECdaqW+dCts3ybxtI2W8gpe/cjSizZR J2pAm1sj5NPhQmTUsaBAogLjHuizpogxtoesOqNYl4H3km7WMT4LvzIq8jcLwLFePXaI B2oQ== X-Gm-Message-State: AOAM532C6yqtdgEgIJLFWAvDL181BNdcn/tHER6taxxdgsr3JyAPIZd0 NrK05R8HmE5Rrk7mfRtvXS4xxv3G37efmmEhLrNNKA== X-Received: by 2002:a5e:890e:: with SMTP id k14mr2343801ioj.151.1642436900085; Mon, 17 Jan 2022 08:28:20 -0800 (PST) MIME-Version: 1.0 References: <20220114212102.179209-1-german.gomez@arm.com> <35a4f70f-d7ef-6e3c-dc79-aa09d87f0271@arm.com> In-Reply-To: <35a4f70f-d7ef-6e3c-dc79-aa09d87f0271@arm.com> From: Ian Rogers Date: Mon, 17 Jan 2022 08:28:07 -0800 Message-ID: Subject: Re: [PATCH] perf record/arm-spe: Override attr->sample_period for non-libpfm4 events To: German Gomez Cc: James Clark , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Chase Conklin , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Arnaldo Carvalho de Melo , Stephane Eranian , netdev@vger.kernel.org, bpf@vger.kernel.org, "acme@kernel.org" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 17, 2022 at 2:27 AM German Gomez wrote: > > Hi James, > > On 17/01/2022 09:59, James Clark wrote: > > > > On 14/01/2022 21:21, German Gomez wrote: > >> A previous commit preventing attr->sample_period values from being > >> overridden in pfm events changed a related behaviour in arm_spe. > >> > >> Before this patch: > >> perf record -c 10000 -e arm_spe_0// -- sleep 1 > >> > >> Would not yield an SPE event with period=10000, because the arm-spe code > > Just to clarify, this seems like it should say "Would yield", not "Would not yield", > > as in it was previously working? > > "this patch" refers to the patch I'm sending, not the one it's fixing. > I might have to rewrite this to make it more clear. How about: > > === > A previous patch preventing "attr->sample_period" values from being > overridden in pfm events changed a related behaviour in arm-spe. > > Before said patch: > perf record -c 10000 -e arm_spe_0// -- sleep 1 > > Would yield an SPE event with period=10000. After the patch, the period > in "-c 10000" was being ignored because the arm-spe code initializes > sample_period to a non-zero value. > > This patch restores the previous behaviour for non-libpfm4 events. > === Thanks for fixing this, I can add an acked-by for the v2 patch. Could we add a test for this to avoid future regressions? There are similar tests for frequency like: https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git/tree/tools/perf/tests/attr/test-record-freq based on the attr.py test: https://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git/tree/tools/perf/tests/attr.py The test specifies a base type of event attribute and then what is modified by the test. It takes a little to get your head around but having a test for this would be a welcome addition. Thanks! Ian > Thanks for the review, > German