3 outfile
="$(dirname $0)/winbindd.stp"
5 child_funcs
="winbindd_dual_ping
6 winbindd_dual_list_trusted_domains
7 winbindd_dual_init_connection
9 winbindd_dual_pam_auth_crap
10 winbindd_dual_pam_logoff
11 winbindd_dual_pam_chng_pswd_auth_crap
12 winbindd_dual_pam_chauthtok
21 _wbint_LookupUserAliases
22 _wbint_LookupUserGroups
23 _wbint_QuerySequenceNumber
24 _wbint_LookupGroupMembers
26 _wbint_QueryUserRidList
29 _wbint_CheckMachineAccount
30 _wbint_ChangeMachineAccount
42 winbindd_getsidaliases
43 winbindd_getuserdomgroups
45 winbindd_show_sequence
60 winbindd_check_machine_acct
64 winbindd_pam_chauthtok
65 winbindd_pam_chng_pswd_auth_crap
70 winbindd_change_machine_acct
71 winbindd_pam_auth_crap"
73 backend_funcs
="query_user_list
87 header
='#!/usr/bin/stap
89 # Systemtap script to instrument winbindd
91 '"# Generated by examples/systemtap/$(basename $0) on $(date), do not edit
95 # Instrument all winbindd processes:
98 # Instrument a specific winbindd process:
99 # # stap -x PID winbindd.stp
102 global dc_running, dc_svctime
103 global backend_running, backend_svctime
104 global send_running, recv_running
105 global start_time, idle_time
106 global async_svctime, async_runtime
109 printf("Collecting data, press ctrl-C to stop... ")
112 domchild_req_template
='
114 # winbind domain child function XXX
117 probe process("winbindd").function("XXX") {
118 dc_running[tid(), "XXX"] = gettimeofday_us()
121 probe process("winbindd").function("XXX").return {
122 if (!([tid(), "XXX"] in dc_running))
125 end = gettimeofday_us()
126 begin = dc_running[tid(), "XXX"]
127 delete dc_running[tid(), "XXX"]
129 duration = end - begin
130 dc_svctime["XXX"] <<< duration
133 backend_req_template
='
135 # winbind domain child backend function XXX
138 probe process("winbindd").function("XXX@../source3/winbindd/winbindd_ads.c") {
139 backend_running[tid(), "XXX"] = gettimeofday_us()
142 probe process("winbindd").function("XXX@../source3/winbindd/winbindd_ads.c").return {
143 if (!([tid(), "XXX"] in backend_running))
146 end = gettimeofday_us()
147 begin = backend_running[tid(), "XXX"]
148 delete backend_running[tid(), "XXX"]
150 duration = end - begin
151 backend_svctime["XXX"] <<< duration
156 # winbind async function XXX
159 probe process("winbindd").function("XXX_send") {
160 send_running["XXX_send"] = gettimeofday_us()
163 probe process("winbindd").function("XXX_send").return {
164 if (!(["XXX_send"] in send_running))
167 end = gettimeofday_us()
168 start = send_running["XXX_send"]
169 delete send_running["XXX_send"]
171 start_time["XXX_send", $return] = start
172 idle_time["XXX_send", $return] = end
175 probe process("winbindd").function("XXX_recv") {
176 if (!(["XXX_send", $req] in start_time))
179 recv_running["XXX_recv"] = gettimeofday_us()
182 probe process("winbindd").function("XXX_recv").return {
183 if (!(["XXX_recv"] in recv_running))
186 recv_end = gettimeofday_us()
187 recv_start = recv_running["XXX_recv"]
188 delete recv_running["XXX_recv"]
189 recv_runtime = recv_end - recv_start
193 send_begin = start_time["XXX_send", req]
194 delete start_time["XXX_send", req]
195 svctime = recv_end - send_begin
197 idle = idle_time["XXX_send", req]
198 delete idle_time["XXX_send", req]
199 runtime = (idle - send_begin) + recv_runtime
201 async_svctime["XXX_send"] <<< svctime
202 async_runtime["XXX_send"] <<< runtime
209 printf("Winbind request service time\n")
210 printf("============================\n")
211 foreach ([name] in async_svctime) {
212 printf("%-40s count: %5d, sum: %6d ms (min: %6d us, avg: %6d us, max: %6d us)\n",
214 @count(async_svctime[name]),
215 @sum(async_svctime[name]) / 1000,
216 @min(async_svctime[name]),
217 @avg(async_svctime[name]),
218 @max(async_svctime[name]))
222 printf("Winbind request runtime\n")
223 printf("=======================\n")
224 foreach ([name] in async_runtime) {
225 printf("%-40s count: %5d, sum: %6d ms (min: %6d us, avg: %6d us, max: %6d us)\n",
227 @count(async_runtime[name]),
228 @sum(async_runtime[name]) / 1000,
229 @min(async_runtime[name]),
230 @avg(async_runtime[name]),
231 @max(async_runtime[name]))
235 printf("Winbind domain-child request service time\n")
236 printf("=========================================\n")
237 foreach ([name] in dc_svctime) {
238 printf("%-40s count: %5d, sum: %6d ms (min: %6d us, avg: %6d us, max: %6d us)\n",
240 @count(dc_svctime[name]),
241 @sum(dc_svctime[name]) / 1000,
242 @min(dc_svctime[name]),
243 @avg(dc_svctime[name]),
244 @max(dc_svctime[name]))
248 printf("Winbind domain-child AD-backend service time\n")
249 printf("============================================\n")
250 foreach ([name] in backend_svctime) {
251 printf("%-40s count: %5d, sum: %6d ms (min: %6d us, avg: %6d us, max: %6d us)\n",
253 @count(backend_svctime[name]),
254 @sum(backend_svctime[name]) / 1000,
255 @min(backend_svctime[name]),
256 @avg(backend_svctime[name]),
257 @max(backend_svctime[name]))
261 printf("Winbind request service time distributions (us)\n")
262 printf("===============================================\n")
263 foreach ([name] in async_svctime) {
264 printf("%s:\n", name);
265 println(@hist_log(async_svctime[name]))
269 printf("Winbind request runtime distributions (us)\n")
270 printf("==========================================\n")
271 foreach ([name] in async_runtime) {
272 printf("%s:\n", name);
273 println(@hist_log(async_runtime[name]))
276 printf("Winbind domain-child request service time distributions (us)\n")
277 printf("============================================================\n")
278 foreach ([name] in dc_svctime) {
279 printf("%s:\n", name);
280 println(@hist_log(dc_svctime[name]))
283 printf("Winbind domain-child AD-backend service time distributions (us)\n")
284 printf("===============================================================\n")
285 foreach ([name] in backend_svctime) {
286 printf("%s:\n", name);
287 println(@hist_log(backend_svctime[name]))
295 printf "$child_funcs\n" |
while read func
; do
296 printf "$domchild_req_template\n" |
sed -e s
/XXX
/$func/g
>> $outfile
299 printf "$backend_funcs\n" |
while read func
; do
300 printf "$backend_req_template\n" |
sed -e "s|XXX|$func|g" >> $outfile
303 printf "$async_funcs\n" |
while read func
; do
304 printf "$async_req_template\n" |
sed -e s
/XXX
/$func/g
>> $outfile