From 6d13026f05fc2f6daf99878efa9a9ca542eeaf2b Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Thu, 19 Jul 2012 19:13:28 +0000 Subject: [PATCH] Default logging improvements git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4410 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_lib.c | 18 +++++++++--------- scst/src/scst_targ.c | 20 +++++++++----------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index e46631605..133bd4079 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -2476,7 +2476,7 @@ static void scst_check_reassign_sess(struct scst_session *sess) goto out; } - TRACE_MGMT_DBG("sess %p will be reassigned from acg %s to acg %s", + PRINT_INFO("sess %p will be reassigned from acg %s to acg %s", sess, sess->acg->acg_name, acg->acg_name); old_acg = sess->acg; @@ -3800,7 +3800,7 @@ out: found: if (t->active_cmd_threads == &scst_main_cmd_threads) { res = t; - TRACE_MGMT_DBG("Going to share async IO context %p (res %p, " + TRACE_DBG("Going to share async IO context %p (res %p, " "ini %s, dev %s, grouping type %d)", t->aic_keeper->aic, res, t->sess->initiator_name, t->dev->virt_name, @@ -3808,13 +3808,13 @@ found: } else { res = t; if (!*(volatile bool*)&res->active_cmd_threads->io_context_ready) { - TRACE_MGMT_DBG("IO context for t %p not yet " + TRACE_DBG("IO context for t %p not yet " "initialized, waiting...", t); msleep(100); goto found; } smp_rmb(); - TRACE_MGMT_DBG("Going to share IO context %p (res %p, ini %s, " + TRACE_DBG("Going to share IO context %p (res %p, ini %s, " "dev %s, cmd_threads %p, grouping type %d)", res->active_cmd_threads->io_context, res, t->sess->initiator_name, t->dev->virt_name, @@ -3866,7 +3866,7 @@ static int scst_ioc_keeper_thread(void *arg) aic_keeper->aic = get_io_context(GFP_KERNEL, -1); #endif #endif - TRACE_MGMT_DBG("Alloced new async IO context %p (aic %p)", + TRACE_DBG("Alloced new async IO context %p (aic %p)", aic_keeper->aic, aic_keeper); /* We have our own ref counting */ @@ -3907,7 +3907,7 @@ int scst_tgt_dev_setup_threads(struct scst_tgt_dev *tgt_dev) aic_keeper = shared_io_tgt_dev->aic_keeper; kref_get(&aic_keeper->aic_keeper_kref); - TRACE_MGMT_DBG("Linking async io context %p " + TRACE_DBG("Linking async io context %p " "for shared tgt_dev %p (dev %s)", aic_keeper->aic, tgt_dev, tgt_dev->dev->virt_name); @@ -3937,7 +3937,7 @@ int scst_tgt_dev_setup_threads(struct scst_tgt_dev *tgt_dev) wait_event(aic_keeper->aic_keeper_waitQ, aic_keeper->aic_ready); - TRACE_MGMT_DBG("Created async io context %p " + TRACE_DBG("Created async io context %p " "for not shared tgt_dev %p (dev %s)", aic_keeper->aic, tgt_dev, tgt_dev->dev->virt_name); @@ -3962,7 +3962,7 @@ int scst_tgt_dev_setup_threads(struct scst_tgt_dev *tgt_dev) shared_io_tgt_dev = scst_find_shared_io_tgt_dev(tgt_dev); if (shared_io_tgt_dev != NULL) { - TRACE_MGMT_DBG("Linking io context %p for " + TRACE_DBG("Linking io context %p for " "shared tgt_dev %p (cmd_threads %p)", shared_io_tgt_dev->active_cmd_threads->io_context, tgt_dev, tgt_dev->active_cmd_threads); @@ -8568,7 +8568,7 @@ static bool scst_parse_unmap_descriptors(struct scst_cmd *cmd) length = scst_get_buf_full_sense(cmd, &address); if (unlikely(length <= 0)) { if (length == 0) - goto out_put; + goto out; else goto out_abn; } diff --git a/scst/src/scst_targ.c b/scst/src/scst_targ.c index 19c2a6b22..3bb04497b 100644 --- a/scst/src/scst_targ.c +++ b/scst/src/scst_targ.c @@ -3744,12 +3744,8 @@ static int scst_finish_cmd(struct scst_cmd *cmd) spin_unlock_irq(&sess->sess_list_lock); - if (unlikely(test_bit(SCST_CMD_ABORTED, &cmd->cmd_flags))) { - TRACE_MGMT_DBG("Aborted cmd %p finished (cmd_ref %d)", - cmd, atomic_read(&cmd->cmd_ref)); - + if (unlikely(test_bit(SCST_CMD_ABORTED, &cmd->cmd_flags))) scst_finish_cmd_mgmt(cmd); - } __scst_cmd_put(cmd); @@ -4170,7 +4166,7 @@ static void scst_ioctx_get(struct scst_cmd_threads *p_cmd_threads) #else p_cmd_threads->io_context = get_io_context(GFP_KERNEL, -1); #endif - TRACE_MGMT_DBG("Alloced new IO context %p " + TRACE_DBG("Alloced new IO context %p " "(p_cmd_threads %p)", p_cmd_threads->io_context, p_cmd_threads); /* @@ -4181,7 +4177,7 @@ static void scst_ioctx_get(struct scst_cmd_threads *p_cmd_threads) } else { current->io_context = ioc_task_link(p_cmd_threads->io_context); - TRACE_MGMT_DBG("Linked IO context %p " + TRACE_DBG("Linked IO context %p " "(p_cmd_threads %p)", p_cmd_threads->io_context, p_cmd_threads); } @@ -4682,8 +4678,8 @@ static void scst_finish_cmd_mgmt(struct scst_cmd *cmd) TRACE_ENTRY(); - TRACE_MGMT_DBG("cmd %p finished (tag %llu)", - cmd, (long long unsigned int)cmd->tag); + TRACE(TRACE_MGMT, "Aborted cmd %p finished (tag %llu, ref %d)", cmd, + (long long unsigned int)cmd->tag, atomic_read(&cmd->cmd_ref)); spin_lock_irqsave(&scst_mcmd_lock, flags); @@ -4873,7 +4869,7 @@ void scst_abort_cmd(struct scst_cmd *cmd, struct scst_mgmt_cmd *mcmd, } if (mstb->done_counted || mstb->finish_counted) { - TRACE(TRACE_SCSI|TRACE_MGMT_DEBUG, "cmd %p (tag %llu, " + PRINT_INFO("cmd %p (tag %llu, " "sn %u) being executed/xmitted (state %d, " "op %x, proc time %ld sec., timeout %d sec.), " "deferring ABORT (cmd_done_wait_count %d, " @@ -6157,7 +6153,9 @@ int scst_rx_mgmt_fn(struct scst_session *sess, mcmd->cmd_sn = params->cmd_sn; if (params->fn < SCST_UNREG_SESS_TM) - TRACE(TRACE_MGMT, "TM fn %d (%p)", params->fn, mcmd); + TRACE(TRACE_MGMT, "TM fn %d (%p, initiator %s, target %s)", + params->fn, mcmd, sess->initiator_name, + sess->tgt->tgt_name); else TRACE_MGMT_DBG("TM fn %d (%p)", params->fn, mcmd);