Skip to content

Commit

Permalink
User qemu profiling
Browse files Browse the repository at this point in the history
- Makefile.target:  re-enable profiling for user qemu.  It seems
  profiling was (accidently?) removed by commit 3937

- syscall.c:
    * add an include to get _mcleanup prototype
    * add a call to _mcleanup for exit_group in a way
      similar to what is done for exit

(Laurent Desnogues)

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5642 c046a42c-6fe2-441c-8c8c-71466251a162
  • Loading branch information
aurel32 committed Nov 6, 2008
1 parent afec112 commit 6d946cd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Makefile.target
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,12 @@ LDFLAGS+=-Wl,-T,$(SRC_PATH)/$(ARCH)el.ld
endif
endif

# profiling code
ifdef TARGET_GPROF
LDFLAGS+=-p
CFLAGS+=-p
endif

OBJS= main.o syscall.o strace.o mmap.o signal.o path.o thunk.o \
elfload.o linuxload.o uaccess.o
LIBS+= $(AIOLIBS)
Expand Down
6 changes: 6 additions & 0 deletions linux-user/syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@
#include <netinet/ip.h>
#include <netinet/tcp.h>
#include <qemu-common.h>
#ifdef HAVE_GPROF
#include <sys/gmon.h>
#endif

#define termios host_termios
#define winsize host_winsize
Expand Down Expand Up @@ -4864,6 +4867,9 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
#ifdef __NR_exit_group
/* new thread calls */
case TARGET_NR_exit_group:
#ifdef HAVE_GPROF
_mcleanup();
#endif
gdb_exit(cpu_env, arg1);
ret = get_errno(exit_group(arg1));
break;
Expand Down

0 comments on commit 6d946cd

Please sign in to comment.