Received: by 2002:ac0:b08d:0:0:0:0:0 with SMTP id l13csp3561315imc; Sun, 24 Feb 2019 07:41:12 -0800 (PST) X-Google-Smtp-Source: AHgI3IbbJoV091x08esdXo3gUj0y67DYxN77LCGpzOabYdYtlTEa1e7r3ciebSz2F6+wd5YFzrRT X-Received: by 2002:a17:902:3143:: with SMTP id w61mr15226453plb.253.1551022872223; Sun, 24 Feb 2019 07:41:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551022872; cv=none; d=google.com; s=arc-20160816; b=gEGQ7ueFhn5jywaotxofmpl18zJkxrx3MGunsfgv7YA44scWzBg/igOeUtGxFXyzS+ YlglN9OuLP6JYM6V1lLvyOwGoFN3sY6toiICoh25pcka+lYb/ORcZPPdV8Gcip/e8UYB ZubqsFix3qCuv6xd5prRv0vIWz/LnMfwM1dNIMlQA2ywBc2WZLsxVVTvmwTG45PwHe78 bhcFN2z/pJ/Yb7/b8VQnzSWRCB/Sqa9Yfgq5l1rwUBlKf6mWNtmdGIKzrev/HjrQSUuZ pLdZ7Jki3dAsK6uAZK52fSU7emdynURL5xCubu3xAFWKQNyx4oHHkIWYCFZ67AhWBrFd eO3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=ogRzAw70OBxGvA9X47LFAszoKo8HJUqLUMUHVW4fKKs=; b=YU7Rkvh5P48dNefCrLvM+DZiNGkyShP5Kdv6CA/UoX/LHduVbVFz9Fc6StBzQ9EMGo a4elxxBshf2G4t5nkr7Pdu3kOg7Cx9fqxfV7xS7V/NMSD0ZXUOH8Ma/5VhOUHNQoFvHw flBkFOjJ++XjB/1N46EjMLNZxLGLrkgv73h7li53REqd/frhxNG4zoLrSpWZ3+ptYuJy R+GQN4Y5m9tWzURruRMX8V9spSXZrykmy17FubGTQZMouyy38d6zwhRwOIDJ2dORe79c 3gWs1Pv2tvPQEe7uQJtslFPr5RIE9IxeF/cYUJiRMFh2ummhzAeqw916yLYz3Iv8CjFL 3ZqA== 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 g98si2788107plb.11.2019.02.24.07.40.56; Sun, 24 Feb 2019 07:41:12 -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 S1728446AbfBXPhb (ORCPT + 99 others); Sun, 24 Feb 2019 10:37:31 -0500 Received: from mga06.intel.com ([134.134.136.31]:49091 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726458AbfBXPhb (ORCPT ); Sun, 24 Feb 2019 10:37:31 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Feb 2019 07:37:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,407,1544515200"; d="scan'208";a="118688380" Received: from tassilo.jf.intel.com (HELO tassilo.localdomain) ([10.7.201.137]) by orsmga006.jf.intel.com with ESMTP; 24 Feb 2019 07:37:30 -0800 Received: by tassilo.localdomain (Postfix, from userid 1000) id 80D68300309; Sun, 24 Feb 2019 07:37:30 -0800 (PST) From: Andi Kleen To: acme@kernel.org, linux-perf-users@vger.kernel.org Cc: linux-kernel@vger.kernel.org, jolsa@kernel.org, namhyung@kernel.org, eranian@google.com Subject: Support sample context in perf report Date: Sun, 24 Feb 2019 07:37:11 -0800 Message-Id: <20190224153722.27020-1-andi@firstfloor.org> X-Mailer: git-send-email 2.17.2 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We currently have two ways to look at sample data in perf: either use perf report to aggregate everything, or use perf script to look at all individual samples. Both ways are useful. Of course aggregation is useful to quickly find the most expensive part of the code. But sometimes a single sample is not good enough to determine the problem and we need to look at context, either through branch contexts, or other previous samples (e.g. for correlating different micro architecture events or computing metrics) This can be done through perf script today, but it can be rather cumbersome to find the right samples to look at. Another problem with perf report is that it aggregates the whole measurement period. But many real workloads have phases where they behave quite differently, and it is often not useful to combine them into a single histogram. While this can be worked around with the --time option to report, it can be quite cumbersome. This patch kit attempts to address some of these problems in perf report by making it time aware. - It adds a new time sort key that allows perf report to separate samples from different regions. The time regions can be defined with a new --time-quantum option. - Then it extends the perf script support in the tui record browser to allow browsing samples for different time regions from within a perf report session. - Finally it extends the report browser script display support to automatically select sensible defaults based on what was recorded. For example it will automatically show branch contexts with -b. There could be probably be done more to make perf report even better for such use cases (e.g. a real time line display), but this basic support is good enough for many useful usages. Also available in git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-misc.git perf/streams-1