From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756077AbdLVCND (ORCPT ); Thu, 21 Dec 2017 21:13:03 -0500 Received: from mga09.intel.com ([134.134.136.24]:45276 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755153AbdLVCNB (ORCPT ); Thu, 21 Dec 2017 21:13:01 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,438,1508828400"; d="scan'208";a="3917047" Subject: Re: [PATCH] perf tool: Improve bash command line auto-complete for multiple events with comma To: Arnaldo Carvalho de Melo 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 References: <1513848370-8098-1-git-send-email-yao.jin@linux.intel.com> <20171221162632.GP21971@kernel.org> From: "Jin, Yao" Message-ID: <508e0577-d739-af00-7723-07d63365a12e@linux.intel.com> Date: Fri, 22 Dec 2017 10:12:58 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20171221162632.GP21971@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/22/2017 12:26 AM, Arnaldo Carvalho de Melo wrote: > 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 > > 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, > 0000-cover-letter.patch Kbuild > 0001-perf-tools-Use-shell-function-for-perl-cflags-retrie.patch Kconfig > > [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 > 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// > > [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 > Hi Arnaldo, Thanks so much for testing and merging this patch. Yes, it could have a further improvement. I will post a follow-up patch to fix this issue. Thanks Jin Yao