From nobody Sun May 19 18:17:57 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=cs.unc.edu ARC-Seal: i=1; a=rsa-sha256; t=1711729550; cv=none; d=zohomail.com; s=zohoarc; b=cxHLvdXfO8m/hxp4hlOWTh25c9Ij25yRPgIKIWojXXiYsHjRK6l4+0SKE7M3lPUSdKf95va/aIqp1JNNGwny1xvjSo5yrsybV1CLrSwb5hkYpwMu7mFB0j6552E67vO1sb5QEDQi8Ay+QYDGiml61lMlf+RcuxffbUAgcrlrRSs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1711729550; 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=yzaR2tfkkvfJNYn7QAkCGmS8gAFONRxGzcSvNxNyFFc=; b=TAmH6glLoLEoJKz8M0VUzNcVlRXONx6frLYjJ66geHRK3FvPaWowEcRzcnzW4m/17DiorJNfUoYBK+A2H0raXmrMUou+z0iY6y0JgovrvaZl0/KclRxdBIbuj8d6vfKU++Cv+S2eJQddM6yX2VpEtr55fKDSIfzbIGeJSDKFkB4= 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+importer2=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 171172954995252.89184466576489; Fri, 29 Mar 2024 09:25:49 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rqF2T-0001x7-Ba; Fri, 29 Mar 2024 12:25:09 -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 1rqDn2-0001kP-DY for qemu-devel@nongnu.org; Fri, 29 Mar 2024 11:05:08 -0400 Received: from mail-qv1-xf35.google.com ([2607:f8b0:4864:20::f35]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rqDn0-0003Gq-BO for qemu-devel@nongnu.org; Fri, 29 Mar 2024 11:05:08 -0400 Received: by mail-qv1-xf35.google.com with SMTP id 6a1803df08f44-690cf6ecd3cso10636746d6.2 for ; Fri, 29 Mar 2024 08:05:05 -0700 (PDT) Received: from kermit.cs.unc.edu (kermit.cs.unc.edu. [152.2.133.133]) by smtp.gmail.com with ESMTPSA id t5-20020a0562140c6500b006986c65f3d2sm1704418qvj.137.2024.03.29.08.05.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Mar 2024 08:05:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.unc.edu; s=google; t=1711724704; x=1712329504; 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=yzaR2tfkkvfJNYn7QAkCGmS8gAFONRxGzcSvNxNyFFc=; b=juX9a6QbBXXlGf4/6TJrfK9yuFLJjvlQuvC1Wwms2xtoE+crjh9qrR7tZkrqyao3rf +jSKsXJUmSLtGnai9/+WyqRfcgQn98a6S5/yP0zQrV32j1B/9f0Q4UcOcWqqS7gY80Mn VxEZRvAuTtSJBlQtkkXQ5aZEvntNPv2cxT7mCRTK5xOVjvq/3sMQkE5foISxz2i+VdMa sAxaGxNWqF8reAHSi68earoVS32v9TbkF3EfKkaAmInWESckNGfE2W0zJH39RdhZiEdl +iHIwXSQu4tdDLU7Pgiv0AuFmG7T5ZZyM3sjMIH39Z+b4Ts/nYCsidT0BGD/ZS/tZAp4 t/xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711724704; x=1712329504; 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=yzaR2tfkkvfJNYn7QAkCGmS8gAFONRxGzcSvNxNyFFc=; b=cRN5CsTyT0flq4x9c8hju7lB+JgfrxehkQ5QFfPWfSEU0sKCNo/aBnbqAQON/cRrBo 3H4xpndZ5TNYT5/4ajgKsKn8U9E276XCWROWPdl/NL1kWAOWQ2dC7In8PYnMEg3MpGiX hsnHf5MRGK0JGaz9pXQR5x4h4CVM0XV0+gurmkB9yBYgCLkWBcKVWwWoquKQhiCa115g PbaUSa8mdYBM/hAFvyDAkacQTIOZmKnd/CdWSlgMcsGIre17A7NzIdBdKTfgLh0+CUcj iAqGlmFG2GKtYFGWmDM9hOzZMIUAre64X7AvacTCTg9FXAzuWZzeWKus0NCOrMuQEwFP hbwA== X-Gm-Message-State: AOJu0Ywt7YE9/1RSAzGTPDr8DHyicksiqOC3DH6clyrIYRClfJNy6GkH wGZgSYVbztoJwkjUJX7U++D5kEyj4y7DLezwu12b83NvAygmBYGxj83XbA2Act8S93XPWPK24NE 5JnpHRumJFyDLWQlzEYx0gtGxova+07q+9mObRI4Z2SLYN9OOVCtOSEnruF1xBiC/s/LTTcOIZ8 /zChUDGfnSYVfNodGJxRBGuzJlLBBh X-Google-Smtp-Source: AGHT+IGD/ZMKtmWZNdTN9necnoN6PK4lMJEQtaBCs+gmngiizWN3p6Fe48dIjZTqUyojZT3ahOuQww== X-Received: by 2002:a05:6214:5809:b0:696:9224:140e with SMTP id mk9-20020a056214580900b006969224140emr2749028qvb.39.1711724704303; Fri, 29 Mar 2024 08:05:04 -0700 (PDT) From: Don Porter To: qemu-devel@nongnu.org Cc: Austin Clements , Geoffrey Thomas , Don Porter Subject: [PATCH 1/1] e1000: Get debug flags from an environment variable Date: Fri, 29 Mar 2024 11:04:50 -0400 Message-Id: <20240329150450.2843758-2-porter@cs.unc.edu> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240329150450.2843758-1-porter@cs.unc.edu> References: <20240329150450.2843758-1-porter@cs.unc.edu> 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+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::f35; envelope-from=porter@cs.unc.edu; helo=mail-qv1-xf35.google.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-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-Mailman-Approved-At: Fri, 29 Mar 2024 12:25:08 -0400 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @cs.unc.edu) X-ZM-MESSAGEID: 1711729552074100001 Content-Type: text/plain; charset="utf-8" From: Austin Clements The E1000 debug messages are very useful for developing drivers, so this introduces an E1000_DEBUG environment variable that lets the debug flags be set without recompiling QEMU. Signed-off-by: Austin Clements [geofft@ldpreload.com: Rebased on top of 2.9.0] Signed-off-by: Geoffrey Thomas Signed-off-by: Don Porter --- hw/net/e1000.c | 65 +++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 59 insertions(+), 6 deletions(-) diff --git a/hw/net/e1000.c b/hw/net/e1000.c index 43f3a4a701..8d46225944 100644 --- a/hw/net/e1000.c +++ b/hw/net/e1000.c @@ -30,11 +30,14 @@ #include "hw/pci/pci_device.h" #include "hw/qdev-properties.h" #include "migration/vmstate.h" +#include "monitor/monitor.h" #include "net/eth.h" #include "net/net.h" #include "net/checksum.h" #include "sysemu/sysemu.h" #include "sysemu/dma.h" +#include "qapi/qmp/qerror.h" +#include "qemu/error-report.h" #include "qemu/iov.h" #include "qemu/module.h" #include "qemu/range.h" @@ -44,15 +47,19 @@ #include "trace.h" #include "qom/object.h" =20 -/* #define E1000_DEBUG */ - -#ifdef E1000_DEBUG enum { DEBUG_GENERAL, DEBUG_IO, DEBUG_MMIO, DEBUG_INTERRUPT, DEBUG_RX, DEBUG_TX, DEBUG_MDIC, DEBUG_EEPROM, DEBUG_UNKNOWN, DEBUG_TXSUM, DEBUG_TXERR, DEBUG_RXERR, DEBUG_RXFILTER, DEBUG_PHY, DEBUG_NOTYET, }; + +static const char *debugnames[] =3D { + "GENERAL", "IO", "MMIO", "INTERRUPT", + "RX", "TX", "MDIC", "EEPROM", + "UNKNOWN", "TXSUM", "TXERR", "RXERR", + "RXFILTER", "PHY", "NOTYET", NULL +}; #define DBGBIT(x) (1<