Commit 61e41fb1 authored by Nathan Scott's avatar Nathan Scott

[XFS] Fix ktrace code - dont build unilaterally, and do earlier init for pagebuf use.

SGI Modid: 2.5.x-xfs:slinx:160172a
parent 00d9eb99
......@@ -131,12 +131,13 @@ xfs-y += $(addprefix linux/, \
# Objects in support/
xfs-y += $(addprefix support/, \
debug.o \
ktrace.o \
move.o \
mrlock.o \
qsort.o \
uuid.o)
xfs-$(CONFIG_XFS_TRACE) += support/ktrace.o
# Quota and DMAPI stubs
xfs-y += xfs_dmops.o \
xfs_qmops.o
......
......@@ -869,6 +869,8 @@ init_xfs_fs( void )
si_meminfo(&si);
xfs_physmem = si.totalram;
ktrace_init(64);
error = init_inodecache();
if (error < 0)
goto undo_inodecache;
......@@ -907,6 +909,7 @@ exit_xfs_fs( void )
vfs_exitdmapi();
pagebuf_terminate();
destroy_inodecache();
ktrace_uninit();
}
module_init(init_xfs_fs);
......
/*
* Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
* Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
......@@ -40,8 +40,6 @@
#include "debug.h"
#include "ktrace.h"
#if (defined(DEBUG) || defined(CONFIG_XFS_VNODE_TRACING))
static kmem_zone_t *ktrace_hdr_zone;
static kmem_zone_t *ktrace_ent_zone;
static int ktrace_zentries;
......@@ -121,7 +119,6 @@ ktrace_alloc(int nentries, int sleep)
ktp->kt_nentries = nentries;
ktp->kt_index = 0;
ktp->kt_rollover = 0;
return ktp;
}
......@@ -235,7 +232,6 @@ ktrace_nentries(
return (ktp->kt_rollover ? ktp->kt_nentries : ktp->kt_index);
}
/*
* ktrace_first()
*
......@@ -276,7 +272,7 @@ ktrace_first(ktrace_t *ktp, ktrace_snap_t *ktsp)
}
return ktep;
}
EXPORT_SYMBOL(ktrace_first);
/*
* ktrace_next()
......@@ -311,11 +307,7 @@ ktrace_next(
return ktep;
}
#if (defined(DEBUG) || defined(CONFIG_XFS_VNODE_TRACING))
EXPORT_SYMBOL(ktrace_first);
EXPORT_SYMBOL(ktrace_next);
#endif
/*
* ktrace_skip()
......@@ -323,7 +315,6 @@ EXPORT_SYMBOL(ktrace_next);
* Skip the next "count" entries and return the entry after that.
* Return NULL if this causes us to iterate past the beginning again.
*/
ktrace_entry_t *
ktrace_skip(
ktrace_t *ktp,
......@@ -362,18 +353,3 @@ ktrace_skip(
}
return ktep;
}
#else
ktrace_t *
ktrace_alloc(int nentries, int sleep)
{
/*
* KM_SLEEP callers don't expect failure.
*/
if (sleep & KM_SLEEP)
panic("ktrace_alloc: NULL memory on KM_SLEEP request!");
return NULL;
}
#endif
/*
* Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
* Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
......@@ -32,6 +32,7 @@
#ifndef __XFS_SUPPORT_KTRACE_H__
#define __XFS_SUPPORT_KTRACE_H__
#include <support/spin.h>
/*
* Trace buffer entry structure.
......@@ -59,16 +60,13 @@ typedef struct ktrace_snap {
int ks_index; /* current index */
} ktrace_snap_t;
/*
* Exported interfaces.
*/
extern ktrace_t *ktrace_alloc(int, int);
#if (defined(DEBUG) || defined(CONFIG_XFS_VNODE_TRACING))
#ifdef CONFIG_XFS_TRACE
extern void ktrace_init(int zentries);
extern void ktrace_uninit(void);
extern ktrace_t *ktrace_alloc(int, int);
extern void ktrace_free(ktrace_t *);
extern void ktrace_enter(
......@@ -96,10 +94,8 @@ extern ktrace_entry_t *ktrace_next(ktrace_t *, ktrace_snap_t *);
extern ktrace_entry_t *ktrace_skip(ktrace_t *, int, ktrace_snap_t *);
#else
#define ktrace_init(x) do { } while (0)
#define ktrace_uninit() do { } while (0)
#endif /* CONFIG_XFS_TRACE */
#define ktrace_free(ktp)
#define ktrace_enter(ktp,v0,v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13,v14,v15)
#endif
#endif /* __XFS_SUPPORT_KTRACE_H__ */
#endif /* __XFS_SUPPORT_KTRACE_H__ */
......@@ -132,14 +132,6 @@ xfs_init(void)
"xfs_chashlist");
_ACL_ZONE_INIT(xfs_acl_zone, "xfs_acl");
#ifdef CONFIG_XFS_VNODE_TRACING
ktrace_init(VNODE_TRACE_SIZE);
#else
#ifdef DEBUG
ktrace_init(64);
#endif
#endif
/*
* Allocate global trace buffers.
*/
......@@ -203,9 +195,6 @@ xfs_cleanup(void)
kmem_cache_destroy(xfs_ili_zone);
kmem_cache_destroy(xfs_chashlist_zone);
_ACL_ZONE_DESTROY(xfs_acl_zone);
#if (defined(DEBUG) || defined(CONFIG_XFS_VNODE_TRACING))
ktrace_uninit();
#endif
}
/*
......
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