From patchwork Tue Nov 5 22:47:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 840843 Delivered-To: patch@linaro.org Received: by 2002:a5d:6307:0:b0:381:e71e:8f7b with SMTP id i7csp241110wru; Tue, 5 Nov 2024 14:53:57 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUhec/z2mEqILNbOk17EcxcrSLwZHRsxUcI2N2RYNd08WbGnrKQtlIHXAH4wxjpESarP3g8Kg==@linaro.org X-Google-Smtp-Source: AGHT+IHOzDkZQu6dutihjfNAsjTrQKgM49NfF4O43JeAP4ymY61YAQSIhVV4R9DXYxDYMVc9mNrt X-Received: by 2002:ac8:598e:0:b0:461:4371:f660 with SMTP id d75a77b69052e-462ab2fc8f2mr352805581cf.37.1730847237560; Tue, 05 Nov 2024 14:53:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1730847237; cv=none; d=google.com; s=arc-20240605; b=YUXFsujXUNwopkRlNLYr4hswlwLJ21MtBhCeYE4flIhDgqCY9rFZw/3X+sgngPuLJs B5dRmfpW0j9u9PUcTaNBIlYuU6MuVD76IG602e8jsUrFXpWemOZ5wjL+fzzgvSZiu3TF 94kNZtjO7yVyhkr+qjyaqk7L11VuIKND2itAZLMG9MRhc6nChOL5ekum5uot2YV9LTMv Tc7/3dntjptTS20GE7y1UE3Mi7qF9h30napZsbYqIOitbTAW0fatdAOn4Iuzz5aypehd Ayaw7Nxi+ccluB0wg9IZcml7GLsF08AUVI3+VBktodvZAVPzOW9NLvf17/kZCwp/y9sD s/Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=Sfn7cm81gRHlzMkLVCOGrjRL5gmP+m5CKJ7vqtP/iic=; fh=I7y3H1hRzG+Zc0HcIfXOdhCN5cL1tidIXJb5yvpXrHk=; b=DV9/egHezOKRCEDg1vcwBiAcAd1BIij2STqMHWcnB7mJyYCEwOx5pI7BVfzrvHJ+4z YVei1xgiqhwSJzQ7beBimO13MmgU5UJmasQgJEGVUygqCrEtOiW4vHATqqf6bfqRENFn i297JeJNdiRYNk30BtW4Woegx0VTSWOCBQ/pRHjOJOO9iNIbGyC85oxTnbhE2G3puYkq 4InQ6+NbJ5FkT3/bUaRX5WoOrLlPjTl15gKMXsv16U08IK3Aym0DD9rjtgCYDQJfO5i2 2FLiUZYx4LqoHTgU3nyFOAujho3UrUj1pQNtl8zJlr3NIYW0NObl8PYho8rXJBjFm6RP 9ddg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ATRx8l5p; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-462ad1f20d0si139750161cf.424.2024.11.05.14.53.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Nov 2024 14:53:57 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ATRx8l5p; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t8SMV-00079I-3l; Tue, 05 Nov 2024 17:49:23 -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 1t8SM6-0006fm-OX for qemu-devel@nongnu.org; Tue, 05 Nov 2024 17:48:59 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t8SM5-0004JT-4X for qemu-devel@nongnu.org; Tue, 05 Nov 2024 17:48:58 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-431548bd1b4so50892425e9.3 for ; Tue, 05 Nov 2024 14:48:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1730846935; x=1731451735; 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=Sfn7cm81gRHlzMkLVCOGrjRL5gmP+m5CKJ7vqtP/iic=; b=ATRx8l5pKW0PgFupOjzjzh6P0af7g5/gpWeYUlztUxck+iOCt4zjAvPBww0DrFmy3D blMiCHzfjnnQfe/IbRSgh1FmEqqyqHYQKCnRAkyEhol1fI6o+9rglVzct3I++CHiAbiy 9iufu3JbT2TJjr7izV52mUV/zFEkkngrwmitOy2cqJgGXxLs7p8d9AhfqSN+wfznsuMi L+E47g6WY12+tVqZipgihnYMX9tH6guq1y9IXj+9Djg4kMzOKlixChxjRFdqBHxJQOkE ay8rjVkK3Og7Anu3aqtrMygX/1Gi9simJ6VWYinR5N9gOCvfjGabjTKwKyoZxHqj45oC bCXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730846935; x=1731451735; 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=Sfn7cm81gRHlzMkLVCOGrjRL5gmP+m5CKJ7vqtP/iic=; b=reuRFUep8/ODGgdugIsFJMDOvJXgEXI2UXi4kgf9itg6IgDGviKEYMXWLDUHW9DEe/ CVr4oBxwzIbOe/JByrasLMEK4RBop5+hdOe+KK9O/Rskx3O/iQyKuwYLe/jCiSWDXFXB nu+Gu5p3h6tzF0NLKOllyMsMSDXaUgP37xVF3ksSDKC/IpuK3phd1qL024jvfHFLM4gH rEWhk1/rjUaEJCiMqBVNdojNhuD5j2qGYzJL3vzfDBArbvzhses/NMGem6CAiD2mfpbX nD06F56wkKMRlRbVvLjrzMmm5NRIIRMVNUDdBS1VPoMer5+B+I2taRSPoo3TUHwMcPoN Ii3Q== X-Gm-Message-State: AOJu0YypivYzFMBStF78G/PFtp0hDcpn3cjOOPbD1B0r49OUAipwm1nD 72hfO+x2l7yXEmxdWU/lkaHazeK3BeFYqlUGSg5Nv7mfhhB7K7LXo8jxlVOEh0S7mB8IC7CgwEu Fal04pg== X-Received: by 2002:a05:6000:788:b0:37d:4cee:55b with SMTP id ffacd0b85a97d-381c7ae3095mr13007244f8f.59.1730846935423; Tue, 05 Nov 2024 14:48:55 -0800 (PST) Received: from localhost.localdomain ([89.101.134.25]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-381c10d49dfsm17451083f8f.46.2024.11.05.14.48.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 05 Nov 2024 14:48:54 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bernhard Beschow , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Corey Minyard , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 16/29] hw/i2c/mpc_i2c: Convert DPRINTF to trace events for register access Date: Tue, 5 Nov 2024 22:47:14 +0000 Message-ID: <20241105224727.53059-17-philmd@linaro.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241105224727.53059-1-philmd@linaro.org> References: <20241105224727.53059-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Bernhard Beschow Reviewed-by: Cédric Le Goater Acked-by: Corey Minyard Signed-off-by: Bernhard Beschow Message-ID: <20241103133412.73536-12-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé --- hw/i2c/mpc_i2c.c | 9 +++++---- hw/i2c/trace-events | 5 +++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/hw/i2c/mpc_i2c.c b/hw/i2c/mpc_i2c.c index 2467d1a9aa2..3d79c156531 100644 --- a/hw/i2c/mpc_i2c.c +++ b/hw/i2c/mpc_i2c.c @@ -24,6 +24,7 @@ #include "hw/sysbus.h" #include "migration/vmstate.h" #include "qom/object.h" +#include "trace.h" /* #define DEBUG_I2C */ @@ -224,8 +225,8 @@ static uint64_t mpc_i2c_read(void *opaque, hwaddr addr, unsigned size) break; } - DPRINTF("%s: addr " HWADDR_FMT_plx " %02" PRIx32 "\n", __func__, - addr, value); + trace_mpc_i2c_read(addr, value); + return (uint64_t)value; } @@ -234,8 +235,8 @@ static void mpc_i2c_write(void *opaque, hwaddr addr, { MPCI2CState *s = opaque; - DPRINTF("%s: addr " HWADDR_FMT_plx " val %08" PRIx64 "\n", __func__, - addr, value); + trace_mpc_i2c_write(addr, value); + switch (addr) { case MPC_I2C_ADR: s->adr = value & CADR_MASK; diff --git a/hw/i2c/trace-events b/hw/i2c/trace-events index 6900e06edad..f708a7ace18 100644 --- a/hw/i2c/trace-events +++ b/hw/i2c/trace-events @@ -35,6 +35,11 @@ aspeed_i2c_bus_write(uint32_t busid, uint64_t offset, unsigned size, uint64_t va aspeed_i2c_bus_send(const char *mode, int i, int count, uint8_t byte) "%s send %d/%d 0x%02x" aspeed_i2c_bus_recv(const char *mode, int i, int count, uint8_t byte) "%s recv %d/%d 0x%02x" +# mpc_i2c.c + +mpc_i2c_read(uint64_t addr, uint32_t value) "[0x%" PRIx64 "] -> 0x%02" PRIx32 +mpc_i2c_write(uint64_t addr, uint32_t value) "[0x%" PRIx64 "] <- 0x%02" PRIx32 + # npcm7xx_smbus.c npcm7xx_smbus_read(const char *id, uint64_t offset, uint64_t value, unsigned size) "%s offset: 0x%04" PRIx64 " value: 0x%02" PRIx64 " size: %u"