Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp345026rwp; Wed, 12 Jul 2023 14:23:27 -0700 (PDT) X-Google-Smtp-Source: APBJJlHQNmLLfNorjuUxC5eBumKxO999pX5C5xQsKH1lUsx+0Y6ileq/QJ5JZvOdaEpdxCG1C8k8 X-Received: by 2002:a17:902:db0c:b0:1b9:d36a:904b with SMTP id m12-20020a170902db0c00b001b9d36a904bmr15072815plx.61.1689197007198; Wed, 12 Jul 2023 14:23:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689197007; cv=none; d=google.com; s=arc-20160816; b=bP1/gO8Z9svSoFUAEZiVTuIbIey2b0GGV0uA2FUvf7bPJ2WhWVAGz1t7iRJK3t6H1K S+ET1UBA+1+vVpEhuAkSgMv+AEB2EchrXvC3Yj1G28Mm+GOpfKfmrazom+7Uivs/+U9v 5FhDxAVnZ6hFOvg9u/mI32MO1ZXl82+sjCf4j62XwMOj0+PuZEdQKgfuSCMVMG2NpeNt lFlM2sNnX79hRb4Z/A3Dr/agK8WtMt/cyu9cDYGZxU8h4adZxBK+lcIZ+XYb2hiN2ADe xB6WNCh7bkqY25c5XIXh3GMPV7iWuPuHbLImzfaHgdeJMfDtzyIhVX5ZKnWBUKvNlAZJ irog== 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=ckvfaMUWpPvTo3te2ghCH91a1cTE4BZA7za+DnJRfWc=; fh=o9YG9Zi51TskKxbqunt0cjpwlKAxQJyPiSKchVOtWaI=; b=z9oa/+yP/L8aoowv1MargxA4USAL6h3OhS6tgBJOTr5hXm1gk1oKqkF2K3cx+sUxnc ky9lBtMZ8dTZ33dAGAowD7UXsUgC54Ix3nF1+BjBjEpO9XhYo0yQ0pzwnDTqijLu/zaE 7xPvi64gDCiwlOMgZ84pKlvhWFc2KE/Nii84rBB9lMtTBgqzRCcDiTbIhRJhu5Qd6S/z /8sxXiavGpq955rSgnT7oMXErg5ctMwrxeiaH8RmcoStGKQC9ylOBO3YUyx6ITahZKf5 G1VBhj5roaNCUMKqNxwGx4ndW8f1BEZXxHJiyGpgaiL2c7daqLRfeSM2nuj555LO3Fi9 VNZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=ihCoBZPf; 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 q21-20020a170902bd9500b001b8c689060bsi3809727pls.344.2023.07.12.14.23.14; Wed, 12 Jul 2023 14:23:27 -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=ihCoBZPf; 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 S232144AbjGLUsd (ORCPT + 99 others); Wed, 12 Jul 2023 16:48:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232507AbjGLUs2 (ORCPT ); Wed, 12 Jul 2023 16:48:28 -0400 Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51ACF1FFD for ; Wed, 12 Jul 2023 13:48:27 -0700 (PDT) Received: by mail-qt1-x832.google.com with SMTP id d75a77b69052e-403b622101bso20921cf.1 for ; Wed, 12 Jul 2023 13:48:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1689194906; x=1691786906; 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=ckvfaMUWpPvTo3te2ghCH91a1cTE4BZA7za+DnJRfWc=; b=ihCoBZPfH+/EUMXvGA0hQEGZN+NjZH+19kjrsKmTU+8L8MLDyGD+DD1SRcO/+WgtDQ S/cuwlX5KK1TUg03WXllxL2RU+lerRIAn+nHyAr4T/O9eyGPMeRs25NqGIsBV8eN2Lem tRmebaizSAQb9laYuUYSfmI9wjSYAlpb8CnuWLVyA08PbT+ysnXNHetDnTUnya20Ak+b RhWiLGAukCdh+Pce9tauGU+JGgxCBMWbkCino2MwKjkFhuTcBrBQuLOVhOnwSq/VE+8H HK+lEwnizMuO+PUVt29ThSy+u9mScgHWUH+fgL4HdkdbK7BXpZnzrjyZHFHM9GL+9SVL mEcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689194906; x=1691786906; 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=ckvfaMUWpPvTo3te2ghCH91a1cTE4BZA7za+DnJRfWc=; b=hqySr7o4cQ3LN5+ViL+9NK2UptiF0vZ7DtMcfZJHIVg4eyKaYNT++ZIv0mdtZdB/1S kizEWOSqwu3WNxuHFpmt96JtHDOEnw8oZr4odo72QiZwwb8GOm23N1no7iDk99Seglzy sF0Ro3LeHVxKyOQt+YcC6ozSZokLBng6bjHTtGds4/Mhm82CF5+qbzuCjD6G+h1/9+7U RZRShLoAECo+THzFm+wZ8jCJZw26MM+u8JS0gqFNsIsu5TUXPbzWPU+/ivWjjMasqCyW mVOLyAsGyNetyJ0i0jh+xVhN5gRzX/PEBSjmNiJZwv2LnKMbJ4Nl3Ji4bS4jzCBybLur Ohdg== X-Gm-Message-State: ABy/qLZB3yEk9q2lQ4b0pHuheBSY7setC3S+G77JTGnaTe+VYEKrTHMR hfxLHW535DzJlKA+LtTztM6xdSMgc8AWR9NmRRd29w== X-Received: by 2002:ac8:5905:0:b0:3ef:302c:319e with SMTP id 5-20020ac85905000000b003ef302c319emr357520qty.8.1689194906296; Wed, 12 Jul 2023 13:48:26 -0700 (PDT) MIME-Version: 1.0 References: <20230704074217.240939-1-yangjihong1@huawei.com> <20230704074217.240939-5-yangjihong1@huawei.com> In-Reply-To: <20230704074217.240939-5-yangjihong1@huawei.com> From: Ian Rogers Date: Wed, 12 Jul 2023 13:48:14 -0700 Message-ID: Subject: Re: [PATCH 4/5] perf test: Add test case for record tracking To: Yang Jihong , adrian.hunter@intel.com 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, kan.liang@linux.intel.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=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 On Tue, Jul 4, 2023 at 12:44=E2=80=AFAM Yang Jihong wrote: > > Add a new test case to record tracking side-band events for all CPUs when > tracing selected CPUs We're using "tracking" and "sideband" as synonyms, I think it would be clearer to just use "sideband" and not use "tracking". I see both terms in tools/perf/Documentation/perf-intel-pt.txt Would it be possible to get some consistency here? Thanks, Ian > Test result: > > # ./perf test list 2>&1 | grep 'perf record tracking tests' > 95: perf record tracking tests > f# ./perf test 95 > 95: perf record tracking 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 > new file mode 100755 > index 000000000000..fe05f4772999 > --- /dev/null > +++ b/tools/perf/tests/shell/record_tracking.sh > @@ -0,0 +1,44 @@ > +#!/bin/sh > +# perf record tracking 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 tracking 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 >