Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp655537lqj; Sun, 2 Jun 2024 16:20:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUG7g2QdeXe/dhEptxcQ9OutJ3yzp+UM7vTr3pC5uSS4IVyTWq4QhCkosMkZtvo+GatbYzE0LUj3iklGZZLahz/3UWgiJyS2T22duZdnw== X-Google-Smtp-Source: AGHT+IFF6u0jB1Xr/3OkFHlHcK0tPIKNAP5l9xqoZLsJLMXASznqQhN7w2Gsz8iU+PmACbgulJB+ X-Received: by 2002:a05:6214:540e:b0:6a8:dcc7:9088 with SMTP id 6a1803df08f44-6aecd4c3085mr112971806d6.26.1717370459659; Sun, 02 Jun 2024 16:20:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717370459; cv=pass; d=google.com; s=arc-20160816; b=zUaX+mHQiurcItQQZOnlf1ISRQspojYJgCtn+0tAAaPuGfoocKuMrgACz3maM832kt ZJ4Y8ciGTxNXjwJfLIv48jEpmXQDkgTWYmzb9ncPrWtrG27A7hQfgZmtey5xgpjDelGM yJR/uLU1L3euYIV/U3RYhkLXN17YYbVl0jj52lfLkpx/kp+clSE+m9RIDTFaQ3rTtjBW 0kcLPCkAUqxbVIsFK7Ey33tmxuBm0/vg2oxKbvi92H2zS4szRv7H6hRW9E7l8OELtdeH mB0yhewamSs5URdlC8bpD2A9hRI3fqka7GEHo+47mnAypWm23v4ICesc/l1XuICYBodE sGwA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=NyDfIrRI6Xr2FPV9NA4UwhKworxEDEXmt1u7Ay0b8XY=; fh=ect8rR3D1ygUNulvmp69tbcWtipXkybTGAZ8zbCdH+c=; b=eC1ZvR2tlym+bWJDQTVeJQcfH3fz1wVwrVpqKPSwzOr2By5aCA2nNsLRnUy6Pbn9bB bg5TTDzsFSz7oCpxik5ThKLFHuV5ljeM1+RXD70daQxZJLhl+UAyYrjx9wnIgIo2oj5m 87WcXTAjYwGbUuT9Xu817QcwsQDIwpb7LvZ/qJ6OLt1C695WNCLykB4li3hPJC+XhKrV KHoKZ1JfTCZyOfAoMmPIktNbzTKNv2/hyQgqGzNSX0hSoebRlIWFzIsluN9Q4dj8KRKy 7h9wg849igGu/mBBdvkQazU0d/CbcZvTOiFfPgJgVLsk3+/nVtQ6eqiKAUL8B7ikz0Kc zdmw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=amSNSSK4; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-198472-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198472-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6ae4b42b96asi74935476d6.491.2024.06.02.16.20.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jun 2024 16:20:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-198472-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=amSNSSK4; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-198472-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-198472-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 535561C2087E for ; Sun, 2 Jun 2024 23:20:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0EBCB7CF30; Sun, 2 Jun 2024 23:20:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="amSNSSK4" Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D35092232B; Sun, 2 Jun 2024 23:20:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717370451; cv=none; b=VCm2R3E1oxxcaxKX7an4hKbT5yo2WM0wYzFJvJVqG+/SK6jF2h7UYkeWzdql2fCcFb3Hoh8hf1eWKeCDBZdirT8d0UY5uoBJB/rnYt5ImKdtF7DNaW4gUsQ3O6DC2SXa3yaw4Zrm8KkmmLML9qElzraDsitPA6NUA148JkxPgiE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717370451; c=relaxed/simple; bh=m2pHOs+8mizs3w/BcsgtC4LcAv7doMQX/7GNMunWl1U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=A11zfi2FyRH+Ptpe+Rl7nYNXdqkug9I7Lw1zU2YN1mmuxzmhgN5hw5OwHfI2eFBBFjWgL2/HZAqE4ckp7mY5rsZJXDZN4DxbAt6NOWmEP5Gv/sVLvd5eWcOonj8mWt3PlyFNkYv5i8CmK2aAbippK1q/2PY8DBllEBZzPLolWKs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=amSNSSK4; arc=none smtp.client-ip=209.85.210.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-6f4603237e0so2431845b3a.0; Sun, 02 Jun 2024 16:20:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717370449; x=1717975249; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NyDfIrRI6Xr2FPV9NA4UwhKworxEDEXmt1u7Ay0b8XY=; b=amSNSSK4Rpg8105r3TiKib1hJ/hE6Y6pCCBuhmPUVWXpV1P/o9jy3WKbbpCKMFUeFl yeW6TsysWKAvo+socz+dZaFJRXFLodhKKYGOwhcOvQnbWYfkuci9KsE/TZc46hyfMcCE DtV1LZllgUOVCqd8262cw3WCnZ2ODURhQ5VZH1ckZMJHBSEjVi/fIyDUvhJRP6/Z92cp /d12hJLbMROYq7MCrNuNiBNIAz7zNgpYRTCnduZPKxwIByIeNXab2lycA2qJSVppJCbb W8lSo/gE8a8lN36ep1osQ6u0Rfjnu8gQaCNcK2I5f25by5hDPm0Tg2xDeuJg0O9XXFWP 62Cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717370449; x=1717975249; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NyDfIrRI6Xr2FPV9NA4UwhKworxEDEXmt1u7Ay0b8XY=; b=Or5RRQ7g2h2oPAmJIGSxbJXEfilhUxJlw3B8u7JdjDOcBCYzRdIGO72+sImmjJNR8R KHy/rSa3hJDl+ZMIlGoshc2eq0LY+xnSfA4+G9+C02Xf9TVBjzQ6nZ2rkzqOXf3jVAEt JJt93/9TeI4VRDH/mjKZmjuAaA0H9sOCDTuPc0+nEM6NKF73UuNjjMbiS5XMrb9cZqpB DCc3+Iz72xPq3eBEu6leQ6w/d0ihb50MqyOJOaJVRHtW0D9MeJY3zjEX11oCpogChewG iLEqU5b6px4B2j5EO3IUx3Wx11GmGXi6j7mGkbFRIjvxZneaVBHld927ldR9d9F/mmcY XU1A== X-Forwarded-Encrypted: i=1; AJvYcCX1F/MRdpFwP57O7AAxsPdoIPMHKk8tVvefioWfYNl9GU5g5TOsuJmGO+gUh3u2obt6VJEQeuRe+hveI4ZYLaB/wLEbKKstsMbOXI3hhYR4UtzQb+g4b18RKhV5R9aCT1m0Cch9CZGeTMYcpk5FBQ== X-Gm-Message-State: AOJu0YxPQ+0fE71OIhqK5xQ80aorHkKvWdQ6r1e5rcYY2m8M6BHtv17n RA3C1y/diDKcbcYUKVSsGeaUAdAtchDnV3e1mu3P0dDCw+ZiUw58 X-Received: by 2002:a05:6a00:2e08:b0:702:3c08:826a with SMTP id d2e1a72fcca58-702457ab678mr11180557b3a.11.1717370449066; Sun, 02 Jun 2024 16:20:49 -0700 (PDT) Received: from bangji.corp.google.com ([2620:15c:2c0:5:a70f:559b:bc7c:dcd2]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-6c4d3a52b65sm3660907a12.87.2024.06.02.16.20.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jun 2024 16:20:48 -0700 (PDT) From: Namhyung Kim X-Google-Original-From: Namhyung Kim To: weilin.wang@intel.com Cc: namhyung@google.com, Namhyung Kim , Ian Rogers , Arnaldo Carvalho de Melo , Peter Zijlstra , Ingo Molnar , Alexander Shishkin , Jiri Olsa , Adrian Hunter , Kan Liang , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Perry Taylor , Samantha Alt , Caleb Biggers Subject: Re: [RFC PATCH v10 8/8] perf test: Add test for Intel TPEBS counting mode Date: Sun, 2 Jun 2024 16:20:31 -0700 Message-ID: <20240602232041.1730256-1-namhyung@google.com> X-Mailer: git-send-email 2.45.1.288.g0e0cd299f1-goog In-Reply-To: <20240529064327.4080674-9-weilin.wang@intel.com> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: namhyung@google.com On Wed, 29 May 2024 02:43:24 -0400 weilin.wang@intel.com wrote: > From: Weilin Wang > > Intel TPEBS sampling mode is supported through perf record. The counting mode > code uses perf record to capture retire_latency value and use it in metric > calculation. This test checks the counting mode code. > > Signed-off-by: Weilin Wang > --- > .../perf/tests/shell/test_stat_intel_tpebs.sh | 19 +++++++++++++++++++ > 1 file changed, 19 insertions(+) > create mode 100755 tools/perf/tests/shell/test_stat_intel_tpebs.sh > > diff --git a/tools/perf/tests/shell/test_stat_intel_tpebs.sh b/tools/perf/tests/shell/test_stat_intel_tpebs.sh > new file mode 100755 > index 000000000000..43f75055fee4 > --- /dev/null > +++ b/tools/perf/tests/shell/test_stat_intel_tpebs.sh > @@ -0,0 +1,19 @@ > +#!/bin/bash > +# test Intel TPEBS counting mode > +# SPDX-License-Identifier: GPL-2.0 > + > +set e > +err=0 > + > +# Use this event for testing because it should exist in all platforms > +e=cache-misses:R > + > +# Without this cmd option, default value or zero is returned > +echo "Testing without --enable-tpebs-recording" > +result=$(perf stat -e "$e" true 2>&1) > +[[ "$result" =~ "$e" ]] || exit 1 > + > +# In platforms that do not support TPEBS, it should execute without error. > +echo "Testing with --enable-tpebs-recording" > +result=$(perf stat -e "$e" --enable-tpebs-recording -a sleep 0.01 2>&1) > +[[ "$result" =~ "perf record" && "$result" =~ "$e" ]] || exit 1 I got these build errors: Thanks, Namhyung --- TEST tests/shell/test_stat_intel_tpebs.sh.shellcheck_log In tests/shell/test_stat_intel_tpebs.sh line 6: err=0 ^-^ SC2034 (warning): err appears unused. Verify use (or export if used externally). In tests/shell/test_stat_intel_tpebs.sh line 14: [[ "$result" =~ "$e" ]] || exit 1 ^--^ SC2076 (warning): Remove quotes from right-hand side of =~ to match as a regex rather than literally. In tests/shell/test_stat_intel_tpebs.sh line 19: [[ "$result" =~ "perf record" && "$result" =~ "$e" ]] || exit 1 ^--^ SC2076 (warning): Remove quotes from right-hand side of =~ to match as a regex rather than literally. For more information: https://www.shellcheck.net/wiki/SC2034 -- err appears unused. Verify use (o... https://www.shellcheck.net/wiki/SC2076 -- Remove quotes from right-hand sid... make[4]: *** [tests/Build:91: tests/shell/test_stat_intel_tpebs.sh.shellcheck_log] Error 1