aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_dbf.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/scsi/zfcp_dbf.c')
-rw-r--r--drivers/s390/scsi/zfcp_dbf.c126
1 files changed, 126 insertions, 0 deletions
diff --git a/drivers/s390/scsi/zfcp_dbf.c b/drivers/s390/scsi/zfcp_dbf.c
index 5a4b1e9a8b50..2fcfe9bec554 100644
--- a/drivers/s390/scsi/zfcp_dbf.c
+++ b/drivers/s390/scsi/zfcp_dbf.c
@@ -522,6 +522,7 @@ static struct debug_view zfcp_hba_dbf_view = {
522 522
523static const char *zfcp_rec_dbf_tags[] = { 523static 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}; 526};
526 527
527static const char *zfcp_rec_dbf_ids[] = { 528static const char *zfcp_rec_dbf_ids[] = {
@@ -534,6 +535,58 @@ static const char *zfcp_rec_dbf_ids[] = {
534 [7] = "down wakeup ecd", 535 [7] = "down wakeup ecd",
535 [8] = "down sleep epd", 536 [8] = "down sleep epd",
536 [9] = "down wakeup epd", 537 [9] = "down wakeup epd",
538 [10] = "online",
539 [11] = "operational",
540 [12] = "scsi slave destroy",
541 [13] = "propagate failed adapter",
542 [14] = "propagate failed port",
543 [15] = "block adapter",
544 [16] = "unblock adapter",
545 [17] = "block port",
546 [18] = "unblock port",
547 [19] = "block unit",
548 [20] = "unblock unit",
549 [21] = "unit recovery failed",
550 [22] = "port recovery failed",
551 [23] = "adapter recovery failed",
552 [24] = "qdio queues down",
553 [25] = "p2p failed",
554 [26] = "nameserver lookup failed",
555 [27] = "nameserver port failed",
556 [28] = "link up",
557 [29] = "link down",
558 [30] = "link up status read",
559 [31] = "open port failed",
560 [32] = "open port failed",
561 [33] = "close port",
562 [34] = "open unit failed",
563 [35] = "exclusive open unit failed",
564 [36] = "shared open unit failed",
565 [37] = "link down",
566 [38] = "link down status read no link",
567 [39] = "link down status read fdisc login",
568 [40] = "link down status read firmware update",
569 [41] = "link down status read unknown reason",
570 [42] = "link down ecd incomplete",
571 [43] = "link down epd incomplete",
572 [44] = "sysfs adapter recovery",
573 [45] = "sysfs port recovery",
574 [46] = "sysfs unit recovery",
575 [47] = "port boxed abort",
576 [48] = "unit boxed abort",
577 [49] = "port boxed ct",
578 [50] = "port boxed close physical",
579 [51] = "port boxed open unit",
580 [52] = "port boxed close unit",
581 [53] = "port boxed fcp",
582 [54] = "unit boxed fcp",
583 [55] = "port access denied ct",
584 [56] = "port access denied els",
585 [57] = "port access denied open port",
586 [58] = "port access denied close physical",
587 [59] = "unit access denied open unit",
588 [60] = "shared unit access denied open unit",
589 [61] = "unit access denied fcp",
537}; 590};
538 591
539static int zfcp_rec_dbf_view_format(debug_info_t *id, struct debug_view *view, 592static int zfcp_rec_dbf_view_format(debug_info_t *id, struct debug_view *view,
@@ -552,6 +605,14 @@ static int zfcp_rec_dbf_view_format(debug_info_t *id, struct debug_view *view,
552 zfcp_dbf_out(&p, "ready", "%d", r->u.thread.ready); 605 zfcp_dbf_out(&p, "ready", "%d", r->u.thread.ready);
553 zfcp_dbf_out(&p, "running", "%d", r->u.thread.running); 606 zfcp_dbf_out(&p, "running", "%d", r->u.thread.running);
554 break; 607 break;
608 case ZFCP_REC_DBF_ID_TARGET:
609 zfcp_dbf_out(&p, "reference", "0x%016Lx", r->u.target.ref);
610 zfcp_dbf_out(&p, "status", "0x%08x", r->u.target.status);
611 zfcp_dbf_out(&p, "erp_count", "%d", r->u.target.erp_count);
612 zfcp_dbf_out(&p, "d_id", "0x%06x", r->u.target.d_id);
613 zfcp_dbf_out(&p, "wwpn", "0x%016Lx", r->u.target.wwpn);
614 zfcp_dbf_out(&p, "fcp_lun", "0x%016Lx", r->u.target.fcp_lun);
615 break;
555 } 616 }
556 sprintf(p, "\n"); 617 sprintf(p, "\n");
557 return (p - buf) + 1; 618 return (p - buf) + 1;
@@ -601,6 +662,71 @@ void zfcp_rec_dbf_event_thread(u8 id2, struct zfcp_adapter *adapter, int lock)
601 spin_unlock_irqrestore(&adapter->rec_dbf_lock, flags); 662 spin_unlock_irqrestore(&adapter->rec_dbf_lock, flags);
602} 663}
603 664
665static void zfcp_rec_dbf_event_target(u8 id2, u64 ref,
666 struct zfcp_adapter *adapter,
667 atomic_t *status, atomic_t *erp_count,
668 u64 wwpn, u32 d_id, u64 fcp_lun)
669{
670 struct zfcp_rec_dbf_record *r = &adapter->rec_dbf_buf;
671 unsigned long flags;
672
673 spin_lock_irqsave(&adapter->rec_dbf_lock, flags);
674 memset(r, 0, sizeof(*r));
675 r->id = ZFCP_REC_DBF_ID_TARGET;
676 r->id2 = id2;
677 r->u.target.ref = ref;
678 r->u.target.status = atomic_read(status);
679 r->u.target.wwpn = wwpn;
680 r->u.target.d_id = d_id;
681 r->u.target.fcp_lun = fcp_lun;
682 r->u.target.erp_count = atomic_read(erp_count);
683 debug_event(adapter->rec_dbf, 3, r, sizeof(*r));
684 spin_unlock_irqrestore(&adapter->rec_dbf_lock, flags);
685}
686
687/**
688 * zfcp_rec_dbf_event_adapter - trace event for adapter state change
689 * @id: identifier for trigger of state change
690 * @ref: additional reference (e.g. request)
691 * @adapter: adapter
692 */
693void zfcp_rec_dbf_event_adapter(u8 id, u64 ref, struct zfcp_adapter *adapter)
694{
695 zfcp_rec_dbf_event_target(id, ref, adapter, &adapter->status,
696 &adapter->erp_counter, 0, 0, 0);
697}
698
699/**
700 * zfcp_rec_dbf_event_port - trace event for port state change
701 * @id: identifier for trigger of state change
702 * @ref: additional reference (e.g. request)
703 * @port: port
704 */
705void zfcp_rec_dbf_event_port(u8 id, u64 ref, struct zfcp_port *port)
706{
707 struct zfcp_adapter *adapter = port->adapter;
708
709 zfcp_rec_dbf_event_target(id, ref, adapter, &port->status,
710 &port->erp_counter, port->wwpn, port->d_id,
711 0);
712}
713
714/**
715 * zfcp_rec_dbf_event_unit - trace event for unit state change
716 * @id: identifier for trigger of state change
717 * @ref: additional reference (e.g. request)
718 * @unit: unit
719 */
720void zfcp_rec_dbf_event_unit(u8 id, u64 ref, struct zfcp_unit *unit)
721{
722 struct zfcp_port *port = unit->port;
723 struct zfcp_adapter *adapter = port->adapter;
724
725 zfcp_rec_dbf_event_target(id, ref, adapter, &unit->status,
726 &unit->erp_counter, port->wwpn, port->d_id,
727 unit->fcp_lun);
728}
729
604static void 730static void
605_zfcp_san_dbf_event_common_ct(const char *tag, struct zfcp_fsf_req *fsf_req, 731_zfcp_san_dbf_event_common_ct(const char *tag, struct zfcp_fsf_req *fsf_req,
606 u32 s_id, u32 d_id, void *buffer, int buflen) 732 u32 s_id, u32 d_id, void *buffer, int buflen)