Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp8482444rwp; Wed, 19 Jul 2023 10:22:14 -0700 (PDT) X-Google-Smtp-Source: APBJJlGcTFipHMS6ysLhq5Am/mqpt5dt4bK7g1e0Qr/1vCs3pYsNKfjgPQnROSb5T90UaEat7l0/ X-Received: by 2002:a17:906:d3:b0:993:e752:1a70 with SMTP id 19-20020a17090600d300b00993e7521a70mr3134454eji.19.1689787334382; Wed, 19 Jul 2023 10:22:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689787334; cv=none; d=google.com; s=arc-20160816; b=D7yvg6s6dP4hhQN30ugfeREQT7D2dTn4UDUyuUFFedT8PXGF9isYDK42SXqYWhEJ84 nUnGDIY0SMQcHuDl9mg3iS8pPunfDzfl7q0a+j9feFeOj5/x1L6zKegIEQwnl1ExmiXU mzMFOoekAGdkoxj5gF5sAgvEWRaVcRuBR+quAGlIQvaRGfLp3s498TUKgr0unhYxo1O0 CZYyWljtWhLFHnuL6amtNM6S0oPoLEBoHUY8b6uuKWbBqFupXPxhkp/daAU2cFBZOWoU jvj3IrBNHMzA6jMfHqRTnk8HIA/zwhzCPCnGEdT9qOf0a0D17eKIDmxmTSve9t/5hS39 doZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Qdhb3Ae11Gg1Dat3FtPlzRqYz+pl+VF4Ei5yrEPLth0=; fh=E4DxMlxEq+cvWUToaIvfZqrvft/Xl5h3l/q5ktNy7co=; b=S462sgKeD7P6xW5svPIz9baLh2qkRCvEy2dMr2bmZF+9XrpvLis/38PH6+dcP6tXKA Q8o+ORLx41YDXp6YgfNka6Bya5FiK23QDtGABMsDNNBcBad2F6LULwSid62YcGSPbTon Nebem2gErYvoRQoog/2QKjMGCXMljzGnmQFTbRNjD9ZwziY63GGLCcR/eJdJi433296v sCMcInolE494MqAKooREwDfUol8jlhDIY76/1uYqJAsnBbb7AaVV9sRU5ZzvxLI7YbPv 0w3/t3WWWGQWLajsDxWZA15xyTMZXG3U65DaNzBCvB5feSY4W5GS9eNPRffMjlGIhHKN SrMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=ZhpgSv3u; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h2-20020a1709062dc200b0099351214a94si3096878eji.648.2023.07.19.10.21.49; Wed, 19 Jul 2023 10:22:14 -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=@google.com header.s=20221208 header.b=ZhpgSv3u; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229497AbjGSQsq (ORCPT + 99 others); Wed, 19 Jul 2023 12:48:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230291AbjGSQso (ORCPT ); Wed, 19 Jul 2023 12:48:44 -0400 Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B36D2137 for ; Wed, 19 Jul 2023 09:48:32 -0700 (PDT) Received: by mail-qt1-x82f.google.com with SMTP id d75a77b69052e-401d1d967beso5791cf.0 for ; Wed, 19 Jul 2023 09:48:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1689785311; x=1692377311; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Qdhb3Ae11Gg1Dat3FtPlzRqYz+pl+VF4Ei5yrEPLth0=; b=ZhpgSv3ucAbMdOpycJUjN25cYLL4v6Q2VEZ9BHyAYp/RLIZTddNVRP3H1CckWGYT6+ DDx8BkNPfq1m4eGu6KnD4v1nA34X3YhpzrtlxqtwXNDeNfzi8I3R/BnpbSNCAz/cFOxA UX+0qplhn5jKCpboPrfhEab3jglezs+E+hmzwVSQ2k1VJY/jfuG6MwtsX8KrhBEksb5N MDUMdrW2UvnNCPajHkBwyePdOUD1wurmMBd2MxzCJ+0xWWDuOJVMWRH5kxdKfbMckjqE /iJa8ARtYoF4YjmmF8B9PZexijoUH2qNxe/gi9VJBHzhDH6Yi/fPH9zOTTYSnbo6kFjQ 03iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689785311; x=1692377311; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Qdhb3Ae11Gg1Dat3FtPlzRqYz+pl+VF4Ei5yrEPLth0=; b=kPl0fqLx9umcNVICKEJlLbU3OxeGvT/ek2CWVpFrPKLFsuOiF8GN3aYP8pMYuHfAQt lYFqHDnHxyQkP1mfhdeW+t58ccbT7TnHTA4fiTUjEqzkh1fP6+jcCAoc8oRF55MYgvNX xsTm3HOGVfFHdGaJoKeJDIxwYoAQXfIn7jfMijoVKIAwpyFQfaRCXLqnP/FbSe5gdVB3 8BNM6vhHtJ+CUtJ02seCQF7DGGJV0qMAudOnpADMXWCO5IFS2tVWxUA/+qxvQeHKKoEo bMGLQSnjIVFbh1JH8yrGPuZ6v4xfCM1jRsZxpfet+GuILVa61tIfK4j1VbeOvhkF332T H0mw== X-Gm-Message-State: ABy/qLbpdSyHLhQD/KWewC/EpSLvzQG7q5Jdus0OTd0Esf5F7iQJ66ij qbXTHzuyORlkKmf0hDpl5ke1Wr7j/4wNH+/XmqiD/Q== X-Received: by 2002:a05:622a:1cd:b0:403:a090:41c5 with SMTP id t13-20020a05622a01cd00b00403a09041c5mr701146qtw.16.1689785311166; Wed, 19 Jul 2023 09:48:31 -0700 (PDT) MIME-Version: 1.0 References: <20230715032915.97146-1-yangjihong1@huawei.com> <20230715032915.97146-8-yangjihong1@huawei.com> In-Reply-To: <20230715032915.97146-8-yangjihong1@huawei.com> From: Ian Rogers Date: Wed, 19 Jul 2023 09:48:19 -0700 Message-ID: Subject: Re: [PATCH v2 7/7] perf test: Add test case for record sideband events To: Yang Jihong Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org, namhyung@kernel.org, adrian.hunter@intel.com, kan.liang@linux.intel.com, james.clark@arm.com, tmricht@linux.ibm.com, ak@linux.intel.com, anshuman.khandual@arm.com, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable 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 On Fri, Jul 14, 2023 at 8:31=E2=80=AFPM Yang Jihong wrote: > > Add a new test case to record sideband events for all CPUs when tracing > selected CPUs > > Test result: > > # ./perf test list 2>&1 | grep 'perf record sideband tests' > 95: perf record sideband tests > # ./perf test 95 > 95: perf record sideband tests : = Ok > > Signed-off-by: Yang Jihong > --- > tools/perf/tests/shell/record_tracking.sh | 44 +++++++++++++++++++++++ > 1 file changed, 44 insertions(+) > create mode 100755 tools/perf/tests/shell/record_tracking.sh > > diff --git a/tools/perf/tests/shell/record_tracking.sh b/tools/perf/tests= /shell/record_tracking.sh Could this be record_sideband.sh ? It will be more consistent with the test output... Thanks, Ian > new file mode 100755 > index 000000000000..44fc0af92f81 > --- /dev/null > +++ b/tools/perf/tests/shell/record_tracking.sh > @@ -0,0 +1,44 @@ > +#!/bin/sh > +# perf record sideband tests > +# SPDX-License-Identifier: GPL-2.0 > + > +set -e > + > +err=3D0 > +perfdata=3D$(mktemp /tmp/__perf_test.perf.data.XXXXX) > + > +can_cpu_wide() > +{ > + if ! perf record -o ${perfdata} -BN --no-bpf-event -e dummy:u -C $1 = true 2>&1 >/dev/null > + then > + echo "record sideband test [Skipped cannot record cpu$1]" > + err=3D2 > + fi > + > + rm -f ${perfdata} > + return $err > +} > + > +test_system_wide_tracking() > +{ > + # Need CPU 0 and CPU 1 > + can_cpu_wide 0 || return 0 > + can_cpu_wide 1 || return 0 > + > + # Record on CPU 0 a task running on CPU 1 > + perf record -BN --no-bpf-event -o ${perfdata} -e dummy:u -C 0 -- tas= kset --cpu-list 1 true > + > + # Should get MMAP events from CPU 1 > + mmap_cnt=3D`perf script -i ${perfdata} --show-mmap-events -C 1 2>/de= v/null | grep MMAP | wc -l` > + > + rm -f ${perfdata} > + > + if [ ${mmap_cnt} -gt 0 ] ; then > + return 0 > + fi > + > + echo "Failed to record MMAP events on CPU 1 when tracing CPU 0" > + return 1 > +} > + > +test_system_wide_tracking > -- > 2.30.GIT >