内核调试的方法

/var/log/kern.log

You should have (or be able to mount) debugfs and see a dma_api directory. There's a little documentation in the kernel doc

directory.

For example, in my fstab I've got:
sysfs                   /sys                    sysfs   rw,relatime        0 0
debug   /sys/kernel/debug debugfs  0 0

So in this case you should have /sys/kernel/debug/dma_api.

Assuming it's enabled, then you would get a stack trace on the first detected error. If you set dma_api/all_errors to 1, then you'd

get repeated traces. There are some other options commented in the source code for dma api debugging.

In my case (sky2), I didn't get stack traces, but quickly had debugging disabled as the table entries ran out (dma buffers weren't

being freed). dma_api/min_free_entries went to zero... no stack trace, but still useful data.


[root@tinker dma-api]# pwd
/sys/kernel/debug/dma-api
[root@tinker dma-api]# for d in *; do echo $d; cat $d; done
all_errors
0
disabled
N
driver_filter
error_count
0
min_free_entries
27999
num_errors
1
num_free_entries
28149

https://bugzilla.redhat.com/show_bug.cgi?id=541397

It's also not that the kernel is not able to do stack traces in principle, because at shutdown, it always generates a "possible

recursive locking" warning, and there it spits out a nice stack trace

你可能感兴趣的:(error,example,should,Little,enabled)