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.
29 #pragma ident "%Z%%M% %I% %E% SMI"
31 #include <tnf/probe.h>
33 #include "tnf_types.h"
40 * Size of a TNF buffer block
43 #define TNF_BLOCK_SIZE 512
44 #define TNF_BLOCK_MASK ~(TNF_BLOCK_SIZE - 1)
47 * Size of TNF file directory area
50 #define TNF_DIRECTORY_SIZE (1 << 16)
53 * specification of index field of probe control block
56 #define PROBE_INDEX_TYPE_MASK 0x3
57 #define PROBE_INDEX_MEM_PTR 0x0 /* index is a normal memory ptr */
58 #define PROBE_INDEX_FILE_PTR 0x1 /* index is a file abs ptr */
59 #define PROBE_INDEX_LOW_MASK 0xffff0000
60 #define PROBE_INDEX_SHIFT 16
62 #define PROBE_IS_FILE_PTR(x) \
63 (((x) & PROBE_INDEX_TYPE_MASK) == PROBE_INDEX_FILE_PTR)
65 #define ATTR_SEPARATOR ';'
66 #define VAL_SEPARATOR ' '
69 tnf_record_p record_p
;
70 tnf_uint32_t record_gen
;
83 * time base should be on a double word boundary to avoid pads
85 tnf_longlong_t time_base
;
86 } tnf_schedule_prototype_t
;
91 tnf_properties_t properties
;
92 tnf_slot_types_t slot_types
;
93 tnf_type_size_t type_size
;
94 tnf_slot_names_t slot_names
;
96 } tnf_probe_prototype_t
;
103 * Data structure that is the glue between the tnf layer and the buffering
107 /* fields needed by TNF writing layer */
108 enum tnf_alloc_mode mode
;
109 void * (*alloc
)(TNFW_B_WCB
*, size_t, enum tnf_alloc_mode
);
110 TNFW_B_STATUS (*commit
)(TNFW_B_WCB
*);
111 TNFW_B_STATUS (*rollback
)(TNFW_B_WCB
*);
113 /* fields needed by tracing allocation and final function */
115 tnf_schedule_t schedule
;
121 extern tnf_tag_data_t
*tnf_probe_type_tag_data
;
122 extern tnf_tag_data_t
*tnf_sched_rec_tag_data
;
124 tnf_record_p
tnf_schedule_write(tnf_ops_t
*ops
, tnf_schedule_t
*sched
);
125 uintptr_t tnf_probe_tag(tnf_ops_t
*ops
, tnf_probe_control_t
*probe
);
126 void _tnf_sched_init(tnf_schedule_t
*, hrtime_t
);
127 int _tnf_trace_initialize(void);
128 void _tnf_fork_thread_setup(void);
130 extern char tnf_trace_file_name
[];
132 /* PROJECT PRIVATE interfaces between prex and libtnfprobe */
134 void *tnf_trace_alloc(tnf_ops_t
*, tnf_probe_control_t
*, tnf_probe_setup_t
*);
136 void tnf_trace_end(tnf_probe_setup_t
*);
138 void tnf_trace_commit(tnf_probe_setup_t
*);
140 void tnf_trace_rollback(tnf_probe_setup_t
*);
142 void tnf_probe_debug(tnf_probe_setup_t
*);
148 #endif /* _TNF_TRACE_H */