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

added debug facilities to debug output

This commit is contained in:
Steffen Vogel 2016-06-13 21:43:08 +02:00
parent 04aad098bb
commit 35bfd02b13
2 changed files with 10 additions and 10 deletions

View file

@ -129,7 +129,7 @@ static int gtfpga_load_driver(struct pci_dev *d)
if (!f)
serror("Failed to add PCI id to uio_pci_generic driver");
debug(5, "Adding ID to uio_pci_generic module: %04x %04x", d->vendor_id, d->device_id);
debug(DBG_GTFPGA | 5, "Adding ID to uio_pci_generic module: %04x %04x", d->vendor_id, d->device_id);
fprintf(f, "%04x %04x", d->vendor_id, d->device_id);
fclose(f);
@ -138,7 +138,7 @@ static int gtfpga_load_driver(struct pci_dev *d)
if (!f)
serror("Failed to add PCI id to uio_pci_generic driver");
debug(5, "Bind slot to uio_pci_generic module: %s", slot);
debug(DBG_GTFPGA | 5, "Bind slot to uio_pci_generic module: %s", slot);
fprintf(f, "%s\n", slot);
fclose(f);
@ -168,7 +168,7 @@ static int gtfpga_mmap(struct gtfpga *g)
int size = g->dev->size[GTFPGA_BAR];
/* mmap() first BAR */
debug(5, "Setup mapping: mmap(NULL, %#x, PROT_READ | PROT_WRITE, MAP_SHARED, %u, %#lx)", size, fd, addr);
debug(DBG_GTFPGA | 5, "Setup mapping: mmap(NULL, %#x, PROT_READ | PROT_WRITE, MAP_SHARED, %u, %#lx)", size, fd, addr);
void *map = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, addr);
if (map == MAP_FAILED)
serror("Failed mmap()");

View file

@ -88,7 +88,7 @@ int opal_deinit()
if (err != EOK)
error("Failed to close shared memory area (%d)", err);
debug(4, "Closing OPAL shared memory mapping");
debug(DBG_OPAL | 4, "Closing OPAL shared memory mapping");
err = OpalSystemCtrl_UnRegister(print_shmem_name);
if (err != EOK)
@ -104,7 +104,7 @@ int opal_deinit()
int opal_print_global()
{
debug(2, "Controller ID: %u", params.controllerID);
debug(DBG_OPAL | 2, "Controller ID: %u", params.controllerID);
char *sbuf = alloc(send_icons * 5);
char *rbuf = alloc(recv_icons * 5);
@ -114,17 +114,17 @@ int opal_print_global()
for (int i = 0; i < recv_icons; i++)
strcatf(&rbuf, "%u ", recv_ids[i]);
debug(2, "Send Blocks: %s", sbuf);
debug(2, "Receive Blocks: %s", rbuf);
debug(DBG_OPAL | 2, "Send Blocks: %s", sbuf);
debug(DBG_OPAL | 2, "Receive Blocks: %s", rbuf);
free(sbuf);
free(rbuf);
debug(2, "Control Block Parameters:");
debug(DBG_OPAL | 2, "Control Block Parameters:");
for (int i = 0; i < GENASYNC_NB_FLOAT_PARAM; i++)
debug(2, "FloatParam[]%u] = %f", i, params.FloatParam[i]);
debug(DBG_OPAL | 2, "FloatParam[]%u] = %f", i, params.FloatParam[i]);
for (int i = 0; i < GENASYNC_NB_STRING_PARAM; i++)
debug(2, "StringParam[%u] = %s", i, params.StringParam[i]);
debug(DBG_OPAL | 2, "StringParam[%u] = %s", i, params.StringParam[i]);
return 0;
}