diff --git a/tools/plictool.c b/tools/plictool.c index 08f267e..c517e81 100644 --- a/tools/plictool.c +++ b/tools/plictool.c @@ -6,6 +6,7 @@ /* Changelog: * v0.0.1 (2024-09-03): Initial version. + * v0.0.2 (2024-09-04): Print contexts in another line and on/off information. */ #include @@ -25,7 +26,7 @@ long nsources = 1024L; static void usage(void) { - printf("plictool v0.0.1 - Rodrigo Arias Mallo \n"); + printf("plictool v0.0.2 - Rodrigo Arias Mallo \n"); printf( "Usage: plictool [-a addr] [-s nsources] [-c ncontexts]\n"); @@ -44,7 +45,7 @@ void dump_sources(void *base) uint32_t priority = *priority_reg; const char *fmt = - "src=%ld pend=%u prio=%u"; + "src=%ld pend=%u prio=%u\n"; if (pending || priority) { printf(fmt, s, pending, priority); @@ -66,11 +67,10 @@ void dump_sources(void *base) printed_source = 1; } - printf(" ctx=%ld thre=%u", c, threshold); - } + int active = priority > threshold ? 1 : 0; - if (printed_source) - printf("\n"); + printf(" ctx=%ld thre=%u active=%d\n", c, threshold, active); + } } }