char debug_file_path[1024] = "/tmp/lustre-log";
static char debug_file_name[1024];
-static int handled_panic; /* to avoid recursive calls to notifiers */
char portals_upcall[1024] = "/usr/lib/lustre/portals_upcall";
void portals_debug_dumplog_internal(void *arg)
set_current_state(TASK_RUNNING);
}
+#ifdef PORTALS_DUMP_ON_PANIC
static int panic_dumplog(struct notifier_block *self, unsigned long unused1,
void *unused2)
{
+ static int handled_panic; /* to avoid recursive calls to notifiers */
+
if (handled_panic)
return 0;
else
next : NULL,
priority : 10000
};
+#endif
+
+#ifdef CRAY_PORTALS
+extern void *lus_portals_debug;
+#endif
int portals_debug_init(unsigned long bufsize)
{
+#ifdef CRAY_PORTALS
+ lus_portals_debug = &portals_debug_msg;
+#endif
+#ifdef PORTALS_DUMP_ON_PANIC
+ /* This is currently disabled because it spews far too much to the
+ * console on the rare cases it is ever triggered. */
notifier_chain_register(&panic_notifier_list, &lustre_panic_notifier);
+#endif
return tracefile_init();
}
int portals_debug_cleanup(void)
{
tracefile_exit();
+#ifdef PORTALS_DUMP_ON_PANIC
notifier_chain_unregister(&panic_notifier_list, &lustre_panic_notifier);
+#endif
+#ifdef CRAY_PORTALS
+ lus_portals_debug = NULL;
+#endif
return 0;
}
hname);
break;
default:
- fprintf(stderr, "gethostbyname error: %s\n",
- strerror(errno));
+ fprintf(stderr, "gethostbyname error for %s: %s\n",
+ hname, strerror(h_errno));
break;
}
return NULL;