linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf tool: Auto-complete for the event with ':'
@ 2017-12-22 20:15 Jin Yao
  2017-12-22 13:15 ` Arnaldo Carvalho de Melo
  2017-12-28 15:36 ` [tip:perf/core] perf tools: Auto-complete for events " tip-bot for Jin Yao
  0 siblings, 2 replies; 3+ messages in thread
From: Jin Yao @ 2017-12-22 20:15 UTC (permalink / raw)
  To: acme, jolsa, peterz, mingo, alexander.shishkin
  Cc: Linux-kernel, ak, kan.liang, yao.jin, Jin Yao

It's a follow up patch for a previous patch "perf tool: Return all
events as auto-completions after comma".

Sorry about that, I should send these 2 patches in a patch-set.

With this patch, the auto-completion can work well for the event
with ':'. 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>
---
 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
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-12-28 15:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-22 20:15 [PATCH] perf tool: Auto-complete for the event with ':' Jin Yao
2017-12-22 13:15 ` Arnaldo Carvalho de Melo
2017-12-28 15:36 ` [tip:perf/core] perf tools: Auto-complete for events " tip-bot for Jin Yao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).