Skip to content

Commit b207369

Browse files
Remove reliance on papi.h when building without PAPI
Previously papi.h was needed by drhook_papi.h, even when building without PAPI. Now it is only needed when PAPI is requested as the type is defined locally.
1 parent 7558ac5 commit b207369

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/fiat/drhook/drhook.c

+8-1
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,19 @@ static int backtrace(void **buffer, int size) { return 0; }
8282
#include <sys/stat.h>
8383
#include <fcntl.h>
8484
#include <dlfcn.h>
85+
86+
// Extension headers
8587
#ifdef DR_HOOK_HAVE_NVTX
8688
#include "dr_hook_nvtx.h"
8789
#endif
90+
#ifdef DR_HOOK_HAVE_PAPI
91+
#include "drhook_papi.h"
92+
#else
93+
// This type is in the signature of remove_calltree()
94+
#define long_long long long
95+
#endif
8896

8997
#include "ec_get_cycles.h"
90-
#include "drhook_papi.h"
9198
static long long int *thread_cycles = NULL;
9299

93100
int drhook_lhook = 1; // NOTE: A global variable !!

src/fiat/drhook/extensions/papi/drhook_papi.h

-2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,4 @@ void drhook_papi_bzero(long_long* a);
4444

4545
void drhook_papi_print(char* s, long_long* a, int header);
4646

47-
#else
48-
#define long_long long long
4947
#endif

0 commit comments

Comments
 (0)