From patchwork Thu May 11 06:27:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Namhyung Kim X-Patchwork-Id: 92367 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp4156249vqo; Wed, 10 May 2023 23:40:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ56VbfY3cz5WaRTFrBCWUDW0xkHbHXaqAG97X2MZ0T7/MtBfH/TqNdfDoF73X8bbEWCz1LU X-Received: by 2002:a17:903:44b:b0:1ab:f74:a111 with SMTP id iw11-20020a170903044b00b001ab0f74a111mr20348154plb.63.1683787238414; Wed, 10 May 2023 23:40:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683787238; cv=none; d=google.com; s=arc-20160816; b=tRq0i0pbul8QhEdQT95pxnMST9uj38uTuRutc6wiZHhTvoQmEzlVc2vPV47d9kMuEW vTxQi3ojLlzuNocD5DP7NeaRo4KokOZ7NY3bETf5xndY33UfJlnlKxuClRPvKq0h4tzt GQjBcoCmtffCTUnaxSDqGAK9MxFmfPouWoYgqRe8OwFXnzltjMWapzv1+LN17nlO6SYi VCJ518VnnfPZa+BuMl37nPjX6p+AXGxtNnOvjSdZ7V7i1/2XVKWAYP9UfVs/Gsqm+kiM S2I6t7UsSpnOmt3HXg8SJLHlKe2W8ga9LhmyPvu3ZMLqoIxQmuMSDnYKD5ZNwFB90hTw +xbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=WK/vptfD+s0yQGQBHciJfzoWhRURnNdyfSrksISe1As=; b=LW64jnlDMve3VTN62OHw1srtImPAoOaTVyYuQJmvHC5Hs4DzY/45AVO+kimIM2lDv3 vSsylaY0oR6+0ULc+ctrrWMKofGVGse2svsPQo8T/rFgKPi9vd4tCLeqvFbG3i/ARpHC Ay/ZtxYNBNUY+5PKl7ctGkN8UXPELZ5gjzLLGSDI1jMuHVEwRy4Ar4y7sZWJSimIXeoQ ppvoiTa8nPcgi43Hn6YhdrJmBrh6Q9mYlO6W0rZPSA2vtLDseYW1ll0ty0CgsRICqgDC H8/VLGmV/oVe1ycP7HOg/WNpgLVhRhPpgkTDAVNzqXnc3qAlXHLyFrpPcXjku3k+h4KX JK8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=gJBO284B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k8-20020a170902ba8800b001a979141a24si5661703pls.214.2023.05.10.23.40.23; Wed, 10 May 2023 23:40:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=gJBO284B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237021AbjEKG1e (ORCPT + 99 others); Thu, 11 May 2023 02:27:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229490AbjEKG1a (ORCPT ); Thu, 11 May 2023 02:27:30 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F35DDE0; Wed, 10 May 2023 23:27:28 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1a50cb65c92so58714655ad.0; Wed, 10 May 2023 23:27:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683786448; x=1686378448; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:from:to:cc:subject:date:message-id:reply-to; bh=WK/vptfD+s0yQGQBHciJfzoWhRURnNdyfSrksISe1As=; b=gJBO284BPEnxa95PkjvJXy4xbgbF2UBpZvdagt/VBUrBSAfzfEu8DL1CmFwXPDBwve mId9OBLz+z5A9GE3JU6KhE7rCwXODt6+/uMmVvDikBpws/w9RZjrdm3oZVg+7rx9qrxo ZYNZy7hlGj88jJ7fZ7zUlTt6l5KKxKh7jJEfwrIUGtbSLFQry5rmFdiyR4YYmoJBJ5Zg aOIxV2uGu3MBfC/PPx9qFCSCQ9OIWxhViTmhZfXhT4wspIUol+LCrd6zRC09HPLnWCui 5Pu6NrvfXMHa7UlXgTDGml32vKnX4XI+FbFSpw5asVznYpickyJFn/mpr8EW6sGQ8C0d 9rzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683786448; x=1686378448; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=WK/vptfD+s0yQGQBHciJfzoWhRURnNdyfSrksISe1As=; b=adMqbjOlfHoSgtaRCW8DWUHFkZyYAgZsYC2duT9Hh1yYJdEoo65FfuMUZl6gXD35OB zYfhmhfuIS7viOLubnG/sg9zZ4PtMbdtw6CWRznSqzNOwxEFJwty+4YCYfPdC4ce7UVA vIMK0g6hWKKz/T12ovESg2v9PsHciERI9p9BlRpTjSRC6n6pxhxabXK6P6mUQVxGgHtC NaBr25aJu2PuxIpzxLaKBdXzTOVrv0D1sjVwZXXQACwjZJiNUpU0m99lqhh/adaz68jl rL/9aTrP/AQwDf51KNMmtxPR/2Ii5Jhr67k+WC0a6bCPke6dnbdGGdEZ6eoARjS7sjt8 JS0Q== X-Gm-Message-State: AC+VfDxT79wAyqK7DzZ8mzOAWwrxgK0ScK8Fsv7JQXFUVm5aSTNEeWHN CtDxta8N1Nmm7r0h54V5p4Y= X-Received: by 2002:a17:902:8216:b0:1ac:753a:7933 with SMTP id x22-20020a170902821600b001ac753a7933mr11649636pln.39.1683786448233; Wed, 10 May 2023 23:27:28 -0700 (PDT) Received: from bangji.hsd1.ca.comcast.net ([2601:647:6700:7f00:c18c:3210:36c3:c88c]) by smtp.gmail.com with ESMTPSA id jj17-20020a170903049100b001ac2be2639asm4925683plb.223.2023.05.10.23.27.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 May 2023 23:27:27 -0700 (PDT) Sender: Namhyung Kim From: Namhyung Kim To: Arnaldo Carvalho de Melo , Jiri Olsa Cc: Ian Rogers , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org, Andi Kleen Subject: [PATCH 1/3] perf annotate: Handle more instructions on x86 Date: Wed, 10 May 2023 23:27:23 -0700 Message-ID: <20230511062725.514752-1-namhyung@kernel.org> X-Mailer: git-send-email 2.40.1.521.gf1e218fcd8-goog MIME-Version: 1.0 X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765578887009615740?= X-GMAIL-MSGID: =?utf-8?q?1765578887009615740?= I found some instructions didn't parse the operands properly. Add them to the table to fix the issue. Signed-off-by: Namhyung Kim Acked-by: Ian Rogers --- tools/perf/arch/x86/annotate/instructions.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/perf/arch/x86/annotate/instructions.c b/tools/perf/arch/x86/annotate/instructions.c index 305872692bfd..5c7bec25fee4 100644 --- a/tools/perf/arch/x86/annotate/instructions.c +++ b/tools/perf/arch/x86/annotate/instructions.c @@ -35,12 +35,14 @@ static struct ins x86__instructions[] = { { .name = "cs", .ops = &mov_ops, }, { .name = "dec", .ops = &dec_ops, }, { .name = "decl", .ops = &dec_ops, }, + { .name = "decq", .ops = &dec_ops, }, { .name = "divsd", .ops = &mov_ops, }, { .name = "divss", .ops = &mov_ops, }, { .name = "gs", .ops = &mov_ops, }, { .name = "imul", .ops = &mov_ops, }, { .name = "inc", .ops = &dec_ops, }, { .name = "incl", .ops = &dec_ops, }, + { .name = "incq", .ops = &dec_ops, }, { .name = "ja", .ops = &jump_ops, }, { .name = "jae", .ops = &jump_ops, }, { .name = "jb", .ops = &jump_ops, }, @@ -123,6 +125,8 @@ static struct ins x86__instructions[] = { { .name = "test", .ops = &mov_ops, }, { .name = "testb", .ops = &mov_ops, }, { .name = "testl", .ops = &mov_ops, }, + { .name = "testq", .ops = &mov_ops, }, + { .name = "tzcnt", .ops = &mov_ops, }, { .name = "ucomisd", .ops = &mov_ops, }, { .name = "ucomiss", .ops = &mov_ops, }, { .name = "vaddsd", .ops = &mov_ops, }, From patchwork Thu May 11 06:27:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Namhyung Kim X-Patchwork-Id: 92368 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp4161291vqo; Wed, 10 May 2023 23:54:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4arNFm52s9V9GBaaKBcfXH2VfLInfYA+wsEtY+1E3S/mF0p0TcV4cjAu3zgPVvAvRUkQm+ X-Received: by 2002:a05:6a21:789c:b0:100:607:b986 with SMTP id bf28-20020a056a21789c00b001000607b986mr18314408pzc.56.1683788059993; Wed, 10 May 2023 23:54:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683788059; cv=none; d=google.com; s=arc-20160816; b=kH7tg5eGrGHsm6vGl/uJXPWyeIbIE996ydCiutDvweVPu19pEYqHBHQhYHbZnw39Mf QCJcLSTJ9RDCOzf0bWGo6x60CeotDdpiC1hwW54EXSJfnaRs7ZulDIDLNS7pvdLBHDyH yYo4KPHr8wjJAEiNtRerz2ygz09qo3cuYkjFxhfuS2Zw9JjcEhcIcjvFR0YZRxtW79OV wQtAds5dG4ZNSW3U4hhx9O/DdXc3IK3ixP+jgnSq8ScI1Re0yX5QDTYwrSRCQhfXoJZ4 Xl7AokUob7SYHuB/ZonkN8gMdJCXTd8kQmpGMBU/C1eCbCqjU13bF4GUFITxfPkQk7UU 821A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from:sender :dkim-signature; bh=BUM/womBq8zG0iIiWwWTRkqn2H+jvaSWOmmttRj5uZA=; b=UxLW7r2UR88kA0P5+JPEFxSyvD8ws8ZKm510R1hDBffgXkdt18STuhpRoVcHplGw7m wZnmJK1j8/Jd9SR9Yl74v4i8/KErkWNmNmXnZUwJNrhPzrmEnl3q6VvWNoQcyvlehSyr gTG2GLa9fvTfmPIcdwS1NH3O9+8kTxIl5UZVKZGIQE1pDaJLjwX0N/t3Z20Lvd9HMzx+ mbm3IFBMcXTbWzwadSiIBWrDfXDwHsq1CkXi5i7RzXQigPr+mxGn7orRVQHR/nQI6jKb DVtqlJHeS+5KSyRuQjlyjE713Lkkjqco7AmESo5UXEmmxJyCfEpfaAD0jJEsfTHJXQGU cDCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="QVkS6/mf"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x186-20020a6386c3000000b00528c6c2ea96si6312173pgd.306.2023.05.10.23.54.07; Wed, 10 May 2023 23:54:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="QVkS6/mf"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232984AbjEKG1f (ORCPT + 99 others); Thu, 11 May 2023 02:27:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236751AbjEKG1a (ORCPT ); Thu, 11 May 2023 02:27:30 -0400 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFDF9103; Wed, 10 May 2023 23:27:29 -0700 (PDT) Received: by mail-pg1-x52e.google.com with SMTP id 41be03b00d2f7-51b0f9d7d70so7437391a12.1; Wed, 10 May 2023 23:27:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683786449; x=1686378449; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=BUM/womBq8zG0iIiWwWTRkqn2H+jvaSWOmmttRj5uZA=; b=QVkS6/mfk8fj+fZi8lFlKmIk8nPgYKzj4H1gYEY24Nc0TMmQJ0SNvHM5yPrbqOQfez S509jegR0jRiPSkb5q6EpjrQlc8BZmq7/uzRWMURB2sUOb1B8W4qCx+YeGhIG1+tyZ+Y JZ7MVI2Qr8dpfFvczODEDR2pZIDgJt/L3nZjlWihYI6ZgCxTgYVPgoMMohmAHoJm0YHJ csf6IDnjecRXuoahJO/J6TXkhlBSpNbw9Eyoa0eg4f2eWrvwbzODuMFxbOJssWCkY2pB 6IRD/wZz56p9HWtMibiYOzR75HJk+YcZqX0lj6dghNkh4YUkCOo796cgbFz7HhsEA3lV T+eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683786449; x=1686378449; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=BUM/womBq8zG0iIiWwWTRkqn2H+jvaSWOmmttRj5uZA=; b=SZUYzB1Va2cyi6Or0mPerN1HICTU28wF4KDSHnkx+Z+J+GalLfEWwzGXbGTYa7GqNj aQTbMEfZAfH0+S3U6Z4fFeF497l70SNN4rQJNRc7eHkXW5RngQH8ZWHSws15YwjTPLk5 eNSf1Yh/mQy8+xPpnpD51bgxToiyySdLes7kv4h+gy29KLzdGHkB3FmhvwZ7rA7IOoYp XzyOeBSwskGc9DBvTjKMX4Q122jk2kQ9dAEZTm84NsnjIdiWWFJWTwHn0MPjHa4jKXbr yZ4FPlEh8PAkG3Y+WUFgvbpjOmS9uNeX6Vpa59brbOHDhT/MV2guovSDi2kFJY4HgW3j NUOA== X-Gm-Message-State: AC+VfDwoV5bvfp34JGbu1EgpSdyjynNcCM65pfSBWTOdf/7DwQed+824 B3YsMY/mG5CH2kmq8AonsX0= X-Received: by 2002:a17:902:b68d:b0:1ac:7405:d3ba with SMTP id c13-20020a170902b68d00b001ac7405d3bamr13535688pls.40.1683786449496; Wed, 10 May 2023 23:27:29 -0700 (PDT) Received: from bangji.hsd1.ca.comcast.net ([2601:647:6700:7f00:c18c:3210:36c3:c88c]) by smtp.gmail.com with ESMTPSA id jj17-20020a170903049100b001ac2be2639asm4925683plb.223.2023.05.10.23.27.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 May 2023 23:27:29 -0700 (PDT) Sender: Namhyung Kim From: Namhyung Kim To: Arnaldo Carvalho de Melo , Jiri Olsa Cc: Ian Rogers , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org, Andi Kleen Subject: [PATCH 2/3] perf annotate: Parse x86 SIB addressing properly Date: Wed, 10 May 2023 23:27:24 -0700 Message-ID: <20230511062725.514752-2-namhyung@kernel.org> X-Mailer: git-send-email 2.40.1.521.gf1e218fcd8-goog In-Reply-To: <20230511062725.514752-1-namhyung@kernel.org> References: <20230511062725.514752-1-namhyung@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765579748919658429?= X-GMAIL-MSGID: =?utf-8?q?1765579748919658429?= When the source argument of mov instruction is look like below, it didn't parse the whole operand and just stopped at the first comma. mov (%rbx,%rax,1),%rcx Fix it by checking the parentheses and move it to the closing one. Signed-off-by: Namhyung Kim Acked-by: Ian Rogers --- tools/perf/util/annotate.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c index ca9f0add68f4..6053ddf9c32d 100644 --- a/tools/perf/util/annotate.c +++ b/tools/perf/util/annotate.c @@ -550,6 +550,19 @@ static int mov__parse(struct arch *arch, struct ins_operands *ops, struct map_sy return -1; *s = '\0'; + + /* + * x86 SIB addressing has something like 0x8(%rax, %rcx, 1) + * then it needs to have the closing parenthesis. + */ + if (strchr(ops->raw, '(')) { + *s = ','; + s = strchr(ops->raw, ')'); + if (s == NULL || s[1] != ',') + return -1; + *++s = '\0'; + } + ops->source.raw = strdup(ops->raw); *s = ','; From patchwork Thu May 11 06:27:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Namhyung Kim X-Patchwork-Id: 92375 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp4162434vqo; Wed, 10 May 2023 23:57:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ74EIh0Peqm4qRut18M9UY6inYGrUlqza9iFVNvbrVtF5PKrV2cClQ+6PWM4lCk8jv3Ia9Y X-Received: by 2002:a17:902:db07:b0:1ac:65ab:cf7b with SMTP id m7-20020a170902db0700b001ac65abcf7bmr20286230plx.9.1683788253651; Wed, 10 May 2023 23:57:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683788253; cv=none; d=google.com; s=arc-20160816; b=e0Ll22tUL7EoglR00Jy/IYl4Mf0Ug3u2e4MQYN5YiS5iVq2rkBzgj7QbNxZA6YFTd1 I8rHhTKvKblHHltwXMWhVvWpP5gXItrvHH1eS+Evye8e48G+ZtR5Ur86eeSJuhljDZYJ hjFHKQdfUv05Qcpx8jgcVVdXArA3b8OMBBYgfbj5QZTRvQHAzdn9YF52MBxDXpBVqwTK P5+uGE+gQBFKIR4jRnUTgADJFK/Avh5z1EAye7hOMnOPT8eH+VgTg5DV7sTmeQICM8Ya 0tkaQXDWnMUwL/+ZiYUvoS4q4cTJeTLVzFCKJn4rd0t+T7lDQnDm00m53C7d96tmOltR PCiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from:sender :dkim-signature; bh=Wccq2cR0tl91tz/Xz/oRtoRCvVeKB1PntoUZvC+KoPo=; b=KAPgpgozboI/Rp8wHwCaYErC6koU0EX9FcRKd5na6XJjYPhl+xGrmKnkap5O4MMyFD /lLd3lMB59DOl2I4DY6oli3Q6cW8pLy81/v7a4TLaL/MhlYWaTaRXPOpq9l7pww0oYwP Dq44dWlDxyxleaffKVQMtnJLt5OR4YQ+YS7ZUwLsac5IE4rCuRI+jlnKjXf4aLy7JJF2 pfT2M8SlhXY+3SGA7HtWK2esHb6Oq9jFKTR3oXfVK60dlmDYsffDDcd0iMgcsJY0K5RA 43unHCJELtDsj1w2OseTFKgyNZiZ2j7Nf3qY4LfHoosaioGkyPWlJgTI4qZhEWPnNjKJ tmFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="X/nJr+o6"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p15-20020a170902b08f00b001ac3103c548si5815428plr.138.2023.05.10.23.57.17; Wed, 10 May 2023 23:57:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="X/nJr+o6"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237035AbjEKG1i (ORCPT + 99 others); Thu, 11 May 2023 02:27:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236987AbjEKG1d (ORCPT ); Thu, 11 May 2023 02:27:33 -0400 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47F0210F; Wed, 10 May 2023 23:27:31 -0700 (PDT) Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-64384c6797eso6655908b3a.2; Wed, 10 May 2023 23:27:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683786451; x=1686378451; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=Wccq2cR0tl91tz/Xz/oRtoRCvVeKB1PntoUZvC+KoPo=; b=X/nJr+o62wE8h5IO6ySscvVRFTeLOXrjZ+GvnMkMet3bf3AQvsKLeZZizE8UZoHNxR f8OLSsbDXLcejOpnV6r2N7DL0A3RDpI0sKiNfwCg9ce2OxvAaJTuP+MvL75uBkRBIe9g tLKzz0HWVZGEmmJiGAV9+9g0Z7VzjM1rdnHGlX1tJMGaqZgDxfNfsSPYWjqbY17xNXh3 SEI12+/bIprRSGwQRghk08j0DcDsuDAp2d2NyIuuBr9mX1mzQPwl81DLStVCR4BdZgB1 ZYgabkfqBb6VzPdQdl1lY/3aMfkd73ff8JI1VZC+id5FeoCJaEqv7eDSqYb2cx1xEqa7 Dm/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683786451; x=1686378451; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Wccq2cR0tl91tz/Xz/oRtoRCvVeKB1PntoUZvC+KoPo=; b=gyc3C/V//QddVKYSbT/YuJ89VxPVFKYINuGJdqal9VVMUa2ztN1i7Mn+uGhMYFKKin d8qEULCeUEe2SdNw0sY/rM1Q3GxJTkqbTrsvIexSCgwMy2ij5bbYb3+SpSEG/WLquzqv tzygum1vCrQQUZqUFcDDPEAu74eziz0/UcoaG8i6uOwAtO9snDt4NWkUBL1MV1Y83oFy ueDaC++F0fO58mW/xrY4EUAjIaAOULHm5ppi+54j2i1AYG/IJhJfNTwecodD1ERgYgFB 6gRrihli4IPwQpxQUwbic8IuQ0TH83cwmyzMYEop9M465BmAq65xuKIpv9wnaTQGCVGF 2l5w== X-Gm-Message-State: AC+VfDy5TgeH3TfSMT9MwZRXKTkHRxChskOjxvcjCtSB7C6/sXOc0jne 5X0OJd0qalCPPqD9hCh3xN4= X-Received: by 2002:a17:902:ecc3:b0:1ab:528:5f85 with SMTP id a3-20020a170902ecc300b001ab05285f85mr26717839plh.59.1683786450600; Wed, 10 May 2023 23:27:30 -0700 (PDT) Received: from bangji.hsd1.ca.comcast.net ([2601:647:6700:7f00:c18c:3210:36c3:c88c]) by smtp.gmail.com with ESMTPSA id jj17-20020a170903049100b001ac2be2639asm4925683plb.223.2023.05.10.23.27.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 May 2023 23:27:30 -0700 (PDT) Sender: Namhyung Kim From: Namhyung Kim To: Arnaldo Carvalho de Melo , Jiri Olsa Cc: Ian Rogers , Adrian Hunter , Peter Zijlstra , Ingo Molnar , LKML , linux-perf-users@vger.kernel.org, Andi Kleen Subject: [PATCH 3/3] perf annotate browser: Add '<' and '>' keys for navigation Date: Wed, 10 May 2023 23:27:25 -0700 Message-ID: <20230511062725.514752-3-namhyung@kernel.org> X-Mailer: git-send-email 2.40.1.521.gf1e218fcd8-goog In-Reply-To: <20230511062725.514752-1-namhyung@kernel.org> References: <20230511062725.514752-1-namhyung@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765579951863117087?= X-GMAIL-MSGID: =?utf-8?q?1765579951863117087?= The hists__find_annotations() allow to move to next or previous symbols for annotation using the arrow keys. But TUI annotate_browser__run() uses the RIGHT key as ENTER to handle jump/call instructions. That makes the navigation to the next function impossible. I'd like to change it back to move the next symbol but I'm afraid if some users get confused. So I added a new pair of keys to handle that. Signed-off-by: Namhyung Kim Acked-by: Ian Rogers --- tools/perf/builtin-annotate.c | 4 +++- tools/perf/ui/browsers/annotate.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c index 63cdf6ea6f6d..425a7e2fd6fb 100644 --- a/tools/perf/builtin-annotate.c +++ b/tools/perf/builtin-annotate.c @@ -342,7 +342,7 @@ static void hists__find_annotations(struct hists *hists, notes = symbol__annotation(he->ms.sym); if (notes->src == NULL) { find_next: - if (key == K_LEFT) + if (key == K_LEFT || key == '<') nd = rb_prev(nd); else nd = rb_next(nd); @@ -378,9 +378,11 @@ static void hists__find_annotations(struct hists *hists, return; /* fall through */ case K_RIGHT: + case '>': next = rb_next(nd); break; case K_LEFT: + case '<': next = rb_prev(nd); break; default: diff --git a/tools/perf/ui/browsers/annotate.c b/tools/perf/ui/browsers/annotate.c index 12c3ce530e42..70bad42b807b 100644 --- a/tools/perf/ui/browsers/annotate.c +++ b/tools/perf/ui/browsers/annotate.c @@ -781,9 +781,9 @@ static int annotate_browser__run(struct annotate_browser *browser, ui_browser__help_window(&browser->b, "UP/DOWN/PGUP\n" "PGDN/SPACE Navigate\n" + " Move to prev/next symbol\n" "q/ESC/CTRL+C Exit\n\n" "ENTER Go to target\n" - "ESC Exit\n" "H Go to hottest instruction\n" "TAB/shift+TAB Cycle thru hottest instructions\n" "j Toggle showing jump to target arrows\n" @@ -913,6 +913,8 @@ static int annotate_browser__run(struct annotate_browser *browser, annotation__toggle_full_addr(notes, ms); continue; case K_LEFT: + case '<': + case '>': case K_ESC: case 'q': case CTRL('c'):