xref: /onnv-gate/usr/src/uts/common/tnf/mkprobehdr.sh (revision 0:68f95e015346)
1*0Sstevel@tonic-gate#!/usr/bin/sh
2*0Sstevel@tonic-gate#
3*0Sstevel@tonic-gate# CDDL HEADER START
4*0Sstevel@tonic-gate#
5*0Sstevel@tonic-gate# The contents of this file are subject to the terms of the
6*0Sstevel@tonic-gate# Common Development and Distribution License, Version 1.0 only
7*0Sstevel@tonic-gate# (the "License").  You may not use this file except in compliance
8*0Sstevel@tonic-gate# with the License.
9*0Sstevel@tonic-gate#
10*0Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
11*0Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
12*0Sstevel@tonic-gate# See the License for the specific language governing permissions
13*0Sstevel@tonic-gate# and limitations under the License.
14*0Sstevel@tonic-gate#
15*0Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
16*0Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
17*0Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
18*0Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
19*0Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
20*0Sstevel@tonic-gate#
21*0Sstevel@tonic-gate# CDDL HEADER END
22*0Sstevel@tonic-gate#
23*0Sstevel@tonic-gate#
24*0Sstevel@tonic-gate# Copyright (c) 1994-2000 by Sun Microsystems, Inc.
25*0Sstevel@tonic-gate# All rights reserved.
26*0Sstevel@tonic-gate#
27*0Sstevel@tonic-gate#ident	"%Z%%M%	%I%	%E% SMI"
28*0Sstevel@tonic-gate
29*0Sstevel@tonic-gatecat <<ENDSTR
30*0Sstevel@tonic-gate/*
31*0Sstevel@tonic-gate *	Copyright (c) 1994, by Sun Microsytems, Inc.
32*0Sstevel@tonic-gate */
33*0Sstevel@tonic-gate
34*0Sstevel@tonic-gate#ifndef _SYS_TNF_PROBE_H
35*0Sstevel@tonic-gate#define	_SYS_TNF_PROBE_H
36*0Sstevel@tonic-gate
37*0Sstevel@tonic-gate#pragma ident	"%Z%tnf_probe.h	%I%	%E% SMI"
38*0Sstevel@tonic-gate
39*0Sstevel@tonic-gate#include <sys/tnf_writer.h>
40*0Sstevel@tonic-gate
41*0Sstevel@tonic-gate#ifdef __cplusplus
42*0Sstevel@tonic-gateextern "C" {
43*0Sstevel@tonic-gate#endif
44*0Sstevel@tonic-gate
45*0Sstevel@tonic-gate/*
46*0Sstevel@tonic-gate * These macros are used to convert the __LINE__ directive to a
47*0Sstevel@tonic-gate * string in the probe macros below.
48*0Sstevel@tonic-gate */
49*0Sstevel@tonic-gate
50*0Sstevel@tonic-gate#define	TNF_STRINGIFY(x) #x
51*0Sstevel@tonic-gate#define	TNF_STRINGVALUE(x) TNF_STRINGIFY(x)
52*0Sstevel@tonic-gate
53*0Sstevel@tonic-gate/*
54*0Sstevel@tonic-gate * Alignment of tnf_ref32_t
55*0Sstevel@tonic-gate */
56*0Sstevel@tonic-gate
57*0Sstevel@tonic-gatestruct _tnf_ref32_align {
58*0Sstevel@tonic-gate	char		c;
59*0Sstevel@tonic-gate	tnf_ref32_t	t;
60*0Sstevel@tonic-gate};
61*0Sstevel@tonic-gate#define	TNF_REF32_ALIGN		TNF_OFFSETOF(struct _tnf_ref32_align, t)
62*0Sstevel@tonic-gate
63*0Sstevel@tonic-gate/*
64*0Sstevel@tonic-gate * Probe versioning
65*0Sstevel@tonic-gate */
66*0Sstevel@tonic-gate
67*0Sstevel@tonic-gatestruct tnf_probe_version {
68*0Sstevel@tonic-gate	size_t	version_size;		/* sizeof(struct tnf_probe_version) */
69*0Sstevel@tonic-gate	size_t	probe_control_size;	/* sizeof(tnf_probe_control_t) */
70*0Sstevel@tonic-gate};
71*0Sstevel@tonic-gate
72*0Sstevel@tonic-gateextern struct tnf_probe_version __tnf_probe_version_1;
73*0Sstevel@tonic-gate#pragma weak __tnf_probe_version_1
74*0Sstevel@tonic-gate
75*0Sstevel@tonic-gate/*
76*0Sstevel@tonic-gate * Typedefs
77*0Sstevel@tonic-gate */
78*0Sstevel@tonic-gate
79*0Sstevel@tonic-gatetypedef struct tnf_probe_control tnf_probe_control_t;
80*0Sstevel@tonic-gatetypedef struct tnf_probe_setup tnf_probe_setup_t;
81*0Sstevel@tonic-gate
82*0Sstevel@tonic-gate/* returns pointer to buffer */
83*0Sstevel@tonic-gatetypedef void * (*tnf_probe_test_func_t)(void *,
84*0Sstevel@tonic-gate					tnf_probe_control_t *,
85*0Sstevel@tonic-gate					tnf_probe_setup_t *);
86*0Sstevel@tonic-gate
87*0Sstevel@tonic-gate/* returns buffer pointer */
88*0Sstevel@tonic-gatetypedef void * (*tnf_probe_alloc_func_t)(tnf_ops_t *,	/* tpd	*/
89*0Sstevel@tonic-gate					tnf_probe_control_t *,
90*0Sstevel@tonic-gate					tnf_probe_setup_t *);
91*0Sstevel@tonic-gate
92*0Sstevel@tonic-gatetypedef void (*tnf_probe_func_t)(tnf_probe_setup_t *);
93*0Sstevel@tonic-gate
94*0Sstevel@tonic-gate/*
95*0Sstevel@tonic-gate * Probe argument block
96*0Sstevel@tonic-gate */
97*0Sstevel@tonic-gate
98*0Sstevel@tonic-gatestruct tnf_probe_setup {
99*0Sstevel@tonic-gate	tnf_ops_t		*tpd_p;
100*0Sstevel@tonic-gate	void			*buffer_p;
101*0Sstevel@tonic-gate	tnf_probe_control_t	*probe_p;
102*0Sstevel@tonic-gate};
103*0Sstevel@tonic-gate
104*0Sstevel@tonic-gate/*
105*0Sstevel@tonic-gate * Probe control block
106*0Sstevel@tonic-gate */
107*0Sstevel@tonic-gate
108*0Sstevel@tonic-gatestruct tnf_probe_control {
109*0Sstevel@tonic-gate	const struct tnf_probe_version	*version;
110*0Sstevel@tonic-gate	tnf_probe_control_t	*next;
111*0Sstevel@tonic-gate	tnf_probe_test_func_t	test_func;
112*0Sstevel@tonic-gate	tnf_probe_alloc_func_t	alloc_func;
113*0Sstevel@tonic-gate	tnf_probe_func_t	probe_func;
114*0Sstevel@tonic-gate	tnf_probe_func_t	commit_func;
115*0Sstevel@tonic-gate	tnf_uint32_t		index;
116*0Sstevel@tonic-gate	const char		*attrs;
117*0Sstevel@tonic-gate	tnf_tag_data_t		***slot_types;
118*0Sstevel@tonic-gate	unsigned long		tnf_event_size;
119*0Sstevel@tonic-gate};
120*0Sstevel@tonic-gate
121*0Sstevel@tonic-gate#ifdef _KERNEL
122*0Sstevel@tonic-gate
123*0Sstevel@tonic-gate#define	TNF_NEXT_INIT	0
124*0Sstevel@tonic-gate
125*0Sstevel@tonic-gate#else
126*0Sstevel@tonic-gate
127*0Sstevel@tonic-gate#define	TNF_NEXT_INIT	-1
128*0Sstevel@tonic-gate
129*0Sstevel@tonic-gate#endif	/* _KERNEL */
130*0Sstevel@tonic-gate
131*0Sstevel@tonic-gate/*
132*0Sstevel@tonic-gate * TNF Type extension
133*0Sstevel@tonic-gate */
134*0Sstevel@tonic-gate
135*0Sstevel@tonic-gate#ifdef NPROBE
136*0Sstevel@tonic-gate
137*0Sstevel@tonic-gate#define	TNF_DECLARE_RECORD(ctype, record)				\\
138*0Sstevel@tonic-gate	typedef tnf_reference_t record##_t
139*0Sstevel@tonic-gate
140*0Sstevel@tonic-gate#else
141*0Sstevel@tonic-gate
142*0Sstevel@tonic-gate#define	TNF_DECLARE_RECORD(ctype, record)				\\
143*0Sstevel@tonic-gate	typedef tnf_reference_t record##_t;				\\
144*0Sstevel@tonic-gate	extern tnf_tag_data_t *record##_tag_data;			\\
145*0Sstevel@tonic-gate	extern record##_t record(tnf_ops_t *, ctype *, tnf_reference_t)
146*0Sstevel@tonic-gate
147*0Sstevel@tonic-gate#endif	/* NPROBE */
148*0Sstevel@tonic-gate
149*0Sstevel@tonic-gateENDSTR
150*0Sstevel@tonic-gate
151*0Sstevel@tonic-gate#
152*0Sstevel@tonic-gate# The following code generates the five type extension macros
153*0Sstevel@tonic-gate#
154*0Sstevel@tonic-gatefor i in 1 2 3 4 5; do
155*0Sstevel@tonic-gate  echo "#ifdef NPROBE\n"
156*0Sstevel@tonic-gate  echo "/* CSTYLED */"
157*0Sstevel@tonic-gate  echo "#define	TNF_DEFINE_RECORD_$i(ctype, ctype_record\c"
158*0Sstevel@tonic-gate  j=1; while [ $j -le $i ]; do
159*0Sstevel@tonic-gate    echo ", t$j, n$j\c"
160*0Sstevel@tonic-gate    j=`expr $j + 1`
161*0Sstevel@tonic-gate  done
162*0Sstevel@tonic-gate  echo ")\n"
163*0Sstevel@tonic-gate  echo "#else\n"
164*0Sstevel@tonic-gate  echo "/* CSTYLED */"
165*0Sstevel@tonic-gate  echo "#define	TNF_DEFINE_RECORD_$i(ctype, ctype_record\c"
166*0Sstevel@tonic-gate  j=1; while [ $j -le $i ]; do
167*0Sstevel@tonic-gate    echo ", t$j, n$j\c"
168*0Sstevel@tonic-gate    j=`expr $j + 1`
169*0Sstevel@tonic-gate  done
170*0Sstevel@tonic-gate  echo ") \\"
171*0Sstevel@tonic-gate  echo "typedef struct {						\\"
172*0Sstevel@tonic-gate  echo "	tnf_tag_t	tag;					\\"
173*0Sstevel@tonic-gate  j=1; while [ $j -le $i ]; do
174*0Sstevel@tonic-gate    echo "	t$j##_t		data_$j;				\\"
175*0Sstevel@tonic-gate    j=`expr $j + 1`
176*0Sstevel@tonic-gate  done
177*0Sstevel@tonic-gate  echo "} ctype_record##_prototype_t;					\\"
178*0Sstevel@tonic-gate  echo "static tnf_tag_data_t **ctype_record##_type_slots[] = {		\\"
179*0Sstevel@tonic-gate  echo "	&tnf_tag_tag_data,					\\"
180*0Sstevel@tonic-gate  j=1; while [ $j -le $i ]; do
181*0Sstevel@tonic-gate    echo "	&t$j##_tag_data,					\\"
182*0Sstevel@tonic-gate    j=`expr $j + 1`
183*0Sstevel@tonic-gate  done
184*0Sstevel@tonic-gate  echo "	0 };							\\";
185*0Sstevel@tonic-gate  echo "static char *ctype_record##_slot_names[] = {			\\";
186*0Sstevel@tonic-gate  echo "	\"tnf_tag\",						\\"
187*0Sstevel@tonic-gate  j=1; while [ $j -le $i ]; do
188*0Sstevel@tonic-gate    echo "	\"\"#n$j,						\\"
189*0Sstevel@tonic-gate    j=`expr $j + 1`
190*0Sstevel@tonic-gate  done
191*0Sstevel@tonic-gate  echo "	0 };							\\"
192*0Sstevel@tonic-gate  echo "static tnf_tag_data_t ctype_record##_tag_data_rec = {		\\"
193*0Sstevel@tonic-gate  echo "	TNF_TAG_VERSION, &tnf_struct_tag_1,			\\"
194*0Sstevel@tonic-gate  echo "	0, #ctype_record, &tnf_user_struct_properties,		\\"
195*0Sstevel@tonic-gate  echo "	sizeof (ctype_record##_prototype_t),			\\"
196*0Sstevel@tonic-gate  echo "	TNF_REF32_ALIGN,					\\"
197*0Sstevel@tonic-gate  echo "	sizeof (ctype_record##_t), TNF_STRUCT, 0,		\\"
198*0Sstevel@tonic-gate  echo "	ctype_record##_type_slots, ctype_record##_slot_names	\\"
199*0Sstevel@tonic-gate  echo "};								\\"
200*0Sstevel@tonic-gate  echo "tnf_tag_data_t *ctype_record##_tag_data =			\\"
201*0Sstevel@tonic-gate  echo "			&ctype_record##_tag_data_rec;		\\"
202*0Sstevel@tonic-gate  echo "ctype_record##_t						\\"
203*0Sstevel@tonic-gate  echo "ctype_record(tnf_ops_t *ops, ctype * the_ctype,			\\"
204*0Sstevel@tonic-gate  echo "				tnf_reference_t reference)	\\"
205*0Sstevel@tonic-gate  echo "{								\\"
206*0Sstevel@tonic-gate  echo "	tnf_tag_data_t			*metatag_data;		\\"
207*0Sstevel@tonic-gate  echo "	tnf_record_p			metatag_index;		\\"
208*0Sstevel@tonic-gate  echo "	ctype_record##_prototype_t	*buffer;		\\"
209*0Sstevel@tonic-gate  echo "								\\"
210*0Sstevel@tonic-gate  echo "	if (the_ctype == NULL)					\\"
211*0Sstevel@tonic-gate  echo "		return (0);					\\"
212*0Sstevel@tonic-gate  echo "	buffer = (ctype_record##_prototype_t *) tnf_allocate(ops, \\"
213*0Sstevel@tonic-gate  echo "			sizeof (ctype_record##_prototype_t));	\\"
214*0Sstevel@tonic-gate  echo "	if (buffer == NULL)					\\"
215*0Sstevel@tonic-gate  echo "		return (0);					\\"
216*0Sstevel@tonic-gate  echo "								\\"
217*0Sstevel@tonic-gate  echo "	metatag_data = ctype_record##_tag_data;			\\"
218*0Sstevel@tonic-gate  echo "	metatag_index = metatag_data->tag_index ?		\\"
219*0Sstevel@tonic-gate  echo "		metatag_data->tag_index:			\\"
220*0Sstevel@tonic-gate  echo "		metatag_data->tag_desc(ops, metatag_data);	\\"
221*0Sstevel@tonic-gate  echo "	buffer->tag = tnf_tag(ops, metatag_index,		\\"
222*0Sstevel@tonic-gate  echo "		(tnf_reference_t) &buffer->tag);		\\"
223*0Sstevel@tonic-gate  j=1; while [ $j -le $i ]; do
224*0Sstevel@tonic-gate    echo "	buffer->data_$j = t$j(ops, the_ctype->n$j,		\\"
225*0Sstevel@tonic-gate    echo "			(tnf_reference_t) &(buffer->data_$j));	\\"
226*0Sstevel@tonic-gate    j=`expr $j + 1`
227*0Sstevel@tonic-gate  done
228*0Sstevel@tonic-gate  echo "	return (tnf_ref32(ops, (tnf_record_p) buffer, reference)); \\"
229*0Sstevel@tonic-gate  echo "}\n"
230*0Sstevel@tonic-gate  echo "#endif /* NPROBE */"
231*0Sstevel@tonic-gate  echo ""
232*0Sstevel@tonic-gatedone
233*0Sstevel@tonic-gate
234*0Sstevel@tonic-gateecho "/*"
235*0Sstevel@tonic-gateecho " * Probe Macros"
236*0Sstevel@tonic-gateecho " */"
237*0Sstevel@tonic-gateecho ""
238*0Sstevel@tonic-gate
239*0Sstevel@tonic-gate#
240*0Sstevel@tonic-gate# The following code generates the six probe macros ...
241*0Sstevel@tonic-gate#
242*0Sstevel@tonic-gatefor i in 0 1 2 3 4 5; do
243*0Sstevel@tonic-gate  echo "#ifdef NPROBE\n"
244*0Sstevel@tonic-gate  echo "/* CSTYLED */"
245*0Sstevel@tonic-gate  echo "#define	TNF_PROBE_$i(namearg, keysarg, detail\c"
246*0Sstevel@tonic-gate  j=1; while [ $j -le $i ]; do
247*0Sstevel@tonic-gate    echo ", type_$j, namearg_$j, valarg_$j\c"
248*0Sstevel@tonic-gate    j=`expr $j + 1`
249*0Sstevel@tonic-gate  done
250*0Sstevel@tonic-gate  echo ") \\"
251*0Sstevel@tonic-gate  echo "\t\t((void)0)\n"
252*0Sstevel@tonic-gate  echo "#else\n"
253*0Sstevel@tonic-gate  echo "/* CSTYLED */"
254*0Sstevel@tonic-gate  echo "#define	TNF_PROBE_$i(namearg, keysarg, detail\c"
255*0Sstevel@tonic-gate  j=1; while [ $j -le $i ]; do
256*0Sstevel@tonic-gate    echo ", type_$j, namearg_$j, valarg_$j\c";
257*0Sstevel@tonic-gate    j=`expr $j + 1`
258*0Sstevel@tonic-gate  done
259*0Sstevel@tonic-gate  echo ")	\\"
260*0Sstevel@tonic-gate  echo "{								\\"
261*0Sstevel@tonic-gate  echo "	struct tnf_v_buf_$i {					\\"
262*0Sstevel@tonic-gate  echo "		tnf_probe_event_t	probe_event;		\\"
263*0Sstevel@tonic-gate  echo "		tnf_time_delta_t	time_delta;		\\"
264*0Sstevel@tonic-gate  j=1; while [ $j -le $i ]; do
265*0Sstevel@tonic-gate    echo "		type_$j##_t		data_$j;		\\"
266*0Sstevel@tonic-gate    j=`expr $j + 1`
267*0Sstevel@tonic-gate  done
268*0Sstevel@tonic-gate  echo "	};							\\"
269*0Sstevel@tonic-gate  echo "	static tnf_tag_data_t ** tnf_v_##namearg##_info[] = {		\\"
270*0Sstevel@tonic-gate  echo "		&tnf_probe_event_tag_data,			\\"
271*0Sstevel@tonic-gate  echo "		&tnf_time_delta_tag_data,			\\"
272*0Sstevel@tonic-gate  j=1; while [ $j -le $i ]; do
273*0Sstevel@tonic-gate    echo "		&type_$j##_tag_data,				\\"
274*0Sstevel@tonic-gate    j=`expr $j + 1`
275*0Sstevel@tonic-gate  done
276*0Sstevel@tonic-gate  echo "		0 };						\\"
277*0Sstevel@tonic-gate  echo "	static struct tnf_probe_control tnf_v_##namearg##_probe = {	\\"
278*0Sstevel@tonic-gate  echo "		&__tnf_probe_version_1,				\\"
279*0Sstevel@tonic-gate  echo "		(tnf_probe_control_t *) TNF_NEXT_INIT,		\\"
280*0Sstevel@tonic-gate  echo "		(tnf_probe_test_func_t) 0,			\\"
281*0Sstevel@tonic-gate  echo "		(tnf_probe_alloc_func_t) 0,			\\"
282*0Sstevel@tonic-gate  echo "		(tnf_probe_func_t) 0,				\\"
283*0Sstevel@tonic-gate  echo "		(tnf_probe_func_t) 0,				\\"
284*0Sstevel@tonic-gate  echo "		(tnf_uint32_t) 0,				\\"
285*0Sstevel@tonic-gate  echo "			/* attribute string */			\\"
286*0Sstevel@tonic-gate  echo "			\"name \" TNF_STRINGVALUE(namearg) \";\" \\"
287*0Sstevel@tonic-gate#  echo "			\"slots \"\c"
288*0Sstevel@tonic-gate#  j=1; while [ $j -le $i ]; do
289*0Sstevel@tonic-gate#    echo " #namearg_$j \" \"\c"
290*0Sstevel@tonic-gate#    j=`expr $j + 1`
291*0Sstevel@tonic-gate  echo "			\"slots \"				\\"
292*0Sstevel@tonic-gate  j=1; while [ $j -le $i ]; do
293*0Sstevel@tonic-gate    echo "			\"\"#namearg_$j\" \"			\\"
294*0Sstevel@tonic-gate    j=`expr $j + 1`
295*0Sstevel@tonic-gate  done
296*0Sstevel@tonic-gate  echo "			\";\"					\\"
297*0Sstevel@tonic-gate  echo "			\"keys \" keysarg \";\"			\\"
298*0Sstevel@tonic-gate  echo "			\"file \" __FILE__ \";\"		\\"
299*0Sstevel@tonic-gate  echo "			\"line \" TNF_STRINGVALUE(__LINE__) \";\" \\"
300*0Sstevel@tonic-gate  echo "			detail,					\\"
301*0Sstevel@tonic-gate  echo "		tnf_v_##namearg##_info,					\\"
302*0Sstevel@tonic-gate  echo "		sizeof (struct tnf_v_buf_$i)			\\"
303*0Sstevel@tonic-gate  echo "	};							\\"
304*0Sstevel@tonic-gate  echo "	tnf_probe_control_t	*tnf_v_probe_p = &tnf_v_##namearg##_probe; \\"
305*0Sstevel@tonic-gate  echo "	tnf_probe_test_func_t	tnf_v_probe_test = tnf_v_probe_p->test_func; \\"
306*0Sstevel@tonic-gate  echo "	tnf_probe_setup_t	tnf_v_set_p;			\\"
307*0Sstevel@tonic-gate  echo "	struct tnf_v_buf_$i	*tnf_v_probe_buffer;		\\"
308*0Sstevel@tonic-gate  echo "								\\"
309*0Sstevel@tonic-gate  echo "	if (tnf_v_probe_test) {					\\"
310*0Sstevel@tonic-gate  echo "		tnf_v_probe_buffer = (struct tnf_v_buf_$i *)	\\"
311*0Sstevel@tonic-gate  echo "		    tnf_v_probe_test(0, tnf_v_probe_p, &tnf_v_set_p); \\"
312*0Sstevel@tonic-gate  echo "		if (tnf_v_probe_buffer) {			\\"
313*0Sstevel@tonic-gate  j=1; while [ $j -le $i ]; do
314*0Sstevel@tonic-gate    echo "		    tnf_v_probe_buffer->data_$j = type_$j(	\\"
315*0Sstevel@tonic-gate    echo "			tnf_v_set_p.tpd_p, valarg_$j,		\\"
316*0Sstevel@tonic-gate    echo "			(tnf_reference_t) &(tnf_v_probe_buffer->data_$j)); \\"
317*0Sstevel@tonic-gate    j=`expr $j + 1`
318*0Sstevel@tonic-gate  done
319*0Sstevel@tonic-gate  echo "		    (tnf_v_probe_p->probe_func)(&tnf_v_set_p);	\\"
320*0Sstevel@tonic-gate  echo "		}						\\"
321*0Sstevel@tonic-gate  echo "	}							\\"
322*0Sstevel@tonic-gate  echo "}\n"
323*0Sstevel@tonic-gate  echo "#endif /* NPROBE */"
324*0Sstevel@tonic-gate  echo ""
325*0Sstevel@tonic-gate  done
326*0Sstevel@tonic-gate
327*0Sstevel@tonic-gateecho "/*"
328*0Sstevel@tonic-gateecho " * Debug Probe Macros (contain an additional \"debug\" attribute)"
329*0Sstevel@tonic-gateecho " */"
330*0Sstevel@tonic-gateecho ""
331*0Sstevel@tonic-gate
332*0Sstevel@tonic-gate#
333*0Sstevel@tonic-gate# The following code generates the six debug probe macros ...
334*0Sstevel@tonic-gate#
335*0Sstevel@tonic-gatefor i in 0 1 2 3 4 5; do
336*0Sstevel@tonic-gate  echo "#if defined(TNF_DEBUG)\n"
337*0Sstevel@tonic-gate  echo "/* CSTYLED */"
338*0Sstevel@tonic-gate  echo "#define	TNF_PROBE_${i}_DEBUG(namearg, keysarg, detail\c"
339*0Sstevel@tonic-gate  j=1; while [ $j -le $i ]; do
340*0Sstevel@tonic-gate    echo ", type_$j, namearg_$j, valarg_$j\c";
341*0Sstevel@tonic-gate    j=`expr $j + 1`
342*0Sstevel@tonic-gate  done
343*0Sstevel@tonic-gate  echo ")\t\c"
344*0Sstevel@tonic-gate  echo "TNF_PROBE_$i(namearg, keysarg, \"debug;\" detail\c"
345*0Sstevel@tonic-gate  j=1; while [ $j -le $i ]; do
346*0Sstevel@tonic-gate    echo ", type_$j, namearg_$j, valarg_$j\c"
347*0Sstevel@tonic-gate    j=`expr $j + 1`
348*0Sstevel@tonic-gate  done
349*0Sstevel@tonic-gate  echo ")\n"
350*0Sstevel@tonic-gate  echo "#else\n"
351*0Sstevel@tonic-gate  echo "/* CSTYLED */"
352*0Sstevel@tonic-gate  echo "#define	TNF_PROBE_${i}_DEBUG(namearg, keysarg, detail\c"
353*0Sstevel@tonic-gate  j=1; while [ $j -le $i ]; do
354*0Sstevel@tonic-gate    echo ", type_$j, namearg_$j, valarg_$j\c"
355*0Sstevel@tonic-gate    j=`expr $j + 1`
356*0Sstevel@tonic-gate  done
357*0Sstevel@tonic-gate  echo ") \\"
358*0Sstevel@tonic-gate  echo "\t\t((void)0)\n"
359*0Sstevel@tonic-gate  echo "#endif /* defined(TNF_DEBUG) */"
360*0Sstevel@tonic-gate  echo ""
361*0Sstevel@tonic-gate  done
362*0Sstevel@tonic-gate
363*0Sstevel@tonic-gate  echo "#ifdef __cplusplus"
364*0Sstevel@tonic-gate  echo "}"
365*0Sstevel@tonic-gate  echo "#endif"
366*0Sstevel@tonic-gate  echo ""
367*0Sstevel@tonic-gate  echo "#endif /* _SYS_TNF_PROBE_H */"
368