Received: by 10.223.176.5 with SMTP id f5csp2460590wra; Thu, 1 Feb 2018 00:39:31 -0800 (PST) X-Google-Smtp-Source: AH8x226WGimkQHb5nNj/WjFT0mlLY1qNHsuPpx+dL9Y++XYR3xIuxHPp+hBZfvqYuxIgsJHmFXUg X-Received: by 2002:a17:902:34a:: with SMTP id 68-v6mr31706974pld.276.1517474371263; Thu, 01 Feb 2018 00:39:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517474371; cv=none; d=google.com; s=arc-20160816; b=bjRnpFWY+88T3x5oiEuqNNrbyx0UMbhaO6Byj318QBQ3y3i+2M1aG70D/nPAcnBJSn sci37hzfa6t/gjBISFThTzd69HW/sB+nbIFDqtlh3mPev/kKIIOK5AsQBpC0oLzEpCWL tK+b51XT6KANOIwOhNVaSOU5zGxXkNuoTJ08pUlkmkSK3eqPtSgUPVPKU/kDWFWUi9LG isAn11eiEmQriBERp+DcMNpDSgZx/JaPGZnqGmGyrgXuoh/K/zxT9GJkp3oJAhaYcdsV EHtyLhSDUBi0fy5PBZM0vFPJvPpD4YjDzU4PYAI/kCjBmDt96ZUwxgMUggLWM3mzhX0F YsZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=FxmBQMeMlncFj2XgdAljQiiCwoMj6WhpYF6RVECgdjI=; b=rT7dtzBPha8IoQIDQORZoctV+ZdSWSw0/tJU6amogqmFp+huiQniLdXuiZbFvcpWKs DwQNwkVMnx9iTEznD84SpMV8GtX+OtX0alT0O2rCDMIfXzOmx9wPiYqb8EHudOMfr183 CsV1P2YJSd14UWcGHmJ5Kr5pkkkJFTulBTqFBBf9uou9e/DX08HLnR1d3xbFmv3tk0FN BTfWJZehq2OD7zhqTabnvfecoVK9yXFu4oerpk7bOWjN9HP6uF/QM6LqQyk3+ve/cqvk 1oJkjz6J9KcBDI/H1Z8iJgiKhumF9tAkl+4xJBFIHc2lN8QNLsoV+dK0T0ybgOYNOM1w 4pow== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s1-v6si1707606plk.234.2018.02.01.00.39.16; Thu, 01 Feb 2018 00:39:31 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751937AbeBAIiW (ORCPT + 99 others); Thu, 1 Feb 2018 03:38:22 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39176 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751910AbeBAIiU (ORCPT ); Thu, 1 Feb 2018 03:38:20 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7B8D068E1D; Thu, 1 Feb 2018 08:38:19 +0000 (UTC) Received: from krava.redhat.com (ovpn-204-213.brq.redhat.com [10.40.204.213]) by smtp.corp.redhat.com (Postfix) with ESMTP id 03338620CB; Thu, 1 Feb 2018 08:38:16 +0000 (UTC) From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Ingo Molnar , Namhyung Kim , David Ahern , Andi Kleen , Alexander Shishkin , Peter Zijlstra , Stephane Eranian Subject: [PATCH 1/3] perf tools: Fix period/freq terms setup Date: Thu, 1 Feb 2018 09:38:10 +0100 Message-Id: <20180201083812.11359-2-jolsa@kernel.org> In-Reply-To: <20180201083812.11359-1-jolsa@kernel.org> References: <20180201083812.11359-1-jolsa@kernel.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 01 Feb 2018 08:38:19 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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=1000/u ls $ perf evlist -v cpu/cpu-cycles,period=1000/u: ... sample_type: IP|TID|TIME|PERIOD, ... After: $ perf record -e cpu/cpu-cycles,period=1000/u ls $ perf evlist -v cpu/cpu-cycles,period=1000/u: ... sample_type: IP|TID|TIME, ... Setting PERIOD sample type based on period term setup. Reported-by: Stephane Eranian Link: http://lkml.kernel.org/n/tip-anrtntkwfto5rqulegfwitn5@git.kernel.org Signed-off-by: Jiri Olsa --- 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 66fa45198a11..f2f2eaafde6d 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -745,12 +745,14 @@ static void apply_config_terms(struct perf_evsel *evsel, if (!(term->weak && opts->user_interval != ULLONG_MAX)) { attr->sample_period = term->val.period; attr->freq = 0; + perf_evsel__reset_sample_bit(evsel, PERIOD); } break; case PERF_EVSEL__CONFIG_TERM_FREQ: if (!(term->weak && opts->user_freq != UINT_MAX)) { attr->sample_freq = term->val.freq; attr->freq = 1; + perf_evsel__set_sample_bit(evsel, PERIOD); } break; case PERF_EVSEL__CONFIG_TERM_TIME: -- 2.13.6