Loading...
tests/stackshot_tests.m xnu-12377.121.6 xnu-8792.61.2
--- xnu/xnu-12377.121.6/tests/stackshot_tests.m
+++ xnu/xnu-8792.61.2/tests/stackshot_tests.m
@@ -6,7 +6,6 @@
 #include <kern/block_hint.h>
 #include <kdd.h>
 #include <libproc.h>
-#include <os/atomic_private.h>
 #include <mach-o/dyld.h>
 #include <mach-o/dyld_images.h>
 #include <mach-o/dyld_priv.h>
@@ -17,16 +16,10 @@
 #include <pthread/workqueue_private.h>
 #include <dispatch/private.h>
 #include <stdalign.h>
-#include <TargetConditionals.h>
-#import <Foundation/NSTask.h>
-
 #import <zlib.h>
 #import <IOKit/IOKitLib.h>
 #import <IOKit/IOKitLibPrivate.h>
 #import <IOKit/IOKitKeysPrivate.h>
-#import "test_utils.h"
-
-
 
 T_GLOBAL_META(
 		T_META_NAMESPACE("xnu.stackshot"),
@@ -34,8 +27,7 @@
 		T_META_RADAR_COMPONENT_VERSION("stackshot"),
 		T_META_OWNER("jonathan_w_adams"),
 		T_META_CHECK_LEAKS(false),
-		T_META_ASROOT(true),
-		XNU_T_META_SOC_SPECIFIC
+		T_META_ASROOT(true)
 		);
 
 static const char *current_process_name(void);
@@ -68,9 +60,6 @@
 #define PARSE_STACKSHOT_ASYNCSTACK           0x1000
 #define PARSE_STACKSHOT_COMPACTINFO          0x2000 /* TODO: rdar://88789261 */
 #define PARSE_STACKSHOT_DRIVERKIT            0x4000
-#define PARSE_STACKSHOT_THROTTLED_SP         0x8000
-#define PARSE_STACKSHOT_SUSPENDINFO          0x10000
-#define PARSE_STACKSHOT_TARGETPID            0x20000
 
 /* keys for 'extra' dictionary for parse_stackshot */
 static const NSString* zombie_child_pid_key = @"zombie_child_pid"; // -> @(pid), required for PARSE_STACKSHOT_ZOMBIE
@@ -87,30 +76,11 @@
 static const NSString* asyncstack_expected_threadid_key = @"asyncstack_expected_threadid"; // -> @(tid), required for PARSE_STACKSHOT_ASYNCSTACK
 static const NSString* asyncstack_expected_stack_key = @"asyncstack_expected_stack"; // -> @[pc...]), expected PCs for asyncstack
 static const NSString* driverkit_found_key = @"driverkit_found_key"; // callback when driverkit process is found. argument is the process pid.
-static const NSString* sp_throttled_expected_ctxt_key = @"sp_throttled_expected_ctxt_key"; // -> @(ctxt), required for PARSE_STACKSHOT_THROTTLED_SP
-static const NSString* sp_throttled_expect_flag = @"sp_throttled_expect_flag"; // -> @(is_throttled), required for PARSE_STACKSHOT_THROTTLED_SP
-static const NSString* no_exclaves_key = @"no_exclaves";
 
 #define TEST_STACKSHOT_QUEUE_LABEL        "houston.we.had.a.problem"
 #define TEST_STACKSHOT_QUEUE_LABEL_LENGTH sizeof(TEST_STACKSHOT_QUEUE_LABEL)
 
-#define THROTTLED_SERVICE_NAME "com.apple.xnu.test.stackshot.throttled_service"
-
-static int64_t
-run_sysctl_test(const char *t, int64_t value)
-{
-	char name[1024];
-	int64_t result = 0;
-	size_t s = sizeof(value);
-	int rc;
-
-	snprintf(name, sizeof(name), "debug.test.%s", t);
-	rc = sysctlbyname(name, &result, &s, &value, s);
-	T_QUIET; T_ASSERT_POSIX_SUCCESS(rc, "sysctlbyname(%s)", name);
-	return result;
-}
-
-T_DECL(microstackshots, "test the microstackshot syscall", T_META_TAG_VM_PREFERRED)
+T_DECL(microstackshots, "test the microstackshot syscall")
 {
 	void *buf = NULL;
 	unsigned int size = DEFAULT_STACKSHOT_BUFFER_SIZE;
@@ -157,7 +127,6 @@
 	bool no_recordfile;
 	pid_t target_pid;
 	bool target_kernel;
-	bool nocheck_recordfile;
 	uint64_t since_timestamp;
 	uint32_t size_hint;
 	dt_stat_time_t timer;
@@ -269,61 +238,6 @@
 		T_QUIET; T_ASSERT_POSIX_SUCCESS(written, "wrote stackshot to file");
 
 		fclose(f);
-
-		// the xnu lldbmacros include a kcdata dumper which is used by
-		// panic triage and other things to process the recorded data
-		// from panics.  With `-s foo.ips`, this generates a panic
-		// report similar.  It's really important that this continues to
-		// work.
-		//
-		// We also ship the same code as /usr/local/bin/kcdata.  To make
-		// sure the *.ips continues to work without aborting or otherwise
-		// tripping over the current data being output by xnu, we do a
-		// `kcdata.py -s /dev/null` run on the *first* kcdata we get for
-		// a given test, and save the stdout/err to files that get
-		// reported in the test report.  Typically it will tell you the
-		// shared cache UUID and maybe complain about missing exclaves
-		// data.
-		//
-		// This only works on full stackshots, so we skip it for DELTAs,
-		// and BridgeOS is missing python, so we make sure everything we
-		// need is executable before trying
-#define PYTHON3_PATH "/usr/local/bin/python3"
-#define KCDATA_PATH "/usr/local/bin/kcdata"
-		if (!(scenario->flags & STACKSHOT_COLLECT_DELTA_SNAPSHOT) &&
-		    !scenario->nocheck_recordfile &&
-		    access(PYTHON3_PATH, X_OK) == 0 && access(KCDATA_PATH, X_OK) == 0) {
-
-			scenario->nocheck_recordfile = true; // don't do this more than once per scenario
-			char outpath[MAXPATHLEN];
-			strlcpy(outpath, scenario->name, sizeof(outpath));
-			strlcat(outpath, ".kcdpy-out", sizeof(outpath));
-			char errpath[MAXPATHLEN];
-			strlcpy(errpath, scenario->name, sizeof(errpath));
-			strlcat(errpath, ".kcdpy-err", sizeof(errpath));
-			T_QUIET; T_ASSERT_POSIX_ZERO(dt_resultfile(outpath, sizeof(outpath)), "create py-out path");
-			T_QUIET; T_ASSERT_POSIX_ZERO(dt_resultfile(errpath, sizeof(errpath)), "create py-err path");
-
-			char *launch_tool_args[] = {
-				KCDATA_PATH,
-				"-s",
-				"/dev/null",
-				sspath,
-				NULL
-			};
-			pid_t child_pid = -1;
-			int ret = dt_launch_tool(&child_pid, launch_tool_args, false, outpath, errpath);
-			T_WITH_ERRNO; T_EXPECT_EQ(ret, 0, "dt_launch_tool(\"" KCDATA_PATH " -s /dev/null kcdata\") should succeed");
-			if (ret == 0) {
-				int exit_status = 0, signum = 0;
-				ret = dt_waitpid(child_pid, &exit_status, &signum, 60);
-				T_QUIET; T_EXPECT_EQ(ret, 1, "dt_waitpid() on "KCDATA_PATH);
-				if (ret == 1) {
-					T_EXPECT_EQ(exit_status, 0, "kcdata.py should successfully run against our output");
-					T_QUIET; T_EXPECT_EQ(signum, 0, "kcdata.py shouldn't get a signal");
-				}
-			}
-		}
 	}
 	cb(buf, size);
 	if (compress_ok) {
@@ -340,7 +254,7 @@
 	T_QUIET; T_EXPECT_POSIX_ZERO(ret, "deallocated stackshot config");
 }
 
-T_DECL(simple_compressed, "take a simple compressed stackshot", T_META_TAG_VM_PREFERRED)
+T_DECL(simple_compressed, "take a simple compressed stackshot")
 {
 	struct scenario scenario = {
 		.name = "kcdata_compressed",
@@ -354,7 +268,7 @@
 	});
 }
 
-T_DECL(panic_compressed, "take a compressed stackshot with the same flags as a panic stackshot", T_META_TAG_VM_PREFERRED)
+T_DECL(panic_compressed, "take a compressed stackshot with the same flags as a panic stackshot")
 {
 	uint64_t stackshot_flags = (STACKSHOT_SAVE_KEXT_LOADINFO |
 			STACKSHOT_SAVE_LOADINFO |
@@ -380,7 +294,7 @@
 	});
 }
 
-T_DECL(kcdata, "test that kcdata stackshots can be taken and parsed", T_META_TAG_VM_PREFERRED)
+T_DECL(kcdata, "test that kcdata stackshots can be taken and parsed")
 {
 	struct scenario scenario = {
 		.name = "kcdata",
@@ -419,11 +333,11 @@
 		last_duration / nanosec, last_duration % nanosec);
 }
 
-T_DECL(stats, "test that stackshot stats can be read out and change when a stackshot occurs", T_META_TAG_VM_PREFERRED)
+T_DECL(stats, "test that stackshot stats can be read out and change when a stackshot occurs")
 {
 	mach_timebase_info_data_t timebase = {0, 0};
 	mach_timebase_info(&timebase);
-
+	
 	struct scenario scenario = {
 		.name = "kcdata",
 		.flags = (STACKSHOT_SAVE_LOADINFO | STACKSHOT_KCDATA_FORMAT),
@@ -460,7 +374,7 @@
 	T_EXPECT_LT(post.ss_last_start, post.ss_last_end, "post: stackshot should take time");
 }
 
-T_DECL(kcdata_faulting, "test that kcdata stackshots while faulting can be taken and parsed", T_META_TAG_VM_PREFERRED)
+T_DECL(kcdata_faulting, "test that kcdata stackshots while faulting can be taken and parsed")
 {
 	struct scenario scenario = {
 		.name = "faulting",
@@ -475,7 +389,7 @@
 	});
 }
 
-T_DECL(bad_flags, "test a poorly-formed stackshot syscall", T_META_TAG_VM_PREFERRED)
+T_DECL(bad_flags, "test a poorly-formed stackshot syscall")
 {
 	struct scenario scenario = {
 		.flags = STACKSHOT_SAVE_IN_KERNEL_BUFFER /* not allowed from user space */,
@@ -488,7 +402,7 @@
 	});
 }
 
-T_DECL(delta, "test delta stackshots", T_META_TAG_VM_PREFERRED)
+T_DECL(delta, "test delta stackshots")
 {
 	struct scenario scenario = {
 		.name = "delta",
@@ -517,7 +431,7 @@
 	});
 }
 
-T_DECL(shared_cache_layout, "test stackshot inclusion of shared cache layout", T_META_TAG_VM_PREFERRED)
+T_DECL(shared_cache_layout, "test stackshot inclusion of shared cache layout")
 {
 	struct scenario scenario = {
 		.name = "shared_cache_layout",
@@ -542,7 +456,7 @@
 	});
 }
 
-T_DECL(stress, "test that taking stackshots for 60 seconds doesn't crash the system", T_META_TAG_VM_PREFERRED)
+T_DECL(stress, "test that taking stackshots for 60 seconds doesn't crash the system")
 {
 	uint64_t max_diff_time = 60ULL /* seconds */ * 1000000000ULL;
 	uint64_t start_time;
@@ -560,7 +474,6 @@
 				STACKSHOT_THREAD_GROUP |
 				STACKSHOT_SAVE_JETSAM_COALITIONS |
 				STACKSHOT_ASID |
-				STACKSHOT_EXCLAVES |
 				0),
 	};
 
@@ -585,7 +498,7 @@
 	printf("\n");
 }
 
-T_DECL(dispatch_queue_label, "test that kcdata stackshots contain libdispatch queue labels", T_META_TAG_VM_PREFERRED)
+T_DECL(dispatch_queue_label, "test that kcdata stackshots contain libdispatch queue labels")
 {
 	struct scenario scenario = {
 		.name = "kcdata",
@@ -651,7 +564,7 @@
 	}
 }
 
-T_DECL(shared_cache_flags, "tests stackshot's task_ss_flags for the shared cache", T_META_TAG_VM_PREFERRED)
+T_DECL(shared_cache_flags, "tests stackshot's task_ss_flags for the shared cache")
 {
 	posix_spawnattr_t		attr;
 	char *env_addr;
@@ -714,12 +627,12 @@
 		T_QUIET; T_ASSERT_EQ(!!WIFSIGNALED(status), 1, "waitpid status should be signalled");
 		T_QUIET; T_ASSERT_EQ(WTERMSIG(status), SIGKILL, "waitpid status should be SIGKILLed");
 
-		parse_stackshot(PARSE_STACKSHOT_SHAREDCACHE_FLAGS, ssbuf, sslen,
+		parse_stackshot(PARSE_STACKSHOT_SHAREDCACHE_FLAGS, ssbuf, sslen, 
 			@{sharedcache_child_pid_key: @(pid), sharedcache_child_sameaddr_key: @(child_same_addr ? 1 : 0)});
 	});
 }
 
-T_DECL(transitioning_tasks, "test that stackshot contains transitioning task info", T_META_BOOTARGS_SET("enable_proc_exit_lpexit_spin=1"), T_META_TAG_VM_PREFERRED)
+T_DECL(transitioning_tasks, "test that stackshot contains transitioning task info", T_META_BOOTARGS_SET("enable_proc_exit_lpexit_spin=1"))
 {
     int32_t sysctlValue = -1, numAttempts =0;
     char path[PATH_MAX];
@@ -744,13 +657,13 @@
     dispatch_activate(child_sig_src);
 
     T_ASSERT_POSIX_SUCCESS(sysctlbyname("debug.proc_exit_lpexit_spin_pid", NULL, NULL, &sysctlValue, sizeof(sysctlValue)), "set debug.proc_exit_lpexit_spin_pid=-1");
-
+    
     int proc_exit_spin_pos = 0 ;
-
+    
     while (0 == sysctlbyname("debug.proc_exit_lpexit_spin_pos", NULL, NULL, &proc_exit_spin_pos, sizeof(proc_exit_spin_pos))) {
-
+        
         T_LOG(" ##### Testing while spinning in proc_exit at position %d ##### ", proc_exit_spin_pos);
-
+        
         int sp_ret = posix_spawn(&pid, args[0], NULL, NULL, args, NULL);
         T_ASSERT_POSIX_ZERO(sp_ret, "spawned process '%s' with PID %d", args[0], pid);
 
@@ -763,7 +676,6 @@
 
         T_ASSERT_POSIX_SUCCESS(kill(pid, SIGUSR1), "signaled pre-exec child to exec");
 
-	/* wait for a signal from post-exec child */
         dispatch_semaphore_wait(child_ready_sem, DISPATCH_TIME_FOREVER);
 
         T_ASSERT_POSIX_SUCCESS(sysctlbyname("debug.proc_exit_lpexit_spin_pid", NULL, NULL, &pid, sizeof(pid)), "set debug.proc_exit_lpexit_spin_pid =  %d, ", pid);
@@ -799,7 +711,7 @@
             int status;
             T_ASSERT_POSIX_SUCCESS(waitpid(pid, &status, 0), "waitpid on post-exec child");
         });
-
+        
         proc_exit_spin_pos++;
     }
 
@@ -833,9 +745,7 @@
 	exit(0);
 }
 
-T_DECL(zombie, "tests a stackshot of a zombie task with a thread stuck in the kernel",
-	T_META_ENABLED(false), /* test is too flaky to run by default, but transitioning_tasks covers this case as well */
-	T_META_TAG_VM_PREFERRED)
+T_DECL(zombie, "tests a stackshot of a zombie task with a thread stuck in the kernel")
 {
 	char path[PATH_MAX];
 	uint32_t path_size = sizeof(path);
@@ -922,25 +832,25 @@
 {
 	dispatch_queue_t signal_processing_q = dispatch_queue_create("signal processing queue", NULL);
 	T_QUIET; T_ASSERT_NOTNULL(signal_processing_q, "signal processing queue");
-
+	
 	signal(SIGUSR1, SIG_IGN);
 	dispatch_source_t parent_sig_src = dispatch_source_create(DISPATCH_SOURCE_TYPE_SIGNAL, SIGUSR1, 0, signal_processing_q);
 	T_QUIET; T_ASSERT_NOTNULL(parent_sig_src, "dispatch_source_create (child_sig_src)");
 	dispatch_source_set_event_handler(parent_sig_src, ^{
-
+		
 		// Parent took a timestamp then signaled us: exec into the next process
-
+		
 		char path[PATH_MAX];
 		uint32_t path_size = sizeof(path);
 		T_QUIET; T_ASSERT_POSIX_ZERO(_NSGetExecutablePath(path, &path_size), "_NSGetExecutablePath");
 		char *args[] = { path, "-n", "exec_child_postexec", NULL };
-
+		
 		T_QUIET; T_ASSERT_POSIX_ZERO(execve(args[0], args, NULL), "execing into exec_child_postexec");
 	});
 	dispatch_activate(parent_sig_src);
-
+	
 	T_ASSERT_POSIX_SUCCESS(kill(getppid(), SIGUSR1), "signaled parent to take timestamp");
-
+	
 	sleep(100);
 	// Should never get here
 	T_FAIL("Received signal to exec from parent");
@@ -954,51 +864,51 @@
 	T_FAIL("Killed by parent");
 }
 
-T_DECL(exec, "test getting full task snapshots for a task that execs", T_META_TAG_VM_PREFERRED)
+T_DECL(exec, "test getting full task snapshots for a task that execs")
 {
 	char path[PATH_MAX];
 	uint32_t path_size = sizeof(path);
 	T_QUIET; T_ASSERT_POSIX_ZERO(_NSGetExecutablePath(path, &path_size), "_NSGetExecutablePath");
 	char *args[] = { path, "-n", "exec_child_preexec", NULL };
-
+	
 	dispatch_source_t child_sig_src;
 	dispatch_semaphore_t child_ready_sem = dispatch_semaphore_create(0);
 	T_QUIET; T_ASSERT_NOTNULL(child_ready_sem, "exec child semaphore");
-
+	
 	dispatch_queue_t signal_processing_q = dispatch_queue_create("signal processing queue", NULL);
 	T_QUIET; T_ASSERT_NOTNULL(signal_processing_q, "signal processing queue");
-
+	
 	pid_t pid;
-
+	
 	T_LOG("spawning a child");
-
+	
 	signal(SIGUSR1, SIG_IGN);
 	child_sig_src = dispatch_source_create(DISPATCH_SOURCE_TYPE_SIGNAL, SIGUSR1, 0, signal_processing_q);
 	T_QUIET; T_ASSERT_NOTNULL(child_sig_src, "dispatch_source_create (child_sig_src)");
-
+	
 	dispatch_source_set_event_handler(child_sig_src, ^{ dispatch_semaphore_signal(child_ready_sem); });
 	dispatch_activate(child_sig_src);
-
+	
 	int sp_ret = posix_spawn(&pid, args[0], NULL, NULL, args, NULL);
 	T_QUIET; T_ASSERT_POSIX_ZERO(sp_ret, "spawned process '%s' with PID %d", args[0], pid);
-
+	
 	dispatch_semaphore_wait(child_ready_sem, DISPATCH_TIME_FOREVER);
 	uint64_t start_time = mach_absolute_time();
-
+	
 	struct proc_uniqidentifierinfo proc_info_data = { };
 	int retval = proc_pidinfo(getpid(), PROC_PIDUNIQIDENTIFIERINFO, 0, &proc_info_data, sizeof(proc_info_data));
 	T_QUIET; T_EXPECT_POSIX_SUCCESS(retval, "proc_pidinfo PROC_PIDUNIQIDENTIFIERINFO");
 	T_QUIET; T_ASSERT_EQ_INT(retval, (int) sizeof(proc_info_data), "proc_pidinfo PROC_PIDUNIQIDENTIFIERINFO returned data");
 	uint64_t unique_pid = proc_info_data.p_uniqueid;
-
+	
 	T_LOG("received signal from pre-exec child, unique_pid is %llu, timestamp is %llu", unique_pid, start_time);
-
+	
 	T_ASSERT_POSIX_SUCCESS(kill(pid, SIGUSR1), "signaled pre-exec child to exec");
-
+	
 	dispatch_semaphore_wait(child_ready_sem, DISPATCH_TIME_FOREVER);
-
+	
 	T_LOG("received signal from post-exec child, capturing stackshot");
-
+	
 	struct scenario scenario = {
 		.name = "exec",
 		.flags = (STACKSHOT_SAVE_LOADINFO | STACKSHOT_GET_GLOBAL_MEM_STATS
@@ -1006,22 +916,18 @@
 				  | STACKSHOT_COLLECT_DELTA_SNAPSHOT),
 		.since_timestamp = start_time
 	};
-
+	
 	take_stackshot(&scenario, false, ^( void *ssbuf, size_t sslen) {
 		// Kill the child
 		int status;
 		T_ASSERT_POSIX_SUCCESS(kill(pid, SIGKILL), "kill post-exec child %d", pid);
 		T_ASSERT_POSIX_SUCCESS(waitpid(pid, &status, 0), "waitpid on post-exec child");
-
+		
 		parse_stackshot(PARSE_STACKSHOT_POSTEXEC | PARSE_STACKSHOT_DELTA, ssbuf, sslen, @{postexec_child_unique_pid_key: @(unique_pid)});
 	});
 }
 
-T_DECL(
-	exec_inprogress,
-	"test stackshots of processes in the middle of exec",
-	T_META_ENABLED(false), /* rdar://111691318 */
-	T_META_TAG_VM_PREFERRED)
+T_DECL(exec_inprogress, "test stackshots of processes in the middle of exec")
 {
 	pid_t pid;
 	/* a BASH quine which execs itself as long as the parent doesn't exit */
@@ -1046,7 +952,7 @@
 	for (tries = 0; !found && tries < tries_limit; tries++) {
 		take_stackshot(&scenario, false,
 		    ^( void *ssbuf, size_t sslen) {
-			parse_stackshot(PARSE_STACKSHOT_EXEC_INPROGRESS | PARSE_STACKSHOT_TARGETPID,
+			parse_stackshot(PARSE_STACKSHOT_EXEC_INPROGRESS,
 			    ssbuf, sslen, @{
 				exec_inprogress_pid_key: @(pid),
 				exec_inprogress_found_key: ^(uint64_t id1, uint64_t id2) { found = true; cid1 = id1; cid2 = id2; }});
@@ -1142,7 +1048,7 @@
 	return NULL;
 }
 
-T_DECL(asyncstack, "test swift async stack entries", T_META_TAG_VM_PREFERRED)
+T_DECL(asyncstack, "test swift async stack entries")
 {
 	struct scenario scenario = {
 		.name = "asyncstack",
@@ -1173,7 +1079,7 @@
 	T_QUIET; T_ASSERT_POSIX_ZERO(pthread_join(pthread, NULL), "wait for thread");
 
 }
-#endif /* #ifdef _LP64 */
+#endif
 
 static uint32_t
 get_user_promotion_basepri(void)
@@ -1205,7 +1111,7 @@
 }
 
 
-T_DECL(turnstile_singlehop, "turnstile single hop test", T_META_TAG_VM_PREFERRED)
+T_DECL(turnstile_singlehop, "turnstile single hop test")
 {
 	dispatch_queue_t dq1, dq2;
 	dispatch_semaphore_t sema_x;
@@ -1251,7 +1157,7 @@
 		pthread_mutex_lock(lockbp);
 	});
 	dispatch_semaphore_wait(sema_x, DISPATCH_TIME_FOREVER);
-
+	
 	T_LOG("Async2 completed");
 
 	while (1) {
@@ -1332,7 +1238,7 @@
 	}
 }
 
-T_DECL(instrs_cycles, "test a getting instructions and cycles in stackshot", T_META_TAG_VM_PREFERRED)
+T_DECL(instrs_cycles, "test a getting instructions and cycles in stackshot")
 {
 	skip_if_monotonic_unsupported();
 
@@ -1350,7 +1256,7 @@
 }
 
 T_DECL(delta_instrs_cycles,
-		"test delta stackshots with instructions and cycles", T_META_TAG_VM_PREFERRED)
+		"test delta stackshots with instructions and cycles")
 {
 	skip_if_monotonic_unsupported();
 
@@ -1396,7 +1302,7 @@
 		T_SKIP("thread groups not supported on this system");
 }
 
-T_DECL(thread_groups, "test getting thread groups in stackshot", T_META_TAG_VM_PREFERRED)
+T_DECL(thread_groups, "test getting thread groups in stackshot")
 {
 	check_thread_groups_supported();
 
@@ -1412,7 +1318,7 @@
 	});
 }
 
-T_DECL(compactinfo, "test compactinfo inclusion", T_META_TAG_VM_PREFERRED)
+T_DECL(compactinfo, "test compactinfo inclusion")
 {
 	struct scenario scenario = {
 		.name = "compactinfo",
@@ -1423,22 +1329,9 @@
 
 	T_LOG("attempting to take stackshot with compactinfo flag");
 	take_stackshot(&scenario, false, ^(void *ssbuf, size_t sslen) {
-		parse_stackshot(PARSE_STACKSHOT_COMPACTINFO | PARSE_STACKSHOT_TARGETPID, ssbuf, sslen, nil);
-	});
-}
-
-T_DECL(suspendinfo, "test task suspend info inclusion", T_META_TAG_VM_PREFERRED)
-{
-	struct scenario scenario = {
-		.name = "suspendinfo",
-		.target_pid = getpid(),
-		.flags = (STACKSHOT_SAVE_LOADINFO | STACKSHOT_KCDATA_FORMAT),
-	};
-
-	T_LOG("attempting to take stackshot with suspendinfo flag");
-	take_stackshot(&scenario, false, ^(void *ssbuf, size_t sslen) {
-		parse_stackshot(PARSE_STACKSHOT_SUSPENDINFO | PARSE_STACKSHOT_TARGETPID, ssbuf, sslen, nil);
-	});
+		parse_stackshot(PARSE_STACKSHOT_COMPACTINFO, ssbuf, sslen, nil);
+	});
+	
 }
 
 static NSMutableSet * find_driverkit_pids(io_registry_entry_t root) {
@@ -1475,12 +1368,12 @@
 		}
 		IOObjectRelease(current);
 	}
-
+	
 	IOObjectRelease(iter);
 	return driverkit_pids;
 }
 
-T_DECL(driverkit, "test driverkit inclusion", T_META_TAG_VM_PREFERRED)
+T_DECL(driverkit, "test driverkit inclusion")
 {
 	struct scenario scenario = {
 		.name = "driverkit",
@@ -1488,7 +1381,7 @@
 		.flags = (STACKSHOT_SAVE_LOADINFO | STACKSHOT_KCDATA_FORMAT
 			    | STACKSHOT_INCLUDE_DRIVER_THREADS_IN_KERNEL),
 	};
-
+	
 	io_registry_entry_t root = IORegistryGetRootEntry(kIOMainPortDefault);
 	NSMutableSet * driverkit_pids = find_driverkit_pids(root);
 	IOObjectRelease(root);
@@ -1496,7 +1389,7 @@
 	T_LOG("expecting to find %lu driverkit processes", [driverkit_pids count]);
 	T_LOG("attempting to take stackshot with STACKSHOT_INCLUDE_DRIVER_THREADS_IN_KERNEL flag");
 	take_stackshot(&scenario, false, ^(void *ssbuf, size_t sslen) {
-		parse_stackshot(PARSE_STACKSHOT_DRIVERKIT | PARSE_STACKSHOT_TARGETPID, ssbuf, sslen, @{
+		parse_stackshot(PARSE_STACKSHOT_DRIVERKIT, ssbuf, sslen, @{
 			driverkit_found_key: ^(pid_t pid) {
 				[driverkit_pids removeObject:[NSNumber numberWithInt:pid]];
 		}});
@@ -1510,9 +1403,6 @@
 {
 	bool seen_asid = false;
 	bool seen_page_table_snapshot = false;
-	bool seen_task = false;
-	int container = 0;
-	int task_container = -1;
 	kcdata_iter_t iter = kcdata_iter(ssbuf, sslen);
 	T_ASSERT_EQ(kcdata_iter_type(iter), KCDATA_BUFFER_BEGIN_STACKSHOT,
 			"buffer provided is a stackshot");
@@ -1520,26 +1410,6 @@
 	iter = kcdata_iter_next(iter);
 	KCDATA_ITER_FOREACH(iter) {
 		switch (kcdata_iter_type(iter)) {
-		/* There's a slight chance that we see a transit version of this task
-		 * in the stackshot, so we want to make sure to check both */
-		case KCDATA_TYPE_CONTAINER_BEGIN: {
-			container++;
-			if (kcdata_iter_container_type(iter) == STACKSHOT_KCCONTAINER_TASK) {
-				seen_asid = seen_page_table_snapshot = false;
-				task_container = container;
-			}
-			break;
-		}
-		case KCDATA_TYPE_CONTAINER_END: {
-			if (container == task_container) {
-				task_container = -1;
-				seen_task = true;
-				T_ASSERT_TRUE(seen_page_table_snapshot, "check that we have seen a page table snapshot");
-				T_ASSERT_TRUE(seen_asid, "check that we have seen an ASID");
-			}
-			container--;
-			break;
-		}
 		case KCDATA_TYPE_ARRAY: {
 			T_QUIET;
 			T_ASSERT_TRUE(kcdata_iter_array_valid(iter),
@@ -1590,7 +1460,7 @@
 				j += (4 + num_entries);
 			}
 			T_ASSERT_TRUE(nonzero_tte, "check that we saw at least one non-empty TTE");
-			T_ASSERT_EQ(j, elem_count, "check that page table dump size matches extent of last header");
+			T_ASSERT_EQ(j, elem_count, "check that page table dump size matches extent of last header"); 
 			break;
 		}
 		case STACKSHOT_KCTYPE_ASID: {
@@ -1599,11 +1469,11 @@
 		}
 		}
 	}
-
-	T_QUIET; T_ASSERT_TRUE(seen_task, "check that we have seen a complete task container");
-}
-
-T_DECL(dump_page_tables, "test stackshot page table dumping support", T_META_TAG_VM_PREFERRED)
+	T_ASSERT_TRUE(seen_page_table_snapshot, "check that we have seen a page table snapshot");
+	T_ASSERT_TRUE(seen_asid, "check that we have seen an ASID");
+}
+
+T_DECL(dump_page_tables, "test stackshot page table dumping support")
 {
 	struct scenario scenario = {
 		.name = "asid-page-tables",
@@ -1619,8 +1489,6 @@
 		parse_page_table_asid_stackshot(ssbuf, sslen);
 	});
 }
-
-
 
 static void stackshot_verify_current_proc_uuid_info(void **ssbuf, size_t sslen, uint64_t expected_offset, const struct proc_uniqidentifierinfo *proc_info_data)
 {
@@ -1658,10 +1526,7 @@
 	T_FAIL("failed to find matching UUID in stackshot data");
 }
 
-T_DECL(translated,
-    "tests translated bit is set correctly",
-    T_META_TAG_VM_PREFERRED,
-    T_META_ENABLED(false /* rdar://133956022 */))
+T_DECL(translated, "tests translated bit is set correctly")
 {
 #if !(TARGET_OS_OSX && TARGET_CPU_ARM64)
 	T_SKIP("Only valid on Apple silicon Macs")
@@ -1675,26 +1540,26 @@
 	T_QUIET; T_ASSERT_NOTNULL(binary_name, "Find basename in path '%s'", path);
 	strlcpy(binary_name, "stackshot_translated_child", path_size - (binary_name - path));
 	char *args[] = { path, NULL };
-
+	
 	dispatch_source_t child_sig_src;
 	dispatch_semaphore_t child_ready_sem = dispatch_semaphore_create(0);
 	T_QUIET; T_ASSERT_NOTNULL(child_ready_sem, "exec child semaphore");
-
+	
 	dispatch_queue_t signal_processing_q = dispatch_queue_create("signal processing queue", NULL);
 	T_QUIET; T_ASSERT_NOTNULL(signal_processing_q, "signal processing queue");
-
+		
 	signal(SIGUSR1, SIG_IGN);
 	child_sig_src = dispatch_source_create(DISPATCH_SOURCE_TYPE_SIGNAL, SIGUSR1, 0, signal_processing_q);
 	T_QUIET; T_ASSERT_NOTNULL(child_sig_src, "dispatch_source_create (child_sig_src)");
-
+	
 	dispatch_source_set_event_handler(child_sig_src, ^{ dispatch_semaphore_signal(child_ready_sem); });
 	dispatch_activate(child_sig_src);
-
+	
 	// Spawn child
 	pid_t pid;
 	T_LOG("spawning translated child");
 	T_QUIET; T_ASSERT_POSIX_ZERO(posix_spawn(&pid, args[0], NULL, NULL, args, NULL), "spawned process '%s' with PID %d", args[0], pid);
-
+	
 	// Wait for the the child to spawn up
 	dispatch_semaphore_wait(child_ready_sem, DISPATCH_TIME_FOREVER);
 
@@ -1705,15 +1570,15 @@
 	T_QUIET; T_ASSERT_POSIX_SUCCESS(sysctl(mib, (unsigned)(sizeof(mib)/sizeof(int)), &process_info, &bufsize, NULL, 0), "get translated child process info");
 	T_QUIET; T_ASSERT_GT(bufsize, (size_t)0, "process info is not empty");
 	T_QUIET; T_ASSERT_TRUE((process_info.kp_proc.p_flag & P_TRANSLATED), "KERN_PROC_PID reports child is translated");
-
+	
 	T_LOG("capturing stackshot");
-
+	
 	struct scenario scenario = {
 		.name = "translated",
 		.flags = (STACKSHOT_SAVE_LOADINFO | STACKSHOT_GET_GLOBAL_MEM_STATS
 				  | STACKSHOT_SAVE_IMP_DONATION_PIDS | STACKSHOT_KCDATA_FORMAT),
 	};
-
+	
 	take_stackshot(&scenario, true, ^( void *ssbuf, size_t sslen) {
 		parse_stackshot(PARSE_STACKSHOT_TRANSLATED, ssbuf, sslen, @{translated_child_pid_key: @(pid)});
 	});
@@ -1725,7 +1590,7 @@
 
 }
 
-T_DECL(proc_uuid_info, "tests that the main binary UUID for a proc is always populated", T_META_TAG_VM_PREFERRED)
+T_DECL(proc_uuid_info, "tests that the main binary UUID for a proc is always populated")
 {
 	struct proc_uniqidentifierinfo proc_info_data = { };
 	mach_msg_type_number_t      count;
@@ -1777,7 +1642,7 @@
 	});
 }
 
-T_DECL(cseg_waitinfo, "test that threads stuck in the compressor report correct waitinfo", T_META_TAG_VM_PREFERRED)
+T_DECL(cseg_waitinfo, "test that threads stuck in the compressor report correct waitinfo")
 {
 	struct scenario scenario = {
 		.name = "cseg_waitinfo",
@@ -1786,27 +1651,17 @@
 	};
 	__block uint64_t thread_id = 0;
 
-	int val = 1;
-
-	dispatch_queue_t dqa = dispatch_queue_create("com.apple.stackshot.cseg_waitinfo_a", NULL);
-	dispatch_queue_t dqb = dispatch_queue_create("com.apple.stackshot.cseg_waitinfo_b", NULL);
-	dispatch_semaphore_t children_ok = dispatch_semaphore_create(0);
-
-	dispatch_async(dqa, ^{
-		dispatch_semaphore_signal(children_ok);
+	dispatch_queue_t dq = dispatch_queue_create("com.apple.stackshot.cseg_waitinfo", NULL);
+	dispatch_semaphore_t child_ok = dispatch_semaphore_create(0);
+
+	dispatch_async(dq, ^{
+		pthread_threadid_np(NULL, &thread_id);
+		dispatch_semaphore_signal(child_ok);
 		int val = 1;
 		T_ASSERT_POSIX_SUCCESS(sysctlbyname("kern.cseg_wedge_thread", NULL, NULL, &val, sizeof(val)), "wedge child thread");
 	});
 
-	dispatch_async(dqb, ^{
-		pthread_threadid_np(NULL, &thread_id);
-		dispatch_semaphore_signal(children_ok);
-		int val = 1;
-		T_ASSERT_POSIX_SUCCESS(sysctlbyname("kern.cseg_wedge_setup", NULL, NULL, &val, sizeof(val)), "setup wedge");
-	});
-
-	dispatch_semaphore_wait(children_ok, DISPATCH_TIME_FOREVER);
-	dispatch_semaphore_wait(children_ok, DISPATCH_TIME_FOREVER);
+	dispatch_semaphore_wait(child_ok, DISPATCH_TIME_FOREVER);
 	sleep(1);
 
 	T_LOG("taking stackshot");
@@ -1986,7 +1841,7 @@
  * (part 3): tests the same as part 2, but uses kevents, which allow for
  *           priority inheritance
  */
-T_DECL(special_reply_port, "test that tasks using special reply ports have correct waitinfo", T_META_TAG_VM_PREFERRED)
+T_DECL(special_reply_port, "test that tasks using special reply ports have correct waitinfo")
 {
 	dispatch_semaphore_t can_continue  = dispatch_semaphore_create(0);
 	dispatch_queue_t dq = dispatch_queue_create("signalqueue", NULL);
@@ -2095,7 +1950,7 @@
 	 */
 	sleep(1);
 
-	dispatch_mach_t dispatch_mach = dispatch_mach_create(SRP_SERVICE_NAME, machdq,
+	dispatch_mach_t dispatch_mach = dispatch_mach_create(SRP_SERVICE_NAME, machdq, 
 	    ^(dispatch_mach_reason_t reason,
 	      dispatch_mach_msg_t message,
 	      mach_error_t error __unused) {
@@ -2122,409 +1977,6 @@
 	/* cleanup - kill the client */
 	T_ASSERT_POSIX_SUCCESS(kill(client_pid, SIGKILL), "killing client");
 	T_ASSERT_POSIX_SUCCESS(waitpid(client_pid, NULL, 0), "waiting for the client to exit");
-}
-
-T_HELPER_DECL(throtlled_sp_client,
-	"client that uses a connection port to send a message to a server")
-{
-	mach_port_t conn_port, service_port, reply_port, *stash;
-	mach_msg_type_number_t stash_cnt = 0;
-
-	kern_return_t kr = mach_ports_lookup(mach_task_self(), &stash, &stash_cnt);
-	T_ASSERT_MACH_SUCCESS(kr, "mach_ports_lookup");
-
-	service_port = stash[0];
-	T_ASSERT_TRUE(MACH_PORT_VALID(service_port), "valid service port");
-	mig_deallocate((vm_address_t)stash, stash_cnt * sizeof(stash[0]));
-
-	mach_port_options_t opts = {
-		.flags = MPO_INSERT_SEND_RIGHT
-			| MPO_CONNECTION_PORT,
-		.service_port_name = service_port,
-	};
-
-	kr = mach_port_construct(mach_task_self(), &opts, 0ull, &conn_port);
-	T_QUIET; T_ASSERT_MACH_SUCCESS(kr, "mach_port_construct");
-
-	mach_port_options_t opts2 = {
-		.flags = MPO_REPLY_PORT
-	};
-	kr = mach_port_construct(mach_task_self(), &opts2, 0ull, &reply_port);
-	T_QUIET; T_ASSERT_MACH_SUCCESS(kr, "mach_port_construct");
-
-	/* XPC-like check-in message */
-	struct {
-		mach_msg_header_t header;
-		mach_msg_port_descriptor_t recvp;
-		mach_msg_port_descriptor_t sendp;
-	} checkin_message = {
-		.header =
-		{
-			.msgh_remote_port = service_port,
-			.msgh_local_port = MACH_PORT_NULL,
-			.msgh_size = sizeof(checkin_message),
-			.msgh_bits = MACH_MSGH_BITS(MACH_MSG_TYPE_COPY_SEND, 0),
-		},
-		.recvp =
-		{
-			.type = MACH_MSG_PORT_DESCRIPTOR,
-			.name = conn_port,
-			.disposition = MACH_MSG_TYPE_MOVE_RECEIVE,
-		},
-		.sendp =
-		{
-			.type = MACH_MSG_PORT_DESCRIPTOR,
-			.name = reply_port,
-			.disposition = MACH_MSG_TYPE_MAKE_SEND,
-		}
-	};
-	dispatch_mach_msg_t dmsg = dispatch_mach_msg_create((mach_msg_header_t *)&checkin_message, sizeof(checkin_message),
-		DISPATCH_MACH_MSG_DESTRUCTOR_DEFAULT, NULL);
-
-	dispatch_queue_t machdq = dispatch_queue_create("machqueue", NULL);
-	dispatch_mach_t dchannel = dispatch_mach_create(THROTTLED_SERVICE_NAME, machdq,
-		^(dispatch_mach_reason_t reason,
-	      dispatch_mach_msg_t message __unused,
-	      mach_error_t error __unused) {
-		switch (reason) {
-			case DISPATCH_MACH_CONNECTED:
-				T_LOG("mach channel connected");
-				break;
-			case DISPATCH_MACH_MESSAGE_SENT:
-				T_LOG("sent mach message");
-				break;
-			default:
-				T_ASSERT_FAIL("Unexpected reply to channel reason %lu", reason);
-		}
-	});
-	dispatch_mach_connect(dchannel, reply_port, service_port, dmsg);
-	dispatch_release(dmsg);
-
-	struct {
-		mach_msg_header_t header;
-		uint64_t request_id;
-	} request = {
-		.header =
-		{
-			.msgh_size = sizeof(request),
-			.msgh_bits = MACH_MSGH_BITS(MACH_MSG_TYPE_COPY_SEND, MACH_MSG_TYPE_MAKE_SEND_ONCE),
-		},
-		.request_id = 1,
-	};
-	dispatch_mach_msg_t dmsg2 = dispatch_mach_msg_create((mach_msg_header_t *)&request, sizeof(request),
-		DISPATCH_MACH_MSG_DESTRUCTOR_DEFAULT, NULL);
-
-	dispatch_mach_reason_t reason;
-	mach_error_t error;
-
-	/* send the check-in message and the request message */
-	dispatch_mach_msg_t dreply = dispatch_mach_send_with_result_and_wait_for_reply(dchannel,
-			dmsg2, 0, DISPATCH_MACH_SEND_DEFAULT, &reason, &error);
-	dispatch_release(dmsg2);
-
-	/* not expected to execute as parent will SIGKILL client */
-	T_ASSERT_FAIL("client process exiting after receiving %s reply", dreply ? "non-null" : "null");
-}
-
-static void
-check_throttled_sp(const char *test_name, uint64_t context, bool is_throttled)
-{
-	struct scenario scenario = {
-		.name = test_name,
-		.quiet = false,
-		.flags = (STACKSHOT_THREAD_WAITINFO | STACKSHOT_KCDATA_FORMAT),
-	};
-
-	T_LOG("taking stackshot %s", test_name);
-	take_stackshot(&scenario, false, ^(void *ssbuf, size_t sslen) {
-		parse_stackshot(PARSE_STACKSHOT_THROTTLED_SP, ssbuf, sslen,
-					@{sp_throttled_expected_ctxt_key: @(context),
-					sp_throttled_expect_flag: @(is_throttled)});
-	});
-}
-
-/* Take stackshot when a client is blocked on the service port of a process, in the scenario when
- * the process with the receive right for the service port is:
- *     (a) Monitoring the service port using kevents
- *     (b) Not monitoring the service port
- */
-T_DECL(throttled_sp,
-	"test that service port throttled flag is propagated to the stackshot correctly", T_META_TAG_VM_PREFERRED)
-{
-	mach_port_t service_port;
-	__block dispatch_semaphore_t can_continue  = dispatch_semaphore_create(0);
-
-	char path[PATH_MAX];
-	uint32_t path_size = sizeof(path);
-	T_ASSERT_POSIX_ZERO(_NSGetExecutablePath(path, &path_size), "_NSGetExecutablePath");
-	char *client_args[] = { path, "-n", "throtlled_sp_client", NULL };
-
-	__block	uint64_t thread_id = 0;
-	pid_t client_pid;
-	int mark_throttled;
-
-	struct mach_service_port_info sp_info = {};
-	strcpy(sp_info.mspi_string_name, THROTTLED_SERVICE_NAME);
-	sp_info.mspi_domain_type = (uint8_t)1;
-	kern_return_t kr;
-
-	mach_port_options_t opts = {
-		.flags = MPO_SERVICE_PORT | MPO_INSERT_SEND_RIGHT | MPO_CONTEXT_AS_GUARD | MPO_STRICT | MPO_TEMPOWNER,
-		.service_port_info = &sp_info,
-	};
-
-	kr = mach_port_construct(mach_task_self(), &opts, 0ull, &service_port);
-	T_ASSERT_MACH_SUCCESS(kr, "mach_port_construct %u", service_port);
-
-	/* Setup a dispatch source to monitor the service port similar to how launchd does. */
-	dispatch_queue_t machdq = dispatch_queue_create("machqueue", NULL);
-	dispatch_source_t mach_src = dispatch_source_create(DISPATCH_SOURCE_TYPE_MACH_RECV, service_port,
-		DISPATCH_MACH_RECV_SYNC_PEEK, machdq);
-	dispatch_source_set_event_handler(mach_src, ^{
-		pthread_threadid_np(NULL, &thread_id);
-		dispatch_semaphore_signal(can_continue);
-	});
-	dispatch_activate(mach_src);
-
-	/* Stash the port in task to make sure child also gets it */
-	kr = mach_ports_register(mach_task_self(), &service_port, 1);
-	T_QUIET; T_ASSERT_MACH_SUCCESS(kr, "mach_ports_register service port");
-
-	mark_throttled = 1;
-	kr = mach_port_set_attributes(mach_task_self(), service_port, MACH_PORT_SERVICE_THROTTLED, (mach_port_info_t)(&mark_throttled),
-	           MACH_PORT_SERVICE_THROTTLED_COUNT);
-	T_QUIET; T_ASSERT_MACH_SUCCESS(kr, "mark service port as throttled");
-
-	int rc = posix_spawn(&client_pid, client_args[0], NULL, NULL, client_args, NULL);
-	T_QUIET; T_ASSERT_POSIX_ZERO(rc, "spawned process '%s' with PID %d", client_args[0], client_pid);
-	T_LOG("Spawned client as PID %d", client_pid);
-
-	dispatch_semaphore_wait(can_continue, DISPATCH_TIME_FOREVER);
-
-	/* The service port has received the check-in message. Take stackshot for scenario (a). */
-	check_throttled_sp("throttled_service_port_monitored", thread_id, true);
-
-	/* This simulates a throttled spawn when the service port is no longer monitored. */
-	dispatch_source_cancel(mach_src);
-
-	/* Take stackshot for scenario (b) */
-	check_throttled_sp("throttled_service_port_unmonitored", (uint64_t)getpid(), true);
-
-	mark_throttled = 0;
-	kr = mach_port_set_attributes(mach_task_self(), service_port, MACH_PORT_SERVICE_THROTTLED, (mach_port_info_t)(&mark_throttled),
-	           MACH_PORT_SERVICE_THROTTLED_COUNT);
-	T_QUIET; T_ASSERT_MACH_SUCCESS(kr, "unmark service port as throttled");
-
-	/* Throttled flag should not be set when the port is not throttled. */
-	check_throttled_sp("unthrottled_service_port_unmonitored", (uint64_t)getpid(), false);
-
-	/* cleanup - kill the client */
-	T_ASSERT_POSIX_SUCCESS(kill(client_pid, SIGKILL), "killing client");
-	T_ASSERT_POSIX_SUCCESS(waitpid(client_pid, NULL, 0), "waiting for the client to exit");
-}
-
-
-char *const clpcctrl_path = "/usr/local/bin/clpcctrl";
-
-static int
-run_clpc(char *const argv[]) {
-	posix_spawnattr_t sattr;
-	pid_t pid;
-	int wstatus;
-	int ret;
-
-	T_QUIET; T_ASSERT_POSIX_ZERO(posix_spawn(&pid, argv[0], NULL, NULL, argv, NULL), "spawn clpcctrl");
-	T_QUIET; T_ASSERT_POSIX_SUCCESS(waitpid(pid, &wstatus, 0), "wait for clpcctrl");
-	T_QUIET; T_ASSERT_TRUE(WIFEXITED(wstatus), "clpcctrl exited normally");
-	ret = WEXITSTATUS(wstatus);
-
-	if (ret) {
-		return ret;
-	}
-
-	uint64_t sched_recommended_cores = 1;
-	size_t sched_recommended_cores_sz = sizeof(uint64_t);
-	T_QUIET; T_ASSERT_POSIX_SUCCESS(
-	    sysctlbyname("kern.sched_recommended_cores", &sched_recommended_cores, &sched_recommended_cores_sz, NULL, 0),
-	    "get kern.sched_recommended_cores");
-	T_LOG("Recommended cores: 0x%llx", sched_recommended_cores);
-
-	return 0;
-}
-
-static void
-restore_clpc() {
-	/* 
-	 * For some reason, the new CLPC utility always returns with a nonzero
-	 * exit status when re-enabling dynamic control. So, we use the old
-	 * one here.
-	 */
-	T_QUIET; T_ASSERT_POSIX_ZERO(run_clpc((char *const []) { clpcctrl_path, "-d", NULL }), "CLPC ran successfully");
-}
-
-void test_stackshot_cpu_info(void *ssbuf, size_t sslen, int exp_cpus, NSArray *exp_cluster_types) {
-	kcdata_iter_t iter = kcdata_iter(ssbuf, sslen);
-	bool seen_cpu = false, seen_buffer = false;
-	int singlethread_override = 0;
-	size_t singlethread_override_sz = sizeof(singlethread_override);
-	T_QUIET; T_ASSERT_POSIX_SUCCESS(
-		sysctlbyname("kern.stackshot_single_thread", &singlethread_override, &singlethread_override_sz, NULL, 0),
-		"get kern.stackshot_single_thread");
-	if (singlethread_override) {
-		T_LOG("skipping cpu count/type check due to single-thread override (kern.stackshot_single_thread=1)");
-		return;
-	}
-
-	KCDATA_ITER_FOREACH(iter) {
-		if (kcdata_iter_type(iter) != KCDATA_TYPE_ARRAY) {
-			continue;
-		}
-
-		int n_elems = kcdata_iter_array_elem_count(iter);
-
-		switch (kcdata_iter_array_elem_type(iter)) {
-			case STACKSHOT_KCTYPE_LATENCY_INFO_CPU:
-				seen_cpu = true;
-
-				/* Check ncpus */
-				if (exp_cpus != -1) {
-					T_QUIET; T_ASSERT_EQ(exp_cpus, n_elems, "Expected number of CPUs matches number of CPUs used for stackshot");
-				}
-
-				if (exp_cluster_types == nil) {
-					continue;
-				}
-
-				/* Check cluster types */
-				struct stackshot_latency_cpu *latencies = (struct stackshot_latency_cpu *) kcdata_iter_payload(iter);
-				for (int i = 0; i < n_elems; i++) {
-					NSNumber *cluster_type = [NSNumber numberWithInt:latencies[i].cluster_type];
-					T_QUIET; T_ASSERT_TRUE([exp_cluster_types containsObject:cluster_type], "Type of CPU cluster in expected CPU cluster types");
-				}
-				break;
-			case STACKSHOT_KCTYPE_LATENCY_INFO_BUFFER:
-				seen_buffer = true;
-
-				if (exp_cluster_types == nil) {
-					continue;
-				}
-
-				/* Check that we have a buffer for each cluster */
-				struct stackshot_latency_buffer *buffers = (struct stackshot_latency_buffer *) kcdata_iter_payload(iter);
-				for (int i = 0; i < n_elems; i++) {
-					if (buffers[i].size == 0) {
-						continue;
-					}
-					NSNumber *cluster_type = [NSNumber numberWithInt:buffers[i].cluster_type];
-					T_QUIET; T_ASSERT_TRUE([exp_cluster_types containsObject:cluster_type], "Type of CPU cluster for buffer in expected cluster types");
-				}
-				break;
-			default:
-				/* Not either of these, continue; */
-				break;
-		}
-	}
-
-	T_QUIET; T_ASSERT_TRUE(seen_cpu || !is_development_kernel(), "Seen CPU latency info or is release kernel");
-	T_QUIET; T_ASSERT_TRUE(seen_buffer || !is_development_kernel(), "Seen buffer info or is release kernel");
-}
-
-#define N_CLUSTER_TYPES 2
-
-T_DECL(core_masks,
-	"test that stackshot works under various core masks on ARM systems",
-	T_META_REQUIRES_SYSCTL_EQ("hw.optional.arm64", 1),
-	T_META_REQUIRES_SYSCTL_NE("kern.kasan.available", 1), /* rdar://115577993 */
-	XNU_T_META_REQUIRES_DEVELOPMENT_KERNEL,
-	T_META_REQUIRE_NOT_VIRTUALIZED,
-	T_META_RUN_CONCURRENTLY(false),
-	T_META_TAG_VM_NOT_ELIGIBLE,
-	T_META_ENABLED(!TARGET_OS_VISION)) // disable for visionOS: device may not be stable with many cores masked off (127904530)
-{
-	/*
-	 * Make sure we're not in a release kernel
-	 * (cannot check with T_META; only one sysctl T_META at a time will work)
-	 */
-	if (!is_development_kernel()) {
-		T_SKIP("test was not run because kernel is release; cannot set core masks");
-		return;
-	}
-
-	/*
-	 * rdar://115577993 - CLPC compiles as release in KASAN-variant builds,
-	 * preventing clpcctrl from working. For now, skip this. (Cannot check
-	 * with T_META; only one sysctl T_META at a time will work)
-	 */
-	int kasan_avail = 0;
-	size_t kasan_avail_sz = sizeof(kasan_avail);
-	sysctlbyname("kern.kasan.available", &kasan_avail, &kasan_avail_sz, NULL, 0);
-	if (kasan_avail) {
-		T_SKIP("test was not run because kernel is KASAN; cannot set core masks (see rdar://115577993)");
-		return;
-	}
-
-	/* Check nperflevels to see if we're on an AMP system */
-	int nperflevels = 1;
-	size_t nperflevels_sz = sizeof(int);
-	T_ASSERT_POSIX_SUCCESS(
-	    sysctlbyname("hw.nperflevels", &nperflevels, &nperflevels_sz, NULL, 0),
-	    "get hw.nperflevels");
-	if (nperflevels == 1) {
-		T_SKIP("On SMP system, skipping stackshot core_masks tests");
-	}
-
-	T_ATEND(restore_clpc);
-
-	NSMutableArray* cluster_types = [[NSMutableArray alloc] init];
-	
-	char const* scenario_names[] = {
-		"core_masks_amp_ecpus",
-		"core_masks_amp_pcpus",
-	};
-
-	char const* core_mask_names[] = {
-		"e",
-		"p",
-	};
-
-	for (int type = 0; type < N_CLUSTER_TYPES; type++) {
-		int c_ret = run_clpc((char *const[]) {clpcctrl_path, "-C", core_mask_names[type], NULL});
-		if (c_ret) {
-			T_LOG("clpcctrl for mask %s failed with %d", core_mask_names[type], c_ret);
-			continue;
-		}
-		
-		NSNumber *cluster_type_num = [NSNumber numberWithInt:(type + 1)];
-		[cluster_types addObject:cluster_type_num];
-
-		struct scenario scenario = {
-			.name = scenario_names[type],
-			.flags = (STACKSHOT_KCDATA_FORMAT | STACKSHOT_SAVE_LOADINFO |
-			STACKSHOT_THREAD_WAITINFO | STACKSHOT_GET_GLOBAL_MEM_STATS)
-		};
-
-		take_stackshot(&scenario, false, ^(void *ssbuf, size_t sslen) {
-			parse_stackshot(0, ssbuf, sslen, nil);
-			test_stackshot_cpu_info(ssbuf, sslen, -1, @[cluster_type_num]);
-		});
-	}
-
-	T_ASSERT_GE((int) [cluster_types count], 2, "at least two cluster types");
-
-	T_QUIET; T_ASSERT_POSIX_ZERO(
-			run_clpc((char *const[]) {clpcctrl_path, "-C", "all", NULL}),
-			"clpcctrl all CPUs");
-
-	struct scenario scenario = {
-		.name = "core_masks_amp_allcpus",
-		.flags = (STACKSHOT_KCDATA_FORMAT | STACKSHOT_SAVE_LOADINFO |
-		STACKSHOT_THREAD_WAITINFO | STACKSHOT_GET_GLOBAL_MEM_STATS)
-	};
-
-	take_stackshot(&scenario, false, ^(void *ssbuf, size_t sslen) {
-		parse_stackshot(0, ssbuf, sslen, nil);
-		test_stackshot_cpu_info(ssbuf, sslen, -1, cluster_types);
-	});
 }
 
 #pragma mark performance tests
@@ -2641,7 +2093,7 @@
 }
 
 
-T_DECL(flag_perf, "test stackshot performance with different flags set", T_META_TAG_PERF, T_META_TAG_VM_NOT_ELIGIBLE)
+T_DECL(flag_perf, "test stackshot performance with different flags set", T_META_TAG_PERF)
 {
 	stackshot_flag_perf_noclobber(STACKSHOT_NO_IO_STATS, "baseline");
 	stackshot_flag_perf_noclobber(0, "io_stats");
@@ -2659,50 +2111,39 @@
 	stackshot_flag_perf(STACKSHOT_SAVE_JETSAM_COALITIONS, "save_jetsam_coalitions");
 	stackshot_flag_perf(STACKSHOT_INSTRS_CYCLES, "instrs_cycles");
 	stackshot_flag_perf(STACKSHOT_ASID, "asid");
-	stackshot_flag_perf(STACKSHOT_EXCLAVES, "all_exclaves");
-	stackshot_flag_perf(STACKSHOT_EXCLAVES | STACKSHOT_ASID, "all_exclaves_and_asid");
-	stackshot_flag_perf(STACKSHOT_SKIP_EXCLAVES, "skip_exclaves");
 }
 
 T_DECL(perf_no_size_hint, "test stackshot performance with no size hint",
-		T_META_TAG_PERF, T_META_TAG_VM_NOT_ELIGIBLE)
+		T_META_TAG_PERF)
 {
 	stackshot_perf(0);
 }
 
 T_DECL(perf_size_hint, "test stackshot performance with size hint",
-		T_META_TAG_PERF, T_META_TAG_VM_NOT_ELIGIBLE)
+		T_META_TAG_PERF)
 {
 	stackshot_perf(SHOULD_REUSE_SIZE_HINT);
 }
 
 T_DECL(perf_process, "test stackshot performance targeted at process",
-		T_META_TAG_PERF, T_META_TAG_VM_NOT_ELIGIBLE)
+		T_META_TAG_PERF)
 {
 	stackshot_perf(SHOULD_REUSE_SIZE_HINT | SHOULD_TARGET_SELF);
 }
 
 T_DECL(perf_delta, "test delta stackshot performance",
-		T_META_TAG_PERF, T_META_TAG_VM_NOT_ELIGIBLE)
+		T_META_TAG_PERF)
 {
 	stackshot_perf(SHOULD_REUSE_SIZE_HINT | SHOULD_USE_DELTA);
 }
 
-T_DECL(perf_delta_no_exclaves, "test delta stackshot performance without Exclaves",
-	    T_META_REQUIRES_SYSCTL_EQ("kern.exclaves_status", 1),
-		T_META_REQUIRES_SYSCTL_EQ("kern.exclaves_inspection_status", 1),
-		T_META_TAG_PERF, T_META_TAG_VM_NOT_ELIGIBLE)
-{
-	stackshot_perf(SHOULD_REUSE_SIZE_HINT | SHOULD_USE_DELTA | STACKSHOT_SKIP_EXCLAVES);
-}
-
 T_DECL(perf_delta_process, "test delta stackshot performance targeted at a process",
-		T_META_TAG_PERF, T_META_TAG_VM_NOT_ELIGIBLE)
+		T_META_TAG_PERF)
 {
 	stackshot_perf(SHOULD_REUSE_SIZE_HINT | SHOULD_USE_DELTA | SHOULD_TARGET_SELF);
 }
 
-T_DECL(stackshot_entitlement_report_test, "test stackshot entitlement report", T_META_TAG_VM_PREFERRED)
+T_DECL(stackshot_entitlement_report_test, "test stackshot entitlement report")
 {
 	int sysctlValue = 1;
 	T_ASSERT_POSIX_SUCCESS(
@@ -2711,43 +2152,6 @@
 	// having a way to verify that the coreanalytics event was received would be even better
 	// See rdar://74197197
 	T_PASS("entitlement test ran");
-}
-
-static void
-expect_os_build_version_in_stackshot(void *ssbuf, size_t sslen)
-{
-	kcdata_iter_t iter = kcdata_iter(ssbuf, sslen);
-
-	bool saw_os_build_version = false;
-	iter = kcdata_iter_next(iter);
-
-	KCDATA_ITER_FOREACH(iter) {
-		switch (kcdata_iter_type(iter)) {
-		case STACKSHOT_KCTYPE_OS_BUILD_VERSION:
-			saw_os_build_version = true;
-			T_LOG("Found os build version in stackshot: %s", kcdata_iter_payload(iter));
-			return;
-
-		default:
-			break;
-		}
-	}
-
-	T_ASSERT_FAIL("didn't see os build version in stackshot");
-}
-
-T_DECL(os_build_version, "test stackshot contains os build version", T_META_TAG_VM_PREFERRED)
-{
-
-	struct scenario scenario = {
-		.name = "os-build-version",
-		.flags = (STACKSHOT_SAVE_LOADINFO | STACKSHOT_KCDATA_FORMAT),
-	};
-
-	T_LOG("attempting to take stackshot with an os build version");
-	take_stackshot(&scenario, false, ^(void *ssbuf, size_t sslen) {
-		expect_os_build_version_in_stackshot(ssbuf, sslen);
-	});
 }
 
 static uint64_t
@@ -2899,25 +2303,20 @@
 	bool expect_dispatch_queue_label = (stackshot_parsing_flags & PARSE_STACKSHOT_DISPATCH_QUEUE_LABEL);
 	bool expect_turnstile_lock = (stackshot_parsing_flags & PARSE_STACKSHOT_TURNSTILEINFO);
 	bool expect_srp_waitinfo = (stackshot_parsing_flags & PARSE_STACKSHOT_WAITINFO_SRP);
-	bool expect_sp_throttled = (stackshot_parsing_flags & PARSE_STACKSHOT_THROTTLED_SP);
 	bool expect_exec_inprogress = (stackshot_parsing_flags & PARSE_STACKSHOT_EXEC_INPROGRESS);
 	bool expect_transitioning_task = (stackshot_parsing_flags & PARSE_STACKSHOT_TRANSITIONING);
 	bool expect_asyncstack = (stackshot_parsing_flags & PARSE_STACKSHOT_ASYNCSTACK);
 	bool expect_driverkit = (stackshot_parsing_flags & PARSE_STACKSHOT_DRIVERKIT);
-	bool expect_suspendinfo = (stackshot_parsing_flags & PARSE_STACKSHOT_SUSPENDINFO);
 	bool found_zombie_child = false, found_postexec_child = false, found_shared_cache_layout = false, found_shared_cache_uuid = false;
 	bool found_translated_child = false, found_transitioning_task = false;
 	bool found_dispatch_queue_label = false, found_turnstile_lock = false;
 	bool found_cseg_waitinfo = false, found_srp_waitinfo = false;
 	bool found_sharedcache_child = false, found_sharedcache_badflags = false, found_sharedcache_self = false;
 	bool found_asyncstack = false;
-	bool found_throttled_service = false;
-	bool found_exclaves = false;
-	bool expect_single_task = (stackshot_parsing_flags & PARSE_STACKSHOT_TARGETPID);
 	uint64_t srp_expected_threadid = 0;
-	pid_t zombie_child_pid = -1, srp_expected_pid = -1, sharedcache_child_pid = -1, throttled_service_ctx = -1;
+	pid_t zombie_child_pid = -1, srp_expected_pid = -1, sharedcache_child_pid = -1;
 	pid_t translated_child_pid = -1, transistioning_task_pid = -1;
-	bool sharedcache_child_sameaddr = false, is_throttled = false;
+	bool sharedcache_child_sameaddr = false;
 	uint64_t postexec_child_unique_pid = 0, cseg_expected_threadid = 0;
 	uint64_t sharedcache_child_flags = 0, sharedcache_self_flags = 0;
 	uint64_t asyncstack_threadid = 0;
@@ -2929,8 +2328,6 @@
 	uint64_t exec_inprogress_containerid = 0;
 	void (^driverkit_cb)(pid_t) = NULL;
 	NSMutableDictionary *sharedCaches = [NSMutableDictionary new];
-	uint64_t expected_num_threads = 0, expected_num_tasks = 0, found_percpu_threads = 0, found_tasks = 0, found_percpu_tasks = 0;
-	NSMutableSet *seen_tasks = [NSMutableSet new];
 
 	if (expect_shared_cache_uuid) {
 		uuid_t shared_cache_uuid;
@@ -2965,13 +2362,13 @@
 		T_QUIET; T_ASSERT_GE([sameaddr_num intValue], 0, "sharedcache child sameaddr is boolean (0 or 1)");
 		T_QUIET; T_ASSERT_LE([sameaddr_num intValue], 1, "sharedcache child sameaddr is boolean (0 or 1)");
 	}
-
+    
     if (expect_transitioning_task) {
         NSNumber* pid_num = extra[transitioning_pid_key];
         T_ASSERT_NOTNULL(pid_num, "transitioning task pid provided");
         transistioning_task_pid = [pid_num intValue];
     }
-
+    
 	if (expect_zombie_child) {
 		NSNumber* pid_num = extra[zombie_child_pid_key];
 		T_QUIET; T_ASSERT_NOTNULL(pid_num, "zombie child pid provided");
@@ -3006,19 +2403,6 @@
 			T_QUIET; T_ASSERT_GT(srp_expected_pid, 0, "srp_expected_pid greater than zero");
 		}
 		T_LOG("looking for SRP pid: %d threadid: %llu", srp_expected_pid, srp_expected_threadid);
-	}
-
-	if (expect_sp_throttled) {
-		NSNumber* ctx = extra[sp_throttled_expected_ctxt_key];
-		T_QUIET; T_ASSERT_TRUE(ctx != nil, "expected pid");
-		throttled_service_ctx = [ctx intValue];
-		T_QUIET; T_ASSERT_GT(throttled_service_ctx, 0, "expected pid greater than zero");
-
-		NSNumber *throttled = extra[sp_throttled_expect_flag];
-		T_QUIET; T_ASSERT_TRUE(throttled != nil, "expected flag value");
-		is_throttled = ([throttled intValue] != 0);
-
-		T_LOG("Looking for service with ctxt: %d, thottled:%d", throttled_service_ctx, is_throttled);
 	}
 
 	if (expect_translated_child) {
@@ -3111,7 +2495,7 @@
 			inflateEnd(&zs);
 
 			T_ASSERT_EQ((uint64_t)zs.total_out, totalin, "expected number of bytes inflated");
-
+			
 			/* copy the data after the compressed area */
 			T_QUIET; T_ASSERT_GE((void *)bufferBase, ssbuf,
 					"base of compressed stackshot is after the returned stackshot buffer");
@@ -3152,6 +2536,7 @@
 
 			break;
 		}
+
 		case KCDATA_TYPE_CONTAINER_BEGIN: {
 			T_QUIET;
 			T_ASSERT_TRUE(kcdata_iter_container_valid(iter),
@@ -3169,44 +2554,22 @@
 				break;
 			}
 
-			if (container_type == STACKSHOT_KCCONTAINER_EXCLAVES) {
-				found_exclaves = true;
-				break;
-			}
-
 			/*
 			 * treat containers other than tasks/transitioning_tasks
 			 * as expanded in-line.
 			 */
 			if (container_type != STACKSHOT_KCCONTAINER_TASK &&
 			    container_type != STACKSHOT_KCCONTAINER_TRANSITIONING_TASK) {
-				T_LOG("container skipped: %d", container_type);
 				break;
 			}
 			NSDictionary *container = parseKCDataContainer(&iter, &error);
 			T_QUIET; T_ASSERT_NOTNULL(container, "parsed task/transitioning_task container from stackshot");
 			T_QUIET; T_ASSERT_NULL(error, "error unset after parsing container");
 
-			found_tasks++;
-
 			NSDictionary* task_snapshot = container[@"task_snapshots"][@"task_snapshot"];
 			NSDictionary* task_delta_snapshot = container[@"task_snapshots"][@"task_delta_snapshot"];
 			NSDictionary* transitioning_task_snapshot = container[@"transitioning_task_snapshots"][@"transitioning_task_snapshot"];
-
-			NSNumber *task_pid = NULL;
-			if (task_snapshot) {
-				task_pid = task_snapshot[@"ts_unique_pid"];
-			} else if(task_delta_snapshot) {
-				task_pid = task_snapshot[@"tds_unique_pid"];
-			} else if(transitioning_task_snapshot) {
-				task_pid = transitioning_task_snapshot[@"tts_pid"];
-			}
-
-			if (task_pid && [seen_tasks containsObject:task_pid]) {
-				T_QUIET; T_ASSERT_FALSE([seen_tasks containsObject:task_pid], "No duplicate PIDs in stackshot");
-				[seen_tasks addObject:task_pid];
-			}
-
+            
 			/*
 			 * Having processed the container, we now only check it
 			 * if it's the correct type.
@@ -3218,7 +2581,7 @@
 			if (!expect_transitioning_task) {
 			    	T_QUIET; T_ASSERT_TRUE(!!task_snapshot != !!task_delta_snapshot, "Either task_snapshot xor task_delta_snapshot provided");
 			}
-
+            
 			if (expect_dispatch_queue_label && !found_dispatch_queue_label) {
 				for (id thread_key in container[@"task_snapshots"][@"thread_snapshots"]) {
 					NSMutableDictionary *thread = container[@"task_snapshots"][@"thread_snapshots"][thread_key];
@@ -3230,41 +2593,44 @@
 					}
 				}
 			}
-
+			
 			if (expect_transitioning_task && !found_transitioning_task) {
 				if (transitioning_task_snapshot) {
 					uint64_t the_pid = [transitioning_task_snapshot[@"tts_pid"] unsignedLongLongValue];
 					if (the_pid == (uint64_t)transistioning_task_pid) {
 					    found_transitioning_task = true;
-
 					    T_PASS("FOUND Transitioning task %llu has a transitioning task snapshot", (uint64_t) transistioning_task_pid);
 					    break;
 					}
 				}
 			}
-
+            
 			if (expect_postexec_child && !found_postexec_child) {
 				if (task_snapshot) {
 					uint64_t unique_pid = [task_snapshot[@"ts_unique_pid"] unsignedLongLongValue];
 					if (unique_pid == postexec_child_unique_pid) {
 						found_postexec_child = true;
-
+						
 						T_PASS("post-exec child %llu has a task snapshot", postexec_child_unique_pid);
-
+						
 						break;
 					}
 				}
-
+				
 				if (task_delta_snapshot) {
 					uint64_t unique_pid = [task_delta_snapshot[@"tds_unique_pid"] unsignedLongLongValue];
 					if (unique_pid == postexec_child_unique_pid) {
 						found_postexec_child = true;
-
+						
 						T_FAIL("post-exec child %llu shouldn't have a delta task snapshot", postexec_child_unique_pid);
-
+						
 						break;
 					}
 				}
+			}
+			
+			if (!task_snapshot) {
+				break;
 			}
 
 			int pid = [task_snapshot[@"ts_pid"] intValue];
@@ -3298,7 +2664,7 @@
 					T_EXPECT_EQ((uint64_t)addr, firstMapping,
 							"SlidFirstMapping should match shared_cache_range");
 
-					/*
+					/* 
 					 * check_shared_cache_uuid() will assert on failure, so if
 					 * we get here, then we have found the shared cache UUID
 					 * and it's correct
@@ -3334,9 +2700,6 @@
 						T_QUIET; T_EXPECT_NOTNULL(sharedCaches[sharedcache_id], "sharedCacheID %d should exist", [sharedcache_id intValue]);
 					}
 				} else {
-					if ((sharedregion_flags == kTaskSharedRegionOther) && (task_flags & kTaskSharedRegionInfoUnavailable)) {
-						T_LOG("kTaskSharedRegionOther does not have shared region info available.");
-					}
 					T_QUIET; T_EXPECT_NULL(sharedregion_info, "non-kTaskSharedRegionOther should have no shared_cache_dyld_load_info struct");
 					T_QUIET; T_EXPECT_NULL(sharedcache_id, "non-kTaskSharedRegionOther should have no sharedCacheID");
 				}
@@ -3344,21 +2707,19 @@
 
 			if (expect_zombie_child && (pid == zombie_child_pid)) {
 				found_zombie_child = true;
-
-				expected_num_tasks += 1;
-
+				
 				uint64_t task_flags = [task_snapshot[@"ts_ss_flags"] unsignedLongLongValue];
 				T_ASSERT_TRUE((task_flags & kTerminatedSnapshot) == kTerminatedSnapshot, "child zombie marked as terminated");
-
+				
 				continue;
 			}
-
+			
 			if (expect_translated_child && (pid == translated_child_pid)) {
 				found_translated_child = true;
-
+				
 				uint64_t task_flags = [task_snapshot[@"ts_ss_flags"] unsignedLongLongValue];
 				T_EXPECT_BITS_SET(task_flags, kTaskIsTranslated, "child marked as translated");
-
+				
 				continue;
 			}
 			if (expect_exec_inprogress && (pid == exec_inprogress_pid || pid == -exec_inprogress_pid)) {
@@ -3381,7 +2742,7 @@
 				for (id i in winfos) {
 					NSNumber *waitType = i[@"wait_type"];
 					NSNumber *owner = i[@"owner"];
-					if (waitType.intValue == kThreadWaitSleepWithInheritor &&
+					if (waitType.intValue == kThreadWaitCompressor &&
 							owner.unsignedLongValue == cseg_expected_threadid) {
 						found_cseg_waitinfo = true;
 						break;
@@ -3428,46 +2789,10 @@
 				}
 			}
 
-			if (expect_sp_throttled) {
-				NSArray *tinfos = container[@"task_snapshots"][@"thread_turnstileinfo"];
-				for (id i in tinfos) {
-					if (([i[@"turnstile_flags"] intValue] & STACKSHOT_TURNSTILE_STATUS_PORTFLAGS)
-						&& [i[@"turnstile_context"] intValue] == throttled_service_ctx) {
-						int portlabel_id = [i[@"portlabel_id"] intValue];
-						T_LOG("[pid:%d] Turnstile (flags = 0x%x, ctx = %d, portlabel_id = %d)", pid,
-							[i[@"turnstile_flags"] intValue], [i[@"turnstile_context"] intValue], portlabel_id);
-						for (id portid in container[@"task_snapshots"][@"portlabels"]) {
-							if (portlabel_id != [portid intValue]) {
-								continue;
-							}
-
-							NSMutableDictionary *portlabel = container[@"task_snapshots"][@"portlabels"][portid];
-							T_ASSERT_TRUE(portlabel != nil, "Found portlabel id: %d", [portid intValue]);
-							NSString *portlabel_name = portlabel[@"portlabel_name"];
-							T_EXPECT_TRUE(portlabel_name != nil, "Found portlabel %s", portlabel_name.UTF8String);
-							T_EXPECT_EQ_STR(portlabel_name.UTF8String, THROTTLED_SERVICE_NAME, "throttled service port name matches");
-							T_EXPECT_EQ(([portlabel[@"portlabel_flags"] intValue] & STACKSHOT_PORTLABEL_THROTTLED) != 0,
-								is_throttled, "Port %s throttled", is_throttled ? "is" : "isn't");
-							found_throttled_service = true;
-							break;
-						}
-					}
-
-					if (found_throttled_service) {
-						break;
-					}
-				}
-			}
-
-			if (expect_suspendinfo) {
-				// TODO: rdar://112563110
-			}
-
-
 			if (pid != getpid()) {
 				break;
 			}
-
+			
 			T_EXPECT_EQ_STR(current_process_name(),
 					[task_snapshot[@"ts_p_comm"] UTF8String],
 					"current process name matches in stackshot");
@@ -3492,15 +2817,6 @@
 			T_QUIET; T_ASSERT_EQ(retval, (int)sizeof(struct proc_archinfo), "proc_pidinfo call for PROC_PIDARCHINFO returned expected size");
 			T_QUIET; T_EXPECT_EQ(cputype, archinfo.p_cputype, "cpu type is correct");
 			T_QUIET; T_EXPECT_EQ(cpusubtype, archinfo.p_cpusubtype, "cpu subtype is correct");
-
-			NSDictionary * codesigning_info = container[@"task_snapshots"][@"stackshot_task_codesigning_info"];
-			T_QUIET; T_ASSERT_NOTNULL(codesigning_info[@"csflags"], "have csflags");
-			uint64_t flags = [codesigning_info[@"csflags"] unsignedLongLongValue];
-			T_QUIET; T_EXPECT_GT(flags, 0, "nonzero csflags");
-
-			T_QUIET; T_ASSERT_NOTNULL(container[@"task_snapshots"][@"jetsam_coalition"], "have jetsam coalition");
-			uint64_t jetsam_coalition = [container[@"task_snapshots"][@"jetsam_coalition"] unsignedLongLongValue];
-			T_QUIET; T_EXPECT_GT(jetsam_coalition, 0, "nonzero jetsam coalition");
 
 			bool found_main_thread = false;
 			uint64_t main_thread_id = -1ULL;
@@ -3589,31 +2905,11 @@
 			T_EXPECT_EQ((uint64_t)addr, payload->sharedCacheSlidFirstMapping,
 			    "SlidFirstMapping should match shared_cache_range");
 
-			/*
+			/* 
 			 * check_shared_cache_uuid() asserts on failure, so we must have
 			 * found the shared cache UUID to be correct.
 			 */
 			found_shared_cache_uuid = true;
-			break;
-		}
-		case KCDATA_TYPE_UINT64_DESC: {
-			char     *desc;
-			uint64_t *data;
-			uint32_t  size;
-			kcdata_iter_get_data_with_desc(iter, &desc, &data, &size);
-
-			if (strcmp(desc, "stackshot_tasks_count") == 0) {
-				expected_num_tasks = *data;
-			} else if (strcmp(desc, "stackshot_threads_count") == 0) {
-				expected_num_threads = *data;
-			}
-
-			break;
-		}
-		case STACKSHOT_KCTYPE_LATENCY_INFO_CPU: {
-			struct stackshot_latency_cpu *cpu_latency = kcdata_iter_payload(iter);
-			found_percpu_tasks += cpu_latency->tasks_processed;
-			found_percpu_threads += cpu_latency->threads_processed;
 			break;
 		}
 		}
@@ -3627,16 +2923,16 @@
 			T_QUIET; T_ASSERT_NE(sharedcache_self_flags, (uint64_t)kTaskSharedRegionNone, "sharedcache: self should have shared region");
 			if (sharedcache_self_flags == kTaskSharedRegionSystem && !sharedcache_child_sameaddr) {
 				/* If we're in the system shared region, and the child has a different address, child must have an Other shared region */
-				T_ASSERT_EQ(sharedcache_child_flags, (uint64_t)kTaskSharedRegionOther,
+				T_ASSERT_EQ(sharedcache_child_flags, (uint64_t)kTaskSharedRegionOther, 
 				    "sharedcache child should have Other shared region");
 			}
 		}
 	}
-
+    
 	if (expect_transitioning_task) {
 		T_QUIET; T_ASSERT_TRUE(found_transitioning_task, "found transitioning_task child in kcdata");
 	}
-
+    
 	if (expect_exec_inprogress) {
 		T_QUIET; T_ASSERT_GT(exec_inprogress_found, 0, "found at least 1 task for execing process");
 	}
@@ -3677,31 +2973,8 @@
 		T_QUIET; T_ASSERT_TRUE(found_srp_waitinfo, "found special reply port waitinfo");
 	}
 
-	if (expect_sp_throttled) {
-		T_QUIET; T_ASSERT_TRUE(found_throttled_service, "found the throttled service");
-	}
-
 	if (expect_asyncstack) {
 		T_QUIET; T_ASSERT_TRUE(found_asyncstack, "found async stack threadid");
-	}
-
-	if ([extra objectForKey:no_exclaves_key] != nil) {
-		T_QUIET; T_ASSERT_FALSE(found_exclaves, "did not find any Exclaves data");
-	}
-
-
-	bool check_counts = !delta && !found_transitioning_task && !expect_single_task && !expect_driverkit;
-
-	if (check_counts && (expected_num_threads != 0) && (found_percpu_threads != 0)) {
-		/* If the task counts below check out, we can be sure that the per-cpu reported thread counts are accurate. */
-		T_QUIET; T_ASSERT_EQ_ULLONG(found_percpu_threads, expected_num_threads, "number of threads reported by CPUs matches expected count");
-	}
-
-	if (check_counts && (expected_num_tasks != 0)) {
-		T_QUIET; T_ASSERT_EQ_ULLONG(found_tasks, expected_num_tasks, "number of tasks in kcdata matches expected count");
-		if (found_percpu_tasks != 0) {
-			T_QUIET; T_ASSERT_EQ_ULLONG(found_percpu_tasks, expected_num_tasks, "number of tasks reported by CPUs matches expected count");
-		}
 	}
 
 	T_ASSERT_FALSE(KCDATA_ITER_FOREACH_FAILED(iter), "successfully iterated kcdata");
@@ -3730,45 +3003,3 @@
 	T_QUIET;
 	T_ASSERT_POSIX_ZERO(ret, "set thread name to %s", TEST_THREAD_NAME);
 }
-
-T_DECL(dirty_buffer, "test that stackshot works with a dirty input buffer from kernel", T_META_TAG_VM_PREFERRED)
-{
-	const char *test_sysctl = "stackshot_dirty_buffer";
-	int64_t result;
-
-	T_LOG("running sysctl to trigger kernel-driven stackshot");
-	result = run_sysctl_test(test_sysctl, 0);
-	T_ASSERT_EQ_LLONG(result, 1, "sysctl result indicated success");
-}
-
-T_DECL(kernel_initiated, "smoke test that stackshot works with kernel-initiated stackshots", T_META_TAG_VM_PREFERRED)
-{
-	const char *test_sysctl = "stackshot_kernel_initiator";
-	int64_t result;
-	__block bool did_get_stackshot = false;
-
-	initialize_thread(); // must run before the stackshots to keep parse_stackshot happy
-
-	T_LOG("running sysctl to trigger kernel-driven stackshot type 1");
-	result = run_sysctl_test(test_sysctl, 1);
-	T_ASSERT_EQ_LLONG(result, 1, "sysctl result indicated success");
-
-	T_LOG("running sysctl to trigger kernel-driven stackshot type 2");
-	result = run_sysctl_test(test_sysctl, 2);
-	T_ASSERT_EQ_LLONG(result, 1, "sysctl result indicated success");
-
-	struct scenario scenario = {
-		.name = "from_kernel_initiated",
-		.flags = STACKSHOT_RETRIEVE_EXISTING_BUFFER,
-	};
-
-	T_LOG("attempting to fetch stored in-kernel stackshot");
-	take_stackshot(&scenario, false, ^(void *ssbuf, size_t sslen) {
-		T_ASSERT_NOTNULL(ssbuf, "non-null kernel stackshot");
-		T_ASSERT_GT(sslen, 0, "non-zero stackshot size");
-		parse_stackshot(0, ssbuf, sslen, nil);
-		did_get_stackshot = true;
-	});
-
-	T_ASSERT_TRUE(did_get_stackshot, "got stackshot from kernel type 2");
-}