The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Yuntao Wang <yuntao.wang@linux.dev>
To: Jason Baron <jbaron@akamai.com>, Jim Cromie <jim.cromie@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, Yuntao Wang <yuntao.wang@linux.dev>
Subject: [PATCH 1/2] dyndbg: fix incorrect mod_ct value in dynamic_debug_init()
Date: Tue, 11 Aug 2026 20:18:30 +0800	[thread overview]
Message-ID: <20260811121831.577848-2-yuntao.wang@linux.dev> (raw)
In-Reply-To: <20260811121831.577848-1-yuntao.wang@linux.dev>

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 <yuntao.wang@linux.dev>
---
 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 = iter;
 		}
 	}
+
+	mod_ct++;
 	di.num_descs = mod_sites;
 	di.descs = iter_mod_start;
 	ret = ddebug_add_module(&di, modname);
-- 
2.55.0


  reply	other threads:[~2026-08-11 12:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-11 12:18 [PATCH 0/2] dyndbg: fix incorrect mod_ct value in dynamic_debug_init() Yuntao Wang
2026-08-11 12:18 ` Yuntao Wang [this message]
2026-08-11 12:18 ` [PATCH 2/2] dyndbg: clean up dynamic_debug_init() to improve readability Yuntao Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260811121831.577848-2-yuntao.wang@linux.dev \
    --to=yuntao.wang@linux.dev \
    --cc=akpm@linux-foundation.org \
    --cc=jbaron@akamai.com \
    --cc=jim.cromie@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox