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]
23 * Copyright (c) 1994, by Sun Microsytems, Inc.
26 #ifndef _SYS_TNF_PROBE_H
27 #define _SYS_TNF_PROBE_H
29 #pragma ident "%Z%%M% %I% %E% SMI"
31 #include <sys/tnf_writer.h>
37 #define TNF_STRINGIFY(x) #x
38 #define TNF_STRINGVALUE(x) TNF_STRINGIFY(x)
41 * Alignment of tnf_ref32_t
44 struct _tnf_ref32_align
{
48 #define TNF_REF32_ALIGN TNF_OFFSETOF(struct _tnf_ref32_align, t)
54 struct tnf_probe_version
{
55 size_t version_size
; /* sizeof(struct tnf_probe_version) */
56 size_t probe_control_size
; /* sizeof(tnf_probe_control_t) */
59 extern struct tnf_probe_version __tnf_probe_version_1
;
60 #pragma weak __tnf_probe_version_1
66 typedef struct tnf_probe_control tnf_probe_control_t
;
67 typedef struct tnf_probe_setup tnf_probe_setup_t
;
69 /* returns pointer to buffer */
70 typedef void * (*tnf_probe_test_func_t
)(void *,
71 tnf_probe_control_t
*,
74 /* returns buffer pointer */
75 typedef void * (*tnf_probe_alloc_func_t
)(tnf_ops_t
*, /* tpd */
76 tnf_probe_control_t
*,
79 typedef void (*tnf_probe_func_t
)(tnf_probe_setup_t
*);
82 * Probe argument block
85 struct tnf_probe_setup
{
88 tnf_probe_control_t
*probe_p
;
95 struct tnf_probe_control
{
96 const struct tnf_probe_version
*version
;
97 tnf_probe_control_t
*next
;
98 tnf_probe_test_func_t test_func
;
99 tnf_probe_alloc_func_t alloc_func
;
100 tnf_probe_func_t probe_func
;
101 tnf_probe_func_t commit_func
;
104 tnf_tag_data_t
***slot_types
;
105 unsigned long tnf_event_size
;
110 #define TNF_NEXT_INIT 0
114 #define TNF_NEXT_INIT -1
122 #define TNF_DECLARE_RECORD(ctype, record) \
123 typedef tnf_reference_t record##_t
125 #define TNF_DEFINE_RECORD_1(ctype, ctype_record, t1, n1)
126 #define TNF_DEFINE_RECORD_2(ctype, ctype_record, t1, n1, t2, n2)
127 #define TNF_DEFINE_RECORD_3(ctype, ctype_record, t1, n1, t2, n2, t3, n3)
128 #define TNF_DEFINE_RECORD_4(ctype, ctype_record, t1, n1, t2, n2, t3, n3, t4, n4)
130 #define TNF_DEFINE_RECORD_5(ctype, ctype_record, t1, n1, t2, n2, t3, n3, t4, n4, t5, n5)
136 #define TNF_PROBE_0(namearg, keysarg, detail) \
138 #define TNF_PROBE_1(namearg, keysarg, detail, type_1, namearg_1, valarg_1) \
141 #define TNF_PROBE_2(namearg, keysarg, detail, type_1, namearg_1, valarg_1, type_2, namearg_2, valarg_2) \
144 #define TNF_PROBE_3(namearg, keysarg, detail, type_1, namearg_1, valarg_1, type_2, namearg_2, valarg_2, type_3, namearg_3, valarg_3) \
147 #define TNF_PROBE_4(namearg, keysarg, detail, type_1, namearg_1, valarg_1, type_2, namearg_2, valarg_2, type_3, namearg_3, valarg_3, type_4, namearg_4, valarg_4) \
150 #define TNF_PROBE_5(namearg, keysarg, detail, type_1, namearg_1, valarg_1, type_2, namearg_2, valarg_2, type_3, namearg_3, valarg_3, type_4, namearg_4, valarg_4, type_5, namearg_5, valarg_5) \
154 * Debug Probe Macros (contain an additional "debug" attribute)
157 #define TNF_PROBE_0_DEBUG(namearg, keysarg, detail) \
160 #define TNF_PROBE_1_DEBUG(namearg, keysarg, detail, type_1, namearg_1, valarg_1) \
163 #define TNF_PROBE_2_DEBUG(namearg, keysarg, detail, type_1, namearg_1, valarg_1, type_2, namearg_2, valarg_2) \
166 #define TNF_PROBE_3_DEBUG(namearg, keysarg, detail, type_1, namearg_1, valarg_1, type_2, namearg_2, valarg_2, type_3, namearg_3, valarg_3) \
169 #define TNF_PROBE_4_DEBUG(namearg, keysarg, detail, type_1, namearg_1, valarg_1, type_2, namearg_2, valarg_2, type_3, namearg_3, valarg_3, type_4, namearg_4, valarg_4) \
172 #define TNF_PROBE_5_DEBUG(namearg, keysarg, detail, type_1, namearg_1, valarg_1, type_2, namearg_2, valarg_2, type_3, namearg_3, valarg_3, type_4, namearg_4, valarg_4, type_5, namearg_5, valarg_5) \
179 #endif /* _SYS_TNF_PROBE_H */