#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "gpu/command_buffer/service/gpu_tracer.h"
#include <stddef.h>
#include <stdint.h>
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/task/single_thread_task_runner.h"
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
#include "gpu/command_buffer/service/context_group.h"
#include "gpu/command_buffer/service/decoder_context.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_context.h"
#include "ui/gl/gl_version_info.h"
#include "ui/gl/gpu_timing.h"
namespace gpu {
namespace gles2 {
constexpr const char* kGpuTraceSourceNames[] = …;
static_assert …;
TraceMarker::TraceMarker(const std::string& category, const std::string& name)
: … { … }
TraceMarker::TraceMarker(const TraceMarker& other) = default;
TraceMarker::~TraceMarker() = default;
TraceOutputter::TraceOutputter() : … { … }
TraceOutputter::TraceOutputter(const std::string& name) : … { … }
TraceOutputter::~TraceOutputter() = default;
void TraceOutputter::TraceDevice(GpuTracerSource source,
const std::string& category,
const std::string& name,
int64_t start_time,
int64_t end_time) { … }
void TraceOutputter::TraceServiceBegin(GpuTracerSource source,
const std::string& category,
const std::string& name) { … }
void TraceOutputter::TraceServiceEnd(GpuTracerSource source,
const std::string& category,
const std::string& name) { … }
GPUTrace::GPUTrace(Outputter* outputter,
gl::GPUTimingClient* gpu_timing_client,
const GpuTracerSource source,
const std::string& category,
const std::string& name,
const bool tracing_service,
const bool tracing_device)
: … { … }
GPUTrace::~GPUTrace() = default;
void GPUTrace::Destroy(bool have_context) { … }
void GPUTrace::Start() { … }
void GPUTrace::End() { … }
bool GPUTrace::IsAvailable() { … }
void GPUTrace::Process() { … }
GPUTracer::GPUTracer(DecoderContext* decoder, bool context_is_gl)
: … { … }
GPUTracer::~GPUTracer() = default;
void GPUTracer::Destroy(bool have_context) { … }
bool GPUTracer::BeginDecoding() { … }
bool GPUTracer::EndDecoding() { … }
bool GPUTracer::Begin(const std::string& category, const std::string& name,
GpuTracerSource source) { … }
bool GPUTracer::End(GpuTracerSource source) { … }
bool GPUTracer::HasTracesToProcess() { … }
void GPUTracer::ProcessTraces() { … }
bool GPUTracer::IsTracing() { … }
const std::string& GPUTracer::CurrentCategory(GpuTracerSource source) const { … }
const std::string& GPUTracer::CurrentName(GpuTracerSource source) const { … }
bool GPUTracer::CheckDisjointStatus() { … }
void GPUTracer::ClearOngoingTraces(bool have_context) { … }
}
}