From patchwork Wed Dec 20 17:14:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 10126115 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 493576057F for ; Wed, 20 Dec 2017 17:34:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2862E26E49 for ; Wed, 20 Dec 2017 17:34:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1CE2C29047; Wed, 20 Dec 2017 17:34:48 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 8F6EB26E49 for ; Wed, 20 Dec 2017 17:34:47 +0000 (UTC) Received: from localhost ([::1]:60449 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRiGU-0004Cu-Oi for patchwork-qemu-devel@patchwork.kernel.org; Wed, 20 Dec 2017 12:34:46 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56523) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eRhyU-0004mU-6a for qemu-devel@nongnu.org; Wed, 20 Dec 2017 12:16:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eRhyT-0007JO-BX for qemu-devel@nongnu.org; Wed, 20 Dec 2017 12:16:10 -0500 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:39003) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eRhyT-0007J3-4e for qemu-devel@nongnu.org; Wed, 20 Dec 2017 12:16:09 -0500 Received: by mail-wm0-x244.google.com with SMTP id i11so11095992wmf.4 for ; Wed, 20 Dec 2017 09:16:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Xb3ideVOQilzPcbANaBhagw4MFAyC7x3pFpkU7CX3lE=; b=AF4KV1gnAYeK5IqLN+rdJ/roqNwi9roJj7ZCtf2kqFsugd19TkxuDd+WuGi4PJJTkM B6q5nb04n41UtZCRgAHHZdDRneTJvHY17s83hAJ5xLQLggcm67mSFss22Prp9e1YiEgO uD2gjuKENpQpkqFU9SYcKXxFOd2Nkau6ioRSeo3V61FxtPiH0lTIz53F8d9CbeICbGVp y6S2lNdk/HN448hfZSTEyoMAOTsaIk4zqdWwxJ8uxF12cZ2fTTkHTM/LF7+7St5Igtoa p2INTS6RvSHdWrOUzHuw9N1Ay9Lje3DpkY+qQOEES0hCm8ZY9JWMkUCBOUzoZb5n/dCT cWVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Xb3ideVOQilzPcbANaBhagw4MFAyC7x3pFpkU7CX3lE=; b=lKpMs0y1T9mfCdBtPFQ25nfR3qB8KTR3xdH+YjY1Xz0sqca3/16rMPWWWz5YqsC5VS zJUhgFoh6lemEEAVXJLEHieQDJneRRZejHCG2xYGtiLDvBV8K6Y2YSiBCVhuzCSe2/hP XigHuABfBIUbgQvi1ZCdivSG5pN0rWM6rVfjzkf0cj6p65iOph0VQwtqwkz5tXVuvtEr b1E1LfKF8k4R6vJM85klXQEVEtyIbHYC7sh9VbTMw25xWPPfFR7vHHDsTirG9aTJisKq botsHjLlNm6m0XZSnjKNnnX2tixkyd8DnUO/t16jUG8PRmrSqmYaIu8wrlP8o14oqXxX sKCA== X-Gm-Message-State: AKGB3mKD8mGW+RXFbiLe91XcN0D/raClRjV3vAmD4U7db7eB18BiJK7d qSWpIzJ0bn+4A7vFO3Z6f2bx8LDi X-Google-Smtp-Source: ACJfBosnJS0W4geGD4oIjmL1vJRkhQKGNzr7haqQcBTMXQtOhT3v5tXrDk8AqadOEGFx72U/pOjBJA== X-Received: by 10.28.48.4 with SMTP id w4mr7354265wmw.16.1513790167856; Wed, 20 Dec 2017 09:16:07 -0800 (PST) Received: from 640k.lan (dynamic-adsl-78-12-251-125.clienti.tiscali.it. [78.12.251.125]) by smtp.gmail.com with ESMTPSA id f125sm2751101wme.45.2017.12.20.09.16.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Dec 2017 09:16:07 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 20 Dec 2017 18:14:43 +0100 Message-Id: <1513790098-9815-32-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1513790098-9815-1-git-send-email-pbonzini@redhat.com> References: <1513790098-9815-1-git-send-email-pbonzini@redhat.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::244 Subject: [Qemu-devel] [PULL 31/46] hw/i386/vmport: replace fprintf() by trace events or LOG_UNIMP 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: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Philippe Mathieu-Daudé Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20171215034356.4449-2-f4bug@amsat.org> [Replace unknown command tracepoint with LOG_UNIMP, add generic tracepoint for vmport commands. - Paolo] Signed-off-by: Paolo Bonzini --- hw/i386/trace-events | 4 ++++ hw/i386/vmport.c | 14 +++++--------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hw/i386/trace-events b/hw/i386/trace-events index d43b4b6..22d4464 100644 --- a/hw/i386/trace-events +++ b/hw/i386/trace-events @@ -113,3 +113,7 @@ amdvi_mode_invalid(uint8_t level, uint64_t addr)"error: translation level 0x%"PR amdvi_page_fault(uint64_t addr) "error: page fault accessing guest physical address 0x%"PRIx64 amdvi_iotlb_hit(uint8_t bus, uint8_t slot, uint8_t func, uint64_t addr, uint64_t txaddr) "hit iotlb devid %02x:%02x.%x gpa 0x%"PRIx64" hpa 0x%"PRIx64 amdvi_translation_result(uint8_t bus, uint8_t slot, uint8_t func, uint64_t addr, uint64_t txaddr) "devid: %02x:%02x.%x gpa 0x%"PRIx64" hpa 0x%"PRIx64 + +# hw/i386/vmport.c +vmport_register(unsigned char command, void *func, void *opaque) "command: 0x%02x func: %p opaque: %p" +vmport_command(unsigned char command) "command: 0x%02x" diff --git a/hw/i386/vmport.c b/hw/i386/vmport.c index eb880c6..9b8c688 100644 --- a/hw/i386/vmport.c +++ b/hw/i386/vmport.c @@ -27,8 +27,7 @@ #include "hw/i386/pc.h" #include "sysemu/hw_accel.h" #include "hw/qdev.h" - -/* #define VMPORT_DEBUG */ +#include "trace.h" #define VMPORT_CMD_GETVERSION 0x0a #define VMPORT_CMD_GETRAMSIZE 0x14 @@ -54,6 +53,7 @@ void vmport_register(unsigned char command, VMPortReadFunc *func, void *opaque) return; } + trace_vmport_register(command, func, opaque); port_state->func[command] = func; port_state->opaque[command] = opaque; } @@ -76,13 +76,9 @@ static uint64_t vmport_ioport_read(void *opaque, hwaddr addr, } command = env->regs[R_ECX]; - if (command >= VMPORT_ENTRIES) { - return eax; - } - if (!s->func[command]) { -#ifdef VMPORT_DEBUG - fprintf(stderr, "vmport: unknown command %x\n", command); -#endif + trace_vmport_command(command); + if (command >= VMPORT_ENTRIES || !s->func[command]) { + qemu_log_mask(LOG_UNIMP, "vmport: unknown command %x\n", command); return eax; }