From nobody Tue Feb 10 04:17:23 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=amsat.org ARC-Seal: i=1; a=rsa-sha256; t=1592694546; cv=none; d=zohomail.com; s=zohoarc; b=HF0oHeFND3aF6bJh0I9ko6MzWwtDiQWhFtH738ouweds9u1ap9ZPKV9Iq67X5/r8r1aSLADv+7CHrhlwt6S/WElHudX229oSVAKgJZ7D7y353AtuUAoBuJYXFuYt6ee6HGBhN7D+TtmNyAQcSm8Jjibt/wFOBGuPZGks6dZDcl0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1592694546; h=Content-Type:Content-Transfer-Encoding:Cc: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=+2AZIJNfLoRM7W1nhvrnhDoshMHCbhObjMtaHucBvyY=; b=c/98twY6Aa/kKlMAJdnJo9ZclRqMCfXOQl82W7HCz91Gu0LsC+jlDyVvdLu7AijdSkwBusiXCPxVSudnASYOQdMvDfgx1UOu7M3RL+0HSxpYXYwLuhT/si8ORp9LX0v3lGcbk4dlw4k6WYoa0iQmZcjObDHp1Js10V8y/BV1WRs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1592694546061495.1513821155287; Sat, 20 Jun 2020 16:09:06 -0700 (PDT) Received: from localhost ([::1]:57924 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jmmbg-0000Lv-TQ for importer@patchew.org; Sat, 20 Jun 2020 19:09:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42238) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jmma9-00072v-SO; Sat, 20 Jun 2020 19:07:29 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:55629) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jmma8-0002MO-9I; Sat, 20 Jun 2020 19:07:29 -0400 Received: by mail-wm1-x343.google.com with SMTP id g75so3579642wme.5; Sat, 20 Jun 2020 16:07:27 -0700 (PDT) Received: from localhost.localdomain (1.red-83-51-162.dynamicip.rima-tde.net. [83.51.162.1]) by smtp.gmail.com with ESMTPSA id o82sm11455037wmo.40.2020.06.20.16.07.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Jun 2020 16:07:25 -0700 (PDT) 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=+2AZIJNfLoRM7W1nhvrnhDoshMHCbhObjMtaHucBvyY=; b=MMXuAsbKzPtw7rmEOVHoV8Oop7VX86Tkj4DrAl46aA2mOaOjz9HzpDmKsuaVb3KxAh vku1E6fv41DU2qKN5/D+apHbo4FGqnox4RyNYrHt5VvY+8EsveqC8YmK1OXEDuS1MLv6 nnN16xbYLL7YSHdKEetrrSYx3MObTS434z8+rB4cjjSrElsXRW19Cz+KgtXH2bSVf5PB 0Gl/VTOvmqCA6C1thQIhux6Q/gqgjRsEVHhDk/q6VcZVNjp12hxvvgDq6uE0cDOX3Q1+ gdhUDQJ9LfETRUJxOJts5Zy/8OS7uyFZ/bxE7xkVe3RI5eNdwuuyJX0jskt66g0XZGR6 QPQw== 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=+2AZIJNfLoRM7W1nhvrnhDoshMHCbhObjMtaHucBvyY=; b=b+KculVetlfRO6zn8u8sDOLP4bzyPkp08Ohxl6V8zellPfSuMlcK4MLHPt0FFEteN4 ouzfaKNusJb6F3gISDfFs5bcUBcG8uBK70/FpdWXmKssaZ9w1EonD9VQCWmBaTJtuEeD EmUKF7evW2nnraXO6Qh5r0z6iZyJTvhTXI2AFqqh4R8ovhDmLE6Mnn9JdX4xZfd6dH+m KkfvBfhuR4pOgd4NovG6jOc6TolkwvRMLv5yZfWj1uXJUjmYQiD+E5hQE5O0BofLMKLM at6iFsopT7Cy7LA8Lz7j2/PR/Q6Hn6XHDqJjUJaR+twfU3UgUZLFFAMUrTSpRi6mkEKM zbPw== X-Gm-Message-State: AOAM532x9SitZDXnAXYBtRQNqO6o3MeV7UZ1fpAiwFuGsLuV47+NO61M /st3rRQxgCDVEHBcH60fbbUA8olp X-Google-Smtp-Source: ABdhPJyGR+eoAV+MqIXDn7Tg8PLjadjC83sNT4bs9d5/O/4DfozIbWEBtPwgqLm7Ep1FjMQj+cyLiA== X-Received: by 2002:a7b:cc8b:: with SMTP id p11mr39464wma.180.1592694446355; Sat, 20 Jun 2020 16:07:26 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v3 3/7] hw/misc/led: Emit a trace event when LED intensity has changed Date: Sun, 21 Jun 2020 01:07:15 +0200 Message-Id: <20200620230719.32139-4-f4bug@amsat.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200620230719.32139-1-f4bug@amsat.org> References: <20200620230719.32139-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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::343; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x343.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: 0 X-Spam_score: 0.0 X-Spam_bar: / X-Spam_report: (0.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=1, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@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 , Andrew Jeffery , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, Joel Stanley , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Track the LED intensity, and emit a trace event when it changes. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/hw/misc/led.h | 1 + hw/misc/led.c | 5 +++++ hw/misc/trace-events | 1 + 3 files changed, 7 insertions(+) diff --git a/include/hw/misc/led.h b/include/hw/misc/led.h index 883006bb8f..df5b32a2db 100644 --- a/include/hw/misc/led.h +++ b/include/hw/misc/led.h @@ -35,6 +35,7 @@ typedef struct LEDState { DeviceState parent_obj; /* Public */ =20 + uint16_t current_intensity; qemu_irq irq; =20 /* Properties */ diff --git a/hw/misc/led.c b/hw/misc/led.c index 8503dde777..37d9f1f3d2 100644 --- a/hw/misc/led.c +++ b/hw/misc/led.c @@ -32,6 +32,11 @@ void led_set_intensity(LEDState *s, uint16_t new_intensi= ty) { trace_led_set_intensity(s->description ? s->description : "n/a", s->color, new_intensity); + if (new_intensity !=3D s->current_intensity) { + trace_led_change_intensity(s->description ? s->description : "n/a", + s->color, + s->current_intensity, new_intensity); + } s->current_intensity =3D new_intensity; } =20 diff --git a/hw/misc/trace-events b/hw/misc/trace-events index f58853d367..57d39bf9b9 100644 --- a/hw/misc/trace-events +++ b/hw/misc/trace-events @@ -209,6 +209,7 @@ grlib_apb_pnp_read(uint64_t addr, uint32_t value) "APB = PnP read addr:0x%03"PRIx6 =20 # led.c led_set_intensity(const char *color, const char *desc, uint16_t intensity)= "LED desc:'%s' color:%s intensity: 0x%04"PRIx16 +led_change_intensity(const char *color, const char *desc, uint16_t old_int= ensity, uint16_t new_intensity) "LED desc:'%s' color:%s intensity 0x%04"PRI= x16" -> 0x%04"PRIx16"" =20 # pca9552.c pca9552_gpio_status(const char *description, const char *buf) "%s GPIOs 0-= 15 [%s]" --=20 2.21.3