Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754994AbcJETrT (ORCPT ); Wed, 5 Oct 2016 15:47:19 -0400 Received: from mga01.intel.com ([192.55.52.88]:57314 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754360AbcJETrQ (ORCPT ); Wed, 5 Oct 2016 15:47:16 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,302,1473145200"; d="scan'208";a="16653652" From: Andi Kleen To: acme@kernel.org Cc: sukadev@linux.vnet.ibm.com, jolsa@redhat.com, linux-kernel@vger.kernel.org, Andi Kleen Subject: [PATCH 2/3] perf, tools: Handle completion of upper case events Date: Wed, 5 Oct 2016 12:47:11 -0700 Message-Id: <1475696832-9188-3-git-send-email-andi@firstfloor.org> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1475696832-9188-1-git-send-email-andi@firstfloor.org> References: <1475696832-9188-1-git-send-email-andi@firstfloor.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 993 Lines: 30 From: Andi Kleen Vendor events are often specified in upper case. perf list outputs them in lower case. Handle this case in perf-completion.sh so that completion on the upper case events still works. Signed-off-by: Andi Kleen --- tools/perf/perf-completion.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/perf/perf-completion.sh b/tools/perf/perf-completion.sh index 3ba80b2359cc..48e7a01b5c91 100644 --- a/tools/perf/perf-completion.sh +++ b/tools/perf/perf-completion.sh @@ -161,7 +161,11 @@ __perf_main () # List possible events for -e option elif [[ $prev == @("-e"|"--event") && $prev_skip_opts == @(record|stat|top) ]]; then - evts=$($cmd list --raw-dump) + # handle upper case events + case "$cur" in + [A-Z]*) evts=$($cmd list --raw-dump | tr a-z A-Z) ;; + *) evts=$($cmd list --raw-dump) ;; + esac __perfcomp_colon "$evts" "$cur" else # List subcommands for perf commands -- 2.5.5