2 * Copyright (c) 2000-2003,2005 Silicon Graphics, Inc.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write the Free Software Foundation,
16 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 #ifndef __XFS_SUPPORT_KTRACE_H__
19 #define __XFS_SUPPORT_KTRACE_H__
24 * Trace buffer entry structure.
26 typedef struct ktrace_entry
{
31 * Trace buffer header structure.
33 typedef struct ktrace
{
34 int kt_nentries
; /* number of entries in trace buf */
35 int kt_index
; /* current index in entries */
37 ktrace_entry_t
*kt_entries
; /* buffer of entries */
41 * Trace buffer snapshot structure.
43 typedef struct ktrace_snap
{
44 int ks_start
; /* kt_index at time of snap */
45 int ks_index
; /* current index */
49 #ifdef CONFIG_XFS_TRACE
51 extern void ktrace_init(int zentries
);
52 extern void ktrace_uninit(void);
54 extern ktrace_t
*ktrace_alloc(int, unsigned int __nocast
);
55 extern void ktrace_free(ktrace_t
*);
57 extern void ktrace_enter(
76 extern ktrace_entry_t
*ktrace_first(ktrace_t
*, ktrace_snap_t
*);
77 extern int ktrace_nentries(ktrace_t
*);
78 extern ktrace_entry_t
*ktrace_next(ktrace_t
*, ktrace_snap_t
*);
79 extern ktrace_entry_t
*ktrace_skip(ktrace_t
*, int, ktrace_snap_t
*);
82 #define ktrace_init(x) do { } while (0)
83 #define ktrace_uninit() do { } while (0)
84 #endif /* CONFIG_XFS_TRACE */
86 #endif /* __XFS_SUPPORT_KTRACE_H__ */