static uint32_t get_kctype_subtype_size(kctype_subtype_t type);
static void setup_subtype_description(kcdata_subtype_descriptor_t desc, kctype_subtype_t type, uint32_t offset, char * name);
static void setup_subtype_array_description(
- kcdata_subtype_descriptor_t desc, kctype_subtype_t type, uint32_t offset, uint32_t count, char * name);
+ kcdata_subtype_descriptor_t desc, kctype_subtype_t type, uint32_t offset, uint32_t count, char * name);
static void setup_type_definition(struct kcdata_type_definition * d, uint32_t type, uint32_t num_elems, char * name);
struct kcdata_type_definition *
#define _SUBTYPE_ARRAY(t, s, f, c) setup_subtype_array_description(&subtypes[i++], (t), offsetof(s, f), (c), _STR_VALUE(f))
#define _STRINGTYPE(f) setup_subtype_array_description(&subtypes[i++], KC_ST_CHAR, 0, UINT16_MAX, f)
- if (buffer_size < sizeof(struct kcdata_type_definition) || buffer == NULL)
+ if (buffer_size < sizeof(struct kcdata_type_definition) || buffer == NULL) {
return NULL;
+ }
struct kcdata_type_definition * retval = (struct kcdata_type_definition *)&buffer[0];
kcdata_subtype_descriptor_t subtypes = (kcdata_subtype_descriptor_t)&buffer[sizeof(struct kcdata_type_definition)];
setup_type_definition(retval, type_id, i, "int64_desc");
break;
}
-
+
case KCDATA_TYPE_TYPEDEFINTION: {
i = 0;
setup_subtype_description(&subtypes[i++], KC_ST_UINT32, offsetof(struct kcdata_type_definition, kct_type_identifier), "typeID");
case STACKSHOT_KCTYPE_SHAREDCACHE_LOADINFO: {
i = 0;
+ /*
+ * for backwards compatibility, we keep the old field names, but the
+ * new data is being put in dyld_shared_cache_loadinfo
+ */
_SUBTYPE(KC_ST_UINT64, struct dyld_uuid_info_64_v2, imageLoadAddress);
_SUBTYPE_ARRAY(KC_ST_UINT8, struct dyld_uuid_info_64_v2, imageUUID, 16);
_SUBTYPE(KC_ST_UINT64, struct dyld_uuid_info_64_v2, imageSlidBaseAddress);
+ _SUBTYPE(KC_ST_UINT64, struct dyld_shared_cache_loadinfo, sharedCacheSlidFirstMapping);
setup_type_definition(retval, type_id, i, "shared_cache_dyld_load_info");
break;
}
}
/* case TASK_CRASHINFO_RUSAGE: { */
- /* /\* */
- /* * rusage is a complex structure and is only for legacy use for crashed processes rusage info. */
- /* * So we just consider it as opaque data. */
- /* *\/ */
- /* i = 0; */
- /* setup_subtype_array_description(&subtypes[i++], KC_ST_UINT8, 0, sizeof(struct rusage), "rusage"); */
- /* setup_type_definition(retval, type_id, i, "rusage"); */
- /* break; */
+ /* /\* */
+ /* * rusage is a complex structure and is only for legacy use for crashed processes rusage info. */
+ /* * So we just consider it as opaque data. */
+ /* *\/ */
+ /* i = 0; */
+ /* setup_subtype_array_description(&subtypes[i++], KC_ST_UINT8, 0, sizeof(struct rusage), "rusage"); */
+ /* setup_type_definition(retval, type_id, i, "rusage"); */
+ /* break; */
/* } */
case TASK_CRASHINFO_RUSAGE_INFO: {
case STACKSHOT_KCTYPE_STACKSHOT_DURATION: {
i = 0;
- _SUBTYPE(KC_ST_UINT64, struct stackshot_duration, stackshot_duration);
- _SUBTYPE(KC_ST_UINT64, struct stackshot_duration, stackshot_duration_outer);
+ _SUBTYPE(KC_ST_UINT64, struct stackshot_duration_v2, stackshot_duration);
+ _SUBTYPE(KC_ST_UINT64, struct stackshot_duration_v2, stackshot_duration_outer);
+ _SUBTYPE(KC_ST_UINT64, struct stackshot_duration_v2, stackshot_duration_prior);
subtypes[0].kcs_flags |= KCS_SUBTYPE_FLAGS_MERGE;
subtypes[1].kcs_flags |= KCS_SUBTYPE_FLAGS_MERGE;
+ subtypes[2].kcs_flags |= KCS_SUBTYPE_FLAGS_MERGE;
setup_type_definition(retval, type_id, i, "stackshot_duration");
break;
}
_SUBTYPE(KC_ST_UINT64, struct jetsam_coalition_snapshot, jcs_leader_task_uniqueid);
setup_type_definition(retval, type_id, i, "jetsam_coalition_snapshot");
break;
- }
+ }
case STACKSHOT_KCTYPE_JETSAM_COALITION: {
i = 0;
_SUBTYPE(KC_ST_UINT64, struct instrs_cycles_snapshot, ics_cycles);
setup_type_definition(retval, type_id, i, "instrs_cycles_snapshot");
break;
- }
+ }
case STACKSHOT_KCTYPE_USER_STACKTOP: {
i = 0;
setup_type_definition(retval, type_id, i, "exit_reason_basic_info");
break;
-
}
case EXIT_REASON_USER_DESC: {
setup_type_definition(retval, type_id, i, "system_shared_cache_layout");
break;
}
-
+
+ case STACKSHOT_KCTYPE_THREAD_DISPATCH_QUEUE_LABEL: {
+ i = 0;
+ _STRINGTYPE("dispatch_queue_label");
+ setup_type_definition(retval, type_id, i, "dispatch_queue_label");
+ break;
+ }
+
+ case STACKSHOT_KCTYPE_THREAD_TURNSTILEINFO: {
+ i = 0;
+ _SUBTYPE(KC_ST_UINT64, struct stackshot_thread_turnstileinfo, waiter);
+ _SUBTYPE(KC_ST_UINT64, struct stackshot_thread_turnstileinfo, turnstile_context);
+ _SUBTYPE(KC_ST_UINT8, struct stackshot_thread_turnstileinfo, turnstile_priority);
+ _SUBTYPE(KC_ST_UINT8, struct stackshot_thread_turnstileinfo, number_of_hops);
+ _SUBTYPE(KC_ST_UINT64, struct stackshot_thread_turnstileinfo, turnstile_flags);
+ setup_type_definition(retval, type_id, i, "thread_turnstileinfo");
+ break;
+ }
+
+ case STACKSHOT_KCTYPE_TASK_CPU_ARCHITECTURE: {
+ i = 0;
+ _SUBTYPE(KC_ST_INT32, struct stackshot_cpu_architecture, cputype);
+ _SUBTYPE(KC_ST_INT32, struct stackshot_cpu_architecture, cpusubtype);
+ setup_type_definition(retval, type_id, i, "task_cpu_architecture");
+ break;
+ }
+
default:
retval = NULL;
break;
}
assert(retval == NULL || (buffer_size > sizeof(struct kcdata_type_definition) +
- (retval->kct_num_elements * sizeof(struct kcdata_subtype_descriptor))));
+ (retval->kct_num_elements * sizeof(struct kcdata_subtype_descriptor))));
return retval;
}
static void
setup_subtype_array_description(
- kcdata_subtype_descriptor_t desc, kctype_subtype_t type, uint32_t offset, uint32_t count, char * name)
+ kcdata_subtype_descriptor_t desc, kctype_subtype_t type, uint32_t offset, uint32_t count, char * name)
{
desc->kcs_flags = KCS_SUBTYPE_FLAGS_ARRAY;
desc->kcs_elem_type = type;
memcpy(desc->kcs_name, name, sizeof(desc->kcs_name));
desc->kcs_name[sizeof(desc->kcs_name) - 1] = '\0';
}
-