linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Peter Zijlstra <peterz@infradead.org>,
	Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: linux-kernel@vger.kernel.org, David Ahern <dsahern@gmail.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@gmail.com>,
	Stephane Eranian <eranian@google.com>
Subject: [PATCH 42/44] perf tools: Intel PT to always update thread stack trace number
Date: Thu,  9 Apr 2015 18:54:22 +0300	[thread overview]
Message-ID: <1428594864-29309-43-git-send-email-adrian.hunter@intel.com> (raw)
In-Reply-To: <1428594864-29309-1-git-send-email-adrian.hunter@intel.com>

The enhanced thread stack is used by higher layers but still
requires the trace number.  The trace number is used to
distinguish discontinuous sections of trace (for example
from Snapshot mode or Sample mode), which cause the thread
stack to be flushed.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
 tools/perf/util/intel-pt.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c
index 11c0445..5994356 100644
--- a/tools/perf/util/intel-pt.c
+++ b/tools/perf/util/intel-pt.c
@@ -302,7 +302,7 @@ static int intel_pt_get_trace(struct intel_pt_buffer *b, void *data)
 	if (!old_buffer || ptq->pt->sampling_mode || (ptq->pt->snapshot_mode &&
 						      !buffer->consecutive)) {
 		b->consecutive = false;
-		b->trace_nr = buffer->buffer_nr;
+		b->trace_nr = buffer->buffer_nr + 1;
 	} else {
 		b->consecutive = true;
 	}
@@ -1101,6 +1101,8 @@ static int intel_pt_sample(struct intel_pt_queue *ptq)
 		thread_stack__event(ptq->thread, ptq->flags, state->from_ip,
 				    state->to_ip, ptq->insn_len,
 				    state->trace_nr);
+	else
+		thread_stack__set_trace_nr(ptq->thread, state->trace_nr);
 
 	if (pt->sample_branches) {
 		err = intel_pt_synth_branch_sample(ptq);
-- 
1.9.1


  parent reply	other threads:[~2015-04-09 15:59 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-09 15:53 [PATCH 00/44] perf tools: Introduce an abstraction for AUX Area and Instruction Tracing Adrian Hunter
2015-04-09 15:53 ` [PATCH 01/44] perf header: Add AUX area tracing feature Adrian Hunter
2015-05-06  2:58   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-04-09 15:53 ` [PATCH 02/44] perf evlist: Add support for mmapping an AUX area buffer Adrian Hunter
2015-05-06  2:58   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-04-09 15:53 ` [PATCH 03/44] perf tools: Add user events for AUX area tracing Adrian Hunter
2015-04-20 23:06   ` Arnaldo Carvalho de Melo
2015-04-20 23:10     ` Arnaldo Carvalho de Melo
2015-04-21  9:23     ` Adrian Hunter
2015-05-06  2:59   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-04-09 15:53 ` [PATCH 04/44] perf tools: Add support for AUX area recording Adrian Hunter
2015-04-20 23:17   ` Arnaldo Carvalho de Melo
2015-05-06  2:59   ` [tip:perf/core] perf auxtrace: " tip-bot for Adrian Hunter
2015-04-09 15:53 ` [PATCH 05/44] perf record: Add basic AUX area tracing support Adrian Hunter
2015-05-06  2:59   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-04-09 15:53 ` [PATCH 06/44] perf record: Extend -m option for AUX area tracing mmap pages Adrian Hunter
2015-05-06  2:59   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-04-09 15:53 ` [PATCH 07/44] perf tools: Add a user event for AUX area tracing errors Adrian Hunter
2015-05-06  3:00   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-04-09 15:53 ` [PATCH 08/44] perf session: Add hooks to allow transparent decoding of AUX area tracing data Adrian Hunter
2015-04-21 14:41   ` Arnaldo Carvalho de Melo
2015-04-21 14:46     ` Arnaldo Carvalho de Melo
2015-05-06  3:00   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-04-09 15:53 ` [PATCH 09/44] perf session: Add instruction tracing options Adrian Hunter
2015-04-21 14:50   ` Arnaldo Carvalho de Melo
2015-04-22  6:23     ` Adrian Hunter
2015-04-23 14:08       ` Arnaldo Carvalho de Melo
2015-05-06  3:00   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-04-09 15:53 ` [PATCH 10/44] perf auxtrace: Add helpers for AUX area tracing errors Adrian Hunter
2015-05-06  3:01   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-04-09 15:53 ` [PATCH 11/44] perf auxtrace: Add helpers for queuing AUX area tracing data Adrian Hunter
2015-04-21  9:21   ` [PATCH V2 " Adrian Hunter
2015-05-06  3:01     ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-04-09 15:53 ` [PATCH 12/44] perf auxtrace: Add a heap for sorting AUX area tracing queues Adrian Hunter
2015-04-21 15:01   ` Arnaldo Carvalho de Melo
2015-05-06  3:01   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-04-09 15:53 ` [PATCH 13/44] perf auxtrace: Add processing for AUX area tracing events Adrian Hunter
2015-05-06  3:01   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-04-09 15:53 ` [PATCH 14/44] perf auxtrace: Add a hashtable for caching Adrian Hunter
2015-05-06  3:02   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-04-09 15:53 ` [PATCH 15/44] perf tools: Add member to struct dso for an instruction cache Adrian Hunter
2015-05-06  3:02   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-04-09 15:53 ` [PATCH 16/44] perf script: Add Instruction Tracing support Adrian Hunter
2015-05-06  3:02   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-04-09 15:53 ` [PATCH 17/44] perf script: Always allow fields 'addr' and 'cpu' for auxtrace Adrian Hunter
2015-04-09 15:53 ` [PATCH 18/44] perf report: Add Instruction Tracing support Adrian Hunter
2015-04-23 14:16   ` Arnaldo Carvalho de Melo
2015-04-09 15:53 ` [PATCH 19/44] perf inject: Re-pipe AUX area tracing events Adrian Hunter
2015-04-21  9:21   ` [PATCH V2 " Adrian Hunter
2015-05-06  3:03     ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-04-09 15:54 ` [PATCH 20/44] perf inject: Add Instruction Tracing support Adrian Hunter
2015-05-06  3:03   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-04-09 15:54 ` [PATCH 21/44] perf tools: Add AUX area tracing index Adrian Hunter
2015-04-09 15:54 ` [PATCH 22/44] perf tools: Hit all build ids when AUX area tracing Adrian Hunter
2015-04-09 15:54 ` [PATCH 23/44] perf tools: Add build option NO_AUXTRACE to exclude " Adrian Hunter
2015-04-21  9:21   ` [PATCH V2 " Adrian Hunter
2015-04-09 15:54 ` [PATCH 24/44] perf auxtrace: Add option to synthesize events for transactions Adrian Hunter
2015-04-09 15:54 ` [PATCH 25/44] perf script: Add field option 'flags' to print sample flags Adrian Hunter
2015-05-06  3:03   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-04-09 15:54 ` [PATCH 26/44] perf tools: Add aux_watermark member of struct perf_event_attr Adrian Hunter
2015-05-06  3:03   ` [tip:perf/core] " tip-bot for Adrian Hunter
2015-04-09 15:54 ` [PATCH 27/44] perf tools: Add support for PERF_RECORD_AUX Adrian Hunter
2015-04-09 15:54 ` [PATCH 28/44] perf tools: Add support for PERF_RECORD_ITRACE_START Adrian Hunter
2015-04-09 15:54 ` [PATCH 29/44] perf tools: Add AUX area tracing Snapshot Mode Adrian Hunter
2015-04-09 15:54 ` [PATCH 30/44] perf record: Add AUX area tracing Snapshot Mode support Adrian Hunter
2015-04-09 15:54 ` [PATCH 31/44] perf auxtrace: Add Intel PT as an AUX area tracing type Adrian Hunter
2015-04-09 15:54 ` [PATCH 32/44] perf tools: Add Intel PT packet decoder Adrian Hunter
2015-04-09 15:54 ` [PATCH 33/44] perf tools: Add Intel PT instruction decoder Adrian Hunter
2015-04-09 15:54 ` [PATCH 34/44] perf tools: Add Intel PT log Adrian Hunter
2015-04-09 15:54 ` [PATCH 35/44] perf tools: Add Intel PT decoder Adrian Hunter
2015-04-09 15:54 ` [PATCH 36/44] perf tools: Add Intel PT support Adrian Hunter
2015-04-09 15:54 ` [PATCH 37/44] perf tools: Take Intel PT into use Adrian Hunter
2015-04-09 15:54 ` [PATCH 38/44] perf tools: Allow auxtrace data alignment Adrian Hunter
2015-04-09 15:54 ` [PATCH 39/44] perf tools: Add Intel BTS support Adrian Hunter
2015-04-09 15:54 ` [PATCH 40/44] perf tools: Output sample flags and insn_len from intel_pt Adrian Hunter
2015-04-09 15:54 ` [PATCH 41/44] perf tools: Output sample flags and insn_len from intel_bts Adrian Hunter
2015-04-09 15:54 ` Adrian Hunter [this message]
2015-04-09 15:54 ` [PATCH 43/44] perf tools: Intel BTS to always update thread stack trace number Adrian Hunter
2015-04-09 15:54 ` [PATCH 44/44] perf tools: Add example call-graph script 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=1428594864-29309-43-git-send-email-adrian.hunter@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=acme@kernel.org \
    --cc=dsahern@gmail.com \
    --cc=eranian@google.com \
    --cc=fweisbec@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=namhyung@gmail.com \
    --cc=peterz@infradead.org \
    /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).