aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeon Scroggins III <scroggo@google.com>2022-05-06 13:39:36 -0400
committerSkCQ <skcq-be@skia-corp.google.com.iam.gserviceaccount.com>2022-05-13 14:15:43 +0000
commit21e6e37ee325dcdb3fa99870138e386b330d5dc5 (patch)
treebc24a576e354ec8f519cd9c76f0c422d00b92a04
parenta45d7d634b3c8e893f8451c2038c40bd6d52b59b (diff)
downloadskia-21e6e37ee325dcdb3fa99870138e386b330d5dc5.tar.gz
Android: Turn on select Skia tracepoints
In b/224677119, we found that turning on *all* of Skia tracing caused regressions. We are separately turning it off, but we do find some value in select tracepoints. Add back in the ones we care about. The remaining tracepoints can still be turned on manually with the sysprop. All of these tracepoints are already traced on other platforms (e.g. Chrome, Flutter). Convert them to TRACE_EVENT0_ALWAYS, introduced in I13fd77445e0d2a05e46b75629b37bab5f571b02e. (A better long term solution will be to use categories, as tracked in b/232405757.) For GrOps, we had an Android-specific tracepoint, added in I18ac03676da058ba4af5bd6a0c375b3f17c3c399, as well as separate TRACE_EVENT0 tracepoints with basically the same timing and label. Remove the Android-specific version, and make the other one TRACE_EVENT0_ALWAYS. This removes redundant child-parent pairs. Bug: 231627558 Bug: 224677119 Bug: 232226246 Test: manual Change-Id: I03ce62062a0bde723d3b6ac026bd978b249ad9a4 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/540167 Auto-Submit: Leon Scroggins <scroggo@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
-rw-r--r--src/gpu/ops/GrOp.h6
-rw-r--r--src/gpu/ops/OpsTask.cpp11
-rw-r--r--src/gpu/vk/GrVkAMDMemoryAllocator.cpp2
-rw-r--r--src/gpu/vk/GrVkPipeline.cpp2
4 files changed, 7 insertions, 14 deletions
diff --git a/src/gpu/ops/GrOp.h b/src/gpu/ops/GrOp.h
index 6b3a173adc..123731ddfc 100644
--- a/src/gpu/ops/GrOp.h
+++ b/src/gpu/ops/GrOp.h
@@ -173,7 +173,7 @@ public:
void prePrepare(GrRecordingContext* context, const GrSurfaceProxyView& dstView,
GrAppliedClip* clip, const GrDstProxyView& dstProxyView,
GrXferBarrierFlags renderPassXferBarriers, GrLoadOp colorLoadOp) {
- TRACE_EVENT0("skia.gpu", name());
+ TRACE_EVENT0_ALWAYS("skia.gpu", name());
this->onPrePrepare(context, dstView, clip, dstProxyView, renderPassXferBarriers,
colorLoadOp);
}
@@ -183,13 +183,13 @@ public:
* necessary before execute() is called.
*/
void prepare(GrOpFlushState* state) {
- TRACE_EVENT0("skia.gpu", name());
+ TRACE_EVENT0_ALWAYS("skia.gpu", name());
this->onPrepare(state);
}
/** Issues the op's commands to GrGpu. */
void execute(GrOpFlushState* state, const SkRect& chainBounds) {
- TRACE_EVENT0("skia.gpu", name());
+ TRACE_EVENT0_ALWAYS("skia.gpu", name());
this->onExecute(state, chainBounds);
}
diff --git a/src/gpu/ops/OpsTask.cpp b/src/gpu/ops/OpsTask.cpp
index c691ceff06..a596fba52c 100644
--- a/src/gpu/ops/OpsTask.cpp
+++ b/src/gpu/ops/OpsTask.cpp
@@ -501,16 +501,13 @@ void OpsTask::onPrepare(GrOpFlushState* flushState) {
(fClippedContentBounds.isEmpty() && fColorLoadOp != GrLoadOp::kDiscard)) {
return;
}
- TRACE_EVENT0("skia.gpu", TRACE_FUNC);
+ TRACE_EVENT0_ALWAYS("skia.gpu", TRACE_FUNC);
flushState->setSampledProxyArray(&fSampledProxies);
GrSurfaceProxyView dstView(sk_ref_sp(this->target(0)), fTargetOrigin, fTargetSwizzle);
// Loop over the ops that haven't yet been prepared.
for (const auto& chain : fOpChains) {
if (chain.shouldExecute()) {
-#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
- TRACE_EVENT0("skia.gpu", chain.head()->name());
-#endif
GrOpFlushState::OpArgs opArgs(chain.head(),
dstView,
fUsesMSAASurface,
@@ -546,8 +543,7 @@ bool OpsTask::onExecute(GrOpFlushState* flushState) {
if (this->isColorNoOp() || fClippedContentBounds.isEmpty()) {
return false;
}
-
- TRACE_EVENT0("skia.gpu", TRACE_FUNC);
+ TRACE_EVENT0_ALWAYS("skia.gpu", TRACE_FUNC);
// Make sure load ops are not kClear if the GPU needs to use draws for clears
SkASSERT(fColorLoadOp != GrLoadOp::kClear ||
@@ -636,9 +632,6 @@ bool OpsTask::onExecute(GrOpFlushState* flushState) {
if (!chain.shouldExecute()) {
continue;
}
-#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
- TRACE_EVENT0("skia.gpu", chain.head()->name());
-#endif
GrOpFlushState::OpArgs opArgs(chain.head(),
dstView,
diff --git a/src/gpu/vk/GrVkAMDMemoryAllocator.cpp b/src/gpu/vk/GrVkAMDMemoryAllocator.cpp
index 0885aacc12..599c8406db 100644
--- a/src/gpu/vk/GrVkAMDMemoryAllocator.cpp
+++ b/src/gpu/vk/GrVkAMDMemoryAllocator.cpp
@@ -104,7 +104,7 @@ GrVkAMDMemoryAllocator::~GrVkAMDMemoryAllocator() {
VkResult GrVkAMDMemoryAllocator::allocateImageMemory(VkImage image, AllocationPropertyFlags flags,
GrVkBackendMemory* backendMemory) {
- TRACE_EVENT0("skia.gpu", TRACE_FUNC);
+ TRACE_EVENT0_ALWAYS("skia.gpu", TRACE_FUNC);
VmaAllocationCreateInfo info;
info.flags = 0;
info.usage = VMA_MEMORY_USAGE_UNKNOWN;
diff --git a/src/gpu/vk/GrVkPipeline.cpp b/src/gpu/vk/GrVkPipeline.cpp
index 8b61563d0a..d202d2cf84 100644
--- a/src/gpu/vk/GrVkPipeline.cpp
+++ b/src/gpu/vk/GrVkPipeline.cpp
@@ -546,7 +546,7 @@ sk_sp<GrVkPipeline> GrVkPipeline::Make(GrVkGpu* gpu,
VkPipeline vkPipeline;
VkResult err;
{
- TRACE_EVENT0("skia.shaders", "CreateGraphicsPipeline");
+ TRACE_EVENT0_ALWAYS("skia.shaders", "CreateGraphicsPipeline");
#if defined(SK_ENABLE_SCOPED_LSAN_SUPPRESSIONS)
// skia:8712
__lsan::ScopedDisabler lsanDisabler;