Lines Matching refs:buf
14 get_prefix = function(buf)
16 initial_timestamp = buf.timestamp
18 local secs = trace.convert_timestamp_to_nanoseconds(buf.timestamp - initial_timestamp) / 1000000000
21 if trace.debugid_is_start(buf.debugid) then
23 elseif trace.debugid_is_end(buf.debugid) then
30 if buf.pid == buf[1] then
31 proc = buf.command
32 if pid_map[buf[1]] == nil then
33 pid_map[buf[1]] = buf.command
35 elseif pid_map[buf[1]] ~= nil then
36 proc = pid_map[buf[1]]
42 prefix, secs, proc, buf.pid, buf.threadid, buf.debugname)
109 trace_codename("wq_pthread_exit", function(buf)
110 local prefix = get_prefix(buf)
111 if trace.debugid_is_start(buf.debugid) then
118 trace_codename("wq_workqueue_exit", function(buf)
119 local prefix = get_prefix(buf)
120 if trace.debugid_is_start(buf.debugid) then
127 trace_codename("wq_start_add_timer", function(buf)
128 local prefix = get_prefix(buf)
130 prefix, buf.arg4, buf.arg3, buf.arg2)
133 trace_codename("wq_add_timer", function(buf)
134 local prefix = get_prefix(buf)
135 if trace.debugid_is_start(buf.debugid) then
137 prefix, buf.arg2, buf.arg3, buf.arg4)
138 elseif trace.debugid_is_end(buf.debugid) then
140 prefix, buf.arg2, buf.arg3, buf.arg4)
144 trace_codename("wq_select_threadreq", function(buf)
145 local prefix = get_prefix(buf)
146 if buf[2] == 0 then
148 elseif buf[2] == 1 then
150 elseif buf[2] == 2 then
152 elseif buf[2] == 3 then
157 trace_codename("wq_creator_select", function(buf)
158 local prefix = get_prefix(buf)
159 if buf[2] == 1 then
160 printf("%s\t\tcreator %x overridden at %s\n", prefix, buf[3],
161 parse_thread_qos(buf[4]))
162 elseif buf[2] == 2 then
163 printf("%s\t\tcreator %x selected at %s\n", prefix, buf[3],
164 parse_thread_qos(buf[4]))
165 elseif buf[2] == 3 then
166 printf("%s\t\tcreator idled (%d yields)\n", prefix, buf[4])
167 elseif buf[2] == 4 then
168 printf("%s\t\tcreator removed (%d yields)\n", prefix, buf[4])
172 trace_codename("wq_creator_yield", function(buf)
173 local prefix = get_prefix(buf)
175 if buf[2] == 1 then
177 elseif buf[2] == 2 then
181 prefix, reason, buf[3], buf[4])
184 trace_codename("wq_thread_logical_run", function(buf)
185 local prefix = get_prefix(buf)
186 if trace.debugid_is_start(buf.debugid) then
187 printf("%s\tthread unparking (request %x)\n", prefix, buf[2])
196 trace_codename("wq_runthread", function(buf)
197 local prefix = get_prefix(buf)
198 if trace.debugid_is_start(buf.debugid) then
200 runthread_time_map[buf.threadid] = buf.timestamp;
201 runthread_cputime_map[buf.threadid] = trace.cputime_for_thread(buf.threadid);
202 elseif runthread_time_map[buf.threadid] then
203 local time = buf.timestamp - runthread_time_map[buf.threadid]
204 local cputime = trace.cputime_for_thread(buf.threadid) - runthread_cputime_map[buf.threadid]
212 runthread_time_map[buf.threadid] = 0
213 runthread_cputime_map[buf.threadid] = 0
214 elseif trace.debugid_is_end(buf.debugid) then
219 trace_codename("wq_thactive_update", function(buf)
220 local prefix = get_prefix(buf)
221 local thactive = get_thactive(buf[2], buf[3])
225 trace_codename("wq_thread_block", function(buf)
226 local prefix = get_prefix(buf)
227 local req_pri = parse_thread_qos(buf[3] >> 8)
228 if trace.debugid_is_start(buf.debugid) then
230 prefix, buf[2], parse_thread_qos(buf[3] & 0xff), req_pri, buf[4] >> 1, buf[4] & 0x1)
233 prefix, buf[2], parse_thread_qos(buf[3] & 0xff), req_pri, buf[4])
237 trace_codename("wq_thread_create_failed", function(buf)
238 local prefix = get_prefix(buf)
239 if buf[3] == 0 then
241 prefix, buf[2])
242 elseif buf[3] == 1 then
243 printf("%s\tfailed to vm_map workq thread stack: 0x%x\n", prefix, buf[2])
244 elseif buf[3] == 2 then
245 printf("%s\tfailed to vm_protect workq thread guardsize: 0x%x\n", prefix, buf[2])
249 trace_codename("wq_thread_create", function(buf)
250 printf("%s\tcreated new workqueue thread\n", get_prefix(buf))
253 trace_codename("wq_thread_terminate", function(buf)
254 local prefix = get_prefix(buf)
256 if trace.debugid_is_start(buf.debugid) then
261 printf("%s\t%s: currently idle %d\n", prefix, what, buf[2])
264 trace_codename("wq_wqops_reqthreads", function(buf)
265 local prefix = get_prefix(buf)
266 …egacy thread request made for %d threads at %s\n", prefix, buf[2], parse_pthread_priority(buf[3]));
269 trace_codename("wq_thread_request_initiate", function(buf)
270 local prefix = get_prefix(buf)
271 …("%s\tthread request %x made at %s (count:%d)\n", prefix, buf[2], parse_thread_qos(buf[3]), buf[4]…
274 trace_codename("wq_thread_request_modify", function(buf)
275 local prefix = get_prefix(buf)
276 printf("%s\tthread request %x priorty updated to %s\n", prefix, buf[2], parse_thread_qos(buf[3]));
279 trace_codename("wq_thread_request_cancel", function(buf)
280 local prefix = get_prefix(buf)
281 printf("%s\tthread request %x canceled\n", prefix, buf[2], parse_thread_qos(buf[3]));
284 trace_codename("wq_constrained_admission", function(buf)
285 local prefix = get_prefix(buf)
286 if buf[2] == 1 then
288 prefix, buf[3], buf[4])
289 elseif (buf[2] == 2) or (buf[2] == 3) then
291 if buf[2] == 2 then success = "success"
294 prefix, success, buf[3], buf[4])
298 trace_codename("wq_cooperative_admission", function(buf)
299 local prefix = get_prefix(buf)
300 if (buf[4] == 1) then
302 prefix, parse_thread_qos(buf[2]), buf[1])
303 elseif (buf[4] == 2) then
305 prefix, parse_thread_qos(buf[2]), buf[1])
306 elseif (buf[4] == 3) then
308 if (buf[3] == 0) then
312 prefix, success, parse_thread_qos(buf[2]), buf[1])
316 trace_codename("wq_death_call", function(buf)
317 local prefix = get_prefix(buf)
318 if trace.debugid_is_start(buf.debugid) then
320 elseif trace.debugid_is_end(buf.debugid) then