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: 9317079 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3FE53607D3 for ; Tue, 6 Sep 2016 14:31:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B5CD28D2E for ; Tue, 6 Sep 2016 14:31:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0017028D5D; Tue, 6 Sep 2016 14:31:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F0FC328D2E for ; Tue, 6 Sep 2016 14:31:15 +0000 (UTC) Received: from localhost ([::1]:33938 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhHP9-0008BL-05 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 06 Sep 2016 10:31:15 -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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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). #