From nobody Wed Nov 27 13:04:29 2024 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1698495941; cv=none; d=zohomail.com; s=zohoarc; b=J4n3XY7uSUzCMnvekYVsOW9HzMdYH1F7VxDU4IJAzlBeNnV6Bk09UpOusD7VoltSOqFA1J+MCyh6IRTakA7juRAjcacbLE6qqISY2F7LWtNqT/MrcbbE16keWjCSveRE5Jd3ZUrWaiDDPtIYkSNDmH0PyZIqJ1ub8QULKjIz9/g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698495941; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Z+50/O4PNCKQH2UPmRwpwa8C3hjwmP+3AadueA5nS0w=; b=TmJtSrJMYUGsXYyIjx/B+98dxfDc+FFwkILa35BpuO0H5v8KeGoaF0AsK6NyewPI9pZ+OplHj39cKvOFXMtzWhG6LV6paU6Axz6TW2oE6qObI+zpMY5UlUGkAeC4Kl8EubUXlBYuVzj5oM3MRDjqcFtSkaQgQcnxr3VxqxLveu4= 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 1698495941495773.0779667837986; Sat, 28 Oct 2023 05:25:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qwiMj-0006Kk-QO; Sat, 28 Oct 2023 08:24:33 -0400 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 1qwiMi-0006Jw-2C; Sat, 28 Oct 2023 08:24:32 -0400 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qwiMg-0006lP-CW; Sat, 28 Oct 2023 08:24:31 -0400 Received: by mail-ed1-x52d.google.com with SMTP id 4fb4d7f45d1cf-5409bc907edso4520477a12.0; Sat, 28 Oct 2023 05:24:29 -0700 (PDT) Received: from archlinux.. (dynamic-089-012-044-170.89.12.pool.telefonica.de. [89.12.44.170]) by smtp.gmail.com with ESMTPSA id a13-20020a170906190d00b009ae3d711fd9sm2706687eje.69.2023.10.28.05.24.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Oct 2023 05:24:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698495867; x=1699100667; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Z+50/O4PNCKQH2UPmRwpwa8C3hjwmP+3AadueA5nS0w=; b=PapyUXBeuUVf0POH/6KHuqPs+IigD3SggaKDpbhME/1n8E+il45JauEHKciIhLvH1u tF0t7yA+1gwXmdv+cEM3E0UPoJVxRbiJQWZ88ZuxQQjoeRyWkunq3UGxtBNMqYcVkolk snfk2AdZxdy9E+NmYxH/TQ0hG2jqfJ2KVPlrwlyCC1+7xZuDzxVJsoOEHpNLeAD9fqEC lM5ZSZqqhGGvKBHe5BGt9KQWFzbXacITsr9lYC7BZ+Mcz00hDNHQPncWyge6DNkar91L W7+h+iU97G7SMAXeNeEKg+p1yZ/AlueQrT6Y8T3Vx7HYZj6FcL5EFSd1ifsKPxxdFiM4 DYUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698495867; x=1699100667; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Z+50/O4PNCKQH2UPmRwpwa8C3hjwmP+3AadueA5nS0w=; b=vw4T+S89qaLjWEZNg6pPUetl+HtZRhSlrLIO89DT2Yp7xAfHLG3HyB39nqr2ztxTPo 0yXsz3u7pbmxwUXhR7NDGX6B5EWJBLiDzP/FIQ02WawR7KZdl3dHioC4W1Z8cs3G0pZl TelOgX/qr4pnaZhPUfewMfSXy9SyAHnuP+u7Ueq+znQGq9Cq6lqBib/QmkD95qL6H+bm wVPz+BIUzeN0wXuymFtkvfciQZqn3GmrzhNu+AUVE17R4nqxcxARoqAImKmlAHYtXWGp SWtAhHVs15V9dWO0xQp2+pFp4H9cMACt7uV7k3axF1px5yvBxqqDu2rN32HnrcsXQLgA Ee/Q== X-Gm-Message-State: AOJu0Yy3c5S0YqO6fv3MTpu1EVDvNWD3j6N1xgC98lbTIW0R6JVkmfwZ efWyMh4JrIXpgFmJc9XbV19trtszWXI= X-Google-Smtp-Source: AGHT+IHIR2UQG2nOuLJaEjyq58WcbmQMiSnqzJ/4RIgRu0TcMxoS+um9nfeVHV5+dhhOmWHuwFYR6w== X-Received: by 2002:a17:907:1c25:b0:9ae:50e3:7e40 with SMTP id nc37-20020a1709071c2500b009ae50e37e40mr4172825ejc.52.1698495867279; Sat, 28 Oct 2023 05:24:27 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-trivial@nongnu.org, Stefan Hajnoczi , Jean-Christophe Dubois , qemu-arm@nongnu.org, Andrey Smirnov , Peter Xu , David Hildenbrand , "Michael S. Tsirkin" , Mads Ynddal , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Bernhard Beschow Subject: [PATCH 1/6] hw/watchdog/wdt_imx2: Trace MMIO access Date: Sat, 28 Oct 2023 14:24:10 +0200 Message-ID: <20231028122415.14869-2-shentey@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231028122415.14869-1-shentey@gmail.com> References: <20231028122415.14869-1-shentey@gmail.com> MIME-Version: 1.0 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::52d; envelope-from=shentey@gmail.com; helo=mail-ed1-x52d.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, FREEMAIL_FROM=0.001, 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 @gmail.com) X-ZM-MESSAGEID: 1698495942629100009 Content-Type: text/plain; charset="utf-8" Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/watchdog/wdt_imx2.c | 24 ++++++++++++++++++------ hw/watchdog/trace-events | 4 ++++ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/hw/watchdog/wdt_imx2.c b/hw/watchdog/wdt_imx2.c index e776a2fbd4..885ebd3978 100644 --- a/hw/watchdog/wdt_imx2.c +++ b/hw/watchdog/wdt_imx2.c @@ -17,6 +17,7 @@ #include "hw/qdev-properties.h" =20 #include "hw/watchdog/wdt_imx2.h" +#include "trace.h" =20 static void imx2_wdt_interrupt(void *opaque) { @@ -67,20 +68,29 @@ static void imx2_wdt_reset(DeviceState *dev) static uint64_t imx2_wdt_read(void *opaque, hwaddr addr, unsigned int size) { IMX2WdtState *s =3D IMX2_WDT(opaque); + uint16_t value =3D 0; =20 switch (addr) { case IMX2_WDT_WCR: - return s->wcr; + value =3D s->wcr; + break; case IMX2_WDT_WSR: - return s->wsr; + value =3D s->wsr; + break; case IMX2_WDT_WRSR: - return s->wrsr; + value =3D s->wrsr; + break; case IMX2_WDT_WICR: - return s->wicr; + value =3D s->wicr; + break; case IMX2_WDT_WMCR: - return s->wmcr; + value =3D s->wmcr; + break; } - return 0; + + trace_imx2_wdt_read(addr, value); + + return value; } =20 static void imx_wdt2_update_itimer(IMX2WdtState *s, bool start) @@ -137,6 +147,8 @@ static void imx2_wdt_write(void *opaque, hwaddr addr, { IMX2WdtState *s =3D IMX2_WDT(opaque); =20 + trace_imx2_wdt_write(addr, value); + switch (addr) { case IMX2_WDT_WCR: if (s->wcr_locked) { diff --git a/hw/watchdog/trace-events b/hw/watchdog/trace-events index 2739570652..874968cc06 100644 --- a/hw/watchdog/trace-events +++ b/hw/watchdog/trace-events @@ -17,6 +17,10 @@ cmsdk_apb_watchdog_lock(uint32_t lock) "CMSDK APB watchd= og: lock %" PRIu32 aspeed_wdt_read(uint64_t addr, uint32_t size) "@0x%" PRIx64 " size=3D%d" aspeed_wdt_write(uint64_t addr, uint32_t size, uint64_t data) "@0x%" PRIx6= 4 " size=3D%d value=3D0x%"PRIx64 =20 +# wdt_imx2.c +imx2_wdt_read(uint32_t addr, uint16_t data) "[0x%" PRIx32 "] -> 0x%" PRIx16 +imx2_wdt_write(uint32_t addr, uint16_t data) "[0x%" PRIx32 "] <- 0x%" PRIx= 16 + # spapr_watchdog.c spapr_watchdog_start(uint64_t flags, uint64_t num, uint64_t timeout) "Flag= s 0x%" PRIx64 " num=3D%" PRId64 " %" PRIu64 "ms" spapr_watchdog_stop(uint64_t num, uint64_t ret) "num=3D%" PRIu64 " ret=3D%= " PRId64 --=20 2.42.0 From nobody Wed Nov 27 13:04:29 2024 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1698495941; cv=none; d=zohomail.com; s=zohoarc; b=O9sdHRpcOpE3nSI0HwHBAexLtJA/jtURy2uwsd3jyxRKaZdpAlOQfk4ujNDpkXft7McmLjyoKJ31gCCLTHJAHGVMu0B1OAXD5jQlWm4Pt/9HRh9xlEjW9fSnelMiGyvw3td3D7QPmbLKfpdU116gDV6cEIac7o5TfjSv+DjM8Gk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698495941; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=3625XLI1M77/QNI0XDsoa+gao97xuom6mXxW++PFOrI=; b=D8OMeEWuyjCyCMGd3GGaXv6LT1k7V/Bbse9qqZWHyNS2Uf5pOwSgLzTbNK3zssgW6QMocBWQcVQpv54JzRO6LV9AFmHuxSBMrXteB/yAx1L6+tulsG9MPlJlhjE0mZxUecFrWxInK05Hr+EhDQdXntNsNByjJ0JtQkhEBcd+8qA= 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 1698495941564961.3120010094227; Sat, 28 Oct 2023 05:25:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qwiMl-0006Lf-GF; Sat, 28 Oct 2023 08:24:35 -0400 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 1qwiMj-0006Km-Qr; Sat, 28 Oct 2023 08:24:33 -0400 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qwiMi-0006la-5o; Sat, 28 Oct 2023 08:24:33 -0400 Received: by mail-ej1-x635.google.com with SMTP id a640c23a62f3a-9d0b4dfd60dso185392166b.1; Sat, 28 Oct 2023 05:24:31 -0700 (PDT) Received: from archlinux.. (dynamic-089-012-044-170.89.12.pool.telefonica.de. [89.12.44.170]) by smtp.gmail.com with ESMTPSA id a13-20020a170906190d00b009ae3d711fd9sm2706687eje.69.2023.10.28.05.24.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Oct 2023 05:24:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698495869; x=1699100669; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3625XLI1M77/QNI0XDsoa+gao97xuom6mXxW++PFOrI=; b=Rw24mKHxFlHKhVNRPzjOcT9CnTTyt8oCFbt2CYJ7esLoJUFHOHpz2g5wXDKm9lOLob m3tX7Am9pKNXZKFOM+gne13n+bWHBN2Vn7KW0i93BcbBFAWngJPbNQC+DcjiXzC6VrDR zNUAECk2rfwsqKhOXMgChxdgsf9GzuWoAAFUhzQs1nqibj1ZHKzO4zZWzFY3vnBNDKaM EKTt5LoQaTsKtDJp4JXDs++Idsk9Bk/kQLL/41n1OcI0/6h26XoJG3byQ+h+8goUj9mY HC47n6V9C87frxHA4DC6ubACzJDR5ZflVRjylOahv+ZHFBYIVLyi2Nt11RypIPN4jNww 0U+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698495869; x=1699100669; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3625XLI1M77/QNI0XDsoa+gao97xuom6mXxW++PFOrI=; b=BEAa/psDC0GcQFygQGiFQGHLAFFRQEdR1a3olsYLxnbxOtWjOxFpLqe3YNfhDXkVfF DWq3TtLQfOJbg5AQSWmWxKmR2zpxhRtLomT6ZC/8mtxNcNLOU6n5xvXzgVhfin/Vwc+c m9OkkWPM0+sIVCFiP63QEAngKzBjGUQpgo8dLWUdQuYaJRt//M16ogClur0YLmyQSFmO BYYMbV5khbcQDDbKTY6oo1LotkCr2TgX6Hz+piwMiHxB2HzDno1cEOOkwoutp3GieMPi rQ3et20J7Pdq+u4RB3lYtEQmk122ipeNEJ6XBXQ88DuLJVweHaB850npoujdlaQ2Z82L IG2Q== X-Gm-Message-State: AOJu0Yy1jDqK5r57IRc/PoKIJdL6jZOPVNyvlhXZdZLa/94ZsDhejHHT 5i3YEhQlzl7tOg/gvJ/yOiu6lb2OStY= X-Google-Smtp-Source: AGHT+IGLDXI85ZB3XsRKlvG3MpeNmB8vokikH+7LoMalEY8ePS2c2VUj8IpHtRs3eKUonOuQhaRGlg== X-Received: by 2002:a17:906:c103:b0:9c1:4343:60ab with SMTP id do3-20020a170906c10300b009c1434360abmr4574571ejc.10.1698495869191; Sat, 28 Oct 2023 05:24:29 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-trivial@nongnu.org, Stefan Hajnoczi , Jean-Christophe Dubois , qemu-arm@nongnu.org, Andrey Smirnov , Peter Xu , David Hildenbrand , "Michael S. Tsirkin" , Mads Ynddal , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Bernhard Beschow Subject: [PATCH 2/6] hw/watchdog/wdt_imx2: Trace timer activity Date: Sat, 28 Oct 2023 14:24:11 +0200 Message-ID: <20231028122415.14869-3-shentey@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231028122415.14869-1-shentey@gmail.com> References: <20231028122415.14869-1-shentey@gmail.com> MIME-Version: 1.0 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::635; envelope-from=shentey@gmail.com; helo=mail-ej1-x635.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, FREEMAIL_FROM=0.001, 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 @gmail.com) X-ZM-MESSAGEID: 1698495942659100011 Content-Type: text/plain; charset="utf-8" Signed-off-by: Bernhard Beschow --- hw/watchdog/wdt_imx2.c | 4 ++++ hw/watchdog/trace-events | 2 ++ 2 files changed, 6 insertions(+) diff --git a/hw/watchdog/wdt_imx2.c b/hw/watchdog/wdt_imx2.c index 885ebd3978..891d7beb2a 100644 --- a/hw/watchdog/wdt_imx2.c +++ b/hw/watchdog/wdt_imx2.c @@ -23,6 +23,8 @@ static void imx2_wdt_interrupt(void *opaque) { IMX2WdtState *s =3D IMX2_WDT(opaque); =20 + trace_imx2_wdt_interrupt(); + s->wicr |=3D IMX2_WDT_WICR_WTIS; qemu_set_irq(s->irq, 1); } @@ -31,6 +33,8 @@ static void imx2_wdt_expired(void *opaque) { IMX2WdtState *s =3D IMX2_WDT(opaque); =20 + trace_imx2_wdt_expired(); + s->wrsr =3D IMX2_WDT_WRSR_TOUT; =20 /* Perform watchdog action if watchdog is enabled */ diff --git a/hw/watchdog/trace-events b/hw/watchdog/trace-events index 874968cc06..ad3be1e9bd 100644 --- a/hw/watchdog/trace-events +++ b/hw/watchdog/trace-events @@ -20,6 +20,8 @@ aspeed_wdt_write(uint64_t addr, uint32_t size, uint64_t d= ata) "@0x%" PRIx64 " si # wdt_imx2.c imx2_wdt_read(uint32_t addr, uint16_t data) "[0x%" PRIx32 "] -> 0x%" PRIx16 imx2_wdt_write(uint32_t addr, uint16_t data) "[0x%" PRIx32 "] <- 0x%" PRIx= 16 +imx2_wdt_interrupt(void) "" +imx2_wdt_expired(void) "" =20 # spapr_watchdog.c spapr_watchdog_start(uint64_t flags, uint64_t num, uint64_t timeout) "Flag= s 0x%" PRIx64 " num=3D%" PRId64 " %" PRIu64 "ms" --=20 2.42.0 From nobody Wed Nov 27 13:04:29 2024 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1698496010; cv=none; d=zohomail.com; s=zohoarc; b=fQna762vGcilGiVQm39Zy8fbQyN3wxGTuOTgF/rPy6laQdY6UXvEbPwtDOWuEr/odzPobcduat5D17y2KwRAQyFRli6rs8si5mFlG697bd/8BR8lamKki5WGOzALcNgvUTKDF2dYC/mnNR72xo9Of3ch268GVE3jBjnBd1xzI0I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698496010; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=p98LzR4A98wQ5ZfYaKYuefbwebJ7vVfonZaSMKgh8fI=; b=YmGB0FzWHO/ag30bsZifWjgK08o58j6ohzYnWMSoBtMMNc1C6Lt9AuVCZWhwX9YMpiBcY9Qp1oK52I4V4grC9mI5UV5RvO0dD5cTq+4dSbfkEJt2JowV8/u0LB9L37bzXcBz449eJmvZStY1mxVuOJHSkcEQmyIxAp0NFcx0Jl8= 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 1698496010736360.1063478068711; Sat, 28 Oct 2023 05:26:50 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qwiMq-0006Q7-HI; Sat, 28 Oct 2023 08:24:40 -0400 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 1qwiMo-0006OT-Rq; Sat, 28 Oct 2023 08:24:38 -0400 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qwiMj-0006m0-Jo; Sat, 28 Oct 2023 08:24:38 -0400 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-9d10f94f70bso130853866b.3; Sat, 28 Oct 2023 05:24:32 -0700 (PDT) Received: from archlinux.. (dynamic-089-012-044-170.89.12.pool.telefonica.de. [89.12.44.170]) by smtp.gmail.com with ESMTPSA id a13-20020a170906190d00b009ae3d711fd9sm2706687eje.69.2023.10.28.05.24.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Oct 2023 05:24:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698495871; x=1699100671; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=p98LzR4A98wQ5ZfYaKYuefbwebJ7vVfonZaSMKgh8fI=; b=Ltxrwo8fo+ppBxo9soWE1pFE66G33G1uPSN7E0VdVwWEIdwUMfDg7tmcVr4UNf0Wjw zcCM+BqCjcz6vDU1IAOK3ago39QHmbxys+eiHqbDIdBxQTothuVVX9yL7cU2wd2KHmbc MMKkfQWDklaBPkh5JP2Tp4TEecDos78nP7QOJIgTh7lxPlab0iQMFiEbqEraCeLbZaJ8 5Jah9VuuK08WVe2BHdyHbV/WjO1uR0prJMoz5J1MDL1QGjU23sB/oUSCDfnOxKCMxA5H kjVrbPUPbkzufi8CYQGuLxi9S3MH1zWqdpKa1ULrLtWw9WvSzdwJRGvRCsGasHJsPG3v fsgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698495871; x=1699100671; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=p98LzR4A98wQ5ZfYaKYuefbwebJ7vVfonZaSMKgh8fI=; b=rKgMTWjAnGr2lakIhdOq0G+zPGcQnoNnbAQwBRQhhjEf9KcjYWDPvfvv82Y07qu1aA uZeLVsKVXiJ/0dIAvOO25aXjfIyoI3K8zO+j7UBQeGrdfM2mTfKluL5aknAGUK86NLih OH7SGHeM0k0rU6hgkHbT8pWpWbx6OCmdHzgB5U+JsOtwq61iGjx8+V0JqI8Ly3WH0Ds2 3qPSPTpLAZjS4ByOIbaqvJ34hrn0CPHp62aBVvx3po7spRiPlvd/mNKUimeNKWp8Mu+S Ft4NXAb71i2BRLFODYXnpjZpTuRW5nFySA3QqWZmKWpThw3QGSu8qCMpVPGFDHTsyGd1 LKNg== X-Gm-Message-State: AOJu0YxPZRQSngoXkXSLNvejUWDhRA09/p9LLnofqYvFExWNA892xUEC JB9oekUq5sRSzHeKhm4uoHwibFNF9Qc= X-Google-Smtp-Source: AGHT+IE9lMcNenzXtmCdyFljehhaORXwfWkm/tchOl2CQVJyxQEDCoTdkbHWTRhAw91FZLlC9MDfxA== X-Received: by 2002:a17:907:3f1f:b0:9ae:4878:1172 with SMTP id hq31-20020a1709073f1f00b009ae48781172mr4123125ejc.7.1698495870679; Sat, 28 Oct 2023 05:24:30 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-trivial@nongnu.org, Stefan Hajnoczi , Jean-Christophe Dubois , qemu-arm@nongnu.org, Andrey Smirnov , Peter Xu , David Hildenbrand , "Michael S. Tsirkin" , Mads Ynddal , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Bernhard Beschow Subject: [PATCH 3/6] hw/misc/imx7_snvs: Trace MMIO access Date: Sat, 28 Oct 2023 14:24:12 +0200 Message-ID: <20231028122415.14869-4-shentey@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231028122415.14869-1-shentey@gmail.com> References: <20231028122415.14869-1-shentey@gmail.com> MIME-Version: 1.0 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::630; envelope-from=shentey@gmail.com; helo=mail-ej1-x630.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, FREEMAIL_FROM=0.001, 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 @gmail.com) X-ZM-MESSAGEID: 1698496012073100003 Content-Type: text/plain; charset="utf-8" Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/misc/imx7_snvs.c | 5 +++++ hw/misc/trace-events | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/hw/misc/imx7_snvs.c b/hw/misc/imx7_snvs.c index ee7698bd9c..a245f96cd4 100644 --- a/hw/misc/imx7_snvs.c +++ b/hw/misc/imx7_snvs.c @@ -16,9 +16,12 @@ #include "hw/misc/imx7_snvs.h" #include "qemu/module.h" #include "sysemu/runstate.h" +#include "trace.h" =20 static uint64_t imx7_snvs_read(void *opaque, hwaddr offset, unsigned size) { + trace_imx7_snvs_read(offset, 0); + return 0; } =20 @@ -28,6 +31,8 @@ static void imx7_snvs_write(void *opaque, hwaddr offset, const uint32_t value =3D v; const uint32_t mask =3D SNVS_LPCR_TOP | SNVS_LPCR_DP_EN; =20 + trace_imx7_snvs_write(offset, value); + if (offset =3D=3D SNVS_LPCR && ((value & mask) =3D=3D mask)) { qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SHUTDOWN); } diff --git a/hw/misc/trace-events b/hw/misc/trace-events index 24ba7cc4d0..426a8472b6 100644 --- a/hw/misc/trace-events +++ b/hw/misc/trace-events @@ -115,6 +115,10 @@ msf2_sysreg_write_pll_status(void) "Invalid write to r= ead only PLL status regist imx7_gpr_read(uint64_t offset) "addr 0x%08" PRIx64 imx7_gpr_write(uint64_t offset, uint64_t value) "addr 0x%08" PRIx64 "value= 0x%08" PRIx64 =20 +# imx7_snvs.c +imx7_snvs_read(uint64_t offset, uint32_t value) "addr 0x%08" PRIx64 "value= 0x%08" PRIx32 +imx7_snvs_write(uint64_t offset, uint32_t value) "addr 0x%08" PRIx64 "valu= e 0x%08" PRIx32 + # mos6522.c mos6522_set_counter(int index, unsigned int val) "T%d.counter=3D%d" mos6522_get_next_irq_time(uint16_t latch, int64_t d, int64_t delta) "latch= =3D%d counter=3D0x%"PRIx64 " delta_next=3D0x%"PRIx64 --=20 2.42.0 From nobody Wed Nov 27 13:04:29 2024 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1698495941; cv=none; d=zohomail.com; s=zohoarc; b=cREoupuOl6/1WE1wEdR84SrYA8vi90hw4iNaq+rqeJ2FJUigQLNTxjxNUnyUgEFOdieNXfqKI9mS3HHVAsea3KADgjIiInQNceYKCOItC55W6XlcJgV3gm8TypMQEaBkycVYq9qpfmjRUBijuGv4kefD+dGYA5egToTrCocQjCQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698495941; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=r/GfajRIrYhgKYmLQLWAkDGqOb+fcd/j2IAGxcdFbD0=; b=OwlVfrqC0imu8QXtxoVxRFL3sPOCQwjWcQR5jODj7rQR4GPEQPXagYfvrcDJyOl6JNpo1pV+9enQ3vNCuW9PDLwjDt8++8OzYmuEHX53wfkw2itjuBBtJUEMky5821aAhaITG119BGgiskVJKg4t31GrEwgizMKYfScMjpIEsf8= 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 1698495941660399.13556426559796; Sat, 28 Oct 2023 05:25:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qwiMo-0006ON-Fi; Sat, 28 Oct 2023 08:24:38 -0400 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 1qwiMn-0006Mw-Oz; Sat, 28 Oct 2023 08:24:37 -0400 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qwiMk-0006mB-Rx; Sat, 28 Oct 2023 08:24:37 -0400 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-99c1c66876aso461126966b.2; Sat, 28 Oct 2023 05:24:33 -0700 (PDT) Received: from archlinux.. (dynamic-089-012-044-170.89.12.pool.telefonica.de. [89.12.44.170]) by smtp.gmail.com with ESMTPSA id a13-20020a170906190d00b009ae3d711fd9sm2706687eje.69.2023.10.28.05.24.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Oct 2023 05:24:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698495872; x=1699100672; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=r/GfajRIrYhgKYmLQLWAkDGqOb+fcd/j2IAGxcdFbD0=; b=B8Gu37dhyND9fBYOnWoLbBEorHRohFtKn62u9FL/VykHPqGJWMH78vO03jNDM1KLav W/wb7ae2ub8oUS0p0lP8sa7B5IcNOVL9RJQxjgezNYnAAzGgE3OveKqsODzjDpnf5zlP CJuSOMgf3yQZ0Tj2tz39lZgEc7segfvHPUUuD3pjzeKTwpqjk6IvJKUcAeW7ykZagLxC leNqupBeAJKJ9VK0we82qVBZ5bFz6Qr1zHoNFRed8226JwkFTGfJRRywzHH+xK7XKKUY qc8WI+5beNzqyomKd3gZVlm+4nztowWf0dK1IE0a6MJ8ZMQnXeUSH5URhz9rii9dU73F zKiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698495872; x=1699100672; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=r/GfajRIrYhgKYmLQLWAkDGqOb+fcd/j2IAGxcdFbD0=; b=bbXWT8VsbZB2T8WKqQGj6w17WekjOR3qXV+wvZ8T4mWkXBJtTvbonQA4KKtkWImqd0 6WiQ5UVXn9v/DrdQrNYU16nGphO8d4kLfqFyRI53AHbL1LYZ0PUjWZevYwUg+ffTbQIA 4U9g5jK6Wn0vxJckw5HAFNFBdInFhs2GO7GMf153IVOsHwaIrjg/a5uopuQXd2Fne/7s SwleRabLj5TvrbDK32Xim0w/8wOX74UScWPA+jK0kWg6yHvljVoEAroMnZUA5cWIQM0J xrt+G27eqlnjLrd4yONXT9quuKayOqIRdUWNDv5+C6+zZvIqaUttAq6qxNLtS/8tTlgf I2Qg== X-Gm-Message-State: AOJu0Yx+wvOPl8CblUWK69c9czIdLgGEUFg2R3U99VvEXvVTIASTTcxS 79qj8g11EqPqNRzQTJ69eHcxPwPH0ss= X-Google-Smtp-Source: AGHT+IHv96nH2LOV/SNgBOAroojKxVvkS7/zz+cI8+/99Q/qcggi0hkhOiFqzE3dq4y5WpVnKZdpbA== X-Received: by 2002:a17:907:7f1e:b0:9be:9e69:488c with SMTP id qf30-20020a1709077f1e00b009be9e69488cmr5166062ejc.59.1698495872225; Sat, 28 Oct 2023 05:24:32 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-trivial@nongnu.org, Stefan Hajnoczi , Jean-Christophe Dubois , qemu-arm@nongnu.org, Andrey Smirnov , Peter Xu , David Hildenbrand , "Michael S. Tsirkin" , Mads Ynddal , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Bernhard Beschow Subject: [PATCH 4/6] hw/misc/imx6_ccm: Convert DPRINTF to trace events Date: Sat, 28 Oct 2023 14:24:13 +0200 Message-ID: <20231028122415.14869-5-shentey@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231028122415.14869-1-shentey@gmail.com> References: <20231028122415.14869-1-shentey@gmail.com> MIME-Version: 1.0 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::630; envelope-from=shentey@gmail.com; helo=mail-ej1-x630.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, FREEMAIL_FROM=0.001, 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 @gmail.com) X-ZM-MESSAGEID: 1698495942633100010 Content-Type: text/plain; charset="utf-8" Signed-off-by: Bernhard Beschow Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/misc/imx6_ccm.c | 41 ++++++++++++++--------------------------- hw/misc/trace-events | 15 +++++++++++++++ 2 files changed, 29 insertions(+), 27 deletions(-) diff --git a/hw/misc/imx6_ccm.c b/hw/misc/imx6_ccm.c index 4c830fd89a..85af466c2b 100644 --- a/hw/misc/imx6_ccm.c +++ b/hw/misc/imx6_ccm.c @@ -15,18 +15,7 @@ #include "migration/vmstate.h" #include "qemu/log.h" #include "qemu/module.h" - -#ifndef DEBUG_IMX6_CCM -#define DEBUG_IMX6_CCM 0 -#endif - -#define DPRINTF(fmt, args...) \ - do { \ - if (DEBUG_IMX6_CCM) { \ - fprintf(stderr, "[%s]%s: " fmt , TYPE_IMX6_CCM, \ - __func__, ##args); \ - } \ - } while (0) +#include "trace.h" =20 static const char *imx6_ccm_reg_name(uint32_t reg) { @@ -263,7 +252,7 @@ static uint64_t imx6_analog_get_pll2_clk(IMX6CCMState *= dev) freq *=3D 20; } =20 - DPRINTF("freq =3D %u\n", (uint32_t)freq); + trace_imx6_analog_get_pll2_clk(freq); =20 return freq; } @@ -275,7 +264,7 @@ static uint64_t imx6_analog_get_pll2_pfd0_clk(IMX6CCMSt= ate *dev) freq =3D imx6_analog_get_pll2_clk(dev) * 18 / EXTRACT(dev->analog[CCM_ANALOG_PFD_528], PFD0_FRAC); =20 - DPRINTF("freq =3D %u\n", (uint32_t)freq); + trace_imx6_analog_get_pll2_pfd0_clk(freq); =20 return freq; } @@ -287,7 +276,7 @@ static uint64_t imx6_analog_get_pll2_pfd2_clk(IMX6CCMSt= ate *dev) freq =3D imx6_analog_get_pll2_clk(dev) * 18 / EXTRACT(dev->analog[CCM_ANALOG_PFD_528], PFD2_FRAC); =20 - DPRINTF("freq =3D %u\n", (uint32_t)freq); + trace_imx6_analog_get_pll2_pfd2_clk(freq); =20 return freq; } @@ -315,7 +304,7 @@ static uint64_t imx6_analog_get_periph_clk(IMX6CCMState= *dev) break; } =20 - DPRINTF("freq =3D %u\n", (uint32_t)freq); + trace_imx6_analog_get_periph_clk(freq); =20 return freq; } @@ -327,7 +316,7 @@ static uint64_t imx6_ccm_get_ahb_clk(IMX6CCMState *dev) freq =3D imx6_analog_get_periph_clk(dev) / (1 + EXTRACT(dev->ccm[CCM_CBCDR], AHB_PODF)); =20 - DPRINTF("freq =3D %u\n", (uint32_t)freq); + trace_imx6_ccm_get_ahb_clk(freq); =20 return freq; } @@ -339,7 +328,7 @@ static uint64_t imx6_ccm_get_ipg_clk(IMX6CCMState *dev) freq =3D imx6_ccm_get_ahb_clk(dev) / (1 + EXTRACT(dev->ccm[CCM_CBCDR], IPG_PODF)); =20 - DPRINTF("freq =3D %u\n", (uint32_t)freq); + trace_imx6_ccm_get_ipg_clk(freq); =20 return freq; } @@ -351,7 +340,7 @@ static uint64_t imx6_ccm_get_per_clk(IMX6CCMState *dev) freq =3D imx6_ccm_get_ipg_clk(dev) / (1 + EXTRACT(dev->ccm[CCM_CSCMR1], PERCLK_PODF)); =20 - DPRINTF("freq =3D %u\n", (uint32_t)freq); + trace_imx6_ccm_get_per_clk(freq); =20 return freq; } @@ -385,7 +374,7 @@ static uint32_t imx6_ccm_get_clock_frequency(IMXCCMStat= e *dev, IMXClk clock) break; } =20 - DPRINTF("Clock =3D %d) =3D %u\n", clock, freq); + trace_imx6_ccm_get_clock_frequency(clock, freq); =20 return freq; } @@ -394,7 +383,7 @@ static void imx6_ccm_reset(DeviceState *dev) { IMX6CCMState *s =3D IMX6_CCM(dev); =20 - DPRINTF("\n"); + trace_imx6_ccm_reset(); =20 s->ccm[CCM_CCR] =3D 0x040116FF; s->ccm[CCM_CCDR] =3D 0x00000000; @@ -483,7 +472,7 @@ static uint64_t imx6_ccm_read(void *opaque, hwaddr offs= et, unsigned size) =20 value =3D s->ccm[index]; =20 - DPRINTF("reg[%s] =3D> 0x%" PRIx32 "\n", imx6_ccm_reg_name(index), valu= e); + trace_imx6_ccm_read(imx6_ccm_reg_name(index), value); =20 return (uint64_t)value; } @@ -494,8 +483,7 @@ static void imx6_ccm_write(void *opaque, hwaddr offset,= uint64_t value, uint32_t index =3D offset >> 2; IMX6CCMState *s =3D (IMX6CCMState *)opaque; =20 - DPRINTF("reg[%s] <=3D 0x%" PRIx32 "\n", imx6_ccm_reg_name(index), - (uint32_t)value); + trace_imx6_ccm_write(imx6_ccm_reg_name(index), (uint32_t)value); =20 /* * We will do a better implementation later. In particular some bits @@ -591,7 +579,7 @@ static uint64_t imx6_analog_read(void *opaque, hwaddr o= ffset, unsigned size) break; } =20 - DPRINTF("reg[%s] =3D> 0x%" PRIx32 "\n", imx6_analog_reg_name(index), v= alue); + trace_imx6_analog_read(imx6_analog_reg_name(index), value); =20 return (uint64_t)value; } @@ -602,8 +590,7 @@ static void imx6_analog_write(void *opaque, hwaddr offs= et, uint64_t value, uint32_t index =3D offset >> 2; IMX6CCMState *s =3D (IMX6CCMState *)opaque; =20 - DPRINTF("reg[%s] <=3D 0x%" PRIx32 "\n", imx6_analog_reg_name(index), - (uint32_t)value); + trace_imx6_analog_write(imx6_analog_reg_name(index), (uint32_t)value); =20 switch (index) { case CCM_ANALOG_PLL_ARM_SET: diff --git a/hw/misc/trace-events b/hw/misc/trace-events index 426a8472b6..f359fb3add 100644 --- a/hw/misc/trace-events +++ b/hw/misc/trace-events @@ -196,6 +196,21 @@ iotkit_secctl_s_write(uint32_t offset, uint64_t data, = unsigned size) "IoTKit Sec iotkit_secctl_ns_read(uint32_t offset, uint64_t data, unsigned size) "IoTK= it SecCtl NS regs read: offset 0x%x data 0x%" PRIx64 " size %u" iotkit_secctl_ns_write(uint32_t offset, uint64_t data, unsigned size) "IoT= Kit SecCtl NS regs write: offset 0x%x data 0x%" PRIx64 " size %u" =20 +# imx6_ccm.c +imx6_analog_get_periph_clk(uint32_t freq) "freq =3D %u" +imx6_analog_get_pll2_clk(uint32_t freq) "freq =3D %u" +imx6_analog_get_pll2_pfd0_clk(uint32_t freq) "freq =3D %u" +imx6_analog_get_pll2_pfd2_clk(uint32_t freq) "freq =3D %u" +imx6_analog_read(const char *reg, uint32_t value) "reg[%s] =3D> 0x%" PRIx32 +imx6_analog_write(const char *reg, uint32_t value) "reg[%s] <=3D 0x%" PRIx= 32 +imx6_ccm_get_ahb_clk(uint32_t freq) "freq =3D %u" +imx6_ccm_get_ipg_clk(uint32_t freq) "freq =3D %u" +imx6_ccm_get_per_clk(uint32_t freq) "freq =3D %u" +imx6_ccm_get_clock_frequency(unsigned clock, uint32_t freq) "(Clock =3D %d= ) =3D %u" +imx6_ccm_read(const char *reg, uint32_t value) "reg[%s] =3D> 0x%" PRIx32 +imx6_ccm_reset(void) "" +imx6_ccm_write(const char *reg, uint32_t value) "reg[%s] <=3D 0x%" PRIx32 + # imx6ul_ccm.c ccm_entry(void) "" ccm_freq(uint32_t freq) "freq =3D %d" --=20 2.42.0 From nobody Wed Nov 27 13:04:29 2024 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1698496001; cv=none; d=zohomail.com; s=zohoarc; b=FH99nPYD4DY9WKAWHeoTNwXHNJf85H6/9m53RfaqWjdPBqavm03VFM0dmJlr3s+BSPHlST7WznN2VJX2SmVmyAB693zUsf1wOa7VIWFMUO/ptW0s+mZ+PQYGK/H5zJ3QXIdiZwQd0mRkMDWBfYUageMT0PRRQqQh4TbUkI26vCs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698496001; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=fjgdUkcWnddjAoJazRvwcvImmvBOY1raY1kEKMOKf0U=; b=nYUpLx42m20po8EhsFHolu1tewiI9HR1jhl1s78Y+mlknDXsTyK8q6EaB3kJUKvCBfU1w3td8eY07Kp+RuJm9/6E904y9cQ04cg7QPsT6VKILX96LNJ+qnVqCWS0LAdPgNL8gHV+if2mc/B+OMjtKgSWIGl5pXlNYxhVBRmpG5c= 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 1698496001917835.2341594753666; Sat, 28 Oct 2023 05:26:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qwiMp-0006PT-OK; Sat, 28 Oct 2023 08:24:39 -0400 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 1qwiMo-0006OW-Vg; Sat, 28 Oct 2023 08:24:38 -0400 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qwiMn-0006ma-6v; Sat, 28 Oct 2023 08:24:38 -0400 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-53e08e439c7so4972035a12.0; Sat, 28 Oct 2023 05:24:36 -0700 (PDT) Received: from archlinux.. (dynamic-089-012-044-170.89.12.pool.telefonica.de. [89.12.44.170]) by smtp.gmail.com with ESMTPSA id a13-20020a170906190d00b009ae3d711fd9sm2706687eje.69.2023.10.28.05.24.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Oct 2023 05:24:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698495874; x=1699100674; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fjgdUkcWnddjAoJazRvwcvImmvBOY1raY1kEKMOKf0U=; b=kLlozT/wxisgJdu9nNPJ2Doc10Dlgu+5O/FsYU54yO/l+8bd1PCJaKaRAd6/68BTRu dC2/IVL3muAlXZ5CKqkqSFSwgi06cDxrc88TxfnE9Dw6Wt1VzijkFBmWuJG5jBVzx296 h1Bn+ygTpCN3f5aIrFDZwzjZ8/FcS5cDoQ5m9Ev4AGm6lzE2qwfU6fq8h9ZBF1RUL6N+ GoSNBauJRKyP106U1PHQt8thOVVaa7zOxoPfEytVckIbr8xh6qNG9LaJUiumnJ0zA+s3 ZCr9w+lGBAV7j2kywTKJIx6ybVkqNeTdZsIVz6Km+Vg0r+XFVt+UIAaR7o1litvnkBXw T67g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698495874; x=1699100674; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fjgdUkcWnddjAoJazRvwcvImmvBOY1raY1kEKMOKf0U=; b=drvM+RN+6mkbBFkI1YBwoMSr+Nbyy202YyHMq2EyONVOrN522rz0Ht/P7uSXN2No38 nDHnGb4c2pgy1Qf+3J6DNdSdjfvN+qXTicBQpQd1XwKCeoeaUmkVgLgEy6wpJACufe/n erkNSwZ2sil7tdnRif/Y+pNgehCrZLzSUCtzrMEO/XB6V3lKeO3A8D7jmNuA8elHlSAm Sprh4Y7XyfFig0RjFuD/Oq87Gzutcn1y5FbLykR9J59AfvD2jedu2TDY+dlrOL1oe0q7 M/Kj8eVx8U7akGtvf5M5Dkak3MrrBMHDymahO1X6IXnbkw9GFc0iJEUq1/K5J+shEgd3 iSQg== X-Gm-Message-State: AOJu0YxE5D/+Ij4VcJrNBl+4dvxsLDmu55ktPLOeAxLG6XWaVrwZAi2z tPeNV9Cw7e8OnTycuu3tji8W9b7Jy6A= X-Google-Smtp-Source: AGHT+IGOSUYtIgWsA3aFhpnqbGAIgU9Hq/uj5HdoxIXee0RFUX3nzS4IbTyvCi7cbMOImsLF/RAteQ== X-Received: by 2002:a17:907:3603:b0:9be:40ba:5f1 with SMTP id bk3-20020a170907360300b009be40ba05f1mr4436765ejc.60.1698495874201; Sat, 28 Oct 2023 05:24:34 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-trivial@nongnu.org, Stefan Hajnoczi , Jean-Christophe Dubois , qemu-arm@nongnu.org, Andrey Smirnov , Peter Xu , David Hildenbrand , "Michael S. Tsirkin" , Mads Ynddal , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Bernhard Beschow Subject: [PATCH 5/6] hw/i2c/pm_smbus: Convert DPRINTF to trace events Date: Sat, 28 Oct 2023 14:24:14 +0200 Message-ID: <20231028122415.14869-6-shentey@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231028122415.14869-1-shentey@gmail.com> References: <20231028122415.14869-1-shentey@gmail.com> MIME-Version: 1.0 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::533; envelope-from=shentey@gmail.com; helo=mail-ed1-x533.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, FREEMAIL_FROM=0.001, 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 @gmail.com) X-ZM-MESSAGEID: 1698496003986100003 Content-Type: text/plain; charset="utf-8" Let the trace messages slightly deviate from the function names ("smb" -> "smbus") being traced in order to avoid conflights with the SMB protocol. Signed-off-by: Bernhard Beschow Acked-by: Corey Minyard Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/i2c/pm_smbus.c | 18 ++++-------------- hw/i2c/trace-events | 6 ++++++ 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/hw/i2c/pm_smbus.c b/hw/i2c/pm_smbus.c index 4e1b8a5182..78e7c229a8 100644 --- a/hw/i2c/pm_smbus.c +++ b/hw/i2c/pm_smbus.c @@ -23,6 +23,7 @@ #include "hw/i2c/pm_smbus.h" #include "hw/i2c/smbus_master.h" #include "migration/vmstate.h" +#include "trace.h" =20 #define SMBHSTSTS 0x00 #define SMBHSTCNT 0x02 @@ -64,15 +65,6 @@ #define AUX_BLK (1 << 1) #define AUX_MASK 0x3 =20 -/*#define DEBUG*/ - -#ifdef DEBUG -# define SMBUS_DPRINTF(format, ...) printf(format, ## __VA_ARGS__) -#else -# define SMBUS_DPRINTF(format, ...) do { } while (0) -#endif - - static void smb_transaction(PMSMBus *s) { uint8_t prot =3D (s->smb_ctl >> 2) & 0x07; @@ -82,7 +74,7 @@ static void smb_transaction(PMSMBus *s) I2CBus *bus =3D s->smbus; int ret; =20 - SMBUS_DPRINTF("SMBus trans addr=3D0x%02x prot=3D0x%02x\n", addr, prot); + trace_smbus_transaction(addr, prot); /* Transaction isn't exec if STS_DEV_ERR bit set */ if ((s->smb_stat & STS_DEV_ERR) !=3D 0) { goto error; @@ -258,8 +250,7 @@ static void smb_ioport_writeb(void *opaque, hwaddr addr= , uint64_t val, PMSMBus *s =3D opaque; uint8_t clear_byte_done; =20 - SMBUS_DPRINTF("SMB writeb port=3D0x%04" HWADDR_PRIx - " val=3D0x%02" PRIx64 "\n", addr, val); + trace_smbus_ioport_writeb(addr, val); switch(addr) { case SMBHSTSTS: clear_byte_done =3D s->smb_stat & val & STS_BYTE_DONE; @@ -429,8 +420,7 @@ static uint64_t smb_ioport_readb(void *opaque, hwaddr a= ddr, unsigned width) val =3D 0; break; } - SMBUS_DPRINTF("SMB readb port=3D0x%04" HWADDR_PRIx " val=3D0x%02x\n", - addr, val); + trace_smbus_ioport_readb(addr, val); =20 if (s->set_irq) { s->set_irq(s, smb_irq_value(s)); diff --git a/hw/i2c/trace-events b/hw/i2c/trace-events index d7b1e25858..6900e06eda 100644 --- a/hw/i2c/trace-events +++ b/hw/i2c/trace-events @@ -15,6 +15,12 @@ i2c_send_async(uint8_t address, uint8_t data) "send_asyn= c(addr:0x%02x) data:0x%0 i2c_recv(uint8_t address, uint8_t data) "recv(addr:0x%02x) data:0x%02x" i2c_ack(void) "" =20 +# pm_smbus.c + +smbus_ioport_readb(uint16_t addr, uint8_t data) "[0x%04" PRIx16 "] -> val= =3D0x%02x" +smbus_ioport_writeb(uint16_t addr, uint8_t data) "[0x%04" PRIx16 "] <- val= =3D0x%02x" +smbus_transaction(uint8_t addr, uint8_t prot) "addr=3D0x%02x prot=3D0x%02x" + # allwinner_i2c.c =20 allwinner_i2c_read(const char* reg_name, uint64_t offset, uint64_t value) = "read %s [0x%" PRIx64 "]: -> 0x%" PRIx64 --=20 2.42.0 From nobody Wed Nov 27 13:04:29 2024 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=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1698496005; cv=none; d=zohomail.com; s=zohoarc; b=f5uq0CI+VHGTBFmsdbnbNpczVAVwrWyF0ZQKYRbEqAN4OJTK1CR0550mOXwCQuRgbqLQMFiJHBdDpDS3kWKrPmttWjNjlLI8LEdkrSGHbtS0RC/M2bHL6QUyrtN6seV3A0X1L0GFa+v3m3V6CDE5SdFDxsDTWUuQroPOiCI5O3s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1698496005; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=/GoSWYHVdJxtZMHJ3DaJORKAAQ1OsmJR2yJLwNoj76I=; b=l9gjbJjdokqaZcpKMG75MdO47j/1QVCThkzPZQRcJ62MnoCBtWjio/CfAmJ3EU8eJEX+umZW8QNedQSmzWWltLSXxYMeXye+N3Wze4iPuTtl3JLj4Zj5ggiOYPGavWGMWTo5VJMAN3pjxJcUb7AUmDlmRN0gBwC5aFZ+QiSq5Ag= 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 1698496005606679.200539633308; Sat, 28 Oct 2023 05:26:45 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qwiMs-0006SA-FY; Sat, 28 Oct 2023 08:24:42 -0400 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 1qwiMq-0006Pt-Bb; Sat, 28 Oct 2023 08:24:40 -0400 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qwiMo-0006mm-G8; Sat, 28 Oct 2023 08:24:40 -0400 Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-9c603e2354fso601583366b.1; Sat, 28 Oct 2023 05:24:37 -0700 (PDT) Received: from archlinux.. (dynamic-089-012-044-170.89.12.pool.telefonica.de. [89.12.44.170]) by smtp.gmail.com with ESMTPSA id a13-20020a170906190d00b009ae3d711fd9sm2706687eje.69.2023.10.28.05.24.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Oct 2023 05:24:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698495876; x=1699100676; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/GoSWYHVdJxtZMHJ3DaJORKAAQ1OsmJR2yJLwNoj76I=; b=Os35jh3vSGYS+W3icYzpWjuC54e2nb/8PddHFPhst+Nwk4JJsFyEYESmGu3MXh2IHG /YLKAy3g0tigPeUZNrxouKqOmwwNhBnCQ77XrSmt630gmhBGZNlEqD3FWc9a7VKzMXVR glM49MD4Wu6LdB5QH7JPwQNI0ZwzLMIP74wKwLh4OBcsCBeRHtDGLHTwKSGQZdDfwjTi UsQ7ifrWCDWYj1TZbxGRqKRDi/t1tqrVr4xpdp4+6Pa6TJXrrw2unMkYcvlfQzu+oDeY yjQYmGrM42x/qFaptdsSkZ+B04NEb86um0IjBfkRO1iOAVxxlfrg2V8l4AgFS5S2hlKW tEXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698495876; x=1699100676; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/GoSWYHVdJxtZMHJ3DaJORKAAQ1OsmJR2yJLwNoj76I=; b=gql46KPm8Ut+HdzmqMqLYNLQVfeXV/GP7MZb8WfsyFjmXXA3XpX801EMfQgdAHA5wg UZ9/pCIDsCVj8gb8e7IrUzrWycNDm8pZFjonwCRB7LQyQhMlCCVC3YqUqQ5I8FXVGs2j ZpLm+2bhwttY56fb3gG7Hb5OStEkvw1OqqaC58oHmJGqEl9JgIcAu1Xlo946xLASm9Au GkGIJPBUbV5LOZvGA6JVb2jV5hOYb5cjpXFoqAsg3oBLSAi4fA1kIMvzQZAkLDsN8mkc oyCSBl5sif37dxcSz90hUe4x0V/n0JxDlYiFttewfT8Es/dm4vHuuAvcCDuK/7aEDIZv 0iow== X-Gm-Message-State: AOJu0YwFbQny0miT72dG2aVnK0kV4kbuzwYlDKhxpW3/mUhbg4KYlVbU LlyIrXXyp6KsJLnlB7urw6r+sheWdF0= X-Google-Smtp-Source: AGHT+IFpJnCcmIPAyCQS5J2XnD3aUcaurKWq0yz3/LzmMZfo46oKmGit8kNjPYmVG55aNlOz3MjOAA== X-Received: by 2002:a17:907:94d1:b0:9ae:699d:8a31 with SMTP id dn17-20020a17090794d100b009ae699d8a31mr4595836ejc.33.1698495875718; Sat, 28 Oct 2023 05:24:35 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: Peter Maydell , qemu-trivial@nongnu.org, Stefan Hajnoczi , Jean-Christophe Dubois , qemu-arm@nongnu.org, Andrey Smirnov , Peter Xu , David Hildenbrand , "Michael S. Tsirkin" , Mads Ynddal , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Bernhard Beschow Subject: [PATCH 6/6] system/memory: Trace names of MemoryRegions rather than host pointers Date: Sat, 28 Oct 2023 14:24:15 +0200 Message-ID: <20231028122415.14869-7-shentey@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231028122415.14869-1-shentey@gmail.com> References: <20231028122415.14869-1-shentey@gmail.com> MIME-Version: 1.0 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::634; envelope-from=shentey@gmail.com; helo=mail-ej1-x634.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, FREEMAIL_FROM=0.001, 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 @gmail.com) X-ZM-MESSAGEID: 1698496005950100005 Content-Type: text/plain; charset="utf-8" Tracing the host pointer of the accessed MemoryRegion seems to be a debug feature for developing QEMU itself. When analyzing guest behavior by compar= ing traces, these pointers generate a lot of noise since the pointers differ be= tween QEMU invocations, making this task harder than it needs to be. Moreover, the pointers seem to be redundant to the names already assigned to MemoryRegion= s. Remove the pointers from the traces and trace the names where missing. When developing QEMU, developers could just add the host pointer tracing for themselves. Signed-off-by: Bernhard Beschow --- docs/devel/tracing.rst | 4 ++-- system/memory.c | 26 ++++++++++++++++---------- system/trace-events | 12 ++++++------ 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/docs/devel/tracing.rst b/docs/devel/tracing.rst index d288480db1..8c31d5f76e 100644 --- a/docs/devel/tracing.rst +++ b/docs/devel/tracing.rst @@ -18,8 +18,8 @@ events:: =20 $ qemu --trace "memory_region_ops_*" ... ... - 719585@1608130130.441188:memory_region_ops_read cpu 0 mr 0x562fdfbb382= 0 addr 0x3cc value 0x67 size 1 - 719585@1608130130.441190:memory_region_ops_write cpu 0 mr 0x562fdfbd2f= 00 addr 0x3d4 value 0x70e size 2 + 719585@1608130130.441188:memory_region_ops_read cpu 0 addr 0x3cc value= 0x67 size 1 + 719585@1608130130.441190:memory_region_ops_write cpu 0 addr 0x3d4 valu= e 0x70e size 2 =20 This output comes from the "log" trace backend that is enabled by default = when ``./configure --enable-trace-backends=3DBACKENDS`` was not explicitly spec= ified. diff --git a/system/memory.c b/system/memory.c index 4928f2525d..076a992b74 100644 --- a/system/memory.c +++ b/system/memory.c @@ -444,10 +444,11 @@ static MemTxResult memory_region_read_accessor(Memor= yRegion *mr, =20 tmp =3D mr->ops->read(mr->opaque, addr, size); if (mr->subpage) { - trace_memory_region_subpage_read(get_cpu_index(), mr, addr, tmp, s= ize); + trace_memory_region_subpage_read(get_cpu_index(), addr, tmp, size, + memory_region_name(mr)); } else if (trace_event_get_state_backends(TRACE_MEMORY_REGION_OPS_READ= )) { hwaddr abs_addr =3D memory_region_to_absolute_addr(mr, addr); - trace_memory_region_ops_read(get_cpu_index(), mr, abs_addr, tmp, s= ize, + trace_memory_region_ops_read(get_cpu_index(), abs_addr, tmp, size, memory_region_name(mr)); } memory_region_shift_read_access(value, shift, mask, tmp); @@ -467,10 +468,11 @@ static MemTxResult memory_region_read_with_attrs_acce= ssor(MemoryRegion *mr, =20 r =3D mr->ops->read_with_attrs(mr->opaque, addr, &tmp, size, attrs); if (mr->subpage) { - trace_memory_region_subpage_read(get_cpu_index(), mr, addr, tmp, s= ize); + trace_memory_region_subpage_read(get_cpu_index(), addr, tmp, size, + memory_region_name(mr)); } else if (trace_event_get_state_backends(TRACE_MEMORY_REGION_OPS_READ= )) { hwaddr abs_addr =3D memory_region_to_absolute_addr(mr, addr); - trace_memory_region_ops_read(get_cpu_index(), mr, abs_addr, tmp, s= ize, + trace_memory_region_ops_read(get_cpu_index(), abs_addr, tmp, size, memory_region_name(mr)); } memory_region_shift_read_access(value, shift, mask, tmp); @@ -488,10 +490,11 @@ static MemTxResult memory_region_write_accessor(Memor= yRegion *mr, uint64_t tmp =3D memory_region_shift_write_access(value, shift, mask); =20 if (mr->subpage) { - trace_memory_region_subpage_write(get_cpu_index(), mr, addr, tmp, = size); + trace_memory_region_subpage_write(get_cpu_index(), addr, tmp, size, + memory_region_name(mr)); } else if (trace_event_get_state_backends(TRACE_MEMORY_REGION_OPS_WRIT= E)) { hwaddr abs_addr =3D memory_region_to_absolute_addr(mr, addr); - trace_memory_region_ops_write(get_cpu_index(), mr, abs_addr, tmp, = size, + trace_memory_region_ops_write(get_cpu_index(), abs_addr, tmp, size, memory_region_name(mr)); } mr->ops->write(mr->opaque, addr, tmp, size); @@ -509,10 +512,11 @@ static MemTxResult memory_region_write_with_attrs_acc= essor(MemoryRegion *mr, uint64_t tmp =3D memory_region_shift_write_access(value, shift, mask); =20 if (mr->subpage) { - trace_memory_region_subpage_write(get_cpu_index(), mr, addr, tmp, = size); + trace_memory_region_subpage_write(get_cpu_index(), addr, tmp, size, + memory_region_name(mr)); } else if (trace_event_get_state_backends(TRACE_MEMORY_REGION_OPS_WRIT= E)) { hwaddr abs_addr =3D memory_region_to_absolute_addr(mr, addr); - trace_memory_region_ops_write(get_cpu_index(), mr, abs_addr, tmp, = size, + trace_memory_region_ops_write(get_cpu_index(), abs_addr, tmp, size, memory_region_name(mr)); } return mr->ops->write_with_attrs(mr->opaque, addr, tmp, size, attrs); @@ -1356,7 +1360,8 @@ static uint64_t memory_region_ram_device_read(void *o= paque, break; } =20 - trace_memory_region_ram_device_read(get_cpu_index(), mr, addr, data, s= ize); + trace_memory_region_ram_device_read(get_cpu_index(), addr, data, size, + memory_region_name(mr)); =20 return data; } @@ -1366,7 +1371,8 @@ static void memory_region_ram_device_write(void *opaq= ue, hwaddr addr, { MemoryRegion *mr =3D opaque; =20 - trace_memory_region_ram_device_write(get_cpu_index(), mr, addr, data, = size); + trace_memory_region_ram_device_write(get_cpu_index(), addr, data, size, + memory_region_name(mr)); =20 switch (size) { case 1: diff --git a/system/trace-events b/system/trace-events index 69c9044151..21f1c005e0 100644 --- a/system/trace-events +++ b/system/trace-events @@ -9,12 +9,12 @@ cpu_in(unsigned int addr, char size, unsigned int val) "a= ddr 0x%x(%c) value %u" cpu_out(unsigned int addr, char size, unsigned int val) "addr 0x%x(%c) val= ue %u" =20 # memory.c -memory_region_ops_read(int cpu_index, void *mr, uint64_t addr, uint64_t va= lue, unsigned size, const char *name) "cpu %d mr %p addr 0x%"PRIx64" value = 0x%"PRIx64" size %u name '%s'" -memory_region_ops_write(int cpu_index, void *mr, uint64_t addr, uint64_t v= alue, unsigned size, const char *name) "cpu %d mr %p addr 0x%"PRIx64" value= 0x%"PRIx64" size %u name '%s'" -memory_region_subpage_read(int cpu_index, void *mr, uint64_t offset, uint6= 4_t value, unsigned size) "cpu %d mr %p offset 0x%"PRIx64" value 0x%"PRIx64= " size %u" -memory_region_subpage_write(int cpu_index, void *mr, uint64_t offset, uint= 64_t value, unsigned size) "cpu %d mr %p offset 0x%"PRIx64" value 0x%"PRIx6= 4" size %u" -memory_region_ram_device_read(int cpu_index, void *mr, uint64_t addr, uint= 64_t value, unsigned size) "cpu %d mr %p addr 0x%"PRIx64" value 0x%"PRIx64"= size %u" -memory_region_ram_device_write(int cpu_index, void *mr, uint64_t addr, uin= t64_t value, unsigned size) "cpu %d mr %p addr 0x%"PRIx64" value 0x%"PRIx64= " size %u" +memory_region_ops_read(int cpu_index, uint64_t addr, uint64_t value, unsig= ned size, const char *name) "cpu %d addr 0x%"PRIx64" value 0x%"PRIx64" size= %u name '%s'" +memory_region_ops_write(int cpu_index, uint64_t addr, uint64_t value, unsi= gned size, const char *name) "cpu %d addr 0x%"PRIx64" value 0x%"PRIx64" siz= e %u name '%s'" +memory_region_subpage_read(int cpu_index, uint64_t offset, uint64_t value,= unsigned size, const char *name) "cpu %d offset 0x%"PRIx64" value 0x%"PRIx= 64" size %u name '%s'" +memory_region_subpage_write(int cpu_index, uint64_t offset, uint64_t value= , unsigned size, const char *name) "cpu %d offset 0x%"PRIx64" value 0x%"PRI= x64" size %u name '%s'" +memory_region_ram_device_read(int cpu_index, uint64_t addr, uint64_t value= , unsigned size, const char *name) "cpu %d addr 0x%"PRIx64" value 0x%"PRIx6= 4" size %u name '%s'" +memory_region_ram_device_write(int cpu_index, uint64_t addr, uint64_t valu= e, unsigned size, const char *name) "cpu %d addr 0x%"PRIx64" value 0x%"PRIx= 64" size %u name '%s'" memory_region_sync_dirty(const char *mr, const char *listener, int global)= "mr '%s' listener '%s' synced (global=3D%d)" flatview_new(void *view, void *root) "%p (root %p)" flatview_destroy(void *view, void *root) "%p (root %p)" --=20 2.42.0