debug messages: implement dynamic debug

Heavily inspired off linux kernel's dynamic debug:
 * add a /sys/kernel/debug/dynamic_debug/control file
 (accessible from linux side in /sys/class/mcos/mcos0/sys/kernel/debug/dynamic_debug/control)
 * read from file to list debug statements (currently limited to 4k in size)
 * write to file with '[file foo ][func bar ][line [x][-[y]]] [+-]p' to change values

Side effects:
 * reindented all linker scripts, there is a new __verbose section
 * added string function strpbrk

Change-Id: I36d7707274dcc3ecaf200075a31a2f0f76021059
This commit is contained in:
Dominique Martinet
2018-05-24 18:17:45 +09:00
parent bc887aab44
commit 3185334c1c
48 changed files with 407 additions and 232 deletions

View File

@@ -32,6 +32,7 @@
#include <syscall.h>
#include <sysfs.h>
#include <ihk/monitor.h>
#include <debug.h>
//#define IOCTL_FUNC_EXTENSION
#ifdef IOCTL_FUNC_EXTENSION
@@ -41,11 +42,8 @@
//#define DEBUG_PRINT_INIT
#ifdef DEBUG_PRINT_INIT
#define dkprintf(...) do { kprintf(__VA_ARGS__); } while (0)
#define ekprintf(...) do { kprintf(__VA_ARGS__); } while (0)
#else
#define dkprintf(...) do { } while (0)
#define ekprintf(...) do { kprintf(__VA_ARGS__); } while (0)
#undef DDEBUG_DEFAULT
#define DDEBUG_DEFAULT DDEBUG_PRINT
#endif
#define DUMP_LEVEL_USER_UNUSED_EXCLUDE 24
@@ -331,6 +329,7 @@ static void populate_sysfs(void)
{
cpu_sysfs_setup();
numa_sysfs_setup();
dynamic_debug_sysfs_setup();
//setup_remote_snooping_samples();
} /* populate_sysfs() */