perf: Steam's web helper runs its GPU, audio and zygote work inside one process (#566)

This commit is contained in:
Kurt Himebauch authored and GitHub committed 2026-10-14 01:01:49 -04:00
1 parent 6211faf6bc
commit 3fe03c0a88
5 files changed
+151 -5

No files matched your search

+7 -3
View File
@@ -262,6 +262,7 @@ __attribute__((visibility("hidden"))) void bl_binfmt_before(const char *path, ch
__attribute__((visibility("hidden"))) int bl_binfmt_retry(const char *path, char *const argv[], char *const envp[], int error);
__attribute__((visibility("hidden"))) void bl_binfmt_before_search(const char *file, char *const argv[], char *const envp[]);
__attribute__((visibility("hidden"))) int bl_binfmt_after_search(const char *file, char *const argv[], char *const envp[], int error);
__attribute__((visibility("hidden"))) char *const *bl_webhelper_argv(const char *path, char *const argv[]);
__attribute__((visibility("hidden"))) int bl_binfmt_spawn(pid_t *pid, const char *path, const posix_spawn_file_actions_t *fa,
const posix_spawnattr_t *attr, char *const argv[], char *const envp[],
spawn_fn real);
@@ -308,7 +309,8 @@ static int maybe_answer_lsof(const char *path, char *const argv[]) {
_exit(0);
}
int execve(const char *path, char *const argv[], char *const envp[]) {
int execve(const char *path, char *const argv_in[], char *const envp[]) {
char *const *argv = bl_webhelper_argv(path, argv_in);
static int (*real)(const char *, char *const[], char *const[]);
if (!real) real = (int (*)(const char *, char *const[], char *const[]))dlsym(RTLD_NEXT, "execve");
maybe_answer_lsof(path, argv);
@@ -332,7 +334,8 @@ static int answer_lsof_via_spawn(const char *path, char *const argv[], pid_t *pi
return 0;
}
int execvp(const char *file, char *const argv[]) {
int execvp(const char *file, char *const argv_in[]) {
char *const *argv = bl_webhelper_argv(file, argv_in);
static int (*real)(const char *, char *const[]);
if (!real) real = (int (*)(const char *, char *const[]))dlsym(RTLD_NEXT, "execvp");
maybe_answer_lsof(file, argv);
@@ -341,7 +344,8 @@ int execvp(const char *file, char *const argv[]) {
return bl_binfmt_after_search(file, argv, environ, errno);
}
int execv(const char *path, char *const argv[]) {
int execv(const char *path, char *const argv_in[]) {
char *const *argv = bl_webhelper_argv(path, argv_in);
static int (*real)(const char *, char *const[]);
if (!real) real = (int (*)(const char *, char *const[]))dlsym(RTLD_NEXT, "execv");
maybe_answer_lsof(path, argv);