src/jdk.hotspot.agent/macosx/native/libsaproc/libproc.h
branchihse-remove-mapfiles-branch
changeset 56109 5bf57be44328
parent 47216 71c04702a3d5
equal deleted inserted replaced
56108:88838a55535b 56109:5bf57be44328
     1 /*
     1 /*
     2  * Copyright (c) 2003, 2013, 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.
    70 #else
    70 #else
    71 #include "asm-sparc/ptrace.h"
    71 #include "asm-sparc/ptrace.h"
    72 #endif
    72 #endif
    73 
    73 
    74 #endif //sparc or sparcv9
    74 #endif //sparc or sparcv9
       
    75 #include "jni.h"
    75 
    76 
    76 // This C bool type must be int for compatibility with BSD calls and
    77 // This C bool type must be int for compatibility with BSD calls and
    77 // it would be a mistake to equivalence it to C++ bool on many platforms
    78 // it would be a mistake to equivalence it to C++ bool on many platforms
    78 typedef int bool;
    79 typedef int bool;
    79 #define true  1
    80 #define true  1
   111 
   112 
   112 struct reg;
   113 struct reg;
   113 struct ps_prochandle;
   114 struct ps_prochandle;
   114 
   115 
   115 // attach to a process
   116 // attach to a process
   116 struct ps_prochandle* Pgrab(pid_t pid);
   117 JNIEXPORT struct ps_prochandle*
       
   118 Pgrab(pid_t pid);
   117 
   119 
   118 // attach to a core dump
   120 // attach to a core dump
   119 struct ps_prochandle* Pgrab_core(const char* execfile, const char* corefile);
   121 JNIEXPORT struct ps_prochandle*
       
   122 Pgrab_core(const char* execfile, const char* corefile);
   120 
   123 
   121 // release a process or core
   124 // release a process or core
   122 void Prelease(struct ps_prochandle* ph);
   125 JNIEXPORT void
       
   126 Prelease(struct ps_prochandle* ph);
   123 
   127 
   124 // functions not directly available in Solaris libproc
   128 // functions not directly available in Solaris libproc
   125 
   129 
   126 // initialize libproc (call this only once per app)
   130 // initialize libproc (call this only once per app)
   127 // pass true to make library verbose
   131 // pass true to make library verbose
   128 bool init_libproc(bool verbose);
   132 JNIEXPORT bool
       
   133 init_libproc(bool verbose);
   129 
   134 
   130 // get number of threads
   135 // get number of threads
   131 int get_num_threads(struct ps_prochandle* ph);
   136 int get_num_threads(struct ps_prochandle* ph);
   132 
   137 
   133 // get lwp_id of n'th thread
   138 // get lwp_id of n'th thread