Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp3061351ybh; Sat, 25 Jul 2020 09:43:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2gRA8+AqH8yIwXIZ7svYeZzOhIjX44x3KTt4mbgXqA06fqwK0u2OernyThgYeZbzsYAlK X-Received: by 2002:a17:906:6bc9:: with SMTP id t9mr11729114ejs.372.1595695431250; Sat, 25 Jul 2020 09:43:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595695431; cv=none; d=google.com; s=arc-20160816; b=WjR7SonfaCHJ1W07i44JPQG5S4Yjjwa+F7PVte75y9BlnMqFE33UbDSyUcKPHRt1LY QpQQwH94PUdUtZg1mkUr3uyYOjJ/Hl85OiS/Ft/Z2/BoCWh53dd5RUYS7kA5YA/aQpcm /WcKdHPV3nIAos/8W3ekH+q+R6GNYGEPHhb3TrxzCHSmOwkEqreeKhTm2YFeTUw9cbkK lTeBpZT9tVV46DRhzyT0ZhdScnePp684asPmyBBAXW8y9NmOmF/6AzskYYjJ4t4s98kq gsv14pw2qUhpKEs6CSE0rMCVq9fc8h/+b2809++EsTN/Aayr3Ct4EaMjaaoXfFpFljvZ gW1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=RiXVo3AMimnhVv7/19uNQl81O8qD2MfnX5iUSVdBFlI=; b=EwUMj/4mQ2udHKrYUYGutCgAZ7u/nNyOdaVH0Di+vonWN2t2wfyahMU8PIn/Ty4KJ0 qAUQdY+REBGhhQeEzhJun0BAuJ6D3ZhlOmddP0xgV63qH5VSIyKdGTDf+QLeUrA5ciyr OD2542H52uaVymqBKKDYWsCtJvesNrf2Mi+Tbn9b3asZBK9AAKbMDZ5p4lgr3qXUAmxu QlIMOlFKerUMXRChgZJDWYVAhVKWxdJj0wG5nMT6xq5scUTuH3bTGrEHrG6iO0WsW8eq 7f/ax8np3bfZvRsSY+632AScHJ9Ftg7yhmX0Iy/GxYoI81n2oPjrYRozWKcl7Ll6HXtQ igTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=nKIgy4ti; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u16si2812272eje.469.2020.07.25.09.43.27; Sat, 25 Jul 2020 09:43:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=nKIgy4ti; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727828AbgGYQlM (ORCPT + 99 others); Sat, 25 Jul 2020 12:41:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726567AbgGYQlK (ORCPT ); Sat, 25 Jul 2020 12:41:10 -0400 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04EFDC08C5C0 for ; Sat, 25 Jul 2020 09:41:10 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id f7so10974552wrw.1 for ; Sat, 25 Jul 2020 09:41:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RiXVo3AMimnhVv7/19uNQl81O8qD2MfnX5iUSVdBFlI=; b=nKIgy4ti9DcsBsbxwF/WwMoQFRPUN5l9UJK7/4VGP9Me5METBwGWRl42iztnpN3KYj 8oy+fAJeKiw8lYjz1KdjzrSs/8Th0lRTBIL/xEK5PW+MY6Jj1ampISpFR769hVXRGXIV XxmMlehAbTVvRbBvwo5EfEZ+4sSAkUISnzR4WrXjbRbQ25iix02M+A9q+JtX/MpMOANl /wb43/0Ym+Hc8TKhy6QwGd6HLYe39VRUALPsZqXS8RYlWrW5lvzPO29ywJvl0GyiTKoO QajrZkBnao8VlQL/eUmzSg4XQyT1VnQQqw52sdELspnqCGFUH1cgq8TvTf6rVHlz62gz JTbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RiXVo3AMimnhVv7/19uNQl81O8qD2MfnX5iUSVdBFlI=; b=JxnPQZZay6y2YvjQWt5pPdzR6PxXyY8INJaW6FU/FCohGVwgYXDn+l6qScYX4o/g9T IFUUIOwHM40ZT3u82fGlRyBznHKekE5Lh9GcRhp6uA6SRCqtHWTEdGYdwHwuEFZdmAct JgYT/0Z91/wyXy8LoDni4EJGek9uQak1T1r4nChbg8wwmjbnPOUt50oR96YWsWtesTE0 l+bqvm/K3ur1ne1HkMt6edHk7zBCG5LHN2Ac1vl6PutUiezK5XWw8snM1MgVSYkbC5ep QA+rq6s3CfTZ658rZCYdeV1Mjr+/UQ5h1bo71gHVtGTXgK/jB4TbCiugoFhjd6QLULrb llCA== X-Gm-Message-State: AOAM532RfnQ+NKxoipUaJBtu9B6DEyG4a1Z6EAhv/3/SvTkaMD3oSfPA UCPwQ1Jtf8saKR3Gpspzr0QP9SETLop4DRJc0FKUpw== X-Received: by 2002:adf:edd0:: with SMTP id v16mr14345300wro.271.1595695266958; Sat, 25 Jul 2020 09:41:06 -0700 (PDT) MIME-Version: 1.0 References: <20200725121959.1181869-1-jolsa@kernel.org> In-Reply-To: <20200725121959.1181869-1-jolsa@kernel.org> From: Ian Rogers Date: Sat, 25 Jul 2020 09:40:55 -0700 Message-ID: Subject: Re: [PATCH 1/2] perf tools: Allow r0x event syntax To: Jiri Olsa Cc: Arnaldo Carvalho de Melo , Jin Yao , lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Michael Petlan , Stephane Eranian , Andi Kleen , Thomas Richter Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jul 25, 2020 at 5:20 AM Jiri Olsa wrote: > > Adding support to specify raw event with 'r0' syntax within > pmu term syntax like: > > -e cpu/r0xdead/ > > It will be used to specify raw events in cases where they conflict > with real pmu terms, like 'read', which is valid raw event syntax, > but also a possible pmu term name as reported by Jin Yao. > > Reported-by: Jin Yao > Signed-off-by: Jiri Olsa Acked-by: Ian Rogers > --- > tools/perf/Documentation/perf-list.txt | 1 + > tools/perf/tests/parse-events.c | 5 +++++ > tools/perf/util/parse-events.l | 1 + > 3 files changed, 7 insertions(+) > > diff --git a/tools/perf/Documentation/perf-list.txt b/tools/perf/Documentation/perf-list.txt > index 376a50b3452d..10ed539a8859 100644 > --- a/tools/perf/Documentation/perf-list.txt > +++ b/tools/perf/Documentation/perf-list.txt > @@ -119,6 +119,7 @@ It's also possible to use pmu syntax: > > perf record -e r1a8 -a sleep 1 > perf record -e cpu/r1a8/ ... > + perf record -e cpu/r0x1a8/ ... > > You should refer to the processor specific documentation for getting these > details. Some of them are referenced in the SEE ALSO section below. > diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c > index 895188b63f96..5aaddcb0058a 100644 > --- a/tools/perf/tests/parse-events.c > +++ b/tools/perf/tests/parse-events.c > @@ -1766,6 +1766,11 @@ static struct evlist_test test__events_pmu[] = { > .check = test__checkevent_raw_pmu, > .id = 4, > }, > + { > + .name = "software/r0x1a/", > + .check = test__checkevent_raw_pmu, > + .id = 4, > + }, > }; > > struct terms_test { > diff --git a/tools/perf/util/parse-events.l b/tools/perf/util/parse-events.l > index 56912c9641f5..44c85fea5d00 100644 > --- a/tools/perf/util/parse-events.l > +++ b/tools/perf/util/parse-events.l > @@ -293,6 +293,7 @@ percore { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_PERCORE); } > aux-output { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_AUX_OUTPUT); } > aux-sample-size { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_AUX_SAMPLE_SIZE); } > r{num_raw_hex} { return raw(yyscanner); } > +r0x{num_raw_hex} { return raw(yyscanner); } > , { return ','; } > "/" { BEGIN(INITIAL); return '/'; } > {name_minus} { return str(yyscanner, PE_NAME); } > -- > 2.25.4 >