Add some debug messages

This commit is contained in:
Rodrigo Arias 2023-03-08 16:19:59 +01:00 committed by Rodrigo Arias Mallo
parent f3bcdeccd1
commit 4f440c5104
3 changed files with 11 additions and 1 deletions

View File

@ -172,7 +172,7 @@ propagate_chan(struct bay_chan *bchan, enum bay_cb_type type)
DL_FOREACH(bchan->cb[type], cur) { DL_FOREACH(bchan->cb[type], cur) {
dbg("calling cb %p", cur->func); dbg("calling cb %p", cur->func);
if (cur->func(bchan->chan, cur->arg) != 0) { if (cur->func(bchan->chan, cur->arg) != 0) {
err("callback failed"); err("callback failed for %s", bchan->chan->name);
return -1; return -1;
} }
} }

View File

@ -1,6 +1,8 @@
/* Copyright (c) 2021-2023 Barcelona Supercomputing Center (BSC) /* Copyright (c) 2021-2023 Barcelona Supercomputing Center (BSC)
* SPDX-License-Identifier: GPL-3.0-or-later */ * SPDX-License-Identifier: GPL-3.0-or-later */
//#define ENABLE_DEBUG
#include "cpu.h" #include "cpu.h"
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@ -248,6 +250,9 @@ cpu_update(struct cpu *cpu)
err("chan_set pid failed"); err("chan_set pid failed");
return -1; return -1;
} }
char buf[128];
dbg("cpu%ld sets th_running to %s",
cpu->gindex, value_str(gid_running, buf));
if (chan_set(&cpu->chan[CPU_CHAN_THRUN], gid_running) != 0) { if (chan_set(&cpu->chan[CPU_CHAN_THRUN], gid_running) != 0) {
err("chan_set gid_running failed"); err("chan_set gid_running failed");
return -1; return -1;

View File

@ -1,6 +1,8 @@
/* Copyright (c) 2021-2023 Barcelona Supercomputing Center (BSC) /* Copyright (c) 2021-2023 Barcelona Supercomputing Center (BSC)
* SPDX-License-Identifier: GPL-3.0-or-later */ * SPDX-License-Identifier: GPL-3.0-or-later */
//#define ENABLE_DEBUG
#include "thread.h" #include "thread.h"
#include <errno.h> #include <errno.h>
#include <stdio.h> #include <stdio.h>
@ -387,6 +389,7 @@ thread_set_cpu(struct thread *th, struct cpu *cpu)
return -1; return -1;
} }
dbg("thread%ld sets cpu%ld", th->gindex, cpu->gindex);
th->cpu = cpu; th->cpu = cpu;
/* Update cpu channel */ /* Update cpu channel */
@ -407,6 +410,7 @@ thread_unset_cpu(struct thread *th)
return -1; return -1;
} }
dbg("thread%ld unsets cpu", th->gindex);
th->cpu = NULL; th->cpu = NULL;
struct chan *c = &th->chan[TH_CHAN_CPU]; struct chan *c = &th->chan[TH_CHAN_CPU];
@ -426,6 +430,7 @@ thread_migrate_cpu(struct thread *th, struct cpu *cpu)
return -1; return -1;
} }
dbg("thread%ld migrates to cpu%d", th->gindex, cpu->gindex);
th->cpu = cpu; th->cpu = cpu;
struct chan *c = &th->chan[TH_CHAN_CPU]; struct chan *c = &th->chan[TH_CHAN_CPU];