Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 124787
b: refs/heads/master
c: 8c4ed63
h: refs/heads/master
i:
  124785: 29b1c68
  124783: dcf66d0
v: v3
  • Loading branch information
Christoph Hellwig authored and Lachlan McIlroy committed Oct 30, 2008
1 parent 5b2810c commit 0e0cc70
Show file tree
Hide file tree
Showing 11 changed files with 310 additions and 267 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 854929f05831d3a290a802815ee955b96c740c61
refs/heads/master: 8c4ed633e65d0bd0a25d45aad9b4646e3236cad7
3 changes: 2 additions & 1 deletion trunk/fs/xfs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ xfs-y += xfs_alloc.o \
xfs_dmops.o \
xfs_qmops.o

xfs-$(CONFIG_XFS_TRACE) += xfs_dir2_trace.o
xfs-$(CONFIG_XFS_TRACE) += xfs_btree_trace.o \
xfs_dir2_trace.o

# Objects in linux/
xfs-y += $(addprefix $(XFS_LINUX)/, \
Expand Down
24 changes: 20 additions & 4 deletions trunk/fs/xfs/linux-2.6/xfs_super.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#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 Expand Up @@ -1916,10 +1917,19 @@ xfs_alloc_trace_bufs(void)
if (!xfs_bmap_trace_buf)
goto out_free_alloc_trace;
#endif
#ifdef XFS_BMBT_TRACE
#ifdef XFS_BTREE_TRACE
xfs_allocbt_trace_buf = ktrace_alloc(XFS_ALLOCBT_TRACE_SIZE,
KM_MAYFAIL);
if (!xfs_allocbt_trace_buf)
goto out_free_bmap_trace;

xfs_inobt_trace_buf = ktrace_alloc(XFS_INOBT_TRACE_SIZE, KM_MAYFAIL);
if (!xfs_inobt_trace_buf)
goto out_free_allocbt_trace;

xfs_bmbt_trace_buf = ktrace_alloc(XFS_BMBT_TRACE_SIZE, KM_MAYFAIL);
if (!xfs_bmbt_trace_buf)
goto out_free_bmap_trace;
goto out_free_inobt_trace;
#endif
#ifdef XFS_ATTR_TRACE
xfs_attr_trace_buf = ktrace_alloc(XFS_ATTR_TRACE_SIZE, KM_MAYFAIL);
Expand All @@ -1941,8 +1951,12 @@ xfs_alloc_trace_bufs(void)
ktrace_free(xfs_attr_trace_buf);
out_free_bmbt_trace:
#endif
#ifdef XFS_BMBT_TRACE
#ifdef XFS_BTREE_TRACE
ktrace_free(xfs_bmbt_trace_buf);
out_free_inobt_trace:
ktrace_free(xfs_inobt_trace_buf);
out_free_allocbt_trace:
ktrace_free(xfs_allocbt_trace_buf);
out_free_bmap_trace:
#endif
#ifdef XFS_BMAP_TRACE
Expand All @@ -1965,8 +1979,10 @@ xfs_free_trace_bufs(void)
#ifdef XFS_ATTR_TRACE
ktrace_free(xfs_attr_trace_buf);
#endif
#ifdef XFS_BMBT_TRACE
#ifdef XFS_BTREE_TRACE
ktrace_free(xfs_bmbt_trace_buf);
ktrace_free(xfs_inobt_trace_buf);
ktrace_free(xfs_allocbt_trace_buf);
#endif
#ifdef XFS_BMAP_TRACE
ktrace_free(xfs_bmap_trace_buf);
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/xfs/xfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#define XFS_ATTR_TRACE 1
#define XFS_BLI_TRACE 1
#define XFS_BMAP_TRACE 1
#define XFS_BMBT_TRACE 1
#define XFS_BTREE_TRACE 1
#define XFS_DIR2_TRACE 1
#define XFS_DQUOT_TRACE 1
#define XFS_ILOCK_TRACE 1
Expand Down
73 changes: 73 additions & 0 deletions trunk/fs/xfs/xfs_alloc_btree.c
Original file line number Diff line number Diff line change
Expand Up @@ -2219,8 +2219,81 @@ xfs_allocbt_dup_cursor(
cur->bc_btnum);
}

#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 = {
.dup_cursor = xfs_allocbt_dup_cursor,

#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
Loading

0 comments on commit 0e0cc70

Please sign in to comment.