linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Adrian Hunter <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de,
	acme@redhat.com, adrian.hunter@intel.com, mingo@kernel.org,
	jolsa@redhat.com, hpa@zytor.com
Subject: [tip:perf/core] perf tools: Add Intel PT support for using CYC packets
Date: Thu, 27 Aug 2015 23:40:00 -0700	[thread overview]
Message-ID: <tip-0de802abd14abdf8cbbba28b421a1a00fa0939d5@git.kernel.org> (raw)
In-Reply-To: <1437150840-31811-24-git-send-email-adrian.hunter@intel.com>

Commit-ID:  0de802abd14abdf8cbbba28b421a1a00fa0939d5
Gitweb:     http://git.kernel.org/tip/0de802abd14abdf8cbbba28b421a1a00fa0939d5
Author:     Adrian Hunter <adrian.hunter@intel.com>
AuthorDate: Fri, 17 Jul 2015 19:33:58 +0300
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 24 Aug 2015 17:49:43 -0300

perf tools: Add Intel PT support for using CYC packets

CYC packets are a new Intel PT feature.

CYC packets provide even finer grain timestamp information than MTC and
TSC packets.  A CYC packet contains the number of CPU cycles since the
last CYC packet. Unlike MTC and TSC packets, CYC packets are only sent
when another packet is also sent.

Support for this feature is indicated by:

/sys/bus/event_source/devices/intel_pt/caps/psb_cyc

which contains "1" if the feature is supported and "0" otherwise.

CYC packets can be requested using a PMU config term e.g. perf record -e
intel_pt/cyc/u sleep 1

The frequency of CYC packets can also be specified.  e.g. perf record -e
intel_pt/cyc,cyc_thresh=2/u sleep 1

CYC packets are not requested by default.

Valid cyc_thresh values are given by:

/sys/bus/event_source/devices/intel_pt/caps/cycle_thresholds

which contains a hexadecimal value, the bits of which represent valid
values e.g. bit 2 set means value 2 is valid.

The value represents the minimum number of CPU cycles that must have
passed before a CYC packet can be sent.  The number of CPU cycles is:

    2 ^ (value - 1)

e.g. value 4 means 8 CPU cycles must pass before a CYC packet can be
sent.  Note a CYC packet is still only sent when another packet is sent,
not at, e.g. every 8 CPU cycles.

If an invalid value is entered, the error message will give a list of
valid values e.g.

    $ perf record -e intel_pt/cyc,cyc_thresh=15/u uname
    Invalid cyc_thresh for intel_pt. Valid values are: 0-12

tools/perf/Documentation/intel-pt.txt is updated in a later patch as
there are a number of new features being added.

For more information refer to the June 2015 or later Intel 64 and IA-32
Architectures SDM Chapter 36 Intel Processor Trace.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/1437150840-31811-24-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/arch/x86/util/intel-pt.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tools/perf/arch/x86/util/intel-pt.c b/tools/perf/arch/x86/util/intel-pt.c
index a5de01d..2ca10d7 100644
--- a/tools/perf/arch/x86/util/intel-pt.c
+++ b/tools/perf/arch/x86/util/intel-pt.c
@@ -475,6 +475,12 @@ static int intel_pt_validate_config(struct perf_pmu *intel_pt_pmu,
 	if (!evsel)
 		return 0;
 
+	err = intel_pt_val_config_term(intel_pt_pmu, "caps/cycle_thresholds",
+				       "cyc_thresh", "caps/psb_cyc",
+				       evsel->attr.config);
+	if (err)
+		return err;
+
 	err = intel_pt_val_config_term(intel_pt_pmu, "caps/mtc_periods",
 				       "mtc_period", "caps/mtc",
 				       evsel->attr.config);

  reply	other threads:[~2015-08-28  6:40 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-17 16:33 [PATCH V8 00/25] perf tools: Introduce an abstraction for AUX Area and Instruction Tracing Adrian Hunter
2015-07-17 16:33 ` [PATCH V8 01/25] perf auxtrace: Add Intel PT as an AUX area tracing type Adrian Hunter
2015-08-20  9:57   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-07-17 16:33 ` [PATCH V8 02/25] perf tools: Add Intel PT packet decoder Adrian Hunter
2015-08-20  9:57   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-07-17 16:33 ` [PATCH V8 03/25] perf tools: Add Intel PT instruction decoder Adrian Hunter
2015-08-12 20:55   ` Arnaldo Carvalho de Melo
2015-08-13  6:48     ` Adrian Hunter
2015-08-13  7:14       ` [PATCH V9 " Adrian Hunter
2015-08-13 12:37         ` Arnaldo Carvalho de Melo
2015-08-20  9:57         ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-07-17 16:33 ` [PATCH V8 04/25] perf tools: Add Intel PT log Adrian Hunter
2015-08-20  9:58   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-07-17 16:33 ` [PATCH V8 05/25] perf tools: Add Intel PT decoder Adrian Hunter
2015-08-20  9:58   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-07-17 16:33 ` [PATCH V8 06/25] perf tools: Add Intel PT support Adrian Hunter
2015-08-20  9:59   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-07-17 16:33 ` [PATCH V8 07/25] perf tools: Take Intel PT into use Adrian Hunter
2015-08-20  9:59   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-07-17 16:33 ` [PATCH V8 08/25] perf tools: Add Intel BTS support Adrian Hunter
2015-08-17 15:52   ` Arnaldo Carvalho de Melo
2015-08-17 17:43     ` Adrian Hunter
2015-08-17 17:58       ` Arnaldo Carvalho de Melo
2015-08-17 19:09         ` Adrian Hunter
2015-08-17 19:58           ` Arnaldo Carvalho de Melo
2015-08-18  6:39             ` Adrian Hunter
2015-08-18  9:09               ` Adrian Hunter
2015-08-18 16:10               ` Arnaldo Carvalho de Melo
2015-08-20  8:53                 ` Adrian Hunter
2015-08-21 14:18                   ` Arnaldo Carvalho de Melo
2015-08-22  6:52   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-07-17 16:33 ` [PATCH V8 09/25] perf tools: Put itrace options into an asciidoc include Adrian Hunter
2015-08-22  6:53   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-07-17 16:33 ` [PATCH V8 10/25] perf tools: Add example call-graph script Adrian Hunter
2015-08-21 15:00   ` Arnaldo Carvalho de Melo
2015-08-21 15:11     ` Arnaldo Carvalho de Melo
2015-08-21 15:21       ` Arnaldo Carvalho de Melo
2015-08-21 15:28         ` Arnaldo Carvalho de Melo
2015-08-21 15:32           ` Arnaldo Carvalho de Melo
2015-08-24  7:00           ` Adrian Hunter
2015-08-24 20:20             ` Arnaldo Carvalho de Melo
2015-08-22  6:53   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-07-17 16:33 ` [PATCH V8 11/25] perf auxtrace: Fix period type 'i' not working Adrian Hunter
2015-08-06 19:50   ` Arnaldo Carvalho de Melo
2015-08-07  7:22   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-07-17 16:33 ` [PATCH V8 12/25] perf tools: Fix perf-with-kcore handling of arguments containing spaces Adrian Hunter
2015-08-06 19:50   ` Arnaldo Carvalho de Melo
2015-08-07  7:22   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-07-17 16:33 ` [PATCH V8 13/25] perf tools: Fix Intel PT 'instructions' sample period Adrian Hunter
2015-08-28  6:37   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-07-17 16:33 ` [PATCH V8 14/25] perf tools: Add perf_pmu__format_bits() Adrian Hunter
2015-08-06 19:50   ` Arnaldo Carvalho de Melo
2015-08-07  7:23   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-07-17 16:33 ` [PATCH V8 15/25] perf tools: Validate config term maximum value Adrian Hunter
2015-08-06 19:50   ` Arnaldo Carvalho de Melo
2015-08-07  7:23   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-07-17 16:33 ` [PATCH V8 16/25] perf tools: Extend the event parser maximum error index Adrian Hunter
2015-08-06 19:50   ` Arnaldo Carvalho de Melo
2015-08-07  7:23   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-07-17 16:33 ` [PATCH V8 17/25] perf tools: Add Intel PT support for PSB periods Adrian Hunter
2015-08-28  6:38   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-07-17 16:33 ` [PATCH V8 18/25] perf tools: Add new Intel PT packet definitions Adrian Hunter
2015-08-28  6:38   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-07-17 16:33 ` [PATCH V8 19/25] perf tools: Pass Intel PT information for decoding MTC and CYC Adrian Hunter
2015-08-28  6:38   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-07-17 16:33 ` [PATCH V8 20/25] perf tools: Add Intel PT support for decoding MTC packets Adrian Hunter
2015-08-28  6:39   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-07-17 16:33 ` [PATCH V8 21/25] perf tools: Add Intel PT support for using " Adrian Hunter
2015-08-28  6:39   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-07-17 16:33 ` [PATCH V8 22/25] perf tools: Add Intel PT support for decoding CYC packets Adrian Hunter
2015-08-28  6:39   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-07-17 16:33 ` [PATCH V8 23/25] perf tools: Add Intel PT support for using " Adrian Hunter
2015-08-28  6:40   ` tip-bot for Adrian Hunter [this message]
2015-07-17 16:33 ` [PATCH V8 24/25] perf tools: Add Intel PT support for decoding TRACESTOP packets Adrian Hunter
2015-08-28  6:40   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-07-17 16:34 ` [PATCH V8 25/25] perf tools: Update Intel PT documentation Adrian Hunter
2015-08-28  6:40   ` [tip:perf/core] " tip-bot for Adrian Hunter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tip-0de802abd14abdf8cbbba28b421a1a00fa0939d5@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=acme@redhat.com \
    --cc=adrian.hunter@intel.com \
    --cc=hpa@zytor.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).