5555#define SWIFT_LOG_TASK_FLAGS_CHANGED_NAME " task_flags_changed"
5656#define SWIFT_LOG_TASK_STATUS_CHANGED_NAME " task_status_changed"
5757#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 "
5959#define SWIFT_LOG_TASK_CONTINUATION_AWAIT " task_continuation_await"
60- #define SWIFT_LOG_TASK_CONTINUATION_RESUME " task_continuation_resume"
6160#define SWIFT_LOG_JOB_ENQUEUE_GLOBAL_NAME " job_enqueue_global"
6261#define SWIFT_LOG_JOB_ENQUEUE_GLOBAL_WITH_DELAY_NAME \
6362 " job_enqueue_global_with_delay"
@@ -178,16 +177,21 @@ inline void actor_note_job_queue(HeapObject *actor, Job *first,
178177// Task trace calls.
179178
180179inline 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) {
182183 ENSURE_LOGS ();
183184 auto id = os_signpost_id_make_with_pointer (TaskLog, task);
184185 auto parentID = parent ? parent->getTaskId () : 0 ;
185186 os_signpost_interval_begin (
186187 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);
191195}
192196
193197inline void task_destroy (AsyncTask *task) {
@@ -244,9 +248,9 @@ inline void task_continuation_init(AsyncTask *task,
244248 ContinuationAsyncContext *context) {
245249 ENSURE_LOGS ();
246250 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);
250254}
251255
252256inline void task_continuation_await (ContinuationAsyncContext *context) {
@@ -260,8 +264,8 @@ inline void task_continuation_resume(ContinuationAsyncContext *context,
260264 bool error) {
261265 ENSURE_LOGS ();
262266 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);
265269}
266270
267271inline void job_enqueue_global (Job *job) {
@@ -293,7 +297,7 @@ inline void job_enqueue_main_executor(Job *job) {
293297 }
294298}
295299
296- inline job_run_info job_run_begin (Job *job, ExecutorRef *executor ) {
300+ inline job_run_info job_run_begin (Job *job) {
297301 auto invalidInfo = []{
298302 return job_run_info{ 0 , OS_SIGNPOST_ID_INVALID };
299303 };
@@ -302,25 +306,18 @@ inline job_run_info job_run_begin(Job *job, ExecutorRef *executor) {
302306 ENSURE_LOGS (invalidInfo ());
303307 auto handle = os_signpost_id_generate (TaskLog);
304308 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);
310311 return { taskId, handle };
311312 }
312313 return invalidInfo ();
313314}
314315
315- inline void job_run_end (ExecutorRef *executor, job_run_info info) {
316+ inline void job_run_end (job_run_info info) {
316317 if (info.handle != OS_SIGNPOST_ID_INVALID) {
317318 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 );
324321 }
325322}
326323
0 commit comments