From patchwork Thu Sep 10 20:54:25 2020 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: 273972 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D17B1C43461 for ; Thu, 10 Sep 2020 20:57:22 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 53CDA21D7E for ; Thu, 10 Sep 2020 20:57:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="upX18BBU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 53CDA21D7E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:48492 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kGTdB-0001Id-Bd for qemu-devel@archiver.kernel.org; Thu, 10 Sep 2020 16:57:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41058) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kGTaY-0004DY-Pw; Thu, 10 Sep 2020 16:54:38 -0400 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:40432) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kGTaX-0000HI-BQ; Thu, 10 Sep 2020 16:54:38 -0400 Received: by mail-wr1-x431.google.com with SMTP id j2so8648428wrx.7; Thu, 10 Sep 2020 13:54:36 -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=Pg2UbiPnEyj3JIOQp/7lnXV/UdSauRuubalG7cq91s0=; b=upX18BBU9qj81TIw224hWd7f9RodAdsuGcLJF8YW8hkxK/1nX1QocqrHGG08utTLXb c+ahbIOqRY6ci46wv5yx10szetuUy9cwJEZIQCyd2gD/sc/esJCRqzl1Q0zbi/pfatX2 rYyP+zidhMPc3gJyCXj9x4B7j20w/CwTWi2l/gk7+ZAmBf38gTAYyjl+pgclpuNDpE4F iHY/ReqDZDTJkh8GirSxLq3nGpSFW7WoVluLlAuC8ezn57ClopgsL+iGZTYnd2Zd+/YW qPabM5r8vhZWGpdyH5kNZWhaqnHDqrGMZZM6LCIZrR4pN8wKvbgF5ki8+0uuJIny7p58 96Yw== 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=Pg2UbiPnEyj3JIOQp/7lnXV/UdSauRuubalG7cq91s0=; b=WWvLeYphv3/jSP5OAzlrFcfi7kBIEzZahE8lHmteay9MgN91U7ttQBDr8KoUVmrfOn 0ulYSCCmYXGozvDT/kIe0YuMUo03L93ekMXiVzB3eFHkeUnBihsK/HlbkolQOmnBIFxy V1mn23wV14WBV5xrTanVtUyw7vUcLm+6kRBYjK8OmEt/xQABje3zXao03iXwvt6whOZN 0TsSs0Z07fMy3vnadNZMYKE3iwyB556hUal4RrERL3L6DPeRoTzD7YVaATlxqDYsRYLK nLJNqnn115aucE9qa/8dSdpxK2xK1xM7QPOugGyDcj3QgxXxvU1KDh2O5iDouuclfd/S 57Zw== X-Gm-Message-State: AOAM533/htCiWPDINEA335EhRZd142PeIB3coC/K2nTMrDESqofGZeOd fYfyQWPGlmmuPw+8MOTkxBz1W+CF/3o= X-Google-Smtp-Source: ABdhPJxtI5kY0fz0HXzHsDqTwqgijyyUagdhcuYMVPv8h6iRNy4t+RQq+G/25ecdRgBI419gf+JiKQ== X-Received: by 2002:a5d:62c2:: with SMTP id o2mr10657829wrv.418.1599771275494; Thu, 10 Sep 2020 13:54:35 -0700 (PDT) Received: from x1w.redhat.com (65.red-83-57-170.dynamicip.rima-tde.net. [83.57.170.65]) by smtp.gmail.com with ESMTPSA id t1sm5089317wmi.16.2020.09.10.13.54.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 13:54:34 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v5 3/7] hw/misc/led: Emit a trace event when LED intensity has changed Date: Thu, 10 Sep 2020 22:54:25 +0200 Message-Id: <20200910205429.727766-4-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200910205429.727766-1-f4bug@amsat.org> References: <20200910205429.727766-1-f4bug@amsat.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wr1-x431.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: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no 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 , =?utf-8?q?Daniel_P=2E_Berran?= =?utf-8?b?Z8Op?= , Eduardo Habkost , Andrew Jeffery , Richard Henderson , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-arm@nongnu.org, =?utf-8?q?C=C3=A9dric_Le_Goater?= , Paolo Bonzini , Luc Michel , Joel Stanley Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Track the LED intensity, and emit a trace event when it changes. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- hw/misc/led.c | 4 ++++ hw/misc/trace-events | 1 + 2 files changed, 5 insertions(+) diff --git a/hw/misc/led.c b/hw/misc/led.c index 3ef4f5e0469..ebe1fa45b1e 100644 --- a/hw/misc/led.c +++ b/hw/misc/led.c @@ -41,6 +41,10 @@ void led_set_intensity(LEDState *s, unsigned intensity_percent) intensity_percent = LED_INTENSITY_PERCENT_MAX; } trace_led_set_intensity(s->description, s->color, intensity_percent); + if (intensity_percent != s->intensity_percent) { + trace_led_change_intensity(s->description, s->color, + s->intensity_percent, intensity_percent); + } s->intensity_percent = intensity_percent; } diff --git a/hw/misc/trace-events b/hw/misc/trace-events index 76c9ddb54fe..89d15f05f9a 100644 --- a/hw/misc/trace-events +++ b/hw/misc/trace-events @@ -216,6 +216,7 @@ grlib_apb_pnp_read(uint64_t addr, uint32_t value) "APB PnP read addr:0x%03"PRIx6 # led.c led_set_intensity(const char *color, const char *desc, uint8_t intensity_percent) "LED desc:'%s' color:%s intensity: %u%%" +led_change_intensity(const char *color, const char *desc, uint8_t old_intensity_percent, uint8_t new_intensity_percent) "LED desc:'%s' color:%s intensity %u%% -> %u%%" # pca9552.c pca955x_gpio_status(const char *description, const char *buf) "%s GPIOs 0-15 [%s]"