From patchwork Fri Feb 17 22:32:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 58791 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp105688wrn; Fri, 17 Feb 2023 14:50:23 -0800 (PST) X-Google-Smtp-Source: AK7set8M3ymog3KrPDss51wbvgXIG0/q7Q9g4GexZMkY0ZMLdDUoPvimunrJx2+cOqArbAVPwicr X-Received: by 2002:a17:902:d512:b0:198:b945:4108 with SMTP id b18-20020a170902d51200b00198b9454108mr1700248plg.0.1676674223588; Fri, 17 Feb 2023 14:50:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676674223; cv=none; d=google.com; s=arc-20160816; b=URvJkSejRU7bDxsG6Wjmp5bDl25biCc6R4JQFbNOIqCRvRfqVFQI4FdvS2Q2OI/8xP 2NKUGFhzY1apmG0yToXGZKmu1Hpx4MT+i0DwMQhzDmotA0GONhmn8uuaXiEKdqCL4/oK 3zEvQHjKnq+L14aM7L2Rnp1WFGscUzYOv/ZzKQat7sKQYRAdpTwiUdm4dzz6ujccI/Ls ltdpaGvYJ+WMA36KC3yPDpihimADmyrL4d+Z8cvgsjwgD+n8/VNMbgrkxZstLslzcUnS s7OdJAilK+ERMrC9tblfOczYmCMqx4wIAccK2A10Vc6KbXIsM790FyT6i2YyajNTzr2h Ii9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from; bh=SbC3ABHgFRUeSPinI56x4NwNJDxlP/+l8DvbcCpDuKU=; b=ulocM29s2DvMQzIr//REH3AhN0VENkbqCFnr8BQKHokGpnAgh3MMjET5jQ93xJKyUp BbgmaRzLO9C6mRdUvRq71Al5N36wR74gIP/sxa2H2zFcBx6i7rYikQjbJimiyMpUu7TA ydBkCMoRbWT45uN1RQ/vXZ6yeoy17ooXFTOnujd65KQDN3PV9w8OqMYXlxiAtgBToihX MCucDtOKT51cAzYUCCRAiSD/QXDYAN3ijoVKu1RKlYLM5QrqoGdfOtcOiXlNQW7ryuEF wjFnCS4JfWuswbRGlcVHrlAcTkyk7tCU6p4Veo6SgamiYoVrIfqDq3yNMejOeFtosoXd AjJg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f12-20020a170902ce8c00b0019912996c0bsi1086964plg.569.2023.02.17.14.50.10; Fri, 17 Feb 2023 14:50:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229881AbjBQWcp (ORCPT + 99 others); Fri, 17 Feb 2023 17:32:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229851AbjBQWcn (ORCPT ); Fri, 17 Feb 2023 17:32:43 -0500 Received: from mail-ot1-f43.google.com (mail-ot1-f43.google.com [209.85.210.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57C065FC40; Fri, 17 Feb 2023 14:32:41 -0800 (PST) Received: by mail-ot1-f43.google.com with SMTP id f97-20020a9d2c6a000000b00690ee4a5febso544632otb.0; Fri, 17 Feb 2023 14:32:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SbC3ABHgFRUeSPinI56x4NwNJDxlP/+l8DvbcCpDuKU=; b=OOEdEd19z0jXI4jyYEBFjxlfoIyBQnlQNyDd9MSr8ASJpAmOFHFCn/fxSZPKHq3fAQ QF/Oexuvmtbr+b+Re1o7FMXS2pUvwuNcnc6IcGDmRce67ZdNVpKOHinCyTfvQ0yoWHHD JLwuTRoBe0NgEBAjQXcrKriLTAUEPT2Y6le1ZdaQMF1NRGddJ5A06lBOPZ9rLheid+On YvbGRLefzZp2l4e25hHmWDcylcZ5E2kt/lXeuTAt18odeSBcoTGt7k1QQn5E/H4PWzH1 9s5UfnovR1toL/gm6YEdh5+QU4r60M7yjrPBNHHXVjsIw2deHGCD4TK9wNSJ1U0IyANm gGQA== X-Gm-Message-State: AO0yUKWo1I45js8P3+cb/xpUpNgFJy2wbhqQs5g8fQS1Bx2N7UnwNhrc F+kxbVk1AwjTDikU/AJYwrq8iNAvZw== X-Received: by 2002:a9d:7005:0:b0:68b:b06a:5b8b with SMTP id k5-20020a9d7005000000b0068bb06a5b8bmr677081otj.0.1676673160522; Fri, 17 Feb 2023 14:32:40 -0800 (PST) Received: from robh_at_kernel.org (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id t4-20020a9d5904000000b0068d01839027sm2354861oth.30.2023.02.17.14.32.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Feb 2023 14:32:40 -0800 (PST) Received: (nullmailer pid 1684708 invoked by uid 1000); Fri, 17 Feb 2023 22:32:38 -0000 From: Rob Herring Date: Fri, 17 Feb 2023 16:32:10 -0600 Subject: [PATCH v5 1/2] perf tools: Sync perf_event_attr::config3 addition MIME-Version: 1.0 Message-Id: <20220914-arm-perf-tool-spe1-2-v2-v5-1-2cf5210b2f77@kernel.org> References: <20220914-arm-perf-tool-spe1-2-v2-v5-0-2cf5210b2f77@kernel.org> In-Reply-To: <20220914-arm-perf-tool-spe1-2-v2-v5-0-2cf5210b2f77@kernel.org> To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim Cc: Leo Yan , James Clark , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org X-Mailer: b4 0.13-dev X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758120350417712551?= X-GMAIL-MSGID: =?utf-8?q?1758120350417712551?= Arm SPEv1.2 adds another 64-bits of event filtering control. As the existing perf_event_attr::configN fields are all used up for SPE PMU, an additional field is needed. Add a new 'config3' field. Signed-off-by: Rob Herring Reviewed-by: Kajol Jain --- This matches commit 09519ec3b19e ("perf: Add perf_event_attr::config3") for the kernel queued in linux-next. --- tools/include/uapi/linux/perf_event.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/include/uapi/linux/perf_event.h b/tools/include/uapi/linux/perf_event.h index ea6defacc1a7..a38814ce9485 100644 --- a/tools/include/uapi/linux/perf_event.h +++ b/tools/include/uapi/linux/perf_event.h @@ -365,6 +365,7 @@ enum perf_event_read_format { #define PERF_ATTR_SIZE_VER5 112 /* add: aux_watermark */ #define PERF_ATTR_SIZE_VER6 120 /* add: aux_sample_size */ #define PERF_ATTR_SIZE_VER7 128 /* add: sig_data */ +#define PERF_ATTR_SIZE_VER8 136 /* add: config3 */ /* * Hardware event_id to monitor via a performance monitoring event: @@ -506,6 +507,8 @@ struct perf_event_attr { * truncated accordingly on 32 bit architectures. */ __u64 sig_data; + + __u64 config3; /* extension of config2 */ }; /* From patchwork Fri Feb 17 22:32:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 58789 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp105206wrn; Fri, 17 Feb 2023 14:48:56 -0800 (PST) X-Google-Smtp-Source: AK7set8jwMgIiz7C0RJWtRw0F9nlHoIIfpHdb7QmLrgMnI2JSvR9CSoiU804wsEv8FrbVUmg4fon X-Received: by 2002:a05:6402:60d:b0:4ad:7c30:25a3 with SMTP id n13-20020a056402060d00b004ad7c3025a3mr4526732edv.1.1676674136466; Fri, 17 Feb 2023 14:48:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676674136; cv=none; d=google.com; s=arc-20160816; b=rrF1wkQOV/XWjNsrCfXzDNkDN997acZ0g6G1FIR/ZPIavH0W5ZZwJttt3rAuMnsM4N CDM2dDokkLmpnNLByZKUM0L1W6ZQ1JTY/RI63ZcVpBwf2rmC+tSmIuijV+briVfU0QIP pRYSTVeYdTQYbb6L4VIse6O80H0TmmHH5fd6nwP6mNiGn7lasDSDHV2e0w8HA3Q23JQg aCOxBw2/F5B0pkc5cDLCHq9jG3OYSeOwM/ZY/APYk3fy9CGxcbH1iZSbc+2IaAmCsHPU GXiZ0zQyoxxLx5/IDraNzqKZ15iao2TR8a0RoLJuSdasJ67ncfHVAxg9h1Z9QBcH2+ks WtMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from; bh=Wv3uMFhrX0zu65zR8xr/Styloh6XLaktubY3Ad8zIsg=; b=a/i7bR4SYrw7/Zmp+JKT/C4eq0MK1ABRnHtT7am2XsEtIe0cAP4LXJcDl4jUnvqVqG jsyhvjlO3XiOB6K1A2fdP2ANvQDpWtxVlz9zW4490lv+r8g3dJ5wpDRH9+XJqu3KqmS1 aETHQwlanVosOVXSnkVVmIY1tAKoy4aEDkI8RZ2jpaPhA4Q7eD/Ruwu9+U+1x90InTla DDC55hI/EkUauE6iXVa47EtGjD08V98cIDd72EROLuvrPMR1XoUFeOp5YRqHoav8ZjcO orOsyqnT34KCvQA7nIObr/R1dl3Ys3F8jfdPgqjCJPzSGWmHZzNke5tFER6VDhGpMfme 9Cqw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s4-20020a056402164400b004acdca46ec2si6041407edx.440.2023.02.17.14.48.32; Fri, 17 Feb 2023 14:48:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229851AbjBQWcs (ORCPT + 99 others); Fri, 17 Feb 2023 17:32:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229873AbjBQWco (ORCPT ); Fri, 17 Feb 2023 17:32:44 -0500 Received: from mail-oa1-f46.google.com (mail-oa1-f46.google.com [209.85.160.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CF4C5F83D; Fri, 17 Feb 2023 14:32:42 -0800 (PST) Received: by mail-oa1-f46.google.com with SMTP id 586e51a60fabf-17172b43531so2923308fac.1; Fri, 17 Feb 2023 14:32:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Wv3uMFhrX0zu65zR8xr/Styloh6XLaktubY3Ad8zIsg=; b=y/dbRxG5648LIRZht1dH8wJzbypv8PGRVh6AtNhJzMmy+AjExNkocBAYLLXuAbYEFZ 5WRqYQe/B9D7v3eZiOunrEkxGDQbmYH+Bf5shv49mG0vHlIXXZfisZsez4AXt2ZV9Vlr L/mLnneksZQscsLK36QTirsIKjawUQ1G4MpqI9ZMj2Ia52+OWIKGCgof4uNK0pM4fkwm /nqSwYI/hc2gnNhSDqLS8u9ljLsJWRL1Fhb31Pm53ohVAdJjEG6fmHCMzq8MW49DYOKg tqd06lxbM0qXxJDKxy57vhEPS0qZwZT6XH3eceDCIGyAVsM/mfokQAGnQ/nhC1rKqzn8 C7IQ== X-Gm-Message-State: AO0yUKVr6k/XXv9tTjFVT7+A81trcbr2iojuNLD+AMsQ7wd1tDZkO3Z4 MjhMyFxTb9N0Vdd7G+ZZ9m5LcxbFwA== X-Received: by 2002:a05:6870:a414:b0:16e:3b9e:b75b with SMTP id m20-20020a056870a41400b0016e3b9eb75bmr1549538oal.8.1676673161847; Fri, 17 Feb 2023 14:32:41 -0800 (PST) Received: from robh_at_kernel.org (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id ef5-20020a0568701a8500b00152c52608dbsm1223926oab.34.2023.02.17.14.32.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Feb 2023 14:32:41 -0800 (PST) Received: (nullmailer pid 1684710 invoked by uid 1000); Fri, 17 Feb 2023 22:32:38 -0000 From: Rob Herring Date: Fri, 17 Feb 2023 16:32:11 -0600 Subject: [PATCH v5 2/2] perf: Add support for perf_event_attr::config3 MIME-Version: 1.0 Message-Id: <20220914-arm-perf-tool-spe1-2-v2-v5-2-2cf5210b2f77@kernel.org> References: <20220914-arm-perf-tool-spe1-2-v2-v5-0-2cf5210b2f77@kernel.org> In-Reply-To: <20220914-arm-perf-tool-spe1-2-v2-v5-0-2cf5210b2f77@kernel.org> To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim Cc: Leo Yan , James Clark , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org X-Mailer: b4 0.13-dev X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758120259357231771?= X-GMAIL-MSGID: =?utf-8?q?1758120259357231771?= perf_event_attr has gained a new field, config3, so add support for it extending the existing configN support. Signed-off-by: Rob Herring --- v5: - Rebase on v6.2-rc1 v4: - Add config3 to event parsing tests --- tools/perf/tests/parse-events.c | 13 ++++++++++++- tools/perf/util/parse-events.c | 6 ++++++ tools/perf/util/parse-events.h | 1 + tools/perf/util/parse-events.l | 1 + tools/perf/util/pmu.c | 3 +++ tools/perf/util/pmu.h | 1 + 6 files changed, 24 insertions(+), 1 deletion(-) diff --git a/tools/perf/tests/parse-events.c b/tools/perf/tests/parse-events.c index 459afdb256a1..ddd5bdfe5723 100644 --- a/tools/perf/tests/parse-events.c +++ b/tools/perf/tests/parse-events.c @@ -444,6 +444,7 @@ static int test__checkevent_pmu(struct evlist *evlist) TEST_ASSERT_VAL("wrong config", 10 == evsel->core.attr.config); TEST_ASSERT_VAL("wrong config1", 1 == evsel->core.attr.config1); TEST_ASSERT_VAL("wrong config2", 3 == evsel->core.attr.config2); + TEST_ASSERT_VAL("wrong config3", 0 == evsel->core.attr.config3); /* * The period value gets configured within evlist__config, * while this test executes only parse events method. @@ -464,6 +465,7 @@ static int test__checkevent_list(struct evlist *evlist) TEST_ASSERT_VAL("wrong config", 1 == evsel->core.attr.config); TEST_ASSERT_VAL("wrong config1", 0 == evsel->core.attr.config1); TEST_ASSERT_VAL("wrong config2", 0 == evsel->core.attr.config2); + TEST_ASSERT_VAL("wrong config3", 0 == evsel->core.attr.config3); TEST_ASSERT_VAL("wrong exclude_user", !evsel->core.attr.exclude_user); TEST_ASSERT_VAL("wrong exclude_kernel", !evsel->core.attr.exclude_kernel); TEST_ASSERT_VAL("wrong exclude_hv", !evsel->core.attr.exclude_hv); @@ -625,6 +627,15 @@ static int test__checkterms_simple(struct list_head *terms) TEST_ASSERT_VAL("wrong val", term->val.num == 3); TEST_ASSERT_VAL("wrong config", !strcmp(term->config, "config2")); + /* config3=4 */ + term = list_entry(term->list.next, struct parse_events_term, list); + TEST_ASSERT_VAL("wrong type term", + term->type_term == PARSE_EVENTS__TERM_TYPE_CONFIG3); + TEST_ASSERT_VAL("wrong type val", + term->type_val == PARSE_EVENTS__TERM_TYPE_NUM); + TEST_ASSERT_VAL("wrong val", term->val.num == 4); + TEST_ASSERT_VAL("wrong config", !strcmp(term->config, "config3")); + /* umask=1*/ term = list_entry(term->list.next, struct parse_events_term, list); TEST_ASSERT_VAL("wrong type term", @@ -1983,7 +1994,7 @@ struct terms_test { static const struct terms_test test__terms[] = { [0] = { - .str = "config=10,config1,config2=3,umask=1,read,r0xead", + .str = "config=10,config1,config2=3,config3=4,umask=1,read,r0xead", .check = test__checkterms_simple, }, }; diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 5973f46c2375..a2ae92736aac 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c @@ -944,6 +944,7 @@ static const char *config_term_names[__PARSE_EVENTS__TERM_TYPE_NR] = { [PARSE_EVENTS__TERM_TYPE_CONFIG] = "config", [PARSE_EVENTS__TERM_TYPE_CONFIG1] = "config1", [PARSE_EVENTS__TERM_TYPE_CONFIG2] = "config2", + [PARSE_EVENTS__TERM_TYPE_CONFIG3] = "config3", [PARSE_EVENTS__TERM_TYPE_NAME] = "name", [PARSE_EVENTS__TERM_TYPE_SAMPLE_PERIOD] = "period", [PARSE_EVENTS__TERM_TYPE_SAMPLE_FREQ] = "freq", @@ -983,6 +984,7 @@ config_term_avail(int term_type, struct parse_events_error *err) case PARSE_EVENTS__TERM_TYPE_CONFIG: case PARSE_EVENTS__TERM_TYPE_CONFIG1: case PARSE_EVENTS__TERM_TYPE_CONFIG2: + case PARSE_EVENTS__TERM_TYPE_CONFIG3: case PARSE_EVENTS__TERM_TYPE_NAME: case PARSE_EVENTS__TERM_TYPE_METRIC_ID: case PARSE_EVENTS__TERM_TYPE_SAMPLE_PERIOD: @@ -1028,6 +1030,10 @@ do { \ CHECK_TYPE_VAL(NUM); attr->config2 = term->val.num; break; + case PARSE_EVENTS__TERM_TYPE_CONFIG3: + CHECK_TYPE_VAL(NUM); + attr->config3 = term->val.num; + break; case PARSE_EVENTS__TERM_TYPE_SAMPLE_PERIOD: CHECK_TYPE_VAL(NUM); break; diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h index 07df7bb7b042..34db4870a56b 100644 --- a/tools/perf/util/parse-events.h +++ b/tools/perf/util/parse-events.h @@ -60,6 +60,7 @@ enum { PARSE_EVENTS__TERM_TYPE_CONFIG, PARSE_EVENTS__TERM_TYPE_CONFIG1, PARSE_EVENTS__TERM_TYPE_CONFIG2, + PARSE_EVENTS__TERM_TYPE_CONFIG3, PARSE_EVENTS__TERM_TYPE_NAME, PARSE_EVENTS__TERM_TYPE_SAMPLE_PERIOD, PARSE_EVENTS__TERM_TYPE_SAMPLE_FREQ, diff --git a/tools/perf/util/parse-events.l b/tools/perf/util/parse-events.l index 3a9ce96c8bce..51fe0a9fb3de 100644 --- a/tools/perf/util/parse-events.l +++ b/tools/perf/util/parse-events.l @@ -285,6 +285,7 @@ modifier_bp [rwx]{1,3} config { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_CONFIG); } config1 { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_CONFIG1); } config2 { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_CONFIG2); } +config3 { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_CONFIG3); } name { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_NAME); } period { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_SAMPLE_PERIOD); } freq { return term(yyscanner, PARSE_EVENTS__TERM_TYPE_SAMPLE_FREQ); } diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c index 03284059175f..2d9a0c35c6c3 100644 --- a/tools/perf/util/pmu.c +++ b/tools/perf/util/pmu.c @@ -1278,6 +1278,9 @@ static int pmu_config_term(const char *pmu_name, case PERF_PMU_FORMAT_VALUE_CONFIG2: vp = &attr->config2; break; + case PERF_PMU_FORMAT_VALUE_CONFIG3: + vp = &attr->config3; + break; default: return -EINVAL; } diff --git a/tools/perf/util/pmu.h b/tools/perf/util/pmu.h index 68e15c38ae71..2e6bd1bf304a 100644 --- a/tools/perf/util/pmu.h +++ b/tools/perf/util/pmu.h @@ -17,6 +17,7 @@ enum { PERF_PMU_FORMAT_VALUE_CONFIG, PERF_PMU_FORMAT_VALUE_CONFIG1, PERF_PMU_FORMAT_VALUE_CONFIG2, + PERF_PMU_FORMAT_VALUE_CONFIG3, PERF_PMU_FORMAT_VALUE_CONFIG_END, };