-
Notifications
You must be signed in to change notification settings - Fork 468
/
Copy pathprovider.d
141 lines (123 loc) · 5.05 KB
/
provider.d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
/*
* Copyright (c) 2010-2013 Apple Inc. All rights reserved.
*
* @APPLE_APACHE_LICENSE_HEADER_START@
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @APPLE_APACHE_LICENSE_HEADER_END@
*/
/*
* DTrace Probes for libdispatch
*
* Only available in the introspection version of the library,
* loaded by running a process with the environment variable
* DYLD_LIBRARY_PATH=/usr/lib/system/introspection
*/
typedef struct dispatch_object_s *dispatch_object_t;
typedef struct dispatch_queue_s *dispatch_queue_t;
typedef struct dispatch_source_s *dispatch_source_t;
typedef void (*dispatch_function_t)(void *);
typedef struct dispatch_trace_timer_params_s {
int64_t deadline, interval, leeway;
} *dispatch_trace_timer_params_t;
provider dispatch {
/*
* Probes for dispatch queue push and pop operations
*
* dispatch$target:libdispatch*.dylib::queue-push
* dispatch$target:libdispatch*.dylib::queue-pop
*/
probe queue__push(dispatch_queue_t queue, const char *label,
dispatch_object_t item, const char *kind,
dispatch_function_t function, void *context);
probe queue__pop(dispatch_queue_t queue, const char *label,
dispatch_object_t item, const char *kind,
dispatch_function_t function, void *context);
/*
* Probes for dispatch callouts to client functions
*
* dispatch$target:libdispatch*.dylib::callout-entry
* dispatch$target:libdispatch*.dylib::callout-return
*/
probe callout__entry(dispatch_queue_t queue, const char *label,
dispatch_function_t function, void *context);
probe callout__return(dispatch_queue_t queue, const char *label,
dispatch_function_t function, void *context);
/*
* Probes for dispatch timer configuration and programming
*
* Timer configuration indicates that dispatch_source_set_timer() was called.
* Timer programming indicates that the dispatch manager is about to sleep
* for 'deadline' ns (but may wake up earlier if non-timer events occur).
* Time parameters are in nanoseconds, a value of -1 means "forever".
*
* dispatch$target:libdispatch*.dylib::timer-configure
* dispatch$target:libdispatch*.dylib::timer-program
*/
probe timer__configure(dispatch_source_t source,
dispatch_function_t handler, dispatch_trace_timer_params_t params);
probe timer__program(dispatch_source_t source, dispatch_function_t handler,
dispatch_trace_timer_params_t params);
/*
* Probes for dispatch timer wakes and fires
*
* Timer wakes indicate that the dispatch manager woke up due to expiry of the
* deadline for the specified timer.
* Timer fires indicate that that the dispatch manager scheduled the event
* handler of the specified timer for asynchronous execution (may occur without
* a corresponding timer wake if the manager was awake processing other events
* when the timer deadline expired).
*
* dispatch$target:libdispatch*.dylib::timer-wake
* dispatch$target:libdispatch*.dylib::timer-fire
*/
probe timer__wake(dispatch_source_t source, dispatch_function_t handler);
probe timer__fire(dispatch_source_t source, dispatch_function_t handler);
};
#pragma D attributes Evolving/Evolving/Common provider dispatch provider
#pragma D attributes Private/Private/Common provider dispatch module
#pragma D attributes Private/Private/Common provider dispatch function
#pragma D attributes Evolving/Evolving/Common provider dispatch name
#pragma D attributes Evolving/Evolving/Common provider dispatch args
typedef struct voucher_s *voucher_t;
/*
* Probes for vouchers
*/
provider voucher {
/*
* Voucher lifetime:
*
* voucher$target:::create A new voucher is being created
* voucher$target:::dispose A voucher is being freed
* voucher$target:::retain A voucher is being retained
* voucher$target:::release A voucher is being released
*/
probe create(voucher_t voucher, mach_port_t kv, uint64_t activity_id);
probe dispose(voucher_t voucher);
probe retain(voucher_t voucher, int resulting_refcnt);
probe release(voucher_t voucher, int resulting_refcnt);
/*
* Thread adoption
*
* voucher$target:::adopt A voucher is being adopted by the current thread
* voucher$target:::orphan A voucher is being orphanned by the current thread
*/
probe adopt(voucher_t voucher);
probe orphan(voucher_t voucher);
};
#pragma D attributes Evolving/Evolving/Common provider voucher provider
#pragma D attributes Private/Private/Common provider voucher module
#pragma D attributes Private/Private/Common provider voucher function
#pragma D attributes Evolving/Evolving/Common provider voucher name
#pragma D attributes Evolving/Evolving/Common provider voucher args