[09/21] xfs: finish our set of inode get/put tracepoints for scrub
diff mbox

Message ID 152986826640.3155.4987566125495724086.stgit@magnolia
State New
Headers show

Commit Message

Darrick J. Wong June 24, 2018, 7:24 p.m. UTC
From: Darrick J. Wong <darrick.wong@oracle.com>

Finish setting up tracepoints to track inode get/put operations when
running them through the scrub code.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/scrub/common.c |    2 ++
 fs/xfs/scrub/dir.c    |    1 +
 fs/xfs/scrub/parent.c |    1 +
 fs/xfs/scrub/scrub.c  |    1 +
 fs/xfs/scrub/trace.h  |    3 +++
 5 files changed, 8 insertions(+)



--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox

diff --git a/fs/xfs/scrub/common.c b/fs/xfs/scrub/common.c
index 9740c28384b6..6dcd83944ab6 100644
--- a/fs/xfs/scrub/common.c
+++ b/fs/xfs/scrub/common.c
@@ -717,7 +717,9 @@  xfs_scrub_get_inode(
 				error, __return_address);
 		return error;
 	}
+	trace_xfs_scrub_iget_target(ip, __this_address);
 	if (VFS_I(ip)->i_generation != sc->sm->sm_gen) {
+		trace_xfs_scrub_iput_target(ip, __this_address);
 		iput(VFS_I(ip));
 		return -ENOENT;
 	}
diff --git a/fs/xfs/scrub/dir.c b/fs/xfs/scrub/dir.c
index 5cb371576732..a11dde63535c 100644
--- a/fs/xfs/scrub/dir.c
+++ b/fs/xfs/scrub/dir.c
@@ -81,6 +81,7 @@  xfs_scrub_dir_check_ftype(
 	if (!xfs_scrub_fblock_xref_process_error(sdc->sc, XFS_DATA_FORK, offset,
 			&error))
 		goto out;
+	trace_xfs_scrub_iget(ip, __this_address);
 
 	/* Convert mode to the DT_* values that dir_emit uses. */
 	ino_dtype = xfs_dir3_get_dtype(mp,
diff --git a/fs/xfs/scrub/parent.c b/fs/xfs/scrub/parent.c
index fd0b2bfb8f18..c5ce6622d4f9 100644
--- a/fs/xfs/scrub/parent.c
+++ b/fs/xfs/scrub/parent.c
@@ -170,6 +170,7 @@  xfs_scrub_parent_validate(
 	}
 	if (!xfs_scrub_fblock_xref_process_error(sc, XFS_DATA_FORK, 0, &error))
 		goto out;
+	trace_xfs_scrub_iget(dp, __this_address);
 	if (dp == sc->ip || !S_ISDIR(VFS_I(dp)->i_mode)) {
 		xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, 0);
 		goto out_rele;
diff --git a/fs/xfs/scrub/scrub.c b/fs/xfs/scrub/scrub.c
index b66cfbc56a34..b24b37b34d85 100644
--- a/fs/xfs/scrub/scrub.c
+++ b/fs/xfs/scrub/scrub.c
@@ -191,6 +191,7 @@  xfs_scrub_teardown(
 		sc->tp = NULL;
 	}
 	if (sc->ip) {
+		trace_xfs_scrub_iput_target(sc->ip, __this_address);
 		if (sc->ilock_flags)
 			xfs_iunlock(sc->ip, sc->ilock_flags);
 		if (sc->ip != ip_in &&
diff --git a/fs/xfs/scrub/trace.h b/fs/xfs/scrub/trace.h
index a050a00fc258..2a561689cecb 100644
--- a/fs/xfs/scrub/trace.h
+++ b/fs/xfs/scrub/trace.h
@@ -509,6 +509,9 @@  DEFINE_EVENT(xfs_scrub_iref_class, name, \
 DEFINE_SCRUB_IREF_EVENT(xfs_scrub_iput_deferred);
 DEFINE_SCRUB_IREF_EVENT(xfs_scrub_iput_defer);
 DEFINE_SCRUB_IREF_EVENT(xfs_scrub_iput_now);
+DEFINE_SCRUB_IREF_EVENT(xfs_scrub_iget);
+DEFINE_SCRUB_IREF_EVENT(xfs_scrub_iget_target);
+DEFINE_SCRUB_IREF_EVENT(xfs_scrub_iput_target);
 
 /* repair tracepoints */
 #if IS_ENABLED(CONFIG_XFS_ONLINE_REPAIR)