[PATCH 05/12] quota: Add missing prefixes to struct field names

Eugene Syromyatnikov evgsyr at gmail.com
Wed Sep 21 03:11:28 UTC 2016


* quota.c (decode_cmd_data): Print field names in accordance with their
  definition.
---
 quota.c |  191 ++++++++++++++++++++++++++++++++-------------------------------
 1 file changed, 98 insertions(+), 93 deletions(-)

diff --git a/quota.c b/quota.c
index 68f8a79..1e1597f 100644
--- a/quota.c
+++ b/quota.c
@@ -237,16 +237,16 @@ decode_cmd_data(struct tcb *tcp, uint32_t id, uint32_t cmd, unsigned long data)
 
 		if (umove_or_printaddr(tcp, data, &dq))
 			break;
-		tprintf("{bhardlimit=%" PRIu64 ", ", dq.dqb_bhardlimit);
-		tprintf("bsoftlimit=%" PRIu64 ", ", dq.dqb_bsoftlimit);
-		tprintf("curspace=%" PRIu64 ", ", dq.dqb_curspace);
-		tprintf("ihardlimit=%" PRIu64 ", ", dq.dqb_ihardlimit);
-		tprintf("isoftlimit=%" PRIu64 ", ", dq.dqb_isoftlimit);
-		tprintf("curinodes=%" PRIu64 ", ", dq.dqb_curinodes);
+		tprintf("{dqb_bhardlimit=%" PRIu64 ", ", dq.dqb_bhardlimit);
+		tprintf("dqb_bsoftlimit=%" PRIu64 ", ", dq.dqb_bsoftlimit);
+		tprintf("dqb_curspace=%" PRIu64 ", ", dq.dqb_curspace);
+		tprintf("dqb_ihardlimit=%" PRIu64 ", ", dq.dqb_ihardlimit);
+		tprintf("dqb_isoftlimit=%" PRIu64 ", ", dq.dqb_isoftlimit);
+		tprintf("dqb_curinodes=%" PRIu64 ", ", dq.dqb_curinodes);
 		if (!abbrev(tcp)) {
-			tprintf("btime=%" PRIu64 ", ", dq.dqb_btime);
-			tprintf("itime=%" PRIu64 ", ", dq.dqb_itime);
-			tprints("valid=");
+			tprintf("dqb_btime=%" PRIu64 ", ", dq.dqb_btime);
+			tprintf("dqb_itime=%" PRIu64 ", ", dq.dqb_itime);
+			tprints("dqb_valid=");
 			printflags(if_dqblk_valid,
 				   dq.dqb_valid, "QIF_???");
 			tprints("}");
@@ -267,19 +267,19 @@ decode_cmd_data(struct tcb *tcp, uint32_t id, uint32_t cmd, unsigned long data)
 
 		if (umove_or_printaddr(tcp, data, &dq))
 			break;
-		tprintf("{bhardlimit=%" PRIu64 ", ", dq.dqb_bhardlimit);
-		tprintf("bsoftlimit=%" PRIu64 ", ", dq.dqb_bsoftlimit);
-		tprintf("curspace=%" PRIu64 ", ", dq.dqb_curspace);
-		tprintf("ihardlimit=%" PRIu64 ", ", dq.dqb_ihardlimit);
-		tprintf("isoftlimit=%" PRIu64 ", ", dq.dqb_isoftlimit);
-		tprintf("curinodes=%" PRIu64 ", ", dq.dqb_curinodes);
+		tprintf("{dqb_bhardlimit=%" PRIu64 ", ", dq.dqb_bhardlimit);
+		tprintf("dqb_bsoftlimit=%" PRIu64 ", ", dq.dqb_bsoftlimit);
+		tprintf("dqb_curspace=%" PRIu64 ", ", dq.dqb_curspace);
+		tprintf("dqb_ihardlimit=%" PRIu64 ", ", dq.dqb_ihardlimit);
+		tprintf("dqb_isoftlimit=%" PRIu64 ", ", dq.dqb_isoftlimit);
+		tprintf("dqb_curinodes=%" PRIu64 ", ", dq.dqb_curinodes);
 		if (!abbrev(tcp)) {
-			tprintf("btime=%" PRIu64 ", ", dq.dqb_btime);
-			tprintf("itime=%" PRIu64 ", ", dq.dqb_itime);
-			tprints("valid=");
+			tprintf("dqb_btime=%" PRIu64 ", ", dq.dqb_btime);
+			tprintf("dqb_itime=%" PRIu64 ", ", dq.dqb_itime);
+			tprints("dqb_valid=");
 			printflags(if_dqblk_valid,
 				   dq.dqb_valid, "QIF_???");
-			tprintf(", id=%u}", dq.dqb_id);
+			tprintf(", dqb_id=%u}", dq.dqb_id);
 		} else
 			tprintf("id=%u, ...}", dq.dqb_id);
 		break;
@@ -304,14 +304,14 @@ decode_cmd_data(struct tcb *tcp, uint32_t id, uint32_t cmd, unsigned long data)
 
 		if (umove_or_printaddr(tcp, data, &dq))
 			break;
-		tprintf("{bhardlimit=%u, ", dq.dqb_bhardlimit);
-		tprintf("bsoftlimit=%u, ", dq.dqb_bsoftlimit);
-		tprintf("curblocks=%u, ", dq.dqb_curblocks);
-		tprintf("ihardlimit=%u, ", dq.dqb_ihardlimit);
-		tprintf("isoftlimit=%u, ", dq.dqb_isoftlimit);
-		tprintf("curinodes=%u, ", dq.dqb_curinodes);
-		tprintf("btime=%lu, ", (long) dq.dqb_btime);
-		tprintf("itime=%lu}", (long) dq.dqb_itime);
+		tprintf("{dqb_bhardlimit=%u, ", dq.dqb_bhardlimit);
+		tprintf("dqb_bsoftlimit=%u, ", dq.dqb_bsoftlimit);
+		tprintf("dqb_curblocks=%u, ", dq.dqb_curblocks);
+		tprintf("dqb_ihardlimit=%u, ", dq.dqb_ihardlimit);
+		tprintf("dqb_isoftlimit=%u, ", dq.dqb_isoftlimit);
+		tprintf("dqb_curinodes=%u, ", dq.dqb_curinodes);
+		tprintf("dqb_btime=%lu, ", (long) dq.dqb_btime);
+		tprintf("dqb_itime=%lu}", (long) dq.dqb_itime);
 		break;
 	}
 	case Q_V2_GETQUOTA:
@@ -334,14 +334,14 @@ decode_cmd_data(struct tcb *tcp, uint32_t id, uint32_t cmd, unsigned long data)
 
 		if (umove_or_printaddr(tcp, data, &dq))
 			break;
-		tprintf("{ihardlimit=%u, ", dq.dqb_ihardlimit);
-		tprintf("isoftlimit=%u, ", dq.dqb_isoftlimit);
-		tprintf("curinodes=%u, ", dq.dqb_curinodes);
-		tprintf("bhardlimit=%u, ", dq.dqb_bhardlimit);
-		tprintf("bsoftlimit=%u, ", dq.dqb_bsoftlimit);
-		tprintf("curspace=%" PRIu64 ", ", dq.dqb_curspace);
-		tprintf("btime=%lu, ", (long) dq.dqb_btime);
-		tprintf("itime=%lu}", (long) dq.dqb_itime);
+		tprintf("{dqb_ihardlimit=%u, ", dq.dqb_ihardlimit);
+		tprintf("dqb_isoftlimit=%u, ", dq.dqb_isoftlimit);
+		tprintf("dqb_curinodes=%u, ", dq.dqb_curinodes);
+		tprintf("dqb_bhardlimit=%u, ", dq.dqb_bhardlimit);
+		tprintf("dqb_bsoftlimit=%u, ", dq.dqb_bsoftlimit);
+		tprintf("dqb_curspace=%" PRIu64 ", ", dq.dqb_curspace);
+		tprintf("dqb_btime=%lu, ", (long) dq.dqb_btime);
+		tprintf("dqb_itime=%lu}", (long) dq.dqb_itime);
 		break;
 	}
 	case Q_XGETQUOTA:
@@ -365,26 +365,26 @@ decode_cmd_data(struct tcb *tcp, uint32_t id, uint32_t cmd, unsigned long data)
 
 		if (umove_or_printaddr(tcp, data, &dq))
 			break;
-		tprintf("{version=%d, ", dq.d_version);
-		tprints("flags=");
+		tprintf("{d_version=%d, ", dq.d_version);
+		tprints("d_flags=");
 		printflags(xfs_dqblk_flags,
 			   (uint8_t) dq.d_flags, "XFS_???_QUOTA");
-		tprintf(", fieldmask=%#x, ", dq.d_fieldmask);
-		tprintf("id=%u, ", dq.d_id);
-		tprintf("blk_hardlimit=%" PRIu64 ", ", dq.d_blk_hardlimit);
-		tprintf("blk_softlimit=%" PRIu64 ", ", dq.d_blk_softlimit);
-		tprintf("ino_hardlimit=%" PRIu64 ", ", dq.d_ino_hardlimit);
-		tprintf("ino_softlimit=%" PRIu64 ", ", dq.d_ino_softlimit);
-		tprintf("bcount=%" PRIu64 ", ", dq.d_bcount);
-		tprintf("icount=%" PRIu64 ", ", dq.d_icount);
+		tprintf(", d_fieldmask=%#x, ", dq.d_fieldmask);
+		tprintf("d_id=%u, ", dq.d_id);
+		tprintf("d_blk_hardlimit=%" PRIu64 ", ", dq.d_blk_hardlimit);
+		tprintf("d_blk_softlimit=%" PRIu64 ", ", dq.d_blk_softlimit);
+		tprintf("d_ino_hardlimit=%" PRIu64 ", ", dq.d_ino_hardlimit);
+		tprintf("d_ino_softlimit=%" PRIu64 ", ", dq.d_ino_softlimit);
+		tprintf("d_bcount=%" PRIu64 ", ", dq.d_bcount);
+		tprintf("d_icount=%" PRIu64 ", ", dq.d_icount);
 		if (!abbrev(tcp)) {
-			tprintf("itimer=%d, ", dq.d_itimer);
-			tprintf("btimer=%d, ", dq.d_btimer);
-			tprintf("iwarns=%u, ", dq.d_iwarns);
-			tprintf("bwarns=%u, ", dq.d_bwarns);
-			tprintf("rtbcount=%" PRIu64 ", ", dq.d_rtbcount);
-			tprintf("rtbtimer=%d, ", dq.d_rtbtimer);
-			tprintf("rtbwarns=%u}", dq.d_rtbwarns);
+			tprintf("d_itimer=%d, ", dq.d_itimer);
+			tprintf("d_btimer=%d, ", dq.d_btimer);
+			tprintf("d_iwarns=%u, ", dq.d_iwarns);
+			tprintf("d_bwarns=%u, ", dq.d_bwarns);
+			tprintf("d_rtbcount=%" PRIu64 ", ", dq.d_rtbcount);
+			tprintf("d_rtbtimer=%d, ", dq.d_rtbtimer);
+			tprintf("d_rtbwarns=%u}", dq.d_rtbwarns);
 		} else
 			tprints("...}");
 		break;
@@ -423,11 +423,11 @@ decode_cmd_data(struct tcb *tcp, uint32_t id, uint32_t cmd, unsigned long data)
 
 		if (umove_or_printaddr(tcp, data, &dq))
 			break;
-		tprintf("{bgrace=%" PRIu64 ", ", dq.dqi_bgrace);
-		tprintf("igrace=%" PRIu64 ", ", dq.dqi_igrace);
-		tprints("flags=");
+		tprintf("{dqi_bgrace=%" PRIu64 ", ", dq.dqi_bgrace);
+		tprintf("dqi_igrace=%" PRIu64 ", ", dq.dqi_igrace);
+		tprints("dqi_flags=");
 		printflags(if_dqinfo_flags, dq.dqi_flags, "DQF_???");
-		tprints(", valid=");
+		tprints(", dqi_valid=");
 		printflags(if_dqinfo_valid, dq.dqi_valid, "IIF_???");
 		tprints("}");
 		break;
@@ -449,13 +449,13 @@ decode_cmd_data(struct tcb *tcp, uint32_t id, uint32_t cmd, unsigned long data)
 
 		if (umove_or_printaddr(tcp, data, &dq))
 			break;
-		tprintf("{bgrace=%u, ", dq.dqi_bgrace);
-		tprintf("igrace=%u, ", dq.dqi_igrace);
-		tprints("flags=");
+		tprintf("{dqi_bgrace=%u, ", dq.dqi_bgrace);
+		tprintf("dqi_igrace=%u, ", dq.dqi_igrace);
+		tprints("dqi_flags=");
 		printflags(if_dqinfo_flags, dq.dqi_flags, "DQF_???");
-		tprintf(", blocks=%u, ", dq.dqi_blocks);
-		tprintf("free_blk=%u, ", dq.dqi_free_blk);
-		tprintf("free_entry=%u}", dq.dqi_free_entry);
+		tprintf(", dqi_blocks=%u, ", dq.dqi_blocks);
+		tprintf("dqi_free_blk=%u, ", dq.dqi_free_blk);
+		tprintf("dqi_free_entry=%u}", dq.dqi_free_entry);
 		break;
 	}
 	case Q_V1_GETSTATS:
@@ -511,26 +511,28 @@ decode_cmd_data(struct tcb *tcp, uint32_t id, uint32_t cmd, unsigned long data)
 
 		if (umove_or_printaddr(tcp, data, &dq))
 			break;
-		tprintf("{version=%d, ", dq.qs_version);
+		tprintf("{qs_version=%d, ", dq.qs_version);
 		if (abbrev(tcp)) {
 			tprints("...}");
 			break;
 		}
-		tprints("flags=");
+		tprints("qs_flags=");
 		printflags(xfs_quota_flags,
 			   dq.qs_flags, "XFS_QUOTA_???");
-		tprintf(", incoredqs=%u, ", dq.qs_incoredqs);
-		tprintf("u_ino=%" PRIu64 ", ", dq.qs_uquota.qfs_ino);
-		tprintf("u_nblks=%" PRIu64 ", ", dq.qs_uquota.qfs_nblks);
-		tprintf("u_nextents=%u, ", dq.qs_uquota.qfs_nextents);
-		tprintf("g_ino=%" PRIu64 ", ", dq.qs_gquota.qfs_ino);
-		tprintf("g_nblks=%" PRIu64 ", ", dq.qs_gquota.qfs_nblks);
-		tprintf("g_nextents=%u, ", dq.qs_gquota.qfs_nextents);
-		tprintf("btimelimit=%d, ", dq.qs_btimelimit);
-		tprintf("itimelimit=%d, ", dq.qs_itimelimit);
-		tprintf("rtbtimelimit=%d, ", dq.qs_rtbtimelimit);
-		tprintf("bwarnlimit=%u, ", dq.qs_bwarnlimit);
-		tprintf("iwarnlimit=%u}", dq.qs_iwarnlimit);
+		tprintf(", qs_incoredqs=%u, ", dq.qs_incoredqs);
+		tprints("qs_uquota={");
+		tprintf("qfs_ino=%" PRIu64 ", ", dq.qs_uquota.qfs_ino);
+		tprintf("qfs_nblks=%" PRIu64 ", ", dq.qs_uquota.qfs_nblks);
+		tprintf("qfs_nextents=%u}, ", dq.qs_uquota.qfs_nextents);
+		tprints("qs_gquota={");
+		tprintf("qfs_ino=%" PRIu64 ", ", dq.qs_gquota.qfs_ino);
+		tprintf("qfs_nblks=%" PRIu64 ", ", dq.qs_gquota.qfs_nblks);
+		tprintf("qfs_nextents=%u}, ", dq.qs_gquota.qfs_nextents);
+		tprintf("qs_btimelimit=%d, ", dq.qs_btimelimit);
+		tprintf("qs_itimelimit=%d, ", dq.qs_itimelimit);
+		tprintf("qs_rtbtimelimit=%d, ", dq.qs_rtbtimelimit);
+		tprintf("qs_bwarnlimit=%u, ", dq.qs_bwarnlimit);
+		tprintf("qs_iwarnlimit=%u}", dq.qs_iwarnlimit);
 		break;
 	}
 	case Q_XGETQSTATV:
@@ -545,29 +547,32 @@ decode_cmd_data(struct tcb *tcp, uint32_t id, uint32_t cmd, unsigned long data)
 
 		if (umove_or_printaddr(tcp, data, &dq))
 			break;
-		tprintf("{version=%d, ", dq.qs_version);
+		tprintf("{qs_version=%d, ", dq.qs_version);
 		if (abbrev(tcp)) {
 			tprints("...}");
 			break;
 		}
-		tprints("flags=");
+		tprints("qs_flags=");
 		printflags(xfs_quota_flags,
 			   dq.qs_flags, "XFS_QUOTA_???");
-		tprintf(", incoredqs=%u, ", dq.qs_incoredqs);
-		tprintf("u_ino=%" PRIu64 ", ", dq.qs_uquota.qfs_ino);
-		tprintf("u_nblks=%" PRIu64 ", ", dq.qs_uquota.qfs_nblks);
-		tprintf("u_nextents=%u, ", dq.qs_uquota.qfs_nextents);
-		tprintf("g_ino=%" PRIu64 ", ", dq.qs_gquota.qfs_ino);
-		tprintf("g_nblks=%" PRIu64 ", ", dq.qs_gquota.qfs_nblks);
-		tprintf("g_nextents=%u, ", dq.qs_gquota.qfs_nextents);
-		tprintf("p_ino=%" PRIu64 ", ", dq.qs_pquota.qfs_ino);
-		tprintf("p_nblks=%" PRIu64 ", ", dq.qs_pquota.qfs_nblks);
-		tprintf("p_nextents=%u, ", dq.qs_pquota.qfs_nextents);
-		tprintf("btimelimit=%d, ", dq.qs_btimelimit);
-		tprintf("itimelimit=%d, ", dq.qs_itimelimit);
-		tprintf("rtbtimelimit=%d, ", dq.qs_rtbtimelimit);
-		tprintf("bwarnlimit=%u, ", dq.qs_bwarnlimit);
-		tprintf("iwarnlimit=%u}", dq.qs_iwarnlimit);
+		tprintf(", qs_incoredqs=%u, ", dq.qs_incoredqs);
+		tprints("qs_uquota={");
+		tprintf("qfs_ino=%" PRIu64 ", ", dq.qs_uquota.qfs_ino);
+		tprintf("qfs_nblks=%" PRIu64 ", ", dq.qs_uquota.qfs_nblks);
+		tprintf("qfs_nextents=%u}, ", dq.qs_uquota.qfs_nextents);
+		tprints("qs_gquota={");
+		tprintf("qfs_ino=%" PRIu64 ", ", dq.qs_gquota.qfs_ino);
+		tprintf("qfs_nblks=%" PRIu64 ", ", dq.qs_gquota.qfs_nblks);
+		tprintf("qfs_nextents=%u}, ", dq.qs_gquota.qfs_nextents);
+		tprints("qs_pquota={");
+		tprintf("qfs_ino=%" PRIu64 ", ", dq.qs_pquota.qfs_ino);
+		tprintf("qfs_nblks=%" PRIu64 ", ", dq.qs_pquota.qfs_nblks);
+		tprintf("qfs_nextents=%u}, ", dq.qs_pquota.qfs_nextents);
+		tprintf("qs_btimelimit=%d, ", dq.qs_btimelimit);
+		tprintf("qs_itimelimit=%d, ", dq.qs_itimelimit);
+		tprintf("qs_rtbtimelimit=%d, ", dq.qs_rtbtimelimit);
+		tprintf("qs_bwarnlimit=%u, ", dq.qs_bwarnlimit);
+		tprintf("qs_iwarnlimit=%u}", dq.qs_iwarnlimit);
 		break;
 	}
 	case Q_XQUOTAON:
-- 
1.7.10.4





More information about the Strace-devel mailing list