/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 1994, by Sun Microsytems, Inc.
*/
#ifndef _SYS_TNF_PROBE_H
#define _SYS_TNF_PROBE_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/tnf_writer.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* These macros are used to convert the __LINE__ directive to a
* string in the probe macros below.
*/
#define TNF_STRINGIFY(x) #x
/*
* Alignment of tnf_ref32_t
*/
struct _tnf_ref32_align {
char c;
tnf_ref32_t t;
};
/*
* Probe versioning
*/
struct tnf_probe_version {
};
extern struct tnf_probe_version __tnf_probe_version_1;
/*
* Typedefs
*/
/* returns pointer to buffer */
typedef void * (*tnf_probe_test_func_t)(void *,
/* returns buffer pointer */
/*
* Probe argument block
*/
struct tnf_probe_setup {
void *buffer_p;
};
/*
* Probe control block
*/
struct tnf_probe_control {
const char *attrs;
unsigned long tnf_event_size;
};
#ifdef _KERNEL
#define TNF_NEXT_INIT 0
#else
#endif /* _KERNEL */
/*
* TNF Type extension
*/
#ifdef NPROBE
#else
#endif /* NPROBE */
#ifdef NPROBE
/* CSTYLED */
#else
/* CSTYLED */
typedef struct { \
} ctype_record##_prototype_t; \
&tnf_tag_tag_data, \
0 }; \
static char *ctype_record##_slot_names[] = { \
"tnf_tag", \
""#n1, \
0 }; \
0, #ctype_record, &tnf_user_struct_properties, \
sizeof (ctype_record##_prototype_t), \
}; \
ctype_record##_t \
{ \
\
return (0); \
sizeof (ctype_record##_prototype_t)); \
return (0); \
\
}
#endif /* NPROBE */
#ifdef NPROBE
/* CSTYLED */
#else
/* CSTYLED */
typedef struct { \
} ctype_record##_prototype_t; \
&tnf_tag_tag_data, \
0 }; \
static char *ctype_record##_slot_names[] = { \
"tnf_tag", \
""#n1, \
""#n2, \
0 }; \
0, #ctype_record, &tnf_user_struct_properties, \
sizeof (ctype_record##_prototype_t), \
}; \
ctype_record##_t \
{ \
\
return (0); \
sizeof (ctype_record##_prototype_t)); \
return (0); \
\
}
#endif /* NPROBE */
#ifdef NPROBE
/* CSTYLED */
#else
/* CSTYLED */
typedef struct { \
} ctype_record##_prototype_t; \
&tnf_tag_tag_data, \
0 }; \
static char *ctype_record##_slot_names[] = { \
"tnf_tag", \
""#n1, \
""#n2, \
""#n3, \
0 }; \
0, #ctype_record, &tnf_user_struct_properties, \
sizeof (ctype_record##_prototype_t), \
}; \
ctype_record##_t \
{ \
\
return (0); \
sizeof (ctype_record##_prototype_t)); \
return (0); \
\
}
#endif /* NPROBE */
#ifdef NPROBE
/* CSTYLED */
#else
/* CSTYLED */
typedef struct { \
} ctype_record##_prototype_t; \
&tnf_tag_tag_data, \
0 }; \
static char *ctype_record##_slot_names[] = { \
"tnf_tag", \
""#n1, \
""#n2, \
""#n3, \
""#n4, \
0 }; \
0, #ctype_record, &tnf_user_struct_properties, \
sizeof (ctype_record##_prototype_t), \
}; \
ctype_record##_t \
{ \
\
return (0); \
sizeof (ctype_record##_prototype_t)); \
return (0); \
\
}
#endif /* NPROBE */
#ifdef NPROBE
/* CSTYLED */
#else
/* CSTYLED */
typedef struct { \
} ctype_record##_prototype_t; \
&tnf_tag_tag_data, \
0 }; \
static char *ctype_record##_slot_names[] = { \
"tnf_tag", \
""#n1, \
""#n2, \
""#n3, \
""#n4, \
""#n5, \
0 }; \
0, #ctype_record, &tnf_user_struct_properties, \
sizeof (ctype_record##_prototype_t), \
}; \
ctype_record##_t \
{ \
\
return (0); \
sizeof (ctype_record##_prototype_t)); \
return (0); \
\
}
#endif /* NPROBE */
/*
* Probe Macros
*/
#ifdef NPROBE
/* CSTYLED */
((void)0)
#else
/* CSTYLED */
{ \
struct tnf_v_buf_0 { \
}; \
0 }; \
(tnf_probe_control_t *) TNF_NEXT_INIT, \
(tnf_probe_test_func_t) 0, \
(tnf_probe_alloc_func_t) 0, \
(tnf_probe_func_t) 0, \
(tnf_probe_func_t) 0, \
(tnf_uint32_t) 0, \
/* attribute string */ \
"slots " \
";" \
detail, \
sizeof (struct tnf_v_buf_0) \
}; \
struct tnf_v_buf_0 *tnf_v_probe_buffer; \
\
if (tnf_v_probe_test) { \
tnf_v_probe_buffer = (struct tnf_v_buf_0 *) \
if (tnf_v_probe_buffer) { \
} \
} \
}
#endif /* NPROBE */
#ifdef NPROBE
/* CSTYLED */
((void)0)
#else
/* CSTYLED */
{ \
struct tnf_v_buf_1 { \
}; \
0 }; \
(tnf_probe_control_t *) TNF_NEXT_INIT, \
(tnf_probe_test_func_t) 0, \
(tnf_probe_alloc_func_t) 0, \
(tnf_probe_func_t) 0, \
(tnf_probe_func_t) 0, \
(tnf_uint32_t) 0, \
/* attribute string */ \
"slots " \
";" \
detail, \
sizeof (struct tnf_v_buf_1) \
}; \
struct tnf_v_buf_1 *tnf_v_probe_buffer; \
\
if (tnf_v_probe_test) { \
tnf_v_probe_buffer = (struct tnf_v_buf_1 *) \
if (tnf_v_probe_buffer) { \
} \
} \
}
#endif /* NPROBE */
#ifdef NPROBE
/* CSTYLED */
#define TNF_PROBE_2(namearg, keysarg, detail, type_1, namearg_1, valarg_1, type_2, namearg_2, valarg_2) \
((void)0)
#else
/* CSTYLED */
#define TNF_PROBE_2(namearg, keysarg, detail, type_1, namearg_1, valarg_1, type_2, namearg_2, valarg_2) \
{ \
struct tnf_v_buf_2 { \
}; \
0 }; \
(tnf_probe_control_t *) TNF_NEXT_INIT, \
(tnf_probe_test_func_t) 0, \
(tnf_probe_alloc_func_t) 0, \
(tnf_probe_func_t) 0, \
(tnf_probe_func_t) 0, \
(tnf_uint32_t) 0, \
/* attribute string */ \
"slots " \
";" \
detail, \
sizeof (struct tnf_v_buf_2) \
}; \
struct tnf_v_buf_2 *tnf_v_probe_buffer; \
\
if (tnf_v_probe_test) { \
tnf_v_probe_buffer = (struct tnf_v_buf_2 *) \
if (tnf_v_probe_buffer) { \
} \
} \
}
#endif /* NPROBE */
#ifdef NPROBE
/* CSTYLED */
#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) \
((void)0)
#else
/* CSTYLED */
#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) \
{ \
struct tnf_v_buf_3 { \
}; \
0 }; \
(tnf_probe_control_t *) TNF_NEXT_INIT, \
(tnf_probe_test_func_t) 0, \
(tnf_probe_alloc_func_t) 0, \
(tnf_probe_func_t) 0, \
(tnf_probe_func_t) 0, \
(tnf_uint32_t) 0, \
/* attribute string */ \
"slots " \
";" \
detail, \
sizeof (struct tnf_v_buf_3) \
}; \
struct tnf_v_buf_3 *tnf_v_probe_buffer; \
\
if (tnf_v_probe_test) { \
tnf_v_probe_buffer = (struct tnf_v_buf_3 *) \
if (tnf_v_probe_buffer) { \
} \
} \
}
#endif /* NPROBE */
#ifdef NPROBE
/* CSTYLED */
#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) \
((void)0)
#else
/* CSTYLED */
#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) \
{ \
struct tnf_v_buf_4 { \
}; \
0 }; \
(tnf_probe_control_t *) TNF_NEXT_INIT, \
(tnf_probe_test_func_t) 0, \
(tnf_probe_alloc_func_t) 0, \
(tnf_probe_func_t) 0, \
(tnf_probe_func_t) 0, \
(tnf_uint32_t) 0, \
/* attribute string */ \
"slots " \
";" \
detail, \
sizeof (struct tnf_v_buf_4) \
}; \
struct tnf_v_buf_4 *tnf_v_probe_buffer; \
\
if (tnf_v_probe_test) { \
tnf_v_probe_buffer = (struct tnf_v_buf_4 *) \
if (tnf_v_probe_buffer) { \
} \
} \
}
#endif /* NPROBE */
#ifdef NPROBE
/* CSTYLED */
#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) \
((void)0)
#else
/* CSTYLED */
#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) \
{ \
struct tnf_v_buf_5 { \
}; \
0 }; \
(tnf_probe_control_t *) TNF_NEXT_INIT, \
(tnf_probe_test_func_t) 0, \
(tnf_probe_alloc_func_t) 0, \
(tnf_probe_func_t) 0, \
(tnf_probe_func_t) 0, \
(tnf_uint32_t) 0, \
/* attribute string */ \
"slots " \
";" \
detail, \
sizeof (struct tnf_v_buf_5) \
}; \
struct tnf_v_buf_5 *tnf_v_probe_buffer; \
\
if (tnf_v_probe_test) { \
tnf_v_probe_buffer = (struct tnf_v_buf_5 *) \
if (tnf_v_probe_buffer) { \
} \
} \
}
#endif /* NPROBE */
/*
* Debug Probe Macros (contain an additional "debug" attribute)
*/
#if defined(TNF_DEBUG)
/* CSTYLED */
#else
/* CSTYLED */
((void)0)
#endif /* defined(TNF_DEBUG) */
#if defined(TNF_DEBUG)
/* CSTYLED */
#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)
#else
/* CSTYLED */
((void)0)
#endif /* defined(TNF_DEBUG) */
#if defined(TNF_DEBUG)
/* CSTYLED */
#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)
#else
/* CSTYLED */
#define TNF_PROBE_2_DEBUG(namearg, keysarg, detail, type_1, namearg_1, valarg_1, type_2, namearg_2, valarg_2) \
((void)0)
#endif /* defined(TNF_DEBUG) */
#if defined(TNF_DEBUG)
/* CSTYLED */
#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)
#else
/* CSTYLED */
#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) \
((void)0)
#endif /* defined(TNF_DEBUG) */
#if defined(TNF_DEBUG)
/* CSTYLED */
#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)
#else
/* CSTYLED */
#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) \
((void)0)
#endif /* defined(TNF_DEBUG) */
#if defined(TNF_DEBUG)
/* CSTYLED */
#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)
#else
/* CSTYLED */
#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) \
((void)0)
#endif /* defined(TNF_DEBUG) */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_TNF_PROBE_H */