Lines Matching defs:task
135 proc_name_kdp(task_t task, char *buf, int size);
141 pid_from_task(task_t task);
1037 static int pid_from_task(task_t task)
1041 if (task->bsd_info)
1042 pid = proc_pid(task->bsd_info);
1133 task_t task = TASK_NULL;
1137 struct task ctask;
1158 queue_iterate(task_list, task, task_t, tasks) {
1159 if ((task == NULL) || (ml_nofault_copy((vm_offset_t) task, (vm_offset_t) &ctask, sizeof(struct task)) != sizeof(struct task)))
1162 int task_pid = pid_from_task(task);
1163 boolean_t task64 = task_has_64BitAddr(task);
1165 if (!task->active) {
1168 * at the moment, stackshot can't handle a task without a name.
1170 if (queue_empty(&task->threads) || task_pid == -1) {
1180 boolean_t have_map = (task->map != NULL) &&
1181 (ml_nofault_copy((vm_offset_t)(task->map), (vm_offset_t)&cmap, sizeof(struct _vm_map)) == sizeof(struct _vm_map));
1185 if (have_pmap && task->active && save_loadinfo_p && task_pid > 0) {
1186 // Read the dyld_all_image_infos struct from the task memory to get UUID array count and location
1189 if (kdp_copyin(task->map->pmap, task->all_image_info_addr, &task_image_infos, sizeof(struct user64_dyld_all_image_infos))) {
1195 if (kdp_copyin(task->map->pmap, task->all_image_info_addr, &task_image_infos, sizeof(struct user32_dyld_all_image_infos))) {
1203 // for this task.
1220 proc_name_kdp(task, task_snap->p_comm, sizeof(task_snap->p_comm));
1226 if (!task->active)
1228 if(task->pidsuspended) task_snap->ss_flags |= kPidSuspended;
1229 if(task->frozen) task_snap->ss_flags |= kFrozen;
1231 task_snap->suspend_count = task->suspend_count;
1232 task_snap->task_size = have_pmap ? pmap_resident_count(task->map->pmap) : 0;
1233 task_snap->faults = task->faults;
1234 task_snap->pageins = task->pageins;
1235 task_snap->cow_faults = task->cow_faults;
1237 task_snap->user_time_in_terminated_threads = task->total_user_time;
1238 task_snap->system_time_in_terminated_threads = task->total_system_time;
1252 if (have_pmap && !kdp_copyin(task->map->pmap, uuid_info_addr, tracepos, uuid_info_array_size))
1258 queue_iterate(&task->threads, thread, thread_t, task_threads){
1289 if (dispatch_p && (task != kernel_task) && (task->active) && have_pmap) {
1293 if (kdp_copyin(task->map->pmap, dqkeyaddr, &dqaddr, (task64 ? 8 : 4)) && (dqaddr != 0)) {
1296 if (kdp_copyin(task->map->pmap, dqserialnumaddr, &dqserialnum, (task64 ? 8 : 4))) {
1322 if (task->active && thread->task->map != kernel_map) {
1323 /* 64-bit task? */
1324 if (task_has_64BitAddr(thread->task)) {