Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1186242ybk; Thu, 21 May 2020 00:25:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOrZgfefa0DuCZfqxJ4cQdaveTGjfrc0hvu/N/a0E3Fp1Oj5NzpH0ynG0J/DIUsLxhaA84 X-Received: by 2002:a17:906:9617:: with SMTP id s23mr2260285ejx.505.1590045910258; Thu, 21 May 2020 00:25:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590045910; cv=none; d=google.com; s=arc-20160816; b=oKzGQKfSBMGwbFeV5cGKKb5B03ouKMrpSKqHvVb825XFPiJTKqeuDrFRq23kXnLwJK HhcnX0cbiWN/athCAbq3o1VIhr2S5xtaUUKD73gmQdbe92agxVu6MbuCc8Prl/ZEuTG6 9XumMmC57Svi8XauL5u1r7l7UGETRQUMol7yu9Jux32dxf18HD0I9khkxXLKXouFhGHz FNkHVjx15fhIPM7e4QMQT7BlJ89266HmRPLMUrWCbllVz0XmaLCYDaw42Jtfv3qjMsxm akOqdFiMt3QVi3spN+wN5VG8mRn/z520QOqANuGlfDniMmlWnQVTbRNcRGXhWU3WX6Z5 ZSvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=LooMJgnBrpGlXiqCOzLVJF+ZZe863XDYgdf5cXAv+ds=; b=gEnJJoBs5F7L2fFV8YbZ7P4q9LhnXyR9LpNLz9MsN88ZI9/HlQK1qLWZ6NnE4SgEGA hPKLCpa16IL2XqAiZGg1n8u6Qd6fdzQcHQHAhVOHOieZ1UWJCiRribA/MILjTOd7VO5V xPO80vX7K6ZKEHLUsfREiPEOGrD94vcIjVL9d7yv8Hws+X+z8hXm9oNLlKc21xdHGRO1 vAB9DsUg1A65j/wBKLDFCdte5L9Cm284CvZljZ74MYefNn6bMFFt78v+mFKuAt/eQc93 p3Pw48GN6gOSZKK6auYjRt0hw0ZC1N6C7qVcVnrOTlKz2PWG4sQu5QgUdczgmqJmY/BV Mpmw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d31si3066870edd.95.2020.05.21.00.24.47; Thu, 21 May 2020 00:25:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728355AbgEUHVz (ORCPT + 99 others); Thu, 21 May 2020 03:21:55 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:52730 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727003AbgEUHVz (ORCPT ); Thu, 21 May 2020 03:21:55 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 2BA30391107AC5928B81; Thu, 21 May 2020 15:21:49 +0800 (CST) Received: from euler.huawei.com (10.175.124.27) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.487.0; Thu, 21 May 2020 15:21:48 +0800 From: Wei Li To: Daniel Thompson , Doug Anderson , Jason Wessel , "Masahiro Yamada" CC: , Subject: [PATCH v3] kdb: Remove the misfeature 'KDBFLAGS' Date: Thu, 21 May 2020 15:21:25 +0800 Message-ID: <20200521072125.21103-1-liwei391@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.175.124.27] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, 'KDBFLAGS' is an internal variable of kdb, it is combined by 'KDBDEBUG' and state flags. It will be shown only when 'KDBDEBUG' is set, and the user can define an environment variable named 'KDBFLAGS' too. These are puzzling indeed. After communication with Daniel, it seems that 'KDBFLAGS' is a misfeature. So let's replace 'KDBFLAGS' with 'KDBDEBUG' to just show the value we wrote into. After this modification, we can use `md4c1 kdb_flags` instead, to observe the state flags. Suggested-by: Daniel Thompson Signed-off-by: Wei Li --- v2 -> v3: - Change to replace the internal env 'KDBFLAGS' with 'KDBDEBUG'. v1 -> v2: - Fix lack of braces. kernel/debug/kdb/kdb_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c index 4fc43fb17127..392029287083 100644 --- a/kernel/debug/kdb/kdb_main.c +++ b/kernel/debug/kdb/kdb_main.c @@ -418,8 +418,7 @@ int kdb_set(int argc, const char **argv) argv[2]); return 0; } - kdb_flags = (kdb_flags & - ~(KDB_DEBUG_FLAG_MASK << KDB_DEBUG_FLAG_SHIFT)) + kdb_flags = (kdb_flags & ~KDB_DEBUG(MASK)) | (debugflags << KDB_DEBUG_FLAG_SHIFT); return 0; @@ -2081,7 +2080,8 @@ static int kdb_env(int argc, const char **argv) } if (KDB_DEBUG(MASK)) - kdb_printf("KDBFLAGS=0x%x\n", kdb_flags); + kdb_printf("KDBDEBUG=0x%x\n", + (kdb_flags & KDB_DEBUG(MASK)) >> KDB_DEBUG_FLAG_SHIFT); return 0; } -- 2.17.1