From aab6808f4eda3a3acc34a15a2e042bdfdfcacda7 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Fri, 24 Feb 2023 16:54:17 +0100 Subject: [PATCH] Ensure the appid and the rank are emitted too --- test/emu/nosv/switch-same-type.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/test/emu/nosv/switch-same-type.c b/test/emu/nosv/switch-same-type.c index c1bd4a1..3be69e7 100644 --- a/test/emu/nosv/switch-same-type.c +++ b/test/emu/nosv/switch-same-type.c @@ -8,8 +8,9 @@ int main(void) { - /* Tests that switching to a nested task of the same type produces a - * duplicated event in the Paraver trace with the task type. */ + /* Tests that switching to a nested nOS-V task (inline if0) of the same + * type produces a duplicated event in the Paraver trace with the task + * type, appid and rank. */ instr_start(0, 1); @@ -30,10 +31,24 @@ main(void) FILE *f = fopen("match.sh", "w"); if (f == NULL) die("fopen failed:"); + + /* Check the task type */ int prvtype = PRV_NOSV_TYPE; int64_t t = get_delta(); - fprintf(f, "grep ':%ld:%d:%d' ovni/thread.prv\n", t, prvtype, gid); - fprintf(f, "grep ':%ld:%d:%d' ovni/cpu.prv\n", t, prvtype, gid); + fprintf(f, "grep ':%ld:%d:%d$' ovni/thread.prv\n", t, prvtype, gid); + fprintf(f, "grep ':%ld:%d:%d$' ovni/cpu.prv\n", t, prvtype, gid); + + /* Check the task appid */ + prvtype = PRV_NOSV_APPID; + int appid = 1; /* Starts at one */ + fprintf(f, "grep ':%ld:%d:%d$' ovni/thread.prv\n", t, prvtype, appid); + fprintf(f, "grep ':%ld:%d:%d$' ovni/cpu.prv\n", t, prvtype, appid); + + /* Check the rank */ + prvtype = PRV_NOSV_RANK; + int rank = 0 + 1; /* Starts at one */ + fprintf(f, "grep ':%ld:%d:%d$' ovni/thread.prv\n", t, prvtype, rank); + fprintf(f, "grep ':%ld:%d:%d$' ovni/cpu.prv\n", t, prvtype, rank); fclose(f); /* Exit from tasks and subsystem */