Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp413789ybg; Tue, 28 Jul 2020 09:04:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzOUFuBhd/fiH43OsD2Zcd+kMhBxqJkk+U2A4qa4NXZMR1efBoE3C8nH/BStaQB5LKfsGM X-Received: by 2002:a17:906:a3d9:: with SMTP id ca25mr22037073ejb.164.1595952269173; Tue, 28 Jul 2020 09:04:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595952269; cv=none; d=google.com; s=arc-20160816; b=B4Gl8bBC2cQQPikoqtoLZTQGJwwTrjHQJcMCtn8J4lROB/OqAW6bWvrgW5rAF5wNzZ KSw2+LfDC3Cs8GSSdMcBsolZXbQxre74Pazy+FKflfycowQn8dB3vN1SDHZSkwNXX9Xa B4c7Rn4Lz03bQ9CHOCysjZbd7MyTo1Ec3aJhKA6FDS19ZlrC+nYFfmB7H7M1bmnWNN/D 3E1NH/0JtfIJlk8mT2R4wX2nhK1GRqn3Vxg5GHZbIPJ0VoL/V5h+cv/zfGnE2x8mVpHy UUmiog4Lly6FNHuHu28a1V4GIkTFLJOcLUgP8VLsx5JnaBTtCNKDOVMQXvB/wjRO5ihl wvow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=24U1OEdP7Jf2UKoN390Wdri/DWgZ9edWaEiMsKd1sPI=; b=T0yqTnKtQNXzPGV2kIZet5DfR8G/eNh+sXw+P6UvWN+NSLR0yuzBhFf+teqmi4cx1O jAApZ8ePWHAuND+1Z7f8aIb3Vd1RVB+j98PX7EwGOvw2g1h//O8VfxYPfq1sVnFVyngL 14okmIPOaVZxSPEXorQOf/JLkOad1EGhPJDejZu/DvegccGA8DStB00lj593jJ8XF5RF /dOThWSqNsgPZL7e9U5zytBjxt6laUqIabwwZ4TTzEj0ow+dmKHTTYuePEZDMUqM51LE ZLVYEZVJNf8Y3LoCYv3HROGxDK20WfLMLp7tNUhX7p7Qpa0FrDz9UKaCRd47AosD9FHa UQNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="kRBIP/lU"; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cn15si3069402edb.173.2020.07.28.09.04.04; Tue, 28 Jul 2020 09:04:29 -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=@kernel.org header.s=default header.b="kRBIP/lU"; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731278AbgG1QDN (ORCPT + 99 others); Tue, 28 Jul 2020 12:03:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:33668 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731044AbgG1QDM (ORCPT ); Tue, 28 Jul 2020 12:03:12 -0400 Received: from quaco.ghostprotocols.net (unknown [179.97.37.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 032BA2053B; Tue, 28 Jul 2020 16:03:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595952192; bh=Nrdi6RbUtjXiYs3BGWNlvAd1Qp355THznjM8Xpt7rHM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kRBIP/lUOGCQLFimbaXgdiU+ySb4ll3DCS93Emg/zKgvyvq6SA4qKZJcxNhvxwWIq HVWqU+pwq2OeRzjmkzbYA4sqqQOpdDIvyjmHi+9TUJqrdKIYTRxdjOOKFwArzRr+lT b824zOQw0jmr9LIi6fxBF83dEDY+pGi2qQz6eVgo= Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id A987440E57; Tue, 28 Jul 2020 13:03:09 -0300 (-03) Date: Tue, 28 Jul 2020 13:03:09 -0300 From: Arnaldo Carvalho de Melo To: Jiri Olsa Cc: Ian Rogers , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Namhyung Kim , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , John Fastabend , KP Singh , Adrian Hunter , Andi Kleen , Athira Rajeev , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, Stephane Eranian , David Sharp Subject: Re: [PATCH v2 1/5] perf record: Set PERF_RECORD_PERIOD if attr->freq is set. Message-ID: <20200728160309.GC374564@kernel.org> References: <20200728085734.609930-1-irogers@google.com> <20200728085734.609930-2-irogers@google.com> <20200728154347.GB1319041@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200728154347.GB1319041@krava> X-Url: http://acmel.wordpress.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Tue, Jul 28, 2020 at 05:43:47PM +0200, Jiri Olsa escreveu: > On Tue, Jul 28, 2020 at 01:57:30AM -0700, Ian Rogers wrote: > > From: David Sharp > > > > evsel__config() would only set PERF_RECORD_PERIOD if it set attr->freq > > from perf record options. When it is set by libpfm events, it would not > > get set. This changes evsel__config to see if attr->freq is set outside of > > whether or not it changes attr->freq itself. > > > > Signed-off-by: David Sharp > > Signed-off-by: Ian Rogers > > Acked-by: Jiri Olsa So, somebody else complained that its not PERF_RECORD_PERIOD (there is no such thing) that is being set, its PERF_SAMPLE_PERIOD. Since you acked it I merged it now, with that correction, - Arnaldo > thanks, > jirka > > > --- > > tools/perf/util/evsel.c | 7 ++++++- > > 1 file changed, 6 insertions(+), 1 deletion(-) > > > > diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c > > index ef802f6d40c1..811f538f7d77 100644 > > --- a/tools/perf/util/evsel.c > > +++ b/tools/perf/util/evsel.c > > @@ -979,13 +979,18 @@ void evsel__config(struct evsel *evsel, struct record_opts *opts, > > if (!attr->sample_period || (opts->user_freq != UINT_MAX || > > opts->user_interval != ULLONG_MAX)) { > > if (opts->freq) { > > - evsel__set_sample_bit(evsel, PERIOD); > > attr->freq = 1; > > attr->sample_freq = opts->freq; > > } else { > > attr->sample_period = opts->default_interval; > > } > > } > > + /* > > + * If attr->freq was set (here or earlier), ask for period > > + * to be sampled. > > + */ > > + if (attr->freq) > > + evsel__set_sample_bit(evsel, PERIOD); > > > > if (opts->no_samples) > > attr->sample_freq = 0; > > -- > > 2.28.0.163.g6104cc2f0b6-goog > > > -- - Arnaldo