[PATCH 14/15] small_traces: Remove trace output of large fields.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: David Sharp
Date: Friday, December 3, 2010 - 5:13 pm

Google-Bug-Id: 3224547

Signed-off-by: David Sharp <dhsharp@google.com>
---
 kernel/trace/trace.c        |    6 ++++++
 kernel/trace/trace_output.c |   18 ++++++++++++++++++
 2 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index ed5c14f..177d4e5 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -1747,6 +1747,7 @@ static void s_stop(struct seq_file *m, void *p)
 
 static void print_lat_help_header(struct seq_file *m)
 {
+#ifndef CONFIG_SMALL_TRACES
 	seq_puts(m, "#                  _------=> CPU#            \n");
 	seq_puts(m, "#                 / _-----=> irqs-off        \n");
 	seq_puts(m, "#                | / _----=> need-resched    \n");
@@ -1756,6 +1757,11 @@ static void print_lat_help_header(struct seq_file *m)
 	seq_puts(m, "#                |||||/     delay             \n");
 	seq_puts(m, "#  cmd     pid   |||||| time  |   caller      \n");
 	seq_puts(m, "#     \\   /      ||||||   \\   |   /           \n");
+#else
+	seq_puts(m, "#               CPU#   delay             \n");
+	seq_puts(m, "#  cmd     pid   | time  |   caller      \n");
+	seq_puts(m, "#     \\   /      |   \\   |   /           \n");
+#endif
 }
 
 static void print_func_help_header(struct seq_file *m)
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
index 9e33b1f..d5d7575 100644
--- a/kernel/trace/trace_output.c
+++ b/kernel/trace/trace_output.c
@@ -531,6 +531,7 @@ seq_print_ip_sym(struct trace_seq *s, unsigned long ip, unsigned long sym_flags)
  * Prints the generic fields of irqs off, in hard or softirq, preempt
  * count and lock depth.
  */
+#ifndef CONFIG_SMALL_TRACES
 int trace_print_lat_fmt(struct trace_seq *s, struct trace_entry *entry)
 {
 	int ret;
@@ -566,6 +567,12 @@ int trace_print_lat_fmt(struct trace_seq *s, struct trace_entry *entry)
 
 	return trace_seq_printf(s, "%d", entry->lock_depth);
 }
+#else
+int trace_print_lat_fmt(struct trace_seq *s, struct trace_entry *entry)
+{
+	return 1;
+}
+#endif
 
 static int
 lat_print_generic(struct trace_seq *s, struct trace_entry *entry, int cpu)
@@ -628,6 +635,7 @@ int trace_print_lat_context(struct trace_iterator *iter)
 
 		trace_find_cmdline(entry->pid, comm);
 
+#ifndef CONFIG_SMALL_TRACES
 		ret = trace_seq_printf(s, "%16s %5d %3d %d %08x %08lx [%08llx]"
 				       " %ld.%03ldms (+%ld.%03ldms): ", comm,
 				       entry->pid, iter->cpu, entry->flags,
@@ -637,6 +645,16 @@ int trace_print_lat_context(struct trace_iterator *iter)
 				       abs_usecs % USEC_PER_MSEC,
 				       rel_usecs / USEC_PER_MSEC,
 				       rel_usecs % USEC_PER_MSEC);
+#else
+		ret = trace_seq_printf(s, "%16s %5d %3d %08lx [%08llx]"
+				       " %ld.%03ldms (+%ld.%03ldms): ", comm,
+				       entry->pid, iter->cpu, iter->idx,
+				       ns2usecs(iter->ts),
+				       abs_usecs / USEC_PER_MSEC,
+				       abs_usecs % USEC_PER_MSEC,
+				       rel_usecs / USEC_PER_MSEC,
+				       rel_usecs % USEC_PER_MSEC);
+#endif
 	} else {
 		ret = lat_print_generic(s, entry, iter->cpu);
 		if (ret)
-- 
1.7.3.1

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[Patch 00/15] Reduce tracing payload size., David Sharp, (Fri Dec 3, 5:13 pm)
[PATCH 04/15] ftrace: pack event structures., David Sharp, (Fri Dec 3, 5:13 pm)
[PATCH 10/15] ftrace: fix event alignment: jbd2:*, David Sharp, (Fri Dec 3, 5:13 pm)
[PATCH 11/15] ftrace: fix event alignment: ext4:*, David Sharp, (Fri Dec 3, 5:13 pm)
[PATCH 14/15] small_traces: Remove trace output of large f ..., David Sharp, (Fri Dec 3, 5:13 pm)
Re: [PATCH 10/15] ftrace: fix event alignment: jbd2:*, Steven Rostedt, (Fri Dec 3, 6:52 pm)
Re: [PATCH 11/15] ftrace: fix event alignment: ext4:*, Steven Rostedt, (Fri Dec 3, 6:53 pm)
Re: [Patch 00/15] Reduce tracing payload size., Andi Kleen, (Mon Dec 6, 6:22 am)
Re: [Patch 00/15] Reduce tracing payload size., Ted Ts'o, (Mon Dec 6, 6:56 am)
Re: [Patch 00/15] Reduce tracing payload size., Andi Kleen, (Mon Dec 6, 7:58 am)
Re: [Patch 00/15] Reduce tracing payload size., Steven Rostedt, (Mon Dec 6, 9:17 am)
Re: [Patch 00/15] Reduce tracing payload size., Miguel Ojeda, (Mon Dec 6, 9:31 am)
Re: [Patch 00/15] Reduce tracing payload size., Andi Kleen, (Mon Dec 6, 9:41 am)
[PATCH] tracing: Add an 'overwrite' trace_option., David Sharp, (Wed Dec 8, 2:46 pm)
Re: [PATCH 08/15] ftrace: fix event alignment: mce:mce_record, Frederic Weisbecker, (Thu Dec 9, 6:33 am)
Re: [PATCH 13/15] small_traces: Add config option to shrin ..., Frederic Weisbecker, (Thu Dec 9, 7:55 am)
Re: [PATCH 13/15] small_traces: Add config option to shrin ..., Frederic Weisbecker, (Thu Dec 9, 8:28 am)
Re: [PATCH] tracing: Add an 'overwrite' trace_option., David Sharp, (Mon Dec 13, 5:39 pm)