From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1mciuS-0004qU-T2 for mharc-grub-devel@gnu.org; Tue, 19 Oct 2021 02:47:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46656) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mciuP-0004lv-Ov for grub-devel@gnu.org; Tue, 19 Oct 2021 02:47:39 -0400 Received: from mail-qt1-x833.google.com ([2607:f8b0:4864:20::833]:44804) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mciuM-0007ZM-JX for grub-devel@gnu.org; Tue, 19 Oct 2021 02:47:37 -0400 Received: by mail-qt1-x833.google.com with SMTP id c28so17406557qtv.11 for ; Mon, 18 Oct 2021 23:47:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=eLa+FqeBUvlTCOLlqFcQ0q34lvPKNueo4G4q24bG+N0=; b=jThhn1YLsXsjbw+FA6locC7ZYO2vWHIaXvrmDjfb9QD6/8NAh2u3c5KLtLD5aKg6ua MEQTJNPkntosQlkpY/W4iQBvgkvZkcUAmJEeBMYyCAzQH0VZwpQxD1vE3uCk8BpYPeEt JldrVAgS91euh+3KxuR17MW3tUJNhQNq22mJIwHz5oK4wuJoEK3yjgXShY8r6DBmlvUX Ir1xOkrTCJvrZ5UJQI+ox/jxeKimbKrVQdKQmyg+0E3pQvp8ePMp2LjFnbw/WRi1Gpf/ hRXQLIzMRiqsgkfjoewMOxKpRIZ0f/9+cBDSGAbz9Zr4ik/9pnQMGW6aCbTGmB+gj6Ri ji7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=eLa+FqeBUvlTCOLlqFcQ0q34lvPKNueo4G4q24bG+N0=; b=V/dvSKJOWisj7jTYf58yk2hZbXb32CQM10B4D8P3761/adefb6MrAHUJxBTUSyOXfo PCWVqoPQnr8fyzxTRKikFKjwFMmogfBUan6TQWj9uLRHELMR0lCKqMwexGOr4o3MeAt5 j0iT/1xbUWIsCu0zfOwC+/am0jMOJzlxAU7xfA7wP4KN0ToEGg5zpjEgxTtu0CjX+m4h dVMR2Gm/QV/WXQZL2iF4OM3qjXJhrhFZbhAjyH7Gd7TQE+ByJXoQNjNn7fva9O0uNr6s pBvx4Rvy75ZLTqjn1mT5rTXFt74nImfiCQLhS/MnlPFADci66EHCjc7zAH8o3sPVi2Pm 9ncA== X-Gm-Message-State: AOAM533Bs+Ju19hTim7GdtBrrbvSixyfviVgtLNdFL6vNFSB00EkoOxN TcyVwLWfceH/lcHG4R2Q/E8aQc8yYbRXFA== X-Google-Smtp-Source: ABdhPJzr5RalA4wvLtkJo6VxCpDzu42rWEcksBcdcqZIDFOpqtiLGMnZuFsgTgoBnIuz5/g75AawtA== X-Received: by 2002:a05:622a:1441:: with SMTP id v1mr35650012qtx.45.1634626053049; Mon, 18 Oct 2021 23:47:33 -0700 (PDT) Received: from localhost.localdomain ([37.218.244.251]) by smtp.gmail.com with ESMTPSA id k9sm6476818qkj.75.2021.10.18.23.47.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Oct 2021 23:47:32 -0700 (PDT) From: Glenn Washburn To: grub-devel@gnu.org, Daniel Kiper Cc: Michael Schierl , Glenn Washburn Subject: [DEBUG 0/2] Disable debug conditionals Date: Tue, 19 Oct 2021 01:47:01 -0500 Message-Id: X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::833; envelope-from=development@efficientek.com; helo=mail-qt1-x833.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-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: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Oct 2021 06:47:39 -0000 Here are two patches I've found useful when debugging grub issues. The first patch allows the the $debug variable to contain conditionals prefixed with a '-' to selectively disable that conditional when all conditionals have been enabled. Only the first occurance of the conditional in the debug variable is checked. So a value of "all,btrfs,alloc,-btrfs" will not disable btrfs debug messages. A better implementation would do a string search for the conditional from the end of the debug string, but grub doesn't have a string method to search from the end of the string currently. I think despite its limitations, the current patch is useful enough to be included, until takes an interest in upgrading it. The second patch adds the conditional to the debug message prefix. This is especially useful in the context of the first patch and a situation where the user is debugging a boot issue in a live grub and doesn't have the source readily available (they are in GRUB on a non-booting system!) Glenn Glenn Washburn (2): misc: Allow selective disabling of debug conditionals misc: Add debug log condition to log output grub-core/kern/misc.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) -- 2.27.0