Received: by 10.213.65.68 with SMTP id h4csp2120859imn; Sun, 8 Apr 2018 20:13:10 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+0d39haepep7L/TbQVMp3tJvwFMnQ4gNBYmFKS+c3UdVAWNl04u4dfcWbxzDl6ZiausA8/ X-Received: by 10.167.129.10 with SMTP id b10mr10168570pfi.186.1523243590681; Sun, 08 Apr 2018 20:13:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243590; cv=none; d=google.com; s=arc-20160816; b=Rkzsw8sq5XANyzW953ClMbip3bhFtuQ3TBAYwl4pQHqaHDsjOc4CIHYXW+surSaGsa 2PacF4aMBa8YyZQOXMDxBmpefv8083nS4arbcWuzbXPNIj7WKFSQQjzFCkETuz3qy3Bz Bpzn6R5wKYK1jZr52HJLnUSxig//OTn7RnlW0Wa/tLq42+t7L8ehOUm1bfKHKJRKx3Uo Y4bFkRUf9jR/YDMWA9WBs39wHM8KDE9Z6SnA2SBbFSpFo2SC4A4rA3e4hgwMCkqwAT8T TKeUIkP+YWgzoo44JEla/4O2vqUOAZvz2lI7gHXothLceJfABuFWWPZ1sMOV3oji88wL s3Dw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=fGTiL8jciKAd5m6laOcfAG1nBmngSbu8HbHSA6WhUKY=; b=BBExARya8NLDG46Ll3pj3R3qAXjPbcgbEmq+99Kp3Q9wRE943dfV1QPbVkAuV4JaSO vbiJTmFMP2MB2hKM930USDoy73OqrlKmfjzFG9UCJwlkUm/Uh8efb0aqLUbmgABCinmN qHzsI2EHXRO72UvSjiIiBDyj2OVx0ET5DA4En9t3V/Nu3e+1Uqju/wCVSHPze3JtBAN4 9Vnah6eekpdN6WKdsQHyWVfg1Pzpu/MsstdqHzlXowb1ptXohRVW+1VFFjUnUUTXaY1y PXsAakFTQbtnd2Uz8LalNb9GNqlizJxNsJqZtYYe5derjc4JSS+K8MyTu3pT8+CRS9uo XGtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Iwn2iP3j; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w71si12028680pfd.273.2018.04.08.20.12.34; Sun, 08 Apr 2018 20:13:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Iwn2iP3j; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757881AbeDIC5j (ORCPT + 99 others); Sun, 8 Apr 2018 22:57:39 -0400 Received: from mail-bn3nam01on0139.outbound.protection.outlook.com ([104.47.33.139]:14848 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755216AbeDIAZj (ORCPT ); Sun, 8 Apr 2018 20:25:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=fGTiL8jciKAd5m6laOcfAG1nBmngSbu8HbHSA6WhUKY=; b=Iwn2iP3jhRLVPFiOIWt9A0PKU9JYyKdcD/iIXJS1Z2/Ysn/v8IuEYkhe33/+Ab/9rcYWbWiuC0DQJ7OuQS7Xwh4yQ4yc1Ru6lMnWxQ2Qgwsgum4IE0S+uOWxfZp8JyTjKMmnoYWyy68jCrIwVuyi056O9Nf7MVLHO4vBgNHh134= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1013.namprd21.prod.outlook.com (52.132.133.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:25:35 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:25:35 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Jiri Olsa , Alexander Shishkin , Andi Kleen , David Ahern , Namhyung Kim , Peter Zijlstra , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 127/161] perf evsel: Fix period/freq terms setup Thread-Topic: [PATCH AUTOSEL for 4.14 127/161] perf evsel: Fix period/freq terms setup Thread-Index: AQHTz5i56uE3/CxLJUSBgLCvTgx0Lg== Date: Mon, 9 Apr 2018 00:21:37 +0000 Message-ID: <20180409001936.162706-127-alexander.levin@microsoft.com> References: <20180409001936.162706-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001936.162706-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1013;7:1ur1rx4yGXMaUjzkRQ4wOuSAZUWFQWScB5e692whgjG5ZwSTHOSj4ojBDUsvaMzC10Ig/KwQhQYV7a8cJgp9KDt3EBH809vwTdzmrsJQCGN8ZwXFtfb8o91qWhJYhBxOv/tryLz/xRgHBBMMs7tqJpJDamywS7ygKDRkPxONchUOTrqFyFbxFqfWzlkYnSxRw+quALq/3SNzjWuzGu1R+66Gqba/7/2HVTA5z2HxkMVV3ljujVqXOjEr0riTgs/e;20:RUY9yFrElhgicGOoa1VAMOgmIOuzAblcJJ1mBlPv7hoHZeWi39sn5cZx0MB9vSVd/jS1dDyWKZIKwtGpqyqsf2weAeAuB0ppTRq7iLQtuhZxoRGuEoRXTPbh3O34XxgC9a/X+bxHFSXpItMtIxpSWU8TxdUDxGf4Amcsi0TIaGA= X-MS-Office365-Filtering-Correlation-Id: 6be7c5fa-c7b5-457d-b4b1-08d59db0695d x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(48565401081)(2017052603328)(7193020);SRVR:DM5PR2101MB1013; x-ms-traffictypediagnostic: DM5PR2101MB1013: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(85827821059158)(211936372134217)(42068640409301)(153496737603132)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(3231221)(944501327)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR2101MB1013;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1013; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(366004)(376002)(396003)(39860400002)(39380400002)(189003)(199004)(3280700002)(2616005)(8936002)(7736002)(476003)(446003)(11346002)(53936002)(3660700001)(86362001)(575784001)(86612001)(81156014)(2906002)(186003)(81166006)(105586002)(1076002)(8676002)(26005)(97736004)(25786009)(6306002)(6512007)(3846002)(68736007)(72206003)(106356001)(5660300001)(6486002)(6116002)(966005)(14454004)(4326008)(305945005)(6436002)(2501003)(5250100002)(10290500003)(478600001)(2900100001)(22452003)(110136005)(39060400002)(316002)(99286004)(66066001)(10090500001)(107886003)(76176011)(102836004)(54906003)(6506007)(36756003)(486006)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1013;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 05uU/SfCksLXLt6bzWFVjuJPLZ0x352p4x8xjYmPxDwecUrhsvQylUtPmPwOJr2Man3dE0b2Ro0IP1DIdBxqpIrObzYj2q2iQ997aOrrNmT5qboppFGPY18/OrvqGsMq4VATptGkh7sJfvhWO45y/i+EyY3tmgJvTS0nC1tHn3CYKfp0s/YtdG84MWOSmmqtKxtuqapABDEfkogKTmyCTE2CECwfZhhAh0T3l3CgS9Aw7OHt4NUrT4/HWOfzCSUt5nAgAw++CNlkjQh3c92lh1YY+uTiLLrtElKL/aoI6X1GwkF7JZBsQXfV7+Mh/PiqifMnK9csEK4X0eGAULVlrb99B9JOWPO7caLEjxdCsQJMljpRDvDjgicrMiPn6RPhulWRTjq8wkfRreY92emaA4tXoR25g4AeHOjejBe2+7g= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6be7c5fa-c7b5-457d-b4b1-08d59db0695d X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:21:37.7374 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1013 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jiri Olsa [ Upstream commit 49c0ae80eb32426fa133246200628e529067c595 ] Stephane reported that we don't set properly PERIOD sample type for events with period term defined. Before: $ perf record -e cpu/cpu-cycles,period=3D1000/u ls $ perf evlist -v cpu/cpu-cycles,period=3D1000/u: ... sample_type: IP|TID|TIME|PERIOD, ... After: $ perf record -e cpu/cpu-cycles,period=3D1000/u ls $ perf evlist -v cpu/cpu-cycles,period=3D1000/u: ... sample_type: IP|TID|TIME, ... Setting PERIOD sample type based on period term setup. Committer note: When we use -c or a period=3DN term in the event definition, then we don't need to ask the kernel, for this event, via perf_event_attr.sample_type |=3D PERF_SAMPLE_PERIOD, to put the event period in each sample for this event, as we know it already, it is in perf_event_attr.sample_period. Reported-by: Stephane Eranian Signed-off-by: Jiri Olsa Tested-by: Stephane Eranian Cc: Alexander Shishkin Cc: Andi Kleen Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20180201083812.11359-2-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/util/evsel.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 7c335d84becf..81d032e56ea5 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -736,12 +736,14 @@ static void apply_config_terms(struct perf_evsel *evs= el, if (!(term->weak && opts->user_interval !=3D ULLONG_MAX)) { attr->sample_period =3D term->val.period; attr->freq =3D 0; + perf_evsel__reset_sample_bit(evsel, PERIOD); } break; case PERF_EVSEL__CONFIG_TERM_FREQ: if (!(term->weak && opts->user_freq !=3D UINT_MAX)) { attr->sample_freq =3D term->val.freq; attr->freq =3D 1; + perf_evsel__set_sample_bit(evsel, PERIOD); } break; case PERF_EVSEL__CONFIG_TERM_TIME: --=20 2.15.1