diff options
author | Harald Welte <laforge@gnumonks.org> | 2017-07-19 11:53:13 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2017-07-19 11:53:13 +0200 |
commit | 198dbda3c830e5a361d335a34305fb70a805986e (patch) | |
tree | 1f93e8da0aa73a2b6d0a27702516586babd64b11 /src/host/virt_phy/src/logging.c | |
parent | f5e0f6424b35751d54e82a08f8d6e6de22ddea9a (diff) |
VIRT-PHY: Log MS context number whenever possible
Now that we can have multiple MS connected to one virtphy instance,
it is important to log some context whenever possible. To do so, we
introduce a monotonically increasing MS number which gets assigned
whenever we allocate a l1_model_ms and printed when the LOGPMS() or
DEBUGPMS() macros are used.
Change-Id: Id7d9507126a03def5bd7690f1dbe987f9a749e65
Diffstat (limited to 'src/host/virt_phy/src/logging.c')
-rw-r--r-- | src/host/virt_phy/src/logging.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/host/virt_phy/src/logging.c b/src/host/virt_phy/src/logging.c index 7801beca..7fb2c238 100644 --- a/src/host/virt_phy/src/logging.c +++ b/src/host/virt_phy/src/logging.c @@ -71,7 +71,14 @@ static const struct log_info_cat default_categories[] = { .color = "\033[1;31m", .enabled = 1, .loglevel = LOGL_DEBUG, - } + }, + [DMAIN] = { + .name = "DMAIN", + .description = "Main Program / Data Structures", + .color = "\033[1;32m", + .enabled = 1, + .loglevel = LOGL_DEBUG, + }, }; const struct log_info ms_log_info = { @@ -107,5 +114,8 @@ int ms_log_init(char *cat_mask) const char *getL1ctlPrimName(uint8_t type) { - return l1ctlPrimNames[type]; + if (type <= ARRAY_SIZE(l1ctlPrimNames)) + return l1ctlPrimNames[type]; + else + return "Unknwon Primitive"; } |