]>
Commit | Line | Data |
---|---|---|
2d21ac55 A |
1 | /* |
2 | * CDDL HEADER START | |
3 | * | |
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 | |
7 | * with the License. | |
8 | * | |
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. | |
13 | * | |
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] | |
19 | * | |
20 | * CDDL HEADER END | |
21 | */ | |
22 | /* | |
23 | * Copyright 2004 Sun Microsystems, Inc. All rights reserved. | |
24 | * Use is subject to license terms. | |
25 | */ | |
26 | ||
27 | #ifndef _SDT_IMPL_H | |
0a7de745 | 28 | #define _SDT_IMPL_H |
2d21ac55 A |
29 | |
30 | /* | |
31 | * This file has been created by splitting up the original DTrace sdt.h | |
32 | * header. Keep the pragma notice here to allow version tracking. | |
33 | */ | |
34 | ||
35 | /* #pragma ident "@(#)sdt.h 1.7 05/06/08 SMI" */ | |
36 | ||
0a7de745 | 37 | #ifdef __cplusplus |
2d21ac55 A |
38 | extern "C" { |
39 | #endif | |
40 | ||
41 | extern const char *sdt_prefix; | |
42 | ||
43 | typedef struct sdt_probedesc { | |
0a7de745 A |
44 | char *sdpd_name; /* name of this probe */ |
45 | char *sdpd_func; /* APPLE NOTE: function name */ | |
46 | unsigned long sdpd_offset; /* offset of call in text */ | |
47 | struct sdt_probedesc *sdpd_next; /* next static probe */ | |
2d21ac55 A |
48 | } sdt_probedesc_t; |
49 | ||
0a7de745 | 50 | #ifdef __cplusplus |
2d21ac55 A |
51 | } |
52 | #endif | |
53 | ||
54 | /* #pragma ident "@(#)sdt_impl.h 1.3 05/06/08 SMI" */ | |
55 | ||
0a7de745 | 56 | #ifdef __cplusplus |
2d21ac55 A |
57 | extern "C" { |
58 | #endif | |
59 | ||
60 | #include <sys/dtrace.h> | |
61 | ||
2d21ac55 A |
62 | struct module { |
63 | int sdt_nprobes; | |
64 | sdt_probedesc_t *sdt_probes; | |
65 | }; | |
66 | ||
67 | extern int sdt_invop(uintptr_t, uintptr_t *, uintptr_t); | |
6d2010ae | 68 | extern uint64_t sdt_getarg(void *, dtrace_id_t, void *, int, int); |
2d21ac55 A |
69 | |
70 | void sdt_provide_module(void *, struct modctl *); | |
d9a64523 | 71 | void sdt_early_init(void); |
2d21ac55 A |
72 | void sdt_init(void); |
73 | ||
74 | extern int sdt_probetab_size; | |
75 | extern int sdt_probetab_mask; | |
76 | #define SDT_ADDR2NDX(addr) ((((uintptr_t)(addr)) >> 4) & sdt_probetab_mask) | |
77 | ||
78 | ||
39236c6e | 79 | #if defined(__x86_64__) |
2d21ac55 | 80 | typedef uint8_t sdt_instr_t; |
5ba3f43e A |
81 | #elif defined(__arm__) |
82 | typedef uint16_t sdt_instr_t; | |
83 | #elif defined(__arm64__) | |
84 | typedef uint32_t sdt_instr_t; | |
2d21ac55 A |
85 | #else |
86 | #error Unknown implementation | |
87 | #endif | |
2d21ac55 A |
88 | |
89 | typedef struct sdt_provider { | |
0a7de745 A |
90 | const char *sdtp_name; /* name of provider */ |
91 | const char *sdtp_prefix; /* prefix for probe names */ | |
92 | dtrace_pattr_t *sdtp_attr; /* stability attributes */ | |
93 | dtrace_provider_id_t sdtp_id; /* provider ID */ | |
2d21ac55 A |
94 | } sdt_provider_t; |
95 | ||
0a7de745 | 96 | extern sdt_provider_t sdt_providers[]; /* array of providers */ |
2d21ac55 A |
97 | |
98 | typedef struct sdt_probe { | |
0a7de745 A |
99 | sdt_provider_t *sdp_provider; /* provider */ |
100 | char *sdp_name; /* name of probe */ | |
101 | int sdp_namelen; /* length of allocated name */ | |
102 | dtrace_id_t sdp_id; /* probe ID */ | |
103 | struct modctl *sdp_ctl; /* modctl for module */ | |
104 | int sdp_loadcnt; /* load count for module */ | |
105 | int sdp_primary; /* non-zero if primary mod */ | |
106 | sdt_instr_t *sdp_patchpoint; /* patch point */ | |
107 | sdt_instr_t sdp_patchval; /* instruction to patch */ | |
108 | sdt_instr_t sdp_savedval; /* saved instruction value */ | |
109 | struct sdt_probe *sdp_next; /* next probe */ | |
110 | struct sdt_probe *sdp_hashnext; /* next on hash */ | |
2d21ac55 A |
111 | } sdt_probe_t; |
112 | ||
113 | typedef struct sdt_argdesc { | |
0a7de745 A |
114 | const char *sda_provider; /* provider for arg */ |
115 | const char *sda_name; /* name of probe */ | |
116 | const int sda_ndx; /* argument index */ | |
117 | const int sda_mapping; /* mapping of argument */ | |
118 | const char *sda_native; /* native type of argument */ | |
119 | const char *sda_xlate; /* translated type of arg */ | |
2d21ac55 A |
120 | } sdt_argdesc_t; |
121 | ||
122 | extern void sdt_getargdesc(void *, dtrace_id_t, void *, dtrace_argdesc_t *); | |
123 | ||
0a7de745 | 124 | #ifdef __cplusplus |
2d21ac55 A |
125 | } |
126 | #endif | |
127 | ||
0a7de745 | 128 | #endif /* _SDT_IMPL_H */ |