7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 */
25 /*
26 * Copyright 2012 DEY Storage Systems, Inc. All rights reserved.
27 * Copyright (c) 2014, Joyent, Inc. All rights reserved.
28 * Copyright (c) 2013 by Delphix. All rights reserved.
29 */
30
31 #ifndef _PCONTROL_H
32 #define _PCONTROL_H
33
34 /*
35 * Implemention-specific include file for libproc process management.
36 * This is not to be seen by the clients of libproc.
37 */
38
39 #include <stdio.h>
40 #include <gelf.h>
41 #include <synch.h>
42 #include <procfs.h>
43 #include <rtld_db.h>
44 #include <libproc.h>
45 #include <libctf.h>
46 #include <limits.h>
47 #include <libproc.h>
48 #include <sys/secflags.h>
49
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53
54 #include "Putil.h"
55
56 /*
57 * Definitions of the process control structures, internal to libproc.
58 * These may change without affecting clients of libproc.
59 */
60
61 /*
62 * sym_tbl_t contains a primary and an (optional) auxiliary symbol table, which
63 * we wish to treat as a single logical symbol table. In this logical table,
64 * the data from the auxiliary table preceeds that from the primary. Symbol
65 * indices start at [0], which is the first item in the auxiliary table
66 * if there is one. The sole purpose for this is so that we can treat the
67 * combination of .SUNW_ldynsym and .dynsym sections as a logically single
119 void *file_ctf_buf; /* CTF data for this file */
120 ctf_file_t *file_ctfp; /* CTF container for this file */
121 char *file_shstrs; /* section header string table */
122 size_t file_shstrsz; /* section header string table size */
123 uintptr_t *file_saddrs; /* section header addresses */
124 uint_t file_nsaddrs; /* number of section header addresses */
125 } file_info_t;
126
127 typedef struct map_info { /* description of an address space mapping */
128 prmap_t map_pmap; /* /proc description of this mapping */
129 file_info_t *map_file; /* pointer into list of mapped files */
130 off64_t map_offset; /* offset into core file (if core) */
131 int map_relocate; /* associated file_map needs to be relocated */
132 } map_info_t;
133
134 typedef struct lwp_info { /* per-lwp information from core file */
135 plist_t lwp_list; /* linked list */
136 lwpid_t lwp_id; /* lwp identifier */
137 lwpsinfo_t lwp_psinfo; /* /proc/<pid>/lwp/<lwpid>/lwpsinfo data */
138 lwpstatus_t lwp_status; /* /proc/<pid>/lwp/<lwpid>/lwpstatus data */
139 #if defined(sparc) || defined(__sparc)
140 gwindows_t *lwp_gwins; /* /proc/<pid>/lwp/<lwpid>/gwindows data */
141 prxregset_t *lwp_xregs; /* /proc/<pid>/lwp/<lwpid>/xregs data */
142 int64_t *lwp_asrs; /* /proc/<pid>/lwp/<lwpid>/asrs data */
143 #endif
144 } lwp_info_t;
145
146 typedef struct fd_info {
147 plist_t fd_list; /* linked list */
148 prfdinfo_t fd_info; /* fd info */
149 } fd_info_t;
150
151 typedef struct core_info { /* information specific to core files */
152 char core_dmodel; /* data model for core file */
153 char core_osabi; /* ELF OS ABI */
154 int core_errno; /* error during initialization if != 0 */
155 plist_t core_lwp_head; /* head of list of lwp info */
156 lwp_info_t *core_lwp; /* current lwp information */
157 uint_t core_nlwp; /* number of lwp's in list */
158 off64_t core_size; /* size of core file in bytes */
|
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 */
25 /*
26 * Copyright 2012 DEY Storage Systems, Inc. All rights reserved.
27 * Copyright (c) 2013 by Delphix. All rights reserved.
28 * Copyright 2018 Joyent, Inc.
29 */
30
31 #ifndef _PCONTROL_H
32 #define _PCONTROL_H
33
34 /*
35 * Implemention-specific include file for libproc process management.
36 * This is not to be seen by the clients of libproc.
37 */
38
39 #include <stdio.h>
40 #include <gelf.h>
41 #include <synch.h>
42 #include <procfs.h>
43 #include <rtld_db.h>
44 #include <libproc.h>
45 #include <libctf.h>
46 #include <limits.h>
47 #include <libproc.h>
48 #include <thread.h>
49 #include <sys/secflags.h>
50
51 #ifdef __cplusplus
52 extern "C" {
53 #endif
54
55 #include "Putil.h"
56
57 /*
58 * Definitions of the process control structures, internal to libproc.
59 * These may change without affecting clients of libproc.
60 */
61
62 /*
63 * sym_tbl_t contains a primary and an (optional) auxiliary symbol table, which
64 * we wish to treat as a single logical symbol table. In this logical table,
65 * the data from the auxiliary table preceeds that from the primary. Symbol
66 * indices start at [0], which is the first item in the auxiliary table
67 * if there is one. The sole purpose for this is so that we can treat the
68 * combination of .SUNW_ldynsym and .dynsym sections as a logically single
120 void *file_ctf_buf; /* CTF data for this file */
121 ctf_file_t *file_ctfp; /* CTF container for this file */
122 char *file_shstrs; /* section header string table */
123 size_t file_shstrsz; /* section header string table size */
124 uintptr_t *file_saddrs; /* section header addresses */
125 uint_t file_nsaddrs; /* number of section header addresses */
126 } file_info_t;
127
128 typedef struct map_info { /* description of an address space mapping */
129 prmap_t map_pmap; /* /proc description of this mapping */
130 file_info_t *map_file; /* pointer into list of mapped files */
131 off64_t map_offset; /* offset into core file (if core) */
132 int map_relocate; /* associated file_map needs to be relocated */
133 } map_info_t;
134
135 typedef struct lwp_info { /* per-lwp information from core file */
136 plist_t lwp_list; /* linked list */
137 lwpid_t lwp_id; /* lwp identifier */
138 lwpsinfo_t lwp_psinfo; /* /proc/<pid>/lwp/<lwpid>/lwpsinfo data */
139 lwpstatus_t lwp_status; /* /proc/<pid>/lwp/<lwpid>/lwpstatus data */
140 char lwp_name[THREAD_NAME_MAX];
141 #if defined(sparc) || defined(__sparc)
142 gwindows_t *lwp_gwins; /* /proc/<pid>/lwp/<lwpid>/gwindows data */
143 prxregset_t *lwp_xregs; /* /proc/<pid>/lwp/<lwpid>/xregs data */
144 int64_t *lwp_asrs; /* /proc/<pid>/lwp/<lwpid>/asrs data */
145 #endif
146 } lwp_info_t;
147
148 typedef struct fd_info {
149 plist_t fd_list; /* linked list */
150 prfdinfo_t fd_info; /* fd info */
151 } fd_info_t;
152
153 typedef struct core_info { /* information specific to core files */
154 char core_dmodel; /* data model for core file */
155 char core_osabi; /* ELF OS ABI */
156 int core_errno; /* error during initialization if != 0 */
157 plist_t core_lwp_head; /* head of list of lwp info */
158 lwp_info_t *core_lwp; /* current lwp information */
159 uint_t core_nlwp; /* number of lwp's in list */
160 off64_t core_size; /* size of core file in bytes */
|