Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp7815261pxb; Thu, 18 Feb 2021 23:03:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJy/CAkVcJjXa+KH/VYd7y+OTpNNrmivE84QV4P7XcvuuwOehEXF1gZtvv+tO+q9B06TkTAN X-Received: by 2002:a05:6402:1a51:: with SMTP id bf17mr5423652edb.25.1613718216780; Thu, 18 Feb 2021 23:03:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613718216; cv=none; d=google.com; s=arc-20160816; b=srTvgBBg7aen3ig9rJwsrQXkESS7LFXgNRZg/tQQcyAVwChp25JoweD5IYprVe0Ejw JPwlnoShQJzo7gBlvSh5o8vtRn3jWIMwo+Sr5ZKKw/jQ6JFVSj0XRfGiDq+Siu0K1deG x5GZEPgqcBKRgLUHqEkh/jFQzVDGvzzHnrbOFTLiLcFF0cUb7b+ReAzbRbllS23DTTzn +IEmwcMxKo76Mw91m8di7zXvIXL+gPKab+G/CnKfmedTJBWtLwwgdv96H4kY7aHE9suV 6goF5CoUaDSIiRlrmuuyme1xeDY2fZjaEsjk00T+hCJCQx+9zS3qHwo5q7nyq+YuT1g4 Kawg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from:ironport-sdr :ironport-sdr; bh=UdwQ+4pUvSPAbyqHjB81s5exRSJVaem75pKYr86CgzU=; b=hmb0FjT+92AW6hppvGZ3/7qp814X/r5sGVXtoKHhxXY18iOO8t/uIndBImgUqVhCkv IRwqCMk8U0Rn1giPFN6j6rBdOTWTvRB6HDdY1GK+9ZaXWisIUvoLxigngdkI4S5u7pvb KuqLWaAifRT/2TsJVq76Ks1QdOYPIvz01XlZisYREhebuSfibDi8t1qdELSNEdw6n1NL nlj3SzLW2lrGGA5VAFyvVd77j0mUGHAnj+G2m4DTmT0XVducVJ3h4a4XQlOKDi65t2QL V+LFMzK9Cz/1dUHXKAugZ/hwGfnXNYMr3FQcoKJAlU0nu5C8m9g/GoUph5YHZ9UIPvrO 2sXA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bt20si5389069edb.234.2021.02.18.23.03.13; Thu, 18 Feb 2021 23:03:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229546AbhBSHCi (ORCPT + 99 others); Fri, 19 Feb 2021 02:02:38 -0500 Received: from mga14.intel.com ([192.55.52.115]:1624 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbhBSHCg (ORCPT ); Fri, 19 Feb 2021 02:02:36 -0500 IronPort-SDR: Msa6xTfY7DKziBWH/YG7OVR4fGYYW2hZmcJdZijhC4atSrtLb7dbjcqTw8WooKFd6K+gyJ6HDi HeB1IBmkl8tQ== X-IronPort-AV: E=McAfee;i="6000,8403,9899"; a="182969067" X-IronPort-AV: E=Sophos;i="5.81,189,1610438400"; d="scan'208";a="182969067" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Feb 2021 23:00:46 -0800 IronPort-SDR: OoSkKFpDMCjVy7J1iY8HyeFHTwXDMeO2oOHxvszqtkrkFvuDAItXSnMmGi8tMi2WTnqDfqJ8gV jx1JsxDyHnbA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,189,1610438400"; d="scan'208";a="419864899" Received: from kbl-ppc.sh.intel.com ([10.239.159.163]) by fmsmga004.fm.intel.com with ESMTP; 18 Feb 2021 23:00:41 -0800 From: Jin Yao To: acme@kernel.org, jolsa@kernel.org, peterz@infradead.org, mingo@redhat.com, alexander.shishkin@linux.intel.com Cc: Linux-kernel@vger.kernel.org, ak@linux.intel.com, kan.liang@intel.com, yao.jin@intel.com, Jin Yao Subject: [PATCH] perf report: Create option to disable raw event ordering Date: Fri, 19 Feb 2021 15:00:05 +0800 Message-Id: <20210219070005.12397-1-yao.jin@linux.intel.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Warning "dso not found" is reported when using "perf report -D". 66702781413407 0x32c0 [0x30]: PERF_RECORD_SAMPLE(IP, 0x2): 28177/28177: 0x55e493e00563 period: 106578 addr: 0 ... thread: perf:28177 ...... dso: 66702727832429 0x9dd8 [0x38]: PERF_RECORD_COMM exec: triad_loop:28177/28177 The PERF_RECORD_SAMPLE event (timestamp: 66702781413407) should be after the PERF_RECORD_COMM event (timestamp: 66702727832429), but it's early processed. So for most of cases, it makes sense to keep the event ordered even for dump mode. But it would be also useful to disable ordered_events for reporting raw dump to see events as they are stored in the perf.data file. So now, set ordered_events by default to true and add a new option 'disable-order' to disable it. For example, perf report -D --disable-order Fixes: 977f739b7126b ("perf report: Disable ordered_events for raw dump") Signed-off-by: Jin Yao --- tools/perf/Documentation/perf-report.txt | 3 +++ tools/perf/builtin-report.c | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/perf/Documentation/perf-report.txt b/tools/perf/Documentation/perf-report.txt index f546b5e9db05..87112e8d904e 100644 --- a/tools/perf/Documentation/perf-report.txt +++ b/tools/perf/Documentation/perf-report.txt @@ -224,6 +224,9 @@ OPTIONS --dump-raw-trace:: Dump raw trace in ASCII. +--disable-order:: + Disable raw trace ordering. + -g:: --call-graph=:: Display call chains using type, min percent threshold, print limit, diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c index 2a845d6cac09..0d65c98794a8 100644 --- a/tools/perf/builtin-report.c +++ b/tools/perf/builtin-report.c @@ -84,6 +84,7 @@ struct report { bool nonany_branch_mode; bool group_set; bool stitch_lbr; + bool disable_order; int max_stack; struct perf_read_values show_threads_values; struct annotation_options annotation_opts; @@ -1296,6 +1297,8 @@ int cmd_report(int argc, const char **argv) OPTS_EVSWITCH(&report.evswitch), OPT_BOOLEAN(0, "total-cycles", &report.total_cycles_mode, "Sort all blocks by 'Sampled Cycles%'"), + OPT_BOOLEAN(0, "disable-order", &report.disable_order, + "Disable raw trace ordering"), OPT_END() }; struct perf_data data = { @@ -1329,7 +1332,7 @@ int cmd_report(int argc, const char **argv) if (report.mmaps_mode) report.tasks_mode = true; - if (dump_trace) + if (dump_trace && report.disable_order) report.tool.ordered_events = false; if (quiet) -- 2.17.1