linux/fs/ocfs2/dlm/dlmdebug.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * dlmdebug.c
 *
 * debug functionality for the dlm
 *
 * Copyright (C) 2004, 2008 Oracle.  All rights reserved.
 */

#include <linux/types.h>
#include <linux/slab.h>
#include <linux/highmem.h>
#include <linux/sysctl.h>
#include <linux/spinlock.h>
#include <linux/debugfs.h>
#include <linux/export.h>

#include "../cluster/heartbeat.h"
#include "../cluster/nodemanager.h"
#include "../cluster/tcp.h"

#include "dlmapi.h"
#include "dlmcommon.h"
#include "dlmdomain.h"
#include "dlmdebug.h"

#define MLOG_MASK_PREFIX
#include "../cluster/masklog.h"

static int stringify_lockname(const char *lockname, int locklen, char *buf,
			      int len);

void dlm_print_one_lock_resource(struct dlm_lock_resource *res)
{}

static void dlm_print_lockres_refmap(struct dlm_lock_resource *res)
{}

static void __dlm_print_lock(struct dlm_lock *lock)
{}

void __dlm_print_one_lock_resource(struct dlm_lock_resource *res)
{}

void dlm_print_one_lock(struct dlm_lock *lockid)
{}
EXPORT_SYMBOL_GPL();

static const char *dlm_errnames[] =;

static const char *dlm_errmsgs[] =;

const char *dlm_errmsg(enum dlm_status err)
{}
EXPORT_SYMBOL_GPL();

const char *dlm_errname(enum dlm_status err)
{}
EXPORT_SYMBOL_GPL();

/* NOTE: This function converts a lockname into a string. It uses knowledge
 * of the format of the lockname that should be outside the purview of the dlm.
 * We are adding only to make dlm debugging slightly easier.
 *
 * For more on lockname formats, please refer to dlmglue.c and ocfs2_lockid.h.
 */
static int stringify_lockname(const char *lockname, int locklen, char *buf,
			      int len)
{}

static int stringify_nodemap(unsigned long *nodemap, int maxnodes,
			     char *buf, int len)
{}

static int dump_mle(struct dlm_master_list_entry *mle, char *buf, int len)
{}

void dlm_print_one_mle(struct dlm_master_list_entry *mle)
{}

#ifdef CONFIG_DEBUG_FS

static struct dentry *dlm_debugfs_root;

#define DLM_DEBUGFS_DIR
#define DLM_DEBUGFS_DLM_STATE
#define DLM_DEBUGFS_LOCKING_STATE
#define DLM_DEBUGFS_MLE_STATE
#define DLM_DEBUGFS_PURGE_LIST

/* begin - utils funcs */
static int debug_release(struct inode *inode, struct file *file)
{}

static ssize_t debug_read(struct file *file, char __user *buf,
			  size_t nbytes, loff_t *ppos)
{}
/* end - util funcs */

/* begin - purge list funcs */
static int debug_purgelist_print(struct dlm_ctxt *dlm, char *buf, int len)
{}

static int debug_purgelist_open(struct inode *inode, struct file *file)
{}

static const struct file_operations debug_purgelist_fops =;
/* end - purge list funcs */

/* begin - debug mle funcs */
static int debug_mle_print(struct dlm_ctxt *dlm, char *buf, int len)
{}

static int debug_mle_open(struct inode *inode, struct file *file)
{}

static const struct file_operations debug_mle_fops =;

/* end - debug mle funcs */

/* begin - debug lockres funcs */
static int dump_lock(struct dlm_lock *lock, int list_type, char *buf, int len)
{}

static int dump_lockres(struct dlm_lock_resource *res, char *buf, int len)
{}

static void *lockres_seq_start(struct seq_file *m, loff_t *pos)
{}

static void lockres_seq_stop(struct seq_file *m, void *v)
{}

static void *lockres_seq_next(struct seq_file *m, void *v, loff_t *pos)
{}

static int lockres_seq_show(struct seq_file *s, void *v)
{}

static const struct seq_operations debug_lockres_ops =;

static int debug_lockres_open(struct inode *inode, struct file *file)
{}

static int debug_lockres_release(struct inode *inode, struct file *file)
{}

static const struct file_operations debug_lockres_fops =;
/* end - debug lockres funcs */

/* begin - debug state funcs */
static int debug_state_print(struct dlm_ctxt *dlm, char *buf, int len)
{}

static int debug_state_open(struct inode *inode, struct file *file)
{}

static const struct file_operations debug_state_fops =;
/* end  - debug state funcs */

/* files in subroot */
void dlm_debug_init(struct dlm_ctxt *dlm)
{}

/* subroot - domain dir */
void dlm_create_debugfs_subroot(struct dlm_ctxt *dlm)
{}

void dlm_destroy_debugfs_subroot(struct dlm_ctxt *dlm)
{}

/* debugfs root */
void dlm_create_debugfs_root(void)
{}

void dlm_destroy_debugfs_root(void)
{}
#endif	/* CONFIG_DEBUG_FS */