1 # define DEBUG_SUBSYSTEM S_LNET
3 #include <libcfs/kp30.h>
4 #include <libcfs/libcfs.h>
7 void libcfs_debug_dumpstack(cfs_task_t *tsk)
12 void libcfs_run_lbug_upcall(char *file, const char *fn, const int line)
16 void lbug_with_loc(char *file, const char *func, const int line)
18 libcfs_catastrophe = 1;
19 CEMERG("LBUG: pid: %u thread: %#x\n",
20 (unsigned)cfs_curproc_pid(), (unsigned)current_thread());
21 libcfs_debug_dumplog();
22 libcfs_run_lbug_upcall(file, func, line);
26 /* panic("lbug_with_loc(%s, %s, %d)", file, func, line) */
29 #if ENTRY_NESTING_SUPPORT
31 static inline struct cfs_debug_data *__current_cdd(void)
33 struct cfs_debug_data *cdd;
35 cdd = (struct cfs_debug_data *)current_uthread()->uu_nlminfo;
37 cdd->magic1 == CDD_MAGIC1 && cdd->magic2 == CDD_MAGIC2 &&
38 cdd->nesting_level < 1000)
44 static inline void __current_cdd_set(struct cfs_debug_data *cdd)
46 current_uthread()->uu_nlminfo = (void *)cdd;
49 void __entry_nesting(struct cfs_debug_data *child)
51 struct cfs_debug_data *parent;
53 parent = __current_cdd();
55 child->parent = parent;
56 child->nesting_level = parent->nesting_level + 1;
58 __current_cdd_set(child);
61 void __exit_nesting(struct cfs_debug_data *child)
63 __current_cdd_set(child->parent);
66 unsigned int __current_nesting_level(void)
68 struct cfs_debug_data *cdd;
70 cdd = __current_cdd();
72 return cdd->nesting_level;
76 /* ENTRY_NESTING_SUPPORT */