File tree Expand file tree Collapse file tree 3 files changed +29
-10
lines changed Expand file tree Collapse file tree 3 files changed +29
-10
lines changed Original file line number Diff line number Diff line change 33#include <assert.h>
44#include <errno.h>
55
6+ #ifdef RPYTHON_VMPROF
7+ #ifdef RPYTHON_LL2CTYPES
8+ /* only for testing: ll2ctypes sets RPY_EXTERN from the command-line */
9+
10+ #else
11+ # include "common_header.h"
12+ # include "structdef.h"
13+ # include "src/threadlocal.h"
14+ # include "rvmprof.h"
15+ # include "forwarddecl.h"
16+ #endif
17+ #endif
18+
19+ #ifdef VMP_SUPPORTS_NATIVE_PROFILING
20+ #include "vmp_stack.h" // reduces warings
21+ #endif
22+
23+
624static volatile int is_enabled = 0 ;
725static long prepare_interval_usec = 0 ;
826static long profile_interval_usec = 0 ;
Original file line number Diff line number Diff line change @@ -131,23 +131,21 @@ struct CallUnrollInfo {
131131// typedef int ucontext_t;
132132// #endif
133133
134- #define GetPC (__SIGNAL_UCONTEXT ) (NULL )
135- // inline intptr_t GetPC(ucontext_t *signal_ucontext) {
136- // // RAW_LOG(ERROR, "GetPC is not yet implemented on Windows\n");
137- // fprintf(stderr, "GetPC is not yet implemented on Windows\n");
138- // return NULL;
139- // }
134+ static intptr_t GetPC (ucontext_t *signal_ucontext) {
135+ // RAW_LOG(ERROR, "GetPC is not yet implemented on Windows\n");
136+ fprintf (stderr, " GetPC is not yet implemented on Windows\n " );
137+ return NULL ;
138+ }
140139
141140// Normal cases. If this doesn't compile, it's probably because
142141// PC_FROM_UCONTEXT is the empty string. You need to figure out
143142// the right value for your system, and add it to the list in
144143// vmrpof_config.h
145144#else
146145
147- #define GetPC (__SIGNAL_UCONTEXT ) (__SIGNAL_UCONTEXT->PC_FROM_UCONTEXT)
148- // inline intptr_t GetPC(ucontext_t *signal_ucontext) {
149- // return signal_ucontext->PC_FROM_UCONTEXT; // defined in config.h
150- // }
146+ static intptr_t GetPC (ucontext_t *signal_ucontext) {
147+ return signal_ucontext->PC_FROM_UCONTEXT ; // defined in config.h
148+ }
151149
152150#endif
153151
Original file line number Diff line number Diff line change 99
1010static mach_port_t mach_task ;
1111#else
12+ #include <stdio.h>
1213#include <stdlib.h>
1314#include <sys/types.h>
1415#include <sys/stat.h>
1516#include <fcntl.h>
17+ #include <unistd.h>
18+ #include <string.h>
1619/* On '''normal''' Unices we can get RSS from '/proc/<pid>/status'. */
1720static int proc_file = -1 ;
1821#endif
You can’t perform that action at this time.
0 commit comments