]> granicus.if.org Git - strace/commitdiff
loop.c: fix printing of structure members' names
authorDmitry V. Levin <ldv@altlinux.org>
Sun, 29 May 2016 22:28:28 +0000 (22:28 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 29 May 2016 22:28:28 +0000 (22:28 +0000)
* loop.c (decode_loop_info, decode_loop_info64): Do not strip "lo_"
prefix from printed names.

loop.c

diff --git a/loop.c b/loop.c
index 178033d3fe651b553ddb44eb53169ed355668221..33773368d7c6e5de158c63a3fc29138b8e5f4455 100644 (file)
--- a/loop.c
+++ b/loop.c
@@ -41,39 +41,39 @@ decode_loop_info(struct tcb *tcp, const long addr)
        if (umove_or_printaddr(tcp, addr, &info))
                return;
 
-       tprintf("{number=%d", info.lo_number);
+       tprintf("{lo_number=%d", info.lo_number);
 
        if (!abbrev(tcp)) {
-               tprintf(", device=%#lx, inode=%lu, rdevice=%#lx",
+               tprintf(", lo_device=%#lx, lo_inode=%lu, lo_rdevice=%#lx",
                        (unsigned long) info.lo_device,
                        info.lo_inode,
                        (unsigned long) info.lo_rdevice);
        }
 
-       tprintf(", offset=%#x", info.lo_offset);
+       tprintf(", lo_offset=%#x", info.lo_offset);
 
        if (!abbrev(tcp) || info.lo_encrypt_type != LO_CRYPT_NONE) {
-               tprints(", encrypt_type=");
+               tprints(", lo_encrypt_type=");
                printxval(loop_crypt_type_options, info.lo_encrypt_type,
                        "LO_CRYPT_???");
-               tprintf(", encrypt_key_size=%d", info.lo_encrypt_key_size);
+               tprintf(", lo_encrypt_key_size=%d", info.lo_encrypt_key_size);
        }
 
-       tprints(", flags=");
+       tprints(", lo_flags=");
        printflags(loop_flags_options, info.lo_flags, "LO_FLAGS_???");
 
-       tprints(", name=");
+       tprints(", lo_name=");
        print_quoted_string(info.lo_name, LO_NAME_SIZE,
                            QUOTE_0_TERMINATED);
 
        if (!abbrev(tcp) || info.lo_encrypt_type != LO_CRYPT_NONE) {
-               tprints(", encrypt_key=");
+               tprints(", lo_encrypt_key=");
                print_quoted_string((void *) info.lo_encrypt_key,
                                    LO_KEY_SIZE, 0);
        }
 
        if (!abbrev(tcp))
-               tprintf(", init={%#lx, %#lx}"
+               tprintf(", lo_init={%#lx, %#lx}"
                        ", reserved={%#x, %#x, %#x, %#x}}",
                        info.lo_init[0], info.lo_init[1],
                        info.reserved[0], info.reserved[1],
@@ -92,9 +92,9 @@ decode_loop_info64(struct tcb *tcp, const long addr)
                return;
 
        if (!abbrev(tcp)) {
-               tprintf("{device=%" PRIu64 ", inode=%" PRIu64 ", "
-                       "rdevice=%" PRIu64 ", offset=%#" PRIx64 ", "
-                       "sizelimit=%" PRIu64 ", number=%" PRIu32,
+               tprintf("{lo_device=%" PRIu64 ", lo_inode=%" PRIu64
+                       ", lo_rdevice=%" PRIu64 ", lo_offset=%#" PRIx64
+                       ", lo_sizelimit=%" PRIu64 ", lo_number=%" PRIu32,
                        (uint64_t) info64.lo_device,
                        (uint64_t) info64.lo_inode,
                        (uint64_t) info64.lo_rdevice,
@@ -102,37 +102,37 @@ decode_loop_info64(struct tcb *tcp, const long addr)
                        (uint64_t) info64.lo_sizelimit,
                        (uint32_t) info64.lo_number);
        } else {
-               tprintf("{offset=%#" PRIx64 ", number=%" PRIu32,
+               tprintf("{lo_offset=%#" PRIx64 ", lo_number=%" PRIu32,
                        (uint64_t) info64.lo_offset,
                        (uint32_t) info64.lo_number);
        }
 
        if (!abbrev(tcp) || info64.lo_encrypt_type != LO_CRYPT_NONE) {
-               tprints(", encrypt_type=");
+               tprints(", lo_encrypt_type=");
                printxval(loop_crypt_type_options, info64.lo_encrypt_type,
                        "LO_CRYPT_???");
-               tprintf(", encrypt_key_size=%" PRIu32,
+               tprintf(", lo_encrypt_key_size=%" PRIu32,
                        info64.lo_encrypt_key_size);
        }
 
-       tprints(", flags=");
+       tprints(", lo_flags=");
        printflags(loop_flags_options, info64.lo_flags, "LO_FLAGS_???");
 
-       tprints(", file_name=");
+       tprints(", lo_file_name=");
        print_quoted_string((void *) info64.lo_file_name,
                            LO_NAME_SIZE, QUOTE_0_TERMINATED);
 
        if (!abbrev(tcp) || info64.lo_encrypt_type != LO_CRYPT_NONE) {
-               tprints(", crypt_name=");
+               tprints(", lo_crypt_name=");
                print_quoted_string((void *) info64.lo_crypt_name,
                                    LO_NAME_SIZE, QUOTE_0_TERMINATED);
-               tprints(", encrypt_key=");
+               tprints(", lo_encrypt_key=");
                print_quoted_string((void *) info64.lo_encrypt_key,
                                    LO_KEY_SIZE, 0);
        }
 
        if (!abbrev(tcp))
-               tprintf(", init={%#" PRIx64 ", %#" PRIx64 "}}",
+               tprintf(", lo_init={%#" PRIx64 ", %#" PRIx64 "}}",
                        (uint64_t) info64.lo_init[0],
                        (uint64_t) info64.lo_init[1]);
        else