mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 18:12:02 +00:00
Fix TSan tests
This commit is contained in:
parent
eb5e577f14
commit
354ceeda80
@ -81,11 +81,11 @@ QueryProfilerBase<ProfilerImpl>::QueryProfilerBase(const Int32 thread_id, const
|
|||||||
sev.sigev_notify = SIGEV_THREAD_ID;
|
sev.sigev_notify = SIGEV_THREAD_ID;
|
||||||
sev.sigev_signo = pause_signal;
|
sev.sigev_signo = pause_signal;
|
||||||
|
|
||||||
#if defined(__FreeBSD__)
|
# if defined(__FreeBSD__)
|
||||||
sev._sigev_un._threadid = thread_id;
|
sev._sigev_un._threadid = thread_id;
|
||||||
#else
|
# else
|
||||||
sev._sigev_un._tid = thread_id;
|
sev._sigev_un._tid = thread_id;
|
||||||
#endif
|
# endif
|
||||||
if (timer_create(clock_type, &sev, &timer_id))
|
if (timer_create(clock_type, &sev, &timer_id))
|
||||||
throwFromErrno("Failed to create thread timer", ErrorCodes::CANNOT_CREATE_TIMER);
|
throwFromErrno("Failed to create thread timer", ErrorCodes::CANNOT_CREATE_TIMER);
|
||||||
|
|
||||||
|
@ -154,6 +154,11 @@ void ThreadStatus::finalizePerformanceCounters()
|
|||||||
|
|
||||||
void ThreadStatus::initQueryProfiler()
|
void ThreadStatus::initQueryProfiler()
|
||||||
{
|
{
|
||||||
|
#if !defined(USE_PHDR_CACHE)
|
||||||
|
/// FIXME: query profiler won't work without PHDR cache.
|
||||||
|
/// Refactor code for a better detection without macros.
|
||||||
|
return;
|
||||||
|
#else
|
||||||
/// query profilers are useless without trace collector
|
/// query profilers are useless without trace collector
|
||||||
if (!global_context)
|
if (!global_context)
|
||||||
return;
|
return;
|
||||||
@ -169,6 +174,7 @@ void ThreadStatus::initQueryProfiler()
|
|||||||
query_profiler_cpu = std::make_unique<QueryProfilerCpu>(
|
query_profiler_cpu = std::make_unique<QueryProfilerCpu>(
|
||||||
/* thread_id */ os_thread_id,
|
/* thread_id */ os_thread_id,
|
||||||
/* period */ static_cast<UInt32>(settings.query_profiler_cpu_time_period_ns));
|
/* period */ static_cast<UInt32>(settings.query_profiler_cpu_time_period_ns));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void ThreadStatus::finalizeQueryProfiler()
|
void ThreadStatus::finalizeQueryProfiler()
|
||||||
|
Loading…
Reference in New Issue
Block a user