Skip to content

Commit be04c04

Browse files
null77Commit Bot
authored andcommitted
Revert "Add trace event to angle Program compilation API"
This reverts commit 7685a79. Reason for revert: Causing TSAN failures, see issue. Bug: chromium:1091723 Original change's description: > Add trace event to angle Program compilation API > > Bug: chromium:1064662 > Change-Id: I2ee48718ff3946ab9307ba27177a02858bf436b0 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2230789 > Commit-Queue: Etienne Bergeron <etienneb@chromium.org> > Reviewed-by: Jamie Madill <jmadill@chromium.org> TBR=etienneb@chromium.org,jmadill@chromium.org Change-Id: I92148677ac53c1ff7a9bc880e0a0834a03fc92ea No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: chromium:1064662 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2231870 Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
1 parent ae9d122 commit be04c04

File tree

8 files changed

+4
-44
lines changed

8 files changed

+4
-44
lines changed

src/libANGLE/WorkerThread.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
#include "libANGLE/WorkerThread.h"
1212

13-
#include "libANGLE/trace.h"
14-
1513
#if (ANGLE_STD_ASYNC_WORKERS == ANGLE_ENABLED)
1614
# include <condition_variable>
1715
# include <future>
@@ -90,7 +88,7 @@ class AsyncWaitableEvent final : public WaitableEvent
9088
friend class AsyncWorkerPool;
9189
void setFuture(std::future<void> &&future);
9290

93-
// To block wait() when the task is still in queue to be run.
91+
// To block wait() when the task is stil in queue to be run.
9492
// Also to protect the concurrent accesses from both main thread and
9593
// background threads to the member fields.
9694
std::mutex mMutex;
@@ -107,7 +105,6 @@ void AsyncWaitableEvent::setFuture(std::future<void> &&future)
107105

108106
void AsyncWaitableEvent::wait()
109107
{
110-
ANGLE_TRACE_EVENT0("gpu.angle", "AsyncWaitableEvent::wait");
111108
{
112109
std::unique_lock<std::mutex> lock(mMutex);
113110
mCondition.wait(lock, [this] { return !mIsPending; });
@@ -189,10 +186,7 @@ void AsyncWorkerPool::checkToRunPendingTasks()
189186
auto closure = task.second;
190187

191188
auto future = std::async(std::launch::async, [closure, this] {
192-
{
193-
ANGLE_TRACE_EVENT0("gpu.angle", "AsyncWorkerPool::RunTask");
194-
(*closure)();
195-
}
189+
(*closure)();
196190
{
197191
std::lock_guard<std::mutex> lock(mMutex);
198192
ASSERT(mRunningThreads != 0);

src/libANGLE/renderer/ShaderImpl.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include "libANGLE/renderer/ShaderImpl.h"
1010

1111
#include "libANGLE/Context.h"
12-
#include "libANGLE/trace.h"
1312

1413
namespace rx
1514
{
@@ -47,7 +46,6 @@ class TranslateTask : public angle::Closure
4746

4847
void operator()() override
4948
{
50-
ANGLE_TRACE_EVENT1("gpu.angle", "TranslateTask::run", "source", mSource);
5149
const char *source = mSource.c_str();
5250
mResult = sh::Compile(mHandle, &source, 1, mOptions);
5351
}

src/libANGLE/renderer/d3d/HLSLCompiler.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ angle::Result HLSLCompiler::compileToBinary(d3d::Context *context,
236236
HRESULT result = S_OK;
237237

238238
{
239-
ANGLE_TRACE_EVENT1("gpu.angle", "D3DCompile", "source", hlsl);
239+
ANGLE_TRACE_EVENT0("gpu.angle", "D3DCompile");
240240
SCOPED_ANGLE_HISTOGRAM_TIMER("GPU.ANGLE.D3DCompileMS");
241241
result = mD3DCompileFunc(hlsl.c_str(), hlsl.length(), gl::g_fakepath, macros, nullptr,
242242
"main", profile.c_str(), configs[i].flags, 0, &binary,
@@ -247,7 +247,6 @@ angle::Result HLSLCompiler::compileToBinary(d3d::Context *context,
247247
{
248248
std::string message = static_cast<const char *>(errorMessage->GetBufferPointer());
249249
SafeRelease(errorMessage);
250-
ANGLE_TRACE_EVENT1("gpu.angle", "D3DCompile::Error", "error", errorMessage);
251250

252251
infoLog.appendSanitized(message.c_str());
253252

src/libANGLE/renderer/d3d/ProgramD3D.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#include "libANGLE/renderer/d3d/ShaderExecutableD3D.h"
3030
#include "libANGLE/renderer/d3d/VertexDataManager.h"
3131
#include "libANGLE/renderer/renderer_utils.h"
32-
#include "libANGLE/trace.h"
3332

3433
using namespace angle;
3534

@@ -899,7 +898,6 @@ class ProgramD3D::LoadBinaryTask : public ProgramD3D::GetExecutableTask
899898

900899
angle::Result run() override
901900
{
902-
ANGLE_TRACE_EVENT0("gpu.angle", "ProgramD3D::LoadBinaryTask::run");
903901
if (!mDataCopySucceeded)
904902
{
905903
mInfoLog << "Failed to copy program binary data to local buffer.";
@@ -1687,7 +1685,6 @@ class ProgramD3D::GetVertexExecutableTask : public ProgramD3D::GetExecutableTask
16871685
GetVertexExecutableTask(ProgramD3D *program) : GetExecutableTask(program) {}
16881686
angle::Result run() override
16891687
{
1690-
ANGLE_TRACE_EVENT0("gpu.angle", "ProgramD3D::GetVertexExecutableTask::run");
16911688
if (!mProgram->mState.getAttachedShader(gl::ShaderType::Vertex))
16921689
{
16931690
return angle::Result::Continue;
@@ -1715,7 +1712,6 @@ class ProgramD3D::GetPixelExecutableTask : public ProgramD3D::GetExecutableTask
17151712
GetPixelExecutableTask(ProgramD3D *program) : GetExecutableTask(program) {}
17161713
angle::Result run() override
17171714
{
1718-
ANGLE_TRACE_EVENT0("gpu.angle", "ProgramD3D::GetPixelExecutableTask::run");
17191715
if (!mProgram->mState.getAttachedShader(gl::ShaderType::Fragment))
17201716
{
17211717
return angle::Result::Continue;
@@ -1751,7 +1747,6 @@ class ProgramD3D::GetGeometryExecutableTask : public ProgramD3D::GetExecutableTa
17511747

17521748
angle::Result run() override
17531749
{
1754-
ANGLE_TRACE_EVENT0("gpu.angle", "ProgramD3D::GetGeometryExecutableTask::run");
17551750
// Auto-generate the geometry shader here, if we expect to be using point rendering in
17561751
// D3D11.
17571752
if (mProgram->usesGeometryShader(mState, gl::PrimitiveMode::Points))
@@ -1773,7 +1768,6 @@ class ProgramD3D::GetComputeExecutableTask : public ProgramD3D::GetExecutableTas
17731768
GetComputeExecutableTask(ProgramD3D *program) : GetExecutableTask(program) {}
17741769
angle::Result run() override
17751770
{
1776-
ANGLE_TRACE_EVENT0("gpu.angle", "ProgramD3D::GetComputeExecutableTask::run");
17771771
mProgram->updateCachedImage2DBindLayoutFromComputeShader();
17781772
ShaderExecutableD3D *computeExecutable = nullptr;
17791773
ANGLE_TRY(mProgram->getComputeExecutableForImage2DBindLayout(this, &computeExecutable,
@@ -1812,7 +1806,6 @@ class ProgramD3D::GraphicsProgramLinkEvent final : public LinkEvent
18121806

18131807
angle::Result wait(const gl::Context *context) override
18141808
{
1815-
ANGLE_TRACE_EVENT0("gpu.angle", "ProgramD3D::GraphicsProgramLinkEvent::wait");
18161809
WaitableEvent::WaitMany(&mWaitEvents);
18171810

18181811
ANGLE_TRY(checkTask(context, mVertexTask.get()));
@@ -1913,7 +1906,6 @@ class ProgramD3D::ComputeProgramLinkEvent final : public LinkEvent
19131906

19141907
angle::Result wait(const gl::Context *context) override
19151908
{
1916-
ANGLE_TRACE_EVENT0("gpu.angle", "ProgramD3D::ComputeProgramLinkEvent::wait");
19171909
mWaitEvent->wait();
19181910

19191911
angle::Result result = mComputeTask->getResult();
@@ -1933,7 +1925,6 @@ class ProgramD3D::ComputeProgramLinkEvent final : public LinkEvent
19331925
std::unique_ptr<LinkEvent> ProgramD3D::compileProgramExecutables(const gl::Context *context,
19341926
gl::InfoLog &infoLog)
19351927
{
1936-
ANGLE_TRACE_EVENT0("gpu.angle", "ProgramD3D::compileProgramExecutables");
19371928
// Ensure the compiler is initialized to avoid race conditions.
19381929
angle::Result result = mRenderer->ensureHLSLCompilerInitialized(GetImplAs<ContextD3D>(context));
19391930
if (result != angle::Result::Continue)
@@ -1959,7 +1950,6 @@ std::unique_ptr<LinkEvent> ProgramD3D::compileProgramExecutables(const gl::Conte
19591950
std::unique_ptr<LinkEvent> ProgramD3D::compileComputeExecutable(const gl::Context *context,
19601951
gl::InfoLog &infoLog)
19611952
{
1962-
ANGLE_TRACE_EVENT0("gpu.angle", "ProgramD3D::compileComputeExecutable");
19631953
// Ensure the compiler is initialized to avoid race conditions.
19641954
angle::Result result = mRenderer->ensureHLSLCompilerInitialized(GetImplAs<ContextD3D>(context));
19651955
if (result != angle::Result::Continue)
@@ -1992,7 +1982,6 @@ angle::Result ProgramD3D::getComputeExecutableForImage2DBindLayout(
19921982
ShaderExecutableD3D **outExecutable,
19931983
gl::InfoLog *infoLog)
19941984
{
1995-
ANGLE_TRACE_EVENT0("gpu.angle", "ProgramD3D::getComputeExecutableForImage2DBindLayout");
19961985
if (mCachedComputeExecutableIndex.valid())
19971986
{
19981987
*outExecutable =
@@ -2034,7 +2023,6 @@ std::unique_ptr<LinkEvent> ProgramD3D::link(const gl::Context *context,
20342023
const gl::ProgramLinkedResources &resources,
20352024
gl::InfoLog &infoLog)
20362025
{
2037-
ANGLE_TRACE_EVENT0("gpu.angle", "ProgramD3D::link");
20382026
const auto &data = context->getState();
20392027

20402028
reset();

src/libANGLE/renderer/d3d/ShaderD3D.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include "libANGLE/features.h"
1717
#include "libANGLE/renderer/d3d/ProgramD3D.h"
1818
#include "libANGLE/renderer/d3d/RendererD3D.h"
19-
#include "libANGLE/trace.h"
2019

2120
namespace rx
2221
{
@@ -37,7 +36,6 @@ class TranslateTaskD3D : public angle::Closure
3736

3837
void operator()() override
3938
{
40-
ANGLE_TRACE_EVENT1("gpu.angle", "TranslateTask::run", "source", mSource);
4139
std::vector<const char *> srcStrings;
4240
if (!mSourcePath.empty())
4341
{

src/libANGLE/renderer/gl/ProgramGL.cpp

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include "libANGLE/renderer/gl/RendererGL.h"
2424
#include "libANGLE/renderer/gl/ShaderGL.h"
2525
#include "libANGLE/renderer/gl/StateManagerGL.h"
26-
#include "libANGLE/trace.h"
2726
#include "platform/FeaturesGL.h"
2827
#include "platform/PlatformMethods.h"
2928

@@ -60,7 +59,6 @@ std::unique_ptr<LinkEvent> ProgramGL::load(const gl::Context *context,
6059
gl::BinaryInputStream *stream,
6160
gl::InfoLog &infoLog)
6261
{
63-
ANGLE_TRACE_EVENT0("gpu.angle", "ProgramGL::load");
6462
preLink();
6563

6664
// Read the binary format, size and blob
@@ -137,12 +135,7 @@ class ProgramGL::LinkTask final : public angle::Closure
137135
LinkTask(LinkImplFunctor &&functor) : mLinkImplFunctor(functor), mFallbackToMainContext(false)
138136
{}
139137

140-
void operator()() override
141-
{
142-
ANGLE_TRACE_EVENT0("gpu.angle", "ProgramGL::LinkTask::run");
143-
mFallbackToMainContext = mLinkImplFunctor(mInfoLog);
144-
}
145-
138+
void operator()() override { mFallbackToMainContext = mLinkImplFunctor(mInfoLog); }
146139
bool fallbackToMainContext() { return mFallbackToMainContext; }
147140
const std::string &getInfoLog() { return mInfoLog; }
148141

@@ -166,8 +159,6 @@ class ProgramGL::LinkEventNativeParallel final : public LinkEvent
166159

167160
angle::Result wait(const gl::Context *context) override
168161
{
169-
ANGLE_TRACE_EVENT0("gpu.angle", "ProgramGL::LinkEventNativeParallel::wait");
170-
171162
GLint linkStatus = GL_FALSE;
172163
mFunctions->getProgramiv(mProgramID, GL_LINK_STATUS, &linkStatus);
173164
if (linkStatus == GL_TRUE)
@@ -205,8 +196,6 @@ class ProgramGL::LinkEventGL final : public LinkEvent
205196

206197
angle::Result wait(const gl::Context *context) override
207198
{
208-
ANGLE_TRACE_EVENT0("gpu.angle", "ProgramGL::LinkEventGL::wait");
209-
210199
mWaitableEvent->wait();
211200
return mPostLinkImplFunctor(mLinkTask->fallbackToMainContext(), mLinkTask->getInfoLog());
212201
}
@@ -223,8 +212,6 @@ std::unique_ptr<LinkEvent> ProgramGL::link(const gl::Context *context,
223212
const gl::ProgramLinkedResources &resources,
224213
gl::InfoLog &infoLog)
225214
{
226-
ANGLE_TRACE_EVENT0("gpu.angle", "ProgramGL::link");
227-
228215
preLink();
229216

230217
if (mState.getAttachedShader(gl::ShaderType::Compute))

src/libANGLE/renderer/gl/ShaderGL.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include "libANGLE/Context.h"
1414
#include "libANGLE/renderer/gl/FunctionsGL.h"
1515
#include "libANGLE/renderer/gl/RendererGL.h"
16-
#include "libANGLE/trace.h"
1716
#include "platform/FeaturesGL.h"
1817

1918
#include <iostream>
@@ -39,7 +38,6 @@ class TranslateTaskGL : public angle::Closure
3938

4039
void operator()() override
4140
{
42-
ANGLE_TRACE_EVENT1("gpu.angle", "TranslateTaskGL::run", "source", mSource);
4341
const char *source = mSource.c_str();
4442
mResult = sh::Compile(mHandle, &source, 1, mOptions);
4543
if (mResult)

src/libANGLE/trace.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,5 @@
2020
#define ANGLE_TRACE_EVENT_INSTANT0(CATEGORY, EVENT) \
2121
TRACE_EVENT_INSTANT0(ANGLEPlatformCurrent(), CATEGORY, EVENT)
2222
#define ANGLE_TRACE_EVENT0(CATEGORY, EVENT) TRACE_EVENT0(ANGLEPlatformCurrent(), CATEGORY, EVENT)
23-
#define ANGLE_TRACE_EVENT1(CATEGORY, EVENT, NAME, PARAM) \
24-
TRACE_EVENT1(ANGLEPlatformCurrent(), CATEGORY, EVENT, NAME, PARAM)
2523

2624
#endif // LIBANGLE_TRACE_H_

0 commit comments

Comments
 (0)