mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
Add some crude debugging support. It leaves alot to be
desired, but it should allow more easy kernel debugging for now. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@59 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
This commit is contained in:
@@ -1,4 +1,11 @@
|
||||
#ifndef _SPL_DEBUG_H
|
||||
#define _SPL_DEBUG_H
|
||||
|
||||
extern unsigned long spl_debug_mask;
|
||||
extern unsigned long spl_debug_subsys;
|
||||
|
||||
void __dprintf(const char *file, const char *func, int line, const char *fmt, ...);
|
||||
void spl_set_debug_mask(unsigned long mask);
|
||||
void spl_set_debug_subsys(unsigned long mask);
|
||||
|
||||
#endif /* SPL_DEBUG_H */
|
||||
|
||||
+3
-3
@@ -35,14 +35,14 @@ extern int kmem_warning_flag;
|
||||
\
|
||||
/* Marked unlikely because we should never be doing this */ \
|
||||
if (unlikely((size) > (PAGE_SIZE * 2)) && kmem_warning_flag) \
|
||||
printk("Warning: kmem_alloc(%d, 0x%x) large alloc at %s:%d " \
|
||||
printk("spl: Warning kmem_alloc(%d, 0x%x) large alloc at %s:%d " \
|
||||
"(%ld/%ld)\n", (int)(size), (int)(flags), \
|
||||
__FILE__, __LINE__, \
|
||||
atomic64_read(&kmem_alloc_used), kmem_alloc_max); \
|
||||
\
|
||||
_ptr_ = (void *)allocator((size), (flags)); \
|
||||
if (_ptr_ == NULL) { \
|
||||
printk("Warning: kmem_alloc(%d, 0x%x) failed at %s:%d " \
|
||||
printk("spl: Warning kmem_alloc(%d, 0x%x) failed at %s:%d " \
|
||||
"(%ld/%ld)\n", (int)(size), (int)(flags), \
|
||||
__FILE__, __LINE__, \
|
||||
atomic64_read(&kmem_alloc_used), kmem_alloc_max); \
|
||||
@@ -73,7 +73,7 @@ extern int kmem_warning_flag;
|
||||
\
|
||||
_ptr_ = (void *)vmalloc((size)); \
|
||||
if (_ptr_ == NULL) { \
|
||||
printk("Warning: vmem_alloc(%d, 0x%x) failed at %s:%d " \
|
||||
printk("spl: Warning vmem_alloc(%d, 0x%x) failed at %s:%d " \
|
||||
"(%ld/%ld)\n", (int)(size), (int)(flags), \
|
||||
__FILE__, __LINE__, \
|
||||
atomic64_read(&vmem_alloc_used), vmem_alloc_max); \
|
||||
|
||||
@@ -236,7 +236,7 @@ rw_tryupgrade(krwlock_t *rwlp)
|
||||
* lock. If there is, then we know we should
|
||||
* not try to upgrade the lock */
|
||||
if (!list_empty(&rwlp->rw_sem.wait_list)) {
|
||||
printk(KERN_WARNING "There are threads waiting\n");
|
||||
printk("spl: Warning There are threads waiting\n");
|
||||
spin_unlock(&rwlp->rw_sem.wait_lock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ extern "C" {
|
||||
const TYPE __left = (TYPE)(LEFT); \
|
||||
const TYPE __right = (TYPE)(RIGHT); \
|
||||
if (!(__left OP __right)) { \
|
||||
printk("Failed VERIFY3(" FMT " " #OP " " FMT ")\n", \
|
||||
printk("spl: Error VERIFY3(" FMT " " #OP " " FMT ")\n", \
|
||||
CAST __left, CAST __right); \
|
||||
BUG(); \
|
||||
} \
|
||||
|
||||
Reference in New Issue
Block a user