Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933500AbbLONSj (ORCPT ); Tue, 15 Dec 2015 08:18:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52352 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933262AbbLONSi (ORCPT ); Tue, 15 Dec 2015 08:18:38 -0500 Date: Tue, 15 Dec 2015 14:18:34 +0100 From: Jiri Olsa To: Wang Nan Cc: acme@kernel.org, masami.hiramatsu.pt@hitachi.com, jolsa@kernel.org, linux-kernel@vger.kernel.org, pi3orama@163.com, lizefan@huawei.com, He Kuang , Alexei Starovoitov , Arnaldo Carvalho de Melo , Namhyung Kim Subject: Re: [PATCH v5 08/14] perf tools: Support perf event alias name Message-ID: <20151215131834.GB31734@krava.brq.redhat.com> References: <1450089563-122430-1-git-send-email-wangnan0@huawei.com> <1450089563-122430-9-git-send-email-wangnan0@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1450089563-122430-9-git-send-email-wangnan0@huawei.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2002 Lines: 55 On Mon, Dec 14, 2015 at 10:39:17AM +0000, Wang Nan wrote: > From: He Kuang > > This patch is useful when trying to pass a perf event to BPF map. > Before this patch we are unable to pass an event with config term to > BPF maps. For example: > > # perf record -a -e cycles/no-inherit,period=0x7fffffffffffffff/ \ > -e './test_bpf_map_2.c/maps:pmu_map.event=cycles/no-inherit,period=0x7fffffffffffffff//' ls / > event syntax error: '..ps:pmu_map.event=cycles/' > \___ Event not found for map setting > > Because those '/' and ',' embarrass parser. we already have 'name=' term, but it's only for pmu events, so I think your solution is better > > This patch adds new bison rules for specifying an alias name to a perf > event, which allows cmdline refer to previous defined perf event through > its name. With this patch user can give alias name to a perf event using > following cmdline. The above goal can be achieved using: > > # perf record -a -e cyc=cycles/no-inherit,period=0x7fffffffffffffff/ \ > -e './test_bpf_map_2.c/maps:pmu_map.event=cyc/' ls / > so this alias should only help as a quick pointer to setup the record session, right? I'm not sure we want to see it as a part of name being stored to perf.data and displayed by perf report and stat $ ./perf stat -e cyc=cycles ls Performance counter stats for 'ls': 2,638,646 cyc=cycles 0.001111614 seconds time elapsed but I guess when you probably have a reason to use that you want to see it in your report.. just a thought ;-) anyway acking the change Acked-by: Jiri Olsa thanks, jirka -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/