diff --git a/dwarf_loader.c b/dwarf_loader.c index 48e1bf0..fc79770 100644 --- a/dwarf_loader.c +++ b/dwarf_loader.c @@ -2791,6 +2791,9 @@ static void *dwarf_cus__process_cu_thread(void *arg) goto out_abort; } + if (dcus->conf->thread_exit && dcus->conf->thread_exit() != 0) + goto out_abort; + return (void *)DWARF_CB_OK; out_abort: return (void *)DWARF_CB_ABORT; diff --git a/dwarves.h b/dwarves.h index 30d33fa..c523993 100644 --- a/dwarves.h +++ b/dwarves.h @@ -37,6 +37,7 @@ struct btf; struct conf_fprintf; /** struct conf_load - load configuration + * @thread_exit - called at the end of a thread, 1st user: BTF encoder dedup * @extra_dbg_info - keep original debugging format extra info * (e.g. DWARF's decl_{line,file}, id, etc) * @fixup_silly_bitfields - Fixup silly things such as "int foo:32;" @@ -47,6 +48,7 @@ struct conf_fprintf; struct conf_load { enum load_steal_kind (*steal)(struct cu *cu, struct conf_load *conf); + int (*thread_exit)(void); void *cookie; char *format_path; int nr_jobs;