Skip to content

Commit

Permalink
test-dyndbg: tune sub-module behavior
Browse files Browse the repository at this point in the history
lib/test_dynamic_debug.c is used to build 2 modules:
test_dynamic_debug.ko and test_dynamic_debug_submod.ko

Define DEBUG only in the main module, not in the submod.  Its purpose
is to insure that prdbgs are enabled by default, so that a modprobe
without params actually logs something, showing that compile-time
enablement works.  This doesn't need to be repeated in the submodule.

Rather, the submodule's purpose is to prove that classmaps defined and
exported from a parent module are propagated to submodules, setting
their class'd debugs accordingly.

Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
  • Loading branch information
jimc committed Jan 11, 2023
1 parent 09ea67b commit 4ef021a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/test_dynamic_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
* Jim Cromie <jim.cromie@gmail.com>
*/

#if defined(TEST_DYNAMIC_DEBUG_SUBMOD)
#define pr_fmt(fmt) "test_dd_submod: " fmt
#else
#if !defined(TEST_DYNAMIC_DEBUG_SUBMOD)
#define pr_fmt(fmt) "test_dd: " fmt
#define DEBUG /* enable all prdbgs (plain & class'd) at compiletime */
#else
#define pr_fmt(fmt) "test_dd_submod: " fmt
#endif

#define DEBUG /* enable all prdbgs (plain & class'd) at compiletime */

#include <linux/module.h>

Expand Down

0 comments on commit 4ef021a

Please sign in to comment.