Received: by 10.223.176.5 with SMTP id f5csp1081312wra; Sat, 3 Feb 2018 17:55:21 -0800 (PST) X-Google-Smtp-Source: AH8x226ZXdhE5oOvvUUeVbUPxFnRVB0Cx4I5HQik6g3DUmjZ34IqQio7QhwgvCH0JJ6kcC36fncr X-Received: by 10.99.139.199 with SMTP id j190mr3079028pge.188.1517709321426; Sat, 03 Feb 2018 17:55:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517709321; cv=none; d=google.com; s=arc-20160816; b=maclq0RwfRU1GLaK3JO1bNkHkoUAg3ja52WZBI7yqgr2CeCyL+sDCjy2DpTgZEZZtz /Tn75XC1Hn2Z2uj2otyB2s11ydkmUWrYJ3XppTBov8FIgV8/MCLV+yzctEOp6A9zDfb5 k+QA3i4vXiDGA27LO5rIpn7cwK6ZokDBc5EyED93U+KhgFlwD2ly+MbQFK+WkD5X7EWk hUlf0SMHvTh4bu04Nl3/pctJ5ETkhp67ryggMoc3ODGgJGk+4coJdHreXARewHu/yAa5 KqcPbqMvouMNn/CjuVYmCetr94fB6RBd7Dmdz83PUxZM9PpxYfWSx+O/tHsm6PjxymuP cjfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=XdG8+0r21PHZwQaZWAfRpkJu94A1sQ9LGPUvTWoJDG4=; b=h3E77CPK7eJhLiw0kj36V4/HzjdTmDEYA9cZ4Ry//Sh85SknibI+dPuHyJRe4wcF9p ZXAhlF3jC/aDKT/Zms14qUfFBpelVSsCqQcokDoUyvTLI7arz35o12LFIQ9P7QMbSj1/ AwJ8aiSEtMTgdSrt+zLLpJWXuAG9ygsDqU9RLL0KE5xLIYxuQeTihMbI8vEbc5Nui1M0 jMOJkrau8KFaapvBVYcpUo5kmK2lZ7Oekmx+6+xEKlvKKmxr4xrDLHb1XARIxVgpckRZ aFb/E81MbPaCd4FYWceckVqV+KjX58pP+dfqCOIJyGPebPvxHWQz02j9wvLK3ZuxydRv fodg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=on8NQhzD; 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=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 11-v6si443842plb.362.2018.02.03.17.55.06; Sat, 03 Feb 2018 17:55:21 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=on8NQhzD; 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=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752166AbeBDAT2 (ORCPT + 99 others); Sat, 3 Feb 2018 19:19:28 -0500 Received: from mail-it0-f65.google.com ([209.85.214.65]:50581 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750764AbeBDATV (ORCPT ); Sat, 3 Feb 2018 19:19:21 -0500 Received: by mail-it0-f65.google.com with SMTP id x128so12850204ite.0 for ; Sat, 03 Feb 2018 16:19:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=XdG8+0r21PHZwQaZWAfRpkJu94A1sQ9LGPUvTWoJDG4=; b=on8NQhzDQy6xqiv3AN1W9zSF2mr1kPUppeyTS+Xk13bY55MglILfUnqi7S/2KaCd1g VjFuVgGq6FkBAFk2gQTpSuSFFqHbslrOUgfMZGhwors5v0GUEwcR0f1aeOFNEmXp4Eat ERfEdF2yvvBNy0RqdHDIBYhkj17FNgvenFwCdrRUah0g6ZQCsMtH9LsZA5XcEAYmhRnd L/Km20Z/QzBx/f1utIxHNKqMkD3qh1Jx1h1OfDbdXetzN8psRaYlQoLqDj6SV3r5rp/J TyBXclC2rgcpAEKQQ2THjHQAHY+pba2X0tlkY4s0Der4WWl9oM0+4L/L/e1gGrz3H2ZY kfqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=XdG8+0r21PHZwQaZWAfRpkJu94A1sQ9LGPUvTWoJDG4=; b=fbOkIdJGdroXk+JyzcT0jGehdfq1OUppHi0iT4Cg74f+/PxqaqFXiEpEQkqvER80Bc qZYibG3P1T4k+n/cxFnSJwGntVt3JgyerJLF24QYk168olZ2QOWhxiSi4O1m8vVnVwmN IxAVe6V4FrSGZUamaVwVt1NFh/kbKaO/tp81jcz0mmp1VuzUzOZO84KMySDP13sZZMV2 QcrAhaGxlFskdfwSxdClGwdeF/5sjafM2XK43BO0FzMH1iiXbyp7ExjUW/QPXggPd6sC j4mAbCjoYqmhInksx3ltKsFMd6It7cgoCyEObuyrWOVf71J6q3JMkl+bMKUCrEnffe7G VZ0Q== X-Gm-Message-State: APf1xPBkg6v+idkFdZKoBQKA7mj0pSDkKwpwajc3uYWxJZ/U13eXSaTH jSXg7lsXiV4SpX0ljzIxbGLVa8nEGCbJSrObbIA5zw== X-Received: by 10.36.167.67 with SMTP id s3mr3313650iti.66.1517703560701; Sat, 03 Feb 2018 16:19:20 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.170.39 with HTTP; Sat, 3 Feb 2018 16:19:20 -0800 (PST) In-Reply-To: <20180203153031.GA5004@krava> References: <20180201083812.11359-1-jolsa@kernel.org> <20180201083812.11359-2-jolsa@kernel.org> <20180203153031.GA5004@krava> From: Stephane Eranian Date: Sat, 3 Feb 2018 16:19:20 -0800 Message-ID: Subject: Re: [PATCH 1/3] perf tools: Fix period/freq terms setup To: Jiri Olsa Cc: Jiri Olsa , Arnaldo Carvalho de Melo , lkml , Ingo Molnar , Namhyung Kim , David Ahern , Andi Kleen , Alexander Shishkin , Peter Zijlstra Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 3, 2018 at 7:30 AM, Jiri Olsa wrote: > 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=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. >> > >> there is still one problem remaining here. It has to do with the handlin= g >> 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=3D0xd0,umaks=3D0x81,period=3D100000/ ..= ... >> >> 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=3D0xc2,umask=3D0x1,cmask=3D16,inv/pp is reject= ed. >> 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=3D10000001,cpu/event=3D0xd0,umaks=3D0x81,period=3D10000= 0/ >> >> Or something equivalent. > > and you can specify terms for hw events like 'cycles' > > [jolsa@krava perf]$ sudo ./perf record -e 'cycles/period=3D10000001/pp,cp= u/event=3D0xd0,umask=3D0x81,period=3D100000/' > ^C[ perf record: Woken up 1 times to write data ] > [ perf record: Captured and wrote 0.579 MB perf.data (722 samples) ] > Ok, I did not know about this syntax. It looks bizarre because you are using an event name as a PMU instance. Works for me. Thanks. > [jolsa@krava perf]$ ./perf evlist -v > cycles/period=3D10000001/pp: size: 112, { sample_period, sample_freq }: 1= 0000001, sample_type: IP|TID|TIME|ID|CPU, read_format: ID, disabled: 1, inh= erit: 1, mmap: 1, comm: 1, task: 1, precise_ip: 2, sample_id_all: 1, exclud= e_guest: 1, mmap2: 1, comm_exec: 1 > cpu/event=3D0xd0,umask=3D0x81,period=3D100000/: type: 4, size: 112, confi= g: 0x81d0, { sample_period, sample_freq }: 100000, sample_type: IP|TID|TIME= |ID|CPU, read_format: ID, disabled: 1, inherit: 1, sample_id_all: 1, exclud= e_guest: 1 > > jirka