On 11/11/19 12:32 PM, Joakim Zhang wrote: > echo 1 > /sys/kernel/debug/tracing/tracing_on > > trace_printk("\nmailbox_num = %u, timestamp = %u, can_id = %x\n", n, > timestamp, cfd->can_id); Add in mailbox_read(), but is print > nothing, could you give me some guidance? I think you need CONFIG_TRACING enabled in you .config. > I always use printk() to debug, but I think it cannot print until > suspend exit totally, so dump mailbox num, timestamp, and can id > failed before. Try to add a trace_printk() to the probe function. Your kernel should spit out a big warning message on the first usage: > Nov 11 12:34:49 orangebox kernel: ********************************************************** > Nov 11 12:34:49 orangebox kernel: ** NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE ** > Nov 11 12:34:50 orangebox kernel: ** ** > Nov 11 12:34:50 orangebox kernel: ** trace_printk() being used. Allocating extra memory. ** > Nov 11 12:34:50 orangebox kernel: ** ** > Nov 11 12:34:50 orangebox kernel: ** This means that this is a DEBUG kernel and it is ** > Nov 11 12:34:50 orangebox kernel: ** unsafe for production use. ** > Nov 11 12:34:50 orangebox kernel: ** ** > Nov 11 12:34:50 orangebox kernel: ** If you see this message and you are not debugging ** > Nov 11 12:34:50 orangebox kernel: ** the kernel, report this immediately to your vendor! ** > Nov 11 12:34:50 orangebox kernel: ** ** > Nov 11 12:34:50 orangebox kernel: ** NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE ** > Nov 11 12:34:50 orangebox kernel: ********************************************************** Then have a look at the trace file: > pi@orangebox:~ $ sudo cat /sys/kernel/debug/tracing/trace > # tracer: nop > # > # entries-in-buffer/entries-written: 1/1 #P:4 > # > # _-----=> irqs-off > # / _----=> need-resched > # | / _---=> hardirq/softirq > # || / _--=> preempt-depth > # ||| / delay > # TASK-PID CPU# |||| TIMESTAMP FUNCTION > # | | | |||| | | > modprobe-230 [001] .... 7.425339: mcp25xxfd_probe: mcp25xxfd_probe: foo Marc -- Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Attachment:
signature.asc
Description: OpenPGP digital signature