1 # define DEBUG_SUBSYSTEM S_LNET
3 #include <libcfs/libcfs.h>
6 void libcfs_debug_dumpstack(cfs_task_t *tsk)
11 void libcfs_run_lbug_upcall(char *file, const char *fn, const int line)
15 void lbug_with_loc(char *file, const char *func, const int line)
17 libcfs_catastrophe = 1;
18 CEMERG("LBUG: pid: %u thread: %#x\n",
19 (unsigned)cfs_curproc_pid(), (unsigned)current_thread());
20 libcfs_debug_dumplog();
21 libcfs_run_lbug_upcall(file, func, line);
25 /* panic("lbug_with_loc(%s, %s, %d)", file, func, line) */
28 #if ENTRY_NESTING_SUPPORT
30 static inline struct cfs_debug_data *__current_cdd(void)
32 struct cfs_debug_data *cdd;
34 cdd = (struct cfs_debug_data *)current_uthread()->uu_nlminfo;
36 cdd->magic1 == CDD_MAGIC1 && cdd->magic2 == CDD_MAGIC2 &&
37 cdd->nesting_level < 1000)
43 static inline void __current_cdd_set(struct cfs_debug_data *cdd)
45 current_uthread()->uu_nlminfo = (void *)cdd;
48 void __entry_nesting(struct cfs_debug_data *child)
50 struct cfs_debug_data *parent;
52 parent = __current_cdd();
54 child->parent = parent;
55 child->nesting_level = parent->nesting_level + 1;
57 __current_cdd_set(child);
60 void __exit_nesting(struct cfs_debug_data *child)
62 __current_cdd_set(child->parent);
65 unsigned int __current_nesting_level(void)
67 struct cfs_debug_data *cdd;
69 cdd = __current_cdd();
71 return cdd->nesting_level;
75 /* ENTRY_NESTING_SUPPORT */