From 7e48cfe72e1834b673358c570c85cf2107c1ea69 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Wed, 4 Sep 2024 12:44:53 +0200 Subject: [PATCH] Print contexts in another line with active info Make it clear to determine if a source is configured to emit interruptions to a given context by printing the active=1 attribute when the priority is larger than the threshold of the context. --- tools/plictool.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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); + } } }