4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
24 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
25 * Use is subject to license terms.
31 #pragma ident "%Z%%M% %I% %E% SMI"
33 #include <sys/types.h>
40 typedef struct fmd_tracerec
{
41 hrtime_t tr_time
; /* high-resolution timestamp */
42 const char *tr_file
; /* source file name */
43 uint32_t tr_line
; /* source file line */
44 uint16_t tr_errno
; /* errno value if error */
45 uint8_t tr_tag
; /* tag (see <fmd_subr.h>) */
46 uint8_t tr_depth
; /* depth of tr_stack[] */
47 char tr_msg
[64]; /* formatted message */
48 uintptr_t tr_stack
[1]; /* stack trace (optional) */
51 typedef struct fmd_tracebuf
{
52 fmd_tracerec_t
*tb_buf
; /* pointer to first trace record */
53 fmd_tracerec_t
*tb_end
; /* pointer to last trace record */
54 fmd_tracerec_t
*tb_ptr
; /* next trace record to use */
55 uint_t tb_frames
; /* maximum captured frames */
56 uint_t tb_recs
; /* number of trace records */
57 uint_t tb_size
; /* size of each record */
58 uint_t tb_depth
; /* recursion depth of trace function */
61 typedef fmd_tracerec_t
*fmd_tracebuf_f(fmd_tracebuf_t
*,
62 uint_t
, const char *, va_list);
64 extern fmd_tracebuf_t
*fmd_trace_create(void);
65 extern void fmd_trace_destroy(fmd_tracebuf_t
*);
67 extern fmd_tracebuf_f fmd_trace_none
;
68 extern fmd_tracebuf_f fmd_trace_lite
;
69 extern fmd_tracebuf_f fmd_trace_full
;
75 #endif /* _FMD_TRACE_H */