From patchwork Tue Sep 6 14:25:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Llu=C3=ADs_Vilanova?= X-Patchwork-Id: 666619 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sT8Dz4n5kz9s5g for ; Wed, 7 Sep 2016 00:32:03 +1000 (AEST) Received: from localhost ([::1]:33952 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhHPs-0001MW-Cl for incoming@patchwork.ozlabs.org; Tue, 06 Sep 2016 10:32:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47359) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhHK5-0004D5-H2 for qemu-devel@nongnu.org; Tue, 06 Sep 2016 10:26:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bhHK0-0005xZ-4E for qemu-devel@nongnu.org; Tue, 06 Sep 2016 10:26:00 -0400 Received: from roura.ac.upc.es ([147.83.33.10]:59607) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhHJz-0005x5-P8 for qemu-devel@nongnu.org; Tue, 06 Sep 2016 10:25:56 -0400 Received: from gw-3.ac.upc.es (gw-3.ac.upc.es [147.83.30.9]) by roura.ac.upc.es (8.13.8/8.13.8) with ESMTP id u86EPrk9029929; Tue, 6 Sep 2016 16:25:53 +0200 Received: from localhost (unknown [84.88.51.85]) by gw-3.ac.upc.es (Postfix) with ESMTPSA id 694DA539; Tue, 6 Sep 2016 16:25:53 +0200 (CEST) From: =?utf-8?b?TGx1w61z?= Vilanova To: qemu-devel@nongnu.org Date: Tue, 6 Sep 2016 16:25:53 +0200 Message-Id: <147317195306.24754.2911961107337506103.stgit@fimbulvetr.bsc.es> X-Mailer: git-send-email 2.9.3 User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-MIME-Autoconverted: from 8bit to quoted-printable by roura.ac.upc.es id u86EPrk9029929 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 147.83.33.10 Subject: [Qemu-devel] [PATCH 1/2] trace: Add "cpu_init" event X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Richard Henderson , Stefan Hajnoczi , Peter Crosthwaite Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signals the creation of a new virtual (guest) CPU. The event does not have the "vcpu" property because the machine creates its initial vCPUs before late trace state initialization, making the event "invisible" at system boot. Signed-off-by: LluĂ­s Vilanova --- cpus.c | 2 ++ stubs/cpus.c | 2 ++ trace-events | 8 ++++++++ 3 files changed, 12 insertions(+) diff --git a/cpus.c b/cpus.c index 84c3520..eaf4b2c 100644 --- a/cpus.c +++ b/cpus.c @@ -46,6 +46,7 @@ #include "qapi-event.h" #include "hw/nmi.h" #include "sysemu/replay.h" +#include "trace.h" #ifndef _WIN32 #include "qemu/compatfd.h" @@ -1448,6 +1449,7 @@ void qemu_init_vcpu(CPUState *cpu) } else { qemu_dummy_start_vcpu(cpu); } + trace_guest_cpu_init(cpu); } void cpu_stop_current(void) diff --git a/stubs/cpus.c b/stubs/cpus.c index e192722..a797be1 100644 --- a/stubs/cpus.c +++ b/stubs/cpus.c @@ -1,6 +1,7 @@ #include "qemu/osdep.h" #include "qemu-common.h" #include "qom/cpu.h" +#include "trace.h" void cpu_resume(CPUState *cpu) { @@ -8,4 +9,5 @@ void cpu_resume(CPUState *cpu) void qemu_init_vcpu(CPUState *cpu) { + trace_guest_cpu_init(cpu); } diff --git a/trace-events b/trace-events index 616cc52..5715826 100644 --- a/trace-events +++ b/trace-events @@ -142,6 +142,14 @@ memory_region_tb_write(int cpu_index, uint64_t addr, uint64_t value, unsigned si ### Guest events, keep at bottom + +## vCPU + +# Create a new virtual (guest) CPU +# +# Targets: all +guest_cpu_init(void *cpu) "cpu=%p" + # @vaddr: Access' virtual address. # @info : Access' information (see below). #