From ee0d8ca53f685f8f27c93b3d7c808f2a78c1ae43 Mon Sep 17 00:00:00 2001 From: Poornima G Date: Wed, 17 Aug 2016 20:19:59 +0530 Subject: io-stats: Add stats for upcall notifications With this patch, there will be additional entries seen in the profile info: UPCALL : Total number of upcall events that were sent from the brick(in brick profile), and number of upcall notifications recieved by client(in client profile) Cache invalidation events: ------------------------- CI_IATT : Number of upcalls that were cache invalidation and had one of the IATT_UPDATE_FLAGS set. This indicates that one of the iatt value was changed. CI_XATTR : Number of upcalls that were cache invalidation, and had one of the UP_XATTR or UP_XATTR_RM set. This indicates that an xattr was updated or deleted. CI_RENAME : Number of upcalls that were cache invalidation, resulted by the renaming of a file or directory CI_UNLINK : Number of upcalls that were cache invalidation, resulted by the unlink of a file. CI_FORGET : Number of upcalls that were cache invalidation, resulted by the forget of inode on the server side. Lease events: ------------ LEASE_RECALL : Number of lease recalls sent by the brick (in brick profile), and number of lease recalls recieved by client(in client profile) Note that the sum of CI_IATT, CI_XATTR, CI_RENAME, CI_UNLINK, CI_FORGET, LEASE_RECALL may not be equal to UPCALL. This is because, each cache invalidation can carry multiple flags. Eg: - Every CI_XATTR will have CI_IATT - Every CI_UNLINK will also increment CI_IATT as link count is an iatt attribute. Also UP_PARENT_DENTRY_FLAGS is currently not accounted for, as CI_RENAME and CI_UNLINK will always have the flag UP_PARENT_DENTRY_FLAGS Change-Id: Ieb8cd21dde2c4c7618f12d025a5e5156f9cc0fe9 BUG: 1371543 Signed-off-by: Poornima G Reviewed-on: http://review.gluster.org/15193 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: Rajesh Joseph CentOS-regression: Gluster Build System Reviewed-by: Pranith Kumar Karampuri --- libglusterfs/src/globals.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'libglusterfs/src/globals.c') diff --git a/libglusterfs/src/globals.c b/libglusterfs/src/globals.c index 50ef4dbeea3..c537971cbb4 100644 --- a/libglusterfs/src/globals.c +++ b/libglusterfs/src/globals.c @@ -16,6 +16,7 @@ #include "mem-pool.h" #include "syncop.h" #include "libglusterfs-messages.h" +#include "upcall-utils.h" const char *gf_fop_list[GF_FOP_MAXVALUE] = { [GF_FOP_NULL] = "NULL", @@ -74,6 +75,18 @@ const char *gf_fop_list[GF_FOP_MAXVALUE] = { [GF_FOP_GETACTIVELK] = "GETACTIVELK", [GF_FOP_SETACTIVELK] = "SETACTIVELK", }; + +const char *gf_upcall_list[GF_UPCALL_FLAGS_MAXVALUE] = { + [GF_UPCALL_NULL] = "NULL", + [GF_UPCALL] = "UPCALL", + [GF_UPCALL_CI_STAT] = "CI_IATT", + [GF_UPCALL_CI_XATTR] = "CI_XATTR", + [GF_UPCALL_CI_RENAME] = "CI_RENAME", + [GF_UPCALL_CI_NLINK] = "CI_UNLINK", + [GF_UPCALL_CI_FORGET] = "CI_FORGET", + [GF_UPCALL_LEASE_RECALL] = "LEASE_RECALL", +}; + /* THIS */ /* This global ctx is a bad hack to prevent some of the libgfapi crashes. -- cgit