Skip to content

Commit

Permalink
add a couple timing categories to ENABLE_TIMINGS (#30718)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson authored Jan 16, 2019
1 parent b70ad64 commit 7070384
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -2649,6 +2649,7 @@ JL_DLLEXPORT void jl_fill_argnames(jl_array_t *data, jl_array_t *names)

JL_DLLEXPORT int jl_save_incremental(const char *fname, jl_array_t *worklist)
{
JL_TIMING(SAVE_MODULE);
char *tmpfname = strcat(strcpy((char *) alloca(strlen(fname)+8), fname), ".XXXXXX");
ios_t f;
jl_array_t *mod_array = NULL, *udeps = NULL;
Expand Down Expand Up @@ -3045,6 +3046,7 @@ static int trace_method(jl_typemap_entry_t *entry, void *closure)

static jl_value_t *_jl_restore_incremental(ios_t *f, jl_array_t *mod_array)
{
JL_TIMING(LOAD_MODULE);
jl_ptls_t ptls = jl_get_ptls_states();
if (ios_eof(f) || !jl_read_verify_header(f)) {
ios_close(f);
Expand Down
2 changes: 2 additions & 0 deletions src/gf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1597,6 +1597,7 @@ JL_DLLEXPORT void jl_method_table_disable(jl_methtable_t *mt, jl_method_t *metho

JL_DLLEXPORT void jl_method_table_insert(jl_methtable_t *mt, jl_method_t *method, jl_tupletype_t *simpletype)
{
JL_TIMING(ADD_METHOD);
assert(jl_is_method(method));
assert(jl_is_mtable(mt));
jl_value_t *type = method->sig;
Expand Down Expand Up @@ -1801,6 +1802,7 @@ jl_method_instance_t *jl_method_lookup(jl_methtable_t *mt, jl_value_t **args, si
JL_DLLEXPORT jl_value_t *jl_matching_methods(jl_tupletype_t *types, int lim, int include_ambiguous,
size_t world, size_t *min_valid, size_t *max_valid)
{
JL_TIMING(METHOD_MATCH);
jl_value_t *unw = jl_unwrap_unionall((jl_value_t*)types);
if (jl_is_tuple_type(unw) && jl_tparam0(unw) == jl_bottom_type)
return (jl_value_t*)jl_alloc_vec_any(0);
Expand Down
7 changes: 6 additions & 1 deletion src/timing.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ static inline uint64_t rdtscp(void)
X(LLVM_MODULE_FINISH), \
X(LLVM_EMIT), \
X(METHOD_LOOKUP_COMPILE), \
X(METHOD_MATCH), \
X(TYPE_CACHE_LOOKUP), \
X(TYPE_CACHE_INSERT), \
X(STAGED_FUNCTION), \
Expand All @@ -63,7 +64,11 @@ static inline uint64_t rdtscp(void)
X(AST_UNCOMPRESS), \
X(SYSIMG_LOAD), \
X(SYSIMG_DUMP), \
X(NATIVE_DUMP),
X(NATIVE_DUMP), \
X(ADD_METHOD), \
X(LOAD_MODULE), \
X(SAVE_MODULE), \
X(INIT_MODULE),

enum jl_timing_owners {
#define X(name) JL_TIMING_ ## name
Expand Down
1 change: 1 addition & 0 deletions src/toplevel.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ static jl_function_t *jl_module_get_initializer(jl_module_t *m JL_PROPAGATES_ROO

void jl_module_run_initializer(jl_module_t *m)
{
JL_TIMING(INIT_MODULE);
jl_function_t *f = jl_module_get_initializer(m);
if (f == NULL)
return;
Expand Down

0 comments on commit 7070384

Please sign in to comment.