Skip to content

Commit a44d57a

Browse files
pm215vivier
authored andcommitted
linux-user: Split strace prototypes into strace.h
The functions implemented in strace.c are only used in a few files in linux-user; split them out of qemu.h and into a new strace.h header which we include in the places that need it. Signed-off-by: Peter Maydell <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Reviewed-by: Richard Henderson <[email protected]> Message-Id: <[email protected]> Signed-off-by: Laurent Vivier <[email protected]>
1 parent 400b7f6 commit a44d57a

File tree

5 files changed

+42
-18
lines changed

5 files changed

+42
-18
lines changed

linux-user/qemu.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -415,24 +415,6 @@ extern long safe_syscall_base(int *pending, long number, ...);
415415
/* syscall.c */
416416
int host_to_target_waitstatus(int status);
417417

418-
/* strace.c */
419-
void print_syscall(void *cpu_env, int num,
420-
abi_long arg1, abi_long arg2, abi_long arg3,
421-
abi_long arg4, abi_long arg5, abi_long arg6);
422-
void print_syscall_ret(void *cpu_env, int num, abi_long ret,
423-
abi_long arg1, abi_long arg2, abi_long arg3,
424-
abi_long arg4, abi_long arg5, abi_long arg6);
425-
/**
426-
* print_taken_signal:
427-
* @target_signum: target signal being taken
428-
* @tinfo: target_siginfo_t which will be passed to the guest for the signal
429-
*
430-
* Print strace output indicating that this signal is being taken by the guest,
431-
* in a format similar to:
432-
* --- SIGSEGV {si_signo=SIGSEGV, si_code=SI_KERNEL, si_addr=0} ---
433-
*/
434-
void print_taken_signal(int target_signum, const target_siginfo_t *tinfo);
435-
436418
/* signal.c */
437419
void process_pending_signals(CPUArchState *cpu_env);
438420
void signal_init(void);

linux-user/signal.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <sys/resource.h>
2323

2424
#include "qemu.h"
25+
#include "strace.h"
2526
#include "trace.h"
2627
#include "signal-common.h"
2728

linux-user/strace.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "qemu/osdep.h"
2+
23
#include <sys/ipc.h>
34
#include <sys/msg.h>
45
#include <sys/sem.h>
@@ -14,6 +15,7 @@
1415
#include <linux/netlink.h>
1516
#include <sched.h>
1617
#include "qemu.h"
18+
#include "strace.h"
1719

1820
struct syscallname {
1921
int nr;

linux-user/strace.h

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* strace.h: prototypes for linux-user builtin strace handling
3+
*
4+
* This program is free software; you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation; either version 2 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with this program; if not, see <http://www.gnu.org/licenses/>.
16+
*/
17+
18+
#ifndef LINUX_USER_STRACE_H
19+
#define LINUX_USER_STRACE_H
20+
21+
void print_syscall(void *cpu_env, int num,
22+
abi_long arg1, abi_long arg2, abi_long arg3,
23+
abi_long arg4, abi_long arg5, abi_long arg6);
24+
void print_syscall_ret(void *cpu_env, int num, abi_long ret,
25+
abi_long arg1, abi_long arg2, abi_long arg3,
26+
abi_long arg4, abi_long arg5, abi_long arg6);
27+
/**
28+
* print_taken_signal:
29+
* @target_signum: target signal being taken
30+
* @tinfo: target_siginfo_t which will be passed to the guest for the signal
31+
*
32+
* Print strace output indicating that this signal is being taken by the guest,
33+
* in a format similar to:
34+
* --- SIGSEGV {si_signo=SIGSEGV, si_code=SI_KERNEL, si_addr=0} ---
35+
*/
36+
void print_taken_signal(int target_signum, const target_siginfo_t *tinfo);
37+
38+
#endif /* LINUX_USER_STRACE_H */

linux-user/syscall.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@
127127
#include "uname.h"
128128

129129
#include "qemu.h"
130+
#include "strace.h"
130131
#include "qemu/guest-random.h"
131132
#include "qemu/selfmap.h"
132133
#include "user/syscall-trace.h"

0 commit comments

Comments
 (0)