aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_debugfs.c
diff options
context:
space:
mode:
authorJames Smart <James.Smart@Emulex.Com>2007-08-02 11:10:09 -0400
committerJames Bottomley <jejb@mulgrave.localdomain>2007-08-01 13:21:26 -0400
commite8b62011d88d6fdba585fb2bb77c9274a63cadab (patch)
tree838c3abee73ec571456ae3ae83e51ecbed8e4a64 /drivers/scsi/lpfc/lpfc_debugfs.c
parent3de2a653a127c468284c48e233719dc39769e354 (diff)
[SCSI] lpfc 8.2.2 : Rework the lpfc_printf_log() macro
Rework the lpfc_printf_log() macro so that logging is enabled on a per-vport basis. Used to be on a physical-port basis, thus logging with large numbers of vports became a mess. Required redefinition of the macro, and an update of every use. Signed-off-by: James Smart <James.Smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_debugfs.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_debugfs.c62
1 files changed, 26 insertions, 36 deletions
diff --git a/drivers/scsi/lpfc/lpfc_debugfs.c b/drivers/scsi/lpfc/lpfc_debugfs.c
index 2310a2d1d8ce..dc7b858b95fa 100644
--- a/drivers/scsi/lpfc/lpfc_debugfs.c
+++ b/drivers/scsi/lpfc/lpfc_debugfs.c
@@ -642,13 +642,11 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
642 lpfc_debugfs_root = debugfs_create_dir("lpfc", NULL); 642 lpfc_debugfs_root = debugfs_create_dir("lpfc", NULL);
643 atomic_set(&lpfc_debugfs_hba_count, 0); 643 atomic_set(&lpfc_debugfs_hba_count, 0);
644 if (!lpfc_debugfs_root) { 644 if (!lpfc_debugfs_root) {
645 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 645 lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
646 "%d:0409 Cannot create debugfs root (lpfc)", 646 "0409 Cannot create debugfs root\n");
647 phba->brd_no);
648 goto debug_failed; 647 goto debug_failed;
649 } 648 }
650 } 649 }
651
652 if (!lpfc_debugfs_start_time) 650 if (!lpfc_debugfs_start_time)
653 lpfc_debugfs_start_time = jiffies; 651 lpfc_debugfs_start_time = jiffies;
654 652
@@ -658,9 +656,8 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
658 phba->hba_debugfs_root = 656 phba->hba_debugfs_root =
659 debugfs_create_dir(name, lpfc_debugfs_root); 657 debugfs_create_dir(name, lpfc_debugfs_root);
660 if (!phba->hba_debugfs_root) { 658 if (!phba->hba_debugfs_root) {
661 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 659 lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
662 "%d:0409 Cannot create debugfs hba (lpfc%d)", 660 "0409 Cannot create debugfs hba\n");
663 phba->brd_no, phba->brd_no);
664 goto debug_failed; 661 goto debug_failed;
665 } 662 }
666 atomic_inc(&lpfc_debugfs_hba_count); 663 atomic_inc(&lpfc_debugfs_hba_count);
@@ -673,9 +670,8 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
673 phba->hba_debugfs_root, 670 phba->hba_debugfs_root,
674 phba, &lpfc_debugfs_op_dumpslim); 671 phba, &lpfc_debugfs_op_dumpslim);
675 if (!phba->debug_dumpslim) { 672 if (!phba->debug_dumpslim) {
676 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 673 lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
677 "%d:0409 Cannot create debugfs dumpslim (lpfc%d)", 674 "0409 Cannot create debugfs dumpslim\n");
678 phba->brd_no, phba->brd_no);
679 goto debug_failed; 675 goto debug_failed;
680 } 676 }
681 677
@@ -692,8 +688,8 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
692 } 688 }
693 lpfc_debugfs_max_slow_ring_trc = (1 << i); 689 lpfc_debugfs_max_slow_ring_trc = (1 << i);
694 printk(KERN_ERR 690 printk(KERN_ERR
695 "lpfc_debugfs_max_slow_ring_trc change to %d\n", 691 "lpfc_debugfs_max_disc_trc changed to "
696 lpfc_debugfs_max_slow_ring_trc); 692 "%d\n", lpfc_debugfs_max_disc_trc);
697 } 693 }
698 } 694 }
699 695
@@ -704,10 +700,9 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
704 phba->hba_debugfs_root, 700 phba->hba_debugfs_root,
705 phba, &lpfc_debugfs_op_slow_ring_trc); 701 phba, &lpfc_debugfs_op_slow_ring_trc);
706 if (!phba->debug_slow_ring_trc) { 702 if (!phba->debug_slow_ring_trc) {
707 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 703 lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
708 "%d:0409 Cannot create debugfs " 704 "0409 Cannot create debugfs "
709 "slow_ring_trace (lpfc%d)", 705 "slow_ring_trace\n");
710 phba->brd_no, phba->brd_no);
711 goto debug_failed; 706 goto debug_failed;
712 } 707 }
713 if (!phba->slow_ring_trc) { 708 if (!phba->slow_ring_trc) {
@@ -716,10 +711,9 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
716 lpfc_debugfs_max_slow_ring_trc), 711 lpfc_debugfs_max_slow_ring_trc),
717 GFP_KERNEL); 712 GFP_KERNEL);
718 if (!phba->slow_ring_trc) { 713 if (!phba->slow_ring_trc) {
719 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 714 lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
720 "%d:0409 Cannot create debugfs " 715 "0409 Cannot create debugfs "
721 "slow_ring buffer (lpfc%d)", 716 "slow_ring buffer\n");
722 phba->brd_no, phba->brd_no);
723 goto debug_failed; 717 goto debug_failed;
724 } 718 }
725 atomic_set(&phba->slow_ring_trc_cnt, 0); 719 atomic_set(&phba->slow_ring_trc_cnt, 0);
@@ -734,9 +728,8 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
734 vport->vport_debugfs_root = 728 vport->vport_debugfs_root =
735 debugfs_create_dir(name, phba->hba_debugfs_root); 729 debugfs_create_dir(name, phba->hba_debugfs_root);
736 if (!vport->vport_debugfs_root) { 730 if (!vport->vport_debugfs_root) {
737 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 731 lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
738 "%d:0409 Cant create debugfs vport%d (lpfc%d)", 732 "0409 Cant create debugfs");
739 phba->brd_no, vport->vpi, phba->brd_no);
740 goto debug_failed; 733 goto debug_failed;
741 } 734 }
742 atomic_inc(&phba->debugfs_vport_count); 735 atomic_inc(&phba->debugfs_vport_count);
@@ -754,8 +747,8 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
754 } 747 }
755 lpfc_debugfs_max_disc_trc = (1 << i); 748 lpfc_debugfs_max_disc_trc = (1 << i);
756 printk(KERN_ERR 749 printk(KERN_ERR
757 "lpfc_debugfs_max_disc_trc changed to %d\n", 750 "lpfc_debugfs_max_disc_trc changed to %d\n",
758 lpfc_debugfs_max_disc_trc); 751 lpfc_debugfs_max_disc_trc);
759 } 752 }
760 } 753 }
761 754
@@ -764,10 +757,9 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
764 GFP_KERNEL); 757 GFP_KERNEL);
765 758
766 if (!vport->disc_trc) { 759 if (!vport->disc_trc) {
767 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 760 lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
768 "%d:0409 Cannot create debugfs " 761 "0409 Cannot create debugfs disc trace "
769 "vport%d disc trace buffer (lpfc%d)", 762 "buffer\n");
770 phba->brd_no, vport->vpi, phba->brd_no);
771 goto debug_failed; 763 goto debug_failed;
772 } 764 }
773 atomic_set(&vport->disc_trc_cnt, 0); 765 atomic_set(&vport->disc_trc_cnt, 0);
@@ -780,10 +772,9 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
780 vport->vport_debugfs_root, 772 vport->vport_debugfs_root,
781 vport, &lpfc_debugfs_op_disc_trc); 773 vport, &lpfc_debugfs_op_disc_trc);
782 if (!vport->debug_disc_trc) { 774 if (!vport->debug_disc_trc) {
783 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 775 lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
784 "%d:0409 Cannot create debugfs " 776 "0409 Cannot create debugfs "
785 "vport%d discovery_trace (lpfc%d)", 777 "discovery_trace\n");
786 phba->brd_no, vport->vpi, phba->brd_no);
787 goto debug_failed; 778 goto debug_failed;
788 } 779 }
789 snprintf(name, sizeof(name), "nodelist"); 780 snprintf(name, sizeof(name), "nodelist");
@@ -792,9 +783,8 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport)
792 vport->vport_debugfs_root, 783 vport->vport_debugfs_root,
793 vport, &lpfc_debugfs_op_nodelist); 784 vport, &lpfc_debugfs_op_nodelist);
794 if (!vport->debug_nodelist) { 785 if (!vport->debug_nodelist) {
795 lpfc_printf_log(phba, KERN_ERR, LOG_INIT, 786 lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT,
796 "%d:0409 Cant create debugfs vport%d nodelist (lpfc%d)", 787 "0409 Cant create debugfs nodelist");
797 phba->brd_no, vport->vpi, phba->brd_no);
798 goto debug_failed; 788 goto debug_failed;
799 } 789 }
800debug_failed: 790debug_failed: