diagnostics(diag): capture icon worker stderr and the distance-filter AIR

This commit is contained in:
rponeawa
2026-11-17 01:59:44 +08:00
Unverified
parent d8f5bfd10a
commit 950ec3cd25
2 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -426,7 +426,7 @@ static id deviceForPort(unsigned port) {
setenv("NATIVE_METAL_DUMP_INPUTS", "1", 0);
setenv("NATIVE_METAL_DUMP_DRAWS", "1:64", 0);
setenv("NATIVE_METAL_DUMP_WORDS", "32", 0);
setenv("NATIVE_METAL_DUMP_FUNCTIONS", "alpha_effect,accumulator_color,stroke_lines,plane_color,primitive_image", 0);
setenv("NATIVE_METAL_DUMP_FUNCTIONS", "filter_distance,alpha_effect,accumulator_color,stroke_lines,plane_color,primitive_image", 0);
if (fields == 5 && pass && skipFirst && skipLast >= skipFirst) {
char skip[48];snprintf(skip, sizeof skip, "%u:%u:%u", pass, skipFirst, skipLast);
setenv("NATIVE_METAL_SKIP_DRAWS", skip, 0);
+7
View File
@@ -5294,6 +5294,13 @@ extern "C" id native_bridge_metal_open(const char *loader,const char *cache,uint
if(gDeviceObject)return gDeviceObject;
gMissing=missing;gInFlight=[NSMutableSet set];
if(cache && *cache){configureShaderDiskCache(cache);gCacheRoot=cache;}
if(diagOn() && getenv("NATIVE_METAL_DUMP_CB") && !strcmp(getprogname(),"iconservicesagent") && !gCacheRoot.empty()) {
const int fd=open((gCacheRoot+"/runtime-stderr.log").c_str(),O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC|O_NOFOLLOW,0600);
if(fd>=0) {
dprintf(fd,"native-metal runtime stderr boot=%s\n",getenv("NATIVE_METAL_BOOT_SESSION")?:"unknown");
if(fd!=STDERR_FILENO){dup2(fd,STDERR_FILENO);close(fd);}
}
}
gDevice=nmb_device_open(loader,cache);
if(loader)gLoaderPath=loader;
if(diagOn() && loader) {