Received: by 10.223.176.5 with SMTP id f5csp659094wra; Sat, 3 Feb 2018 07:32:16 -0800 (PST) X-Google-Smtp-Source: AH8x227cCS6rWCKmAbns/lqqTBQSow3tG7rzYFGUHcMWzZ/bRDZMp9qLVvaQhvzhHXMNV2sYCRL2 X-Received: by 2002:a17:902:7d95:: with SMTP id a21-v6mr17419813plm.291.1517671936729; Sat, 03 Feb 2018 07:32:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517671936; cv=none; d=google.com; s=arc-20160816; b=w21aXK3TwoDmftZouni5nCKNrNSjX8mKruQ0Rl/W6TV3FpdLaG45x0Cvan1r6yfiJr RwxBiVqfxrmjOlFBLPMacYs47VHVInrOHHKZGJVqrDvMb+QSbuE+ql8wpyI6r7UQiTv1 3paPIf+MjTTewEIPHRYmKe2+QpmfNgl9NKFLBmtfDtK+ygoFNIY9hNpm1e7B5Djbv/6F zeSHxqpxypUKFdci2u1Ekau9pXtr9rKjpXkgdyyMoy/85OQqM5pS/3RfzYVPtEUq9VMf gjX68Oinswr3334GArhIE4hLssNmxYonOkynrOvebfBl39KPrlvCu3mwlAj7MnrpmSUX +L8A== 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:arc-authentication-results; bh=9cYrNFwAH56qro9GtzJPAtunZcMLeaoXgJhvdeN9QP8=; b=oC1rvrFjYxqDl8OI5PI2HKadhrtPb4OZ14tgtvS0/vpHu93q47z5cjF/dJMa6HA5X2 iRuJS1g60uCpuZnaWj+j08Xu3Es3/Cc5UyAzR3hbmXBDBKywfQSQ7DqClzB9CTpEXU1d r6sNeBX2d+LsQNDn77R5P6qkqWcA78Ol2+dy/KuZQycJu/hgda9k+15GSzpr7FRsFdIK QkcS+JkOcg7mVwiRWYYKfzyzsLSaR6FerBte5oVrs58G/hvarwUsgPxLc8hbO5kiBRhJ Akv4m9WSoEk8W65cJckzZso5Fhx6BqtY02gJzvTBucfelyruWWu3LkRQeNACxrrqjJ70 Sh/A== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t20si3831791pfi.42.2018.02.03.07.31.40; Sat, 03 Feb 2018 07:32:16 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752633AbeBCPak (ORCPT + 99 others); Sat, 3 Feb 2018 10:30:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34030 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751869AbeBCPaf (ORCPT ); Sat, 3 Feb 2018 10:30:35 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B394F80469; Sat, 3 Feb 2018 15:30:34 +0000 (UTC) Received: from krava (unknown [10.43.17.57]) by smtp.corp.redhat.com (Postfix) with SMTP id D24805D759; Sat, 3 Feb 2018 15:30:31 +0000 (UTC) Date: Sat, 3 Feb 2018 16:30:31 +0100 From: Jiri Olsa To: Stephane Eranian Cc: Jiri Olsa , Arnaldo Carvalho de Melo , 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: <20180203153031.GA5004@krava> 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: User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Sat, 03 Feb 2018 15:30:34 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 02, 2018 at 10:45:46AM -0800, Stephane Eranian wrote: > 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. you can use p modifier behind like: cpu/.../pp > > 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. and you can specify terms for hw events like 'cycles' [jolsa@krava perf]$ sudo ./perf record -e 'cycles/period=10000001/pp,cpu/event=0xd0,umask=0x81,period=100000/' ^C[ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.579 MB perf.data (722 samples) ] [jolsa@krava perf]$ ./perf evlist -v cycles/period=10000001/pp: size: 112, { sample_period, sample_freq }: 10000001, sample_type: IP|TID|TIME|ID|CPU, read_format: ID, disabled: 1, inherit: 1, mmap: 1, comm: 1, task: 1, precise_ip: 2, sample_id_all: 1, exclude_guest: 1, mmap2: 1, comm_exec: 1 cpu/event=0xd0,umask=0x81,period=100000/: type: 4, size: 112, config: 0x81d0, { sample_period, sample_freq }: 100000, sample_type: IP|TID|TIME|ID|CPU, read_format: ID, disabled: 1, inherit: 1, sample_id_all: 1, exclude_guest: 1 jirka