xref: /titanic_44/usr/src/cmd/truss/ramdata.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate  * with the License.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate  * and limitations under the License.
13*7c478bd9Sstevel@tonic-gate  *
14*7c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate  *
20*7c478bd9Sstevel@tonic-gate  * CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate  */
22*7c478bd9Sstevel@tonic-gate /*
23*7c478bd9Sstevel@tonic-gate  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24*7c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
25*7c478bd9Sstevel@tonic-gate  */
26*7c478bd9Sstevel@tonic-gate 
27*7c478bd9Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
28*7c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
29*7c478bd9Sstevel@tonic-gate 
30*7c478bd9Sstevel@tonic-gate 
31*7c478bd9Sstevel@tonic-gate #ifndef _RAMDATA_H
32*7c478bd9Sstevel@tonic-gate #define	_RAMDATA_H
33*7c478bd9Sstevel@tonic-gate 
34*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"	/* SVr4.0 1.3	*/
35*7c478bd9Sstevel@tonic-gate 
36*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
37*7c478bd9Sstevel@tonic-gate extern "C" {
38*7c478bd9Sstevel@tonic-gate #endif
39*7c478bd9Sstevel@tonic-gate 
40*7c478bd9Sstevel@tonic-gate /*
41*7c478bd9Sstevel@tonic-gate  * ramdata.h -- read/write data declarations.
42*7c478bd9Sstevel@tonic-gate  */
43*7c478bd9Sstevel@tonic-gate 
44*7c478bd9Sstevel@tonic-gate #include <errno.h>
45*7c478bd9Sstevel@tonic-gate #include <signal.h>
46*7c478bd9Sstevel@tonic-gate #include <synch.h>
47*7c478bd9Sstevel@tonic-gate #include <thread.h>
48*7c478bd9Sstevel@tonic-gate #include <thread_db.h>
49*7c478bd9Sstevel@tonic-gate #include "htbl.h"
50*7c478bd9Sstevel@tonic-gate 
51*7c478bd9Sstevel@tonic-gate /*
52*7c478bd9Sstevel@tonic-gate  * Set type for possible filedescriptors.
53*7c478bd9Sstevel@tonic-gate  */
54*7c478bd9Sstevel@tonic-gate #define	NOFILES_MAX	(64 * 1024)
55*7c478bd9Sstevel@tonic-gate typedef struct {
56*7c478bd9Sstevel@tonic-gate 	uint32_t word[(NOFILES_MAX+31)/32];
57*7c478bd9Sstevel@tonic-gate } fileset_t;
58*7c478bd9Sstevel@tonic-gate 
59*7c478bd9Sstevel@tonic-gate /*
60*7c478bd9Sstevel@tonic-gate  * Previous stop state enumeration (used by signalled() and requested()).
61*7c478bd9Sstevel@tonic-gate  */
62*7c478bd9Sstevel@tonic-gate #define	SLEEPING	1
63*7c478bd9Sstevel@tonic-gate #define	JOBSIG		2
64*7c478bd9Sstevel@tonic-gate #define	JOBSTOP		3
65*7c478bd9Sstevel@tonic-gate 
66*7c478bd9Sstevel@tonic-gate /*
67*7c478bd9Sstevel@tonic-gate  * Simple convenience.
68*7c478bd9Sstevel@tonic-gate  */
69*7c478bd9Sstevel@tonic-gate #ifdef	TRUE
70*7c478bd9Sstevel@tonic-gate #undef	TRUE
71*7c478bd9Sstevel@tonic-gate #endif
72*7c478bd9Sstevel@tonic-gate #ifdef	FALSE
73*7c478bd9Sstevel@tonic-gate #undef	FALSE
74*7c478bd9Sstevel@tonic-gate #endif
75*7c478bd9Sstevel@tonic-gate #define	TRUE	1
76*7c478bd9Sstevel@tonic-gate #define	FALSE	0
77*7c478bd9Sstevel@tonic-gate 
78*7c478bd9Sstevel@tonic-gate /*
79*7c478bd9Sstevel@tonic-gate  * Definition of private data.  See get_private().
80*7c478bd9Sstevel@tonic-gate  */
81*7c478bd9Sstevel@tonic-gate 
82*7c478bd9Sstevel@tonic-gate #define	IOBSIZE	12		/* number of bytes shown by prt_iob() */
83*7c478bd9Sstevel@tonic-gate 
84*7c478bd9Sstevel@tonic-gate #define	CACHE_LN_SZ 64
85*7c478bd9Sstevel@tonic-gate 
86*7c478bd9Sstevel@tonic-gate typedef struct private {
87*7c478bd9Sstevel@tonic-gate 	struct ps_lwphandle *Lwp;	/* non-NULL for each lwp controller */
88*7c478bd9Sstevel@tonic-gate 	const lwpstatus_t *lwpstat; /* lwp status information while stopped */
89*7c478bd9Sstevel@tonic-gate 	int	length;		/* length of printf() output so far */
90*7c478bd9Sstevel@tonic-gate 	pid_t	child;		/* pid of fork()ed child process */
91*7c478bd9Sstevel@tonic-gate 	char	pname[32];	/* formatted pid/tid of controlled lwp */
92*7c478bd9Sstevel@tonic-gate 	struct {		/* remembered parameters for make_pname() */
93*7c478bd9Sstevel@tonic-gate 		int	ff;
94*7c478bd9Sstevel@tonic-gate 		int	lf;
95*7c478bd9Sstevel@tonic-gate 		pid_t	pid;
96*7c478bd9Sstevel@tonic-gate 		id_t	lwpid;
97*7c478bd9Sstevel@tonic-gate 		id_t	tid;
98*7c478bd9Sstevel@tonic-gate 	} pparam;
99*7c478bd9Sstevel@tonic-gate 	int	Errno;		/* errno for controlled process's syscall */
100*7c478bd9Sstevel@tonic-gate 	int	ErrPriv;	/* privilege missing for last syscall */
101*7c478bd9Sstevel@tonic-gate 	long	Rval1;		/* rval1 (%r0) for syscall */
102*7c478bd9Sstevel@tonic-gate 	long	Rval2;		/* rval2 (%r1) for syscall */
103*7c478bd9Sstevel@tonic-gate 	timestruc_t syslast;	/* most recent value of stime */
104*7c478bd9Sstevel@tonic-gate 	timestruc_t usrlast;	/* most recent value of utime */
105*7c478bd9Sstevel@tonic-gate 	long	sys_args[9];	/* the arguments to the last syscall */
106*7c478bd9Sstevel@tonic-gate 	int	sys_nargs;	/* number of arguments to the last syscall */
107*7c478bd9Sstevel@tonic-gate 	int	sys_indirect;	/* if TRUE, this is an indirect system call */
108*7c478bd9Sstevel@tonic-gate 	char	sys_name[12];	/* name of unknown system call */
109*7c478bd9Sstevel@tonic-gate 	char	raw_sig_name[SIG2STR_MAX+4]; /* name of known signal */
110*7c478bd9Sstevel@tonic-gate 	char	sig_name[12];	/* name of unknown signal */
111*7c478bd9Sstevel@tonic-gate 	char	flt_name[12];	/* name of unknown fault */
112*7c478bd9Sstevel@tonic-gate 	char	*sys_path;	/* first pathname given to syscall */
113*7c478bd9Sstevel@tonic-gate 	size_t	sys_psize;	/* sizeof(*sys_path) */
114*7c478bd9Sstevel@tonic-gate 	int	sys_valid;	/* pathname was fetched and is valid */
115*7c478bd9Sstevel@tonic-gate 	char	*sys_string;	/* buffer for formatted syscall string */
116*7c478bd9Sstevel@tonic-gate 	size_t	sys_ssize;	/* sizeof(*sys_string) */
117*7c478bd9Sstevel@tonic-gate 	size_t	sys_leng;	/* strlen(sys_string) */
118*7c478bd9Sstevel@tonic-gate 	char	*exec_string;	/* copy of sys_string for exec() only */
119*7c478bd9Sstevel@tonic-gate 	char	exec_pname[32];	/* formatted pid for exec() only */
120*7c478bd9Sstevel@tonic-gate 	id_t	exec_lwpid;	/* lwpid that performed the exec */
121*7c478bd9Sstevel@tonic-gate 	char	*str_buffer;	/* fetchstring() buffer */
122*7c478bd9Sstevel@tonic-gate 	size_t	str_bsize;	/* sizeof(*str_buffer) */
123*7c478bd9Sstevel@tonic-gate 	char	iob_buf[2*IOBSIZE+8];	/* where prt_iob() leaves its stuff */
124*7c478bd9Sstevel@tonic-gate 	char	code_buf[160];	/* for symbolic arguments, e.g., ioctl codes */
125*7c478bd9Sstevel@tonic-gate 	int	recur;		/* show_strioctl() -- to prevent recursion */
126*7c478bd9Sstevel@tonic-gate 	int	seconds;	/* seconds, fraction for timestamps */
127*7c478bd9Sstevel@tonic-gate 	int	fraction;	/* fraction in 1/10 milliseconds */
128*7c478bd9Sstevel@tonic-gate } private_t;
129*7c478bd9Sstevel@tonic-gate 
130*7c478bd9Sstevel@tonic-gate extern	thread_key_t	private_key;	/* set by thr_keycreate() */
131*7c478bd9Sstevel@tonic-gate 
132*7c478bd9Sstevel@tonic-gate extern	char	*command;	/* name of command ("truss") */
133*7c478bd9Sstevel@tonic-gate extern	int	interrupt;	/* interrupt signal was received */
134*7c478bd9Sstevel@tonic-gate extern	int	sigusr1;	/* received SIGUSR1 (release process) */
135*7c478bd9Sstevel@tonic-gate extern	int	sfd;		/* file descriptor to shared tmp file */
136*7c478bd9Sstevel@tonic-gate extern	pid_t	created;	/* if process was created, its process id */
137*7c478bd9Sstevel@tonic-gate extern	uid_t	Euid;		/* truss's effective uid */
138*7c478bd9Sstevel@tonic-gate extern	uid_t	Egid;		/* truss's effective gid */
139*7c478bd9Sstevel@tonic-gate extern	uid_t	Ruid;		/* truss's real uid */
140*7c478bd9Sstevel@tonic-gate extern	uid_t	Rgid;		/* truss's real gid */
141*7c478bd9Sstevel@tonic-gate extern	prcred_t credentials;	/* traced process credentials */
142*7c478bd9Sstevel@tonic-gate extern	int	istty;		/* TRUE iff output is a tty */
143*7c478bd9Sstevel@tonic-gate extern	time_t	starttime;	/* start time */
144*7c478bd9Sstevel@tonic-gate 
145*7c478bd9Sstevel@tonic-gate extern	int	Fflag;		/* option flags from getopt() */
146*7c478bd9Sstevel@tonic-gate extern	int	fflag;
147*7c478bd9Sstevel@tonic-gate extern	int	cflag;
148*7c478bd9Sstevel@tonic-gate extern	int	aflag;
149*7c478bd9Sstevel@tonic-gate extern	int	eflag;
150*7c478bd9Sstevel@tonic-gate extern	int	iflag;
151*7c478bd9Sstevel@tonic-gate extern	int	lflag;
152*7c478bd9Sstevel@tonic-gate extern	int	tflag;
153*7c478bd9Sstevel@tonic-gate extern	int	pflag;
154*7c478bd9Sstevel@tonic-gate extern	int	sflag;
155*7c478bd9Sstevel@tonic-gate extern	int	mflag;
156*7c478bd9Sstevel@tonic-gate extern	int	oflag;
157*7c478bd9Sstevel@tonic-gate extern	int	vflag;
158*7c478bd9Sstevel@tonic-gate extern	int	xflag;
159*7c478bd9Sstevel@tonic-gate extern	int	hflag;
160*7c478bd9Sstevel@tonic-gate 
161*7c478bd9Sstevel@tonic-gate extern	int	dflag;
162*7c478bd9Sstevel@tonic-gate extern	int	Dflag;
163*7c478bd9Sstevel@tonic-gate extern	int	Eflag;
164*7c478bd9Sstevel@tonic-gate extern	int	Tflag;
165*7c478bd9Sstevel@tonic-gate extern	int	Sflag;
166*7c478bd9Sstevel@tonic-gate extern	int	Mflag;
167*7c478bd9Sstevel@tonic-gate 
168*7c478bd9Sstevel@tonic-gate extern	sysset_t trace;		/* sys calls to trace */
169*7c478bd9Sstevel@tonic-gate extern	sysset_t traceeven;	/* sys calls to trace even if not reported */
170*7c478bd9Sstevel@tonic-gate extern	sysset_t verbose;	/* sys calls to be verbose about */
171*7c478bd9Sstevel@tonic-gate extern	sysset_t rawout;	/* sys calls to show in raw mode */
172*7c478bd9Sstevel@tonic-gate extern	sigset_t signals;	/* signals to trace */
173*7c478bd9Sstevel@tonic-gate extern	fltset_t faults;	/* faults to trace */
174*7c478bd9Sstevel@tonic-gate extern	fileset_t readfd;	/* read() file descriptors to dump */
175*7c478bd9Sstevel@tonic-gate extern	fileset_t writefd;	/* write() file descriptors to dump */
176*7c478bd9Sstevel@tonic-gate 
177*7c478bd9Sstevel@tonic-gate #pragma align CACHE_LN_SZ(truss_lock, count_lock)
178*7c478bd9Sstevel@tonic-gate extern	mutex_t	truss_lock;	/* protects almost everything */
179*7c478bd9Sstevel@tonic-gate extern	cond_t	truss_cv;	/* condition variable associated w truss_lock */
180*7c478bd9Sstevel@tonic-gate extern	mutex_t count_lock;	/* lock protecting count struct Cp */
181*7c478bd9Sstevel@tonic-gate 
182*7c478bd9Sstevel@tonic-gate extern	htbl_t	*fcall_tbl;	/* function call hash table (per-proc) */
183*7c478bd9Sstevel@tonic-gate 
184*7c478bd9Sstevel@tonic-gate extern	int	truss_nlwp;	/* number of truss lwps */
185*7c478bd9Sstevel@tonic-gate extern	int	truss_maxlwp;	/* number of entries in truss_lwpid */
186*7c478bd9Sstevel@tonic-gate extern	lwpid_t	*truss_lwpid;	/* array of truss lwpid's */
187*7c478bd9Sstevel@tonic-gate 
188*7c478bd9Sstevel@tonic-gate 
189*7c478bd9Sstevel@tonic-gate struct syscount {
190*7c478bd9Sstevel@tonic-gate 	long count;		/* system call count */
191*7c478bd9Sstevel@tonic-gate 	long error;		/* system call errors */
192*7c478bd9Sstevel@tonic-gate 	timestruc_t stime;	/* time spent in system call */
193*7c478bd9Sstevel@tonic-gate };
194*7c478bd9Sstevel@tonic-gate 
195*7c478bd9Sstevel@tonic-gate struct counts {		/* structure for keeping counts */
196*7c478bd9Sstevel@tonic-gate 	long sigcount[PRMAXSIG+1];	/* signals count [0..PRMAXSIG] */
197*7c478bd9Sstevel@tonic-gate 	long fltcount[PRMAXFAULT+1];	/* faults count [0..MAXFAULT] */
198*7c478bd9Sstevel@tonic-gate 	struct syscount *syscount[PRMAXSYS+1];
199*7c478bd9Sstevel@tonic-gate 	timestruc_t systotal;		/* total time spent in kernel */
200*7c478bd9Sstevel@tonic-gate 	timestruc_t usrtotal;		/* total time spent in user mode */
201*7c478bd9Sstevel@tonic-gate 	timestruc_t basetime;		/* base time for timestamps */
202*7c478bd9Sstevel@tonic-gate };
203*7c478bd9Sstevel@tonic-gate 
204*7c478bd9Sstevel@tonic-gate struct global_psinfo {
205*7c478bd9Sstevel@tonic-gate 	mutex_t	fork_lock;		/* protects list of truss pids */
206*7c478bd9Sstevel@tonic-gate 	cond_t	fork_cv;
207*7c478bd9Sstevel@tonic-gate 	char p1[CACHE_LN_SZ - (sizeof (mutex_t) + sizeof (cond_t))];
208*7c478bd9Sstevel@tonic-gate 	mutex_t ps_mutex0;		/* see ipc.c:Ecritical */
209*7c478bd9Sstevel@tonic-gate 	char p2[CACHE_LN_SZ - sizeof (mutex_t)];
210*7c478bd9Sstevel@tonic-gate 	mutex_t	ps_mutex1;		/* see ipc.c:Ecritical */
211*7c478bd9Sstevel@tonic-gate 	char p3[CACHE_LN_SZ - sizeof (mutex_t)];
212*7c478bd9Sstevel@tonic-gate 	pid_t	fork_pid;
213*7c478bd9Sstevel@tonic-gate 	pid_t tpid[1000];	/* truss process pid */
214*7c478bd9Sstevel@tonic-gate 	pid_t spid[1000];	/* subject process pid */
215*7c478bd9Sstevel@tonic-gate 	const char *lwps[1000];	/* optional lwp list */
216*7c478bd9Sstevel@tonic-gate };
217*7c478bd9Sstevel@tonic-gate 
218*7c478bd9Sstevel@tonic-gate extern	struct counts *Cp;	/* for counting: malloc() or shared memory */
219*7c478bd9Sstevel@tonic-gate extern	struct global_psinfo *gps;	/* ptr to global_psinfo struct */
220*7c478bd9Sstevel@tonic-gate 
221*7c478bd9Sstevel@tonic-gate struct bkpt {		/* to describe one function's entry point */
222*7c478bd9Sstevel@tonic-gate 	struct bkpt *next;	/* hash table linked list */
223*7c478bd9Sstevel@tonic-gate 	char	*sym_name;	/* function name */
224*7c478bd9Sstevel@tonic-gate 	struct dynlib *dyn;	/* enclosing library */
225*7c478bd9Sstevel@tonic-gate 	uintptr_t addr;		/* function address, breakpointed */
226*7c478bd9Sstevel@tonic-gate 	ulong_t	instr;		/* original instruction at addr */
227*7c478bd9Sstevel@tonic-gate 	int	flags;		/* see below */
228*7c478bd9Sstevel@tonic-gate };
229*7c478bd9Sstevel@tonic-gate #define	BPT_HANG	0x01	/* leave stopped and abandoned when called */
230*7c478bd9Sstevel@tonic-gate #define	BPT_EXCLUDE	0x02	/* function found but is being excluded */
231*7c478bd9Sstevel@tonic-gate #define	BPT_INTERNAL	0x04	/* trace internal calls on this function */
232*7c478bd9Sstevel@tonic-gate #define	BPT_ACTIVE	0x08	/* function breakpoint is set in process */
233*7c478bd9Sstevel@tonic-gate #define	BPT_PREINIT	0x10	/* PREINIT event in ld.so.1 */
234*7c478bd9Sstevel@tonic-gate #define	BPT_POSTINIT	0x20	/* POSTINIT event in ld.so.1 */
235*7c478bd9Sstevel@tonic-gate #define	BPT_DLACTIVITY	0x40	/* DLACTIVITY event in ld.so.1 */
236*7c478bd9Sstevel@tonic-gate #define	BPT_TD_CREATE	0x80	/* TD_CREATE threading event */
237*7c478bd9Sstevel@tonic-gate 
238*7c478bd9Sstevel@tonic-gate struct dynlib {		/* structure for tracing functions */
239*7c478bd9Sstevel@tonic-gate 	struct dynlib *next;
240*7c478bd9Sstevel@tonic-gate 	char	*lib_name;	/* full library name */
241*7c478bd9Sstevel@tonic-gate 	char	*match_name;	/* library name used in name matching */
242*7c478bd9Sstevel@tonic-gate 	char	*prt_name;	/* library name for printing */
243*7c478bd9Sstevel@tonic-gate 	int	built;		/* if true, bkpt list has been built */
244*7c478bd9Sstevel@tonic-gate 	uintptr_t base;		/* library's mapping base */
245*7c478bd9Sstevel@tonic-gate 	size_t	size;		/* library's mapping size */
246*7c478bd9Sstevel@tonic-gate };
247*7c478bd9Sstevel@tonic-gate 
248*7c478bd9Sstevel@tonic-gate struct dynpat {		/* structure specifying patterns for dynlib's */
249*7c478bd9Sstevel@tonic-gate 	struct dynpat *next;
250*7c478bd9Sstevel@tonic-gate 	const char **libpat;	/* array of patterns for library names */
251*7c478bd9Sstevel@tonic-gate 	const char **sympat;	/* array of patterns for symbol names */
252*7c478bd9Sstevel@tonic-gate 	int	nlibpat;	/* number of library patterns */
253*7c478bd9Sstevel@tonic-gate 	int	nsympat;	/* number of symbol patterns */
254*7c478bd9Sstevel@tonic-gate 	char	flag;		/* 0 or BPT_HANG */
255*7c478bd9Sstevel@tonic-gate 	char	exclude_lib;	/* if true, exclude these libraries */
256*7c478bd9Sstevel@tonic-gate 	char	exclude;	/* if true, exclude these functions */
257*7c478bd9Sstevel@tonic-gate 	char	internal;	/* if true, trace internal calls */
258*7c478bd9Sstevel@tonic-gate 	struct dynlib *Dp;	/* set to the dynlib instance when searching */
259*7c478bd9Sstevel@tonic-gate };
260*7c478bd9Sstevel@tonic-gate 
261*7c478bd9Sstevel@tonic-gate extern	struct dynlib *Dyn;	/* for tracing functions in shared libraries */
262*7c478bd9Sstevel@tonic-gate extern	struct dynpat *Dynpat;
263*7c478bd9Sstevel@tonic-gate extern	struct dynpat *Lastpat;
264*7c478bd9Sstevel@tonic-gate extern	struct bkpt **bpt_hashtable;	/* breakpoint hash table */
265*7c478bd9Sstevel@tonic-gate extern	uint_t	nthr_create;	/* number of thr_create() calls seen so far */
266*7c478bd9Sstevel@tonic-gate 
267*7c478bd9Sstevel@tonic-gate struct callstack {
268*7c478bd9Sstevel@tonic-gate 	struct callstack *next;
269*7c478bd9Sstevel@tonic-gate 	uintptr_t stkbase;	/* stkbase < stkend */
270*7c478bd9Sstevel@tonic-gate 	uintptr_t stkend;	/* stkend == base + size */
271*7c478bd9Sstevel@tonic-gate 	prgreg_t tref;		/* %g7 (sparc) or %gs (intel) */
272*7c478bd9Sstevel@tonic-gate 	id_t	tid;		/* thread-id */
273*7c478bd9Sstevel@tonic-gate 	uint_t	nthr_create;	/* value of nthr_create last time we looked */
274*7c478bd9Sstevel@tonic-gate 	uint_t	ncall;		/* number of elements in stack */
275*7c478bd9Sstevel@tonic-gate 	uint_t	maxcall;	/* max elements in stack (malloc'd) */
276*7c478bd9Sstevel@tonic-gate 	struct {
277*7c478bd9Sstevel@tonic-gate 		uintptr_t sp;		/* %sp for function call */
278*7c478bd9Sstevel@tonic-gate 		uintptr_t pc;		/* value of the return %pc */
279*7c478bd9Sstevel@tonic-gate 		struct bkpt *fcn;	/* name of function called */
280*7c478bd9Sstevel@tonic-gate 	} *stack;		/* pointer to the call stack info */
281*7c478bd9Sstevel@tonic-gate };
282*7c478bd9Sstevel@tonic-gate 
283*7c478bd9Sstevel@tonic-gate extern	struct callstack *callstack;	/* the callstack list */
284*7c478bd9Sstevel@tonic-gate extern	uint_t	nstack;			/* number of detected stacks */
285*7c478bd9Sstevel@tonic-gate extern	rd_agent_t *Rdb_agent;		/* run-time linker debug handle */
286*7c478bd9Sstevel@tonic-gate extern	td_thragent_t *Thr_agent;	/* thread debug handle */
287*7c478bd9Sstevel@tonic-gate extern	int	not_consist;	/* used while rebuilding breakpoint table */
288*7c478bd9Sstevel@tonic-gate 
289*7c478bd9Sstevel@tonic-gate extern	pid_t	ancestor;	/* top-level parent process id */
290*7c478bd9Sstevel@tonic-gate extern	int	descendent;	/* TRUE iff descendent of top level */
291*7c478bd9Sstevel@tonic-gate extern	int	is_vfork_child;	/* TRUE iff process is a vfork()ed child */
292*7c478bd9Sstevel@tonic-gate 
293*7c478bd9Sstevel@tonic-gate extern	int	ngrab;		/* number of pid's that were grabbed */
294*7c478bd9Sstevel@tonic-gate 
295*7c478bd9Sstevel@tonic-gate extern	struct ps_prochandle *Proc;	/* global reference to process */
296*7c478bd9Sstevel@tonic-gate extern	int	data_model;	/* PR_MODEL_LP64 or PR_MODEL_ILP32 */
297*7c478bd9Sstevel@tonic-gate 
298*7c478bd9Sstevel@tonic-gate extern	long	pagesize;	/* bytes per page; should be per-process */
299*7c478bd9Sstevel@tonic-gate 
300*7c478bd9Sstevel@tonic-gate extern	int	exit_called;	/* _exit() syscall was seen */
301*7c478bd9Sstevel@tonic-gate 
302*7c478bd9Sstevel@tonic-gate extern	lwpid_t	primary_lwp;	/* representative lwp on process grab */
303*7c478bd9Sstevel@tonic-gate 
304*7c478bd9Sstevel@tonic-gate extern	sysset_t syshang;	/* sys calls to make process hang */
305*7c478bd9Sstevel@tonic-gate extern	sigset_t sighang;	/* signals to make process hang */
306*7c478bd9Sstevel@tonic-gate extern	fltset_t flthang;	/* faults to make process hang */
307*7c478bd9Sstevel@tonic-gate 
308*7c478bd9Sstevel@tonic-gate extern	int	leave_hung;	/* if TRUE, leave the process hung */
309*7c478bd9Sstevel@tonic-gate 
310*7c478bd9Sstevel@tonic-gate 
311*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
312*7c478bd9Sstevel@tonic-gate }
313*7c478bd9Sstevel@tonic-gate #endif
314*7c478bd9Sstevel@tonic-gate 
315*7c478bd9Sstevel@tonic-gate #endif /* _RAMDATA_H */
316