Skip to content

Commit

Permalink
build: move TARGET_GPROF to config-host.mak
Browse files Browse the repository at this point in the history
TARGET_GPROF is the same for all targets, write it to
config-host.mak instead.

Reviewed-by: Alex Bennée <[email protected]>
Reviewed-by: Marc-André Lureau <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Message-id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
  • Loading branch information
bonzini committed Feb 12, 2020
1 parent fe3dada commit 4cc600d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
6 changes: 3 additions & 3 deletions bsd-user/syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ abi_long do_freebsd_syscall(void *cpu_env, int num, abi_long arg1,

switch(num) {
case TARGET_FREEBSD_NR_exit:
#ifdef TARGET_GPROF
#ifdef CONFIG_GPROF
_mcleanup();
#endif
gdb_exit(cpu_env, arg1);
Expand Down Expand Up @@ -432,7 +432,7 @@ abi_long do_netbsd_syscall(void *cpu_env, int num, abi_long arg1,

switch(num) {
case TARGET_NETBSD_NR_exit:
#ifdef TARGET_GPROF
#ifdef CONFIG_GPROF
_mcleanup();
#endif
gdb_exit(cpu_env, arg1);
Expand Down Expand Up @@ -511,7 +511,7 @@ abi_long do_openbsd_syscall(void *cpu_env, int num, abi_long arg1,

switch(num) {
case TARGET_OPENBSD_NR_exit:
#ifdef TARGET_GPROF
#ifdef CONFIG_GPROF
_mcleanup();
#endif
gdb_exit(cpu_env, arg1);
Expand Down
4 changes: 3 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -6771,6 +6771,9 @@ fi
if test "$l2tpv3" = "yes" ; then
echo "CONFIG_L2TPV3=y" >> $config_host_mak
fi
if test "$gprof" = "yes" ; then
echo "CONFIG_GPROF=y" >> $config_host_mak
fi
if test "$cap_ng" = "yes" ; then
echo "CONFIG_LIBCAP_NG=y" >> $config_host_mak
fi
Expand Down Expand Up @@ -7951,7 +7954,6 @@ alpha)
esac

if test "$gprof" = "yes" ; then
echo "TARGET_GPROF=y" >> $config_target_mak
if test "$target_linux_user" = "yes" ; then
cflags="-p $cflags"
ldflags="-p $ldflags"
Expand Down
4 changes: 2 additions & 2 deletions linux-user/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
#include "qemu/osdep.h"
#include "qemu.h"
#ifdef TARGET_GPROF
#ifdef CONFIG_GPROF
#include <sys/gmon.h>
#endif

Expand All @@ -28,7 +28,7 @@ extern void __gcov_dump(void);

void preexit_cleanup(CPUArchState *env, int code)
{
#ifdef TARGET_GPROF
#ifdef CONFIG_GPROF
_mcleanup();
#endif
#ifdef CONFIG_GCOV
Expand Down
2 changes: 1 addition & 1 deletion linux-user/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ void signal_init(void)
act.sa_flags = SA_SIGINFO;
act.sa_sigaction = host_signal_handler;
for(i = 1; i <= TARGET_NSIG; i++) {
#ifdef TARGET_GPROF
#ifdef CONFIG_GPROF
if (i == SIGPROF) {
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/check-block.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if [ "$#" -ne 0 ]; then
format_list="$@"
fi

if grep -q "TARGET_GPROF=y" *-softmmu/config-target.mak 2>/dev/null ; then
if grep -q "CONFIG_GPROF=y" config-host.mak 2>/dev/null ; then
echo "GPROF is enabled ==> Not running the qemu-iotests."
exit 0
fi
Expand Down

0 comments on commit 4cc600d

Please sign in to comment.