1 /* |
1 /* |
2 * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
91 #define false 0 |
91 #define false 0 |
92 |
92 |
93 struct ps_prochandle; |
93 struct ps_prochandle; |
94 |
94 |
95 // attach to a process |
95 // attach to a process |
96 struct ps_prochandle* Pgrab(pid_t pid, char* err_buf, size_t err_buf_len); |
96 JNIEXPORT struct ps_prochandle* |
|
97 Pgrab(pid_t pid, char* err_buf, size_t err_buf_len); |
97 |
98 |
98 // attach to a core dump |
99 // attach to a core dump |
99 struct ps_prochandle* Pgrab_core(const char* execfile, const char* corefile); |
100 JNIEXPORT struct ps_prochandle* |
|
101 Pgrab_core(const char* execfile, const char* corefile); |
100 |
102 |
101 // release a process or core |
103 // release a process or core |
102 void Prelease(struct ps_prochandle* ph); |
104 JNIEXPORT void |
|
105 Prelease(struct ps_prochandle* ph); |
103 |
106 |
104 // functions not directly available in Solaris libproc |
107 // functions not directly available in Solaris libproc |
105 |
108 |
106 // initialize libproc (call this only once per app) |
109 // initialize libproc (call this only once per app) |
107 // pass true to make library verbose |
110 // pass true to make library verbose |
108 bool init_libproc(bool verbose); |
111 JNIEXPORT bool |
|
112 init_libproc(bool verbose); |
109 |
113 |
110 // get number of threads |
114 // get number of threads |
111 int get_num_threads(struct ps_prochandle* ph); |
115 int get_num_threads(struct ps_prochandle* ph); |
112 |
116 |
113 // get lwp_id of n'th thread |
117 // get lwp_id of n'th thread |