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>
38 * These macros are used to convert the __LINE__ directive to a
39 * string in the probe macros below.
42 #define TNF_STRINGIFY(x) #x
43 #define TNF_STRINGVALUE(x) TNF_STRINGIFY(x)
46 * Alignment of tnf_ref32_t
49 struct _tnf_ref32_align
{
53 #define TNF_REF32_ALIGN TNF_OFFSETOF(struct _tnf_ref32_align, t)
59 struct tnf_probe_version
{
60 size_t version_size
; /* sizeof(struct tnf_probe_version) */
61 size_t probe_control_size
; /* sizeof(tnf_probe_control_t) */
64 extern struct tnf_probe_version __tnf_probe_version_1
;
65 #pragma weak __tnf_probe_version_1
71 typedef struct tnf_probe_control tnf_probe_control_t
;
72 typedef struct tnf_probe_setup tnf_probe_setup_t
;
74 /* returns pointer to buffer */
75 typedef void * (*tnf_probe_test_func_t
)(void *,
76 tnf_probe_control_t
*,
79 /* returns buffer pointer */
80 typedef void * (*tnf_probe_alloc_func_t
)(tnf_ops_t
*, /* tpd */
81 tnf_probe_control_t
*,
84 typedef void (*tnf_probe_func_t
)(tnf_probe_setup_t
*);
87 * Probe argument block
90 struct tnf_probe_setup
{
93 tnf_probe_control_t
*probe_p
;
100 struct tnf_probe_control
{
101 const struct tnf_probe_version
*version
;
102 tnf_probe_control_t
*next
;
103 tnf_probe_test_func_t test_func
;
104 tnf_probe_alloc_func_t alloc_func
;
105 tnf_probe_func_t probe_func
;
106 tnf_probe_func_t commit_func
;
109 tnf_tag_data_t
***slot_types
;
110 unsigned long tnf_event_size
;
115 #define TNF_NEXT_INIT 0
119 #define TNF_NEXT_INIT -1
129 #define TNF_DECLARE_RECORD(ctype, record) \
130 typedef tnf_reference_t record##_t
134 #define TNF_DECLARE_RECORD(ctype, record) \
135 typedef tnf_reference_t record##_t; \
136 extern tnf_tag_data_t *record##_tag_data; \
137 extern record##_t record(tnf_ops_t *, ctype *, tnf_record_p)
144 #define TNF_DEFINE_RECORD_1(ctype, ctype_record, t1, n1)
149 #define TNF_DEFINE_RECORD_1(ctype, ctype_record, t1, n1) \
153 } ctype_record##_prototype_t; \
154 static tnf_tag_data_t **ctype_record##_type_slots[] = { \
158 static char *ctype_record##_slot_names[] = { \
162 static tnf_tag_data_t ctype_record##_tag_data_rec = { \
163 TNF_TAG_VERSION, &tnf_struct_tag_1, \
164 0, #ctype_record, &tnf_user_struct_properties, \
165 sizeof (ctype_record##_prototype_t), \
167 sizeof (ctype_record##_t), TNF_STRUCT, 0, \
168 ctype_record##_type_slots, ctype_record##_slot_names \
170 tnf_tag_data_t *ctype_record##_tag_data = \
171 &ctype_record##_tag_data_rec; \
173 ctype_record(tnf_ops_t *ops, ctype * the_ctype, \
174 tnf_record_p reference) \
176 tnf_tag_data_t *metatag_data; \
177 tnf_record_p metatag_index; \
178 ctype_record##_prototype_t *buffer; \
180 if (the_ctype == NULL) \
182 buffer = (ctype_record##_prototype_t *) tnf_allocate(ops, \
183 sizeof (ctype_record##_prototype_t)); \
184 if (buffer == NULL) \
187 metatag_data = ctype_record##_tag_data; \
188 metatag_index = metatag_data->tag_index ? \
189 metatag_data->tag_index: \
190 metatag_data->tag_desc(ops, metatag_data); \
191 buffer->tag = tnf_tag(ops, metatag_index, \
192 (tnf_record_p) &buffer->tag); \
193 buffer->data_1 = t1(ops, the_ctype->n1, \
194 (tnf_record_p) &(buffer->data_1)); \
195 return (tnf_ref32(ops, (tnf_record_p) buffer, reference)); \
203 #define TNF_DEFINE_RECORD_2(ctype, ctype_record, t1, n1, t2, n2)
208 #define TNF_DEFINE_RECORD_2(ctype, ctype_record, t1, n1, t2, n2) \
213 } ctype_record##_prototype_t; \
214 static tnf_tag_data_t **ctype_record##_type_slots[] = { \
219 static char *ctype_record##_slot_names[] = { \
224 static tnf_tag_data_t ctype_record##_tag_data_rec = { \
225 TNF_TAG_VERSION, &tnf_struct_tag_1, \
226 0, #ctype_record, &tnf_user_struct_properties, \
227 sizeof (ctype_record##_prototype_t), \
229 sizeof (ctype_record##_t), TNF_STRUCT, 0, \
230 ctype_record##_type_slots, ctype_record##_slot_names \
232 tnf_tag_data_t *ctype_record##_tag_data = \
233 &ctype_record##_tag_data_rec; \
235 ctype_record(tnf_ops_t *ops, ctype * the_ctype, \
236 tnf_record_p reference) \
238 tnf_tag_data_t *metatag_data; \
239 tnf_record_p metatag_index; \
240 ctype_record##_prototype_t *buffer; \
242 if (the_ctype == NULL) \
244 buffer = (ctype_record##_prototype_t *) tnf_allocate(ops, \
245 sizeof (ctype_record##_prototype_t)); \
246 if (buffer == NULL) \
249 metatag_data = ctype_record##_tag_data; \
250 metatag_index = metatag_data->tag_index ? \
251 metatag_data->tag_index: \
252 metatag_data->tag_desc(ops, metatag_data); \
253 buffer->tag = tnf_tag(ops, metatag_index, \
254 (tnf_record_p) &buffer->tag); \
255 buffer->data_1 = t1(ops, the_ctype->n1, \
256 (tnf_record_p) &(buffer->data_1)); \
257 buffer->data_2 = t2(ops, the_ctype->n2, \
258 (tnf_record_p) &(buffer->data_2)); \
259 return (tnf_ref32(ops, (tnf_record_p) buffer, reference)); \
267 #define TNF_DEFINE_RECORD_3(ctype, ctype_record, t1, n1, t2, n2, t3, n3)
272 #define TNF_DEFINE_RECORD_3(ctype, ctype_record, t1, n1, t2, n2, t3, n3) \
278 } ctype_record##_prototype_t; \
279 static tnf_tag_data_t **ctype_record##_type_slots[] = { \
285 static char *ctype_record##_slot_names[] = { \
291 static tnf_tag_data_t ctype_record##_tag_data_rec = { \
292 TNF_TAG_VERSION, &tnf_struct_tag_1, \
293 0, #ctype_record, &tnf_user_struct_properties, \
294 sizeof (ctype_record##_prototype_t), \
296 sizeof (ctype_record##_t), TNF_STRUCT, 0, \
297 ctype_record##_type_slots, ctype_record##_slot_names \
299 tnf_tag_data_t *ctype_record##_tag_data = \
300 &ctype_record##_tag_data_rec; \
302 ctype_record(tnf_ops_t *ops, ctype * the_ctype, \
303 tnf_record_p reference) \
305 tnf_tag_data_t *metatag_data; \
306 tnf_record_p metatag_index; \
307 ctype_record##_prototype_t *buffer; \
309 if (the_ctype == NULL) \
311 buffer = (ctype_record##_prototype_t *) tnf_allocate(ops, \
312 sizeof (ctype_record##_prototype_t)); \
313 if (buffer == NULL) \
316 metatag_data = ctype_record##_tag_data; \
317 metatag_index = metatag_data->tag_index ? \
318 metatag_data->tag_index: \
319 metatag_data->tag_desc(ops, metatag_data); \
320 buffer->tag = tnf_tag(ops, metatag_index, \
321 (tnf_record_p) &buffer->tag); \
322 buffer->data_1 = t1(ops, the_ctype->n1, \
323 (tnf_record_p) &(buffer->data_1)); \
324 buffer->data_2 = t2(ops, the_ctype->n2, \
325 (tnf_record_p) &(buffer->data_2)); \
326 buffer->data_3 = t3(ops, the_ctype->n3, \
327 (tnf_record_p) &(buffer->data_3)); \
328 return (tnf_ref32(ops, (tnf_record_p) buffer, reference)); \
336 #define TNF_DEFINE_RECORD_4(ctype, ctype_record, t1, n1, t2, n2, t3, n3, t4, n4)
341 #define TNF_DEFINE_RECORD_4(ctype, ctype_record, t1, n1, t2, n2, t3, n3, t4, n4) \
348 } ctype_record##_prototype_t; \
349 static tnf_tag_data_t **ctype_record##_type_slots[] = { \
356 static char *ctype_record##_slot_names[] = { \
363 static tnf_tag_data_t ctype_record##_tag_data_rec = { \
364 TNF_TAG_VERSION, &tnf_struct_tag_1, \
365 0, #ctype_record, &tnf_user_struct_properties, \
366 sizeof (ctype_record##_prototype_t), \
368 sizeof (ctype_record##_t), TNF_STRUCT, 0, \
369 ctype_record##_type_slots, ctype_record##_slot_names \
371 tnf_tag_data_t *ctype_record##_tag_data = \
372 &ctype_record##_tag_data_rec; \
374 ctype_record(tnf_ops_t *ops, ctype * the_ctype, \
375 tnf_record_p reference) \
377 tnf_tag_data_t *metatag_data; \
378 tnf_record_p metatag_index; \
379 ctype_record##_prototype_t *buffer; \
381 if (the_ctype == NULL) \
383 buffer = (ctype_record##_prototype_t *) tnf_allocate(ops, \
384 sizeof (ctype_record##_prototype_t)); \
385 if (buffer == NULL) \
388 metatag_data = ctype_record##_tag_data; \
389 metatag_index = metatag_data->tag_index ? \
390 metatag_data->tag_index: \
391 metatag_data->tag_desc(ops, metatag_data); \
392 buffer->tag = tnf_tag(ops, metatag_index, \
393 (tnf_record_p) &buffer->tag); \
394 buffer->data_1 = t1(ops, the_ctype->n1, \
395 (tnf_record_p) &(buffer->data_1)); \
396 buffer->data_2 = t2(ops, the_ctype->n2, \
397 (tnf_record_p) &(buffer->data_2)); \
398 buffer->data_3 = t3(ops, the_ctype->n3, \
399 (tnf_record_p) &(buffer->data_3)); \
400 buffer->data_4 = t4(ops, the_ctype->n4, \
401 (tnf_record_p) &(buffer->data_4)); \
402 return (tnf_ref32(ops, (tnf_record_p) buffer, reference)); \
410 #define TNF_DEFINE_RECORD_5(ctype, ctype_record, t1, n1, t2, n2, t3, n3, t4, n4, t5, n5)
415 #define TNF_DEFINE_RECORD_5(ctype, ctype_record, t1, n1, t2, n2, t3, n3, t4, n4, t5, n5) \
423 } ctype_record##_prototype_t; \
424 static tnf_tag_data_t **ctype_record##_type_slots[] = { \
432 static char *ctype_record##_slot_names[] = { \
440 static tnf_tag_data_t ctype_record##_tag_data_rec = { \
441 TNF_TAG_VERSION, &tnf_struct_tag_1, \
442 0, #ctype_record, &tnf_user_struct_properties, \
443 sizeof (ctype_record##_prototype_t), \
445 sizeof (ctype_record##_t), TNF_STRUCT, 0, \
446 ctype_record##_type_slots, ctype_record##_slot_names \
448 tnf_tag_data_t *ctype_record##_tag_data = \
449 &ctype_record##_tag_data_rec; \
451 ctype_record(tnf_ops_t *ops, ctype * the_ctype, \
452 tnf_record_p reference) \
454 tnf_tag_data_t *metatag_data; \
455 tnf_record_p metatag_index; \
456 ctype_record##_prototype_t *buffer; \
458 if (the_ctype == NULL) \
460 buffer = (ctype_record##_prototype_t *) tnf_allocate(ops, \
461 sizeof (ctype_record##_prototype_t)); \
462 if (buffer == NULL) \
465 metatag_data = ctype_record##_tag_data; \
466 metatag_index = metatag_data->tag_index ? \
467 metatag_data->tag_index: \
468 metatag_data->tag_desc(ops, metatag_data); \
469 buffer->tag = tnf_tag(ops, metatag_index, \
470 (tnf_record_p) &buffer->tag); \
471 buffer->data_1 = t1(ops, the_ctype->n1, \
472 (tnf_record_p) &(buffer->data_1)); \
473 buffer->data_2 = t2(ops, the_ctype->n2, \
474 (tnf_record_p) &(buffer->data_2)); \
475 buffer->data_3 = t3(ops, the_ctype->n3, \
476 (tnf_record_p) &(buffer->data_3)); \
477 buffer->data_4 = t4(ops, the_ctype->n4, \
478 (tnf_record_p) &(buffer->data_4)); \
479 buffer->data_5 = t5(ops, the_ctype->n5, \
480 (tnf_record_p) &(buffer->data_5)); \
481 return (tnf_ref32(ops, (tnf_record_p) buffer, reference)); \
493 #define TNF_PROBE_0(namearg, keysarg, detail) \
499 #define TNF_PROBE_0(namearg, keysarg, detail) \
501 struct tnf_v_buf_0 { \
502 tnf_probe_event_t probe_event; \
503 tnf_time_delta_t time_delta; \
505 static tnf_tag_data_t ** tnf_v_##namearg##_info[] = { \
506 &tnf_probe_event_tag_data, \
507 &tnf_time_delta_tag_data, \
509 static struct tnf_probe_control tnf_v_##namearg##_probe = { \
510 &__tnf_probe_version_1, \
511 (tnf_probe_control_t *) TNF_NEXT_INIT, \
512 (tnf_probe_test_func_t) 0, \
513 (tnf_probe_alloc_func_t) 0, \
514 (tnf_probe_func_t) 0, \
515 (tnf_probe_func_t) 0, \
517 /* attribute string */ \
518 "name " TNF_STRINGVALUE(namearg) ";" \
521 "keys " keysarg ";" \
522 "file " __FILE__ ";" \
523 "line " TNF_STRINGVALUE(__LINE__) ";" \
525 tnf_v_##namearg##_info, \
526 sizeof (struct tnf_v_buf_0) \
528 tnf_probe_control_t *tnf_v_probe_p = &tnf_v_##namearg##_probe; \
529 tnf_probe_test_func_t tnf_v_probe_test = tnf_v_probe_p->test_func; \
530 tnf_probe_setup_t tnf_v_set_p; \
531 struct tnf_v_buf_0 *tnf_v_probe_buffer; \
533 if (tnf_v_probe_test) { \
534 tnf_v_probe_buffer = (struct tnf_v_buf_0 *) \
535 tnf_v_probe_test(0, tnf_v_probe_p, &tnf_v_set_p); \
536 if (tnf_v_probe_buffer) { \
537 (tnf_v_probe_p->probe_func)(&tnf_v_set_p); \
547 #define TNF_PROBE_1(namearg, keysarg, detail, type_1, namearg_1, valarg_1) \
553 #define TNF_PROBE_1(namearg, keysarg, detail, type_1, namearg_1, valarg_1) \
555 struct tnf_v_buf_1 { \
556 tnf_probe_event_t probe_event; \
557 tnf_time_delta_t time_delta; \
560 static tnf_tag_data_t ** tnf_v_##namearg##_info[] = { \
561 &tnf_probe_event_tag_data, \
562 &tnf_time_delta_tag_data, \
563 &type_1##_tag_data, \
565 static struct tnf_probe_control tnf_v_##namearg##_probe = { \
566 &__tnf_probe_version_1, \
567 (tnf_probe_control_t *) TNF_NEXT_INIT, \
568 (tnf_probe_test_func_t) 0, \
569 (tnf_probe_alloc_func_t) 0, \
570 (tnf_probe_func_t) 0, \
571 (tnf_probe_func_t) 0, \
573 /* attribute string */ \
574 "name " TNF_STRINGVALUE(namearg) ";" \
578 "keys " keysarg ";" \
579 "file " __FILE__ ";" \
580 "line " TNF_STRINGVALUE(__LINE__) ";" \
582 tnf_v_##namearg##_info, \
583 sizeof (struct tnf_v_buf_1) \
585 tnf_probe_control_t *tnf_v_probe_p = &tnf_v_##namearg##_probe; \
586 tnf_probe_test_func_t tnf_v_probe_test = tnf_v_probe_p->test_func; \
587 tnf_probe_setup_t tnf_v_set_p; \
588 struct tnf_v_buf_1 *tnf_v_probe_buffer; \
590 if (tnf_v_probe_test) { \
591 tnf_v_probe_buffer = (struct tnf_v_buf_1 *) \
592 tnf_v_probe_test(0, tnf_v_probe_p, &tnf_v_set_p); \
593 if (tnf_v_probe_buffer) { \
594 tnf_v_probe_buffer->data_1 = type_1( \
595 tnf_v_set_p.tpd_p, valarg_1, \
596 (tnf_record_p) &(tnf_v_probe_buffer->data_1)); \
597 (tnf_v_probe_p->probe_func)(&tnf_v_set_p); \
607 #define TNF_PROBE_2(namearg, keysarg, detail, type_1, namearg_1, valarg_1, type_2, namearg_2, valarg_2) \
613 #define TNF_PROBE_2(namearg, keysarg, detail, type_1, namearg_1, valarg_1, type_2, namearg_2, valarg_2) \
615 struct tnf_v_buf_2 { \
616 tnf_probe_event_t probe_event; \
617 tnf_time_delta_t time_delta; \
621 static tnf_tag_data_t ** tnf_v_##namearg##_info[] = { \
622 &tnf_probe_event_tag_data, \
623 &tnf_time_delta_tag_data, \
624 &type_1##_tag_data, \
625 &type_2##_tag_data, \
627 static struct tnf_probe_control tnf_v_##namearg##_probe = { \
628 &__tnf_probe_version_1, \
629 (tnf_probe_control_t *) TNF_NEXT_INIT, \
630 (tnf_probe_test_func_t) 0, \
631 (tnf_probe_alloc_func_t) 0, \
632 (tnf_probe_func_t) 0, \
633 (tnf_probe_func_t) 0, \
635 /* attribute string */ \
636 "name " TNF_STRINGVALUE(namearg) ";" \
641 "keys " keysarg ";" \
642 "file " __FILE__ ";" \
643 "line " TNF_STRINGVALUE(__LINE__) ";" \
645 tnf_v_##namearg##_info, \
646 sizeof (struct tnf_v_buf_2) \
648 tnf_probe_control_t *tnf_v_probe_p = &tnf_v_##namearg##_probe; \
649 tnf_probe_test_func_t tnf_v_probe_test = tnf_v_probe_p->test_func; \
650 tnf_probe_setup_t tnf_v_set_p; \
651 struct tnf_v_buf_2 *tnf_v_probe_buffer; \
653 if (tnf_v_probe_test) { \
654 tnf_v_probe_buffer = (struct tnf_v_buf_2 *) \
655 tnf_v_probe_test(0, tnf_v_probe_p, &tnf_v_set_p); \
656 if (tnf_v_probe_buffer) { \
657 tnf_v_probe_buffer->data_1 = type_1( \
658 tnf_v_set_p.tpd_p, valarg_1, \
659 (tnf_record_p) &(tnf_v_probe_buffer->data_1)); \
660 tnf_v_probe_buffer->data_2 = type_2( \
661 tnf_v_set_p.tpd_p, valarg_2, \
662 (tnf_record_p) &(tnf_v_probe_buffer->data_2)); \
663 (tnf_v_probe_p->probe_func)(&tnf_v_set_p); \
673 #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) \
679 #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) \
681 struct tnf_v_buf_3 { \
682 tnf_probe_event_t probe_event; \
683 tnf_time_delta_t time_delta; \
688 static tnf_tag_data_t ** tnf_v_##namearg##_info[] = { \
689 &tnf_probe_event_tag_data, \
690 &tnf_time_delta_tag_data, \
691 &type_1##_tag_data, \
692 &type_2##_tag_data, \
693 &type_3##_tag_data, \
695 static struct tnf_probe_control tnf_v_##namearg##_probe = { \
696 &__tnf_probe_version_1, \
697 (tnf_probe_control_t *) TNF_NEXT_INIT, \
698 (tnf_probe_test_func_t) 0, \
699 (tnf_probe_alloc_func_t) 0, \
700 (tnf_probe_func_t) 0, \
701 (tnf_probe_func_t) 0, \
703 /* attribute string */ \
704 "name " TNF_STRINGVALUE(namearg) ";" \
710 "keys " keysarg ";" \
711 "file " __FILE__ ";" \
712 "line " TNF_STRINGVALUE(__LINE__) ";" \
714 tnf_v_##namearg##_info, \
715 sizeof (struct tnf_v_buf_3) \
717 tnf_probe_control_t *tnf_v_probe_p = &tnf_v_##namearg##_probe; \
718 tnf_probe_test_func_t tnf_v_probe_test = tnf_v_probe_p->test_func; \
719 tnf_probe_setup_t tnf_v_set_p; \
720 struct tnf_v_buf_3 *tnf_v_probe_buffer; \
722 if (tnf_v_probe_test) { \
723 tnf_v_probe_buffer = (struct tnf_v_buf_3 *) \
724 tnf_v_probe_test(0, tnf_v_probe_p, &tnf_v_set_p); \
725 if (tnf_v_probe_buffer) { \
726 tnf_v_probe_buffer->data_1 = type_1( \
727 tnf_v_set_p.tpd_p, valarg_1, \
728 (tnf_record_p) &(tnf_v_probe_buffer->data_1)); \
729 tnf_v_probe_buffer->data_2 = type_2( \
730 tnf_v_set_p.tpd_p, valarg_2, \
731 (tnf_record_p) &(tnf_v_probe_buffer->data_2)); \
732 tnf_v_probe_buffer->data_3 = type_3( \
733 tnf_v_set_p.tpd_p, valarg_3, \
734 (tnf_record_p) &(tnf_v_probe_buffer->data_3)); \
735 (tnf_v_probe_p->probe_func)(&tnf_v_set_p); \
745 #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) \
751 #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) \
753 struct tnf_v_buf_4 { \
754 tnf_probe_event_t probe_event; \
755 tnf_time_delta_t time_delta; \
761 static tnf_tag_data_t ** tnf_v_##namearg##_info[] = { \
762 &tnf_probe_event_tag_data, \
763 &tnf_time_delta_tag_data, \
764 &type_1##_tag_data, \
765 &type_2##_tag_data, \
766 &type_3##_tag_data, \
767 &type_4##_tag_data, \
769 static struct tnf_probe_control tnf_v_##namearg##_probe = { \
770 &__tnf_probe_version_1, \
771 (tnf_probe_control_t *) TNF_NEXT_INIT, \
772 (tnf_probe_test_func_t) 0, \
773 (tnf_probe_alloc_func_t) 0, \
774 (tnf_probe_func_t) 0, \
775 (tnf_probe_func_t) 0, \
777 /* attribute string */ \
778 "name " TNF_STRINGVALUE(namearg) ";" \
785 "keys " keysarg ";" \
786 "file " __FILE__ ";" \
787 "line " TNF_STRINGVALUE(__LINE__) ";" \
789 tnf_v_##namearg##_info, \
790 sizeof (struct tnf_v_buf_4) \
792 tnf_probe_control_t *tnf_v_probe_p = &tnf_v_##namearg##_probe; \
793 tnf_probe_test_func_t tnf_v_probe_test = tnf_v_probe_p->test_func; \
794 tnf_probe_setup_t tnf_v_set_p; \
795 struct tnf_v_buf_4 *tnf_v_probe_buffer; \
797 if (tnf_v_probe_test) { \
798 tnf_v_probe_buffer = (struct tnf_v_buf_4 *) \
799 tnf_v_probe_test(0, tnf_v_probe_p, &tnf_v_set_p); \
800 if (tnf_v_probe_buffer) { \
801 tnf_v_probe_buffer->data_1 = type_1( \
802 tnf_v_set_p.tpd_p, valarg_1, \
803 (tnf_record_p) &(tnf_v_probe_buffer->data_1)); \
804 tnf_v_probe_buffer->data_2 = type_2( \
805 tnf_v_set_p.tpd_p, valarg_2, \
806 (tnf_record_p) &(tnf_v_probe_buffer->data_2)); \
807 tnf_v_probe_buffer->data_3 = type_3( \
808 tnf_v_set_p.tpd_p, valarg_3, \
809 (tnf_record_p) &(tnf_v_probe_buffer->data_3)); \
810 tnf_v_probe_buffer->data_4 = type_4( \
811 tnf_v_set_p.tpd_p, valarg_4, \
812 (tnf_record_p) &(tnf_v_probe_buffer->data_4)); \
813 (tnf_v_probe_p->probe_func)(&tnf_v_set_p); \
823 #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) \
829 #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) \
831 struct tnf_v_buf_5 { \
832 tnf_probe_event_t probe_event; \
833 tnf_time_delta_t time_delta; \
840 static tnf_tag_data_t ** tnf_v_##namearg##_info[] = { \
841 &tnf_probe_event_tag_data, \
842 &tnf_time_delta_tag_data, \
843 &type_1##_tag_data, \
844 &type_2##_tag_data, \
845 &type_3##_tag_data, \
846 &type_4##_tag_data, \
847 &type_5##_tag_data, \
849 static struct tnf_probe_control tnf_v_##namearg##_probe = { \
850 &__tnf_probe_version_1, \
851 (tnf_probe_control_t *) TNF_NEXT_INIT, \
852 (tnf_probe_test_func_t) 0, \
853 (tnf_probe_alloc_func_t) 0, \
854 (tnf_probe_func_t) 0, \
855 (tnf_probe_func_t) 0, \
857 /* attribute string */ \
858 "name " TNF_STRINGVALUE(namearg) ";" \
866 "keys " keysarg ";" \
867 "file " __FILE__ ";" \
868 "line " TNF_STRINGVALUE(__LINE__) ";" \
870 tnf_v_##namearg##_info, \
871 sizeof (struct tnf_v_buf_5) \
873 tnf_probe_control_t *tnf_v_probe_p = &tnf_v_##namearg##_probe; \
874 tnf_probe_test_func_t tnf_v_probe_test = tnf_v_probe_p->test_func; \
875 tnf_probe_setup_t tnf_v_set_p; \
876 struct tnf_v_buf_5 *tnf_v_probe_buffer; \
878 if (tnf_v_probe_test) { \
879 tnf_v_probe_buffer = (struct tnf_v_buf_5 *) \
880 tnf_v_probe_test(0, tnf_v_probe_p, &tnf_v_set_p); \
881 if (tnf_v_probe_buffer) { \
882 tnf_v_probe_buffer->data_1 = type_1( \
883 tnf_v_set_p.tpd_p, valarg_1, \
884 (tnf_record_p) &(tnf_v_probe_buffer->data_1)); \
885 tnf_v_probe_buffer->data_2 = type_2( \
886 tnf_v_set_p.tpd_p, valarg_2, \
887 (tnf_record_p) &(tnf_v_probe_buffer->data_2)); \
888 tnf_v_probe_buffer->data_3 = type_3( \
889 tnf_v_set_p.tpd_p, valarg_3, \
890 (tnf_record_p) &(tnf_v_probe_buffer->data_3)); \
891 tnf_v_probe_buffer->data_4 = type_4( \
892 tnf_v_set_p.tpd_p, valarg_4, \
893 (tnf_record_p) &(tnf_v_probe_buffer->data_4)); \
894 tnf_v_probe_buffer->data_5 = type_5( \
895 tnf_v_set_p.tpd_p, valarg_5, \
896 (tnf_record_p) &(tnf_v_probe_buffer->data_5)); \
897 (tnf_v_probe_p->probe_func)(&tnf_v_set_p); \
905 * Debug Probe Macros (contain an additional "debug" attribute)
908 #if defined(TNF_DEBUG)
911 #define TNF_PROBE_0_DEBUG(namearg, keysarg, detail) TNF_PROBE_0(namearg, keysarg, "debug;" detail)
916 #define TNF_PROBE_0_DEBUG(namearg, keysarg, detail) \
919 #endif /* defined(TNF_DEBUG) */
921 #if defined(TNF_DEBUG)
924 #define TNF_PROBE_1_DEBUG(namearg, keysarg, detail, type_1, namearg_1, valarg_1) TNF_PROBE_1(namearg, keysarg, "debug;" detail, type_1, namearg_1, valarg_1)
929 #define TNF_PROBE_1_DEBUG(namearg, keysarg, detail, type_1, namearg_1, valarg_1) \
932 #endif /* defined(TNF_DEBUG) */
934 #if defined(TNF_DEBUG)
937 #define TNF_PROBE_2_DEBUG(namearg, keysarg, detail, type_1, namearg_1, valarg_1, type_2, namearg_2, valarg_2) TNF_PROBE_2(namearg, keysarg, "debug;" detail, type_1, namearg_1, valarg_1, type_2, namearg_2, valarg_2)
942 #define TNF_PROBE_2_DEBUG(namearg, keysarg, detail, type_1, namearg_1, valarg_1, type_2, namearg_2, valarg_2) \
945 #endif /* defined(TNF_DEBUG) */
947 #if defined(TNF_DEBUG)
950 #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) TNF_PROBE_3(namearg, keysarg, "debug;" detail, type_1, namearg_1, valarg_1, type_2, namearg_2, valarg_2, type_3, namearg_3, valarg_3)
955 #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) \
958 #endif /* defined(TNF_DEBUG) */
960 #if defined(TNF_DEBUG)
963 #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) TNF_PROBE_4(namearg, keysarg, "debug;" 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)
968 #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) \
971 #endif /* defined(TNF_DEBUG) */
973 #if defined(TNF_DEBUG)
976 #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) TNF_PROBE_5(namearg, keysarg, "debug;" 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)
981 #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) \
984 #endif /* defined(TNF_DEBUG) */
990 #endif /* _SYS_TNF_PROBE_H */