Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp623162ybt; Fri, 10 Jul 2020 08:18:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzN+eLff2Hv4nh2gKcouiC4UaP+kRb8P6212r/GankqFo6e+H3lg/Z7S8xKKX4ZTq2+7pYs X-Received: by 2002:a17:906:f752:: with SMTP id jp18mr60986339ejb.538.1594394327288; Fri, 10 Jul 2020 08:18:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594394327; cv=none; d=google.com; s=arc-20160816; b=ibU9snrCSZcmFFXttN46UXj2GAMopcO6W74/sj0QrJMxTM64u2KdMxosQmhUX77oxZ u3m3JN5YIOz+081romeH+RAqlrnNPlcmuGzzOZidAGSnd/GAmlenqyb0evSb8X22hZmt xsxputTty9+4ZPDb9oxwxWwgxwoQdCXCx975mzxwbX0mtg5SKpuSNaB22V93NJH36OR1 tpF+Eq0qaEH8UJ/KLmGXUQDWJ0lQT90CYkggjbeI8U1ah0MHIs9K7dQmbHtIkxr2QaIM 8Q8V0Y1C0YNvQzNDDaLGKNQmwb+Kxkf8oFyOQ1EDTrCjWVURz4+SwjoM0mfsbmLb6T7E DoAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:references:in-reply-to :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=cWtNmIgnreFzO5fkowyRSZveKOCFIP14HPQ/Z36USLM=; b=l7UA6QWzZtMjuC2/G3xzUtkAVPLet4hE9W3kXkitXlIT5DmhIfKJrHkc28YurNwVkO FaiuCp60K1ySsB77w41r+dNBUcu8GCTeInsq1zNrIZzxkuA8F/mLXV15Oj2hzJciYfbr Fzs8pm6QKXavgowMB2DtqrJRmvXXaFoIlF/cX5y843eiAuMHLLKTxDTPpKgkBJakoYwJ 7ftrVN9US7vyH5Vpi/wope/sCJb8n69ZYaG1Ue+C/a1n8PgcPdbESQJZgzdFM9POC08b QVFYseLZvbDd4zV4afHBsPBPOEN+iJvnfOdx1yLQoiyipjH2r2uCgcbsIn57qw7jbQuZ QTkw== 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 q23si4550304edg.348.2020.07.10.08.18.24; Fri, 10 Jul 2020 08:18:47 -0700 (PDT) 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 S1728028AbgGJPPf (ORCPT + 99 others); Fri, 10 Jul 2020 11:15:35 -0400 Received: from mga09.intel.com ([134.134.136.24]:38264 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727098AbgGJPL7 (ORCPT ); Fri, 10 Jul 2020 11:11:59 -0400 IronPort-SDR: SR7gP8FbT1lJcDs1kMc9nAwjscGWHcqESmNaEeYS4KiJmZij44KHhEgxcvqJlVbFub3Ie2+aTz Yd54W747V/AA== X-IronPort-AV: E=McAfee;i="6000,8403,9678"; a="149686314" X-IronPort-AV: E=Sophos;i="5.75,336,1589266800"; d="scan'208";a="149686314" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jul 2020 08:11:58 -0700 IronPort-SDR: ERac0KsH8rDYb6wE9CiXgD83MZHzMxGi9MHpmN6pq+vAY5ZTGpqeoNO3synewSy9+/z9vy33ph LW1zZYUlPSKQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,336,1589266800"; d="scan'208";a="484675506" Received: from ahunter-desktop.fi.intel.com ([10.237.72.73]) by fmsmga005.fm.intel.com with ESMTP; 10 Jul 2020 08:11:56 -0700 From: Adrian Hunter To: Arnaldo Carvalho de Melo Cc: Jiri Olsa , Andi Kleen , linux-kernel@vger.kernel.org Subject: [PATCH V2 06/12] perf intel-pt: Use itrace error flags to suppress some errors Date: Fri, 10 Jul 2020 18:10:58 +0300 Message-Id: <20200710151104.15137-7-adrian.hunter@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200710151104.15137-1-adrian.hunter@intel.com> References: <20200710151104.15137-1-adrian.hunter@intel.com> Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The itrace "e" option may be followed by flags which affect what errors will or will not be reported. Each flag must be preceded by either '+' or '-'. The flags supported by Intel PT are: -o Suppress overflow errors -l Suppress trace data lost errors For example, for errors but not overflow or data lost errors: --itrace=e-o-l Suppressing those errors can be useful for testing and debugging because they are not due to decoding. Signed-off-by: Adrian Hunter --- tools/perf/Documentation/perf-intel-pt.txt | 9 ++++++++- tools/perf/util/intel-pt.c | 9 +++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/tools/perf/Documentation/perf-intel-pt.txt b/tools/perf/Documentation/perf-intel-pt.txt index f4cd49a7fcdb..20ac592a2641 100644 --- a/tools/perf/Documentation/perf-intel-pt.txt +++ b/tools/perf/Documentation/perf-intel-pt.txt @@ -871,7 +871,14 @@ Developer Manuals. Error events show where the decoder lost the trace. Error events are quite important. Users must know if what they are seeing is a complete -picture or not. +picture or not. The "e" option may be followed by flags which affect what errors +will or will not be reported. Each flag must be preceded by either '+' or '-'. +The flags supported by Intel PT are: + -o Suppress overflow errors + -l Suppress trace data lost errors +For example, for errors but not overflow or data lost errors: + + --itrace=e-o-l The "d" option will cause the creation of a file "intel_pt.log" containing all decoded packets and instructions. Note that this option slows down the decoder diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c index f09d4cfcd0fd..a1cb6a284a2b 100644 --- a/tools/perf/util/intel-pt.c +++ b/tools/perf/util/intel-pt.c @@ -1862,6 +1862,15 @@ static int intel_pt_synth_error(struct intel_pt *pt, int code, int cpu, char msg[MAX_AUXTRACE_ERROR_MSG]; int err; + if (pt->synth_opts.error_minus_flags) { + if (code == INTEL_PT_ERR_OVR && + pt->synth_opts.error_minus_flags & AUXTRACE_ERR_FLG_OVERFLOW) + return 0; + if (code == INTEL_PT_ERR_LOST && + pt->synth_opts.error_minus_flags & AUXTRACE_ERR_FLG_DATA_LOST) + return 0; + } + intel_pt__strerror(code, msg, MAX_AUXTRACE_ERROR_MSG); auxtrace_synth_error(&event.auxtrace_error, PERF_AUXTRACE_ERROR_ITRACE, -- 2.17.1