< prev index next >
src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c
Print this page
@ rev 12737 : imported patch alpinefixes-sathreaddb
|
*** 24,34 ****
--- 24,36 ----
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
+ #ifdef INCLUDE_SA_ATTACH
#include <thread_db.h>
+ #endif
#include "libproc_impl.h"
#define SA_ALTROOT "SA_ALTROOT"
int pathmap_open(const char* name) {
*** 114,128 ****
--- 116,132 ----
// initialize libproc
bool init_libproc(bool debug) {
// init debug mode
_libsaproc_debug = debug;
+ #ifdef INCLUDE_SA_ATTACH
// initialize the thread_db library
if (td_init() != TD_OK) {
print_debug("libthread_db's td_init failed\n");
return false;
}
+ #endif
return true;
}
static void destroy_lib_info(struct ps_prochandle* ph) {
*** 271,280 ****
--- 275,285 ----
ph->num_threads++;
return newthr;
}
+ #ifdef INCLUDE_SA_ATTACH
// struct used for client data from thread_db callback
struct thread_db_client_data {
struct ps_prochandle* ph;
thread_info_callback callback;
};
*** 322,332 ****
// delete thread agent
td_ta_delete(thread_agent);
return true;
}
!
// get number of threads
int get_num_threads(struct ps_prochandle* ph) {
return ph->num_threads;
}
--- 327,337 ----
// delete thread agent
td_ta_delete(thread_agent);
return true;
}
! #endif // INCLUDE_SA_ATTACH
// get number of threads
int get_num_threads(struct ps_prochandle* ph) {
return ph->num_threads;
}
< prev index next >