Commit f3d72156 authored by Jim Harris's avatar Jim Harris
Browse files

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: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I8ef678681fc29daed08e2f95b3096c5dce429ab9

Reviewed-on: https://review.gerrithub.io/433203


Reviewed-by: default avatarPaul Luse <paul.e.luse@intel.com>
Reviewed-by: default avatarDarek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
parent b15ecfad
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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;
	}