mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
Added overrun-detection for asynchronous / fixed-rate paths (still missing for synchronous paths)
This commit is contained in:
parent
3dc38c0c22
commit
5dbfb0301b
3 changed files with 12 additions and 5 deletions
|
@ -360,7 +360,7 @@ int hook_stats(struct path *p, struct hook *h, int when)
|
|||
|
||||
case HOOK_PERIODIC: {
|
||||
char *buf = path_print(p);
|
||||
info("%-32s : %-8u %-8u %-8u %-8u %-8u", buf, p->sent, p->received, p->dropped, p->skipped, p->invalid);
|
||||
info("%-32s : %-8u %-8u %-8u %-8u %-8u %-8u", buf, p->sent, p->received, p->dropped, p->skipped, p->invalid, p->overrun);
|
||||
free(buf);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -55,7 +55,14 @@ static void * path_run_async(void *arg)
|
|||
struct path *p = arg;
|
||||
|
||||
/* Block until 1/p->rate seconds elapsed */
|
||||
while (timerfd_wait(p->tfd)) {
|
||||
for (;;) {
|
||||
/* Check for overruns */
|
||||
uint64_t expir = timerfd_wait(p->tfd);
|
||||
if (expir > 1) {
|
||||
p->overrun += expir;
|
||||
warn("Overrun detected for path: overruns=%llu", expir);
|
||||
}
|
||||
|
||||
if (path_run_hook(p, HOOK_ASYNC))
|
||||
continue;
|
||||
|
||||
|
@ -76,7 +83,7 @@ static void * path_run(void *arg)
|
|||
p->previous = p->current = p->pool;
|
||||
|
||||
/* Main thread loop */
|
||||
for(;;) {
|
||||
for (;;) {
|
||||
/* Receive message */
|
||||
int recv = node_read(p->in, p->pool, p->poolsize, p->received, p->in->combine);
|
||||
if (recv < 0)
|
||||
|
|
|
@ -193,8 +193,8 @@ int main(int argc, char *argv[])
|
|||
|
||||
/* Run! */
|
||||
if (settings.stats > 0) {
|
||||
info("%-32s : %-8s %-8s %-8s %-8s %-8s",
|
||||
"Source " MAG("=>") " Destination", "#Sent", "#Recv", "#Drop", "#Skip", "#Invalid");
|
||||
info("%-32s : %-8s %-8s %-8s %-8s %-8s %-8s",
|
||||
"Source " MAG("=>") " Destination", "#Sent", "#Recv", "#Drop", "#Skip", "#Invalid", "#Overuns");
|
||||
line();
|
||||
|
||||
do list_foreach(struct path *p, &paths) {
|
||||
|
|
Loading…
Add table
Reference in a new issue