From nobody Wed Apr 16 00:17:45 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1674481149; cv=none; d=zohomail.com; s=zohoarc; b=ARgYPJuO4JCrCsUA4y5yFakqYQRRxdxDQ5SYSOuF4/hVuSv2h3tBMlrcB13cVK7BhyczLlHWQNTJAuBeb3pbFybYrc7XQ+S/OsI/4rbY0YOk2ujLk6RGZcXPfKw38uRLAyD4OQ2fFmACZwy8ZtI4yiYHMn4oqDjdlRkfCIYbq/A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1674481149; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ajiuKuxh7mBml7IbKxk3IiOiyKWtjxLpWptuFD5vSqA=; b=GKRFSFFRxvBAGrQ96lQ6IVHIQlK4+IrWjsazLtPbLgpw9HCMcp6solK69cf0puIhjzSlfW46nkEH5N2MLlrlNjIRdjlNrD8tkUUGXXS3vE7zPmn79kh2/gQQRVcb8S7/85RgHZTzp5Fkt9nh3BzpAjDWjJn/Pzcf1tYzIzgh9oY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1674481149149129.18689622749116; Mon, 23 Jan 2023 05:39:09 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pJwzw-00067l-47; Mon, 23 Jan 2023 08:36:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pJwzW-0005wA-U4 for qemu-devel@nongnu.org; Mon, 23 Jan 2023 08:36:14 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pJwzU-0002Mg-1T for qemu-devel@nongnu.org; Mon, 23 Jan 2023 08:36:05 -0500 Received: by mail-wm1-x331.google.com with SMTP id c4-20020a1c3504000000b003d9e2f72093so10622400wma.1 for ; Mon, 23 Jan 2023 05:36:03 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id d19-20020a05600c34d300b003a6125562e1sm10817457wmq.46.2023.01.23.05.36.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Jan 2023 05:36:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=ajiuKuxh7mBml7IbKxk3IiOiyKWtjxLpWptuFD5vSqA=; b=iIvtyJ0ZlaFi6umY76siNSJc+GznIVIm5Xcro+uY59F16XwmbQyecIRg4py1Tyj5ky jO+R9c1dyrqrzv2RvNXFz750m4n2ChxFBdnrpMZEFF+wrpZ7GHwHddsP8i2muqPtM6FK r2cwtTito0jEKRoykhBcU6QAem2QcVRtr28vF7xdN/bEocBjwDRcMrXAxHnjt3B2D/oy EpQ5FE9bbXUDxmClRxlxv/W4iJ7SG8meovUdbm5jtG7AqbBtmjOd9/7Y9tEyAsU4L38z Dn8p1hW5tL6g3awXQHNmQzEJAtauGLzNjwUOV6VtXmkvn/iQMkAWdXRlp3kS0D2sKjJT 0VMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ajiuKuxh7mBml7IbKxk3IiOiyKWtjxLpWptuFD5vSqA=; b=ZReGUgk9lH9Gq0kXz2SG4IftEoggesttezdBu3boMZCrugYn1d5CzR5gmT9JECtNgh ZnEtArRIognCWPK4i9BbfC2dzkK4brpMR1oqJyJb1fjTky9q8BtAidTNZFQ3Lm0c3aqY 7cQ3VgD69BG5NcG7to3xVar4T4MaQEnEkEZhROzdnO1C6zNfiLhMAygxY6JwRdtwTvcX M3XS6ImzshP8w+Rk4OfggKl2cmEECrIL4QMktJE9RfAJ8t7kP72mT3+Uq2GGxA8qHO42 KzD7E1rg79nan4GxIUWHuXmLUEIfhueX6KO/ErU79v9MazTinSU8318mKhuxy0z8OY6z gR7g== X-Gm-Message-State: AFqh2kr42eXdwQAGMv239ldFGgQ758vVgU7ksEKPLyTbf5ff6meNDhsl gEjmRSywCz4yhmyffljfnPbQWT1tsSG7Ia+R X-Google-Smtp-Source: AMrXdXvnRE200a1hsI1zhGKqV7Jt0WvLJns2SB8YPaSSmRzqgSmSVawXCmSF6F7+bxxfg+zC0STnzw== X-Received: by 2002:a05:600c:a29f:b0:3d9:f42c:56c5 with SMTP id hu31-20020a05600ca29f00b003d9f42c56c5mr24002311wmb.4.1674480962334; Mon, 23 Jan 2023 05:36:02 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 07/26] hw/i2c/bitbang_i2c: Convert DPRINTF() to trace events Date: Mon, 23 Jan 2023 13:35:34 +0000 Message-Id: <20230123133553.2171158-8-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230123133553.2171158-1-peter.maydell@linaro.org> References: <20230123133553.2171158-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x331.google.com 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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1674481150365100005 From: Philippe Mathieu-Daud=C3=A9 Convert the remaining DPRINTF debug macro uses to tracepoints. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Acked-by: Corey Minyard Message-id: 20230111085016.44551-6-philmd@linaro.org Signed-off-by: Peter Maydell --- hw/i2c/bitbang_i2c.c | 18 ++++++------------ hw/i2c/trace-events | 4 ++++ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/hw/i2c/bitbang_i2c.c b/hw/i2c/bitbang_i2c.c index efc49b7502f..bb189547651 100644 --- a/hw/i2c/bitbang_i2c.c +++ b/hw/i2c/bitbang_i2c.c @@ -18,14 +18,6 @@ #include "qom/object.h" #include "trace.h" =20 -//#define DEBUG_BITBANG_I2C - -#ifdef DEBUG_BITBANG_I2C -#define DPRINTF(fmt, ...) \ -do { printf("bitbang_i2c: " fmt , ## __VA_ARGS__); } while (0) -#else -#define DPRINTF(fmt, ...) do {} while(0) -#endif =20 /* bitbang_i2c_state enum to name */ static const char * const sname[] =3D { @@ -71,8 +63,10 @@ static void bitbang_i2c_enter_stop(bitbang_i2c_interface= *i2c) /* Set device data pin. */ static int bitbang_i2c_ret(bitbang_i2c_interface *i2c, int level) { + trace_bitbang_i2c_data(i2c->last_clock, i2c->last_data, + i2c->device_out, level); i2c->device_out =3D level; - //DPRINTF("%d %d %d\n", i2c->last_clock, i2c->last_data, i2c->device_o= ut); + return level & i2c->last_data; } =20 @@ -137,11 +131,11 @@ int bitbang_i2c_set(bitbang_i2c_interface *i2c, int l= ine, int level) =20 if (i2c->current_addr < 0) { i2c->current_addr =3D i2c->buffer; - DPRINTF("Address 0x%02x\n", i2c->current_addr); + trace_bitbang_i2c_addr(i2c->current_addr); ret =3D i2c_start_transfer(i2c->bus, i2c->current_addr >> 1, i2c->current_addr & 1); } else { - DPRINTF("Sent 0x%02x\n", i2c->buffer); + trace_bitbang_i2c_send(i2c->buffer); ret =3D i2c_send(i2c->bus, i2c->buffer); } if (ret) { @@ -161,7 +155,7 @@ int bitbang_i2c_set(bitbang_i2c_interface *i2c, int lin= e, int level) } case RECEIVING_BIT7: i2c->buffer =3D i2c_recv(i2c->bus); - DPRINTF("RX byte 0x%02x\n", i2c->buffer); + trace_bitbang_i2c_recv(i2c->buffer); /* Fall through... */ case RECEIVING_BIT6 ... RECEIVING_BIT0: data =3D i2c->buffer >> 7; diff --git a/hw/i2c/trace-events b/hw/i2c/trace-events index 48aee4887c4..8e88aa24c1a 100644 --- a/hw/i2c/trace-events +++ b/hw/i2c/trace-events @@ -2,6 +2,10 @@ =20 # bitbang_i2c.c bitbang_i2c_state(const char *old_state, const char *new_state) "state %s = -> %s" +bitbang_i2c_addr(uint8_t addr) "Address 0x%02x" +bitbang_i2c_send(uint8_t byte) "TX byte 0x%02x" +bitbang_i2c_recv(uint8_t byte) "RX byte 0x%02x" +bitbang_i2c_data(unsigned dat, unsigned clk, unsigned old_out, unsigned ne= w_out) "dat %u clk %u out %u -> %u" =20 # core.c =20 --=20 2.34.1