Skip to contentSkip to conversation

updates for tip/tracing/ftrace

GIT PULL In review Steven Rostedt 4 participants 9 messages Mar 13, 2009 Tracing

lore
Share & tools
lore

Steven Rostedt

author maintainer
#0 lore raw

Ingo,

Please pull the latest tip/tracing/ftrace tree, which can be found at:

git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
tip/tracing/ftrace

Steven Rostedt (4):
tracing: left align location header in stack_trace
tracing: add comment for use of double __builtin_consant_p
tracing: move binary buffers into per cpu directory
softirq: no need to have SOFTIRQ in softirq name

----

 kernel/softirq.c           |    5 ++---
 kernel/trace/trace.c       |   26 +++++---------------------
 kernel/trace/trace.h       |    5 +++++
 kernel/trace/trace_stack.c |    4 ++--
 4 files changed, 14 insertions(+), 26 deletions(-)
author maintainer
#1 lore raw

PATCH 1/4 tracing: left align location header in stack_trace

From: Steven Rostedt <[email protected]>

Ingo Molnar suggested, instead of:

        Depth    Size      Location    (27 entries)
        -----    ----      --------
  0)     2880      48   lock_timer_base+0x2b/0x4f
  1)     2832      80   __mod_timer+0x33/0xe0
  2)     2752      16   __ide_set_handler+0x63/0x65

To have it be:

        Depth    Size   Location    (27 entries)
        -----    ----   --------
  0)     2880      48   lock_timer_base+0x2b/0x4f
  1)     2832      80   __mod_timer+0x33/0xe0
  2)     2752      16   __ide_set_handler+0x63/0x65
---
 kernel/trace/trace_stack.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
kernel/trace/trace_stack.c +2 -2
index 91ccbf3..c750f65 100644
@@ -262,9 +262,9 @@ static int t_show(struct seq_file *m, void *v)
 	int size;
 
 	if (v == SEQ_START_TOKEN) {
-		seq_printf(m, "        Depth    Size      Location"
+		seq_printf(m, "        Depth    Size   Location"
 			   "    (%d entries)\n"
-			   "        -----    ----      --------\n",
+			   "        -----    ----   --------\n",
 			   max_stack_trace.nr_entries);
 
 		if (!stack_tracer_enabled && !max_stack_size)
Signature · 3 lines
1.6.1.3

-- 
author maintainer
#2 lore raw

PATCH 2/4 tracing: add comment for use of double __builtin_consant_p

In reply to Steven Rostedt

From: Steven Rostedt <[email protected]>

Impact: documentation

The use of the double __builtin_contant_p checks in the event_trace_printk can be confusing to developers and reviewers. This patch adds a comment to explain why it is there.

LKML-Reference: <[email protected]>

---
 kernel/trace/trace.h |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
kernel/trace/trace.h +5 -0
index 35cfa7b..67595b8 100644
@@ -776,6 +776,11 @@ extern struct ftrace_event_call __stop_ftrace_events[];
 extern const char *__start___trace_bprintk_fmt[];
 extern const char *__stop___trace_bprintk_fmt[];
 
+/*
+ * The double __builtin_constant_p is because gcc will give us an error
+ * if we try to allocate the static variable to fmt if it is not a
+ * constant. Even with the outer if statement optimizing out.
+ */
 #define event_trace_printk(ip, fmt, args...)				\
 do {									\
 	__trace_printk_check_format(fmt, ##args);			\
Signature · 3 lines
1.6.1.3

-- 
author maintainer
#3 lore raw

PATCH 3/4 tracing: move binary buffers into per cpu directory

In reply to Steven Rostedt

From: Steven Rostedt <[email protected]>

The binary_buffers directory in /debugfs/tracing held the files to read the trace buffers in a binary format. This held one file per CPU buffer. But we also have a per_cpu directory that holds a way to read the pretty-print formats.

This patch moves the binary buffers into the per_cpu_directory:

 # ls /debug/tracing/per_cpu/cpu1/
trace  trace_pipe  trace_pipe_raw

The new name is called "trace_pipe_raw". The binary buffers always acted similar to trace_pipe, except that they produce raw data.

---
 kernel/trace/trace.c |   26 +++++---------------------
 1 files changed, 5 insertions(+), 21 deletions(-)
kernel/trace/trace.c +5 -21
index dbb077d..efe3202 100644
@@ -3543,6 +3543,11 @@ static void tracing_init_debugfs_percpu(long cpu)
 				(void *) cpu, &tracing_fops);
 	if (!entry)
 		pr_warning("Could not create debugfs 'trace' entry\n");
+
+	entry = debugfs_create_file("trace_pipe_raw", 0444, d_cpu,
+				    (void *) cpu, &tracing_buffers_fops);
+	if (!entry)
+		pr_warning("Could not create debugfs 'trace_pipe_raw' entry\n");
 }
 
 #ifdef CONFIG_FTRACE_SELFTEST
@@ -3826,7 +3831,6 @@ static __init void create_trace_options_dir(void)
 static __init int tracer_init_debugfs(void)
 {
 	struct dentry *d_tracer;
-	struct dentry *buffers;
 	struct dentry *entry;
 	int cpu;
 
@@ -3899,26 +3903,6 @@ static __init int tracer_init_debugfs(void)
 		pr_warning("Could not create debugfs "
 			   "'trace_marker' entry\n");
 
-	buffers = debugfs_create_dir("binary_buffers", d_tracer);
-
-	if (!buffers)
-		pr_warning("Could not create buffers directory\n");
-	else {
-		int cpu;
-		char buf[64];
-
-		for_each_tracing_cpu(cpu) {
-			sprintf(buf, "%d", cpu);
-
-			entry = debugfs_create_file(buf, 0444, buffers,
-						    (void *)(long)cpu,
-						    &tracing_buffers_fops);
-			if (!entry)
-				pr_warning("Could not create debugfs buffers "
-					   "'%s' entry\n", buf);
-		}
-	}
-
 #ifdef CONFIG_DYNAMIC_FTRACE
 	entry = debugfs_create_file("dyn_ftrace_total_info", 0444, d_tracer,
 				    &ftrace_update_tot_cnt,
Signature · 3 lines
1.6.1.3

-- 
#4 lore raw

Re: [PATCH 3/4] tracing: move binary buffers into per cpu directory

kernel/trace/trace.c static void tracing_init_debugfs_percpu(long cpu) · line 3550

Quoted 7 lines · On Fri, 13 Mar 2009 01:04:49 -0400 Steven Rostedt <[email protected]> wrote:
kernel/trace/trace.c +5 -0
 	if (!entry)
 		pr_warning("Could not create debugfs 'trace' entry\n");
+
+	entry = debugfs_create_file("trace_pipe_raw", 0444, d_cpu,
+				    (void *) cpu, &tracing_buffers_fops);
+	if (!entry)
+		pr_warning("Could not create debugfs 'trace_pipe_raw' entry\n");

Maybe we should just do the warning in debugfs_create_file(). It's hard to think of a scenario where we wouldn't want this failure to be reported.

If there is such a scenario then debugfs_create_file_nowarn() beckons.

author maintainer
#5 lore raw

PATCH 4/4 softirq: no need to have SOFTIRQ in softirq name

In reply to Steven Rostedt

From: Steven Rostedt <[email protected]>

Impact: clean up

It is redundant to have 'SOFTIRQ' in the softirq names.

---
 kernel/softirq.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
kernel/softirq.c +2 -3
index a5e8123..65ff3e3 100644
@@ -55,9 +55,8 @@ static struct softirq_action softirq_vec[NR_SOFTIRQS] __cacheline_aligned_in_smp
 static DEFINE_PER_CPU(struct task_struct *, ksoftirqd);
 
 char *softirq_to_name[NR_SOFTIRQS] = {
-	"HI_SOFTIRQ", "TIMER_SOFTIRQ", "NET_TX_SOFTIRQ", "NET_RX_SOFTIRQ",
-	"BLOCK_SOFTIRQ", "TASKLET_SOFTIRQ", "SCHED_SOFTIRQ", "HRTIMER_SOFTIRQ",
-	"RCU_SOFTIRQ"
+	"HI", "TIMER", "NET_TX", "NET_RX", "BLOCK",
+	"TASKLET", "SCHED", "HRTIMER",	"RCU"
 };
 
 /*
Signature · 3 lines
1.6.1.3

-- 
#6 lore raw

Re: [PATCH 4/4] softirq: no need to have SOFTIRQ in softirq name

Quoted 17 lines · On Fri, 13 Mar 2009 01:04:50 -0400 Steven Rostedt <[email protected]> wrote:

From: Steven Rostedt <[email protected]>

Impact: clean up

It is redundant to have 'SOFTIRQ' in the softirq names.

---
 kernel/softirq.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
kernel/softirq.c +0 -0
index a5e8123..65ff3e3 100644

kernel/softirq.c static struct softirq_action softirq_vec[NR_SOFTIRQS] __cacheline_aligned_in_smp · line 61

Quoted 10 lines
kernel/softirq.c +2 -3
@@ -55,9 +55,8 @@ static struct softirq_action softirq_vec[NR_SOFTIRQS] __cacheline_aligned_in_smp
 static DEFINE_PER_CPU(struct task_struct *, ksoftirqd);
 
 char *softirq_to_name[NR_SOFTIRQS] = {
-	"HI_SOFTIRQ", "TIMER_SOFTIRQ", "NET_TX_SOFTIRQ", "NET_RX_SOFTIRQ",
-	"BLOCK_SOFTIRQ", "TASKLET_SOFTIRQ", "SCHED_SOFTIRQ", "HRTIMER_SOFTIRQ",
-	"RCU_SOFTIRQ"
+	"HI", "TIMER", "NET_TX", "NET_RX", "BLOCK",
+	"TASKLET", "SCHED", "HRTIMER",	"RCU"
 };
 

hm, I was thinking that you'd also do

	printk("%s_SOFTIRQ", ...)

but whatever.

#7 lore raw

Re: [PATCH 4/4] softirq: no need to have SOFTIRQ in softirq name

In reply to Steven Rostedt
Quoted 19 lines · Steven Rostedt

plain text document attachment (0004-softirq-no-need-to-have-SOFTIRQ-in-softirq-name.patch)
From: Steven Rostedt <[email protected]>

Impact: clean up

It is redundant to have 'SOFTIRQ' in the softirq names.

---
 kernel/softirq.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
kernel/softirq.c +0 -0
index a5e8123..65ff3e3 100644

kernel/softirq.c static struct softirq_action softirq_vec[NR_SOFTIRQS] __cacheline_aligned_in_smp · line 61

Quoted 10 lines
kernel/softirq.c +2 -3
@@ -55,9 +55,8 @@ static struct softirq_action softirq_vec[NR_SOFTIRQS] __cacheline_aligned_in_smp
 static DEFINE_PER_CPU(struct task_struct *, ksoftirqd);
 
 char *softirq_to_name[NR_SOFTIRQS] = {
-	"HI_SOFTIRQ", "TIMER_SOFTIRQ", "NET_TX_SOFTIRQ", "NET_RX_SOFTIRQ",
-	"BLOCK_SOFTIRQ", "TASKLET_SOFTIRQ", "SCHED_SOFTIRQ", "HRTIMER_SOFTIRQ",
-	"RCU_SOFTIRQ"
+	"HI", "TIMER", "NET_TX", "NET_RX", "BLOCK",
+	"TASKLET", "SCHED", "HRTIMER",	"RCU"
 };
 

This will look more better:

+ "HI", "TIMER", "NET_TX",
+ "NET_RX", "BLOCK", "TASKLET",
+ "SCHED", "HRTIMER", "RCU"

--
JSR

#8 lore raw
In reply to Steven Rostedt
Quoted 15 lines · Steven Rostedt

Ingo,

Please pull the latest tip/tracing/ftrace tree, which can be found at:

git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
tip/tracing/ftrace

Steven Rostedt (4):
tracing: left align location header in stack_trace
tracing: add comment for use of double __builtin_consant_p
tracing: move binary buffers into per cpu directory
softirq: no need to have SOFTIRQ in softirq name

Quoted 6 lines

----

 kernel/softirq.c           |    5 ++---
 kernel/trace/trace.c       |   26 +++++---------------------
 kernel/trace/trace.h       |    5 +++++
 kernel/trace/trace_stack.c |    4 ++--
 4 files changed, 14 insertions(+), 26 deletions(-)

Pulled, thanks Steve!

Ingo