* [Qemu-devel] [PATCH] User qemu profiling
@ 2008-10-29 9:28 Laurent Desnogues
2008-11-06 16:16 ` Aurelien Jarno
0 siblings, 1 reply; 2+ messages in thread
From: Laurent Desnogues @ 2008-10-29 9:28 UTC (permalink / raw)
To: qemu-devel
[-- Attachment #1: Type: text/plain, Size: 383 bytes --]
Hello,
this patch:
- 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
BTW, I wonder why -p is preferred over -pg for profiling.
Thanks,
Laurent
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: user-profile.patch --]
[-- Type: text/x-patch; name=user-profile.patch, Size: 1032 bytes --]
Index: Makefile.target
===================================================================
--- Makefile.target (revision 5545)
+++ Makefile.target (working copy)
@@ -394,6 +394,12 @@
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)
Index: linux-user/syscall.c
===================================================================
--- linux-user/syscall.c (revision 5566)
+++ linux-user/syscall.c (working copy)
@@ -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
@@ -4864,6 +4867,9 @@
#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;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] User qemu profiling
2008-10-29 9:28 [Qemu-devel] [PATCH] User qemu profiling Laurent Desnogues
@ 2008-11-06 16:16 ` Aurelien Jarno
0 siblings, 0 replies; 2+ messages in thread
From: Aurelien Jarno @ 2008-11-06 16:16 UTC (permalink / raw)
To: qemu-devel
On Wed, Oct 29, 2008 at 10:28:14AM +0100, Laurent Desnogues wrote:
> Hello,
>
> this patch:
>
> - 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
>
> BTW, I wonder why -p is preferred over -pg for profiling.
>
> Thanks,
>
> Laurent
Applied, thanks
> Index: Makefile.target
> ===================================================================
> --- Makefile.target (revision 5545)
> +++ Makefile.target (working copy)
> @@ -394,6 +394,12 @@
> 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)
> Index: linux-user/syscall.c
> ===================================================================
> --- linux-user/syscall.c (revision 5566)
> +++ linux-user/syscall.c (working copy)
> @@ -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
> @@ -4864,6 +4867,9 @@
> #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;
--
.''`. Aurelien Jarno | GPG: 1024D/F1BCDB73
: :' : Debian developer | Electrical Engineer
`. `' aurel32@debian.org | aurelien@aurel32.net
`- people.debian.org/~aurel32 | www.aurel32.net
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-11-06 16:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-29 9:28 [Qemu-devel] [PATCH] User qemu profiling Laurent Desnogues
2008-11-06 16:16 ` Aurelien Jarno
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).