annotate agent/src/os/solaris/dbx/proc_service_2.h @ 1662:e0ba4e04c839

6969574: invokedynamic call sites deoptimize instead of executing Reviewed-by: kvn
author jrose
date Fri, 16 Jul 2010 18:14:19 -0700
parents c18cbe5936b8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
2 * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
a61af66fc99e Initial load
duke
parents:
diff changeset
25 #ifndef _PROC_SERVICE_2_H
a61af66fc99e Initial load
duke
parents:
diff changeset
26 #define _PROC_SERVICE_2_H
a61af66fc99e Initial load
duke
parents:
diff changeset
27
a61af66fc99e Initial load
duke
parents:
diff changeset
28 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
29 * Types, function definitions for the provider of services beyond
a61af66fc99e Initial load
duke
parents:
diff changeset
30 * proc_service. This interface will be used by import modules like
a61af66fc99e Initial load
duke
parents:
diff changeset
31 * BAT/prex, NEO debugger etc.
a61af66fc99e Initial load
duke
parents:
diff changeset
32 */
a61af66fc99e Initial load
duke
parents:
diff changeset
33
a61af66fc99e Initial load
duke
parents:
diff changeset
34 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
35 CCR info
a61af66fc99e Initial load
duke
parents:
diff changeset
36
a61af66fc99e Initial load
duke
parents:
diff changeset
37 Version history:
a61af66fc99e Initial load
duke
parents:
diff changeset
38
a61af66fc99e Initial load
duke
parents:
diff changeset
39 1.0 - Initial CCR release
a61af66fc99e Initial load
duke
parents:
diff changeset
40
a61af66fc99e Initial load
duke
parents:
diff changeset
41 1.1 - Changes for GLUE/neo.
a61af66fc99e Initial load
duke
parents:
diff changeset
42 New entry points ps_svnt_generic() and ps_svc_generic()
a61af66fc99e Initial load
duke
parents:
diff changeset
43 - New entry point ps_getpid()
a61af66fc99e Initial load
duke
parents:
diff changeset
44
a61af66fc99e Initial load
duke
parents:
diff changeset
45 Release information for automatic CCR updates:
a61af66fc99e Initial load
duke
parents:
diff changeset
46 BEGIN RELEASE NOTES: (signifies what gets put into CCR release notes)
a61af66fc99e Initial load
duke
parents:
diff changeset
47 1.2 - Changes to support Solaris 2.7
a61af66fc99e Initial load
duke
parents:
diff changeset
48
a61af66fc99e Initial load
duke
parents:
diff changeset
49 END RELEASE NOTES: (signifies what gets put into CCR release notes)
a61af66fc99e Initial load
duke
parents:
diff changeset
50
a61af66fc99e Initial load
duke
parents:
diff changeset
51 Following is used for CCR version number:
a61af66fc99e Initial load
duke
parents:
diff changeset
52
a61af66fc99e Initial load
duke
parents:
diff changeset
53 #define CCR_PROC_SERVICE_2_VERSION 1.2
a61af66fc99e Initial load
duke
parents:
diff changeset
54
a61af66fc99e Initial load
duke
parents:
diff changeset
55 */
a61af66fc99e Initial load
duke
parents:
diff changeset
56
a61af66fc99e Initial load
duke
parents:
diff changeset
57
a61af66fc99e Initial load
duke
parents:
diff changeset
58 #include <proc_service.h>
a61af66fc99e Initial load
duke
parents:
diff changeset
59 #include <sys/types.h>
a61af66fc99e Initial load
duke
parents:
diff changeset
60
a61af66fc99e Initial load
duke
parents:
diff changeset
61 #ifdef __cplusplus
a61af66fc99e Initial load
duke
parents:
diff changeset
62 extern "C" {
a61af66fc99e Initial load
duke
parents:
diff changeset
63 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
64
a61af66fc99e Initial load
duke
parents:
diff changeset
65 struct ps_loadobj {
a61af66fc99e Initial load
duke
parents:
diff changeset
66 int objfd; /* fd of the load object or executable
a61af66fc99e Initial load
duke
parents:
diff changeset
67 * -1 implies its not available.
a61af66fc99e Initial load
duke
parents:
diff changeset
68 * This file decriptor is live only during the
a61af66fc99e Initial load
duke
parents:
diff changeset
69 * particular call to ps_iter_f(). If you
a61af66fc99e Initial load
duke
parents:
diff changeset
70 * need it beyond that you need to dup() it.
a61af66fc99e Initial load
duke
parents:
diff changeset
71 */
a61af66fc99e Initial load
duke
parents:
diff changeset
72 psaddr_t
a61af66fc99e Initial load
duke
parents:
diff changeset
73 text_base; /* address where text of loadobj was mapped */
a61af66fc99e Initial load
duke
parents:
diff changeset
74 psaddr_t
a61af66fc99e Initial load
duke
parents:
diff changeset
75 data_base; /* address where data of loadobj was mapped */
a61af66fc99e Initial load
duke
parents:
diff changeset
76 const char *objname; /* loadobj name */
a61af66fc99e Initial load
duke
parents:
diff changeset
77 };
a61af66fc99e Initial load
duke
parents:
diff changeset
78
a61af66fc99e Initial load
duke
parents:
diff changeset
79 typedef int ps_iter_f(const struct ps_prochandle *, const struct ps_loadobj *,
a61af66fc99e Initial load
duke
parents:
diff changeset
80 void *cd);
a61af66fc99e Initial load
duke
parents:
diff changeset
81
a61af66fc99e Initial load
duke
parents:
diff changeset
82 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
83 * Returns the ps_prochandle for the current process under focus. Returns
a61af66fc99e Initial load
duke
parents:
diff changeset
84 * NULL if there is none.
a61af66fc99e Initial load
duke
parents:
diff changeset
85 */
a61af66fc99e Initial load
duke
parents:
diff changeset
86
a61af66fc99e Initial load
duke
parents:
diff changeset
87 const struct ps_prochandle *
a61af66fc99e Initial load
duke
parents:
diff changeset
88 ps_get_prochandle(void);
a61af66fc99e Initial load
duke
parents:
diff changeset
89
a61af66fc99e Initial load
duke
parents:
diff changeset
90 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
91 * Returns the ps_prochandle for the current process(allows core files to
a61af66fc99e Initial load
duke
parents:
diff changeset
92 * be specified) under focus. Returns NULL if there is none.
a61af66fc99e Initial load
duke
parents:
diff changeset
93 */
a61af66fc99e Initial load
duke
parents:
diff changeset
94 const struct ps_prochandle *
a61af66fc99e Initial load
duke
parents:
diff changeset
95 ps_get_prochandle2(int cores_too);
a61af66fc99e Initial load
duke
parents:
diff changeset
96
a61af66fc99e Initial load
duke
parents:
diff changeset
97 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
98 * Returns the pid of the process referred to by the ps_prochandle.
a61af66fc99e Initial load
duke
parents:
diff changeset
99 *
a61af66fc99e Initial load
duke
parents:
diff changeset
100 * 0 is returned in case the ps_prochandle is not valid or refers to dead
a61af66fc99e Initial load
duke
parents:
diff changeset
101 * process.
a61af66fc99e Initial load
duke
parents:
diff changeset
102 *
a61af66fc99e Initial load
duke
parents:
diff changeset
103 */
a61af66fc99e Initial load
duke
parents:
diff changeset
104 pid_t
a61af66fc99e Initial load
duke
parents:
diff changeset
105 ps_getpid(const struct ps_prochandle *);
a61af66fc99e Initial load
duke
parents:
diff changeset
106
a61af66fc99e Initial load
duke
parents:
diff changeset
107 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
108 * Iteration function that iterates over all load objects *and the
a61af66fc99e Initial load
duke
parents:
diff changeset
109 * executable*
a61af66fc99e Initial load
duke
parents:
diff changeset
110 *
a61af66fc99e Initial load
duke
parents:
diff changeset
111 * If the callback routine returns:
a61af66fc99e Initial load
duke
parents:
diff changeset
112 * 0 - continue processing link objects
a61af66fc99e Initial load
duke
parents:
diff changeset
113 * non zero - stop calling the callback function
a61af66fc99e Initial load
duke
parents:
diff changeset
114 *
a61af66fc99e Initial load
duke
parents:
diff changeset
115 */
a61af66fc99e Initial load
duke
parents:
diff changeset
116
a61af66fc99e Initial load
duke
parents:
diff changeset
117 ps_err_e
a61af66fc99e Initial load
duke
parents:
diff changeset
118 ps_loadobj_iter(const struct ps_prochandle *, ps_iter_f *, void *clnt_data);
a61af66fc99e Initial load
duke
parents:
diff changeset
119
a61af66fc99e Initial load
duke
parents:
diff changeset
120 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
121 * Address => function name mapping
a61af66fc99e Initial load
duke
parents:
diff changeset
122 *
a61af66fc99e Initial load
duke
parents:
diff changeset
123 * Given an address, returns a pointer to the function's
a61af66fc99e Initial load
duke
parents:
diff changeset
124 * linker name (null terminated).
a61af66fc99e Initial load
duke
parents:
diff changeset
125 */
a61af66fc99e Initial load
duke
parents:
diff changeset
126
a61af66fc99e Initial load
duke
parents:
diff changeset
127 ps_err_e
a61af66fc99e Initial load
duke
parents:
diff changeset
128 ps_find_fun_name(const struct ps_prochandle *, psaddr_t addr,
a61af66fc99e Initial load
duke
parents:
diff changeset
129 const char **name);
a61af66fc99e Initial load
duke
parents:
diff changeset
130
a61af66fc99e Initial load
duke
parents:
diff changeset
131 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
132 * Interface to LD_PRELOAD. LD_PRELOAD given library across the
a61af66fc99e Initial load
duke
parents:
diff changeset
133 * program 'exec'.
a61af66fc99e Initial load
duke
parents:
diff changeset
134 *
a61af66fc99e Initial load
duke
parents:
diff changeset
135 */
a61af66fc99e Initial load
duke
parents:
diff changeset
136
a61af66fc99e Initial load
duke
parents:
diff changeset
137 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
138 * Append/Prepend the 'lib' (has to be library name as understood by LD_PRELOAD)
a61af66fc99e Initial load
duke
parents:
diff changeset
139 * to the LD_PRELOAD variable setting to be used by the debugee
a61af66fc99e Initial load
duke
parents:
diff changeset
140 * Returns a cookie (in id).
a61af66fc99e Initial load
duke
parents:
diff changeset
141 */
a61af66fc99e Initial load
duke
parents:
diff changeset
142 ps_err_e
a61af66fc99e Initial load
duke
parents:
diff changeset
143 ps_ld_preload_append(const char *lib, int *id);
a61af66fc99e Initial load
duke
parents:
diff changeset
144 ps_err_e
a61af66fc99e Initial load
duke
parents:
diff changeset
145 ps_ld_preload_prepend(const char *lib, int *id);
a61af66fc99e Initial load
duke
parents:
diff changeset
146
a61af66fc99e Initial load
duke
parents:
diff changeset
147 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
148 * Remove the library associated with 'id' from the LD_PRELOAD setting.
a61af66fc99e Initial load
duke
parents:
diff changeset
149 *
a61af66fc99e Initial load
duke
parents:
diff changeset
150 */
a61af66fc99e Initial load
duke
parents:
diff changeset
151 ps_err_e
a61af66fc99e Initial load
duke
parents:
diff changeset
152 ps_ld_preload_remove(int id);
a61af66fc99e Initial load
duke
parents:
diff changeset
153
a61af66fc99e Initial load
duke
parents:
diff changeset
154 #ifdef __cplusplus
a61af66fc99e Initial load
duke
parents:
diff changeset
155 }
a61af66fc99e Initial load
duke
parents:
diff changeset
156 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
157
a61af66fc99e Initial load
duke
parents:
diff changeset
158 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
159 * The following are C++ only interfaces
a61af66fc99e Initial load
duke
parents:
diff changeset
160 */
a61af66fc99e Initial load
duke
parents:
diff changeset
161 #ifdef __cplusplus
a61af66fc99e Initial load
duke
parents:
diff changeset
162
a61af66fc99e Initial load
duke
parents:
diff changeset
163 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
164 * classes ServiceDbx and ServantDbx and defined in "gp_dbx_svc.h" which is
a61af66fc99e Initial load
duke
parents:
diff changeset
165 * accessed via CCR
a61af66fc99e Initial load
duke
parents:
diff changeset
166 */
a61af66fc99e Initial load
duke
parents:
diff changeset
167 extern class ServantDbx *ps_svnt_generic();
a61af66fc99e Initial load
duke
parents:
diff changeset
168 extern class ServiceDbx *ps_svc_generic();
a61af66fc99e Initial load
duke
parents:
diff changeset
169
a61af66fc99e Initial load
duke
parents:
diff changeset
170 #endif
a61af66fc99e Initial load
duke
parents:
diff changeset
171
a61af66fc99e Initial load
duke
parents:
diff changeset
172 #endif /* _PROC_SERVICE_2_H */