Revert "Add Perfetto library (gn & bazel) and bare-bones SkPerfTrace class"

This reverts commit bfc9b94840.

Reason for revert: new dependency causing Android build error

Original change's description:
> Add Perfetto library (gn & bazel) and bare-bones SkPerfTrace class
>
> First incremental step to incorporating Perfetto tracing into Skia, more CLs to follow
>
> NOTE: The presubmit check is failing. This appears to be due to the known issue where the presubmit check bugs out if the DEPS file is edited, which it was on this CL (modified to include Perfetto).
>
> Bug: skia:13303
> Change-Id: I908be0392b520e8da14b34588b842bf6d955bd93
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/543081
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Nicolette Prevost <nicolettep@google.com>

Bug: skia:13303
Change-Id: Ia2b883bbab1f8fb4f3914b63104a39240cc60e86
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/544239
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Auto-Submit: Tyler Denniston <tdenniston@google.com>
Reviewed-by: Nicolette Prevost <nicolettep@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
This commit is contained in:
Tyler Denniston 2022-05-26 15:06:14 +00:00
parent 6a67f1f40f
commit d78d52a86f
10 changed files with 1 additions and 176 deletions

View File

@ -1951,14 +1951,6 @@ if (skia_enable_tools) {
"tools/trace/SkDebugfTracer.cpp",
"tools/trace/SkDebugfTracer.h",
]
if (skia_use_perfetto) {
deps += [ "//third_party/perfetto" ]
sources += [
"tools/trace/SkPerfettoTrace.cpp",
"tools/trace/SkPerfettoTrace.h",
]
defines = [ "SK_USE_PERFETTO" ]
}
}
test_lib("tool_utils") {

1
DEPS
View File

@ -37,7 +37,6 @@ deps = {
"third_party/externals/opengl-registry" : "https://skia.googlesource.com/external/github.com/KhronosGroup/OpenGL-Registry@14b80ebeab022b2c78f84a573f01028c96075553",
"third_party/externals/piex" : "https://android.googlesource.com/platform/external/piex.git@bb217acdca1cc0c16b704669dd6f91a1b509c406",
"third_party/externals/rive" : "https://skia.googlesource.com/external/github.com/rive-app/rive-cpp.git@2e80e5803390f16e5047c8e15ab78f7a1d846856",
"third_party/externals/perfetto" : "https://android.googlesource.com/platform/external/perfetto@d5b124f8a69f517e91514135e8dfc4c995d34c36",
"third_party/externals/sfntly" : "https://chromium.googlesource.com/external/github.com/googlei18n/sfntly.git@b55ff303ea2f9e26702b514cf6a3196a2e3e2974",
"third_party/externals/swiftshader" : "https://swiftshader.googlesource.com/SwiftShader@b5cb037f029213553f194ca4203d6d3c03639ebc",
"third_party/externals/vulkanmemoryallocator" : "https://chromium.googlesource.com/external/github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator@7de5cc00de50e71a3aab22dea52fbb7ff4efceb6",

View File

@ -230,10 +230,3 @@ new_local_repository(
path = "third_party/externals/vulkan-tools",
workspace_file_content = "",
)
new_local_repository(
name = "perfetto",
build_file = "bazel/external/perfetto/BUILD.bazel",
path = "third_party/externals/perfetto",
workspace_file_content = "",
)

View File

@ -1,13 +0,0 @@
# This file will be copied into //third_party/externals/perfetto via the
# new_local_repository rule in WORKSPACE.bazel, so all files should be relative to that path.
cc_library(
name = "perfetto",
hdrs = [
"sdk/perfetto.h",
],
srcs = [ "sdk/perfetto.cc" ],
includes = ["sdk"],
visibility = ["//visibility:public"],
defines = [ "SK_USE_PERFETTO" ],
)

View File

@ -62,7 +62,6 @@ declare_args() {
skia_use_lua = is_skia_dev_build && !is_ios
skia_use_metal = false
skia_use_ndk_images = is_android && defined(ndk_api) && ndk_api >= 30
skia_use_perfetto = is_linux || is_mac || is_android
skia_use_piex = !is_win && !is_wasm
skia_use_sfml = false
skia_use_webgl = is_wasm

View File

@ -1,14 +0,0 @@
# Copyright 2022 Google LLC
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("../third_party.gni")
third_party("perfetto") {
public_include_dirs = [
".",
"../externals/perfetto/sdk",
]
sources = [ "../externals/perfetto/sdk/perfetto.cc" ]
}

View File

@ -47,7 +47,6 @@ generated_cc_atom(
":ChromeTracingTracer_hdr",
":EventTracingPriv_hdr",
":SkDebugfTracer_hdr",
":SkPerfettoTrace_hdr",
"//include/utils:SkEventTracer_hdr",
"//src/core:SkATrace_hdr",
"//src/core:SkTraceEvent_hdr",
@ -75,25 +74,3 @@ generated_cc_atom(
"//src/core:SkTraceEvent_hdr",
],
)
generated_cc_atom(
name = "SkPerfettoTrace_hdr",
hdrs = ["SkPerfettoTrace.h"],
visibility = ["//:__subpackages__"],
deps = [
":EventTracingPriv_hdr",
"//include/utils:SkEventTracer_hdr",
"//third_party/externals/perfetto/sdk:perfetto_hdr",
],
)
generated_cc_atom(
name = "SkPerfettoTrace_src",
srcs = ["SkPerfettoTrace.cpp"],
visibility = ["//:__subpackages__"],
deps = [
":SkPerfettoTrace_hdr",
"//src/core:SkTraceEventCommon_hdr",
"//src/core:SkTraceEvent_hdr",
],
)

View File

@ -13,16 +13,12 @@
#include "tools/flags/CommandLineFlags.h"
#include "tools/trace/ChromeTracingTracer.h"
#include "tools/trace/SkDebugfTracer.h"
#if defined(SK_USE_PERFETTO)
#include "tools/trace/SkPerfettoTrace.h"
#endif
static DEFINE_string(trace,
"",
"Log trace events in one of several modes:\n"
" debugf : Show events using SkDebugf\n"
" atrace : Send events to Android ATrace\n"
" perfetto : Send events to Perfetto (Linux, Android, and Mac only)\n"
" <filename> : Any other string is interpreted as a filename. Writes\n"
" trace events to specified file as JSON, for viewing\n"
" with chrome://tracing");
@ -45,18 +41,7 @@ void initializeEventTracingForTools(const char* traceFlag) {
eventTracer = new SkATrace();
} else if (0 == strcmp(traceFlag, "debugf")) {
eventTracer = new SkDebugfTracer();
}
else if (0 == strcmp(traceFlag, "perfetto")) {
#if defined(SK_USE_PERFETTO)
eventTracer = new SkPerfettoTrace();
#else
SkDebugf("Perfetto is not enabled (SK_USE_PERFETTO is false). "
"Perfetto tracing will not be performed.\n"
"Tracing with Perfetto is only enabled for Linux, Android, and Mac.");
return;
#endif
}
else {
} else {
eventTracer = new ChromeTracingTracer(traceFlag);
}

View File

@ -1,43 +0,0 @@
/*
* Copyright 2022 Google LLC
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "src/core/SkTraceEvent.h"
#include "src/core/SkTraceEventCommon.h"
#include "tools/trace/SkPerfettoTrace.h"
PERFETTO_TRACK_EVENT_STATIC_STORAGE();
SkPerfettoTrace::SkPerfettoTrace() {
}
SkPerfettoTrace::~SkPerfettoTrace() {
}
SkEventTracer::Handle SkPerfettoTrace::addTraceEvent(char phase,
const uint8_t* categoryEnabledFlag,
const char* name,
uint64_t id,
int numArgs,
const char** argNames,
const uint8_t* argTypes,
const uint64_t* argValues,
uint8_t flags) {
return 0;
}
void SkPerfettoTrace::updateTraceEventDuration(const uint8_t* categoryEnabledFlag,
const char* name,
SkEventTracer::Handle handle) {
}
const uint8_t* SkPerfettoTrace::getCategoryGroupEnabled(const char* name) {
return fCategories.getCategoryGroupEnabled(name);
}
const char* SkPerfettoTrace::getCategoryGroupName(const uint8_t* categoryEnabledFlag) {
return fCategories.getCategoryGroupName(categoryEnabledFlag);
}

View File

@ -1,50 +0,0 @@
/*
* Copyright 2022 Google LLC
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkPerfettoTrace_DEFINED
#define SkPerfettoTrace_DEFINED
#include "include/utils/SkEventTracer.h"
#include "tools/trace/EventTracingPriv.h"
#include "third_party/externals/perfetto/sdk/perfetto.h"
PERFETTO_DEFINE_CATEGORIES();
/**
* This class is used to support Perfetto tracing. It hooks into the SkEventTracer system.
*/
class SkPerfettoTrace : public SkEventTracer {
public:
SkPerfettoTrace();
~SkPerfettoTrace() override;
SkEventTracer::Handle addTraceEvent(char phase,
const uint8_t* categoryEnabledFlag,
const char* name,
uint64_t id,
int numArgs,
const char** argNames,
const uint8_t* argTypes,
const uint64_t* argValues,
uint8_t flags) override;
void updateTraceEventDuration(const uint8_t* categoryEnabledFlag,
const char* name,
SkEventTracer::Handle handle) override;
const uint8_t* getCategoryGroupEnabled(const char* name) override;
const char* getCategoryGroupName(const uint8_t* categoryEnabledFlag) override;
private:
SkPerfettoTrace(const SkPerfettoTrace&) = delete;
SkPerfettoTrace& operator=(const SkPerfettoTrace&) = delete;
SkEventTracingCategories fCategories;
};
#endif