Skip to content

Commit

Permalink
xfs: remove leftovers of the old btree tracing code
Browse files Browse the repository at this point in the history
Remove various bits left over from the old kdb-only btree tracing code, but
leave the actual trace point stubs in place to ease adding new event based
btree tracing.

Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Alex Elder <[email protected]>
Reviewed-by: Dave Chinner <[email protected]>
  • Loading branch information
Christoph Hellwig committed Jul 13, 2011
1 parent ea15ab3 commit c84470d
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 621 deletions.
2 changes: 0 additions & 2 deletions fs/xfs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ xfs-y += xfs_alloc.o \
xfs_vnodeops.o \
xfs_rw.o

xfs-$(CONFIG_XFS_TRACE) += xfs_btree_trace.o

# Objects in linux/
xfs-y += $(addprefix $(XFS_LINUX)/, \
kmem.o \
Expand Down
1 change: 0 additions & 1 deletion fs/xfs/linux-2.6/xfs_super.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include "xfs_dinode.h"
#include "xfs_inode.h"
#include "xfs_btree.h"
#include "xfs_btree_trace.h"
#include "xfs_ialloc.h"
#include "xfs_bmap.h"
#include "xfs_rtalloc.h"
Expand Down
75 changes: 0 additions & 75 deletions fs/xfs/xfs_alloc_btree.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include "xfs_dinode.h"
#include "xfs_inode.h"
#include "xfs_btree.h"
#include "xfs_btree_trace.h"
#include "xfs_alloc.h"
#include "xfs_error.h"
#include "xfs_trace.h"
Expand Down Expand Up @@ -311,72 +310,6 @@ xfs_allocbt_recs_inorder(
}
#endif /* DEBUG */

#ifdef XFS_BTREE_TRACE
ktrace_t *xfs_allocbt_trace_buf;

STATIC void
xfs_allocbt_trace_enter(
struct xfs_btree_cur *cur,
const char *func,
char *s,
int type,
int line,
__psunsigned_t a0,
__psunsigned_t a1,
__psunsigned_t a2,
__psunsigned_t a3,
__psunsigned_t a4,
__psunsigned_t a5,
__psunsigned_t a6,
__psunsigned_t a7,
__psunsigned_t a8,
__psunsigned_t a9,
__psunsigned_t a10)
{
ktrace_enter(xfs_allocbt_trace_buf, (void *)(__psint_t)type,
(void *)func, (void *)s, NULL, (void *)cur,
(void *)a0, (void *)a1, (void *)a2, (void *)a3,
(void *)a4, (void *)a5, (void *)a6, (void *)a7,
(void *)a8, (void *)a9, (void *)a10);
}

STATIC void
xfs_allocbt_trace_cursor(
struct xfs_btree_cur *cur,
__uint32_t *s0,
__uint64_t *l0,
__uint64_t *l1)
{
*s0 = cur->bc_private.a.agno;
*l0 = cur->bc_rec.a.ar_startblock;
*l1 = cur->bc_rec.a.ar_blockcount;
}

STATIC void
xfs_allocbt_trace_key(
struct xfs_btree_cur *cur,
union xfs_btree_key *key,
__uint64_t *l0,
__uint64_t *l1)
{
*l0 = be32_to_cpu(key->alloc.ar_startblock);
*l1 = be32_to_cpu(key->alloc.ar_blockcount);
}

STATIC void
xfs_allocbt_trace_record(
struct xfs_btree_cur *cur,
union xfs_btree_rec *rec,
__uint64_t *l0,
__uint64_t *l1,
__uint64_t *l2)
{
*l0 = be32_to_cpu(rec->alloc.ar_startblock);
*l1 = be32_to_cpu(rec->alloc.ar_blockcount);
*l2 = 0;
}
#endif /* XFS_BTREE_TRACE */

static const struct xfs_btree_ops xfs_allocbt_ops = {
.rec_len = sizeof(xfs_alloc_rec_t),
.key_len = sizeof(xfs_alloc_key_t),
Expand All @@ -393,18 +326,10 @@ static const struct xfs_btree_ops xfs_allocbt_ops = {
.init_rec_from_cur = xfs_allocbt_init_rec_from_cur,
.init_ptr_from_cur = xfs_allocbt_init_ptr_from_cur,
.key_diff = xfs_allocbt_key_diff,

#ifdef DEBUG
.keys_inorder = xfs_allocbt_keys_inorder,
.recs_inorder = xfs_allocbt_recs_inorder,
#endif

#ifdef XFS_BTREE_TRACE
.trace_enter = xfs_allocbt_trace_enter,
.trace_cursor = xfs_allocbt_trace_cursor,
.trace_key = xfs_allocbt_trace_key,
.trace_record = xfs_allocbt_trace_record,
#endif
};

/*
Expand Down
98 changes: 0 additions & 98 deletions fs/xfs/xfs_bmap_btree.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include "xfs_inode_item.h"
#include "xfs_alloc.h"
#include "xfs_btree.h"
#include "xfs_btree_trace.h"
#include "xfs_itable.h"
#include "xfs_bmap.h"
#include "xfs_error.h"
Expand Down Expand Up @@ -732,95 +731,6 @@ xfs_bmbt_recs_inorder(
}
#endif /* DEBUG */

#ifdef XFS_BTREE_TRACE
ktrace_t *xfs_bmbt_trace_buf;

STATIC void
xfs_bmbt_trace_enter(
struct xfs_btree_cur *cur,
const char *func,
char *s,
int type,
int line,
__psunsigned_t a0,
__psunsigned_t a1,
__psunsigned_t a2,
__psunsigned_t a3,
__psunsigned_t a4,
__psunsigned_t a5,
__psunsigned_t a6,
__psunsigned_t a7,
__psunsigned_t a8,
__psunsigned_t a9,
__psunsigned_t a10)
{
struct xfs_inode *ip = cur->bc_private.b.ip;
int whichfork = cur->bc_private.b.whichfork;

ktrace_enter(xfs_bmbt_trace_buf,
(void *)((__psint_t)type | (whichfork << 8) | (line << 16)),
(void *)func, (void *)s, (void *)ip, (void *)cur,
(void *)a0, (void *)a1, (void *)a2, (void *)a3,
(void *)a4, (void *)a5, (void *)a6, (void *)a7,
(void *)a8, (void *)a9, (void *)a10);
}

STATIC void
xfs_bmbt_trace_cursor(
struct xfs_btree_cur *cur,
__uint32_t *s0,
__uint64_t *l0,
__uint64_t *l1)
{
struct xfs_bmbt_rec_host r;

xfs_bmbt_set_all(&r, &cur->bc_rec.b);

*s0 = (cur->bc_nlevels << 24) |
(cur->bc_private.b.flags << 16) |
cur->bc_private.b.allocated;
*l0 = r.l0;
*l1 = r.l1;
}

STATIC void
xfs_bmbt_trace_key(
struct xfs_btree_cur *cur,
union xfs_btree_key *key,
__uint64_t *l0,
__uint64_t *l1)
{
*l0 = be64_to_cpu(key->bmbt.br_startoff);
*l1 = 0;
}

/* Endian flipping versions of the bmbt extraction functions */
STATIC void
xfs_bmbt_disk_get_all(
xfs_bmbt_rec_t *r,
xfs_bmbt_irec_t *s)
{
__xfs_bmbt_get_all(get_unaligned_be64(&r->l0),
get_unaligned_be64(&r->l1), s);
}

STATIC void
xfs_bmbt_trace_record(
struct xfs_btree_cur *cur,
union xfs_btree_rec *rec,
__uint64_t *l0,
__uint64_t *l1,
__uint64_t *l2)
{
struct xfs_bmbt_irec irec;

xfs_bmbt_disk_get_all(&rec->bmbt, &irec);
*l0 = irec.br_startoff;
*l1 = irec.br_startblock;
*l2 = irec.br_blockcount;
}
#endif /* XFS_BTREE_TRACE */

static const struct xfs_btree_ops xfs_bmbt_ops = {
.rec_len = sizeof(xfs_bmbt_rec_t),
.key_len = sizeof(xfs_bmbt_key_t),
Expand All @@ -837,18 +747,10 @@ static const struct xfs_btree_ops xfs_bmbt_ops = {
.init_rec_from_cur = xfs_bmbt_init_rec_from_cur,
.init_ptr_from_cur = xfs_bmbt_init_ptr_from_cur,
.key_diff = xfs_bmbt_key_diff,

#ifdef DEBUG
.keys_inorder = xfs_bmbt_keys_inorder,
.recs_inorder = xfs_bmbt_recs_inorder,
#endif

#ifdef XFS_BTREE_TRACE
.trace_enter = xfs_bmbt_trace_enter,
.trace_cursor = xfs_bmbt_trace_cursor,
.trace_key = xfs_bmbt_trace_key,
.trace_record = xfs_bmbt_trace_record,
#endif
};

/*
Expand Down
1 change: 0 additions & 1 deletion fs/xfs/xfs_btree.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include "xfs_inode.h"
#include "xfs_inode_item.h"
#include "xfs_btree.h"
#include "xfs_btree_trace.h"
#include "xfs_error.h"
#include "xfs_trace.h"

Expand Down
38 changes: 19 additions & 19 deletions fs/xfs/xfs_btree.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,25 +199,6 @@ struct xfs_btree_ops {
union xfs_btree_rec *r1,
union xfs_btree_rec *r2);
#endif

/* btree tracing */
#ifdef XFS_BTREE_TRACE
void (*trace_enter)(struct xfs_btree_cur *, const char *,
char *, int, int, __psunsigned_t,
__psunsigned_t, __psunsigned_t,
__psunsigned_t, __psunsigned_t,
__psunsigned_t, __psunsigned_t,
__psunsigned_t, __psunsigned_t,
__psunsigned_t, __psunsigned_t);
void (*trace_cursor)(struct xfs_btree_cur *, __uint32_t *,
__uint64_t *, __uint64_t *);
void (*trace_key)(struct xfs_btree_cur *,
union xfs_btree_key *, __uint64_t *,
__uint64_t *);
void (*trace_record)(struct xfs_btree_cur *,
union xfs_btree_rec *, __uint64_t *,
__uint64_t *, __uint64_t *);
#endif
};

/*
Expand Down Expand Up @@ -452,4 +433,23 @@ static inline int xfs_btree_get_level(struct xfs_btree_block *block)
(XFS_FSB_TO_AGNO(mp, fsb) < mp->m_sb.sb_agcount && \
XFS_FSB_TO_AGBNO(mp, fsb) < mp->m_sb.sb_agblocks)

/*
* Trace hooks. Currently not implemented as they need to be ported
* over to the generic tracing functionality, which is some effort.
*
* i,j = integer (32 bit)
* b = btree block buffer (xfs_buf_t)
* p = btree ptr
* r = btree record
* k = btree key
*/
#define XFS_BTREE_TRACE_ARGBI(c, b, i)
#define XFS_BTREE_TRACE_ARGBII(c, b, i, j)
#define XFS_BTREE_TRACE_ARGI(c, i)
#define XFS_BTREE_TRACE_ARGIPK(c, i, p, s)
#define XFS_BTREE_TRACE_ARGIPR(c, i, p, r)
#define XFS_BTREE_TRACE_ARGIK(c, i, k)
#define XFS_BTREE_TRACE_ARGR(c, r)
#define XFS_BTREE_TRACE_CURSOR(c, t)

#endif /* __XFS_BTREE_H__ */
Loading

0 comments on commit c84470d

Please sign in to comment.