diff options
Diffstat (limited to 'xlators/debug')
| -rw-r--r-- | xlators/debug/error-gen/src/error-gen.c | 69 | ||||
| -rw-r--r-- | xlators/debug/io-stats/src/io-stats.c | 67 | ||||
| -rw-r--r-- | xlators/debug/trace/src/trace.c | 81 | 
3 files changed, 148 insertions, 69 deletions
diff --git a/xlators/debug/error-gen/src/error-gen.c b/xlators/debug/error-gen/src/error-gen.c index 5aee0af410b..04b4e67b4be 100644 --- a/xlators/debug/error-gen/src/error-gen.c +++ b/xlators/debug/error-gen/src/error-gen.c @@ -52,7 +52,8 @@ error_gen_lookup_cbk (call_frame_t *frame,  		      int32_t op_errno,  		      inode_t *inode,  		      struct stat *buf, -		      dict_t *dict) +		      dict_t *dict, +                      struct stat *postparent)  {  	STACK_UNWIND (frame,  		      op_ret, @@ -197,12 +198,14 @@ error_gen_truncate_cbk (call_frame_t *frame,  			xlator_t *this,  			int32_t op_ret,  			int32_t op_errno, -			struct stat *buf) +			struct stat *prebuf, +                        struct stat *postbuf)  {  	STACK_UNWIND (frame,  		      op_ret,  		      op_errno, -		      buf); +		      prebuf, +                      postbuf);  	return 0;  } @@ -234,12 +237,14 @@ error_gen_ftruncate_cbk (call_frame_t *frame,  			 xlator_t *this,  			 int32_t op_ret,  			 int32_t op_errno, -			 struct stat *buf) +			 struct stat *prebuf, +                         struct stat *postbuf)  {  	STACK_UNWIND (frame,  		      op_ret,  		      op_errno, -		      buf); +		      prebuf, +                      postbuf);  	return 0;  } @@ -308,12 +313,14 @@ error_gen_readlink_cbk (call_frame_t *frame,  			xlator_t *this,  			int32_t op_ret,  			int32_t op_errno, -			const char *path) +			const char *path, +                        struct stat *sbuf)  {  	STACK_UNWIND (frame,  		      op_ret,  		      op_errno, -		      path); +		      path, +                      sbuf);  	return 0;  } @@ -347,7 +354,9 @@ error_gen_mknod_cbk (call_frame_t *frame,  		     int32_t op_ret,  		     int32_t op_errno,  		     inode_t *inode, -		     struct stat *buf) +                     struct stat *buf, +                     struct stat *preparent, +                     struct stat *postparent)  {  	STACK_UNWIND (frame,  		      op_ret, @@ -386,7 +395,9 @@ error_gen_mkdir_cbk (call_frame_t *frame,  		     int32_t op_ret,  		     int32_t op_errno,  		     inode_t *inode, -		     struct stat *buf) +                     struct stat *buf, +                     struct stat *preparent, +                     struct stat *postparent)  {  	STACK_UNWIND (frame,  		      op_ret, @@ -422,7 +433,9 @@ error_gen_unlink_cbk (call_frame_t *frame,  		      void *cookie,  		      xlator_t *this,  		      int32_t op_ret, -		      int32_t op_errno) +		      int32_t op_errno, +                      struct stat *preparent, +                      struct stat *postparent)  {  	STACK_UNWIND (frame, op_ret, op_errno);  	return 0; @@ -453,7 +466,9 @@ error_gen_rmdir_cbk (call_frame_t *frame,  		     void *cookie,  		     xlator_t *this,  		     int32_t op_ret, -		     int32_t op_errno) +		     int32_t op_errno, +                     struct stat *preparent, +                     struct stat *postparent)  {  	STACK_UNWIND (frame,  		      op_ret, @@ -489,7 +504,9 @@ error_gen_symlink_cbk (call_frame_t *frame,  		       int32_t op_ret,  		       int32_t op_errno,  		       inode_t *inode, -		       struct stat *buf) +                       struct stat *buf, +                       struct stat *preparent, +                       struct stat *postparent)  {  	STACK_UNWIND (frame, op_ret, op_errno, inode,	buf);  	return 0; @@ -523,7 +540,11 @@ error_gen_rename_cbk (call_frame_t *frame,  		      xlator_t *this,  		      int32_t op_ret,  		      int32_t op_errno, -		      struct stat *buf) +		      struct stat *buf, +                      struct stat *preoldparent, +                      struct stat *postoldparent, +                      struct stat *prenewparent, +                      struct stat *postnewparent)  {  	STACK_UNWIND (frame, op_ret, op_errno, buf);  	return 0; @@ -558,7 +579,9 @@ error_gen_link_cbk (call_frame_t *frame,  		    int32_t op_ret,  		    int32_t op_errno,  		    inode_t *inode, -		    struct stat *buf) +                    struct stat *buf, +                    struct stat *preparent, +                    struct stat *postparent)  {  	STACK_UNWIND (frame, op_ret, op_errno, inode,	buf);  	return 0; @@ -594,7 +617,9 @@ error_gen_create_cbk (call_frame_t *frame,  		      int32_t op_errno,  		      fd_t *fd,  		      inode_t *inode, -		      struct stat *buf) +		      struct stat *buf, +                      struct stat *preparent, +                      struct stat *postparent)  {  	STACK_UNWIND (frame, op_ret, op_errno, fd, inode, buf);  	return 0; @@ -641,7 +666,7 @@ int32_t  error_gen_open (call_frame_t *frame,  		xlator_t *this,  		loc_t *loc, -		int32_t flags, fd_t *fd) +		int32_t flags, fd_t *fd, int32_t wbflags)  {  	int op_errno = 0;  	op_errno = error_gen(this); @@ -655,7 +680,7 @@ error_gen_open (call_frame_t *frame,  		    error_gen_open_cbk,  		    FIRST_CHILD(this),  		    FIRST_CHILD(this)->fops->open, -		    loc, flags, fd); +		    loc, flags, fd, wbflags);  	return 0;  } @@ -713,12 +738,14 @@ error_gen_writev_cbk (call_frame_t *frame,  		      xlator_t *this,  		      int32_t op_ret,  		      int32_t op_errno, -		      struct stat *stbuf) +                      struct stat *prebuf, +		      struct stat *postbuf)  {  	STACK_UNWIND (frame,  		      op_ret,  		      op_errno, -		      stbuf); +                      prebuf, +		      postbuf);  	return 0;  } @@ -792,7 +819,9 @@ error_gen_fsync_cbk (call_frame_t *frame,  		     void *cookie,  		     xlator_t *this,  		     int32_t op_ret, -		     int32_t op_errno) +		     int32_t op_errno, +                     struct stat *prebuf, +                     struct stat *postbuf)  {  	STACK_UNWIND (frame,  		      op_ret, diff --git a/xlators/debug/io-stats/src/io-stats.c b/xlators/debug/io-stats/src/io-stats.c index 662762100fe..44e0371841b 100644 --- a/xlators/debug/io-stats/src/io-stats.c +++ b/xlators/debug/io-stats/src/io-stats.c @@ -79,7 +79,9 @@ io_stats_create_cbk (call_frame_t *frame,                       int32_t op_errno,                       fd_t *fd,                       inode_t *inode, -                     struct stat *buf) +                     struct stat *buf, +                     struct stat *preparent, +                     struct stat *postparent)  {          STACK_UNWIND (frame, op_ret, op_errno, fd, inode, buf);          return 0; @@ -144,9 +146,10 @@ io_stats_writev_cbk (call_frame_t *frame,                       xlator_t *this,                       int32_t op_ret,                       int32_t op_errno, -                     struct stat *buf) +                     struct stat *prebuf, +                     struct stat *postbuf)  { -        STACK_UNWIND (frame, op_ret, op_errno, buf); +        STACK_UNWIND (frame, op_ret, op_errno, prebuf, postbuf);          return 0;  } @@ -180,9 +183,11 @@ io_stats_fsync_cbk (call_frame_t *frame,                      void *cookie,                      xlator_t *this,                      int32_t op_ret, -                    int32_t op_errno) +                    int32_t op_errno, +                    struct stat *prebuf, +                    struct stat *postbuf)  { -        STACK_UNWIND (frame, op_ret, op_errno); +        STACK_UNWIND (frame, op_ret, op_errno, prebuf, postbuf);          return 0;  } @@ -204,7 +209,9 @@ io_stats_unlink_cbk (call_frame_t *frame,                       void *cookie,                       xlator_t *this,                       int32_t op_ret, -                     int32_t op_errno) +                     int32_t op_errno, +                     struct stat *preparent, +                     struct stat *postparent)  {          STACK_UNWIND (frame, op_ret, op_errno);          return 0; @@ -216,7 +223,11 @@ io_stats_rename_cbk (call_frame_t *frame,                       xlator_t *this,                       int32_t op_ret,                       int32_t op_errno, -                     struct stat *buf) +                     struct stat *buf, +                     struct stat *preoldparent, +                     struct stat *postoldparent, +                     struct stat *prenewparent, +                     struct stat *postnewparent)  {          STACK_UNWIND (frame, op_ret, op_errno, buf);          return 0; @@ -228,9 +239,10 @@ io_stats_readlink_cbk (call_frame_t *frame,                         xlator_t *this,                         int32_t op_ret,                         int32_t op_errno, -                       const char *buf) +                       const char *buf, +                       struct stat *sbuf)  { -        STACK_UNWIND (frame, op_ret, op_errno, buf); +        STACK_UNWIND (frame, op_ret, op_errno, buf, sbuf);          return 0;  } @@ -242,7 +254,8 @@ io_stats_lookup_cbk (call_frame_t *frame,                       int32_t op_errno,                       inode_t *inode,                       struct stat *buf, -                     dict_t *xattr) +                     dict_t *xattr, +                     struct stat *postmaster)  {          STACK_UNWIND (frame, op_ret, op_errno, inode, buf, xattr);          return 0; @@ -255,7 +268,9 @@ io_stats_symlink_cbk (call_frame_t *frame,                        int32_t op_ret,                        int32_t op_errno,                        inode_t *inode, -                      struct stat *buf) +                      struct stat *buf, +                      struct stat *preparent, +                      struct stat *postparent)  {          STACK_UNWIND (frame, op_ret, op_errno, inode, buf);          return 0; @@ -268,7 +283,9 @@ io_stats_mknod_cbk (call_frame_t *frame,                      int32_t op_ret,                      int32_t op_errno,                      inode_t *inode, -                    struct stat *buf) +                    struct stat *buf, +                    struct stat *preparent, +                    struct stat *postparent)  {          STACK_UNWIND (frame, op_ret, op_errno, inode, buf);          return 0; @@ -282,7 +299,9 @@ io_stats_mkdir_cbk (call_frame_t *frame,                      int32_t op_ret,                      int32_t op_errno,                      inode_t *inode, -                    struct stat *buf) +                    struct stat *buf, +                    struct stat *preparent, +                    struct stat *postparent)  {          STACK_UNWIND (frame, op_ret, op_errno, inode, buf);          return 0; @@ -295,7 +314,9 @@ io_stats_link_cbk (call_frame_t *frame,                     int32_t op_ret,                     int32_t op_errno,                     inode_t *inode, -                   struct stat *buf) +                   struct stat *buf, +                   struct stat *preparent, +                   struct stat *postparent)  {          STACK_UNWIND (frame, op_ret, op_errno, inode, buf);          return 0; @@ -330,7 +351,9 @@ io_stats_rmdir_cbk (call_frame_t *frame,                      void *cookie,                      xlator_t *this,                      int32_t op_ret, -                    int32_t op_errno) +                    int32_t op_errno, +                    struct stat *preparent, +                    struct stat *postparent)  {          STACK_UNWIND (frame, op_ret, op_errno);          return 0; @@ -342,9 +365,10 @@ io_stats_truncate_cbk (call_frame_t *frame,                         xlator_t *this,                         int32_t op_ret,                         int32_t op_errno, -                       struct stat *buf) +                       struct stat *prebuf, +                       struct stat *postbuf)  { -        STACK_UNWIND (frame, op_ret, op_errno, buf); +        STACK_UNWIND (frame, op_ret, op_errno, prebuf, postbuf);          return 0;  } @@ -466,9 +490,10 @@ io_stats_ftruncate_cbk (call_frame_t *frame,                          xlator_t *this,                          int32_t op_ret,                          int32_t op_errno, -                        struct stat *buf) +                        struct stat *prebuf, +                        struct stat *postbuf)  { -        STACK_UNWIND (frame, op_ret, op_errno, buf); +        STACK_UNWIND (frame, op_ret, op_errno, prebuf, postbuf);          return 0;  } @@ -863,7 +888,7 @@ io_stats_open (call_frame_t *frame,                 xlator_t *this,                 loc_t *loc,                 int32_t flags, -               fd_t *fd) +               fd_t *fd, int32_t wbflags)  {          BUMP_HIT(OPEN); @@ -873,7 +898,7 @@ io_stats_open (call_frame_t *frame,                      FIRST_CHILD(this)->fops->open,                      loc,                      flags, -                    fd); +                    fd, wbflags);          return 0;  } diff --git a/xlators/debug/trace/src/trace.c b/xlators/debug/trace/src/trace.c index 2b66720a0cb..2504707627a 100644 --- a/xlators/debug/trace/src/trace.c +++ b/xlators/debug/trace/src/trace.c @@ -63,7 +63,9 @@ trace_create_cbk (call_frame_t *frame,  		  int32_t op_errno,  		  fd_t *fd,  		  inode_t *inode, -		  struct stat *buf) +		  struct stat *buf, +                  struct stat *preparent, +                  struct stat *postparent)  {  	char atime_buf[256], mtime_buf[256], ctime_buf[256];  	ERR_EINVAL_NORETURN (!this); @@ -207,23 +209,24 @@ trace_writev_cbk (call_frame_t *frame,  		  xlator_t *this,  		  int32_t op_ret,  		  int32_t op_errno, -		  struct stat *buf) +                  struct stat *prebuf, +		  struct stat *postbuf)  {  	char atime_buf[256], mtime_buf[256], ctime_buf[256];  	ERR_EINVAL_NORETURN (!this);  	if (trace_fop_names[GF_FOP_WRITE].enabled) {  		if (op_ret >= 0) { -			strftime (atime_buf, 256, "[%b %d %H:%M:%S]", localtime (&buf->st_atime)); -			strftime (mtime_buf, 256, "[%b %d %H:%M:%S]", localtime (&buf->st_mtime)); -			strftime (ctime_buf, 256, "[%b %d %H:%M:%S]", localtime (&buf->st_ctime)); +			strftime (atime_buf, 256, "[%b %d %H:%M:%S]", localtime (&postbuf->st_atime)); +			strftime (mtime_buf, 256, "[%b %d %H:%M:%S]", localtime (&postbuf->st_mtime)); +			strftime (ctime_buf, 256, "[%b %d %H:%M:%S]", localtime (&postbuf->st_ctime));  			gf_log (this->name, GF_LOG_NORMAL,   				"%"PRId64": (op_ret=%d, *buf {st_ino=%"PRIu64", "  				"st_size=%"PRId64", st_blocks=%"PRId64", st_atime=%s, "  				"st_mtime=%s, st_ctime=%s})", -				frame->root->unique, op_ret, buf->st_ino, buf->st_size,  -				buf->st_blocks, atime_buf, mtime_buf, ctime_buf); +				frame->root->unique, op_ret, postbuf->st_ino, postbuf->st_size,  +				postbuf->st_blocks, atime_buf, mtime_buf, ctime_buf);  		} else {  			gf_log (this->name, GF_LOG_NORMAL,   				"%"PRId64": (op_ret=%d, op_errno=%d)", @@ -231,7 +234,7 @@ trace_writev_cbk (call_frame_t *frame,  		}      	} -	STACK_UNWIND (frame, op_ret, op_errno, buf); +	STACK_UNWIND (frame, op_ret, op_errno, prebuf, postbuf);  	return 0;  } @@ -282,7 +285,9 @@ trace_fsync_cbk (call_frame_t *frame,  		 void *cookie,  		 xlator_t *this,  		 int32_t op_ret, -		 int32_t op_errno) +		 int32_t op_errno, +                 struct stat *prebuf, +                 struct stat *postbuf)  {  	ERR_EINVAL_NORETURN (!this ); @@ -418,7 +423,9 @@ trace_unlink_cbk (call_frame_t *frame,  		  void *cookie,  		  xlator_t *this,  		  int32_t op_ret, -		  int32_t op_errno) +		  int32_t op_errno, +                  struct stat *preparent, +                  struct stat *postparent)  {  	ERR_EINVAL_NORETURN (!this ); @@ -438,7 +445,11 @@ trace_rename_cbk (call_frame_t *frame,  		  xlator_t *this,  		  int32_t op_ret,  		  int32_t op_errno, -		  struct stat *buf) +		  struct stat *buf, +                  struct stat *preoldparent, +                  struct stat *postoldparent, +                  struct stat *prenewparent, +                  struct stat *postnewparent)  {  	ERR_EINVAL_NORETURN (!this ); @@ -459,7 +470,8 @@ trace_readlink_cbk (call_frame_t *frame,  		    xlator_t *this,  		    int32_t op_ret,  		    int32_t op_errno, -		    const char *buf) +		    const char *buf, +                    struct stat *sbuf)  {  	ERR_EINVAL_NORETURN (!this ); @@ -481,7 +493,8 @@ trace_lookup_cbk (call_frame_t *frame,  		  int32_t op_errno,  		  inode_t *inode,  		  struct stat *buf, -		  dict_t *xattr) +		  dict_t *xattr, +                  struct stat *postparent)  {  	ERR_EINVAL_NORETURN (!this ); @@ -514,7 +527,9 @@ trace_symlink_cbk (call_frame_t *frame,  		   int32_t op_ret,  		   int32_t op_errno,  		   inode_t *inode, -		   struct stat *buf) +                   struct stat *buf, +                   struct stat *preparent, +                   struct stat *postparent)  {  	char atime_buf[256], mtime_buf[256], ctime_buf[256];  	ERR_EINVAL_NORETURN (!this ); @@ -551,7 +566,9 @@ trace_mknod_cbk (call_frame_t *frame,  		 int32_t op_ret,  		 int32_t op_errno,  		 inode_t *inode, -		 struct stat *buf) +                 struct stat *buf, +                 struct stat *preparent, +                 struct stat *postparent)  {  	char atime_buf[256], mtime_buf[256], ctime_buf[256];  	ERR_EINVAL_NORETURN (!this ); @@ -591,7 +608,9 @@ trace_mkdir_cbk (call_frame_t *frame,  		 int32_t op_ret,  		 int32_t op_errno,  		 inode_t *inode, -		 struct stat *buf) +                 struct stat *buf, +                 struct stat *preparent, +                 struct stat *postparent)  {  	ERR_EINVAL_NORETURN (!this ); @@ -613,7 +632,9 @@ trace_link_cbk (call_frame_t *frame,  		int32_t op_ret,  		int32_t op_errno,  		inode_t *inode, -		struct stat *buf) +                struct stat *buf, +                struct stat *preparent, +                struct stat *postparent)  {  	ERR_EINVAL_NORETURN (!this ); @@ -679,7 +700,9 @@ trace_rmdir_cbk (call_frame_t *frame,  		 void *cookie,  		 xlator_t *this,  		 int32_t op_ret, -		 int32_t op_errno) +		 int32_t op_errno, +                 struct stat *preparent, +                 struct stat *postparent)  {  	ERR_EINVAL_NORETURN (!this ); @@ -699,7 +722,8 @@ trace_truncate_cbk (call_frame_t *frame,  		    xlator_t *this,  		    int32_t op_ret,  		    int32_t op_errno, -		    struct stat *buf) +		    struct stat *prebuf, +                    struct stat *postbuf)  {  	ERR_EINVAL_NORETURN (!this ); @@ -708,8 +732,8 @@ trace_truncate_cbk (call_frame_t *frame,  			gf_log (this->name, GF_LOG_NORMAL,   				"%"PRId64": (op_ret=%d, *buf {st_size=%"PRId64", st_blksize=%"  				GF_PRI_BLKSIZE", st_blocks=%"PRId64"})", -				frame->root->unique, op_ret, buf->st_size, buf->st_blksize,  -				buf->st_blocks); +				frame->root->unique, op_ret, postbuf->st_size, postbuf->st_blksize, +				postbuf->st_blocks);  		} else {  			gf_log (this->name, GF_LOG_NORMAL,   				"%"PRId64": (op_ret=%d, op_errno=%d)", @@ -717,7 +741,7 @@ trace_truncate_cbk (call_frame_t *frame,  		}      	} -	STACK_UNWIND (frame, op_ret, op_errno, buf); +	STACK_UNWIND (frame, op_ret, op_errno, prebuf, postbuf);  	return 0;  } @@ -855,7 +879,8 @@ trace_ftruncate_cbk (call_frame_t *frame,  		     xlator_t *this,  		     int32_t op_ret,  		     int32_t op_errno, -		     struct stat *buf) +		     struct stat *prebuf, +                     struct stat *postbuf)  {  	ERR_EINVAL_NORETURN (!this ); @@ -864,8 +889,8 @@ trace_ftruncate_cbk (call_frame_t *frame,  			gf_log (this->name, GF_LOG_NORMAL,   				"%"PRId64": (op_ret=%d, *buf {st_size=%"PRId64", "  				"st_blksize=%"GF_PRI_BLKSIZE", st_blocks=%"PRId64"})", -				frame->root->unique, op_ret, buf->st_size, buf->st_blksize,  -				buf->st_blocks); +				frame->root->unique, op_ret, postbuf->st_size, postbuf->st_blksize, +				postbuf->st_blocks);  		} else {  			gf_log (this->name, GF_LOG_NORMAL,   				"%"PRId64": (op_ret=%d, op_errno=%d)", @@ -873,7 +898,7 @@ trace_ftruncate_cbk (call_frame_t *frame,  		}      	} -	STACK_UNWIND (frame, op_ret, op_errno, buf); +	STACK_UNWIND (frame, op_ret, op_errno, prebuf, postbuf);  	return 0;  } @@ -1554,7 +1579,7 @@ trace_open (call_frame_t *frame,  	    xlator_t *this,  	    loc_t *loc,  	    int32_t flags, -	    fd_t *fd) +	    fd_t *fd, int32_t wbflags)  {  	ERR_EINVAL_NORETURN (!this || !loc); @@ -1570,7 +1595,7 @@ trace_open (call_frame_t *frame,  		    FIRST_CHILD(this)->fops->open,   		    loc,  		    flags, -		    fd); +		    fd, wbflags);  	return 0;  }  | 
