Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2114687imm; Mon, 3 Sep 2018 19:47:40 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZwts4S6nots1D8DkaExVp0LeYxMB6z3WDPyGY5Np6ABu+b9nqduV1KiY2g0YuzUJ6MX8FE X-Received: by 2002:a62:7983:: with SMTP id u125-v6mr32342523pfc.177.1536029260408; Mon, 03 Sep 2018 19:47:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536029260; cv=none; d=google.com; s=arc-20160816; b=IUxCT0P4mCZLRonS72lDGAvi1qJCtxNn8Htet78K3KoflmCl6+bqMyroLsZtj+2fNx ZlO9uR/IfI2veFMDu3+EGxfXvR+I7Bxr8aNEbnlT/iKNquobgQu+fM1ZC1G0nkUkGckt QJMVlYwS5vXsKEjpeGGSYCXm5nPFbWI1GDn1vIKLczHk7sd0skjLdWF3Q+jCqMXvyPxw 4iLIHNPLJU2yvL52ab1BuKVuqokYc+c9AdTSZr5fMy16m8IpbQ8/jMSZF1xrhw1HjcO3 2LAEN4Jk/ILEb1oxV6x1oZSE+LURxhAzPRtRKR5A/n8gBW5I/fyKA9P+WCbBqSC1RjZJ rViQ== 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:mime-version:dkim-signature :arc-authentication-results; bh=N8VDB7K4hkxRghIHD8ZOYGsPd8NVOeDWeh07tObt0T4=; b=iCkCQVSWBb/ydPVgRAy0TxE4xK4CX/Ny3WLAknEN9DLRIkwnqL/eAlYIJ0yesiehA6 bYAe/vjG87r0oKjiTRAkKrDGVJHZbrAeRRbUUwCusOEPThohn5Ay5D0bVrsDveLGRaCb c5kLXlsp1nZ9Zpak081M7bQrlEUw1RgT0rCn0m61Bs+ZdRR7Y5cotSsOzP/uyRoU79nr kTEXK0PLEX7ErKz1zy+g14mSAHtJYmpiD4Aq1ccN2c8H4A8nRgS+f4MoAhH//PBSUFC6 ETd3R/1xCnb8evXPdYaZ3Pw1IIundfdMoPJSgcvVWjLDEC3Cw2JELx6I80MphFkllYZu IrAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=amuAuaW6; 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 q8-v6si19191583pgk.600.2018.09.03.19.47.25; Mon, 03 Sep 2018 19:47:40 -0700 (PDT) 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=amuAuaW6; 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 S1727708AbeIDHI4 (ORCPT + 99 others); Tue, 4 Sep 2018 03:08:56 -0400 Received: from mail-wm0-f46.google.com ([74.125.82.46]:35712 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726295AbeIDHIz (ORCPT ); Tue, 4 Sep 2018 03:08:55 -0400 Received: by mail-wm0-f46.google.com with SMTP id o18-v6so2683323wmc.0 for ; Mon, 03 Sep 2018 19:46:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc :content-transfer-encoding; bh=N8VDB7K4hkxRghIHD8ZOYGsPd8NVOeDWeh07tObt0T4=; b=amuAuaW6EF5Z9QbBN24E/7X7sd+pnrWSr7nUcZ3SMO2iQsL++lWngIgwIgbWtt9nS+ vVXWoAlYiEgzeQ0ZCvfT5UTrn9tla+qEL/ee3t8O+O1jCceXAL3AzfWh6Yi1yxVP3J9+ CGMPoGvZKqjgGFs/MAtp9kaeIpd1aflU9/5VqiheHBzbM3Fjh/mgzQ27qsu2F5dvueUk DPZkVDLsJ/rBc6IdN7F/H4ZL65Et6TI+DE5WWDbOTjBQd2QzGV4lAOIwx3mhW2pWYn5x uSx0AwXV5j5Avif7BcyWuAepGHf6HLRPtcltiyrzrTpPhv+/mgJ2SL+nuliY+8AqimXV h6Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc :content-transfer-encoding; bh=N8VDB7K4hkxRghIHD8ZOYGsPd8NVOeDWeh07tObt0T4=; b=tMFfNlwtp924E3W63S0VtzveIv8/nKgkBh8ptr08t2qRwG0LVZ+imIvjvzfd4b9Jir N7qfkgYJdkix6+/aK9lBe4ADbuplTTx3tJ9hqfJy8/dsEkFcf/O+RyexLxV0hCAPKImL 9T3PybN636HHfhLdSSOym7OF7H7SH4ng1KlvL8FqHLdQKHPAzLnI4qWarfQtGHxQKvAa /DuOBVs3NkNOnKg3mTae1DN9OD7hvfd7bvIepVqVPwP1ixOeKjJqqKNA69ZOJ/bwBYWU UT9VOWWj8YW5H3dZIPJNm9hFpLG4ehwq+wQcT9k538YjfFsiQq0kmYh2oqG3WLnQ/FcG T1iA== X-Gm-Message-State: APzg51BzwJXuXMXYLPFJSq/ajAheUXUcpMGlMFg0QbCIJ3NcKZ8uxc/F fzTYWDkVqSe1tgp4OSQchzH1DHSz8g5QijAZESY9Qg== X-Received: by 2002:a1c:e141:: with SMTP id y62-v6mr6752719wmg.138.1536029159821; Mon, 03 Sep 2018 19:45:59 -0700 (PDT) MIME-Version: 1.0 From: Stephane Eranian Date: Mon, 3 Sep 2018 19:45:48 -0700 Message-ID: Subject: [RFC] perf tool improvement requests To: Arnaldo Carvalho de Melo , Peter Zijlstra Cc: Jiri Olsa , Jiri Olsa , LKML , Namhyung Kim 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 Hi Arnaldo, Jiri, A few weeks ago, you had asked if I had more requests for the perf tool. I have put together the following list to improve the usability of the perf tool, at least for our usage. Nothing is very big just small improvements here and t= here. 1/ perf stat interval printing Today, the timestamp printed via perf stat -I is relative to the start of the measurements. It would be beneficial to also support a mode where it is using a source which can be synchronized with other traces or profiles. For instance, using gettimeofday() or clocktime(MONOTONIC). 2/ perf report event grouping if you do: $ perf record -e '{ cycles, instructions, branches }' .... $ perf report It will show the 3 profiles together which is VERY useful. However the output is confusing because it is hard to tell which % corresponds to which event. I know it is cmdline order. But it would be good to have a header in the columns to point to the events, instead of guessing. A few times, I had to revert to perf report --header-only to figure out the event order. I discovered the 'i' key on the function profile. But it is still hard to find the events, especially if you passed many of them. 3/ annotate output of loops Percent=E2=94=82401f00: xor %eax,%eax =E2=94=82401f02: test %edi,%edi =E2=94=82401f04: =E2=86=93 jle 401f2b =E2=94=82401f06: nopw %cs:0x0(%rax,%rax,1) 34.20 =E2=94=82401f1=E2=94=8C=E2=94=80=E2=86=92 movsd (%rcx,%rax,8),%xm= m1 14.60 =E2=94=82401f1=E2=94=82: mulsd %xmm0,%xmm1 33.24 =E2=94=82401f1=E2=94=82: addsd (%rdx,%rax,8),%xmm1 9.98 =E2=94=82401f1=E2=94=82: movsd %xmm1,(%rsi,%rax,8) 0.10 =E2=94=82401f2=E2=94=82: add $0x1,%rax 0.03 =E2=94=82401f2=E2=94=9C=E2=94=80=E2=94=80 cmp %eax,%edi 7.84 =E2=94=82401f2=E2=94=94=E2=94=80=E2=94=80=E2=86=91 jg 401f10 <= triad+0x10> =E2=94=82401f2b: mov $0x18,%eax =E2=94=82401f30: =E2=86=90 retq The loop arrows cut through the code addresses. That is annoying! 4/ sorting and event groups If I do: $ perf record -e '{cycles,instructions}' $ perf report It will sort the samples based on the first (leader) of the group. Yet here all events are sampling events. You could as well sort with the second event. But I don't think perf report support sort order on multiple events. Both are from the same category: syms (or ip). Right now, I would have to collect another profile: $ perf record -e '{instructions,cycles}' $ perf report 5) cgroups Today, to measure multiple group events in the same cgroup, you need to= do: $ perf stat -e cycles,branch,instructions -G foo,foo,foo ..... You need to specify the cgroup N-times for N-events. It would be good to support a mode where you'd have to specify the cgroup once: $ perf stat -e cycles,branches,instructions --cgroup-all foo,bar Would measure cycles,branches,instructions for both cgroup foo and ba= r. 6) perf script ip vs. callchain I already submitted this request separately. It is about providing a way to generate the callchain separately from the ip in perf script. Right now, they are lumped together which is not always useful. Also right now, the callchain is a multi-line output which is not useful. perf script should stick with one line per sample, at least when symbolization is off. We have examples of that with brstack. I may have more requests but I wanted to start with these for now. Thanks for your efforts.