From nobody Mon Feb 9 01:46:42 2026 Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (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 3B33F14533F for ; Sat, 17 Aug 2024 06:45:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723877117; cv=none; b=DiPJsPFtw6VtLzkiwBfYNSAQdQIuxnWt+mw5yZ2dzgyQ5JaEy2TSAVLdEmVvhWzXJkElMWaD/QcPmmVNSmxhk9Y7b97nHm/ByMmY4Ex4b+KmaoGuKksbgwrcyv0C8OPBMHvd9TB8uKG5fdBYYiZDHmTWrIC7ICvvpDVSSgo0J7Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723877117; c=relaxed/simple; bh=svsXcTMaRqZcv7GQdX5SDwbX/PNPLJVnzNXlCv1HOwg=; h=Date:In-Reply-To:Message-Id:Mime-Version:References:Subject:From: To:Content-Type; b=OIaiYAd/D5CquVhnn4IwAQQPuMWkxZSne6S+1ZAg7JCiGjr9a+TFEmVF0tedjrWGsLd9H6vZyBT7KmbBNqX7AJBMK99IuNaxdnLsPP5ZHNozyPj5u6nziKzsqQ0oeevg5sva7988yh8GjO3g280gyWsDCfURY1A5FKscXICZtNk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=o7F4B4a7; arc=none smtp.client-ip=209.85.128.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--irogers.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="o7F4B4a7" Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-6886cd07673so49592527b3.3 for ; Fri, 16 Aug 2024 23:45:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1723877115; x=1724481915; darn=vger.kernel.org; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=uiIb0LHFpPGuH8DbvZrhFnBLb6AIQ7thHhf5YFck8Ko=; b=o7F4B4a72LTF0ZtAZDSYFB+3PzHhy77VR9b9FUa0cGmPfKIU1iIk0Q6Pjt3IVk0oo+ 8wVCO6ZtlzbUh7gO93+SA3XsBMTaPBzliuHi6NJJFh0GiUnRfRaXy249BiFYo5Jkw6UO 9h/a6/5E3PBS6hqH2f/x93+yoPKqi6FfvgQGVoiVVBEF+oZ4cjygUyMNiHVHwazWWtDZ TO4uzD4Zov4gKgJTYqrBpSf0c0uBgO4zILHyTtbWMOogZ/k9+oj2Wzg9bd/awnTWoYyv baKuHGAjDKyYPlWJEHYWX85UB+BFjkVMpUqN1OX5qNxse89Iihrd+Nr3izoxfdWITSAy hSgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723877115; x=1724481915; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=uiIb0LHFpPGuH8DbvZrhFnBLb6AIQ7thHhf5YFck8Ko=; b=P+VdfCz6pfXv1r15qwj3VjTRJV3u6aHtUl5obHfXkgxrSINDAcjoddYpgklonppn4r tWYWCx2dFwxq568kueiEo4ZM7C2ErJ2dlpUNiN6BMx4FSyHu64gOK79WKBSEolJ2Ty42 pHafTqmMUQuK60VStrsI2oAKVc0OOn6fI8Vhb5ZQBs9I9Xf/KaBQyyuahY0x4qRHLopi yPR2suEV+5qc8RG/UwoeFb8Ok0T4BVcG1OuI7ewR6Glh0du6kkG6J1dB+hrXge9E2ks6 3toDhxcrJs/ZC0w20/W+UI65ecE13SLUMmQxmTATytJbYYzYhtE+7ljhxvjPPRvpK65P IoKA== X-Forwarded-Encrypted: i=1; AJvYcCXsPvN5Ql2dnd96XCsm54c6UOpNWTn74puzx28tnROgjrjYfwuE4BqLB9kscIi5fH7XZ9UJWAki735y3ECt5KtkR0ph/mGBCe/a/ypX X-Gm-Message-State: AOJu0Yx13HYhlx1Uw+waiRyliH4Lh8+1pMgKppBYUZ1Vqg8+dH6sZJNU CJ10mcpUQj1Xb2x1/MtYJZwZ1GNYsVOk8WmtjpnK14i5zL1YPdRpgxoOJXvXho9fyv79xKNc6f3 jngWisQ== X-Google-Smtp-Source: AGHT+IHpIQH3Z4+neJvbwuE+BMqXxfg4n05M1ztGFk7NZrFg4BazntZ8QBZQfcIgDAHYHp5Rx83a8q7z27Ab X-Received: from irogers.svl.corp.google.com ([2620:15c:2a3:200:78c9:5e58:734f:c59f]) (user=irogers job=sendgmr) by 2002:a05:690c:2f0b:b0:6ad:9825:6a2f with SMTP id 00721157ae682-6b1b6cb7a10mr534947b3.1.1723877115221; Fri, 16 Aug 2024 23:45:15 -0700 (PDT) Date: Fri, 16 Aug 2024 23:44:35 -0700 In-Reply-To: <20240817064442.2152089-1-irogers@google.com> Message-Id: <20240817064442.2152089-7-irogers@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240817064442.2152089-1-irogers@google.com> X-Mailer: git-send-email 2.46.0.184.g6999bdac58-goog Subject: [PATCH v1 06/13] perf test: Expand pipe/inject test From: Ian Rogers To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Kan Liang , Masahiro Yamada , Arnd Bergmann , Jann Horn , Colin Ian King , Casey Chen , Athira Rajeev , Chaitanya S Prakash , James Clark , Ze Gao , Yang Jihong , Yunseong Kim , Weilin Wang , Dominique Martinet , Anne Macedo , Sun Haiyong , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Test recording of call-graphs and injecting --build-all. Add/expand trap handler. Signed-off-by: Ian Rogers --- tools/perf/tests/shell/pipe_test.sh | 101 ++++++++++++++++++++++------ 1 file changed, 79 insertions(+), 22 deletions(-) diff --git a/tools/perf/tests/shell/pipe_test.sh b/tools/perf/tests/shell/p= ipe_test.sh index a78d35d2cff0..ad10012fdc29 100755 --- a/tools/perf/tests/shell/pipe_test.sh +++ b/tools/perf/tests/shell/pipe_test.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # perf pipe recording and injection test # SPDX-License-Identifier: GPL-2.0 =20 @@ -12,30 +12,87 @@ skip_test_missing_symbol ${sym} =20 data=3D$(mktemp /tmp/perf.data.XXXXXX) prog=3D"perf test -w noploop" -task=3D"perf" +err=3D0 =20 -if ! perf record -e task-clock:u -o - ${prog} | perf report -i - --task | = grep ${task}; then - echo "cannot find the test file in the perf report" - exit 1 -fi +set -e =20 -if ! perf record -e task-clock:u -o - ${prog} | perf inject -b | perf repo= rt -i - | grep ${sym}; then - echo "cannot find noploop function in pipe #1" - exit 1 -fi +cleanup() { + rm -rf "${data}" + rm -rf "${data}".old =20 -perf record -e task-clock:u -o - ${prog} | perf inject -b -o ${data} -if ! perf report -i ${data} | grep ${sym}; then - echo "cannot find noploop function in pipe #2" - exit 1 -fi + trap - EXIT TERM INT +} =20 -perf record -e task-clock:u -o ${data} ${prog} -if ! perf inject -b -i ${data} | perf report -i - | grep ${sym}; then - echo "cannot find noploop function in pipe #3" - exit 1 -fi +trap_cleanup() { + echo "Unexpected signal in ${FUNCNAME[1]}" + cleanup + exit 1 +} +trap trap_cleanup EXIT TERM INT =20 +test_record_report() { + echo + echo "Record+report pipe test" + + task=3D"perf" + if ! perf record -e task-clock:u -o - ${prog} | perf report -i - --task = | grep -q ${task} + then + echo "Record+report pipe test [Failed - cannot find the test file in t= he perf report #1]" + err=3D1 + return + fi + + if ! perf record -g -e task-clock:u -o - ${prog} | perf report -i - --ta= sk | grep -q ${task} + then + echo "Record+report pipe test [Failed - cannot find the test file in t= he perf report #2]" + err=3D1 + return + fi + + echo "Record+report pipe test [Success]" +} + +test_inject_bids() { + inject_opt=3D$1 + + echo + echo "Inject ${inject_opt} build-ids test" + + if ! perf record -e task-clock:u -o - ${prog} | perf inject ${inject_opt= }| perf report -i - | grep -q ${sym} + then + echo "Inject build-ids test [Failed - cannot find noploop function in = pipe #1]" + err=3D1 + return + fi + + if ! perf record -g -e task-clock:u -o - ${prog} | perf inject ${inject_= opt} | perf report -i - | grep -q ${sym} + then + echo "Inject ${inject_opt} build-ids test [Failed - cannot find noploo= p function in pipe #2]" + err=3D1 + return + fi + + perf record -e task-clock:u -o - ${prog} | perf inject ${inject_opt} -o = ${data} + if ! perf report -i ${data} | grep -q ${sym}; then + echo "Inject ${inject_opt} build-ids test [Failed - cannot find noploo= p function in pipe #3]" + err=3D1 + return + fi + + perf record -e task-clock:u -o ${data} ${prog} + if ! perf inject ${inject_opt} -i ${data} | perf report -i - | grep -q $= {sym}; then + echo "Inject ${inject_opt} build-ids test [Failed - cannot find noploo= p function in pipe #4]" + err=3D1 + return + fi + + echo "Inject ${inject_opt} build-ids test [Success]" +} + +test_record_report +test_inject_bids -b +test_inject_bids --buildid-all + +cleanup +exit $err =20 -rm -f ${data} ${data}.old -exit 0 --=20 2.46.0.184.g6999bdac58-goog