diff options
author | behlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c> | 2008-03-31 20:42:36 +0000 |
---|---|---|
committer | behlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c> | 2008-03-31 20:42:36 +0000 |
commit | 8d0f1ee907d425e71e34e1aea9c1b5465f8cd4d1 (patch) | |
tree | 2485257786b0d5cd9b54abebf314e4f0966ab7e1 /include/sys | |
parent | e487ee08fb0bf55ac20f9d0779f602b5b543b3bf (diff) |
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
Diffstat (limited to 'include/sys')
-rw-r--r-- | include/sys/debug.h | 7 | ||||
-rw-r--r-- | include/sys/kmem.h | 6 | ||||
-rw-r--r-- | include/sys/rwlock.h | 2 | ||||
-rw-r--r-- | include/sys/sysmacros.h | 2 |
4 files changed, 12 insertions, 5 deletions
diff --git a/include/sys/debug.h b/include/sys/debug.h index 02f64c2cf..4a6ed5c3d 100644 --- a/include/sys/debug.h +++ b/include/sys/debug.h @@ -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 */ diff --git a/include/sys/kmem.h b/include/sys/kmem.h index 46322105d..58ae07747 100644 --- a/include/sys/kmem.h +++ b/include/sys/kmem.h @@ -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); \ diff --git a/include/sys/rwlock.h b/include/sys/rwlock.h index ecee07948..6407e632d 100644 --- a/include/sys/rwlock.h +++ b/include/sys/rwlock.h @@ -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; } diff --git a/include/sys/sysmacros.h b/include/sys/sysmacros.h index a64950d10..d5f8597c2 100644 --- a/include/sys/sysmacros.h +++ b/include/sys/sysmacros.h @@ -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(); \ } \ |