LLVM OpenMP 20.0.0git
|
#include <algorithm>
#include <atomic>
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <dlfcn.h>
#include <inttypes.h>
#include <iostream>
#include <list>
#include <mutex>
#include <sstream>
#include <string>
#include <sys/resource.h>
#include <unistd.h>
#include <unordered_map>
#include <vector>
#include "omp-tools.h"
Go to the source code of this file.
Macros | |
#define | __STDC_FORMAT_MACROS |
#define | KMP_FALLTHROUGH() ((void)0) |
#define | DECLARE_TSAN_FUNCTION(name, ...) static void (*name)(__VA_ARGS__) = __ompt_tsan_func<__VA_ARGS__>; |
#define | TsanHappensBefore(cv) AnnotateHappensBefore(__FILE__, __LINE__, cv) |
#define | TsanHappensAfter(cv) AnnotateHappensAfter(__FILE__, __LINE__, cv) |
#define | TsanIgnoreWritesBegin() AnnotateIgnoreWritesBegin(__FILE__, __LINE__) |
#define | TsanIgnoreWritesEnd() AnnotateIgnoreWritesEnd(__FILE__, __LINE__) |
#define | TsanDeleteClock(cv) |
#define | TsanNewMemory(addr, size) AnnotateNewMemory(__FILE__, __LINE__, addr, size) |
#define | TsanFreeMemory(addr, size) AnnotateNewMemory(__FILE__, __LINE__, addr, size) |
#define | TsanFuncEntry(pc) __tsan_func_entry(pc) |
#define | TsanFuncExit() __tsan_func_exit() |
#define | SET_OPTIONAL_CALLBACK_T(event, type, result, level) |
#define | SET_CALLBACK_T(event, type) |
#define | SET_CALLBACK(event) SET_CALLBACK_T(event, event) |
#define | findTsanFunction(f, fSig) |
#define | findTsanFunctionSilent(f, fSig) f = fSig dlsym(RTLD_DEFAULT, #f) |
Typedefs | |
typedef char | ompt_tsan_clockid |
Functions | |
template<typename... Args> | |
static void | __ompt_tsan_func (Args...) |
DECLARE_TSAN_FUNCTION (AnnotateHappensAfter, const char *, int, const volatile void *) DECLARE_TSAN_FUNCTION(AnnotateHappensBefore | |
const char const volatile void * | DECLARE_TSAN_FUNCTION (AnnotateNewMemory, const char *, int, const volatile void *, size_t) static int(*RunningOnValgrind)(void) |
static uint64_t | my_next_id () |
static TaskData * | ToTaskData (ompt_data_t *task_data) |
static void | ompt_tsan_thread_begin (ompt_thread_t thread_type, ompt_data_t *thread_data) |
static void | ompt_tsan_thread_end (ompt_data_t *thread_data) |
static void | ompt_tsan_parallel_begin (ompt_data_t *parent_task_data, const ompt_frame_t *parent_task_frame, ompt_data_t *parallel_data, uint32_t requested_team_size, int flag, const void *codeptr_ra) |
OMPT event callbacks for handling parallel regions. | |
static void | ompt_tsan_parallel_end (ompt_data_t *parallel_data, ompt_data_t *task_data, int flag, const void *codeptr_ra) |
static void | ompt_tsan_implicit_task (ompt_scope_endpoint_t endpoint, ompt_data_t *parallel_data, ompt_data_t *task_data, unsigned int team_size, unsigned int thread_num, int type) |
static void | ompt_tsan_sync_region (ompt_sync_region_t kind, ompt_scope_endpoint_t endpoint, ompt_data_t *parallel_data, ompt_data_t *task_data, const void *codeptr_ra) |
static void | ompt_tsan_reduction (ompt_sync_region_t kind, ompt_scope_endpoint_t endpoint, ompt_data_t *parallel_data, ompt_data_t *task_data, const void *codeptr_ra) |
static void | ompt_tsan_task_create (ompt_data_t *parent_task_data, const ompt_frame_t *parent_frame, ompt_data_t *new_task_data, int type, int has_dependences, const void *codeptr_ra) |
OMPT event callbacks for handling tasks. | |
static void | freeTask (TaskData *task) |
static void | releaseDependencies (TaskData *task) |
static void | acquireDependencies (TaskData *task) |
static void | completeTask (TaskData *FromTask) |
static void | suspendTask (TaskData *FromTask) |
static void | switchTasks (TaskData *FromTask, TaskData *ToTask) |
static void | endTask (TaskData *FromTask) |
static void | startTask (TaskData *ToTask) |
static void | ompt_tsan_task_schedule (ompt_data_t *first_task_data, ompt_task_status_t prior_task_status, ompt_data_t *second_task_data) |
static void | ompt_tsan_dependences (ompt_data_t *task_data, const ompt_dependence_t *deps, int ndeps) |
static void | ompt_tsan_mutex_acquired (ompt_mutex_t kind, ompt_wait_id_t wait_id, const void *codeptr_ra) |
OMPT event callbacks for handling locking. | |
static void | ompt_tsan_mutex_released (ompt_mutex_t kind, ompt_wait_id_t wait_id, const void *codeptr_ra) |
static int | ompt_tsan_initialize (ompt_function_lookup_t lookup, int device_num, ompt_data_t *tool_data) |
static void | ompt_tsan_finalize (ompt_data_t *tool_data) |
ompt_start_tool_result_t * | ompt_start_tool (unsigned int omp_version, const char *runtime_version) |
Variables | |
static int | hasReductionCallback |
static ArcherFlags * | archer_flags |
const char | int |
static ompt_get_parallel_info_t | ompt_get_parallel_info |
Required OMPT inquiry functions. | |
static ompt_get_thread_data_t | ompt_get_thread_data |
static int | pagesize {0} |
static std::unordered_map< ompt_wait_id_t, std::mutex > | Locks |
Store a mutex for each wait_id to resolve race condition with callbacks. | |
static std::mutex | LocksMutex |
#define __STDC_FORMAT_MACROS |
Definition at line 14 of file ompt-tsan.cpp.
#define DECLARE_TSAN_FUNCTION | ( | name, | |
... | |||
) | static void (*name)(__VA_ARGS__) = __ompt_tsan_func<__VA_ARGS__>; |
Definition at line 152 of file ompt-tsan.cpp.
#define findTsanFunction | ( | f, | |
fSig | |||
) |
Definition at line 1153 of file ompt-tsan.cpp.
Definition at line 1162 of file ompt-tsan.cpp.
#define KMP_FALLTHROUGH | ( | ) | ((void)0) |
Definition at line 50 of file ompt-tsan.cpp.
#define SET_CALLBACK | ( | event | ) | SET_CALLBACK_T(event, event) |
Definition at line 1151 of file ompt-tsan.cpp.
Definition at line 1145 of file ompt-tsan.cpp.
Definition at line 1134 of file ompt-tsan.cpp.
#define TsanDeleteClock | ( | cv | ) |
Definition at line 189 of file ompt-tsan.cpp.
Definition at line 194 of file ompt-tsan.cpp.
#define TsanFuncEntry | ( | pc | ) | __tsan_func_entry(pc) |
Definition at line 199 of file ompt-tsan.cpp.
#define TsanFuncExit | ( | ) | __tsan_func_exit() |
Definition at line 200 of file ompt-tsan.cpp.
#define TsanHappensAfter | ( | cv | ) | AnnotateHappensAfter(__FILE__, __LINE__, cv) |
Definition at line 180 of file ompt-tsan.cpp.
#define TsanHappensBefore | ( | cv | ) | AnnotateHappensBefore(__FILE__, __LINE__, cv) |
Definition at line 177 of file ompt-tsan.cpp.
#define TsanIgnoreWritesBegin | ( | ) | AnnotateIgnoreWritesBegin(__FILE__, __LINE__) |
Definition at line 183 of file ompt-tsan.cpp.
#define TsanIgnoreWritesEnd | ( | ) | AnnotateIgnoreWritesEnd(__FILE__, __LINE__) |
Definition at line 186 of file ompt-tsan.cpp.
Definition at line 192 of file ompt-tsan.cpp.
typedef char ompt_tsan_clockid |
Definition at line 206 of file ompt-tsan.cpp.
|
static |
Definition at line 150 of file ompt-tsan.cpp.
|
static |
Definition at line 903 of file ompt-tsan.cpp.
References archer_flags, i, and TsanHappensAfter.
Referenced by ompt_tsan_task_schedule(), and startTask().
|
static |
Definition at line 915 of file ompt-tsan.cpp.
References releaseDependencies(), TsanHappensAfter, and TsanHappensBefore.
Referenced by ompt_tsan_task_schedule().
const char const volatile void * DECLARE_TSAN_FUNCTION | ( | AnnotateNewMemory | , |
const char * | , | ||
int | , | ||
const volatile void * | , | ||
size_t | |||
) |
|
static |
Definition at line 970 of file ompt-tsan.cpp.
Referenced by ompt_tsan_task_schedule().
|
static |
Definition at line 878 of file ompt-tsan.cpp.
Referenced by ompt_tsan_task_schedule().
|
static |
Definition at line 208 of file ompt-tsan.cpp.
References ret.
Referenced by ompt_tsan_thread_begin().
ompt_start_tool_result_t * ompt_start_tool | ( | unsigned int | omp_version, |
const char * | runtime_version | ||
) |
Definition at line 1238 of file ompt-tsan.cpp.
References archer_flags, findTsanFunctionSilent, ompt_start_tool_result, ompt_tsan_finalize(), ompt_tsan_initialize(), and pagesize.
|
static |
Definition at line 1063 of file ompt-tsan.cpp.
References archer_flags, d, i, ret, ToTaskData(), and TsanHappensBefore.
|
static |
Definition at line 1224 of file ompt-tsan.cpp.
References archer_flags, end, and TsanIgnoreWritesEnd.
Referenced by ompt_start_tool().
|
static |
Definition at line 667 of file ompt-tsan.cpp.
References ToTaskData(), TsanFuncEntry, TsanFuncExit, TsanHappensAfter, and type.
|
static |
Definition at line 1164 of file ompt-tsan.cpp.
References archer_flags, findTsanFunction, hasReductionCallback, ompt_get_parallel_info, ompt_get_thread_data, ompt_set_callback, SET_CALLBACK, SET_CALLBACK_T, SET_OPTIONAL_CALLBACK_T, and TsanIgnoreWritesBegin.
Referenced by ompt_start_tool().
|
static |
OMPT event callbacks for handling locking.
Definition at line 1109 of file ompt-tsan.cpp.
References Locks, LocksMutex, and TsanHappensAfter.
|
static |
Definition at line 1123 of file ompt-tsan.cpp.
References Locks, LocksMutex, and TsanHappensBefore.
|
static |
OMPT event callbacks for handling parallel regions.
Definition at line 635 of file ompt-tsan.cpp.
References archer_flags, ToTaskData(), TsanHappensBefore, and TsanIgnoreWritesEnd.
|
static |
Definition at line 648 of file ompt-tsan.cpp.
References archer_flags, ToTaskData(), TsanHappensAfter, and TsanIgnoreWritesBegin.
|
static |
Definition at line 810 of file ompt-tsan.cpp.
References TsanIgnoreWritesBegin, and TsanIgnoreWritesEnd.
|
static |
Definition at line 703 of file ompt-tsan.cpp.
References hasReductionCallback, KMP_FALLTHROUGH, ToTaskData(), TsanFuncEntry, TsanFuncExit, TsanHappensAfter, TsanHappensBefore, TsanIgnoreWritesBegin, and TsanIgnoreWritesEnd.
|
static |
OMPT event callbacks for handling tasks.
Definition at line 844 of file ompt-tsan.cpp.
References ompt_get_parallel_info, ToTaskData(), TsanHappensBefore, and type.
|
static |
Definition at line 988 of file ompt-tsan.cpp.
References acquireDependencies(), completeTask(), endTask(), freeTask(), startTask(), suspendTask(), switchTasks(), ToTaskData(), TsanHappensAfter, and TsanHappensBefore.
|
static |
Definition at line 607 of file ompt-tsan.cpp.
References my_next_id(), and TsanNewMemory.
|
static |
Definition at line 624 of file ompt-tsan.cpp.
References TsanIgnoreWritesBegin, and TsanIgnoreWritesEnd.
|
static |
Definition at line 890 of file ompt-tsan.cpp.
References archer_flags, i, and TsanHappensBefore.
Referenced by completeTask().
|
static |
Definition at line 975 of file ompt-tsan.cpp.
References acquireDependencies(), and TsanHappensAfter.
Referenced by ompt_tsan_task_schedule().
|
static |
Definition at line 942 of file ompt-tsan.cpp.
References TsanHappensBefore.
Referenced by ompt_tsan_task_schedule().
|
static |
Definition at line 949 of file ompt-tsan.cpp.
References hasReductionCallback, TsanIgnoreWritesBegin, and TsanIgnoreWritesEnd.
Referenced by ompt_tsan_task_schedule().
|
inlinestatic |
Definition at line 597 of file ompt-tsan.cpp.
Referenced by ompt_tsan_dependences(), ompt_tsan_implicit_task(), ompt_tsan_parallel_begin(), ompt_tsan_parallel_end(), ompt_tsan_sync_region(), ompt_tsan_task_create(), and ompt_tsan_task_schedule().
|
static |
Definition at line 146 of file ompt-tsan.cpp.
Referenced by acquireDependencies(), ompt_start_tool(), ompt_tsan_dependences(), ompt_tsan_finalize(), ompt_tsan_initialize(), ompt_tsan_parallel_begin(), ompt_tsan_parallel_end(), and releaseDependencies().
|
static |
Definition at line 53 of file ompt-tsan.cpp.
Referenced by ompt_tsan_initialize(), ompt_tsan_sync_region(), and switchTasks().
const char int |
Definition at line 161 of file ompt-tsan.cpp.
|
static |
Store a mutex for each wait_id to resolve race condition with callbacks.
Definition at line 604 of file ompt-tsan.cpp.
Referenced by ompt_tsan_mutex_acquired(), and ompt_tsan_mutex_released().
|
static |
Definition at line 605 of file ompt-tsan.cpp.
Referenced by ompt_tsan_mutex_acquired(), and ompt_tsan_mutex_released().
|
static |
Required OMPT inquiry functions.
Definition at line 203 of file ompt-tsan.cpp.
Referenced by ompt_tsan_initialize(), and ompt_tsan_task_create().
|
static |
Definition at line 204 of file ompt-tsan.cpp.
Referenced by ompt_tsan_initialize().
|
static |
Definition at line 214 of file ompt-tsan.cpp.
Referenced by ompt_start_tool().