aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_dbf.c
diff options
context:
space:
mode:
authorMartin Peschke <mp3@de.ibm.com>2008-03-27 09:22:04 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-04-07 13:19:05 -0400
commit6f4f365e9c5d721c4d03ee8009dd6fab47feb045 (patch)
tree21bbaf06cf0889c2e81944381689703e3af90829 /drivers/s390/scsi/zfcp_dbf.c
parent9467a9b3efdd9041202f71cc270bda827a7ec777 (diff)
[SCSI] zfcp: Add trace records for recovery actions.
This patch writes trace records for various phases of a recovery action: action being created, action being processed, action continueing asynchronously, action gone, action timed out, action dismissed etc. Signed-off-by: Martin Peschke <mp3@de.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/s390/scsi/zfcp_dbf.c')
-rw-r--r--drivers/s390/scsi/zfcp_dbf.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c
index f207b0bd0cad..466a689c538f 100644
--- a/drivers/s390/scsi/zfcp_dbf.c
+++ b/drivers/s390/scsi/zfcp_dbf.c
@@ -524,6 +524,7 @@ static const char *zfcp_rec_dbf_tags[] = {
524 [ZFCP_REC_DBF_ID_THREAD] = "thread", 524 [ZFCP_REC_DBF_ID_THREAD] = "thread",
525 [ZFCP_REC_DBF_ID_TARGET] = "target", 525 [ZFCP_REC_DBF_ID_TARGET] = "target",
526 [ZFCP_REC_DBF_ID_TRIGGER] = "trigger", 526 [ZFCP_REC_DBF_ID_TRIGGER] = "trigger",
527 [ZFCP_REC_DBF_ID_ACTION] = "action",
527}; 528};
528 529
529static const char *zfcp_rec_dbf_ids[] = { 530static const char *zfcp_rec_dbf_ids[] = {
@@ -671,6 +672,11 @@ static const char *zfcp_rec_dbf_ids[] = {
671 [139] = "hbaapi unit shutdown", 672 [139] = "hbaapi unit shutdown",
672 [140] = "qdio error", 673 [140] = "qdio error",
673 [141] = "scsi host reset", 674 [141] = "scsi host reset",
675 [142] = "dismissing fsf request for recovery action",
676 [143] = "recovery action timed out",
677 [144] = "recovery action gone",
678 [145] = "recovery action being processed",
679 [146] = "recovery action ready for next step",
674}; 680};
675 681
676static int zfcp_rec_dbf_view_format(debug_info_t *id, struct debug_view *view, 682static int zfcp_rec_dbf_view_format(debug_info_t *id, struct debug_view *view,
@@ -708,6 +714,12 @@ static int zfcp_rec_dbf_view_format(debug_info_t *id, struct debug_view *view,
708 zfcp_dbf_out(&p, "port_status", "0x%08x", r->u.trigger.ps); 714 zfcp_dbf_out(&p, "port_status", "0x%08x", r->u.trigger.ps);
709 zfcp_dbf_out(&p, "unit_status", "0x%08x", r->u.trigger.us); 715 zfcp_dbf_out(&p, "unit_status", "0x%08x", r->u.trigger.us);
710 break; 716 break;
717 case ZFCP_REC_DBF_ID_ACTION:
718 zfcp_dbf_out(&p, "erp_action", "0x%016Lx", r->u.action.action);
719 zfcp_dbf_out(&p, "fsf_req", "0x%016Lx", r->u.action.fsf_req);
720 zfcp_dbf_out(&p, "status", "0x%08Lx", r->u.action.status);
721 zfcp_dbf_out(&p, "step", "0x%08Lx", r->u.action.step);
722 break;
711 } 723 }
712 sprintf(p, "\n"); 724 sprintf(p, "\n");
713 return (p - buf) + 1; 725 return (p - buf) + 1;
@@ -861,6 +873,29 @@ void zfcp_rec_dbf_event_trigger(u8 id2, u64 ref, u8 want, u8 need, u64 action,
861 spin_unlock_irqrestore(&adapter->rec_dbf_lock, flags); 873 spin_unlock_irqrestore(&adapter->rec_dbf_lock, flags);
862} 874}
863 875
876/**
877 * zfcp_rec_dbf_event_action - trace event showing progress of recovery action
878 * @id2: identifier
879 * @erp_action: error recovery action struct pointer
880 */
881void zfcp_rec_dbf_event_action(u8 id2, struct zfcp_erp_action *erp_action)
882{
883 struct zfcp_adapter *adapter = erp_action->adapter;
884 struct zfcp_rec_dbf_record *r = &adapter->rec_dbf_buf;
885 unsigned long flags;
886
887 spin_lock_irqsave(&adapter->rec_dbf_lock, flags);
888 memset(r, 0, sizeof(*r));
889 r->id = ZFCP_REC_DBF_ID_ACTION;
890 r->id2 = id2;
891 r->u.action.action = (u64)erp_action;
892 r->u.action.status = erp_action->status;
893 r->u.action.step = erp_action->step;
894 r->u.action.fsf_req = (u64)erp_action->fsf_req;
895 debug_event(adapter->rec_dbf, 4, r, sizeof(*r));
896 spin_unlock_irqrestore(&adapter->rec_dbf_lock, flags);
897}
898
864static void 899static void
865_zfcp_san_dbf_event_common_ct(const char *tag, struct zfcp_fsf_req *fsf_req, 900_zfcp_san_dbf_event_common_ct(const char *tag, struct zfcp_fsf_req *fsf_req,
866 u32 s_id, u32 d_id, void *buffer, int buflen) 901 u32 s_id, u32 d_id, void *buffer, int buflen)