Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp737360lqd; Wed, 24 Apr 2024 15:49:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXA2FkE4C7kpwvA6lSXwZCfQNXLrT2WxALzgJACWqxLuKnrZJ9RoqgLgBODYqj2vl86lgjYN52QLgUj0ulqXYGw1ml51e7aRUz238wGAg== X-Google-Smtp-Source: AGHT+IGDFXKRKVwqo7JH7rVrz4yeT4Fbdwpopnn+dhsUpCPsv1Pq24o8AXYRImIZNydqvlbP9X9e X-Received: by 2002:a17:906:f28f:b0:a58:8864:b323 with SMTP id gu15-20020a170906f28f00b00a588864b323mr2671357ejb.11.1713998942481; Wed, 24 Apr 2024 15:49:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713998942; cv=pass; d=google.com; s=arc-20160816; b=sMSQNSq3R3lPvwwPEyAW8Q0OIjSYFijHzUlHeEtiM2tFm24iKKMio6i52/2IHNm4yP qlltb+Db8/tHKPIJNrzE7Y2if6QbQJO/hwyUf8rGIQKI25+WiFQ066VNHwi0RgZ34zUX 8Hyphu3ceozDWVdWKNiGvGDDSgZXnymjifEFjjPmCDpazzzOXGg/qj6fkF162dsaMiCB o/cIRDmwbZKydVd1sUE5Cu7Oa4yB9na3uJaew2baNJGXjHoCQfm7d53z5I6erWVyrzEC wkwZXwWoIzkksK985EBqptvt51VPZz0RUdn8T0jPmsVh3iOsiBUC9QVi28eCr4RxD7Ns NtCQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence; bh=3+owEzSFWG5pFXPMumCZ4/vmcoV9pGQrrXPME2YLu4Y=; fh=dUjl+bk1bmd3YapdcWFsVJo3GubAhKrU6yaqBoc5wAw=; b=niRSecfui1VvkUmmZJkQSyc3hSekTSS7IZL6uIEVuH7XHurK+Q1ECkdEmFv3Y26TFn qyJbN4mPz4ZzEEc44VP8dw+2cyB/NIoMXpJllQmHA08hlj3qMQYvNlB2ax5xhEJhCdm4 DPuEm1jDJY/LCWaBDXY0CqD+JkwJqT3xOT+/vsPaghei0wEFXiiZBjiIEuAyKCq8ULc7 HAZvWTbMKSdnKt9hTVkOyvmTWs8bjAPJ+PGT95d7ON4SkuUEg0S2ilBki2brjIYen2U4 iAX7Ly6rn8OPIsPurFsMCz6S2s+4Mn2WAK6gO+uBMMn9b2nMsTATLGYoa8IsRIP+ZyXz x5Dg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-157802-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157802-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id j18-20020a1709062a1200b00a555fde76f4si8764719eje.647.2024.04.24.15.49.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 15:49:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-157802-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-157802-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157802-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 am.mirrors.kernel.org (Postfix) with ESMTPS id CE0381F2436A for ; Wed, 24 Apr 2024 22:49:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EB3D716E888; Wed, 24 Apr 2024 22:48:51 +0000 (UTC) Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) (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 0654F155A50; Wed, 24 Apr 2024 22:48:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713998931; cv=none; b=I5Ngc9TKV9FWh926uZo8om2OAnRW6ae3GKd/pTuwXR2/BKSj5fQbMes0Zy9p+NO/bJEVuA9AcjPXacBoYRlpZVBM7dCs0wbjVqePp4xL5mawNzFko5iBpXCmsWtYUijtBooQogPXekZkqSC810BFcksegegSiNnJ+L//1OMdXns= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713998931; c=relaxed/simple; bh=HWJ0tXck9M+iSd+3nJJ3wQ8Ni904YFXQtl5/s+z+x/Y=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=AvF8iut72LmTa/riMeiQh9PBCG3HCixaHNUnyv0RtGt0Kk1JQET3YqoliOC2Z4pXgaIOkiUQuLgnLiVeAVrldetob/in4iXg7+D+TxOXwnxgADNZv4Paotp+wW2nE4PfaajEr3ydibs9d+kXcQlO5nJUHAAxmvFxTj9LoUVYq2A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.216.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-f47.google.com with SMTP id 98e67ed59e1d1-2a58209b159so360466a91.3; Wed, 24 Apr 2024 15:48:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713998929; x=1714603729; 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=3+owEzSFWG5pFXPMumCZ4/vmcoV9pGQrrXPME2YLu4Y=; b=dVc/3Hea8tIyT0BawA5mlkKD/YvzD6VANZ/w1woMnQBOwNEgynhMNx0DOLLixjRZQ1 Yi8ShI7BnEWvCUYvmyxE8qpj5sTtinYLZAXLGCWk83kIw94X7xi6MNJkI5aWBoRdQj7W cPyxVzU+I3XOEVyzrqgmhlzP3BE2smHoN90uuJVM/96FICVYKtG76SILVHl45kK3opLA kxAqen4hPJIS4KDnMjiVqVh2lUfdjhyW8dDvY7k/U5H4FUncEgIvEfoqxK9/F5zUPgTB 8Fr+qtF+71kGjx47UXrWiann9P2IuS3B4j0NSfFea1DO5muXvD3rF9TsOs0XtphgGm/f 9+nA== X-Forwarded-Encrypted: i=1; AJvYcCVuH0U+bCmoVSmBY6ThA4/QjcjrKNGHBnJ6MVUAyfwOQjaVa7hWYxtk5wozl8dluB5BDZn2wTSBm/nfJZ7aPwajqHkWzmLTZMVWk1HLsigoZVGRZyQLJFg2X9X07Sy4VhGS0xTsSmOxR6LddlmpZQ== X-Gm-Message-State: AOJu0YxxMJ4z2/occEpwfX/mZAmd14hLM+yjMpc6N+dmlPdvBhSPgJ7C 7a7CY6noHKM7dDXdi088LKsiGcQ0KfQHxedYG7c6BiYpztqjuO33LrU49wggc2usEFDrB5tUgZu /Ny8N8jEhJK6b6o0YsktarxHCwn16iA== X-Received: by 2002:a17:90b:3e87:b0:2ae:b8df:89e7 with SMTP id rj7-20020a17090b3e8700b002aeb8df89e7mr4001520pjb.38.1713998929108; Wed, 24 Apr 2024 15:48:49 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240424001231.849972-1-namhyung@kernel.org> In-Reply-To: From: Namhyung Kim Date: Wed, 24 Apr 2024 15:48:37 -0700 Message-ID: Subject: Re: [PATCH] perf test: Add a new test for perf annotate To: Arnaldo Carvalho de Melo Cc: Ian Rogers , Kan Liang , Jiri Olsa , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Apr 24, 2024 at 2:02=E2=80=AFPM Arnaldo Carvalho de Melo wrote: > > On Wed, Apr 24, 2024 at 11:09:48AM -0700, Ian Rogers wrote: > > On Tue, Apr 23, 2024 at 5:12=E2=80=AFPM 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 # 993= 590 > > > 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: LGTM! Thanks, Namhyung > > 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=3D1 > 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=3D1 > 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_rege= x}" > then > - echo "Basic annotate [Failed missing disasm output]" > + echo "Basic annotate [Failed: missing disasm output from default dis= assembler]" > err=3D1 > 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=3D1 > return > fi > @@ -70,7 +70,7 @@ test_basic() { > if ! perf annotate -i "${perfdata}" --objdump=3Dobjdump 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=3D1 > return > fi