]> granicus.if.org Git - zfs/commitdiff
Handful of minor stack checking fixes
authorbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>
Mon, 21 Apr 2008 18:08:33 +0000 (18:08 +0000)
committerbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>
Mon, 21 Apr 2008 18:08:33 +0000 (18:08 +0000)
git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@79 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c

cmd/spl.c
include/sys/debug.h
modules/spl/spl-debug.c

index 866bc8905d9437d2cf130ee47362cc19f204ff67..ad2c81b4a58959a1de932caf7d00e5d33c88d41f 100644 (file)
--- a/cmd/spl.c
+++ b/cmd/spl.c
@@ -48,10 +48,10 @@ print_rec(struct dbg_line **linev, int used, FILE *out)
                 struct dbg_line *line = linev[i];
                 struct spl_debug_header *hdr = line->hdr;
 
-                fprintf(out, "%08x:%08x:%u:%u.%06llu:%u:%u:(%s:%u:%s()) %s",
+                fprintf(out, "%08x:%08x:%u:%u.%06llu:%u:%u:%u:(%s:%u:%s()) %s",
                         hdr->ph_subsys, hdr->ph_mask, hdr->ph_cpu_id,
                         hdr->ph_sec, (unsigned long long)hdr->ph_usec,
-                        hdr->ph_stack, hdr->ph_pid, line->file,
+                        hdr->ph_stack, hdr->ph_pid, hdr->ph_stack, line->file,
                         hdr->ph_line_num, line->fn, line->text);
                 free(line->hdr);
                 free(line);
index 12585e00f5a54a7b7f7e07c145337a918e591d34..720e4136e7c732226c3a24f90f9385a51ed376df 100644 (file)
@@ -172,6 +172,8 @@ do {                                                                    \
                                       "exceeded 90%% of maximum safe "  \
                                      "stack size (%lu/%lu)\n",         \
                                      _stack, THREAD_SIZE);             \
+                       spl_debug_dumpstack(NULL);                      \
+                       spl_debug_dumplog();                            \
                } else {                                                \
                         spl_debug_msg(NULL, D_TRACE, D_WARNING,         \
                                       file, func, line, "Error "        \
@@ -183,13 +185,11 @@ do {                                                                    \
         }                                                               \
 } while (0)
 
-#define CHECK_STACK()__CHECK_STACK(__FILE__, __func__, __LINE__)
+#define CHECK_STACK()   __CHECK_STACK(__FILE__, __func__, __LINE__)
 
 /* ASSERTION that is safe to use within the debug system */
 #define __ASSERT(cond)                                                 \
 do {                                                                   \
-       CHECK_STACK();                                                  \
-                                                                        \
        if (unlikely(!(cond))) {                                        \
                 printk(KERN_ERR "ASSERTION("#cond") failed");           \
                SBUG();                                                 \
index e4344fdd50fd2d014986e4aefc9a71e1f386f256..b5771a2aab379054b721c1e5e4132873960fe055 100644 (file)
@@ -504,8 +504,9 @@ trace_print_to_console(struct spl_debug_header *hdr, int mask, const char *buf,
         if ((mask & D_CONSOLE) != 0) {
                 printk("%s%s: %.*s", ptype, prefix, len, buf);
         } else {
-                printk("%s%s: %d:(%s:%d:%s()) %.*s", ptype, prefix, hdr->ph_pid,
-                       file, hdr->ph_line_num, fn, len, buf);
+                printk("%s%s: %d:%d:(%s:%d:%s()) %.*s", ptype, prefix,
+                       hdr->ph_pid, hdr->ph_stack, file,
+                       hdr->ph_line_num, fn, len, buf);
         }
 
         return;
@@ -1096,7 +1097,7 @@ void spl_debug_dumpstack(struct task_struct *tsk)
         if (tsk == NULL)
                 tsk = current;
 
-        CWARN("showing stack for process %d\n", tsk->pid);
+        printk(KERN_ERR "SPL: Showing stack for process %d\n", tsk->pid);
         show_task(tsk);
 }
 EXPORT_SYMBOL(spl_debug_dumpstack);