Received: by 2002:a19:711a:0:0:0:0:0 with SMTP id m26csp485432lfc; Thu, 28 May 2020 05:40:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxaskNblZ4jWhO5w8pNbaMwa05Ep61EvTB9SMfAAuG/D5Y2tTnb6LylQX6qNSbsyLhMm42K X-Received: by 2002:a25:1f57:: with SMTP id f84mr4897131ybf.336.1590669612866; Thu, 28 May 2020 05:40:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590669612; cv=none; d=google.com; s=arc-20160816; b=Auf1vJTQoLNCZB3yLZbi0EkxktRlaSwdrK0Ms6Q/Go7CEsUn8xnl9eJYjAocc0EaeU Ub8HVIa8pqBwXOe5+my9rz1kmOCsSZ/lKtLqqr9YgCT52em8F0K5xLzw5A/h9oQENXbB OWiZzvqPOyxAjc8kVSBbwqui51kVX1sQ/xrabPO2H8W23Cfy+ZN95igkysONbBOxf9BP TY8VC+AN7YbYvFfVH5gB5gcn2b6H5fPcxgJZtqRwYYfZmH+SG8bdX9gquFXB0I6XZsc3 mu3FTLfuzaoYZpAc661ry49AuaJJNxD9be+8EkaJUyYqM/AaciQuVphT8AuumA9x/42x G4+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=dbM4DIqFT/1AAo5DPEyqBeuBxBSshlvJ2pooOBfqays=; b=WU1IG7aFnLQeiNP0J2/CkZcJMF/QNlwrz5WjGe48YR3bvbTHnk3SW+AiG8uaU636+B QHJ22hyMATVyy1x2cx385RPkRAuMBQ9cKoFxBFCBXMflpMPByB6VjouSAF+DbzOZKH+S zhXbjnAvPHfBwj3PA5OzG0GzlAHZ0hfqo9bDQi0rhJl1XGJYwK++UI9LbqKvu30SQ/7v 9M7fnYvdzKyHOu2lGRJuMpPYEViOFP5Q0UPOwmRshlmw7apa8aeOhT7zB6BaNpa0TKWG wzf445K6R0Khj9ShNqLiLCqcReveZ+K1jsfqvYHPaZB3OwqvMFlHXK7aYnHFD1cAXAyn pqxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@redhat.com header.s=mimecast20190719 header.b=cM+eUoPi; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f35si4078444ybi.135.2020.05.28.05.40.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 May 2020 05:40:12 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@redhat.com header.s=mimecast20190719 header.b=cM+eUoPi; spf=pass (google.com: domain of qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from localhost ([::1]:47824 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeHpU-00017A-3p for alex.bennee@linaro.org; Thu, 28 May 2020 08:40:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33608) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeHlt-0001bB-5d for qemu-arm@nongnu.org; Thu, 28 May 2020 08:36:29 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:37221 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jeHlp-0005AN-Fh for qemu-arm@nongnu.org; Thu, 28 May 2020 08:36:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590669384; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dbM4DIqFT/1AAo5DPEyqBeuBxBSshlvJ2pooOBfqays=; b=cM+eUoPiHcuG86Er4SIP9n+1RuZJ4NSNqnK+fxA0YZ9zdcNA2/J0cEWjXDTfiyQVGzhrKY Q5vleRdeyZcw79QAG7UTu6ZMw6z371Vh2gKWGOxz3TeLT56yV0Vim8FPf87bbhd7SCw8J7 qksbnYSqUdCDP8jrNmyRBA7QhgetHcI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-117-xY18pM-pNsaKqZfQxmKmcw-1; Thu, 28 May 2020 08:36:20 -0400 X-MC-Unique: xY18pM-pNsaKqZfQxmKmcw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7FD41460; Thu, 28 May 2020 12:36:18 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-50.ams2.redhat.com [10.36.113.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id 874475C1D6; Thu, 28 May 2020 12:36:16 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 6AD6A9DAE; Thu, 28 May 2020 14:36:09 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 02/21] hw/display/cg3: Convert debug printf()s to trace events Date: Thu, 28 May 2020 14:35:50 +0200 Message-Id: <20200528123609.27362-3-kraxel@redhat.com> In-Reply-To: <20200528123609.27362-1-kraxel@redhat.com> References: <20200528123609.27362-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=207.211.31.120; envelope-from=kraxel@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 03:11:04 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-arm@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Igor Mitsyanko , Alistair Francis , Mark Cave-Ayland , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , BALATON Zoltan , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Gerd Hoffmann , Andrzej Zaborowski Errors-To: qemu-arm-bounces+alex.bennee=linaro.org@nongnu.org Sender: "Qemu-arm" X-TUID: DnX5hSUnRMZB From: Philippe Mathieu-Daudé Convert DPRINTF() to trace events and remove ifdef'ry. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Message-id: 20200526062252.19852-3-f4bug@amsat.org Signed-off-by: Gerd Hoffmann --- hw/display/cg3.c | 14 ++++---------- hw/display/trace-events | 4 ++++ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/hw/display/cg3.c b/hw/display/cg3.c index f7f1c199ce54..7cbe6e56ff69 100644 --- a/hw/display/cg3.c +++ b/hw/display/cg3.c @@ -35,6 +35,7 @@ #include "hw/qdev-properties.h" #include "qemu/log.h" #include "qemu/module.h" +#include "trace.h" /* Change to 1 to enable debugging */ #define DEBUG_CG3 0 @@ -63,12 +64,6 @@ #define CG3_VRAM_SIZE 0x100000 #define CG3_VRAM_OFFSET 0x800000 -#define DPRINTF(fmt, ...) do { \ - if (DEBUG_CG3) { \ - printf("CG3: " fmt , ## __VA_ARGS__); \ - } \ -} while (0) - #define TYPE_CG3 "cgthree" #define CG3(obj) OBJECT_CHECK(CG3State, (obj), TYPE_CG3) @@ -195,7 +190,8 @@ static uint64_t cg3_reg_read(void *opaque, hwaddr addr, unsigned size) val = 0; break; } - DPRINTF("read %02x from reg %" HWADDR_PRIx "\n", val, addr); + trace_cg3_read(addr, val, size); + return val; } @@ -206,9 +202,7 @@ static void cg3_reg_write(void *opaque, hwaddr addr, uint64_t val, uint8_t regval; int i; - DPRINTF("write %" PRIx64 " to reg %" HWADDR_PRIx " size %d\n", - val, addr, size); - + trace_cg3_write(addr, val, size); switch (addr) { case CG3_REG_BT458_ADDR: s->dac_index = val; diff --git a/hw/display/trace-events b/hw/display/trace-events index e6e22bef8899..47b2b168ae15 100644 --- a/hw/display/trace-events +++ b/hw/display/trace-events @@ -151,3 +151,7 @@ artist_vram_write(unsigned int size, uint64_t addr, uint64_t val) "%u 0x%"PRIx64 artist_fill_window(unsigned int start_x, unsigned int start_y, unsigned int width, unsigned int height, uint32_t op, uint32_t ctlpln) "start=%ux%u length=%ux%u op=0x%08x ctlpln=0x%08x" artist_block_move(unsigned int start_x, unsigned int start_y, unsigned int dest_x, unsigned int dest_y, unsigned int width, unsigned int height) "source %ux%u -> dest %ux%u size %ux%u" artist_draw_line(unsigned int start_x, unsigned int start_y, unsigned int end_x, unsigned int end_y) "%ux%u %ux%u" + +# cg3.c +cg3_read(uint32_t addr, uint32_t val, unsigned size) "read addr:0x%06"PRIx32" val:0x%08"PRIx32" size:%u" +cg3_write(uint32_t addr, uint32_t val, unsigned size) "write addr:0x%06"PRIx32" val:0x%08"PRIx32" size:%u" -- 2.18.4