Commit be04c047 by Jamie Madill Committed by Commit Bot

Revert "Add trace event to angle Program compilation API"

This reverts commit 7685a79e. 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/+/2231870Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent ae9d1227
......@@ -10,8 +10,6 @@
#include "libANGLE/WorkerThread.h"
#include "libANGLE/trace.h"
#if (ANGLE_STD_ASYNC_WORKERS == ANGLE_ENABLED)
# include <condition_variable>
# include <future>
......@@ -90,7 +88,7 @@ class AsyncWaitableEvent final : public WaitableEvent
friend class AsyncWorkerPool;
void setFuture(std::future<void> &&future);
// To block wait() when the task is still in queue to be run.
// To block wait() when the task is stil in queue to be run.
// Also to protect the concurrent accesses from both main thread and
// background threads to the member fields.
std::mutex mMutex;
......@@ -107,7 +105,6 @@ void AsyncWaitableEvent::setFuture(std::future<void> &&future)
void AsyncWaitableEvent::wait()
{
ANGLE_TRACE_EVENT0("gpu.angle", "AsyncWaitableEvent::wait");
{
std::unique_lock<std::mutex> lock(mMutex);
mCondition.wait(lock, [this] { return !mIsPending; });
......@@ -189,10 +186,7 @@ void AsyncWorkerPool::checkToRunPendingTasks()
auto closure = task.second;
auto future = std::async(std::launch::async, [closure, this] {
{
ANGLE_TRACE_EVENT0("gpu.angle", "AsyncWorkerPool::RunTask");
(*closure)();
}
(*closure)();
{
std::lock_guard<std::mutex> lock(mMutex);
ASSERT(mRunningThreads != 0);
......
......@@ -9,7 +9,6 @@
#include "libANGLE/renderer/ShaderImpl.h"
#include "libANGLE/Context.h"
#include "libANGLE/trace.h"
namespace rx
{
......@@ -47,7 +46,6 @@ class TranslateTask : public angle::Closure
void operator()() override
{
ANGLE_TRACE_EVENT1("gpu.angle", "TranslateTask::run", "source", mSource);
const char *source = mSource.c_str();
mResult = sh::Compile(mHandle, &source, 1, mOptions);
}
......
......@@ -236,7 +236,7 @@ angle::Result HLSLCompiler::compileToBinary(d3d::Context *context,
HRESULT result = S_OK;
{
ANGLE_TRACE_EVENT1("gpu.angle", "D3DCompile", "source", hlsl);
ANGLE_TRACE_EVENT0("gpu.angle", "D3DCompile");
SCOPED_ANGLE_HISTOGRAM_TIMER("GPU.ANGLE.D3DCompileMS");
result = mD3DCompileFunc(hlsl.c_str(), hlsl.length(), gl::g_fakepath, macros, nullptr,
"main", profile.c_str(), configs[i].flags, 0, &binary,
......@@ -247,7 +247,6 @@ angle::Result HLSLCompiler::compileToBinary(d3d::Context *context,
{
std::string message = static_cast<const char *>(errorMessage->GetBufferPointer());
SafeRelease(errorMessage);
ANGLE_TRACE_EVENT1("gpu.angle", "D3DCompile::Error", "error", errorMessage);
infoLog.appendSanitized(message.c_str());
......
......@@ -29,7 +29,6 @@
#include "libANGLE/renderer/d3d/ShaderExecutableD3D.h"
#include "libANGLE/renderer/d3d/VertexDataManager.h"
#include "libANGLE/renderer/renderer_utils.h"
#include "libANGLE/trace.h"
using namespace angle;
......@@ -899,7 +898,6 @@ class ProgramD3D::LoadBinaryTask : public ProgramD3D::GetExecutableTask
angle::Result run() override
{
ANGLE_TRACE_EVENT0("gpu.angle", "ProgramD3D::LoadBinaryTask::run");
if (!mDataCopySucceeded)
{
mInfoLog << "Failed to copy program binary data to local buffer.";
......@@ -1687,7 +1685,6 @@ class ProgramD3D::GetVertexExecutableTask : public ProgramD3D::GetExecutableTask
GetVertexExecutableTask(ProgramD3D *program) : GetExecutableTask(program) {}
angle::Result run() override
{
ANGLE_TRACE_EVENT0("gpu.angle", "ProgramD3D::GetVertexExecutableTask::run");
if (!mProgram->mState.getAttachedShader(gl::ShaderType::Vertex))
{
return angle::Result::Continue;
......@@ -1715,7 +1712,6 @@ class ProgramD3D::GetPixelExecutableTask : public ProgramD3D::GetExecutableTask
GetPixelExecutableTask(ProgramD3D *program) : GetExecutableTask(program) {}
angle::Result run() override
{
ANGLE_TRACE_EVENT0("gpu.angle", "ProgramD3D::GetPixelExecutableTask::run");
if (!mProgram->mState.getAttachedShader(gl::ShaderType::Fragment))
{
return angle::Result::Continue;
......@@ -1751,7 +1747,6 @@ class ProgramD3D::GetGeometryExecutableTask : public ProgramD3D::GetExecutableTa
angle::Result run() override
{
ANGLE_TRACE_EVENT0("gpu.angle", "ProgramD3D::GetGeometryExecutableTask::run");
// Auto-generate the geometry shader here, if we expect to be using point rendering in
// D3D11.
if (mProgram->usesGeometryShader(mState, gl::PrimitiveMode::Points))
......@@ -1773,7 +1768,6 @@ class ProgramD3D::GetComputeExecutableTask : public ProgramD3D::GetExecutableTas
GetComputeExecutableTask(ProgramD3D *program) : GetExecutableTask(program) {}
angle::Result run() override
{
ANGLE_TRACE_EVENT0("gpu.angle", "ProgramD3D::GetComputeExecutableTask::run");
mProgram->updateCachedImage2DBindLayoutFromComputeShader();
ShaderExecutableD3D *computeExecutable = nullptr;
ANGLE_TRY(mProgram->getComputeExecutableForImage2DBindLayout(this, &computeExecutable,
......@@ -1812,7 +1806,6 @@ class ProgramD3D::GraphicsProgramLinkEvent final : public LinkEvent
angle::Result wait(const gl::Context *context) override
{
ANGLE_TRACE_EVENT0("gpu.angle", "ProgramD3D::GraphicsProgramLinkEvent::wait");
WaitableEvent::WaitMany(&mWaitEvents);
ANGLE_TRY(checkTask(context, mVertexTask.get()));
......@@ -1913,7 +1906,6 @@ class ProgramD3D::ComputeProgramLinkEvent final : public LinkEvent
angle::Result wait(const gl::Context *context) override
{
ANGLE_TRACE_EVENT0("gpu.angle", "ProgramD3D::ComputeProgramLinkEvent::wait");
mWaitEvent->wait();
angle::Result result = mComputeTask->getResult();
......@@ -1933,7 +1925,6 @@ class ProgramD3D::ComputeProgramLinkEvent final : public LinkEvent
std::unique_ptr<LinkEvent> ProgramD3D::compileProgramExecutables(const gl::Context *context,
gl::InfoLog &infoLog)
{
ANGLE_TRACE_EVENT0("gpu.angle", "ProgramD3D::compileProgramExecutables");
// Ensure the compiler is initialized to avoid race conditions.
angle::Result result = mRenderer->ensureHLSLCompilerInitialized(GetImplAs<ContextD3D>(context));
if (result != angle::Result::Continue)
......@@ -1959,7 +1950,6 @@ std::unique_ptr<LinkEvent> ProgramD3D::compileProgramExecutables(const gl::Conte
std::unique_ptr<LinkEvent> ProgramD3D::compileComputeExecutable(const gl::Context *context,
gl::InfoLog &infoLog)
{
ANGLE_TRACE_EVENT0("gpu.angle", "ProgramD3D::compileComputeExecutable");
// Ensure the compiler is initialized to avoid race conditions.
angle::Result result = mRenderer->ensureHLSLCompilerInitialized(GetImplAs<ContextD3D>(context));
if (result != angle::Result::Continue)
......@@ -1992,7 +1982,6 @@ angle::Result ProgramD3D::getComputeExecutableForImage2DBindLayout(
ShaderExecutableD3D **outExecutable,
gl::InfoLog *infoLog)
{
ANGLE_TRACE_EVENT0("gpu.angle", "ProgramD3D::getComputeExecutableForImage2DBindLayout");
if (mCachedComputeExecutableIndex.valid())
{
*outExecutable =
......@@ -2034,7 +2023,6 @@ std::unique_ptr<LinkEvent> ProgramD3D::link(const gl::Context *context,
const gl::ProgramLinkedResources &resources,
gl::InfoLog &infoLog)
{
ANGLE_TRACE_EVENT0("gpu.angle", "ProgramD3D::link");
const auto &data = context->getState();
reset();
......
......@@ -16,7 +16,6 @@
#include "libANGLE/features.h"
#include "libANGLE/renderer/d3d/ProgramD3D.h"
#include "libANGLE/renderer/d3d/RendererD3D.h"
#include "libANGLE/trace.h"
namespace rx
{
......@@ -37,7 +36,6 @@ class TranslateTaskD3D : public angle::Closure
void operator()() override
{
ANGLE_TRACE_EVENT1("gpu.angle", "TranslateTask::run", "source", mSource);
std::vector<const char *> srcStrings;
if (!mSourcePath.empty())
{
......
......@@ -23,7 +23,6 @@
#include "libANGLE/renderer/gl/RendererGL.h"
#include "libANGLE/renderer/gl/ShaderGL.h"
#include "libANGLE/renderer/gl/StateManagerGL.h"
#include "libANGLE/trace.h"
#include "platform/FeaturesGL.h"
#include "platform/PlatformMethods.h"
......@@ -60,7 +59,6 @@ std::unique_ptr<LinkEvent> ProgramGL::load(const gl::Context *context,
gl::BinaryInputStream *stream,
gl::InfoLog &infoLog)
{
ANGLE_TRACE_EVENT0("gpu.angle", "ProgramGL::load");
preLink();
// Read the binary format, size and blob
......@@ -137,12 +135,7 @@ class ProgramGL::LinkTask final : public angle::Closure
LinkTask(LinkImplFunctor &&functor) : mLinkImplFunctor(functor), mFallbackToMainContext(false)
{}
void operator()() override
{
ANGLE_TRACE_EVENT0("gpu.angle", "ProgramGL::LinkTask::run");
mFallbackToMainContext = mLinkImplFunctor(mInfoLog);
}
void operator()() override { mFallbackToMainContext = mLinkImplFunctor(mInfoLog); }
bool fallbackToMainContext() { return mFallbackToMainContext; }
const std::string &getInfoLog() { return mInfoLog; }
......@@ -166,8 +159,6 @@ class ProgramGL::LinkEventNativeParallel final : public LinkEvent
angle::Result wait(const gl::Context *context) override
{
ANGLE_TRACE_EVENT0("gpu.angle", "ProgramGL::LinkEventNativeParallel::wait");
GLint linkStatus = GL_FALSE;
mFunctions->getProgramiv(mProgramID, GL_LINK_STATUS, &linkStatus);
if (linkStatus == GL_TRUE)
......@@ -205,8 +196,6 @@ class ProgramGL::LinkEventGL final : public LinkEvent
angle::Result wait(const gl::Context *context) override
{
ANGLE_TRACE_EVENT0("gpu.angle", "ProgramGL::LinkEventGL::wait");
mWaitableEvent->wait();
return mPostLinkImplFunctor(mLinkTask->fallbackToMainContext(), mLinkTask->getInfoLog());
}
......@@ -223,8 +212,6 @@ std::unique_ptr<LinkEvent> ProgramGL::link(const gl::Context *context,
const gl::ProgramLinkedResources &resources,
gl::InfoLog &infoLog)
{
ANGLE_TRACE_EVENT0("gpu.angle", "ProgramGL::link");
preLink();
if (mState.getAttachedShader(gl::ShaderType::Compute))
......
......@@ -13,7 +13,6 @@
#include "libANGLE/Context.h"
#include "libANGLE/renderer/gl/FunctionsGL.h"
#include "libANGLE/renderer/gl/RendererGL.h"
#include "libANGLE/trace.h"
#include "platform/FeaturesGL.h"
#include <iostream>
......@@ -39,7 +38,6 @@ class TranslateTaskGL : public angle::Closure
void operator()() override
{
ANGLE_TRACE_EVENT1("gpu.angle", "TranslateTaskGL::run", "source", mSource);
const char *source = mSource.c_str();
mResult = sh::Compile(mHandle, &source, 1, mOptions);
if (mResult)
......
......@@ -20,7 +20,5 @@
#define ANGLE_TRACE_EVENT_INSTANT0(CATEGORY, EVENT) \
TRACE_EVENT_INSTANT0(ANGLEPlatformCurrent(), CATEGORY, EVENT)
#define ANGLE_TRACE_EVENT0(CATEGORY, EVENT) TRACE_EVENT0(ANGLEPlatformCurrent(), CATEGORY, EVENT)
#define ANGLE_TRACE_EVENT1(CATEGORY, EVENT, NAME, PARAM) \
TRACE_EVENT1(ANGLEPlatformCurrent(), CATEGORY, EVENT, NAME, PARAM)
#endif // LIBANGLE_TRACE_H_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment