Files
rocm-systems/src/core/profiling_lock.h
T
Benjamin Welton 0be3e07388 Only check lock if counter collection is used
Only check the lock if counter collection is being
attempted by the profiler. Not when it is loaded.

SWDEV-474455

Change-Id: Ie14de3c8db57e0cbd279ffca51c333a375ca8654
Signed-off-by: Benjamin Welton <bewelton@amd.com>
2024-07-22 05:24:50 -04:00

26 lines
414 B
C++

#ifndef _SRC_CORE_PROFILING_LOCK_H
#define _SRC_CORE_PROFILING_LOCK_H
#include <atomic>
enum LockMode{
PROFILER_V1_LOCK,
PROFILER_V2_LOCK,
};
class ProfilingLock {
public:
static void Lock(LockMode mode);
~ProfilingLock();
private:
ProfilingLock();
static ProfilingLock *Instance();
const char *lock_file;
const char *pid_file;
std::atomic<bool> already_locked{false};
int lock;
};
#endif