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:
behlendo
2008-03-31 20:42:36 +00:00
parent e487ee08fb
commit 8d0f1ee907
9 changed files with 251 additions and 41 deletions
+7
View File
@@ -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
View File
@@ -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); \
+1 -1
View File
@@ -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;
}
+1 -1
View File
@@ -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(); \
} \