55
55
#define SWIFT_LOG_TASK_FLAGS_CHANGED_NAME " task_flags_changed"
56
56
#define SWIFT_LOG_TASK_STATUS_CHANGED_NAME " task_status_changed"
57
57
#define SWIFT_LOG_TASK_WAIT_NAME " task_wait"
58
- #define SWIFT_LOG_TASK_CONTINUATION_INIT " task_continuation_init "
58
+ #define SWIFT_LOG_TASK_CONTINUATION " task_continuation "
59
59
#define SWIFT_LOG_TASK_CONTINUATION_AWAIT " task_continuation_await"
60
- #define SWIFT_LOG_TASK_CONTINUATION_RESUME " task_continuation_resume"
61
60
#define SWIFT_LOG_JOB_ENQUEUE_GLOBAL_NAME " job_enqueue_global"
62
61
#define SWIFT_LOG_JOB_ENQUEUE_GLOBAL_WITH_DELAY_NAME \
63
62
" job_enqueue_global_with_delay"
@@ -178,16 +177,21 @@ inline void actor_note_job_queue(HeapObject *actor, Job *first,
178
177
// Task trace calls.
179
178
180
179
inline void task_create (AsyncTask *task, AsyncTask *parent, TaskGroup *group,
181
- AsyncLet *asyncLet) {
180
+ AsyncLet *asyncLet, uint8_t jobPriority,
181
+ bool isChildTask, bool isFuture, bool isGroupChildTask,
182
+ bool isAsyncLetTask) {
182
183
ENSURE_LOGS ();
183
184
auto id = os_signpost_id_make_with_pointer (TaskLog, task);
184
185
auto parentID = parent ? parent->getTaskId () : 0 ;
185
186
os_signpost_interval_begin (
186
187
TaskLog, id, SWIFT_LOG_TASK_LIFETIME_NAME,
187
- " task=%" PRIx64 " resumefn=%p flags=0x%" PRIx32
188
- " parent=%" PRIx64 " group=%p asyncLet=%p" ,
189
- task->getTaskId (), task->getResumeFunctionForLogging (),
190
- task->Flags .getOpaqueValue (), parentID, group, asyncLet);
188
+ " task=%" PRIx64
189
+ " resumefn=%p jobPriority=%u isChildTask=%{bool}d, isFuture=%{bool}d "
190
+ " isGroupChildTask=%{bool}d isAsyncLetTask=%{bool}d parent=%" PRIx64
191
+ " group=%p asyncLet=%p" ,
192
+ task->getTaskId (), task->getResumeFunctionForLogging (), jobPriority,
193
+ isChildTask, isFuture, isGroupChildTask, isAsyncLetTask, parentID, group,
194
+ asyncLet);
191
195
}
192
196
193
197
inline void task_destroy (AsyncTask *task) {
@@ -244,9 +248,9 @@ inline void task_continuation_init(AsyncTask *task,
244
248
ContinuationAsyncContext *context) {
245
249
ENSURE_LOGS ();
246
250
auto id = os_signpost_id_make_with_pointer (TaskLog, context);
247
- os_signpost_event_emit (TaskLog, id, SWIFT_LOG_TASK_CONTINUATION_INIT ,
248
- " task=%" PRIx64 " context=%p" , task->getTaskId (),
249
- context);
251
+ os_signpost_interval_begin (TaskLog, id, SWIFT_LOG_TASK_CONTINUATION ,
252
+ " task=%" PRIx64 " context=%p" , task->getTaskId (),
253
+ context);
250
254
}
251
255
252
256
inline void task_continuation_await (ContinuationAsyncContext *context) {
@@ -260,8 +264,8 @@ inline void task_continuation_resume(ContinuationAsyncContext *context,
260
264
bool error) {
261
265
ENSURE_LOGS ();
262
266
auto id = os_signpost_id_make_with_pointer (TaskLog, context);
263
- os_signpost_event_emit (TaskLog, id, SWIFT_LOG_TASK_CONTINUATION_RESUME ,
264
- " context=%p error=%{bool}d" , context, error);
267
+ os_signpost_interval_end (TaskLog, id, SWIFT_LOG_TASK_CONTINUATION ,
268
+ " context=%p error=%{bool}d" , context, error);
265
269
}
266
270
267
271
inline void job_enqueue_global (Job *job) {
@@ -293,7 +297,7 @@ inline void job_enqueue_main_executor(Job *job) {
293
297
}
294
298
}
295
299
296
- inline job_run_info job_run_begin (Job *job, ExecutorRef *executor ) {
300
+ inline job_run_info job_run_begin (Job *job) {
297
301
auto invalidInfo = []{
298
302
return job_run_info{ 0 , OS_SIGNPOST_ID_INVALID };
299
303
};
@@ -302,25 +306,18 @@ inline job_run_info job_run_begin(Job *job, ExecutorRef *executor) {
302
306
ENSURE_LOGS (invalidInfo ());
303
307
auto handle = os_signpost_id_generate (TaskLog);
304
308
auto taskId = task->getTaskId ();
305
- os_signpost_interval_begin (
306
- TaskLog, handle, SWIFT_LOG_JOB_RUN_NAME,
307
- " task=%" PRIx64
308
- " executorIdentity=%p executorImplementation=0x%" PRIxPTR,
309
- taskId, executor->getIdentity (), executor->getRawImplementation ());
309
+ os_signpost_interval_begin (TaskLog, handle, SWIFT_LOG_JOB_RUN_NAME,
310
+ " task=%" PRIx64, taskId);
310
311
return { taskId, handle };
311
312
}
312
313
return invalidInfo ();
313
314
}
314
315
315
- inline void job_run_end (ExecutorRef *executor, job_run_info info) {
316
+ inline void job_run_end (job_run_info info) {
316
317
if (info.handle != OS_SIGNPOST_ID_INVALID) {
317
318
ENSURE_LOGS ();
318
- os_signpost_interval_end (
319
- TaskLog, info.handle , SWIFT_LOG_JOB_RUN_NAME,
320
- " task=%" PRIx64
321
- " executorIdentity=%p executorImplementation=0x%" PRIxPTR,
322
- info.taskId , executor->getIdentity (),
323
- executor->getRawImplementation ());
319
+ os_signpost_interval_end (TaskLog, info.handle , SWIFT_LOG_JOB_RUN_NAME,
320
+ " task=%" PRIx64, info.taskId );
324
321
}
325
322
}
326
323
0 commit comments