summaryrefslogtreecommitdiffstats
path: root/libsmartcols
diff options
context:
space:
mode:
authorKarel Zak2019-05-03 13:25:09 +0200
committerKarel Zak2019-05-03 13:25:09 +0200
commit46634fc90dde9086085b6a503844d098d4058b78 (patch)
treeb6fcb47f417fcb8cd3f253b3cafcc8f8b45ad7c4 /libsmartcols
parentlsblk: add more debug messages (diff)
downloadkernel-qcow2-util-linux-46634fc90dde9086085b6a503844d098d4058b78.tar.gz
kernel-qcow2-util-linux-46634fc90dde9086085b6a503844d098d4058b78.tar.xz
kernel-qcow2-util-linux-46634fc90dde9086085b6a503844d098d4058b78.zip
libsmartcols: (groups) improve debug messages
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libsmartcols')
-rw-r--r--libsmartcols/src/grouping.c9
-rw-r--r--libsmartcols/src/print.c7
2 files changed, 14 insertions, 2 deletions
diff --git a/libsmartcols/src/grouping.c b/libsmartcols/src/grouping.c
index fc4828c9c..b767405aa 100644
--- a/libsmartcols/src/grouping.c
+++ b/libsmartcols/src/grouping.c
@@ -159,6 +159,7 @@ static inline const char *group_state_to_string(int state)
return grpstates[state];
}
+/*
static void grpset_debug(struct libscols_table *tb, struct libscols_line *ln)
{
size_t i;
@@ -179,6 +180,8 @@ static void grpset_debug(struct libscols_table *tb, struct libscols_line *ln)
DBG(LINE, ul_debug("grpset[%zu]: free", i));
}
}
+*/
+
static int group_state_for_line(struct libscols_group *gr, struct libscols_line *ln)
{
if (gr->state == SCOLS_GSTATE_NONE &&
@@ -246,8 +249,10 @@ static struct libscols_group **grpset_locate_freespace(struct libscols_table *tb
if (!tb->grpset_size)
prepend = 0;
+ /*
DBG(TAB, ul_debugobj(tb, "orig grpset:"));
grpset_debug(tb, NULL);
+ */
if (prepend) {
for (i = tb->grpset_size - 1; ; i--) {
@@ -299,8 +304,10 @@ static struct libscols_group **grpset_locate_freespace(struct libscols_table *tb
tb->grpset_size += wanted;
done:
+ /*
DBG(TAB, ul_debugobj(tb, "new grpset:"));
grpset_debug(tb, NULL);
+ */
return first;
}
@@ -362,7 +369,7 @@ static int grpset_update(struct libscols_table *tb, struct libscols_line *ln, st
}
grpset_apply_group_state(xx, state, gr);
- ON_DBG(LINE, grpset_debug(tb, ln));
+ /*ON_DBG(LINE, grpset_debug(tb, ln));*/
return 0;
}
diff --git a/libsmartcols/src/print.c b/libsmartcols/src/print.c
index 5f1fc77e2..2a43e2243 100644
--- a/libsmartcols/src/print.c
+++ b/libsmartcols/src/print.c
@@ -830,7 +830,7 @@ static int print_tree_line(struct libscols_table *tb,
{
int rc, children = 0, gr_children = 0;
- DBG(LINE, ul_debugobj(ln, "printing line"));
+ DBG(LINE, ul_debugobj(ln, "---printing tree line->"));
/* print the line */
fput_line_open(tb);
@@ -848,6 +848,8 @@ static int print_tree_line(struct libscols_table *tb,
if (children) {
struct list_head *p;
+ DBG(LINE, ul_debugobj(ln, " printing children"));
+
list_for_each(p, &ln->ln_branch) {
struct libscols_line *chld =
list_entry(p, struct libscols_line, ln_children);
@@ -863,6 +865,8 @@ static int print_tree_line(struct libscols_table *tb,
if (gr_children) {
struct list_head *p;
+ DBG(LINE, ul_debugobj(ln, " printing group children"));
+
list_for_each(p, &ln->group->gr_children) {
struct libscols_line *chld =
list_entry(p, struct libscols_line, ln_children);
@@ -880,6 +884,7 @@ static int print_tree_line(struct libscols_table *tb,
if ((!children && !gr_children) || scols_table_is_json(tb))
fput_line_close(tb, last, last_in_table);
done:
+ DBG(LINE, ul_debugobj(ln, "<- print tree line [rc=%d]", rc));
return rc;
}