All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Jin Yao <yao.jin@linux.intel.com>
Cc: jolsa@kernel.org, peterz@infradead.org, mingo@redhat.com,
	alexander.shishkin@linux.intel.com, Linux-kernel@vger.kernel.org,
	ak@linux.intel.com, kan.liang@intel.com, yao.jin@intel.com
Subject: Re: [PATCH] perf tool: Improve bash command line auto-complete for multiple events with comma
Date: Thu, 21 Dec 2017 13:26:33 -0300	[thread overview]
Message-ID: <20171221162632.GP21971@kernel.org> (raw)
In-Reply-To: <1513848370-8098-1-git-send-email-yao.jin@linux.intel.com>

Em Thu, Dec 21, 2017 at 05:26:10PM +0800, Jin Yao escreveu:
> perf has perf-completion.sh to define command line auto-completion in
> bash/zsh.
> 
> For record/stat -e it works for single events, but not working when
> specifying multiple events with comma.

I'm testing this, and found one issue, that can be fixed in a followup
patch, I think:

If I do:

	perf stat -e <TAB>

Then it will get all events and offer them as completions:

[acme@jouet perf]$ perf stat -e 
Display all 1523 possibilities? (y or n)

Which is around what:

[acme@jouet perf]$ perf list --raw-dump | wc -w
1509
[acme@jouet perf]$

gives.

Ok, so if I say yes all will be presented, and the pager will be used,
etc. then I can press 'q' as soon as I find the one I want and continue
from there (the pager doesn't allow searching with '/', would be nice).

then, the behaviour changes after I add a comma:

[acme@jouet perf]$ perf stat -e cycles,<TAB>
0000-cover-letter.patch                                          Kbuild
0001-perf-tools-Use-shell-function-for-perl-cflags-retrie.patch  Kconfig
<SNIP>
[acme@jouet perf]$ perf stat -e cycles

I.e. after the comma it tries autocompletion with files in the local
directory, not with the list of all events.

Only if I have some character right after the comma is that it will look
for events and not files in the local directory:

ipc/                                                             
[acme@jouet perf]$ perf stat -e cycles,i<TAB>
icache.hit                                         idq_uops_not_delivered.cycles_le_3_uop_deliv.core
icache.ifdata_stall                                ild_stall.lcp
icache.misses                                      inst_retired.any
idq.all_dsb_cycles_4_uops                          inst_retired.any_p
idq.all_dsb_cycles_any_uops                        inst_retired.prec_dist
idq.all_mite_cycles_4_uops                         inst_retired.x87
idq.all_mite_cycles_any_uops                       instructions
idq.dsb_cycles                                     intel_bts//
idq.dsb_uops                                       intel_pt//
<SNIP>
[acme@jouet perf]$ perf stat -e cycles,i

Would be nice to have the same behaviour right after the comma as when
right after -e.

I'm doing a few more tests but I think this can be merged as-is and the
above be just a suggestion for improvement.

Thanks,

- Arnaldo

  reply	other threads:[~2017-12-21 16:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-21  9:26 [PATCH] perf tool: Improve bash command line auto-complete for multiple events with comma Jin Yao
2017-12-21 16:26 ` Arnaldo Carvalho de Melo [this message]
2017-12-22  2:12   ` Jin, Yao
2017-12-28 15:36 ` [tip:perf/core] " tip-bot for Jin Yao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171221162632.GP21971@kernel.org \
    --to=acme@kernel.org \
    --cc=Linux-kernel@vger.kernel.org \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@intel.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=yao.jin@intel.com \
    --cc=yao.jin@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.