37 lines
1.3 KiB
Diff
37 lines
1.3 KiB
Diff
|
|
From 2f37362de1d971cc90c35405705bfa22a33f6cd8 Mon Sep 17 00:00:00 2001
|
||
|
|
From: =?UTF-8?q?J=2E=20Neusch=C3=A4fer?= <j.neuschaefer@gmx.net>
|
||
|
|
Date: Wed, 20 Nov 2024 14:20:24 -0600
|
||
|
|
Subject: [PATCH] linux-user: Print tid not pid with strace
|
||
|
|
MIME-Version: 1.0
|
||
|
|
Content-Type: text/plain; charset=UTF-8
|
||
|
|
Content-Transfer-Encoding: 8bit
|
||
|
|
|
||
|
|
This aligns with strace, and is very useful when tracing multi-threaded
|
||
|
|
programs. The result is the same in single-threaded programs.
|
||
|
|
|
||
|
|
Signed-off-by: J. Neuschäfer <j.neuschaefer@gmx.net>
|
||
|
|
Message-Id: 20241024-strace-v1-1-56c4161431cd@gmx.net
|
||
|
|
[rth: Use TaskState.ts_tid via get_task_state()]
|
||
|
|
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
|
||
|
|
Signed-off-by: Zhongrui Tang <tangzhongrui_yewu@cmss.chinamobile.com>
|
||
|
|
---
|
||
|
|
linux-user/strace.c | 2 +-
|
||
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||
|
|
|
||
|
|
diff --git a/linux-user/strace.c b/linux-user/strace.c
|
||
|
|
index cf26e55264..ac9177ebe4 100644
|
||
|
|
--- a/linux-user/strace.c
|
||
|
|
+++ b/linux-user/strace.c
|
||
|
|
@@ -4176,7 +4176,7 @@ print_syscall(CPUArchState *cpu_env, int num,
|
||
|
|
if (!f) {
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
- fprintf(f, "%d ", getpid());
|
||
|
|
+ fprintf(f, "%d ", get_task_state(env_cpu(cpu_env))->ts_tid);
|
||
|
|
|
||
|
|
for (i = 0; i < nsyscalls; i++) {
|
||
|
|
if (scnames[i].nr == num) {
|
||
|
|
--
|
||
|
|
2.41.0.windows.1
|
||
|
|
|