1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

hook: add debug messages

This commit is contained in:
Steffen Vogel 2017-07-09 19:35:15 +02:00
parent 05f36e48e4
commit e17226995d

View file

@ -90,29 +90,46 @@ int hook_destroy(struct hook *h)
int hook_start(struct hook *h)
{
debug(LOG_HOOK, "Running hook %s: type=sart, priority=%d", plugin_name(h->_vt), h->priority);
return h->_vt->start ? h->_vt->start(h) : 0;
}
int hook_stop(struct hook *h)
{
debug(LOG_HOOK, "Running hook %s: type=stop, priority=%d", plugin_name(h->_vt), h->priority);
return h->_vt->stop ? h->_vt->stop(h) : 0;
}
int hook_periodic(struct hook *h)
{
debug(LOG_HOOK, "Running hook %s: type=periodic, priority=%d", plugin_name(h->_vt), h->priority);
return h->_vt->periodic ? h->_vt->periodic(h) : 0;
}
int hook_restart(struct hook *h)
{
debug(LOG_HOOK, "Running hook %s: type=restart, priority=%d", plugin_name(h->_vt), h->priority);
return h->_vt->restart ? h->_vt->restart(h) : 0;
}
int hook_read(struct hook *h, struct sample *smps[], size_t *cnt)
{
debug(LOG_HOOK, "Running hook %s: type=read, priority=%d, cnt=%zu", plugin_name(h->_vt), h->priority, *cnt);
return h->_vt->read ? h->_vt->read(h, smps, cnt) : 0;
}
int hook_write(struct hook *h, struct sample *smps[], size_t *cnt)
{
debug(LOG_HOOK, "Running hook %s: type=write, priority=%d, cnt=%zu", plugin_name(h->_vt), h->priority, *cnt);
return h->_vt->write ? h->_vt->write(h, smps, cnt) : 0;
}
size_t hook_read_list(struct list *hs, struct sample *smps[], size_t cnt)
{
size_t ret;
@ -147,11 +164,6 @@ size_t hook_write_list(struct list *hs, struct sample *smps[], size_t cnt)
return cnt;
}
int hook_write(struct hook *h, struct sample *smps[], size_t *cnt)
{
return h->_vt->write ? h->_vt->write(h, smps, cnt) : 0;
}
int hook_cmp_priority(const void *a, const void *b)
{
struct hook *ha = (struct hook *) a;