aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs/debug.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-10-31 11:32:30 -0400
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2008-12-03 06:14:34 -0500
commit2ba5f7ae8165b3f575dd3a7d8bb18f421fab8273 (patch)
treec2916fd6398b0a380eed9ac3cd9e59c92ae8cbd5 /fs/ubifs/debug.c
parent787845bdeadd368eedeace92d5bf53f5aa1450ba (diff)
UBIFS: introduce LPT dump function
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs/ubifs/debug.c')
-rw-r--r--fs/ubifs/debug.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c
index 56842772c804..934db1855f09 100644
--- a/fs/ubifs/debug.c
+++ b/fs/ubifs/debug.c
@@ -646,7 +646,8 @@ void dbg_dump_lprops(struct ubifs_info *c)
646 struct ubifs_lprops lp; 646 struct ubifs_lprops lp;
647 struct ubifs_lp_stats lst; 647 struct ubifs_lp_stats lst;
648 648
649 printk(KERN_DEBUG "(pid %d) Dumping LEB properties\n", current->pid); 649 printk(KERN_DEBUG "(pid %d) start dumping LEB properties\n",
650 current->pid);
650 ubifs_get_lp_stats(c, &lst); 651 ubifs_get_lp_stats(c, &lst);
651 dbg_dump_lstats(&lst); 652 dbg_dump_lstats(&lst);
652 653
@@ -657,6 +658,8 @@ void dbg_dump_lprops(struct ubifs_info *c)
657 658
658 dbg_dump_lprop(c, &lp); 659 dbg_dump_lprop(c, &lp);
659 } 660 }
661 printk(KERN_DEBUG "(pid %d) finish dumping LEB properties\n",
662 current->pid);
660} 663}
661 664
662void dbg_dump_lpt_info(struct ubifs_info *c) 665void dbg_dump_lpt_info(struct ubifs_info *c)
@@ -664,6 +667,7 @@ void dbg_dump_lpt_info(struct ubifs_info *c)
664 int i; 667 int i;
665 668
666 spin_lock(&dbg_lock); 669 spin_lock(&dbg_lock);
670 printk(KERN_DEBUG "(pid %d) dumping LPT information\n", current->pid);
667 printk(KERN_DEBUG "\tlpt_sz: %lld\n", c->lpt_sz); 671 printk(KERN_DEBUG "\tlpt_sz: %lld\n", c->lpt_sz);
668 printk(KERN_DEBUG "\tpnode_sz: %d\n", c->pnode_sz); 672 printk(KERN_DEBUG "\tpnode_sz: %d\n", c->pnode_sz);
669 printk(KERN_DEBUG "\tnnode_sz: %d\n", c->nnode_sz); 673 printk(KERN_DEBUG "\tnnode_sz: %d\n", c->nnode_sz);
@@ -704,8 +708,8 @@ void dbg_dump_leb(const struct ubifs_info *c, int lnum)
704 if (dbg_failure_mode) 708 if (dbg_failure_mode)
705 return; 709 return;
706 710
707 printk(KERN_DEBUG "(pid %d) Dumping LEB %d\n", current->pid, lnum); 711 printk(KERN_DEBUG "(pid %d) start dumping LEB %d\n",
708 712 current->pid, lnum);
709 sleb = ubifs_scan(c, lnum, 0, c->dbg->buf); 713 sleb = ubifs_scan(c, lnum, 0, c->dbg->buf);
710 if (IS_ERR(sleb)) { 714 if (IS_ERR(sleb)) {
711 ubifs_err("scan error %d", (int)PTR_ERR(sleb)); 715 ubifs_err("scan error %d", (int)PTR_ERR(sleb));
@@ -722,6 +726,8 @@ void dbg_dump_leb(const struct ubifs_info *c, int lnum)
722 dbg_dump_node(c, snod->node); 726 dbg_dump_node(c, snod->node);
723 } 727 }
724 728
729 printk(KERN_DEBUG "(pid %d) finish dumping LEB %d\n",
730 current->pid, lnum);
725 ubifs_scan_destroy(sleb); 731 ubifs_scan_destroy(sleb);
726 return; 732 return;
727} 733}
@@ -769,7 +775,7 @@ void dbg_dump_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, int cat)
769{ 775{
770 int i; 776 int i;
771 777
772 printk(KERN_DEBUG "(pid %d) Dumping heap cat %d (%d elements)\n", 778 printk(KERN_DEBUG "(pid %d) start dumping heap cat %d (%d elements)\n",
773 current->pid, cat, heap->cnt); 779 current->pid, cat, heap->cnt);
774 for (i = 0; i < heap->cnt; i++) { 780 for (i = 0; i < heap->cnt; i++) {
775 struct ubifs_lprops *lprops = heap->arr[i]; 781 struct ubifs_lprops *lprops = heap->arr[i];
@@ -778,6 +784,7 @@ void dbg_dump_heap(struct ubifs_info *c, struct ubifs_lpt_heap *heap, int cat)
778 "flags %d\n", i, lprops->lnum, lprops->hpos, 784 "flags %d\n", i, lprops->lnum, lprops->hpos,
779 lprops->free, lprops->dirty, lprops->flags); 785 lprops->free, lprops->dirty, lprops->flags);
780 } 786 }
787 printk(KERN_DEBUG "(pid %d) finish dumping heap\n", current->pid);
781} 788}
782 789
783void dbg_dump_pnode(struct ubifs_info *c, struct ubifs_pnode *pnode, 790void dbg_dump_pnode(struct ubifs_info *c, struct ubifs_pnode *pnode,
@@ -785,7 +792,7 @@ void dbg_dump_pnode(struct ubifs_info *c, struct ubifs_pnode *pnode,
785{ 792{
786 int i; 793 int i;
787 794
788 printk(KERN_DEBUG "(pid %d) Dumping pnode:\n", current->pid); 795 printk(KERN_DEBUG "(pid %d) dumping pnode:\n", current->pid);
789 printk(KERN_DEBUG "\taddress %zx parent %zx cnext %zx\n", 796 printk(KERN_DEBUG "\taddress %zx parent %zx cnext %zx\n",
790 (size_t)pnode, (size_t)parent, (size_t)pnode->cnext); 797 (size_t)pnode, (size_t)parent, (size_t)pnode->cnext);
791 printk(KERN_DEBUG "\tflags %lu iip %d level %d num %d\n", 798 printk(KERN_DEBUG "\tflags %lu iip %d level %d num %d\n",
@@ -804,7 +811,7 @@ void dbg_dump_tnc(struct ubifs_info *c)
804 int level; 811 int level;
805 812
806 printk(KERN_DEBUG "\n"); 813 printk(KERN_DEBUG "\n");
807 printk(KERN_DEBUG "(pid %d) Dumping the TNC tree\n", current->pid); 814 printk(KERN_DEBUG "(pid %d) start dumping TNC tree\n", current->pid);
808 znode = ubifs_tnc_levelorder_next(c->zroot.znode, NULL); 815 znode = ubifs_tnc_levelorder_next(c->zroot.znode, NULL);
809 level = znode->level; 816 level = znode->level;
810 printk(KERN_DEBUG "== Level %d ==\n", level); 817 printk(KERN_DEBUG "== Level %d ==\n", level);
@@ -816,8 +823,7 @@ void dbg_dump_tnc(struct ubifs_info *c)
816 dbg_dump_znode(c, znode); 823 dbg_dump_znode(c, znode);
817 znode = ubifs_tnc_levelorder_next(c->zroot.znode, znode); 824 znode = ubifs_tnc_levelorder_next(c->zroot.znode, znode);
818 } 825 }
819 826 printk(KERN_DEBUG "(pid %d) finish dumping TNC tree\n", current->pid);
820 printk(KERN_DEBUG "\n");
821} 827}
822 828
823static int dump_znode(struct ubifs_info *c, struct ubifs_znode *znode, 829static int dump_znode(struct ubifs_info *c, struct ubifs_znode *znode,
@@ -992,7 +998,8 @@ static int dbg_check_key_order(struct ubifs_info *c, struct ubifs_zbranch *zbr1,
992 ubifs_err("1st entry at %d:%d has key %s", zbr1->lnum, 998 ubifs_err("1st entry at %d:%d has key %s", zbr1->lnum,
993 zbr1->offs, DBGKEY(&key)); 999 zbr1->offs, DBGKEY(&key));
994 ubifs_err("but it should have key %s according to tnc", 1000 ubifs_err("but it should have key %s according to tnc",
995 DBGKEY(&zbr1->key)); dbg_dump_node(c, dent1); 1001 DBGKEY(&zbr1->key));
1002 dbg_dump_node(c, dent1);
996 goto out_free; 1003 goto out_free;
997 } 1004 }
998 1005
@@ -1001,7 +1008,8 @@ static int dbg_check_key_order(struct ubifs_info *c, struct ubifs_zbranch *zbr1,
1001 ubifs_err("2nd entry at %d:%d has key %s", zbr1->lnum, 1008 ubifs_err("2nd entry at %d:%d has key %s", zbr1->lnum,
1002 zbr1->offs, DBGKEY(&key)); 1009 zbr1->offs, DBGKEY(&key));
1003 ubifs_err("but it should have key %s according to tnc", 1010 ubifs_err("but it should have key %s according to tnc",
1004 DBGKEY(&zbr2->key)); dbg_dump_node(c, dent2); 1011 DBGKEY(&zbr2->key));
1012 dbg_dump_node(c, dent2);
1005 goto out_free; 1013 goto out_free;
1006 } 1014 }
1007 1015