From: tip-bot for Jin Yao <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: yao.jin@linux.intel.com, peterz@infradead.org,
linux-kernel@vger.kernel.org, ak@linux.intel.com, hpa@zytor.com,
kan.liang@intel.com, jolsa@kernel.org, tglx@linutronix.de,
mingo@kernel.org, acme@redhat.com,
alexander.shishkin@linux.intel.com
Subject: [tip:perf/core] perf tools: Auto-complete for events with ':'
Date: Thu, 28 Dec 2017 07:36:57 -0800 [thread overview]
Message-ID: <tip-5d4fd9c8b83b36d34521b3af361a5726899045bf@git.kernel.org> (raw)
In-Reply-To: <1513973758-19109-1-git-send-email-yao.jin@linux.intel.com>
Commit-ID: 5d4fd9c8b83b36d34521b3af361a5726899045bf
Gitweb: https://git.kernel.org/tip/5d4fd9c8b83b36d34521b3af361a5726899045bf
Author: Jin Yao <yao.jin@linux.intel.com>
AuthorDate: Sat, 23 Dec 2017 04:15:58 +0800
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 27 Dec 2017 12:16:00 -0300
perf tools: Auto-complete for events with ':'
It's a follow up patch for a previous patch "perf tool: Return all
events as auto-completions after comma".
With this patch, auto-completion can work well for events with a ':'.
For example:
root@skl:/tmp# perf stat -e block:block_<TAB>
block:block_bio_backmerge block:block_rq_complete
block:block_bio_bounce block:block_rq_insert
block:block_bio_complete block:block_rq_issue
block:block_bio_frontmerge block:block_rq_remap
block:block_bio_queue block:block_rq_requeue
block:block_bio_remap block:block_sleeprq
block:block_dirty_buffer block:block_split
block:block_getrq block:block_touch_buffer
block:block_plug block:block_unplug
root@skl:/tmp# perf stat -e block:block_rq_<TAB>
block:block_rq_complete block:block_rq_issue block:block_rq_requeue
block:block_rq_insert block:block_rq_remap
root@skl:/tmp# perf stat -e block:block_rq_complete<TAB>
block:block_rq_complete
root@skl:/tmp# perf stat -e block:block_rq_complete
Signed-off-by: Jin Yao <yao.jin@linux.intel.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1513973758-19109-1-git-send-email-yao.jin@linux.intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/perf-completion.sh | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tools/perf/perf-completion.sh b/tools/perf/perf-completion.sh
index 9020641..fdf75d4 100644
--- a/tools/perf/perf-completion.sh
+++ b/tools/perf/perf-completion.sh
@@ -280,6 +280,11 @@ _perf()
export COMP_WORDBREAKS
fi
+ if [[ "$COMP_WORDBREAKS" == *:* ]]; then
+ COMP_WORDBREAKS="${COMP_WORDBREAKS/:/}"
+ export COMP_WORDBREAKS
+ fi
+
local cur words cword prev
if [ $preload_get_comp_words_by_ref = "true" ]; then
_get_comp_words_by_ref -n =:, cur words cword prev
prev parent reply other threads:[~2017-12-28 15:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-22 20:15 [PATCH] perf tool: Auto-complete for the event " Jin Yao
2017-12-22 13:15 ` Arnaldo Carvalho de Melo
2017-12-28 15:36 ` tip-bot for Jin Yao [this message]
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=tip-5d4fd9c8b83b36d34521b3af361a5726899045bf@git.kernel.org \
--to=tipbot@zytor.com \
--cc=acme@redhat.com \
--cc=ak@linux.intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome