mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 08/18] tracing: print out start and stop in latency traces
Date: Fri, 04 Sep 2009 19:55:35 -0400	[thread overview]
Message-ID: <20090905000123.801815459@goodmis.org> (raw)
In-Reply-To: <20090904235527.520961911@goodmis.org>

[-- Attachment #1: 0008-tracing-print-out-start-and-stop-in-latency-traces.patch --]
[-- Type: text/plain, Size: 2687 bytes --]

From: Steven Rostedt <srostedt@redhat.com>

During development of the tracer, we would copy information from
the live tracer to the max tracer with one memcpy. Since then we
added a generic ring buffer and we handle the copies differently now.
Unfortunately, we never copied the critical section information, and
we lost the output:

 #  => started at: kmem_cache_alloc
 #  => ended at:   kmem_cache_alloc

This patch adds back the critical start and end copying as well as
removes the unused "trace_idx" and "overrun" fields of the
trace_array_cpu structure.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/trace.c |   19 +++++++++++--------
 kernel/trace/trace.h |    3 ---
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 0f08816..df2c9f7 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -407,19 +407,22 @@ static void
 __update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu)
 {
 	struct trace_array_cpu *data = tr->data[cpu];
+	struct trace_array_cpu *max_data = tr->data[cpu];
 
 	max_tr.cpu = cpu;
 	max_tr.time_start = data->preempt_timestamp;
 
-	data = max_tr.data[cpu];
-	data->saved_latency = tracing_max_latency;
+	max_data = max_tr.data[cpu];
+	max_data->saved_latency = tracing_max_latency;
+	max_data->critical_start = data->critical_start;
+	max_data->critical_end = data->critical_end;
 
 	memcpy(data->comm, tsk->comm, TASK_COMM_LEN);
-	data->pid = tsk->pid;
-	data->uid = task_uid(tsk);
-	data->nice = tsk->static_prio - 20 - MAX_RT_PRIO;
-	data->policy = tsk->policy;
-	data->rt_priority = tsk->rt_priority;
+	max_data->pid = tsk->pid;
+	max_data->uid = task_uid(tsk);
+	max_data->nice = tsk->static_prio - 20 - MAX_RT_PRIO;
+	max_data->policy = tsk->policy;
+	max_data->rt_priority = tsk->rt_priority;
 
 	/* record this tasks comm */
 	tracing_record_cmdline(tsk);
@@ -1501,7 +1504,7 @@ print_trace_header(struct seq_file *m, struct trace_iterator *iter)
 		seq_puts(m, "\n#  => ended at:   ");
 		seq_print_ip_sym(&iter->seq, data->critical_end, sym_flags);
 		trace_print_seq(m, &iter->seq);
-		seq_puts(m, "#\n");
+		seq_puts(m, "\n#\n");
 	}
 
 	seq_puts(m, "#\n");
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index e2c06b2..f2af713 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -234,9 +234,6 @@ struct trace_array_cpu {
 	atomic_t		disabled;
 	void			*buffer_page;	/* ring buffer spare */
 
-	/* these fields get copied into max-trace: */
-	unsigned long		trace_idx;
-	unsigned long		overrun;
 	unsigned long		saved_latency;
 	unsigned long		critical_start;
 	unsigned long		critical_end;
-- 
1.6.3.3

-- 

  parent reply	other threads:[~2009-09-05  0:03 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-04 23:55 [PATCH 00/18] tracing/ring-buffer: fixes for latency tracer [2.6.32] Steven Rostedt
2009-09-04 23:55 ` [PATCH 01/18] ring-buffer: do not reset while in a commit Steven Rostedt
2009-09-04 23:55 ` [PATCH 02/18] ring-buffer: do not swap buffers during " Steven Rostedt
2009-09-04 23:55 ` [PATCH 03/18] ring-buffer: remove unnecessary cpu_relax Steven Rostedt
2009-09-04 23:55 ` [PATCH 04/18] ring-buffer: fix ring_buffer_read crossing pages Steven Rostedt
2009-09-04 23:55 ` [PATCH 05/18] ring-buffer: remove ring_buffer_event_discard Steven Rostedt
2009-09-04 23:55 ` [PATCH 06/18] ring-buffer: do not count discarded events Steven Rostedt
2009-09-04 23:55 ` [PATCH 07/18] ring-buffer: disable all cpu buffers when one finds a problem Steven Rostedt
2009-09-04 23:55 ` Steven Rostedt [this message]
2009-09-04 23:55 ` [PATCH 09/18] tracing: disable update max tracer while reading trace Steven Rostedt
2009-09-04 23:55 ` [PATCH 10/18] tracing: disable buffers and synchronize_sched before resetting Steven Rostedt
2009-09-04 23:55 ` [PATCH 11/18] tracing: remove users of tracing_reset Steven Rostedt
2009-09-04 23:55 ` [PATCH 12/18] tracing: use timestamp to determine start of latency traces Steven Rostedt
2009-09-04 23:55 ` [PATCH 13/18] tracing: make tracing_reset safe for external use Steven Rostedt
2009-09-04 23:55 ` [PATCH 14/18] tracing: pass around ring buffer instead of tracer Steven Rostedt
2009-09-04 23:55 ` [PATCH 15/18] tracing: add trace_array_printk for internal tracers to use Steven Rostedt
2009-09-04 23:55 ` [PATCH 16/18] tracing: report error in trace if we fail to swap latency buffer Steven Rostedt
2009-09-04 23:55 ` [PATCH 17/18] ring-buffer: check for swapped buffers in start of committing Steven Rostedt
2009-09-04 23:55 ` [PATCH 18/18] ring-buffer: only enable ring_buffer_swap_cpu when needed Steven Rostedt
2009-09-05 15:06 ` [PATCH 00/18] tracing/ring-buffer: fixes for latency tracer [2.6.32] Arnaldo Carvalho de Melo
2009-09-07 10:20   ` Jan Blunck
2009-09-07 10:28     ` Frederic Weisbecker
2009-09-07 10:41       ` Jan Blunck
2009-09-07 11:22         ` Frederic Weisbecker
2009-09-08 14:42     ` Jan Blunck
2009-09-08 15:39       ` Steven Rostedt
2009-09-06  4:19 ` Ingo Molnar

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=20090905000123.801815459@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=acme@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.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

Powered by JetHome