diff options
| author | Shreyas Siravara <sshreyas@fb.com> | 2016-03-22 21:04:35 -0700 | 
|---|---|---|
| committer | Shreyas Siravara <sshreyas@fb.com> | 2017-08-30 03:10:20 +0000 | 
| commit | 69509ee7d270302c232556b5c941fb6a22b4dced (patch) | |
| tree | fc79f03525c7c1037079deb173acb2c8bc789702 /libglusterfs | |
| parent | 9f9da37e3afa1f9394fb5edf49334ef9d6a6dd00 (diff) | |
io-stats: Expose io-thread queue depths
Summary:
- This diff exposes the io-thread queue depths by sending a specialized getxattr() call down to the io-threads translator.
- Port of D3086477, D3094145, D3095505 to 3.8
Test Plan: Tested on devserver, will run prove tests. Valgrind + ASAN pass as well.
Reviewers: rwareing, kvigor
Subscribers: dld, moox, dph
Differential Revision: https://phabricator.fb.com/D3086477
Change-Id: Ia452a4fcdb9173a751c4cb48d739b25c235f6855
Reviewed-on: https://review.gluster.org/18143
Smoke: Gluster Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Shreyas Siravara <sshreyas@fb.com>
Diffstat (limited to 'libglusterfs')
| -rw-r--r-- | libglusterfs/src/dict.h | 2 | ||||
| -rw-r--r-- | libglusterfs/src/glusterfs.h | 46 | 
2 files changed, 48 insertions, 0 deletions
diff --git a/libglusterfs/src/dict.h b/libglusterfs/src/dict.h index 1f6c1a0eae9..5259c6befa1 100644 --- a/libglusterfs/src/dict.h +++ b/libglusterfs/src/dict.h @@ -159,6 +159,8 @@ data_t * data_copy (data_t *old);  dict_t *get_new_dict_full (uint32_t size_hint);  dict_t *get_new_dict (); +#define dict_for_each(d, c) for (c = d->members_list; c; c = c->next) +  int dict_foreach (dict_t *this,                    int (*fn)(dict_t *this,                              char *key, diff --git a/libglusterfs/src/glusterfs.h b/libglusterfs/src/glusterfs.h index 399d695665b..59f3df19420 100644 --- a/libglusterfs/src/glusterfs.h +++ b/libglusterfs/src/glusterfs.h @@ -78,6 +78,7 @@  #define ZR_STRICT_VOLFILE_CHECK "strict-volfile-check"  #define ZR_DUMP_FUSE            "dump-fuse"  #define ZR_FUSE_MOUNTOPTS       "fuse-mountopts" +#define IO_THREADS_QUEUE_SIZE_KEY "io-thread-queue-size"  #define GF_XATTR_CLRLK_CMD      "glusterfs.clrlk"  #define GF_XATTR_PATHINFO_KEY   "trusted.glusterfs.pathinfo" @@ -283,6 +284,51 @@  #define GF_LK_ADVISORY 0  #define GF_LK_MANDATORY 1 +#define GF_CHECK_XATTR_KEY_AND_GOTO(key, cmpkey, errval, lbl)   \ +        do {                                                    \ +                if (key && strcmp (key, cmpkey) == 0) {         \ +                        errval = -EINVAL;                       \ +                        goto lbl;                               \ +                }                                               \ +        } while (0);                                            \ + + +typedef enum { +        GF_FOP_PRI_UNSPEC = -1,         /* Priority not specified */ +        GF_FOP_PRI_HI = 0,              /* low latency */ +        GF_FOP_PRI_NORMAL,              /* normal */ +        GF_FOP_PRI_LO,                  /* bulk */ +        GF_FOP_PRI_LEAST,               /* least */ +        GF_FOP_PRI_MAX, +} gf_fop_pri_t; + +/* For backwards compatibility in io-threads */ +typedef gf_fop_pri_t iot_pri_t; +#define IOT_PRI_UNSPEC  GF_FOP_PRI_UNSPEC +#define IOT_PRI_HI      GF_FOP_PRI_HI +#define IOT_PRI_NORMAL  GF_FOP_PRI_NORMAL +#define IOT_PRI_LO      GF_FOP_PRI_LO +#define IOT_PRI_LEAST   GF_FOP_PRI_LEAST +#define IOT_PRI_MAX     GF_FOP_PRI_MAX + +static const char* FOP_PRI_STRINGS[] = { +        "HIGH", +        "NORMAL", +        "LOW", +        "LEAST" +}; + +static inline const char *fop_pri_to_string (gf_fop_pri_t pri) +{ +        if (pri < 0) +                return "UNSPEC"; + +        if (pri >= GF_FOP_PRI_MAX) +                return "INVALID"; + +        return FOP_PRI_STRINGS[pri]; +} +  const char *fop_enum_to_pri_string (glusterfs_fop_t fop);  const char *fop_enum_to_string (glusterfs_fop_t fop);  | 
