Skip to content

Commit

Permalink
[Profiler] Avoid too many syscall calls for timer-create-based CPU pr…
Browse files Browse the repository at this point in the history
…ofiler (#6067)
  • Loading branch information
gleocadie authored Sep 24, 2024
1 parent 03b9ea7 commit 599c92f
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 89 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#include <unordered_map>

#include "CallstackProvider.h"
#include "CpuProfilerDisableScope.h"
#include "IConfiguration.h"
#include "Log.h"
#include "ManagedThreadInfo.h"
Expand Down Expand Up @@ -122,11 +121,6 @@ StackSnapshotResultBuffer* LinuxStackFramesCollector::CollectStackSampleImplemen
return GetStackSnapshotResult();
}

// Disable timer_create-based CPU profiler if needed
// When scope goes out of scope, the CPU profiler will be reenabled for
// pThreadInfo thread
auto scope = CpuProfilerDisableScope(pThreadInfo);

_plibrariesInfo->UpdateCache();

std::unique_lock<std::mutex> stackWalkInProgressLock(s_stackWalkInProgressMutex);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
#include <iostream>
#include <sstream>

#ifdef LINUX
#include "CpuProfilerDisableScope.h"
#endif
#include "IAllocationsListener.h"
#include "IContentionListener.h"
#include "Log.h"
Expand Down Expand Up @@ -67,15 +64,6 @@ void ClrEventsParser::ParseEvent(
LPCBYTE eventData
)
{
#ifdef LINUX
auto pThreadInfo = ManagedThreadInfo::CurrentThreadInfo;

// Disable timer_create-based CPU profiler if needed
// When scope goes out of scope, the CPU profiler will be reenabled for
// pThreadInfo thread
auto scope = CpuProfilerDisableScope(pThreadInfo.get());
#endif

if (KEYWORD_GC == (keywords & KEYWORD_GC))
{
ParseGcEvent(timestamp, id, version, cbEventData, eventData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
#include "ClrLifetime.h"
#include "Configuration.h"
#include "ContentionProvider.h"
#ifdef LINUX
#include "CpuProfilerDisableScope.h"
#endif
#include "CpuTimeProvider.h"
#include "DebugInfoStore.h"
#include "EnabledProfilers.h"
Expand Down Expand Up @@ -1814,14 +1811,6 @@ HRESULT STDMETHODCALLTYPE CorProfilerCallback::ExceptionThrown(ObjectID thrownOb

if (_pConfiguration->IsExceptionProfilingEnabled() && _pSsiManager->IsProfilerStarted())
{
#ifdef LINUX
// Disable timer_create-based CPU profiler if needed
// When scope goes out of scope, the CPU profiler will be reenabled for
// pThreadInfo thread

auto pThreadInfo = ManagedThreadInfo::CurrentThreadInfo;
auto scope = CpuProfilerDisableScope(pThreadInfo.get());
#endif
_pExceptionsProvider->OnExceptionThrown(thrownObjectId);
}

Expand Down

0 comments on commit 599c92f

Please sign in to comment.