Commit a270f1d0 authored by Nathan Scott's avatar Nathan Scott

[XFS] Enable tracing in the quota code if requested

SGI Modid: 2.5.x-xfs:slinx:160242a
parent bafd0069
......@@ -37,6 +37,7 @@ ifeq ($(CONFIG_XFS_DEBUG),y)
endif
ifeq ($(CONFIG_XFS_TRACE),y)
EXTRA_CFLAGS += -DPAGEBUF_TRACE
EXTRA_CFLAGS += -DXFS_DQUOT_TRACE
endif
obj-$(CONFIG_XFS_FS) += xfs.o
......
......@@ -124,7 +124,7 @@ xfs_qm_dqinit(
initnsema(&dqp->q_flock, 1, "fdq");
sv_init(&dqp->q_pinwait, SV_DEFAULT, "pdq");
#ifdef DQUOT_TRACING
#ifdef XFS_DQUOT_TRACE
dqp->q_trace = ktrace_alloc(DQUOT_TRACE_SIZE, KM_SLEEP);
xfs_dqtrace_entry(dqp, "DQINIT");
#endif
......@@ -148,7 +148,7 @@ xfs_qm_dqinit(
dqp->q_hash = 0;
ASSERT(dqp->dq_flnext == dqp->dq_flprev);
#ifdef DQUOT_TRACING
#ifdef XFS_DQUOT_TRACE
ASSERT(dqp->q_trace);
xfs_dqtrace_entry(dqp, "DQRECLAIMED_INIT");
#endif
......@@ -173,7 +173,7 @@ xfs_qm_dqdestroy(
freesema(&dqp->q_flock);
sv_destroy(&dqp->q_pinwait);
#ifdef DQUOT_TRACING
#ifdef XFS_DQUOT_TRACE
if (dqp->q_trace)
ktrace_free(dqp->q_trace);
dqp->q_trace = NULL;
......@@ -201,20 +201,20 @@ xfs_qm_dqinit_core(
}
#ifdef DQUOT_TRACING
#ifdef XFS_DQUOT_TRACE
/*
* Dquot tracing for debugging.
*/
/* ARGSUSED */
void
xfs_dqtrace_entry__(
xfs_dquot_t *dqp,
char *func,
void *retaddr,
xfs_inode_t *ip)
__xfs_dqtrace_entry(
xfs_dquot_t *dqp,
char *func,
void *retaddr,
xfs_inode_t *ip)
{
xfs_dquot_t *udqp = NULL;
int ino;
xfs_dquot_t *udqp = NULL;
xfs_ino_t ino = 0;
ASSERT(dqp->q_trace);
if (ip) {
......@@ -227,13 +227,19 @@ xfs_dqtrace_entry__(
(void *)(__psint_t)dqp->q_nrefs,
(void *)(__psint_t)dqp->dq_flags,
(void *)(__psint_t)dqp->q_res_bcount,
(void *)(__psint_t)INT_GET(dqp->q_core.d_bcount, ARCH_CONVERT),
(void *)(__psint_t)INT_GET(dqp->q_core.d_icount, ARCH_CONVERT),
(void *)(__psint_t)INT_GET(dqp->q_core.d_blk_hardlimit, ARCH_CONVERT),
(void *)(__psint_t)INT_GET(dqp->q_core.d_blk_softlimit, ARCH_CONVERT),
(void *)(__psint_t)INT_GET(dqp->q_core.d_ino_hardlimit, ARCH_CONVERT),
(void *)(__psint_t)INT_GET(dqp->q_core.d_ino_softlimit, ARCH_CONVERT),
(void *)(__psint_t)INT_GET(dqp->q_core.d_id, ARCH_CONVERT), /* 11 */
(void *)(__psint_t)INT_GET(dqp->q_core.d_bcount,
ARCH_CONVERT),
(void *)(__psint_t)INT_GET(dqp->q_core.d_icount,
ARCH_CONVERT),
(void *)(__psint_t)INT_GET(dqp->q_core.d_blk_hardlimit,
ARCH_CONVERT),
(void *)(__psint_t)INT_GET(dqp->q_core.d_blk_softlimit,
ARCH_CONVERT),
(void *)(__psint_t)INT_GET(dqp->q_core.d_ino_hardlimit,
ARCH_CONVERT),
(void *)(__psint_t)INT_GET(dqp->q_core.d_ino_softlimit,
ARCH_CONVERT),
(void *)(__psint_t)INT_GET(dqp->q_core.d_id, ARCH_CONVERT),
(void *)(__psint_t)current_pid(),
(void *)(__psint_t)ino,
(void *)(__psint_t)retaddr,
......
......@@ -99,7 +99,7 @@ typedef struct xfs_dquot {
sema_t q_flock; /* flush lock */
uint q_pincount; /* pin count for this dquot */
sv_t q_pinwait; /* sync var for pinning */
#ifdef DQUOT_TRACING
#ifdef XFS_DQUOT_TRACE
struct ktrace *q_trace; /* trace header structure */
#endif
} xfs_dquot_t;
......@@ -175,23 +175,25 @@ XFS_DQ_IS_LOCKED(xfs_dquot_t *dqp)
#define XFS_IS_THIS_QUOTA_OFF(d) (! (XFS_QM_ISUDQ(d) ? \
(XFS_IS_UQUOTA_ON((d)->q_mount)) : \
(XFS_IS_GQUOTA_ON((d)->q_mount))))
#ifdef DQUOT_TRACING
#ifdef XFS_DQUOT_TRACE
/*
* Dquot Tracing stuff.
*/
#define DQUOT_TRACE_SIZE 64
#define DQUOT_KTRACE_ENTRY 1
extern void __xfs_dqtrace_entry(xfs_dquot_t *dqp, char *func,
void *, xfs_inode_t *);
#define xfs_dqtrace_entry_ino(a,b,ip) \
xfs_dqtrace_entry__((a), (b), (void*)__return_address, (ip))
__xfs_dqtrace_entry((a), (b), (void*)__return_address, (ip))
#define xfs_dqtrace_entry(a,b) \
xfs_dqtrace_entry__((a), (b), (void*)__return_address, NULL)
extern void xfs_dqtrace_entry__(xfs_dquot_t *dqp, char *func,
void *, xfs_inode_t *);
__xfs_dqtrace_entry((a), (b), (void*)__return_address, NULL)
#else
#define xfs_dqtrace_entry(a,b)
#define xfs_dqtrace_entry_ino(a,b,ip)
#endif
#ifdef QUOTADEBUG
extern void xfs_qm_dqprint(xfs_dquot_t *);
#else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment