diff options
| author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2020-02-12 12:29:59 +0000 |
|---|---|---|
| committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2020-02-12 12:29:59 +0000 |
| commit | 4a3a6d5942d9e03f8754c292b16babb3c92fd36d (patch) | |
| tree | bae74c9d61626cfe808f62791f7fd739191eaa0d /usr/src/cmd | |
| parent | 75fc8ff7f6ab07ed2476a074a7bbaba7ef1f06ee (diff) | |
| parent | fe2dc8bddec347e173d402f53feeb492640a9f98 (diff) | |
| download | illumos-joyent-4a3a6d5942d9e03f8754c292b16babb3c92fd36d.tar.gz | |
[illumos-gate merge]
commit fe2dc8bddec347e173d402f53feeb492640a9f98
12259 CTF shouldn't assume enum size
commit d5d2dbe51affdd94ab32688a7e92dd23ef5b3ba9
12280 typo in dup3(3C) synopsis
commit d5cb55e4df73e14ab5a6a4266b32230c8e73e54e
12294 rfs3_readdir()/rfs3_readdirplus(): Duplicate vattr_to_post_op_attr() call
Diffstat (limited to 'usr/src/cmd')
| -rw-r--r-- | usr/src/cmd/ctfdump/ctfdump.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/usr/src/cmd/ctfdump/ctfdump.c b/usr/src/cmd/ctfdump/ctfdump.c index b77ef56a24..a2e668d266 100644 --- a/usr/src/cmd/ctfdump/ctfdump.c +++ b/usr/src/cmd/ctfdump/ctfdump.c @@ -10,7 +10,7 @@ */ /* - * Copyright 2019, Joyent, Inc. + * Copyright 2020 Joyent, Inc. */ /* @@ -613,7 +613,16 @@ ctfdump_types_cb(ctf_id_t id, boolean_t root, void *arg) } break; case CTF_K_ENUM: - ctfdump_printf(CTFDUMP_TYPES, "%s\n", name); + size = ctf_type_size(g_fp, id); + + /* Only the oddest enums are worth reporting on size. */ + if (size != CTF_ERR && size != sizeof (int)) { + ctfdump_printf(CTFDUMP_TYPES, "%s (%zd bytes)\n", + name, size); + } else { + ctfdump_printf(CTFDUMP_TYPES, "%s\n", name); + } + count = 0; if (ctf_enum_iter(g_fp, id, ctfdump_enum_cb, &count) != 0) ctfdump_fatal("failed to iterate enumerators of %s: " @@ -805,7 +814,14 @@ ctfsrc_type(ctf_id_t id, const char *name) "%s\n", name, ctf_errmsg(ctf_errno(g_fp))); } - printf("};\n\n"); + size = ctf_type_size(g_fp, id); + + /* Only the oddest enums are worth reporting on size. */ + if (size != CTF_ERR && size != sizeof (int)) { + printf("} /* 0x%x bytes */;\n\n", size); + } else { + printf("};\n\n"); + } break; case CTF_K_TYPEDEF: /* |
