From f3d7215681dd396a249af0f9bf9e1ea157bac714 Mon Sep 17 00:00:00 2001 From: Jim Harris Date: Tue, 30 Oct 2018 23:34:53 -0700 Subject: [PATCH] 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 Change-Id: I8ef678681fc29daed08e2f95b3096c5dce429ab9 Reviewed-on: https://review.gerrithub.io/433203 Reviewed-by: Paul Luse Reviewed-by: Darek Stojaczyk Reviewed-by: Ben Walker Chandler-Test-Pool: SPDK Automated Test System --- lib/thread/thread.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/thread/thread.c b/lib/thread/thread.c index dd72b8f27..95d699807 100644 --- a/lib/thread/thread.c +++ b/lib/thread/thread.c @@ -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; }