Message ID | 20230511062725.514752-3-namhyung@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> 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 <rfc822;peekingduck44@gmail.com> + 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <namhyung@gmail.com> From: Namhyung Kim <namhyung@kernel.org> To: Arnaldo Carvalho de Melo <acme@kernel.org>, Jiri Olsa <jolsa@kernel.org> Cc: Ian Rogers <irogers@google.com>, Adrian Hunter <adrian.hunter@intel.com>, Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@kernel.org>, LKML <linux-kernel@vger.kernel.org>, linux-perf-users@vger.kernel.org, Andi Kleen <ak@linux.intel.com> 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 Content-Transfer-Encoding: 8bit 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: <linux-kernel.vger.kernel.org> 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?= |
Series |
[1/3] perf annotate: Handle more instructions on x86
|
|
Commit Message
Namhyung Kim
May 11, 2023, 6:27 a.m. UTC
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 <namhyung@kernel.org>
---
tools/perf/builtin-annotate.c | 4 +++-
tools/perf/ui/browsers/annotate.c | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
Comments
On Wed, May 10, 2023 at 11:27 PM Namhyung Kim <namhyung@kernel.org> wrote: > > 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 <namhyung@kernel.org> Acked-by: Ian Rogers <irogers@google.com> Thanks, Ian > --- > 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'): > -- > 2.40.1.521.gf1e218fcd8-goog >
Em Mon, May 15, 2023 at 10:09:08AM -0700, Ian Rogers escreveu: > On Wed, May 10, 2023 at 11:27 PM Namhyung Kim <namhyung@kernel.org> wrote: > > > > 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 <namhyung@kernel.org> > > Acked-by: Ian Rogers <irogers@google.com> > > Thanks, > Ian > > > --- > > 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" I think the two above were unintentional? I'm removing this hunk. - Arnaldo > > "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'): > > -- > > 2.40.1.521.gf1e218fcd8-goog > >
Em Mon, May 15, 2023 at 05:54:19PM -0300, Arnaldo Carvalho de Melo escreveu: > Em Mon, May 15, 2023 at 10:09:08AM -0700, Ian Rogers escreveu: > > On Wed, May 10, 2023 at 11:27 PM Namhyung Kim <namhyung@kernel.org> wrote: > > > > > > 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 <namhyung@kernel.org> > > > > Acked-by: Ian Rogers <irogers@google.com> > > > > Thanks, > > Ian > > > > > --- > > > 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" > > I think the two above were unintentional? I'm removing this hunk. Humm I see, its a dup, will keep it. - Arnaldo
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'):