Received: from eggs.gnu.org ([2001:4830:134:3::10]:45093) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsZIk-0005YQ-Pp for qemu-devel@nongnu.org; Fri, 07 Oct 2016 13:51:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bsZIf-0007Tw-PV for qemu-devel@nongnu.org; Fri, 07 Oct 2016 13:51:18 -0400 Received: from roura.ac.upc.es ([147.83.33.10]:55569) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bsZIf-0007SM-DQ for qemu-devel@nongnu.org; Fri, 07 Oct 2016 13:51:13 -0400 From: =?utf-8?Q?Llu=C3=ADs_Vilanova?= References: <1475834979-4980-1-git-send-email-stefanha@redhat.com> <87y420l1ak.fsf@fimbulvetr.bsc.es> <20161007141933.GF4619@redhat.com> Date: Fri, 07 Oct 2016 19:51:10 +0200 In-Reply-To: <20161007141933.GF4619@redhat.com> (Daniel P. Berrange's message of "Fri, 7 Oct 2016 15:19:33 +0100") Message-ID: <87h98ojbe9.fsf@fimbulvetr.bsc.es> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PULL 00/20] Tracing patches List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: Peter Maydell , Stefan Hajnoczi , QEMU Developers Daniel P Berrange writes: > On Fri, Oct 07, 2016 at 03:46:27PM +0200, Llu=C3=ADs Vilanova wrote: >> Peter Maydell writes: >>=20 >> > On 7 October 2016 at 11:09, Stefan Hajnoczi wrot= e: >> >> The following changes since commit e902754e3d0890945ddcc1b33748ed7376= 2ddb8d: >> >>=20 >> >> Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.8-201610= 06' into staging (2016-10-06 13:34:00 +0100) >> >>=20 >> >> are available in the git repository at: >> >>=20 >> >> git://github.com/stefanha/qemu.git tags/tracing-pull-request >> >>=20 >> >> for you to fetch changes up to bcdc1363dcb9adb5f7ea016a4d0b41f0357c81= 82: >> >>=20 >> >> trace: Add missing execution mode of guest events (2016-10-07 09:17:4= 9 +0100) >> >>=20 >> >> ---------------------------------------------------------------- >> >>=20 >> >> ---------------------------------------------------------------- >>=20 >> > This makes all the linux-user binaries dump core on startup: >>=20 >> > $ gdb --args /home/petmay01/linaro/qemu-for-merges/build/all-linux-sta= tic/x86_64-linux-user/qemu-x86_64 >> > /bin/ls >> > (gdb) r >> > Starting program: >> > /home/petmay01/linaro/qemu-for-merges/build/all-linux-static/x86_64-li= nux-user/qemu-x86_64 >> > /bin/ls >> > [Thread debugging using libthread_db enabled] >> > Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so= .1". >> > [New Thread 0x7ffff7ffa700 (LWP 14965)] >>=20 >> > Thread 1 "qemu-x86_64" received signal SIGABRT, Aborted. >> > 0x000000006019fbe8 in raise () >> > (gdb) bt >> > #0 0x000000006019fbe8 in raise () >> > #1 0x00000000601a030a in abort () >> > #2 0x00000000600bdd02 in bitmap_new (nbits=3D0) >> > at /home/petmay01/linaro/qemu-for-merges/include/qemu/bitmap.h:99 >> > #3 0x00000000600be99f in cpu_common_initfn (obj=3D0x625f6340) >> > at /home/petmay01/linaro/qemu-for-merges/qom/cpu.c:360 >> > #4 0x00000000600bfe97 in object_init_with_type (obj=3D0x625f6340, ti= =3D0x625eb9a0) >> > at /home/petmay01/linaro/qemu-for-merges/qom/object.c:339 >> > #5 0x00000000600bfe79 in object_init_with_type (obj=3D0x625f6340, ti= =3D0x625e2d80) >> > at /home/petmay01/linaro/qemu-for-merges/qom/object.c:335 >> > #6 0x00000000600bfe79 in object_init_with_type (obj=3D0x625f6340, ti= =3D0x625e78d0) >> > at /home/petmay01/linaro/qemu-for-merges/qom/object.c:335 >> > #7 0x00000000600c00aa in object_initialize_with_type >> > (data=3D0x625f6340, size=3D38416, type=3D0x625e78d0) >> > at /home/petmay01/linaro/qemu-for-merges/qom/object.c:370 >> > #8 0x00000000600c0508 in object_new_with_type (type=3D0x625e78d0) >> > at /home/petmay01/linaro/qemu-for-merges/qom/object.c:478 >> > #9 0x00000000600c0542 in object_new (typename=3D0x625e2fe0 "qemu64-x8= 6_64-cpu") >> > at /home/petmay01/linaro/qemu-for-merges/qom/object.c:488 >> > #10 0x00000000600be03f in cpu_generic_init (typename=3D0x6025ad54 >> > "x86_64-cpu", cpu_model=3D0x60247ca5 "qemu64") >> > at /home/petmay01/linaro/qemu-for-merges/qom/cpu.c:76 >> > #11 0x0000000060089438 in cpu_x86_init (cpu_model=3D0x60247ca5 "qemu64= ") >> > at /home/petmay01/linaro/qemu-for-merges/target-i386/cpu.c:2266 >> > #12 0x0000000060031031 in main (argc=3D2, argv=3D0x7fffffffe4b8, >> > envp=3D0x7fffffffe4d0) >> > at /home/petmay01/linaro/qemu-for-merges/linux-user/main.c:4253 >>=20 >> Aha! I didn't take that abort into consideration during the review. The = fix >> should be on patch 13 of the series (trace: dynamically allocate trace_d= state in >> CPUState): >>=20 >> diff --git a/qom/cpu.c b/qom/cpu.c >> index 484c493..40f2eb1 100644 >> --- a/qom/cpu.c >> +++ b/qom/cpu.c >> @@ -356,12 +356,15 @@ static void cpu_common_initfn(Object *obj) >> qemu_mutex_init(&cpu->work_mutex); >> QTAILQ_INIT(&cpu->breakpoints); >> QTAILQ_INIT(&cpu->watchpoints); >> - bitmap_zero(cpu->trace_dstate, TRACE_VCPU_EVENT_COUNT); >> + >> + cpu->trace_dstate =3D bitmap_new(min(trace_get_vcpu_event_count(), = 1); >> } >>=20 >> static void cpu_common_finalize(Object *obj) >> { >> - cpu_exec_exit(CPU(obj)); >> + CPUState *cpu =3D CPU(obj); >> + cpu_exec_exit(cpu); >> + g_free(cpu->trace_dstate); >> } >>=20 >> static int64_t cpu_common_get_arch_id(CPUState *cpu) > No, this isn't what we want todo. The real problem is that we should > have been registering the trace events in the linux-user/bsd-user > programs. I sent a fix for that. Well, that'll work as long as we keep at least one vcpu event :) Cheers, Lluis