glusterfs  8.2
About: GlusterFS is a network/cluster filesystem. The storage server (or each in a cluster) runs glusterfsd and the clients use mount command or glusterfs client to mount the exported filesystem. Release series 8.x (latest version).
  Fossies Dox: glusterfs-8.2.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

statedump.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2008-2012 Red Hat, Inc. <http://www.redhat.com>
3  This file is part of GlusterFS.
4 
5  This file is licensed to you under your choice of the GNU Lesser
6  General Public License, version 3 or any later version (LGPLv3 or
7  later), or the GNU General Public License, version 2 (GPLv2), in all
8  cases as published by the Free Software Foundation.
9 */
10 
11 #ifndef STATEDUMP_H
12 #define STATEDUMP_H
13 
14 #include <stdarg.h>
15 #include "glusterfs/inode.h"
16 #include "glusterfs/strfd.h"
17 
18 #define GF_DUMP_MAX_BUF_LEN 4096
19 
20 typedef struct gf_dump_xl_options_ {
28 
29 typedef struct gf_dump_options_ {
33  gf_dump_xl_options_t xl_options; // options for all xlators
34  char *dump_path;
36 
38 
39 __attribute__((__format__(__printf__, 3, 4))) static inline void
40 _gf_proc_dump_build_key(char *key, const char *prefix, const char *fmt, ...)
41 {
42  va_list ap;
43  int32_t len;
44 
45  len = snprintf(key, GF_DUMP_MAX_BUF_LEN, "%s.", prefix);
46  if (len >= 0) {
47  va_start(ap, fmt);
48  len = vsnprintf(key + len, GF_DUMP_MAX_BUF_LEN - len, fmt, ap);
49  va_end(ap);
50  }
51  if (len < 0) {
52  *key = 0;
53  }
54 }
55 
56 #define gf_proc_dump_build_key(key, key_prefix, fmt...) \
57  { \
58  _gf_proc_dump_build_key(key, key_prefix, ##fmt); \
59  }
60 
61 #define GF_PROC_DUMP_SET_OPTION(opt, val) opt = val
62 
63 #define GF_CHECK_DUMP_OPTION_ENABLED(option_dump, var, label) \
64  do { \
65  if (option_dump == _gf_true) { \
66  var = _gf_false; \
67  goto label; \
68  } \
69  } while (0);
70 
71 void
73 
74 void
75 gf_proc_dump_fini(void);
76 
77 void
79 
80 void
81 gf_proc_dump_info(int signum, glusterfs_ctx_t *ctx);
82 
83 int
84 gf_proc_dump_add_section(char *key, ...)
85  __attribute__((__format__(__printf__, 1, 2)));
86 
87 int
88 gf_proc_dump_write(char *key, char *value, ...)
89  __attribute__((__format__(__printf__, 2, 3)));
90 
91 void
92 inode_table_dump(inode_table_t *itable, char *prefix);
93 
94 void
95 inode_table_dump_to_dict(inode_table_t *itable, char *prefix, dict_t *dict);
96 
97 void
98 fdtable_dump(fdtable_t *fdtable, char *prefix);
99 
100 void
101 fdtable_dump_to_dict(fdtable_t *fdtable, char *prefix, dict_t *dict);
102 
103 void
104 inode_dump(inode_t *inode, char *prefix);
105 
106 void
108 
109 void
111 
112 void
113 glusterd_init(int sig);
114 
115 void
117 
118 void
120 
121 void
123 
124 void
126 
127 void
129 
130 #endif /* STATEDUMP_H */
_gf_proc_dump_build_key
static void _gf_proc_dump_build_key(char *key, const char *prefix, const char *fmt,...)
Definition: statedump.h:40
gf_proc_dump_cleanup
void gf_proc_dump_cleanup(void)
Definition: statedump.c:956
_glusterfs_ctx
Definition: glusterfs.h:618
gf_proc_dump_xlator_history
void gf_proc_dump_xlator_history(xlator_t *this, strfd_t *strfd)
Definition: statedump.c:991
inode_dump
void inode_dump(inode_t *inode, char *prefix)
Definition: inode.c:2387
gf_dump_xl_options_::dump_inode
bool dump_inode
Definition: statedump.h:22
gf_proc_dump_info
void gf_proc_dump_info(int signum, glusterfs_ctx_t *ctx)
Definition: statedump.c:777
gf_proc_dump_init
void gf_proc_dump_init()
Definition: statedump.c:948
gf_dump_options_::dump_iobuf
bool dump_iobuf
Definition: statedump.h:31
GF_DUMP_MAX_BUF_LEN
#define GF_DUMP_MAX_BUF_LEN
Definition: statedump.h:18
gf_dump_options_
Definition: statedump.h:29
_inode
Definition: inode.h:99
gf_dump_options_::dump_mem
bool dump_mem
Definition: statedump.h:30
gf_proc_dump_mem_info_to_dict
void gf_proc_dump_mem_info_to_dict(dict_t *dict)
Definition: statedump.c:295
gf_proc_dump_xlator_profile
void gf_proc_dump_xlator_profile(xlator_t *this, strfd_t *strfd)
Definition: statedump.c:1032
gf_boolean_t
#define gf_boolean_t
Definition: glusterfs.h:368
gf_dump_xl_options_::dump_history
bool dump_history
Definition: statedump.h:26
gf_dump_options_t
struct gf_dump_options_ gf_dump_options_t
gf_dump_xl_options_t
struct gf_dump_xl_options_ gf_dump_xl_options_t
gf_proc_dump_xlator_meminfo
void gf_proc_dump_xlator_meminfo(xlator_t *this, strfd_t *strfd)
Definition: statedump.c:1018
gf_dump_options_::xl_options
gf_dump_xl_options_t xl_options
Definition: statedump.h:33
inode_table_dump
void inode_table_dump(inode_table_t *itable, char *prefix)
Definition: inode.c:2463
_xlator
Definition: xlator.h:770
gf_proc_dump_fini
void gf_proc_dump_fini(void)
Definition: statedump.c:942
glusterd_init
void glusterd_init(int sig)
gf_proc_dump_xlator_private
void gf_proc_dump_xlator_private(xlator_t *this, strfd_t *strfd)
Definition: statedump.c:962
fdtable_dump_to_dict
void fdtable_dump_to_dict(fdtable_t *fdtable, char *prefix, dict_t *dict)
Definition: fd.c:1155
gf_dump_xl_options_::dump_inodectx
bool dump_inodectx
Definition: statedump.h:24
gf_proc_dump_mallinfo
void gf_proc_dump_mallinfo(strfd_t *strfd)
Definition: statedump.c:977
gf_dump_xl_options_::dump_priv
bool dump_priv
Definition: statedump.h:21
gf_proc_dump_write
int gf_proc_dump_write(char *key, char *value,...)
Definition: statedump.c:187
gf_dump_options_::dump_callpool
bool dump_callpool
Definition: statedump.h:32
gf_dump_xl_options_
Definition: statedump.h:20
inode_table_dump_to_dict
void inode_table_dump_to_dict(inode_table_t *itable, char *prefix, dict_t *dict)
Definition: inode.c:2541
_dict
Definition: dict.h:114
fdtable_dump
void fdtable_dump(fdtable_t *fdtable, char *prefix)
Definition: fd.c:1033
gf_proc_dump_mempool_info_to_dict
void gf_proc_dump_mempool_info_to_dict(glusterfs_ctx_t *ctx, dict_t *dict)
Definition: statedump.c:396
dump_options
gf_dump_options_t dump_options
Definition: statedump.c:39
strfd.h
gf_dump_options_::dump_path
char * dump_path
Definition: statedump.h:34
gf_proc_dump_add_section
int gf_proc_dump_add_section(char *key,...)
Definition: statedump.c:144
strfd_t
Definition: strfd.h:14
gf_dump_xl_options_::dump_fdctx
bool dump_fdctx
Definition: statedump.h:25
_inode_table
Definition: inode.h:36
gf_dump_xl_options_::dump_fd
bool dump_fd
Definition: statedump.h:23
_fdtable
Definition: fd.h:62
inode.h