* UCRL-CODE-235197
*
* This file is part of the SPL, Solaris Porting Layer.
- * For details, see <http://github.com/behlendorf/spl/>.
+ * For details, see <http://zfsonlinux.org/>.
*
* The SPL is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
#include <linux/spinlock.h>
#include <linux/proc_compat.h>
#include <linux/file_compat.h>
+#include <linux/swap.h>
#include <sys/sysmacros.h>
#include <spl-debug.h>
#include <spl-trace.h>
#define SS_DEBUG_SUBSYS SS_DEBUG
+/* Debug log support enabled */
+#ifdef DEBUG_LOG
+
unsigned long spl_debug_subsys = ~0;
EXPORT_SYMBOL(spl_debug_subsys);
module_param(spl_debug_subsys, ulong, 0644);
return "xdr";
case SS_TSD:
return "tsd";
+ case SS_ZLIB:
+ return "zlib";
case SS_USER1:
return "user1";
case SS_USER2:
static int
trace_max_debug_mb(void)
{
- return MAX(512, ((num_physpages >> (20 - PAGE_SHIFT)) * 80) / 100);
+ return MAX(512, ((totalram_pages >> (20 - PAGE_SHIFT)) * 80) / 100);
}
static struct trace_page *
if (strchr(file, '/'))
file = strrchr(file, '/') + 1;
- trace_set_debug_header(&header, subsys, mask, line, 0);
-
tcd = trace_get_tcd();
+ trace_set_debug_header(&header, subsys, mask, line, 0);
if (tcd == NULL)
goto console;
spl_panic_in_progress = 1;
spl_debug_dumpstack(NULL);
- spl_debug_dumplog(flags);
- if (spl_debug_panic_on_bug)
+ if (spl_debug_panic_on_bug) {
+ spl_debug_dumplog(flags);
panic("SPL PANIC");
+ }
set_task_state(current, TASK_UNINTERRUPTIBLE);
while (1)
}
int
-debug_init(void)
+spl_debug_init(void)
{
int rc, max = spl_debug_mb;
/* If spl_debug_mb is set to an invalid value or uninitialized
* then just make the total buffers smp_num_cpus TCD_MAX_PAGES */
- if (max > (num_physpages >> (20 - 2 - PAGE_SHIFT)) / 5 ||
+ if (max > (totalram_pages >> (20 - 2 - PAGE_SHIFT)) / 5 ||
max >= 512 || max < 0) {
max = TCD_MAX_PAGES;
} else {
}
void
-debug_fini(void)
+spl_debug_fini(void)
{
trace_fini();
}
+
+#endif /* DEBUG_LOG */