Skip to content

Commit 9cfaa5b

Browse files
committed
fixup! Merge pull request python#36 from tiran/perf-file
1 parent 7f9f6cd commit 9cfaa5b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Objects/perf_trampoline.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ static perf_status_t perf_status = PERF_STATUS_NO_INIT;
4949
static Py_ssize_t extra_code_index = -1;
5050
static code_arena_t *code_arena;
5151
static trampoline_api_t trampoline_api;
52-
static FILE *perf_map_file;
5352

53+
static FILE *perf_map_file;
5454
void*
5555
_Py_perf_map_get_file(void)
5656
{
@@ -97,7 +97,7 @@ void
9797
_Py_perf_map_write_entry(void* state, const void *code_addr,
9898
unsigned int code_size, PyCodeObject* co)
9999
{
100-
assert(file != NULL);
100+
assert(state != NULL);
101101
FILE *method_file = (FILE*)state;
102102
const char* entry = PyUnicode_AsUTF8(co->co_qualname);
103103
if (entry == NULL) {
@@ -250,6 +250,7 @@ int _PyPerfTrampoline_SetCallbacks(
250250
trampoline_state_write write_state,
251251
trampoline_state_free free_state
252252
) {
253+
#ifdef HAVE_PERF_TRAMPOLINE
253254
if (trampoline_api.state) {
254255
Py_FatalError("Trampoline state already initialized");
255256
return -1;
@@ -263,6 +264,7 @@ int _PyPerfTrampoline_SetCallbacks(
263264
}
264265
trampoline_api.state = state;
265266
perf_status = PERF_STATUS_OK;
267+
#endif
266268
return 0;
267269
}
268270

0 commit comments

Comments
 (0)