Skip to contentSkip to conversation

tracing/sysprof: add missing tracing_{start,stop}_record_cmdline()

PATCH Applied Frederic Weisbecker 4 participants 13 messages Feb 10, 2009 – Feb 11, 2009 Tracing

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 tracing/sysprof: add missing tracing_{start,stop}_record_cmdline()

Add the missing pair tracing_{start,stop}_record_cmdline() to record well the cmdline associated with pid.

---
 kernel/trace/trace_sysprof.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
kernel/trace/trace_sysprof.c +3 -0
index 84ca9d8..9902c15 100644
@@ -238,6 +238,8 @@ static int stack_trace_init(struct trace_array *tr)
 {
 	sysprof_trace = tr;
 
+	tracing_start_cmdline_record();
+
 	mutex_lock(&sample_timer_lock);
 	start_stack_timers();
 	tracer_enabled = 1;
@@ -247,6 +249,7 @@ static int stack_trace_init(struct trace_array *tr)
 
 static void stack_trace_reset(struct trace_array *tr)
 {
+	tracing_stop_cmdline_record();
 	stop_stack_trace(tr);
 }
 
Signature · 1 line
1.6.1
Applied
#1 lore raw
Quoted 7 lines · Frederic Weisbecker

Add the missing pair tracing_{start,stop}_record_cmdline() to record well the cmdline associated with pid.

---
 kernel/trace/trace_sysprof.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

applied to tip/tracing/sysprof, thanks Frederic!

Ingo

#2 lore raw
Quoted 11 lines · Ingo Molnar
Quoted 7 lines · Frederic Weisbecker

Add the missing pair tracing_{start,stop}_record_cmdline() to record well the cmdline associated with pid.

---
 kernel/trace/trace_sysprof.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

applied to tip/tracing/sysprof, thanks Frederic!

hm, causes a build failure:

kernel/built-in.o: In function `stack_trace_reset':
trace_sysprof.c:(.text+0x3e91a): undefined reference to tracing_stop_cmdline_record' kernel/built-in.o: In function stack_trace_init':
trace_sysprof.c:(.text+0x3e953): undefined reference to `tracing_start_cmdline_record'

Ingo

#11 lore raw
In reply to Frederic Weisbecker

Em Tue, Feb 10, 2009 at 04:43:30AM +0100, Frederic Weisbecker escreveu:

Quoted 4 lines

Add the missing pair tracing_{start,stop}_record_cmdline() to record well the cmdline associated with pid.

This is another thing that I think begs for a TRACE_INIT_CMDLINE in struct trace->flags so that just before calling ->init we call tracing_start_cmdline_record? no?

Another thing I noticed is that even we having a ->stop most of the time this semantic action is done thru ->reset :-\

- Arnaldo

Quoted 23 lines
 kernel/trace/trace_sysprof.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
kernel/trace/trace_sysprof.c +3 -0
index 84ca9d8..9902c15 100644
@@ -238,6 +238,8 @@ static int stack_trace_init(struct trace_array *tr)
 {
 	sysprof_trace = tr;
 
+	tracing_start_cmdline_record();
+
 	mutex_lock(&sample_timer_lock);
 	start_stack_timers();
 	tracer_enabled = 1;
@@ -247,6 +249,7 @@ static int stack_trace_init(struct trace_array *tr)
 
 static void stack_trace_reset(struct trace_array *tr)
 {
+	tracing_stop_cmdline_record();
 	stop_stack_trace(tr);
 }
#3 lore raw
In reply to Ingo Molnar
Quoted 15 lines · Ingo Molnar
Quoted 11 lines · Ingo Molnar
Quoted 7 lines · Frederic Weisbecker

Add the missing pair tracing_{start,stop}_record_cmdline() to record well the cmdline associated with pid.

---
 kernel/trace/trace_sysprof.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

applied to tip/tracing/sysprof, thanks Frederic!

Quoted 8 lines

hm, causes a build failure:

kernel/built-in.o: In function `stack_trace_reset':
trace_sysprof.c:(.text+0x3e91a): undefined reference to tracing_stop_cmdline_record' kernel/built-in.o: In function stack_trace_init':
trace_sysprof.c:(.text+0x3e953): undefined reference to `tracing_start_cmdline_record'

Ingo

Sorry, this fixlet solves the problem:

--

Quoted 1 line

From 97113f668e9aef7ba101fbb3399e5ebb27aeec4c Mon Sep 17 00:00:00 2001

From: Frederic Weisbecker <[email protected]>
Date: Tue, 10 Feb 2009 15:07:22 +0100
Subject: [PATCH] tracing/sysprof: fix a build error on sysprof tracer

Fix the following build error:

kernel/built-in.o: In function `stack_trace_reset':
trace_sysprof.c:(.text+0x3e91a): undefined reference to tracing_stop_cmdline_record' kernel/built-in.o: In function stack_trace_init':
trace_sysprof.c:(.text+0x3e953): undefined reference to `tracing_start_cmdline_record'

---
 kernel/trace/Kconfig |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
kernel/trace/Kconfig +1 -0
index 79be773..620f9cd 100644
@@ -134,6 +134,7 @@ config SYSPROF_TRACER
 	bool "Sysprof Tracer"
 	depends on X86
 	select TRACING
+	select CONTEXT_SWITCH_TRACER
 	help
 	  This tracer provides the trace needed by the 'Sysprof' userspace
 	  tool.
Signature · 1 line
1.6.1
#4 lore raw
Quoted 18 lines · Frederic Weisbecker
Quoted 17 lines · Ingo Molnar
Quoted 11 lines · Ingo Molnar
Quoted 7 lines · Frederic Weisbecker

Add the missing pair tracing_{start,stop}_record_cmdline() to record well the cmdline associated with pid.

---
 kernel/trace/trace_sysprof.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

applied to tip/tracing/sysprof, thanks Frederic!

hm, causes a build failure:

Quoted 8 lines
Quoted 6 lines

kernel/built-in.o: In function `stack_trace_reset':
trace_sysprof.c:(.text+0x3e91a): undefined reference to tracing_stop_cmdline_record' kernel/built-in.o: In function stack_trace_init':
trace_sysprof.c:(.text+0x3e953): undefined reference to `tracing_start_cmdline_record'

Ingo

Sorry, this fixlet solves the problem:

Could you please send one combo patch? The patch was so small and was at the tail of tracing/sysprof that i didnt apply it after all.

Ingo

maintainer Acked-by
#9 lore raw
In reply to Frederic Weisbecker

On Tue, 10 Feb 2009, Frederic Weisbecker wrote:

Hi Frederic!

Just a quick comment about the change log. I'm still learning how to write them too, but I'll give my 2 cents anyway ;-)

When looking a logs, I sometimes like to know the reason for the change. So below I would have also included...

Quoted 7 lines

--

Quoted 1 line

From 97113f668e9aef7ba101fbb3399e5ebb27aeec4c Mon Sep 17 00:00:00 2001

From: Frederic Weisbecker <[email protected]>
Date: Tue, 10 Feb 2009 15:07:22 +0100
Subject: [PATCH] tracing/sysprof: fix a build error on sysprof tracer

The sysprof tracer gets the command line data from the context switch tracer. We must select it otherwise we get

Quoted 9 lines

the following build error:

kernel/built-in.o: In function `stack_trace_reset':
trace_sysprof.c:(.text+0x3e91a): undefined reference to tracing_stop_cmdline_record' kernel/built-in.o: In function stack_trace_init':
trace_sysprof.c:(.text+0x3e953): undefined reference to `tracing_start_cmdline_record'

Just makes reading the logs a bit easier to see what is happening.

Thanks!

-- Steve

#12 lore raw
In reply to Arnaldo Carvalho de Melo
Quoted 9 lines · Arnaldo Carvalho de Melo

Em Tue, Feb 10, 2009 at 04:43:30AM +0100, Frederic Weisbecker escreveu:

Quoted 4 lines

Add the missing pair tracing_{start,stop}_record_cmdline() to record well the cmdline associated with pid.

This is another thing that I think begs for a TRACE_INIT_CMDLINE in struct trace->flags so that just before calling ->init we call tracing_start_cmdline_record? no?

Right!
But the flags on struct tracer are more likely for private use, they have a meaning only for the concerned tracer.

I guess it will be something for the global flags, when they will be per-tracer.

Quoted 2 lines

Another thing I noticed is that even we having a ->stop most of the time this semantic action is done thru ->reset :-\

Yes, perhaps the tracing of cmdline could be even performed on tracing_stop, unless... perhaps it's not needed since the sched_switch tracer will be stopped too anyway.

Quoted 26 lines

- Arnaldo

Quoted 23 lines
 kernel/trace/trace_sysprof.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
kernel/trace/trace_sysprof.c +3 -0
index 84ca9d8..9902c15 100644
@@ -238,6 +238,8 @@ static int stack_trace_init(struct trace_array *tr)
 {
 	sysprof_trace = tr;
 
+	tracing_start_cmdline_record();
+
 	mutex_lock(&sample_timer_lock);
 	start_stack_timers();
 	tracer_enabled = 1;
@@ -247,6 +249,7 @@ static int stack_trace_init(struct trace_array *tr)
 
 static void stack_trace_reset(struct trace_array *tr)
 {
+	tracing_stop_cmdline_record();
 	stop_stack_trace(tr);
 }
#10 lore raw
In reply to Steven Rostedt
Quoted 29 lines · Steven Rostedt

On Tue, 10 Feb 2009, Frederic Weisbecker wrote:

Hi Frederic!

Just a quick comment about the change log. I'm still learning how to write them too, but I'll give my 2 cents anyway ;-)

When looking a logs, I sometimes like to know the reason for the change. So below I would have also included...

Quoted 7 lines

--

Quoted 1 line

From 97113f668e9aef7ba101fbb3399e5ebb27aeec4c Mon Sep 17 00:00:00 2001

From: Frederic Weisbecker <[email protected]>
Date: Tue, 10 Feb 2009 15:07:22 +0100
Subject: [PATCH] tracing/sysprof: fix a build error on sysprof tracer

The sysprof tracer gets the command line data from the context switch tracer. We must select it otherwise we get

Quoted 7 lines

the following build error:

kernel/built-in.o: In function `stack_trace_reset':
trace_sysprof.c:(.text+0x3e91a): undefined reference to tracing_stop_cmdline_record' kernel/built-in.o: In function stack_trace_init':
trace_sysprof.c:(.text+0x3e953): undefined reference to `tracing_start_cmdline_record'

Quoted 4 lines
Quoted 2 lines

Just makes reading the logs a bit easier to see what is happening.

Exact, you're right :-)
Anyway, I've unified it in a combo patch...

Quoted 6 lines

Thanks!

-- Steve

author Acked-by Steven Rostedt
#5 lore raw
In reply to Ingo Molnar
Quoted 26 lines · Ingo Molnar
Quoted 23 lines · Frederic Weisbecker
Quoted 22 lines · Ingo Molnar
Quoted 11 lines · Ingo Molnar
Quoted 7 lines · Frederic Weisbecker

Add the missing pair tracing_{start,stop}_record_cmdline() to record well the cmdline associated with pid.

---
 kernel/trace/trace_sysprof.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

applied to tip/tracing/sysprof, thanks Frederic!

hm, causes a build failure:

kernel/built-in.o: In function `stack_trace_reset':
trace_sysprof.c:(.text+0x3e91a): undefined reference to tracing_stop_cmdline_record' kernel/built-in.o: In function stack_trace_init':
trace_sysprof.c:(.text+0x3e953): undefined reference to `tracing_start_cmdline_record'

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

Ingo

Sorry, this fixlet solves the problem:

Could you please send one combo patch? The patch was so small and was at the tail of tracing/sysprof that i didnt apply it after all.

Ingo

Ok.
I've dropped the build error example in the changelog, keeping only the reason of the error, as this is a V2.
Tell me if you are fine with it.

--

Quoted 1 line

From 1656ef9b22049a0d93c7c3946e28774876df535b Mon Sep 17 00:00:00 2001

From: Frederic Weisbecker <[email protected]>
Date: Tue, 10 Feb 2009 15:33:43 +0100
Subject: [PATCH v2] tracing/sysprof: add missing tracing_{start,stop}_record_cmdline()

Add the missing pair tracing_{start,stop}_record_cmdline() to record well the cmdline associated with pid.

Changes in v2:

_ fix a build error, the sched_switch tracer is needed to record the cmdline.

---
 kernel/trace/Kconfig         |    1 +
 kernel/trace/trace_sysprof.c |    3 +++
 2 files changed, 4 insertions(+), 0 deletions(-)
kernel/trace/Kconfig +1 -0
index 79be773..620f9cd 100644
@@ -134,6 +134,7 @@ config SYSPROF_TRACER
 	bool "Sysprof Tracer"
 	depends on X86
 	select TRACING
+	select CONTEXT_SWITCH_TRACER
 	help
 	  This tracer provides the trace needed by the 'Sysprof' userspace
 	  tool.
kernel/trace/trace_sysprof.c +3 -0
index 84ca9d8..9902c15 100644
@@ -238,6 +238,8 @@ static int stack_trace_init(struct trace_array *tr)
 {
 	sysprof_trace = tr;
 
+	tracing_start_cmdline_record();
+
 	mutex_lock(&sample_timer_lock);
 	start_stack_timers();
 	tracer_enabled = 1;
@@ -247,6 +249,7 @@ static int stack_trace_init(struct trace_array *tr)
 
 static void stack_trace_reset(struct trace_array *tr)
 {
+	tracing_stop_cmdline_record();
 	stop_stack_trace(tr);
 }
 
Signature · 1 line
1.6.1
#6 lore raw
Quoted 5 lines · Frederic Weisbecker

Ok.
I've dropped the build error example in the changelog, keeping only the reason of the error, as this is a V2.
Tell me if you are fine with it.

Looks good - applied to tip:tracing/sysprof, thanks Frederic!

Ingo

#7 lore raw

hm, still no good:

kernel/built-in.o: In function `boot_trace_init':
trace_boot.c:(.text+0x7751a): undefined reference to `tracing_sched_switch_assign_trace'
kernel/built-in.o: In function `disable_boot_trace':
(.text+0x7762c): undefined reference to `tracing_stop_sched_switch_record'

Ingo

#8 lore raw
Quoted 8 lines · Ingo Molnar

hm, still no good:

kernel/built-in.o: In function `boot_trace_init':
trace_boot.c:(.text+0x7751a): undefined reference to `tracing_sched_switch_assign_trace'
kernel/built-in.o: In function `disable_boot_trace':
(.text+0x7762c): undefined reference to `tracing_stop_sched_switch_record'

actually, that's Arnaldo's bug, caused by:

9182702: tracing: use a single trace_enabled variable

Ingo