Exemplo n.º 1
0
/* llvm_start_func_profiling - This is the main entry point of the function
 * profiling library.  It is responsible for setting up the atexit handler.
 */
int llvm_start_func_profiling(int argc, const char **argv,
                              unsigned *arrayStart, unsigned numElements) {
  int Ret = save_arguments(argc, argv);
  ArrayStart = arrayStart;
  NumElements = numElements;
  atexit(FuncProfAtExitHandler);
  return Ret;
}
Exemplo n.º 2
0
/* llvm_start_path_profiling - This is the main entry point of the path
 * profiling library.  It is responsible for setting up the atexit handler.
 */
int llvm_start_path_profiling(int argc, const char** argv,
                              void* functionTable, uint32_t numElements) {
  int Ret = save_arguments(argc, argv);
  ft = functionTable;
  ftSize = numElements;
  atexit(pathProfAtExitHandler);

  return Ret;
}
Exemplo n.º 3
0
/* llvm_start_edge_profiling - This is the main entry point of the edge
 * profiling library.  It is responsible for setting up the atexit handler.
 */
int llvm_start_mpi_profiling(int argc, const char **argv,
                              unsigned *arrayStart, unsigned numElements) {
  int Ret = save_arguments(argc, argv);
  ArrayStart = arrayStart;
  NumElements = numElements - FORTRAN_DATATYPE_MAP_SIZE * 2;
  init_datatype_map(ArrayStart + NumElements);
  atexit(MPIProfAtExitHandler);
  return Ret;
}
Exemplo n.º 4
0
/* llvm_start_basic_block_tracing - This is the main entry point of the basic
 * block tracing library.  It is responsible for setting up the atexit
 * handler and allocating the trace buffer.
 */
int llvm_start_basic_block_tracing(int argc, const char **argv,
                              uint64_t *arrayStart,uint64_t numElements) {
  int Ret;
  const unsigned BufferSize = 128 * 1024;
  uint64_t ArraySize;

  Ret = save_arguments(argc, argv);

  /* Allocate a buffer to contain BB tracing data */
  ArraySize = BufferSize / sizeof (uint64_t);
  ArrayStart = malloc (ArraySize * sizeof (uint64_t));
  ArrayEnd = ArrayStart + ArraySize;
  ArrayCursor = ArrayStart;

  /* Set up the atexit handler. */
  atexit (BBTraceAtExitHandler);

  return Ret;
}