Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp692334lqd; Wed, 24 Apr 2024 14:03:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUQDOwlL26TP+hn16DoDC0kjaZ7Pcx7KtYUoqeumDfuZ75CdnnfxxxpfJJvT6I7eaMMQgVWplr8MIqqSf245aT4TvLhLg28OrQo6r92Dw== X-Google-Smtp-Source: AGHT+IEiDLWxQJlhe9oZNYQYfuXM2v80c9mpJmjGkeYu2dNSIOYhI4xeNGM0YEKsn6uZceABqhiK X-Received: by 2002:a17:903:2441:b0:1e2:58f:7ed4 with SMTP id l1-20020a170903244100b001e2058f7ed4mr1439071pls.5.1713992613004; Wed, 24 Apr 2024 14:03:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713992612; cv=pass; d=google.com; s=arc-20160816; b=qrRwp3/NgCu7LH/q9ORRK9A/i/rmyGkglbFKcj57Ju3ItUukfVOZZBJXdvSkKTnmaY v8U1X2+c+TQCrjVhtmj4A1lAR5yVrLaFHxTASC60MSoFN1r8wT7J4ybNCZxLkhq6YLtT mpxEhfeTrWDDP9gGjGPqV+H7wJ+lkPC9SCsD6fQsatsHcGmJ1PP6uAj0x7OK3tBuh02Q O4v/8MhvWUsN8AeFpzqQwB3GV9oEeNUKKCfGjQFlBqjvLqGT445IIFsAbzqx0x9E4yiI X7sfIfUjBYgdom/ZKTzE9MVYVftQQnEv/H8zcU3Y9sbgcSH4gvnJOxtBXIb5WZjtlDmD 1uyw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=uiUabgQlGFQONVrLG7ZPunmY0jimY2vbCEKfx9zqDFU=; fh=QPHjG65RNQ4P0Lo50ADGdMc5jntiupTtyaImif19M7E=; b=gsXrhTf/Fu6XnYSxodEn2PZ2T52JYhw0tyHqL60nAE6RebMJ4IrYcadcRpccDlP2Ds hdI4f9zyVmJn/BbFFvAIBjyxvahBBDno2S597M/jz1pSvHkeFNjmUzpcUU/XUPt4koTj 5P9citzSkEORCOW1rjGrs/v9Ch6ygcSlpcexh3bgd+/OWXm4y4LuGHqOk+tnkCn3KIH/ 1BqBM61k15x0bvHvY4lQ6VZReRScEeyOY8y4/2HqAyi4m/PuZn4kWyzvP7oJ5iByaNbE T2Nv6IXIjKOauKTG38DsGOmCkYmRxFfwk0RdO1j/lnj6W1gVvi3763Mc/9HhBmnz0Ddw g6Hw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kVBkV7CL; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-157715-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157715-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id f13-20020a170902684d00b001e8dd83996esi9300026pln.180.2024.04.24.14.03.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 14:03:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-157715-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kVBkV7CL; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-157715-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157715-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 00B1C2847AF for ; Wed, 24 Apr 2024 21:02:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6E62B15697D; Wed, 24 Apr 2024 21:02:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="kVBkV7CL" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 830BA13B5A6; Wed, 24 Apr 2024 21:02:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713992548; cv=none; b=JqFTQuP0sYFTJr4O659LsIDu90kE20S0/W+v4/xC6lupjm7TA6mNoquZVfj5VPV1bt1q8gNCVZpKYTJTLWwXqZFyq2PeEN6rVdApHd4H8a/1dsfV0Kr8jzxhrT+oJeAeJJ0fBAfaTpEasY44buiYyBLVi3KvsExdelxccvMmYro= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713992548; c=relaxed/simple; bh=duRefqYdkr7ZabzNDP6pQLWEXT6nQnCVmhZIfFwdaCA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=r8+S74H6im4rVPXOVUWxUXyx039WT7VzFPy9oPKqXPUvQAHK/KExHyBtEiXTOI1U+8wWdKUkRfCMhQXeqcSXT9OV9TYpL6u/CfXucjddnqcQJ7w53joTOVTq2w7gpDCnbVwL2t2Z3w4oifF4V8v3qMIAkg6WpY8nnWtvD8PR67g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=kVBkV7CL; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87F1DC113CD; Wed, 24 Apr 2024 21:02:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713992548; bh=duRefqYdkr7ZabzNDP6pQLWEXT6nQnCVmhZIfFwdaCA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kVBkV7CLQZFxa6NTE7tHVgs/ThkR2bEBT8zgQdx/9q79ujwszX8DFByoU5WnzcM1t XB5EHK70Of8Uvz8boggvdQfqfpMfTUWZk+98IOvQEysCTFQuKDHPxWTLDkwK02fhc4 9qNUEmAO2PJ9BSXQ4zsDkkhbIfqKvUEt0e3BgCCTOC21XxvaYvv9nq4o8AMVMUn4sc 8bHpTdCDLige26I3fuVHoAMMX6EDeORgfN7Uiy5WugEbNZLFGYXN7mQHwkAc65r4eu dfJYKOI2bzjDlRfGJfNQr98TMXykLr55OlE4+xxManWqrfpapK5k3FupBwPZO0EyVv IuasSMlYLZinw== Date: Wed, 24 Apr 2024 18:02:24 -0300 From: Arnaldo Carvalho de Melo To: Ian Rogers Cc: Namhyung Kim , Kan Liang , Jiri Olsa , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org Subject: Re: [PATCH] perf test: Add a new test for perf annotate Message-ID: References: <20240424001231.849972-1-namhyung@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, Apr 24, 2024 at 11:09:48AM -0700, Ian Rogers wrote: > On Tue, Apr 23, 2024 at 5:12 PM Namhyung Kim wrote: > > > > Add a basic perf annotate test > > > > $ ./perf test annotate -vv > > 76: perf annotate basic tests: > > --- start --- > > test child forked, pid 846989 > > fbcd0-fbd55 l noploop > > perf does have symbol 'noploop' > > Basic perf annotate test > > : 0 0xfbcd0 : > > 0.00 : fbcd0: pushq %rbp > > 0.00 : fbcd1: movq %rsp, %rbp > > 0.00 : fbcd4: pushq %r12 > > 0.00 : fbcd6: pushq %rbx > > 0.00 : fbcd7: movl $1, %ebx > > 0.00 : fbcdc: subq $0x10, %rsp > > 0.00 : fbce0: movq %fs:0x28, %rax > > 0.00 : fbce9: movq %rax, -0x18(%rbp) > > 0.00 : fbced: xorl %eax, %eax > > 0.00 : fbcef: testl %edi, %edi > > 0.00 : fbcf1: jle 0xfbd04 > > 0.00 : fbcf3: movq (%rsi), %rdi > > 0.00 : fbcf6: movl $0xa, %edx > > 0.00 : fbcfb: xorl %esi, %esi > > 0.00 : fbcfd: callq 0x41920 > > 0.00 : fbd02: movl %eax, %ebx > > 0.00 : fbd04: leaq -0x7b(%rip), %r12 # fbc90 > > 0.00 : fbd0b: movl $2, %edi > > 0.00 : fbd10: movq %r12, %rsi > > 0.00 : fbd13: callq 0x40a00 > > 0.00 : fbd18: movl $0xe, %edi > > 0.00 : fbd1d: movq %r12, %rsi > > 0.00 : fbd20: callq 0x40a00 > > 0.00 : fbd25: movl %ebx, %edi > > 0.00 : fbd27: callq 0x407c0 > > 0.10 : fbd2c: movl 0x89785e(%rip), %eax # 993590 > > 0.00 : fbd32: testl %eax, %eax > > 99.90 : fbd34: je 0xfbd2c > > 0.00 : fbd36: movq -0x18(%rbp), %rax > > 0.00 : fbd3a: subq %fs:0x28, %rax > > 0.00 : fbd43: jne 0xfbd50 > > 0.00 : fbd45: addq $0x10, %rsp > > 0.00 : fbd49: xorl %eax, %eax > > 0.00 : fbd4b: popq %rbx > > 0.00 : fbd4c: popq %r12 > > 0.00 : fbd4e: popq %rbp > > 0.00 : fbd4f: retq > > 0.00 : fbd50: callq 0x407e0 > > 0.00 : fbcd0: pushq %rbp > > 0.00 : fbcd1: movq %rsp, %rbp > > 0.00 : fbcd4: pushq %r12 > > 0.00 : fbcd0: push %rbp > > 0.00 : fbcd1: mov %rsp,%rbp > > 0.00 : fbcd4: push %r12 > > Basic annotate test [Success] > > ---- end(0) ---- > > 76: perf annotate basic tests : Ok > > > > Signed-off-by: Namhyung Kim > > Looks good, thanks for this! > > Reviewed-by: Ian Rogers Thanks! Applied, with the following changes to improve the error reporting, please holler if you disagree: diff --git a/tools/perf/tests/shell/annotate.sh b/tools/perf/tests/shell/annotate.sh index 7820d13eebaef535..1db1e8113d9943a6 100755 --- a/tools/perf/tests/shell/annotate.sh +++ b/tools/perf/tests/shell/annotate.sh @@ -36,7 +36,7 @@ test_basic() { echo "Basic perf annotate test" if ! perf record -o "${perfdata}" ${testprog} 2> /dev/null then - echo "Basic annotate [Failed record]" + echo "Basic annotate [Failed: perf record]" err=1 return fi @@ -44,7 +44,7 @@ test_basic() { # check if it has the target symbol if ! perf annotate -i "${perfdata}" 2> /dev/null | grep "${testsym}" then - echo "Basic annotate [Failed missing symbol]" + echo "Basic annotate [Failed: missing target symbol]" err=1 return fi @@ -52,7 +52,7 @@ test_basic() { # check if it has the disassembly lines if ! perf annotate -i "${perfdata}" 2> /dev/null | grep "${disasm_regex}" then - echo "Basic annotate [Failed missing disasm output]" + echo "Basic annotate [Failed: missing disasm output from default disassembler]" err=1 return fi @@ -61,7 +61,7 @@ test_basic() { if ! perf annotate -i "${perfdata}" "${testsym}" 2> /dev/null | \ grep -m 3 "${disasm_regex}" then - echo "Basic annotate [Failed missing disasm output]" + echo "Basic annotate [Failed: missing disasm output when specifying the target symbol]" err=1 return fi @@ -70,7 +70,7 @@ test_basic() { if ! perf annotate -i "${perfdata}" --objdump=objdump 2> /dev/null | \ grep -m 3 "${disasm_regex}" then - echo "Basic annotate [Failed missing disasm output from objdump]" + echo "Basic annotate [Failed: missing disasm output from non default disassembler (using --objdump)]" err=1 return fi