Received: by 10.213.65.68 with SMTP id h4csp2199887imn; Sun, 8 Apr 2018 22:19:52 -0700 (PDT) X-Google-Smtp-Source: AIpwx48kW3Xo3/rBVTWwIg7lWFzZj0WxjkXCmAI0V+Umhg15CZ1y8TPgcrIneUr7sLxMcfndQ3cm X-Received: by 10.101.90.68 with SMTP id z4mr24225984pgs.184.1523251192310; Sun, 08 Apr 2018 22:19:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523251192; cv=none; d=google.com; s=arc-20160816; b=rC6h9REHpedc65N6ZqXGbOIebBd+gUObFOXmDmScfGprvo+xK9DUru3dH40xAEF+0x XJ6G+uzKzSIThaSpZtEoyYFxOEIuNikzbjshoIkWYfUT3B2BQEnQR0PNXkYQUeUS5+ej Qr3ZiWPa3K4jSmJcsO1IY0OZrLVxme/mpwC+L9d1AwY54tz16lqWp9csm84PW0mTSgHy rHX0uxeXGHa1LXENDhD4/wYyEDM9yH9iTy5VO2k/KQ2rs6fAaVy9jdycguStiL1nNLz3 YuTP9pwKL/oQtucdbgV8ryK3hC56HhKPo3mLoCND8ZgOHRN+/A/Mo9m57SbDao+uZ7dt 9OjA== 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=Liga4kne7FFqSg8q2PjuWgdzH8VGsnJlyOF5HvfefgQ=; b=R9GacJZ0xj53Tx4aKTJfrliQYLNQIAd348AVqIRMZ2cAAtxaZ4It8XA1GRd+xhx/Sg tS/BGH4cW/fzJjJ5So1swj6KpIqAEE7jYKjG5h6Br82hbmmocpr5h6TEm7XqE1Rmh6I5 p7bWfKdHgQ0qRpMKTV49mU6rLir0qpvjyJq+4s/iyU2KMooMcY6Q0unYnh9/0AAXm08Z 4v7ek3qJPYXSBGc3NGW/+eoIGv86/XhTNQ4bZvK1SSSYxNaKMxGq8/oUuZX7mcfYmtDQ WpjbrCVw+GDZqMFmaT/hMppdFofpRd+pNsfTqk9ZKtVinXWVJTRn4OlD4LhoKcqg17J9 Wbxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=N7SvDuIq; 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 f7si3441357pgn.476.2018.04.08.22.19.15; Sun, 08 Apr 2018 22:19:52 -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=N7SvDuIq; 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 S1754355AbeDIAVC (ORCPT + 99 others); Sun, 8 Apr 2018 20:21:02 -0400 Received: from mail-sn1nam01on0114.outbound.protection.outlook.com ([104.47.32.114]:12752 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754340AbeDIAU7 (ORCPT ); Sun, 8 Apr 2018 20:20:59 -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=Liga4kne7FFqSg8q2PjuWgdzH8VGsnJlyOF5HvfefgQ=; b=N7SvDuIqAFL0rpQScxtT6JC+KO/gJ/WoyhcLH7qGO+7AJFmdwKZBQtvznTSkO/OkcadA6HLy4QU16dUql6M7NtrM735d6Yd2eYUfUu5PmVcWjcOup3LwCrOxcPcq3grigLA6DlmDyRMLhXsUUUvzBkQhQpa8FWzi+h1Nm/Hv/38= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0920.namprd21.prod.outlook.com (52.132.132.165) 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:20:57 +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:20:57 +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.15 151/189] perf evsel: Fix period/freq terms setup Thread-Topic: [PATCH AUTOSEL for 4.15 151/189] perf evsel: Fix period/freq terms setup Thread-Index: AQHTz5hVyGc5ZkM9zEuIu4XHLmjWZA== Date: Mon, 9 Apr 2018 00:18:50 +0000 Message-ID: <20180409001637.162453-151-alexander.levin@microsoft.com> References: <20180409001637.162453-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001637.162453-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;DM5PR2101MB0920;7:2+v/PmLQINkI6betFImO2g73fYiGXP/LzNBb+QoKcGbYMWMeqfx3o+yD1BMVfqQV7J3Z0Fw6+dw1G5EvY0SWr/+e5iinzlk0n+5u/S/lr4fphBSsexkxwuTKQN+CEJ4MQX5CB+Ax/eytP2D8RXUrE+ySTz0dtFjE9B1xCVfhkDQC4o2xuGWZYWKbF9PANiiUyGedNiOOMGfItFMh8IWFfW9jannnoFG2RD78+SqGyQ+5BjYJn+T0YYEhLVpbRP8y;20:akPYp8XBfJCwvTY+62z0uAk1LiffeVASrHLM/zN2JrAPJmUByCeUaKSTjvJZIlFisZCUj862+4qFp/6/WIcpSkF9A3R8e4rl2ZP5vC1eUvrOEaFpDkvFMhY1mpZO8Pd6sbx7wuguZ3Op62TQ5gx4lRtJg34meii1QEHvLfOp2fs= X-MS-Office365-Filtering-Correlation-Id: d26437b2-4b31-4301-f34d-08d59dafc3ba 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:DM5PR2101MB0920; x-ms-traffictypediagnostic: DM5PR2101MB0920: 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)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR2101MB0920;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0920; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(39380400002)(396003)(366004)(346002)(376002)(199004)(189003)(66066001)(86362001)(3660700001)(3280700002)(25786009)(76176011)(2900100001)(36756003)(6506007)(2906002)(99286004)(86612001)(6486002)(102836004)(305945005)(1076002)(7736002)(575784001)(97736004)(2616005)(446003)(11346002)(476003)(486006)(26005)(39060400002)(6666003)(6512007)(4326008)(107886003)(6306002)(5660300001)(478600001)(6436002)(105586002)(10290500003)(966005)(5250100002)(22452003)(316002)(186003)(8676002)(110136005)(81166006)(54906003)(6116002)(8936002)(72206003)(53936002)(2501003)(3846002)(68736007)(14454004)(81156014)(10090500001)(106356001)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0920;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: JI72cqwxUvHuMzh+aOIQqjPBd7dYdFFcHqKgm+VpLfQ4fWiz+KvYXNvL4CMytDe0m1o2D+QTS6KkYwBd41+Ze7yhs6D1/1brAeYSio6/RcvQmu2PjyrlLnglXxTGuLyUkDCxCinrhnIaU31ah0Zdz5FJkOfxhkCLPvA2/il1Unm7a7giWevPA2XfHPOX79qblnY9Ny/9tLFMBzaLSJUdObEz/4391gnaeIy0iWmPk20x07RQQWUIZOadD+rm/2mMkqj52KRevzb0tw/8dJKaY/mmR0ohKtBRTiBMEaR4W8f6MY1thASEeI3ETKQdQK651RwCB3ULXdI6mFGvF1rIGntpwnlahexon+MoBWd29t3uD0aCHfYwvXDrYVKvMr6Fmr8K5xOgDkn3uztdxk1PuMdCp5Zcvwp8EA9thj2ltQs= 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: d26437b2-4b31-4301-f34d-08d59dafc3ba X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:18:50.1747 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0920 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 d23a8c51b307..7349a5d22464 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