aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@infradead.org>2010-06-23 21:50:22 -0400
committerAlex Elder <aelder@sgi.com>2010-07-26 14:16:43 -0400
commitd2e078c33c24f97411b0fdd7cd2173e68125e7e3 (patch)
tree596dafaa5f9f6336a62350a889926184a93a3850
parent807cbbdb438d172b87b380eebc1f1c1a5a3549b2 (diff)
xfs: some iget tracing cleanups / fixes
The xfs_iget_alloc/found tracepoints are a bit misnamed and misplaced. Rename them to xfs_iget_hit/xfs_iget_miss and move them to the beggining of the xfs_iget_cache_hit/miss functions. Add a new xfs_iget_reclaim_fail tracepoint for the case where we fail to re-initialize a VFS inode, and add a second instance of the xfs_iget_skip tracepoint for the case of a failed igrab() call. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com>
-rw-r--r--fs/xfs/linux-2.6/xfs_trace.h5
-rw-r--r--fs/xfs/xfs_iget.c8
2 files changed, 7 insertions, 6 deletions
diff --git a/fs/xfs/linux-2.6/xfs_trace.h b/fs/xfs/linux-2.6/xfs_trace.h
index 3f2eec28c70d..9efe368d38c7 100644
--- a/fs/xfs/linux-2.6/xfs_trace.h
+++ b/fs/xfs/linux-2.6/xfs_trace.h
@@ -561,8 +561,9 @@ DEFINE_EVENT(xfs_iget_class, name, \
561 TP_ARGS(ip)) 561 TP_ARGS(ip))
562DEFINE_IGET_EVENT(xfs_iget_skip); 562DEFINE_IGET_EVENT(xfs_iget_skip);
563DEFINE_IGET_EVENT(xfs_iget_reclaim); 563DEFINE_IGET_EVENT(xfs_iget_reclaim);
564DEFINE_IGET_EVENT(xfs_iget_found); 564DEFINE_IGET_EVENT(xfs_iget_reclaim_fail);
565DEFINE_IGET_EVENT(xfs_iget_alloc); 565DEFINE_IGET_EVENT(xfs_iget_hit);
566DEFINE_IGET_EVENT(xfs_iget_miss);
566 567
567DECLARE_EVENT_CLASS(xfs_inode_class, 568DECLARE_EVENT_CLASS(xfs_inode_class,
568 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip), 569 TP_PROTO(struct xfs_inode *ip, unsigned long caller_ip),
diff --git a/fs/xfs/xfs_iget.c b/fs/xfs/xfs_iget.c
index 633cb331b9e9..75664d1b9f59 100644
--- a/fs/xfs/xfs_iget.c
+++ b/fs/xfs/xfs_iget.c
@@ -208,7 +208,7 @@ xfs_iget_cache_hit(
208 ip->i_flags &= ~XFS_INEW; 208 ip->i_flags &= ~XFS_INEW;
209 ip->i_flags |= XFS_IRECLAIMABLE; 209 ip->i_flags |= XFS_IRECLAIMABLE;
210 __xfs_inode_set_reclaim_tag(pag, ip); 210 __xfs_inode_set_reclaim_tag(pag, ip);
211 trace_xfs_iget_reclaim(ip); 211 trace_xfs_iget_reclaim_fail(ip);
212 goto out_error; 212 goto out_error;
213 } 213 }
214 214
@@ -223,6 +223,7 @@ xfs_iget_cache_hit(
223 } else { 223 } else {
224 /* If the VFS inode is being torn down, pause and try again. */ 224 /* If the VFS inode is being torn down, pause and try again. */
225 if (!igrab(inode)) { 225 if (!igrab(inode)) {
226 trace_xfs_iget_skip(ip);
226 error = EAGAIN; 227 error = EAGAIN;
227 goto out_error; 228 goto out_error;
228 } 229 }
@@ -230,6 +231,7 @@ xfs_iget_cache_hit(
230 /* We've got a live one. */ 231 /* We've got a live one. */
231 spin_unlock(&ip->i_flags_lock); 232 spin_unlock(&ip->i_flags_lock);
232 read_unlock(&pag->pag_ici_lock); 233 read_unlock(&pag->pag_ici_lock);
234 trace_xfs_iget_hit(ip);
233 } 235 }
234 236
235 if (lock_flags != 0) 237 if (lock_flags != 0)
@@ -238,7 +240,6 @@ xfs_iget_cache_hit(
238 xfs_iflags_clear(ip, XFS_ISTALE); 240 xfs_iflags_clear(ip, XFS_ISTALE);
239 XFS_STATS_INC(xs_ig_found); 241 XFS_STATS_INC(xs_ig_found);
240 242
241 trace_xfs_iget_found(ip);
242 return 0; 243 return 0;
243 244
244out_error: 245out_error:
@@ -271,7 +272,7 @@ xfs_iget_cache_miss(
271 if (error) 272 if (error)
272 goto out_destroy; 273 goto out_destroy;
273 274
274 xfs_itrace_entry(ip); 275 trace_xfs_iget_miss(ip);
275 276
276 if ((ip->i_d.di_mode == 0) && !(flags & XFS_IGET_CREATE)) { 277 if ((ip->i_d.di_mode == 0) && !(flags & XFS_IGET_CREATE)) {
277 error = ENOENT; 278 error = ENOENT;
@@ -317,7 +318,6 @@ xfs_iget_cache_miss(
317 write_unlock(&pag->pag_ici_lock); 318 write_unlock(&pag->pag_ici_lock);
318 radix_tree_preload_end(); 319 radix_tree_preload_end();
319 320
320 trace_xfs_iget_alloc(ip);
321 *ipp = ip; 321 *ipp = ip;
322 return 0; 322 return 0;
323 323