From nobody Tue Feb 10 09:24:56 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1512888067614540.4262573204187; Sat, 9 Dec 2017 22:41:07 -0800 (PST) Received: from localhost ([::1]:43630 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNvIA-0003f2-5j for importer@patchew.org; Sun, 10 Dec 2017 01:40:50 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60269) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eNvFz-00026f-MX for qemu-devel@nongnu.org; Sun, 10 Dec 2017 01:38:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eNvFy-00062j-NS for qemu-devel@nongnu.org; Sun, 10 Dec 2017 01:38:35 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51312) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eNvFy-000620-HX for qemu-devel@nongnu.org; Sun, 10 Dec 2017 01:38:34 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A934880F90 for ; Sun, 10 Dec 2017 06:38:33 +0000 (UTC) Received: from xz-mi.redhat.com (ovpn-12-22.pek2.redhat.com [10.72.12.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id C691361282; Sun, 10 Dec 2017 06:38:31 +0000 (UTC) From: Peter Xu To: qemu-devel@nongnu.org Date: Sun, 10 Dec 2017 14:38:16 +0800 Message-Id: <20171210063819.14892-3-peterx@redhat.com> In-Reply-To: <20171210063819.14892-1-peterx@redhat.com> References: <20171210063819.14892-1-peterx@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Sun, 10 Dec 2017 06:38:33 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 2/5] i8259: use DEBUG_IRQ_COUNT always X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , peterx@redhat.com, "Michael S . Tsirkin" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" It's not really scary to even enable it forever. After all it's i8259, and it's even not the kernel one. Then we can remove quite a few of lines to make it cleaner. And "info irq" will always work for it. Signed-off-by: Peter Xu Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/intc/i8259.c | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/hw/intc/i8259.c b/hw/intc/i8259.c index f12e0b27f1..20c9d0a58b 100644 --- a/hw/intc/i8259.c +++ b/hw/intc/i8259.c @@ -36,7 +36,6 @@ //#define DEBUG_PIC =20 //#define DEBUG_IRQ_LATENCY -//#define DEBUG_IRQ_COUNT =20 #define TYPE_I8259 "isa-i8259" #define PIC_CLASS(class) OBJECT_CLASS_CHECK(PICClass, (class), TYPE_I8259) @@ -52,12 +51,8 @@ typedef struct PICClass { DeviceRealize parent_realize; } PICClass; =20 -#if defined(DEBUG_PIC) || defined(DEBUG_IRQ_COUNT) static int irq_level[16]; -#endif -#ifdef DEBUG_IRQ_COUNT static uint64_t irq_count[16]; -#endif #ifdef DEBUG_IRQ_LATENCY static int64_t irq_time[16]; #endif @@ -128,24 +123,17 @@ static void pic_set_irq(void *opaque, int irq, int le= vel) { PICCommonState *s =3D opaque; int mask =3D 1 << irq; - -#if defined(DEBUG_PIC) || defined(DEBUG_IRQ_COUNT) || \ - defined(DEBUG_IRQ_LATENCY) int irq_index =3D s->master ? irq : irq + 8; -#endif =20 trace_pic_set_irq(s->master, irq, level); =20 -#if defined(DEBUG_PIC) || defined(DEBUG_IRQ_COUNT) if (level !=3D irq_level[irq_index]) { irq_level[irq_index] =3D level; -#ifdef DEBUG_IRQ_COUNT if (level =3D=3D 1) { irq_count[irq_index]++; } -#endif } -#endif + #ifdef DEBUG_IRQ_LATENCY if (level) { irq_time[irq_index] =3D qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); @@ -253,12 +241,8 @@ static bool pic_get_statistics(InterruptStatsProvider = *obj, PICCommonState *s =3D PIC_COMMON(obj); =20 if (s->master) { -#ifdef DEBUG_IRQ_COUNT *irq_counts =3D irq_count; *nb_irqs =3D ARRAY_SIZE(irq_count); -#else - return false; -#endif } else { *irq_counts =3D NULL; *nb_irqs =3D 0; --=20 2.14.3