diff options
author | Jason King <jason.brian.king@gmail.com> | 2017-05-05 22:58:26 +0000 |
---|---|---|
committer | John Levon <john.levon@joyent.com> | 2018-09-26 08:38:04 +0000 |
commit | c113f3b5211bf6ae3ff1ee916a9f9ad0c28b7125 (patch) | |
tree | ed3893fad0f78462adf85cf08feb76669ab9abab /usr/src/cmd/sgs/elfdump/common | |
parent | dee777b5a3880de62b42997fe61524f95dcc16db (diff) | |
download | illumos-joyent-OS-7200.tar.gz |
OS-7200 would like thread name APIOS-7200
OS-7205 bhyve makefile uses wrong linker flags
Diffstat (limited to 'usr/src/cmd/sgs/elfdump/common')
-rw-r--r-- | usr/src/cmd/sgs/elfdump/common/corenote.c | 19 | ||||
-rw-r--r-- | usr/src/cmd/sgs/elfdump/common/elfdump.msg | 3 | ||||
-rw-r--r-- | usr/src/cmd/sgs/elfdump/common/gen_layout_obj.c | 2 | ||||
-rw-r--r-- | usr/src/cmd/sgs/elfdump/common/gen_struct_layout.c | 15 | ||||
-rw-r--r-- | usr/src/cmd/sgs/elfdump/common/struct_layout.h | 13 | ||||
-rw-r--r-- | usr/src/cmd/sgs/elfdump/common/struct_layout_amd64.c | 11 | ||||
-rw-r--r-- | usr/src/cmd/sgs/elfdump/common/struct_layout_i386.c | 11 | ||||
-rw-r--r-- | usr/src/cmd/sgs/elfdump/common/struct_layout_sparc.c | 12 | ||||
-rw-r--r-- | usr/src/cmd/sgs/elfdump/common/struct_layout_sparcv9.c | 11 |
9 files changed, 95 insertions, 2 deletions
diff --git a/usr/src/cmd/sgs/elfdump/common/corenote.c b/usr/src/cmd/sgs/elfdump/common/corenote.c index 0777025523..a5ba4e31b8 100644 --- a/usr/src/cmd/sgs/elfdump/common/corenote.c +++ b/usr/src/cmd/sgs/elfdump/common/corenote.c @@ -1256,6 +1256,20 @@ dump_prstatus(note_state_t *state, const char *title) } +static void +dump_lwpname(note_state_t *state, const char *title) +{ + const sl_prlwpname_layout_t *layout = state->ns_arch->prlwpname; + + indent_enter(state, title, &layout->pr_lwpid); + + PRINT_DEC(MSG_ORIG(MSG_CNOTE_T_PR_LWPID), pr_lwpid); + PRINT_STRBUF(MSG_ORIG(MSG_CNOTE_T_PR_LWPNAME), pr_lwpname); + + indent_exit(state); +} + + /* * Print percent from 16-bit binary fraction [0 .. 1] * Round up .01 to .1 to indicate some small percentage (the 0x7000 below). @@ -1909,6 +1923,11 @@ corenote(Half mach, int do_swap, Word type, state.ns_v2col = 54; dump_secflags(&state, MSG_ORIG(MSG_CNOTE_DESC_PRSECFLAGS_T)); return (CORENOTE_R_OK); + + case NT_LWPNAME: + state.ns_vcol = 20; + dump_lwpname(&state, MSG_ORIG(MSG_CNOTE_DESC_PRLWPNAME_T)); + return (CORENOTE_R_OK); } return (CORENOTE_R_BADTYPE); diff --git a/usr/src/cmd/sgs/elfdump/common/elfdump.msg b/usr/src/cmd/sgs/elfdump/common/elfdump.msg index e7488d5373..253ea4a788 100644 --- a/usr/src/cmd/sgs/elfdump/common/elfdump.msg +++ b/usr/src/cmd/sgs/elfdump/common/elfdump.msg @@ -22,6 +22,7 @@ # # Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. # Copyright 2012 DEY Storage Systems, Inc. All rights reserved. +# Copyright 2018 Joyent, Inc. # @ _START_ @@ -469,6 +470,7 @@ @ MSG_CNOTE_DESC_STRUCT_UTSNAME "desc: (struct utsname)" @ MSG_CNOTE_DESC_PRFDINFO_T "desc: (prfdinfo_t)" @ MSG_CNOTE_DESC_PRSECFLAGS_T "desc: (prsecflags_t)" +@ MSG_CNOTE_DESC_PRLWPNAME_T "desc: (prlwpname_t)" @ MSG_CNOTE_FMT_LINE "%*s%-*s%s" @ MSG_CNOTE_FMT_LINE_2UP "%*s%-*s%-*s%-*s%s" @@ -535,6 +537,7 @@ @ MSG_CNOTE_T_PR_LWP "pr_lwp:" @ MSG_CNOTE_T_PR_LWPHOLD "pr_lwphold:" @ MSG_CNOTE_T_PR_LWPID "pr_lwpid:" +@ MSG_CNOTE_T_PR_LWPNAME "pr_lwpname:" @ MSG_CNOTE_T_PR_LWPPEND "pr_lwppend:" @ MSG_CNOTE_T_PR_NAME "pr_name:" @ MSG_CNOTE_T_PR_NGROUPS "pr_ngroups:" diff --git a/usr/src/cmd/sgs/elfdump/common/gen_layout_obj.c b/usr/src/cmd/sgs/elfdump/common/gen_layout_obj.c index f7af1c1543..674972dc22 100644 --- a/usr/src/cmd/sgs/elfdump/common/gen_layout_obj.c +++ b/usr/src/cmd/sgs/elfdump/common/gen_layout_obj.c @@ -11,6 +11,7 @@ /* * Copyright 2015 Nexenta Systems, Inc. All rights reserved. + * Copyright 2018 Joyent, Inc. */ /* @@ -58,3 +59,4 @@ timestruc_t ts; struct utsname uts; prfdinfo_t ptfd; prsecflags_t psf; +prlwpname_t psn; diff --git a/usr/src/cmd/sgs/elfdump/common/gen_struct_layout.c b/usr/src/cmd/sgs/elfdump/common/gen_struct_layout.c index d90363c5de..10d6a00af7 100644 --- a/usr/src/cmd/sgs/elfdump/common/gen_struct_layout.c +++ b/usr/src/cmd/sgs/elfdump/common/gen_struct_layout.c @@ -24,11 +24,13 @@ * Use is subject to license terms. * * Copyright 2015 Nexenta Systems, Inc. All rights reserved. + * + * Copyright 2018 Joyent, Inc. */ /* * This program is used to generate the contents of the - * struct_layout_XXX.c files that contain per-archtecture + * struct_layout_XXX.c files that contain per-architecture * structure layout information. * * Although not part of elfdump, it is built by the makefile @@ -599,6 +601,15 @@ gen_prsecflags(void) END; } +static void +gen_prlwpname(void) +{ + START(prlwpname, prlwpname_t); + SCALAR_FIELD(prlwpname_t, pr_lwpid, 0); + ARRAY_FIELD(prlwpname_t, pr_lwpname, 0); + END; +} + /*ARGSUSED*/ int main(int argc, char *argv[]) @@ -640,6 +651,7 @@ main(int argc, char *argv[]) gen_utsname(); gen_prfdinfo(); gen_prsecflags(); + gen_prlwpname(); /* * Generate the full arch_layout description @@ -668,6 +680,7 @@ main(int argc, char *argv[]) (void) printf(fmt, "utsname"); (void) printf(fmt, "prfdinfo"); (void) printf(fmt, "prsecflags"); + (void) printf(fmt, "prlwpname"); (void) printf("};\n"); /* diff --git a/usr/src/cmd/sgs/elfdump/common/struct_layout.h b/usr/src/cmd/sgs/elfdump/common/struct_layout.h index b0592d6909..e452de47ca 100644 --- a/usr/src/cmd/sgs/elfdump/common/struct_layout.h +++ b/usr/src/cmd/sgs/elfdump/common/struct_layout.h @@ -28,6 +28,10 @@ * Copyright 2012 DEY Storage Systems, Inc. All rights reserved. */ +/* + * Copyright 2018 Joyent, Inc. + */ + #ifndef _STRUCT_LAYOUT_H #define _STRUCT_LAYOUT_H @@ -98,7 +102,7 @@ typedef struct { */ typedef union { char sld_i8; - uchar_t sld_ui8; + uchar_t sld_ui8; short sld_i16; ushort_t sld_ui16; int32_t sld_i32; @@ -535,6 +539,12 @@ typedef struct { sl_field_t pr_upper; } sl_prsecflags_layout_t; +typedef struct { + sl_field_t sizeof_struct; + sl_field_t pr_lwpid; + sl_field_t pr_lwpname; +} sl_prlwpname_layout_t; + /* * This type collects all of the layout definitions for * a given architecture. @@ -561,6 +571,7 @@ typedef struct { const sl_utsname_layout_t *utsname; /* struct utsname */ const sl_prfdinfo_layout_t *prfdinfo; /* prdinfo_t */ const sl_prsecflags_layout_t *prsecflags; /* prsecflags_t */ + const sl_prlwpname_layout_t *prlwpname; /* prlwpname_t */ } sl_arch_layout_t; diff --git a/usr/src/cmd/sgs/elfdump/common/struct_layout_amd64.c b/usr/src/cmd/sgs/elfdump/common/struct_layout_amd64.c index 2b9469a022..11488009ea 100644 --- a/usr/src/cmd/sgs/elfdump/common/struct_layout_amd64.c +++ b/usr/src/cmd/sgs/elfdump/common/struct_layout_amd64.c @@ -26,6 +26,9 @@ /* * Copyright 2012 DEY Storage Systems, Inc. All rights reserved. */ +/* + * Copyright 2018 Joyent, Inc. + */ #include <struct_layout.h> @@ -387,6 +390,13 @@ static const sl_prsecflags_layout_t prsecflags_layout = { }; +static const sl_prlwpname_layout_t prlwpname_layout = { + { 0, 40, 0, 0 }, /* sizeof (prlwpname_t) */ + { 0, 8, 0, 0 }, /* pr_lwpid */ + { 8, 1, 32, 0 }, /* pr_lwpname[] */ +}; + + static const sl_arch_layout_t layout_amd64 = { @@ -411,6 +421,7 @@ static const sl_arch_layout_t layout_amd64 = { &utsname_layout, &prfdinfo_layout, &prsecflags_layout, + &prlwpname_layout, }; diff --git a/usr/src/cmd/sgs/elfdump/common/struct_layout_i386.c b/usr/src/cmd/sgs/elfdump/common/struct_layout_i386.c index 6a516bc225..08d5e5f3ce 100644 --- a/usr/src/cmd/sgs/elfdump/common/struct_layout_i386.c +++ b/usr/src/cmd/sgs/elfdump/common/struct_layout_i386.c @@ -26,6 +26,9 @@ /* * Copyright 2012 DEY Storage Systems, Inc. All rights reserved. */ +/* + * Copyright 2018 Joyent, Inc. + */ #include <struct_layout.h> @@ -387,6 +390,13 @@ static const sl_prsecflags_layout_t prsecflags_layout = { }; +static const sl_prlwpname_layout_t prlwpname_layout = { + { 0, 40, 0, 0 }, /* sizeof (prlwpname_t) */ + { 0, 8, 0, 0 }, /* pr_lwpid */ + { 8, 1, 32, 0 }, /* pr_lwpname[] */ +}; + + static const sl_arch_layout_t layout_i386 = { @@ -411,6 +421,7 @@ static const sl_arch_layout_t layout_i386 = { &utsname_layout, &prfdinfo_layout, &prsecflags_layout, + &prlwpname_layout, }; diff --git a/usr/src/cmd/sgs/elfdump/common/struct_layout_sparc.c b/usr/src/cmd/sgs/elfdump/common/struct_layout_sparc.c index 94760c3d82..d0306d60fe 100644 --- a/usr/src/cmd/sgs/elfdump/common/struct_layout_sparc.c +++ b/usr/src/cmd/sgs/elfdump/common/struct_layout_sparc.c @@ -26,6 +26,10 @@ /* * Copyright 2012 DEY Storage Systems, Inc. All rights reserved. */ +/* + * Copyright 2018 Joyent, Inc. + */ + #include <struct_layout.h> @@ -386,6 +390,13 @@ static const sl_prsecflags_layout_t prsecflags_layout = { }; +static const sl_prlwpname_layout_t prlwpname_layout = { + { 0, 40, 0, 0 }, /* sizeof (prlwpname_t) */ + { 0, 8, 0, 0 }, /* pr_lwpid */ + { 8, 1, 32, 0 }, /* pr_lwpname[] */ +}; + + static const sl_arch_layout_t layout_sparc = { @@ -410,6 +421,7 @@ static const sl_arch_layout_t layout_sparc = { &utsname_layout, &prfdinfo_layout, &prsecflags_layout, + &prlwpname_layout, }; diff --git a/usr/src/cmd/sgs/elfdump/common/struct_layout_sparcv9.c b/usr/src/cmd/sgs/elfdump/common/struct_layout_sparcv9.c index a194d8136a..a90db686ba 100644 --- a/usr/src/cmd/sgs/elfdump/common/struct_layout_sparcv9.c +++ b/usr/src/cmd/sgs/elfdump/common/struct_layout_sparcv9.c @@ -26,6 +26,9 @@ /* * Copyright 2012 DEY Storage Systems, Inc. All rights reserved. */ +/* + * Copyright 2018 Joyent, Inc. + */ #include <struct_layout.h> @@ -387,6 +390,13 @@ static const sl_prsecflags_layout_t prsecflags_layout = { }; +static const sl_prlwpname_layout_t prlwpname_layout = { + { 0, 40, 0, 0 }, /* sizeof (prlwpname_t) */ + { 0, 8, 0, 0 }, /* pr_lwpid */ + { 8, 1, 32, 0 }, /* pr_lwpname[] */ +}; + + static const sl_arch_layout_t layout_sparcv9 = { @@ -411,6 +421,7 @@ static const sl_arch_layout_t layout_sparcv9 = { &utsname_layout, &prfdinfo_layout, &prsecflags_layout, + &prlwpname_layout, }; |