forked from OSchip/llvm-project
[OMPT] Fix tool initialization returning 0
If tool initialization returns 0, OMPT should not be active. The current implementation provided some callback invocations in this case. Differential Revision: https://reviews.llvm.org/D42709 llvm-svn: 324320
This commit is contained in:
parent
333be329c4
commit
2a20299f91
|
@ -332,6 +332,12 @@ void ompt_post_init() {
|
||||||
ompt_enabled.enabled = !!ompt_start_tool_result->initialize(
|
ompt_enabled.enabled = !!ompt_start_tool_result->initialize(
|
||||||
ompt_fn_lookup, &(ompt_start_tool_result->tool_data));
|
ompt_fn_lookup, &(ompt_start_tool_result->tool_data));
|
||||||
|
|
||||||
|
if (!ompt_enabled.enabled) {
|
||||||
|
// tool not enabled, zero out the bitmap, and done
|
||||||
|
memset(&ompt_enabled, 0, sizeof(ompt_enabled));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ompt_thread_t *root_thread = ompt_get_thread();
|
ompt_thread_t *root_thread = ompt_get_thread();
|
||||||
|
|
||||||
ompt_set_thread_state(root_thread, omp_state_overhead);
|
ompt_set_thread_state(root_thread, omp_state_overhead);
|
||||||
|
|
Loading…
Reference in New Issue