Skip to content

Commit

Permalink
some changes to timer to try and get it such that performance actuall…
Browse files Browse the repository at this point in the history
…y improves
  • Loading branch information
matthewfl committed Sep 4, 2016
1 parent 239df8a commit ad2b7b0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@


// using timers in addition to number of times it loops to determine what to trace
#ifdef CONF_RELEASE_BUILD
# define CONF_USE_TIMERS
#endif
#define CONF_TIMER_DELAY_MS CONF_BUILD_TOGGLE(0, 5000)
//#ifdef CONF_RELEASE_BUILD
#define CONF_USE_TIMERS
//#endif
#define CONF_TIMER_DELAY_MS CONF_BUILD_TOGGLE(10000, 60000)

#define CONF_ESTIMATE_INSTRUCTIONS

Expand Down
2 changes: 1 addition & 1 deletion src/user_interface.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

// useful for compiling against while not causing any "problems"
//#define DISABLE_REDMAGIC
#define DISABLE_REDMAGIC

// this is define in a .c file instead of .s so that we can
// interface with the -fPIC methods & macros, also need to have @plt at the end
Expand Down
9 changes: 7 additions & 2 deletions src/wrap_malloc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

#include <new>


#include "jit_internal.h"

// we can't direclty use allocators when we are tracing since it might screw with their internal states

// use mmap and mprotect to wrap all alloc options
Expand Down Expand Up @@ -81,7 +84,7 @@ extern "C" void *__wrap_malloc(size_t size) {
BUFFER_SIZES(FIND_BUFFER);

use_real_malloc:
printf("============trying to use real malloc\n");
red_printf("============trying to use real malloc\n");
abort();

return __real_malloc(size);
Expand All @@ -107,8 +110,10 @@ extern "C" void __wrap_free(void *ptr) {

BUFFER_SIZES(FREE_BUFFER);

#ifdef CONF_VERBOSE
if(protected_malloc)
printf("more wtf\n");
red_printf("more wtf\n");
#endif
__real_free(ptr);
}

Expand Down

0 comments on commit ad2b7b0

Please sign in to comment.