linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Tracing to console
@ 2018-06-15 21:01 Bart Van Assche
  2018-06-26 15:42 ` Bart Van Assche
  2018-12-15  3:46 ` Steven Rostedt
  0 siblings, 2 replies; 3+ messages in thread
From: Bart Van Assche @ 2018-06-15 21:01 UTC (permalink / raw)
  To: rostedt; +Cc: linux-kernel, mingo

Hello Steven,

If I run the following commands as root:

cd /sys/kernel/debug/tracing
grep pm_ available_events > set_event
echo function >current_tracer
grep scsi_ available_filter_functions | while read a b; do echo $a; done >set_ftrace_filter
echo 1 >events/printk/enable
echo 1 >tracing_on
echo 1 >/proc/sys/kernel/tracepoint_printk
echo - - - >/sys/class/scsi_host/host0/scan

then the following appears on the console:

console: ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
console: console: ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
console: console: console: ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
console: console: console: console: ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
console: console: console: console: console: ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
console: console: console: console: console: console: ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
console: console: console: console: console: console: console: ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
console: console: console: console: console: console: console: console: ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
console: console: console: console: console: console: console: console: console: ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
console: console: console: console: console: console: console: console: console: console: ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
console: console: console: console: console: console: console: console: console: console: console: ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
[ ... ]

I assume that the repeated "console: " prefix is a bug and also that the same
line repeats over and over again is also a bug? I ran into this with commit
017b3f8a10ca ("scsi: snic: fix a couple of spelling mistakes: "COMPLETE"").

Thanks,

Bart.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Tracing to console
  2018-06-15 21:01 Tracing to console Bart Van Assche
@ 2018-06-26 15:42 ` Bart Van Assche
  2018-12-15  3:46 ` Steven Rostedt
  1 sibling, 0 replies; 3+ messages in thread
From: Bart Van Assche @ 2018-06-26 15:42 UTC (permalink / raw)
  To: rostedt; +Cc: linux-kernel, mingo

Hello Steven and Ingo,

Did I report this observation to the right people?

Thank you,

Bart.

On 06/15/18 14:01, Bart Van Assche wrote:
> Hello Steven,
> 
> If I run the following commands as root:
> 
> cd /sys/kernel/debug/tracing
> grep pm_ available_events > set_event
> echo function >current_tracer
> grep scsi_ available_filter_functions | while read a b; do echo $a; done >set_ftrace_filter
> echo 1 >events/printk/enable
> echo 1 >tracing_on
> echo 1 >/proc/sys/kernel/tracepoint_printk
> echo - - - >/sys/class/scsi_host/host0/scan
> 
> then the following appears on the console:
> 
> console: ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> console: console: ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> console: console: console: ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> console: console: console: console: ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> console: console: console: console: console: ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> console: console: console: console: console: console: ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> console: console: console: console: console: console: console: ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> console: console: console: console: console: console: console: console: ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> console: console: console: console: console: console: console: console: console: ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> console: console: console: console: console: console: console: console: console: console: ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> console: console: console: console: console: console: console: console: console: console: console: ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> [ ... ]
> 
> I assume that the repeated "console: " prefix is a bug and also that the same
> line repeats over and over again is also a bug? I ran into this with commit
> 017b3f8a10ca ("scsi: snic: fix a couple of spelling mistakes: "COMPLETE"").

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Tracing to console
  2018-06-15 21:01 Tracing to console Bart Van Assche
  2018-06-26 15:42 ` Bart Van Assche
@ 2018-12-15  3:46 ` Steven Rostedt
  1 sibling, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2018-12-15  3:46 UTC (permalink / raw)
  To: Bart Van Assche; +Cc: linux-kernel, mingo

On Fri, 15 Jun 2018 21:01:53 +0000
Bart Van Assche <Bart.VanAssche@wdc.com> wrote:

> Hello Steven,

Sorry about the 6 month old reply. I just noticed this email buried in
my INBOX (I triage my INBOX to find emails like this that got missed).
And yes I missed your reply as well :-/


> 
> If I run the following commands as root:
> 
> cd /sys/kernel/debug/tracing
> grep pm_ available_events > set_event
> echo function >current_tracer
> grep scsi_ available_filter_functions | while read a b; do echo $a; done >set_ftrace_filter
> echo 1 >events/printk/enable
> echo 1 >tracing_on
> echo 1 >/proc/sys/kernel/tracepoint_printk

Just for some closure. The tracepoint_printk is a special command that
only gets enabled if you pass "tp_printk" on the kernel command line.

> echo - - - >/sys/class/scsi_host/host0/scan
> 
> then the following appears on the console:
> 
> console: ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> console: console: ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> console: console: console: ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> console: console: console: console: ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> console: console: console: console: console: ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> console: console: console: console: console: console: ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> console: console: console: console: console: console: console: ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> console: console: console: console: console: console: console: console: ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> console: console: console: console: console: console: console: console: console: ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> console: console: console: console: console: console: console: console: console: console: ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> console: console: console: console: console: console: console: console: console: console: console: ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
> [ ... ]
> 
> I assume that the repeated "console: " prefix is a bug and also that the same
> line repeats over and over again is also a bug? I ran into this with commit
> 017b3f8a10ca ("scsi: snic: fix a couple of spelling mistakes: "COMPLETE"").
>

The above behavior is actually expected and not a bug. It's a "Doctor
it hurts me when I do this" issue. Don't do that ;-)

The tracepoint_printk is for cases where the system crashes before you
ever get to a command prompt, and you want to see trace events that you
can enable from the kernel command line. What you did above was like
running "ls -lR / > /dev/mem" in old kernels. It's doomed to fail.

You just told the kernel that you want all trace events to go over
printk, and you also told the kernel, you want all printk to become a
trace event. Thus you created a recursive loop. You're lucky it didn't
crash.

I hope this explains things for you.

Again, sorry that it took 6 months to reply. I believe June was a busy
time for me (vacation and work travel).

-- Steve

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-12-15  3:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-15 21:01 Tracing to console Bart Van Assche
2018-06-26 15:42 ` Bart Van Assche
2018-12-15  3:46 ` Steven Rostedt

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).