From: Petr Mladek <pmladek@suse.com>
To: Yafang Shao <laoar.shao@gmail.com>
Cc: jpoimboe@kernel.org, jikos@kernel.org, mbenes@suse.cz,
joe.lawrence@redhat.com, song@kernel.org,
live-patching@vger.kernel.org
Subject: Re: [PATCH] selftests: livepatch: filter kobject debug messages in check_result()
Date: Wed, 19 Aug 2026 15:28:41 +0200 [thread overview]
Message-ID: <aoWvidB12l4oPIdK@pathway.suse.cz> (raw)
In-Reply-To: <20260818054629.69246-1-laoar.shao@gmail.com>
On Tue 2026-08-18 13:46:29, Yafang Shao wrote:
> CONFIG_DEBUG_KOBJECT makes kobject_add_internal(), kobject_uevent_env(),
> fill_kobj_path() and friends emit pr_debug() messages, and
> CONFIG_DEBUG_KOBJECT_RELEASE makes kobject_release() emit a pr_info()
> for every delayed kobject free. All of these carry the "kobject:"
> prefix via pr_fmt(), e.g.:
>
> kobject: 'test_klp_livepatch' (ffff...): kobject_release, parent ... (delayed N)
Yeah, this is pr_info() printed only when CONFIG_DEBUG_KOBJECT_RELEASE enabled.
> kobject: 'test_klp_livepatch' (ffff...): kobject_add_internal: parent: 'module', set: 'module'
This one seems to be printed by pr_debug(). It is printed
with CONFIG_DEBUG_KOBJECT but only when CONFIG_DYNAMIC_DEBUG
is not enabled.
> The livepatch test modules' kobjects are named "test_klp_*", so these
> lines match the check_result() grep for "test_klp" and leak into the
> result. The extra lines no longer match the expected output, so the
> selftests fail when either debug config is enabled.
>
> Filter out the "kobject:" lines from the result and note in the README
> that both configs are safe to keep enabled.
Honestly, I do not feel comfortable with this ignore-all-kobject-messages
approach. We might miss real problems reported by the kobject API.
It seems acceptable to ignore the quite specific "kobject: .*parent.*
(delayed" pattern.
But I would prefer to ignore the other debug messages by detecting
the KERN_DEBUG loglevel. It seems that dmesg even allows to filter
the output on its own. It is a bit ugly because we want all
other loglevels but:
dmesg --level=info,notice,warn,err,crit,alert,emerg
might do the job.
Best Regards,
Petr
prev parent reply other threads:[~2026-08-19 13:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-18 5:46 [PATCH] selftests: livepatch: filter kobject debug messages in check_result() Yafang Shao
2026-08-19 13:28 ` Petr Mladek [this message]
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=aoWvidB12l4oPIdK@pathway.suse.cz \
--to=pmladek@suse.com \
--cc=jikos@kernel.org \
--cc=joe.lawrence@redhat.com \
--cc=jpoimboe@kernel.org \
--cc=laoar.shao@gmail.com \
--cc=live-patching@vger.kernel.org \
--cc=mbenes@suse.cz \
--cc=song@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