thread: print dev->name in error messages

All io_devices now have an associated name - so add
that name to relevant error messages to help with
debugging.

Signed-off-by: Jim Harris <james.r.harris@intel.com>
Change-Id: I8ef678681fc29daed08e2f95b3096c5dce429ab9

Reviewed-on: https://review.gerrithub.io/433203
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
Jim Harris 2018-10-30 23:34:53 -07:00
parent b15ecfad85
commit f3d7215681

View File

@ -573,7 +573,8 @@ spdk_io_device_register(void *io_device, spdk_io_channel_create_cb create_cb,
pthread_mutex_lock(&g_devlist_mutex);
TAILQ_FOREACH(tmp, &g_io_devices, tailq) {
if (tmp->io_device == io_device) {
SPDK_ERRLOG("io_device %p already registered\n", io_device);
SPDK_ERRLOG("io_device %p already registered (old:%s new:%s)\n",
io_device, tmp->name, dev->name);
free(dev->name);
free(dev);
pthread_mutex_unlock(&g_devlist_mutex);
@ -635,7 +636,8 @@ spdk_io_device_unregister(void *io_device, spdk_io_device_unregister_cb unregist
}
if (dev->for_each_count > 0) {
SPDK_ERRLOG("io_device %p has %u for_each calls outstanding\n", io_device, dev->for_each_count);
SPDK_ERRLOG("io_device %s (%p) has %u for_each calls outstanding\n",
dev->name, io_device, dev->for_each_count);
pthread_mutex_unlock(&g_devlist_mutex);
return;
}