linux-kbuild.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RFC - KBUILD_MODNAME is misleading in builtins, as seen in /proc/dynamic_debug/control
@ 2023-03-20  5:05 jim.cromie
       [not found] ` <6af9da81-7a7b-9f47-acb1-d0350bae7f3f@akamai.com>
  0 siblings, 1 reply; 9+ messages in thread
From: jim.cromie @ 2023-03-20  5:05 UTC (permalink / raw)
  To: LKML, linux-kbuild; +Cc: Greg KH, Jason Baron, Luis Chamberlain

dynamic-debug METADATA uses KBUILD_MODNAME as:

#define DEFINE_DYNAMIC_DEBUG_METADATA_CLS(name, cls, fmt)       \
        static struct _ddebug  __aligned(8)                     \
        __section("__dyndbg") name = {                          \
                .modname = KBUILD_MODNAME,                      \

This is going amiss for some builtins, ie those enabled here, by:

    echo module main +pmf > /proc/dynamic_debug_control
    grep =pmf /proc/dynamic_debug/control

init/main.c:1187 [main]initcall_blacklist =pmf "blacklisting initcall %s\n"
init/main.c:1226 [main]initcall_blacklisted =pmf "initcall %s blacklisted\n"
init/main.c:1432 [main]run_init_process =pmf "  with arguments:\n"
init/main.c:1434 [main]run_init_process =pmf "    %s\n"
init/main.c:1435 [main]run_init_process =pmf "  with environment:\n"
init/main.c:1437 [main]run_init_process =pmf "    %s\n"
kernel/module/main.c:336 [main]find_symbol =pmf "Failed to find symbol %s\n"
kernel/module/main.c:567 [main]already_uses =pmf "%s uses %s!\n"
kernel/module/main.c:571 [main]already_uses =pmf "%s does not use %s!\n"
kernel/module/main.c:586 [main]add_module_usage =pmf "Allocating new
usage for %s.\n"
kernel/module/main.c:627 [main]module_unload_free =pmf "%s unusing %s\n"
kernel/module/main.c:733 [main]__do_sys_delete_module =pmf "%s already dying\n"
kernel/module/main.c:1345 [main]simplify_symbols =pmf "Common symbol: %s\n"
kernel/module/main.c:1353 [main]simplify_symbols =pmf "Absolute
symbol: 0x%08lx\n"
kernel/module/main.c:1508 [main]__layout_sections =pmf "\t%s\n"
kernel/module/main.c:1526 [main]layout_sections =pmf "Core section
allocation order:\n"
kernel/module/main.c:1529 [main]layout_sections =pmf "Init section
allocation order:\n"
kernel/module/main.c:2168 [main]move_module =pmf "final section addresses:\n"
kernel/module/main.c:2183 [main]move_module =pmf "\t0x%lx %s\n"
kernel/module/main.c:2921 [main]__do_sys_init_module =pmf
"init_module: umod=%p, len=%lu, uargs=%p\n"
kernel/module/main.c:2942 [main]__do_sys_finit_module =pmf
"finit_module: fd=%d, uargs=%p, flags=%i\n"
drivers/base/power/main.c:135 [main]device_pm_add =pmf "Adding info for %s:%s\n"
drivers/base/power/main.c:156 [main]device_pm_remove =pmf "Removing
info for %s:%s\n"
drivers/base/power/main.c:175 [main]device_pm_move_before =pmf "Moving
%s:%s before %s:%s\n"
drivers/base/power/main.c:189 [main]device_pm_move_after =pmf "Moving
%s:%s after %s:%s\n"
drivers/base/power/main.c:202 [main]device_pm_move_last =pmf "Moving
%s:%s to end of list\n"
drivers/base/power/main.c:441 [main]pm_dev_dbg =pmf "PM: %s%s%s driver
flags: %x\n"
drivers/base/power/main.c:467 [main]dpm_show_time =pmf "%s%s%s of
devices %s after %ld.%03ld msecs\n"
bash-5.2#

Basically, KBUILD_MODNAME appears to get basename,
not something specific, set in some config (such as pm, or module)
or cleverly picked out of the path (power is possible)

this compromises the clarity of  dyndbg's module keyword

is some heuristic possible to improve this,
with a manual setting to fix when heuristic fails ?

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-03-21 17:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-20  5:05 RFC - KBUILD_MODNAME is misleading in builtins, as seen in /proc/dynamic_debug/control jim.cromie
     [not found] ` <6af9da81-7a7b-9f47-acb1-d0350bae7f3f@akamai.com>
2023-03-20 19:59   ` jim.cromie
2023-03-20 21:04     ` Luis Chamberlain
2023-03-21  9:03       ` Masahiro Yamada
2023-03-21 10:40         ` Nick Alcock
2023-03-21 16:31         ` Luis Chamberlain
2023-03-21 17:45           ` Nick Alcock
2023-03-21  6:45     ` Masahiro Yamada
2023-03-21 12:20       ` jim.cromie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).