diff mbox series

[v2,16/15] xfs: start documenting common units and tags used in tracepoints

Message ID 20210819034647.GR12640@magnolia (mailing list archive)
State Superseded, archived
Headers show
Series None | expand

Commit Message

Darrick J. Wong Aug. 19, 2021, 3:46 a.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

Because there are a lot of tracepoints that express numeric data with
an associated unit and tag, document what they are to help everyone else
keep these thigns straight.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
v2: update unit names, say that we want hex, and put related tag names together
---
 fs/xfs/scrub/trace.h |    4 ++++
 fs/xfs/xfs_trace.h   |   35 +++++++++++++++++++++++++++++++++++
 2 files changed, 39 insertions(+)

Comments

Dave Chinner Aug. 19, 2021, 5:39 a.m. UTC | #1
On Wed, Aug 18, 2021 at 08:46:47PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> Because there are a lot of tracepoints that express numeric data with
> an associated unit and tag, document what they are to help everyone else
> keep these thigns straight.
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---
> v2: update unit names, say that we want hex, and put related tag names together
> ---

Looks good.

Reviewed-by: Dave Chinner <dchinner@redhat.com>
Carlos Maiolino Aug. 19, 2021, 1:27 p.m. UTC | #2
On Wed, Aug 18, 2021 at 08:46:47PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> Because there are a lot of tracepoints that express numeric data with
> an associated unit and tag, document what they are to help everyone else
> keep these thigns straight.
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---
> v2: update unit names, say that we want hex, and put related tag names together
> ---
...
> + * daddr: physical block number in 512b blocks
> + * daddrcount: number of blocks in a physical extent, in 512b blocks

Shouldn't this be bbcount?

Other than that, it looks good:

Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Darrick J. Wong Aug. 19, 2021, 5:06 p.m. UTC | #3
On Thu, Aug 19, 2021 at 03:27:17PM +0200, Carlos Maiolino wrote:
> On Wed, Aug 18, 2021 at 08:46:47PM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> > 
> > Because there are a lot of tracepoints that express numeric data with
> > an associated unit and tag, document what they are to help everyone else
> > keep these thigns straight.
> > 
> > Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> > ---
> > v2: update unit names, say that we want hex, and put related tag names together
> > ---
> ...
> > + * daddr: physical block number in 512b blocks
> > + * daddrcount: number of blocks in a physical extent, in 512b blocks
> 
> Shouldn't this be bbcount?

Yep, and the 'blockcount' above should be 'fsbcount' too.

Thanks for the reviews, everyone!

--D

> 
> Other than that, it looks good:
> 
> Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
> 
> -- 
> Carlos
>
diff mbox series

Patch

diff --git a/fs/xfs/scrub/trace.h b/fs/xfs/scrub/trace.h
index dfb10966af24..a7bbb84f91a7 100644
--- a/fs/xfs/scrub/trace.h
+++ b/fs/xfs/scrub/trace.h
@@ -2,6 +2,10 @@ 
 /*
  * Copyright (C) 2017 Oracle.  All Rights Reserved.
  * Author: Darrick J. Wong <darrick.wong@oracle.com>
+ *
+ * NOTE: none of these tracepoints shall be considered a stable kernel ABI
+ * as they can change at any time.  See xfs_trace.h for documentation of
+ * specific units found in tracepoint output.
  */
 #undef TRACE_SYSTEM
 #define TRACE_SYSTEM xfs_scrub
diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
index 676b66173bb1..2694e1022b7b 100644
--- a/fs/xfs/xfs_trace.h
+++ b/fs/xfs/xfs_trace.h
@@ -2,6 +2,41 @@ 
 /*
  * Copyright (c) 2009, Christoph Hellwig
  * All Rights Reserved.
+ *
+ * NOTE: none of these tracepoints shall be considered a stable kernel ABI
+ * as they can change at any time.
+ *
+ * Current conventions for printing numbers measuring specific units:
+ *
+ * agno: allocation group number
+ *
+ * agino: per-AG inode number
+ * ino: filesystem inode number
+ *
+ * agbno: per-AG block number in fs blocks
+ * startblock: physical block number for file mappings.  This is either a
+ *             segmented fsblock for data device mappings, or a rfsblock
+ *             for realtime device mappings
+ * blockcount: number of blocks in an extent, in fs blocks
+ *
+ * daddr: physical block number in 512b blocks
+ * daddrcount: number of blocks in a physical extent, in 512b blocks
+ *
+ * owner: reverse-mapping owner, usually inodes
+ *
+ * fileoff: file offset, in fs blocks
+ * pos: file offset, in bytes
+ * bytecount: number of bytes
+ *
+ * disize: ondisk file size, in bytes
+ * isize: incore file size, in bytes
+ *
+ * forkoff: inode fork offset, in bytes
+ *
+ * ireccount: number of inode records
+ *
+ * Numbers describing space allocations (blocks, extents, inodes) should be
+ * formatted in hexadecimal.
  */
 #undef TRACE_SYSTEM
 #define TRACE_SYSTEM xfs