1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 /* -*- mode: c; c-basic-offset: 8; -*- 3 * vim: noexpandtab sw=8 ts=8 sts=0: 4 * 5 * dlmdebug.h 6 * 7 * Copyright (C) 2008 Oracle. All rights reserved. 8 */ 9 10 #ifndef DLMDEBUG_H 11 #define DLMDEBUG_H 12 13 void dlm_print_one_mle(struct dlm_master_list_entry *mle); 14 15 #ifdef CONFIG_DEBUG_FS 16 17 struct dlm_debug_ctxt { 18 struct dentry *debug_state_dentry; 19 struct dentry *debug_lockres_dentry; 20 struct dentry *debug_mle_dentry; 21 struct dentry *debug_purgelist_dentry; 22 }; 23 24 struct debug_lockres { 25 int dl_len; 26 char *dl_buf; 27 struct dlm_ctxt *dl_ctxt; 28 struct dlm_lock_resource *dl_res; 29 }; 30 31 int dlm_debug_init(struct dlm_ctxt *dlm); 32 void dlm_debug_shutdown(struct dlm_ctxt *dlm); 33 34 int dlm_create_debugfs_subroot(struct dlm_ctxt *dlm); 35 void dlm_destroy_debugfs_subroot(struct dlm_ctxt *dlm); 36 37 int dlm_create_debugfs_root(void); 38 void dlm_destroy_debugfs_root(void); 39 40 #else 41 42 static inline int dlm_debug_init(struct dlm_ctxt *dlm) 43 { 44 return 0; 45 } 46 static inline void dlm_debug_shutdown(struct dlm_ctxt *dlm) 47 { 48 } 49 static inline int dlm_create_debugfs_subroot(struct dlm_ctxt *dlm) 50 { 51 return 0; 52 } 53 static inline void dlm_destroy_debugfs_subroot(struct dlm_ctxt *dlm) 54 { 55 } 56 static inline int dlm_create_debugfs_root(void) 57 { 58 return 0; 59 } 60 static inline void dlm_destroy_debugfs_root(void) 61 { 62 } 63 64 #endif /* CONFIG_DEBUG_FS */ 65 #endif /* DLMDEBUG_H */ 66