Received: by 10.223.176.5 with SMTP id f5csp1215180wra; Fri, 2 Feb 2018 13:17:07 -0800 (PST) X-Google-Smtp-Source: AH8x225QDpgXWGPhWHaIxK7PKwTKecyW03PGXUWejEJShIiYjiYWdpp7p5BXnxgunUgsfoyhAr0Z X-Received: by 10.101.64.196 with SMTP id u4mr6182265pgp.336.1517606227436; Fri, 02 Feb 2018 13:17:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517606227; cv=none; d=google.com; s=arc-20160816; b=iS5fO5guKbEd0aFqtOGmA1JhVaL/IpyMsZ1BqOMXtCnDEJc+GUoEJPOfxqyW6Hid23 I2//M+VRNyNHvWiJ9YJ3Lv6+3Pn0TDoDXwopNsdC5wxfiBBwkFsOsasNE9bwtQsk/gb4 uvD0tJ7EiAeTnKeDimDF5fcvqqEbJD97azEgqz3t3Dcm552XDu61zXgswbboMZkPogpY ze2C49qY+AqjII3P7Byvx+IJP2xBeL1Gbj4L72d79JsWJ1+wwk/dHP1guFOqKiF8SDrM kLba2iee1VgUksiGnQRTAm2w0s/iMnVfe024FUOYagJs6uhsT0uyNzU+MfdPiGeRTqxi s9gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dmarc-filter:arc-authentication-results; bh=LHOjBHhTYwaHIyiAx0HHIb+0cKj23z7mFtPckA3oSWM=; b=M+AEgzIkSJhAo362j3tHm1SfXJEAE4+HYj7dSbHBT8+PgueO4LSwiDPakyK7Kxg5BJ j7nQD05F1HZz43dF3seUsSNSbIbtAwjj/xdEJ2P3t+RxGzgFKu5hG6TbG8bkkch12IhB vTlzYps3eUxiVllzd7TmncM4IZ0oojWjtjz4RU7PEEB31gsSfK8xWg8KbWO7hqSZrHzd zgg9k4pPVDW1D8zCcv6fssiRPjS5WlxJIpybNEDIoBzeCHP8ZHtTpxJNZXoupIXTO+RE G6pFsWTlbqQ2tK5TZNmeLE9rF995WX6+4N35ID2niIzyFherP1LLg/bKrEGPs2G/V0fW nIOg== 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 h15-v6si167451pli.212.2018.02.02.13.16.52; Fri, 02 Feb 2018 13:17:07 -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 S1752214AbeBBU27 (ORCPT + 99 others); Fri, 2 Feb 2018 15:28:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:47168 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752110AbeBBU2y (ORCPT ); Fri, 2 Feb 2018 15:28:54 -0500 Received: from jouet.infradead.org (unknown [179.97.41.186]) (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 26CE521785; Fri, 2 Feb 2018 20:28:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 26CE521785 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=acme@kernel.org Received: by jouet.infradead.org (Postfix, from userid 1000) id 53A30141E4A; Fri, 2 Feb 2018 17:28:49 -0300 (-03) Date: Fri, 2 Feb 2018 17:28:49 -0300 From: Arnaldo Carvalho de Melo To: Stephane Eranian Cc: Jiri Olsa , lkml , Ingo Molnar , Namhyung Kim , David Ahern , Andi Kleen , Alexander Shishkin , Peter Zijlstra Subject: Re: [PATCH 1/3] perf tools: Fix period/freq terms setup Message-ID: <20180202202849.GA8297@kernel.org> References: <20180201083812.11359-1-jolsa@kernel.org> <20180201083812.11359-2-jolsa@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Fri, Feb 02, 2018 at 10:45:46AM -0800, Stephane Eranian escreveu: > Jiri, > > On Thu, Feb 1, 2018 at 12:38 AM, Jiri Olsa wrote: > > 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. > > > there is still one problem remaining here. It has to do with the handling > of cycles:pp or :p or :ppp. Suppose I want to set a period for it while I am > also sampling on other events: Something like: > > $ perf record -e > cycles:pp,instructions,cpu/event=0xd0,umaks=0x81,period=100000/ ..... > > I want to set the period for cycles:pp, but not for instructions. I > cannot use -c because > it would also force a period on instructions. I could use the raw hw > raw event code for cycles:pp. > But that does not work because recent kernels prevent use of hw > filters on events programmed > for PEBS, e.g., cpu/event=0xc2,umask=0x1,cmask=16,inv/pp is rejected. > PEBS does not support filters. > It works in the case of cycles:pp simply by the nature on the > underlying event and the stalls. > > To get precise cycles, the only event syntax you can use is cycles:pp, > but then you cannot specify > an event-specific period. This needs to be fixed as well. > > I'd like to be able to say: > > $ perf record -e > cycles:pp:period=10000001,cpu/event=0xd0,umaks=0x81,period=100000/ > > Or something equivalent. > > Otherwise, I tested what you have written so far and it works. So I take that as a Tested-by: Stephane and will apply the patches, Jiri can continue working on these other aspects, right? - Arnaldo > Thanks. > > > > 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 > >