Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allocate timing counts on-the-fly + support dynamic events #49901

Merged
merged 4 commits into from
Jun 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/julia.expmap
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
_Z24jl_coverage_data_pointerN4llvm9StringRefEi;
_Z22jl_coverage_alloc_lineN4llvm9StringRefEi;
_Z22jl_malloc_data_pointerN4llvm9StringRefEi;
_jl_timing_*;
LLVMExtra*;
JLJIT*;
llvmGetPassPluginInfo;
Expand Down
1 change: 1 addition & 0 deletions src/julia.h
Original file line number Diff line number Diff line change
Expand Up @@ -1982,6 +1982,7 @@ JL_DLLEXPORT void jl_sigatomic_end(void);
// tasks and exceptions -------------------------------------------------------

typedef struct _jl_timing_block_t jl_timing_block_t;
typedef struct _jl_timing_event_t jl_timing_event_t;
typedef struct _jl_excstack_t jl_excstack_t;

// info describing an exception handler
Expand Down
12 changes: 6 additions & 6 deletions src/task.c
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ JL_DLLEXPORT void jl_switch(void) JL_NOTSAFEPOINT_LEAVE JL_NOTSAFEPOINT_ENTER
int finalizers_inhibited = ptls->finalizers_inhibited;
ptls->finalizers_inhibited = 0;

jl_timing_block_t *blk = jl_timing_block_exit_task(ct, ptls);
jl_timing_block_t *blk = jl_timing_block_task_exit(ct, ptls);
ctx_switch(ct);

#ifdef MIGRATE_TASKS
Expand All @@ -666,7 +666,7 @@ JL_DLLEXPORT void jl_switch(void) JL_NOTSAFEPOINT_LEAVE JL_NOTSAFEPOINT_ENTER
0 != ct->ptls &&
0 == ptls->finalizers_inhibited);
ptls->finalizers_inhibited = finalizers_inhibited;
jl_timing_block_enter_task(ct, ptls, blk); (void)blk;
jl_timing_block_task_enter(ct, ptls, blk); (void)blk;

sig_atomic_t other_defer_signal = ptls->defer_signal;
ptls->defer_signal = defer_signal;
Expand Down Expand Up @@ -705,7 +705,7 @@ JL_DLLEXPORT JL_NORETURN void jl_no_exc_handler(jl_value_t *e, jl_task_t *ct)
#define pop_timings_stack() \
jl_timing_block_t *cur_block = ptls->timing_stack; \
while (cur_block && eh->timing_stack != cur_block) { \
cur_block = jl_pop_timing_block(cur_block); \
cur_block = jl_timing_block_pop(cur_block); \
} \
assert(cur_block == eh->timing_stack);
#else
Expand Down Expand Up @@ -1084,7 +1084,7 @@ JL_DLLEXPORT jl_task_t *jl_new_task(jl_function_t *start, jl_value_t *completion
t->ptls = NULL;
t->world_age = ct->world_age;
t->reentrant_timing = 0;
jl_timing_init_task(t);
jl_timing_task_init(t);

#ifdef COPY_STACKS
if (!t->copy_stack) {
Expand Down Expand Up @@ -1221,7 +1221,7 @@ CFI_NORETURN

ct->started = 1;
JL_PROBE_RT_START_TASK(ct);
jl_timing_block_enter_task(ct, ptls, NULL);
jl_timing_block_task_enter(ct, ptls, NULL);
if (jl_atomic_load_relaxed(&ct->_isexception)) {
record_backtrace(ptls, 0);
jl_push_excstack(&ct->excstack, ct->result,
Expand Down Expand Up @@ -1693,7 +1693,7 @@ jl_task_t *jl_init_root_task(jl_ptls_t ptls, void *stack_lo, void *stack_hi)
ct->ctx.asan_fake_stack = NULL;
#endif

jl_timing_block_enter_task(ct, ptls, NULL);
jl_timing_block_task_enter(ct, ptls, NULL);

#ifdef COPY_STACKS
// initialize the base_ctx from which all future copy_stacks will be copies
Expand Down
Loading