From nobody Tue Sep 29 06:58:35 2026 Received: from out-183.mta0.migadu.com (out-183.mta0.migadu.com [91.218.175.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6E49C347506 for ; Tue, 11 Aug 2026 12:20:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.183 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786450808; cv=none; b=RBExFo9cskGmj3VdYZwAX+0TolhxKfNoUG2hH1StPASB6FcrR0UTnGfJXnjn0nfPnd1wemzi8V8Zs+DYTOISHyJBiV02Ta+KnqaY5f7eo8nwfjIrGxLc2SYUROqqTcanujNVcIxR5XZzEgmu5vfSc8ggXt4HCp9433W/yUC3x3E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786450808; c=relaxed/simple; bh=a69hUwJW/uQP13SnuuhCk8iaIwdal4JO2Z7UYBYsBlQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oRtaA9oI8oHOYZI6WQky+J5yUbTf2e4+f/ElrNZwM+exk5TIwgiv00XULOF1vYB909tyuLObIZXlBFE6CjKTWzWQTvkYNBHgrZKbfAC872O498LDMD8wALKcP+d8b7EyCBFq3s5/P4DZGa2uqI5bhAF5oFpfFzqXaKFouhULNS0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=uicuboyz; arc=none smtp.client-ip=91.218.175.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="uicuboyz" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1786450804; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zq+pI1oE3UGZoNi3dVC61Rc3J8BL8beehh+IsOwTKEg=; b=uicuboyzxP3Scq85+3OSSV957W3oj52V+6KSpKHKgO1g6rV97Y92UEV1IxJ4sEVXd/A2Us vC7LzlhKxAjbU/IQiJPunWNRkZJTja1MKARoazdqcNUM1E5TUDaCqzHJneVs7rRiWjUOsD nVQoTZhBBodF5vX/K0zINhYc+iQ7bu4= From: Yuntao Wang To: Jason Baron , Jim Cromie Cc: Andrew Morton , linux-kernel@vger.kernel.org, Yuntao Wang Subject: [PATCH 1/2] dyndbg: fix incorrect mod_ct value in dynamic_debug_init() Date: Tue, 11 Aug 2026 20:18:30 +0800 Message-ID: <20260811121831.577848-2-yuntao.wang@linux.dev> In-Reply-To: <20260811121831.577848-1-yuntao.wang@linux.dev> References: <20260811121831.577848-1-yuntao.wang@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Suppose all `struct _ddebug` instances belong to the same module, mod_ct should be 1, but it is currently 0. Fix it. Signed-off-by: Yuntao Wang --- lib/dynamic_debug.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 18a71a9108d3..16fad5454d6a 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -1456,6 +1456,8 @@ static int __init dynamic_debug_init(void) iter_mod_start =3D iter; } } + + mod_ct++; di.num_descs =3D mod_sites; di.descs =3D iter_mod_start; ret =3D ddebug_add_module(&di, modname); --=20 2.55.0 From nobody Tue Sep 29 06:58:35 2026 Received: from out-185.mta0.migadu.com (out-185.mta0.migadu.com [91.218.175.185]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 543DA442FB6 for ; Tue, 11 Aug 2026 12:20:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.185 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786450811; cv=none; b=M0vSCc9WqnBic9oszzE51EaALwJuME3zNO1+S3hAyiPKomD/O0bIFPZ+4o2Qwcs+2qhtpHY2NBkAB+GnbC2JUW1MuLaYj2VVu4ChNn8UV9UPMuEdxboPBWUSCqIgCrB7R4G+BooINfYbCH+v5ScUTU1CU7lHOUZouqEaNRJw8k4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786450811; c=relaxed/simple; bh=IRgXuL2HEt972Mb2mEbeRlQabmXtbOr5I2EF/C55K18=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KbYRtEz3pyeuMJCSlMNky83cI99LVxl/kJ7hO1ue99MZeWgKl6nTqKyd9i9qonSsMMc1mBoE1Q8d9W5d8SXAQPfLrH2eqDWvIPDdZKw7nBVKUK9Fh/5ZBsaec2rA4HBhfsSDJlfXdsarK3pAtHy1+TaqOF3tfDhaNTOc1O4JCF8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=JfGfePlt; arc=none smtp.client-ip=91.218.175.185 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="JfGfePlt" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1786450808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=A/TnPWmuMKH0EjkO+dSTtE0bfI9IzVnHwZRMi8O0fKc=; b=JfGfePltUOOvW5CegoRg9Z2aZhV7UKUPmyvN8TcnSF/rYJhuDPDxZH21EY2q/AGLHUls8y MhdQhoakq0cxotbNuOIVDAOUFGZFbBJZvxL/EhNp8+qj4/KfRQAz+4qplHntbppp0iGh9P DQGNWSZFr+GOr2yXI2SJTdF0Kqhsw7A= From: Yuntao Wang To: Jason Baron , Jim Cromie Cc: Andrew Morton , linux-kernel@vger.kernel.org, Yuntao Wang Subject: [PATCH 2/2] dyndbg: clean up dynamic_debug_init() to improve readability Date: Tue, 11 Aug 2026 20:18:31 +0800 Message-ID: <20260811121831.577848-3-yuntao.wang@linux.dev> In-Reply-To: <20260811121831.577848-1-yuntao.wang@linux.dev> References: <20260811121831.577848-1-yuntao.wang@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" Keep variable assignments in the same order throughout the function to make the code easier to follow. No functional changes. Signed-off-by: Yuntao Wang --- lib/dynamic_debug.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/dynamic_debug.c b/lib/dynamic_debug.c index 16fad5454d6a..49334d1aa4b3 100644 --- a/lib/dynamic_debug.c +++ b/lib/dynamic_debug.c @@ -1442,28 +1442,29 @@ static int __init dynamic_debug_init(void) i =3D mod_sites =3D mod_ct =3D 0; =20 for (; iter < __stop___dyndbg; iter++, i++, mod_sites++) { - if (strcmp(modname, iter->modname)) { - mod_ct++; - di.num_descs =3D mod_sites; di.descs =3D iter_mod_start; + di.num_descs =3D mod_sites; ret =3D ddebug_add_module(&di, modname); if (ret) goto out_err; =20 - mod_sites =3D 0; - modname =3D iter->modname; + mod_ct++; + iter_mod_start =3D iter; + modname =3D iter->modname; + mod_sites =3D 0; } } =20 - mod_ct++; - di.num_descs =3D mod_sites; di.descs =3D iter_mod_start; + di.num_descs =3D mod_sites; ret =3D ddebug_add_module(&di, modname); if (ret) goto out_err; =20 + mod_ct++; + ddebug_init_success =3D 1; vpr_info("%d prdebugs in %d modules, %d KiB in ddebug tables, %d kiB in _= _dyndbg section\n", i, mod_ct, (int)((mod_ct * sizeof(struct ddebug_table)) >> 10), --=20 2.55.0