[PATCH 2/7] xfs: add a separate tracepoint for stealing an open zone for GC

Christoph Hellwig
2026-03-30T05:46:00Z

The case where we have to reuse an already open zone warrants a different
trace point vs the normal opening of a GC zone.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
fs/xfs/xfs_trace.h | 1 +
fs/xfs/xfs_zone_gc.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
index 433f84252119..c1aa15973e74 100644
--- a/fs/xfs/xfs_trace.h
+++ b/fs/xfs/xfs_trace.h
@@ -394,6 +394,7 @@ DEFINE_ZONE_EVENT(xfs_zone_full);
DEFINE_ZONE_EVENT(xfs_zone_opened);
DEFINE_ZONE_EVENT(xfs_zone_reset);
DEFINE_ZONE_EVENT(xfs_zone_gc_target_opened);
+DEFINE_ZONE_EVENT(xfs_zone_gc_target_stolen);

TRACE_EVENT(xfs_zone_free_blocks,
TP_PROTO(struct xfs_rtgroup *rtg, xfs_rgblock_t rgbno,
diff --git a/fs/xfs/xfs_zone_gc.c b/fs/xfs/xfs_zone_gc.c
index f076f66c5d57..273c496c2f1c 100644
--- a/fs/xfs/xfs_zone_gc.c
+++ b/fs/xfs/xfs_zone_gc.c
@@ -543,7 +543,7 @@ xfs_zone_gc_steal_open(
return -EIO;
}

- trace_xfs_zone_gc_target_opened(found->oz_rtg);
+ trace_xfs_zone_gc_target_stolen(found->oz_rtg);
found->oz_is_gc = true;
list_del_init(&found->oz_entry);
zi->zi_nr_open_zones--;
--
2.47.3