Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp174155iob; Mon, 2 May 2022 16:17:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8VIUsKt7st3Sapfs8XddbD9Stop0f6QavmoNUxg3Oi7232tp+OZYUpk76m8YYX60oBX+5 X-Received: by 2002:a17:90b:1b0d:b0:1dc:672e:c8c2 with SMTP id nu13-20020a17090b1b0d00b001dc672ec8c2mr1661787pjb.96.1651533427316; Mon, 02 May 2022 16:17:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651533427; cv=none; d=google.com; s=arc-20160816; b=kTgvo00OmRcoBYEOUsNPlyoia7Yu0eFszhFSzQ1DPoPi9X2D1pPY6Qazdv5ycxQ0do pYJ+w6474nYZneLiTxaiJbQX73W9ssd4UgZdD/v5qP49k4ctTptOFx51Mze3bkMuomhK UYR5xVGtVav4Thw0k6erv8nfZnJcYf5EN9iXJBqPw0y3n+NGXBdRTqkTCKOfu318xPwD 3IDcPXXSoxmEqb0sz/hKTc/G2XPqjn+I/BeCpbvA+JnFBFR6ro3NeU/UKw0We0hrL2S8 NZ5vrYgT9+QCWk20SSnz4i5uDLISJFRrlGEeTG2/ViIXv5A2osZoL/j5ywAk9pXcmzMA VVHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :dkim-signature; bh=Kqo59qgKd1gaX20d6SNzOXicZIkv6urxzb/rb9AIZQ4=; b=gPwIHjd/To/5ob5Ah3+9PsRu2b73SILK2CW5B7UmvMRZgGaNa6XlGx4FMEVb+H5vIc UPy8pv0d/v7tGX4k+YitKatlbxeKd3QyK5thWm0mJGwR6JMzLoRrbsI9es3qkI9Wkhbp 34QYDpj5i3CSTfxz1xgwByBk+RnEJqoC3Dg5yFyB9Gcu5upV1JFeb5PMge2duyqlWijB Hoes3KsirmTH25g5M/6rIEhQwDcsfHP7il4KRnBRQbwuCHug/7QGbtcsY4epKDuJwkfZ Vxk7qL96lAkLXILGRnn5SIsb4WufumIgy3ps9omrf3qNVDKFetKYNStNTgZuY3NeyvUu GRzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=K1nJzgo8; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id d192-20020a6368c9000000b003c1bf77d4c3si8510471pgc.848.2022.05.02.16.17.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 May 2022 16:17:07 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=K1nJzgo8; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 92385289B4; Mon, 2 May 2022 16:16:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354434AbiD2GRD (ORCPT + 99 others); Fri, 29 Apr 2022 02:17:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354419AbiD2GQ7 (ORCPT ); Fri, 29 Apr 2022 02:16:59 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 993BEA0BE1 for ; Thu, 28 Apr 2022 23:13:41 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id z14-20020a5b0b0e000000b0064848b628cfso6611285ybp.0 for ; Thu, 28 Apr 2022 23:13:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc; bh=Kqo59qgKd1gaX20d6SNzOXicZIkv6urxzb/rb9AIZQ4=; b=K1nJzgo8S7CyE26PvnGHw0Xo0cKbXQMzSTUbU4RZXQWNvthmXLa1Fa/55QdsRFbfMr C0U9sTC1gbZi5m2tPBNzFFsY+eSUlaO32uAv0XIV5WzOS8FzgAzgVn8uotaI6Edqpc2Y l2C+p6Vi4ZB5cdwz7MRyI67/bBYbF3MB2FZlT3rzV9hH5XXw7FeqZo0MXAaVxWGooE5+ DbOt5cGIh+LNg0O4OPhyQTwg2GYtKVPH69P0w3rQjbIMuhXpKyV002lZy3kZR25R850V qJ67vs573N67W/vwECJO9fgtHh5GpxxkTJwOta3kSKPRdcGvTyQDIv5UA5fcrrwZgAXv myuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=Kqo59qgKd1gaX20d6SNzOXicZIkv6urxzb/rb9AIZQ4=; b=h5oxnhH0XTYnU0WeA1Tx0bcI+Jb3/B2IhcnVKALeAUGp5eUb2oGiHLwqAGjW9pye8j Rfxs6r83ANQKQSzaq/IdV6UTdGtSJ60eYFfQFWISPbNzKUMrfraCexKbMJHAeq+ucmPR h6NTNkLfGYxUsAfZVy6cF1G17RsWxL41P176rZuVHdC7qsrzo/Dekn5XBABAN3eRQ/xx uGJ7PfyPERiKnqIByGZ4glI1E9hFSOHEaMlRTNE7sXQlCpkrw5zhky2/gla6VipjwISk WVX/tEr05l4qC96dKCxzGPfSzUWiLL6BOhQ9Nxo9EzKUpRRKvt6DnQtAbDqhlPrNbaNW E+dg== X-Gm-Message-State: AOAM531qIpCLrjrKN8/LCxv2z3Um6V63v310KceN4wXBULXfiGm7MZ+W GwgZXlggD2fOVT2K5l9yrTwkvu4LmSjG X-Received: from irogers.svl.corp.google.com ([2620:15c:2cd:202:3c33:ed69:1770:973e]) (user=irogers job=sendgmr) by 2002:a25:2553:0:b0:649:1c7e:51ee with SMTP id l80-20020a252553000000b006491c7e51eemr3811092ybl.458.1651212820823; Thu, 28 Apr 2022 23:13:40 -0700 (PDT) Date: Thu, 28 Apr 2022 23:13:36 -0700 Message-Id: <20220429061336.1184848-1-irogers@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.36.0.464.gb9c8b46e94-goog Subject: [PATCH] perf test: Add skip to --per-thread test From: Ian Rogers To: Thomas Richter , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, acme@kernel.org, Jiri Olsa , Namhyung Kim Cc: svens@linux.ibm.com, gor@linux.ibm.com, sumanthk@linux.ibm.com, hca@linux.ibm.com, Ian Rogers Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no 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 As reported in: https://lore.kernel.org/linux-perf-users/20220428122821.3652015-1-tmricht@linux.ibm.com/ the 'instructions:u' event may not be supported. Add a skip using 'perf stat'. Switch some code away from pipe to make the failures clearer. Reported-by: Thomas Richter Signed-off-by: Ian Rogers --- tools/perf/tests/shell/record.sh | 44 +++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/tools/perf/tests/shell/record.sh b/tools/perf/tests/shell/record.sh index cd1cf14259b8..efc0cb07a929 100755 --- a/tools/perf/tests/shell/record.sh +++ b/tools/perf/tests/shell/record.sh @@ -5,11 +5,43 @@ set -e err=0 +perfdata=$(mktemp /tmp/__perf_test.perf.data.XXXXX) + +cleanup() { + rm -f ${perfdata} + rm -f ${perfdata}.old + trap - exit term int +} + +trap_cleanup() { + cleanup + exit 1 +} +trap trap_cleanup exit term int + test_per_thread() { echo "Basic --per-thread mode test" - perf record -e instructions:u --per-thread -o- true 2> /dev/null \ - | perf report -i- -q \ - | egrep -q true + if ! perf stat -e instructions:u --quiet true + then + echo "Per-thread record [Skipped instructions:u not supported]" + if [ $err -ne 1 ] + then + err=2 + fi + return + fi + if ! perf record -e instructions:u --per-thread -o ${perfdata} true 2> /dev/null + then + echo "Per-thread record of instructions:u [Failed]" + err=1 + return + fi + if ! perf report -i ${perfdata} -q | egrep -q true + then + echo "Per-thread record [Failed missing output]" + err=1 + return + fi echo "Basic --per-thread mode test [Success]" } @@ -18,6 +50,10 @@ test_register_capture() { if ! perf list | egrep -q 'br_inst_retired.near_call' then echo "Register capture test [Skipped missing instruction]" + if [ $err -ne 1 ] + then + err=2 + fi return fi if ! perf record --intr-regs=\? 2>&1 | egrep -q 'available registers: AX BX CX DX SI DI BP SP IP FLAGS CS SS R8 R9 R10 R11 R12 R13 R14 R15' @@ -39,4 +75,6 @@ test_register_capture() { test_per_thread test_register_capture + +cleanup exit $err -- 2.36.0.464.gb9c8b46e94-goog