diff options
author | Aaron Vaage <vaage@google.com> | 2024-05-09 17:15:02 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2024-05-09 17:15:02 +0000 |
commit | 248ec4fde76595e0e125b8e06c1b12e21d9c8641 (patch) | |
tree | 3e8fc8b9e14456b0bda25000cb54a24b795c8fa8 | |
parent | 3252c170da369d935b34d93a9f5906e6ab890cdf (diff) | |
parent | 2c191dffbec106e97c253a85c1889f7a1b0a159f (diff) | |
download | perfetto-248ec4fde76595e0e125b8e06c1b12e21d9c8641.tar.gz |
Merge "Trace Redaction - Remove Timeline Optimizations" into main
-rw-r--r-- | Android.bp | 1 | ||||
-rw-r--r-- | src/trace_redaction/BUILD.gn | 2 | ||||
-rw-r--r-- | src/trace_redaction/filter_sched_waking_events_integrationtest.cc | 2 | ||||
-rw-r--r-- | src/trace_redaction/filter_task_rename_integrationtest.cc | 2 | ||||
-rw-r--r-- | src/trace_redaction/main.cc | 2 | ||||
-rw-r--r-- | src/trace_redaction/optimize_timeline.cc | 54 | ||||
-rw-r--r-- | src/trace_redaction/optimize_timeline.h | 33 | ||||
-rw-r--r-- | src/trace_redaction/process_thread_timeline.cc | 89 | ||||
-rw-r--r-- | src/trace_redaction/process_thread_timeline.h | 57 | ||||
-rw-r--r-- | src/trace_redaction/process_thread_timeline_unittest.cc | 122 | ||||
-rw-r--r-- | src/trace_redaction/redact_sched_switch_integrationtest.cc | 2 | ||||
-rw-r--r-- | src/trace_redaction/scrub_process_stats_integrationtest.cc | 2 | ||||
-rw-r--r-- | src/trace_redaction/scrub_process_trees_integrationtest.cc | 13 |
13 files changed, 29 insertions, 352 deletions
diff --git a/Android.bp b/Android.bp index c43694efc..60c862c9f 100644 --- a/Android.bp +++ b/Android.bp @@ -13468,7 +13468,6 @@ filegroup { "src/trace_redaction/filter_task_rename.cc", "src/trace_redaction/find_package_uid.cc", "src/trace_redaction/modify_process_trees.cc", - "src/trace_redaction/optimize_timeline.cc", "src/trace_redaction/populate_allow_lists.cc", "src/trace_redaction/process_thread_timeline.cc", "src/trace_redaction/proto_util.cc", diff --git a/src/trace_redaction/BUILD.gn b/src/trace_redaction/BUILD.gn index 29c4a75e0..45d3bdc87 100644 --- a/src/trace_redaction/BUILD.gn +++ b/src/trace_redaction/BUILD.gn @@ -49,8 +49,6 @@ source_set("trace_redaction") { "frame_cookie.h", "modify_process_trees.cc", "modify_process_trees.h", - "optimize_timeline.cc", - "optimize_timeline.h", "populate_allow_lists.cc", "populate_allow_lists.h", "process_thread_timeline.cc", diff --git a/src/trace_redaction/filter_sched_waking_events_integrationtest.cc b/src/trace_redaction/filter_sched_waking_events_integrationtest.cc index d86bf748a..2993ac0a5 100644 --- a/src/trace_redaction/filter_sched_waking_events_integrationtest.cc +++ b/src/trace_redaction/filter_sched_waking_events_integrationtest.cc @@ -24,7 +24,6 @@ #include "src/trace_redaction/collect_timeline_events.h" #include "src/trace_redaction/filter_sched_waking_events.h" #include "src/trace_redaction/find_package_uid.h" -#include "src/trace_redaction/optimize_timeline.h" #include "src/trace_redaction/scrub_ftrace_events.h" #include "src/trace_redaction/trace_redaction_framework.h" #include "src/trace_redaction/trace_redaction_integration_fixture.h" @@ -50,7 +49,6 @@ class RedactSchedWakingIntegrationTest void SetUp() override { trace_redactor()->emplace_collect<FindPackageUid>(); trace_redactor()->emplace_collect<CollectTimelineEvents>(); - trace_redactor()->emplace_build<OptimizeTimeline>(); auto* ftrace_filter = trace_redactor()->emplace_transform<ScrubFtraceEvents>(); diff --git a/src/trace_redaction/filter_task_rename_integrationtest.cc b/src/trace_redaction/filter_task_rename_integrationtest.cc index 14c66dd17..f080fe7e0 100644 --- a/src/trace_redaction/filter_task_rename_integrationtest.cc +++ b/src/trace_redaction/filter_task_rename_integrationtest.cc @@ -24,7 +24,6 @@ #include "src/trace_redaction/collect_timeline_events.h" #include "src/trace_redaction/filter_task_rename.h" #include "src/trace_redaction/find_package_uid.h" -#include "src/trace_redaction/optimize_timeline.h" #include "src/trace_redaction/trace_redaction_framework.h" #include "src/trace_redaction/trace_redaction_integration_fixture.h" #include "src/trace_redaction/trace_redactor.h" @@ -57,7 +56,6 @@ class RenameEventsTraceRedactorIntegrationTest // registered primitives are there to generate the timeline. trace_redactor()->emplace_collect<FindPackageUid>(); trace_redactor()->emplace_collect<CollectTimelineEvents>(); - trace_redactor()->emplace_build<OptimizeTimeline>(); auto scrub_ftrace_events = trace_redactor()->emplace_transform<ScrubFtraceEvents>(); diff --git a/src/trace_redaction/main.cc b/src/trace_redaction/main.cc index 051a424ac..eec75fd6b 100644 --- a/src/trace_redaction/main.cc +++ b/src/trace_redaction/main.cc @@ -25,7 +25,6 @@ #include "src/trace_redaction/filter_sched_waking_events.h" #include "src/trace_redaction/filter_task_rename.h" #include "src/trace_redaction/find_package_uid.h" -#include "src/trace_redaction/optimize_timeline.h" #include "src/trace_redaction/populate_allow_lists.h" #include "src/trace_redaction/prune_package_list.h" #include "src/trace_redaction/redact_ftrace_event.h" @@ -58,7 +57,6 @@ static base::Status Main(std::string_view input, // Add all builders. redactor.emplace_build<PopulateAllowlists>(); redactor.emplace_build<AllowSuspendResume>(); - redactor.emplace_build<OptimizeTimeline>(); redactor.emplace_build<ReduceFrameCookies>(); redactor.emplace_build<BuildSyntheticThreads>(); diff --git a/src/trace_redaction/optimize_timeline.cc b/src/trace_redaction/optimize_timeline.cc deleted file mode 100644 index 713f7c71f..000000000 --- a/src/trace_redaction/optimize_timeline.cc +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2024 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "src/trace_redaction/optimize_timeline.h" - -#include "perfetto/base/status.h" -#include "src/trace_redaction/trace_redaction_framework.h" - -namespace perfetto::trace_redaction { - -base::Status OptimizeTimeline::Build(Context* context) const { - if (!context->timeline) { - return base::ErrStatus( - "Cannot optimize a null timeline. Are you missing " - "CollectTimelineEvents or an " - "alternative?"); - } - - if (!context->package_uid.has_value()) { - return base::ErrStatus( - "Missing package uid. Are you missing FindPackageUid or an " - "alternative?"); - } - - auto* timeline = context->timeline.get(); - - // Change the timeline from read-only to write only mode. - timeline->Sort(); - - // Goes over the whole timeline, reducing the distance between a pid and its - // uid. - timeline->Flatten(); - - // Reduce the number of events. This makes the timeline specific to the - // package uid (i.e. either 0 or package_uid will be returned). - timeline->Reduce(*context->package_uid); - - return base::OkStatus(); -} - -} // namespace perfetto::trace_redaction diff --git a/src/trace_redaction/optimize_timeline.h b/src/trace_redaction/optimize_timeline.h deleted file mode 100644 index e14285170..000000000 --- a/src/trace_redaction/optimize_timeline.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2024 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef SRC_TRACE_REDACTION_OPTIMIZE_TIMELINE_H_ -#define SRC_TRACE_REDACTION_OPTIMIZE_TIMELINE_H_ - -#include "perfetto/base/status.h" -#include "src/trace_redaction/trace_redaction_framework.h" - -namespace perfetto::trace_redaction { - -// Converts a timeline from a write-only structure to a read-only structure. -class OptimizeTimeline : public BuildPrimitive { - public: - base::Status Build(Context* context) const override; -}; - -} // namespace perfetto::trace_redaction - -#endif // SRC_TRACE_REDACTION_OPTIMIZE_TIMELINE_H_ diff --git a/src/trace_redaction/process_thread_timeline.cc b/src/trace_redaction/process_thread_timeline.cc index 7bd4ea494..a678d99d3 100644 --- a/src/trace_redaction/process_thread_timeline.cc +++ b/src/trace_redaction/process_thread_timeline.cc @@ -20,6 +20,7 @@ #include <cstddef> #include <cstdint> #include <optional> +#include "perfetto/base/logging.h" namespace perfetto::trace_redaction { namespace { @@ -35,57 +36,19 @@ bool OrderByPid(const ProcessThreadTimeline::Event& left, } // namespace void ProcessThreadTimeline::Append(const Event& event) { - write_only_events_.push_back(event); + events_.push_back(event); + mode_ = Mode::kWrite; } void ProcessThreadTimeline::Sort() { - write_only_events_.sort(OrderByPid); - - // Copy all events that don't match adjacent events. This should reduce the - // number of events because process trees may contain the same data - // back-to-back. - read_only_events_.reserve(write_only_events_.size()); - - for (auto event : write_only_events_) { - if (read_only_events_.empty() || event != read_only_events_.back()) { - read_only_events_.push_back(event); - } - } - - // Events have been moved from the write-only list to the read-only vector. - // The resources backing the write-only list can be release. - write_only_events_.clear(); -} - -void ProcessThreadTimeline::Flatten() { - // Union-find-like action to collapse the tree. - for (auto& event : read_only_events_) { - if (event.type() != Event::Type::kOpen) { - continue; - } - - auto event_with_package = Search(0, event.ts(), event.pid()); - - if (event_with_package.has_value()) { - event = Event::Open(event.ts(), event.pid(), event.ppid(), - event_with_package->uid()); - } - } -} - -void ProcessThreadTimeline::Reduce(uint64_t package_uid) { - auto remove_open_events = [package_uid](const Event& event) { - return event.uid() != package_uid && event.type() == Event::Type::kOpen; - }; - - read_only_events_.erase( - std::remove_if(read_only_events_.begin(), read_only_events_.end(), - remove_open_events), - read_only_events_.end()); + std::sort(events_.begin(), events_.end(), OrderByPid); + mode_ = Mode::kRead; } ProcessThreadTimeline::Slice ProcessThreadTimeline::Search(uint64_t ts, int32_t pid) const { + PERFETTO_CHECK(mode_ == Mode::kRead); + Slice s; s.pid = pid; s.uid = 0; @@ -100,6 +63,8 @@ ProcessThreadTimeline::Slice ProcessThreadTimeline::Search(uint64_t ts, std::optional<ProcessThreadTimeline::Event> ProcessThreadTimeline::Search(size_t depth, uint64_t ts, int32_t pid) const { + PERFETTO_DCHECK(mode_ == Mode::kRead); + if (depth >= kMaxSearchDepth) { return std::nullopt; } @@ -117,33 +82,10 @@ ProcessThreadTimeline::Search(size_t depth, uint64_t ts, int32_t pid) const { return Search(depth + 1, ts, event->ppid()); } -std::optional<size_t> ProcessThreadTimeline::GetDepth(uint64_t ts, - int32_t pid) const { - return GetDepth(0, ts, pid); -} - -std::optional<size_t> ProcessThreadTimeline::GetDepth(size_t depth, - uint64_t ts, - int32_t pid) const { - if (depth >= kMaxSearchDepth) { - return std::nullopt; - } - - auto event = FindPreviousEvent(ts, pid); - - if (!TestEvent(event)) { - return std::nullopt; - } - - if (event->uid() != 0) { - return depth; - } - - return GetDepth(depth + 1, ts, event->ppid()); -} - std::optional<ProcessThreadTimeline::Event> ProcessThreadTimeline::FindPreviousEvent(uint64_t ts, int32_t pid) const { + PERFETTO_DCHECK(mode_ == Mode::kRead); + Event fake = Event::Close(ts, pid); // Events are in ts-order within each pid-group. See Optimize(), Because each @@ -152,11 +94,10 @@ ProcessThreadTimeline::FindPreviousEvent(uint64_t ts, int32_t pid) const { // // Find the first process event. Then perform a linear search. There won't be // many events per process. - auto at = std::lower_bound(read_only_events_.begin(), read_only_events_.end(), - fake, OrderByPid); + auto at = std::lower_bound(events_.begin(), events_.end(), fake, OrderByPid); - // `pid` was not found in `read_only_events_`. - if (at == read_only_events_.end()) { + // `pid` was not found in `events_`. + if (at == events_.end()) { return std::nullopt; } @@ -173,7 +114,7 @@ ProcessThreadTimeline::FindPreviousEvent(uint64_t ts, int32_t pid) const { // // 3. The performance gains are minimal or non-existant because of the small // number of events. - for (; at != read_only_events_.end() && at->pid() == pid; ++at) { + for (; at != events_.end() && at->pid() == pid; ++at) { if (at->ts() > ts) { continue; // Ignore events in the future. } diff --git a/src/trace_redaction/process_thread_timeline.h b/src/trace_redaction/process_thread_timeline.h index 3a6f6ac87..4e1354c25 100644 --- a/src/trace_redaction/process_thread_timeline.h +++ b/src/trace_redaction/process_thread_timeline.h @@ -18,7 +18,6 @@ #define SRC_TRACE_REDACTION_PROCESS_THREAD_TIMELINE_H_ #include <cstdint> -#include <list> #include <optional> #include <vector> @@ -121,22 +120,6 @@ class ProcessThreadTimeline { // subset of events will, on average, be trivally small. void Sort(); - // OPTIONAL: minimizes the distance between the leaf nodes and the package - // nodes (a node with a uid value not equal to zero). - void Flatten(); - - // OPTIONAL: Removes events from the timeline that: - // - // 1. Reduces the number of events in the timeline to shrink the search - // space. - // - // 2. Does not invalidate the timeline. - // - // This can only be called after calling Sort(). Calling Reduce() before - // Sort() has undefined behaviour. Calling Reduce() after AppendOpen() if - // AppendClose() (without a call to Sort() call) has undefined behaviour. - void Reduce(uint64_t package_uid); - // Returns a snapshot that contains a process's pid and ppid, but contains the // first uid found in its parent-child chain. If a uid cannot be found, uid=0 // is returned. @@ -144,27 +127,18 @@ class ProcessThreadTimeline { // `Sort()` must be called before this. Slice Search(uint64_t ts, int32_t pid) const; - // Finds the distance between pid and its uid. - // - // Returns -1 it pid has no connection to a uid. - // Returns 0 if pid has an immediately connection to a uid. - // - // Return n where: n is the number of pids between the given pid and the pid - // connected to the uid. For example, assume D() is a - // function that measures the distance between two nodes in - // the same chain: - // - // | pid | depth - // | a : 0 - // | b : 1 - // | c : 2 --> uid = 98 - // - // D(a) = 2 - // D(b) = 1 - // D(c) = 0 - std::optional<size_t> GetDepth(uint64_t ts, int32_t pid) const; - private: + enum class Mode { + // The timeline can safely be queried. If the timeline is in read mode, and + // a user writes to the timeline, the timeline will change to write mode. + kRead, + + // The timeline change be changed. If the timeline is not in write mode, + // reading from the timeline will throw an error. Sort() must be called to + // change the timeline from write to read mode. + kWrite + }; + // Effectively this is the same as: // // events_for(pid).before(ts).sort_by_time().last() @@ -172,14 +146,11 @@ class ProcessThreadTimeline { std::optional<Event> Search(size_t depth, uint64_t ts, int32_t pid) const; - std::optional<size_t> GetDepth(size_t depth, uint64_t ts, int32_t pid) const; - bool TestEvent(std::optional<Event> event) const; - // The number of events are unclear. Use a list when in "write-only" mode and - // then change to a vector for "read-only" mode. - std::list<Event> write_only_events_; - std::vector<Event> read_only_events_; + std::vector<Event> events_; + + Mode mode_ = Mode::kRead; }; } // namespace perfetto::trace_redaction diff --git a/src/trace_redaction/process_thread_timeline_unittest.cc b/src/trace_redaction/process_thread_timeline_unittest.cc index ea7e5e5e5..daca1f18c 100644 --- a/src/trace_redaction/process_thread_timeline_unittest.cc +++ b/src/trace_redaction/process_thread_timeline_unittest.cc @@ -38,26 +38,6 @@ class SliceTestParams { uint64_t uid_; }; -class DepthTestParams { - public: - DepthTestParams(uint64_t ts, - int32_t pid, - std::optional<size_t> raw_depth, - std::optional<size_t> flat_depth) - : ts_(ts), pid_(pid), raw_depth_(raw_depth), flat_depth_(flat_depth) {} - - uint64_t ts() const { return ts_; } - int32_t pid() const { return pid_; } - std::optional<size_t> raw_depth() const { return raw_depth_; } - std::optional<size_t> flat_depth() const { return flat_depth_; } - - private: - uint64_t ts_; - int32_t pid_; - std::optional<size_t> raw_depth_; - std::optional<size_t> flat_depth_; -}; - constexpr uint64_t kTimeA = 0; constexpr uint64_t kTimeB = 10; constexpr uint64_t kTimeC = 20; @@ -65,12 +45,9 @@ constexpr uint64_t kTimeD = 30; constexpr uint64_t kTimeE = 40; constexpr uint64_t kTimeF = 50; constexpr uint64_t kTimeG = 60; -constexpr uint64_t kTimeH = 70; -constexpr uint64_t kTimeI = 70; constexpr int32_t kPidA = 1; constexpr int32_t kPidB = 2; -constexpr int32_t kPidC = 3; constexpr uint64_t kNoPackage = 0; @@ -95,7 +72,6 @@ TEST_P(TimelineEventsOpenAndCloseSingleTest, PidsEndOnClose) { timeline_.Append(ProcessThreadTimeline::Event::Close(kTimeD, kPidB)); timeline_.Sort(); - timeline_.Flatten(); auto slice = timeline_.Search(params.ts(), params.pid()); ASSERT_EQ(slice.pid, params.pid()); @@ -224,102 +200,4 @@ INSTANTIATE_TEST_SUITE_P( SliceTestParams(kTimeD, kPidB, kUidA), SliceTestParams(kTimeE, kPidB, kNoPackage))); -class TimelineEventsFlattenTest - : public testing::Test, - public testing::WithParamInterface<DepthTestParams> { - protected: - ProcessThreadTimeline timeline_; -}; - -TEST_P(TimelineEventsFlattenTest, BeforeFlatten) { - auto params = GetParam(); - - // |---------- PID_A ----------| - // |----- PID_B -----| - // |-- PID_C --| - timeline_.Append(ProcessThreadTimeline::Event::Open(kTimeB, kPidA, 0, kUidA)); - timeline_.Append(ProcessThreadTimeline::Event::Open(kTimeC, kPidB, kPidA)); - timeline_.Append(ProcessThreadTimeline::Event::Open(kTimeD, kPidC, kPidB)); - - // Time E is when all spans are valid. - - timeline_.Append(ProcessThreadTimeline::Event::Close(kTimeF, kPidC)); - timeline_.Append(ProcessThreadTimeline::Event::Close(kTimeG, kPidB)); - timeline_.Append(ProcessThreadTimeline::Event::Close(kTimeH, kPidA)); - - timeline_.Sort(); - - auto depth = timeline_.GetDepth(params.ts(), params.pid()); - ASSERT_EQ(depth, params.raw_depth()); -} - -TEST_P(TimelineEventsFlattenTest, AfterFlatten) { - auto params = GetParam(); - - // |---------- PID_A ----------| - // |----- PID_B -----| - // |-- PID_C --| - timeline_.Append(ProcessThreadTimeline::Event::Open(kTimeB, kPidA, 0, kUidA)); - timeline_.Append(ProcessThreadTimeline::Event::Open(kTimeC, kPidB, kPidA)); - timeline_.Append(ProcessThreadTimeline::Event::Open(kTimeD, kPidC, kPidB)); - - // Time E is when all spans are valid. - - timeline_.Append(ProcessThreadTimeline::Event::Close(kTimeF, kPidC)); - timeline_.Append(ProcessThreadTimeline::Event::Close(kTimeG, kPidB)); - timeline_.Append(ProcessThreadTimeline::Event::Close(kTimeH, kPidA)); - - timeline_.Sort(); - timeline_.Flatten(); - - auto depth = timeline_.GetDepth(params.ts(), params.pid()); - ASSERT_EQ(depth, params.flat_depth()); -} - -INSTANTIATE_TEST_SUITE_P( - AcrossWholeTimeline, - TimelineEventsFlattenTest, - testing::Values( - // Pid A - DepthTestParams(kTimeA, kPidA, std::nullopt, std::nullopt), - DepthTestParams(kTimeB, kPidA, 0, 0), - DepthTestParams(kTimeC, kPidA, 0, 0), - DepthTestParams(kTimeD, kPidA, 0, 0), - DepthTestParams(kTimeE, kPidA, 0, 0), - DepthTestParams(kTimeF, kPidA, 0, 0), - DepthTestParams(kTimeG, kPidA, 0, 0), - DepthTestParams(kTimeH, - kPidA, - std::nullopt, - std::nullopt), // pid A ends - DepthTestParams(kTimeI, kPidA, std::nullopt, std::nullopt), - - // Pid B - DepthTestParams(kTimeA, kPidB, std::nullopt, std::nullopt), - DepthTestParams(kTimeB, kPidB, std::nullopt, std::nullopt), - DepthTestParams(kTimeC, kPidB, 1, 0), - DepthTestParams(kTimeD, kPidB, 1, 0), - DepthTestParams(kTimeE, kPidB, 1, 0), - DepthTestParams(kTimeF, kPidB, 1, 0), - DepthTestParams(kTimeG, - kPidB, - std::nullopt, - std::nullopt), // pid B ends - DepthTestParams(kTimeH, kPidB, std::nullopt, std::nullopt), - DepthTestParams(kTimeI, kPidB, std::nullopt, std::nullopt), - - // Pid C - DepthTestParams(kTimeA, kPidC, std::nullopt, std::nullopt), - DepthTestParams(kTimeB, kPidC, std::nullopt, std::nullopt), - DepthTestParams(kTimeC, kPidC, std::nullopt, std::nullopt), - DepthTestParams(kTimeD, kPidC, 2, 0), - DepthTestParams(kTimeE, kPidC, 2, 0), - DepthTestParams(kTimeF, - kPidC, - std::nullopt, - std::nullopt), // pid C ends - DepthTestParams(kTimeG, kPidC, std::nullopt, std::nullopt), - DepthTestParams(kTimeH, kPidC, std::nullopt, std::nullopt), - DepthTestParams(kTimeI, kPidC, std::nullopt, std::nullopt))); - } // namespace perfetto::trace_redaction diff --git a/src/trace_redaction/redact_sched_switch_integrationtest.cc b/src/trace_redaction/redact_sched_switch_integrationtest.cc index 85d7416a7..f14d6e990 100644 --- a/src/trace_redaction/redact_sched_switch_integrationtest.cc +++ b/src/trace_redaction/redact_sched_switch_integrationtest.cc @@ -22,7 +22,6 @@ #include "src/base/test/status_matchers.h" #include "src/trace_redaction/collect_timeline_events.h" #include "src/trace_redaction/find_package_uid.h" -#include "src/trace_redaction/optimize_timeline.h" #include "src/trace_redaction/redact_sched_switch.h" #include "src/trace_redaction/trace_redaction_framework.h" #include "src/trace_redaction/trace_redaction_integration_fixture.h" @@ -44,7 +43,6 @@ class RedactSchedSwitchIntegrationTest void SetUp() override { trace_redactor()->emplace_collect<FindPackageUid>(); trace_redactor()->emplace_collect<CollectTimelineEvents>(); - trace_redactor()->emplace_build<OptimizeTimeline>(); auto* ftrace_event_redactions = trace_redactor()->emplace_transform<RedactFtraceEvent>(); diff --git a/src/trace_redaction/scrub_process_stats_integrationtest.cc b/src/trace_redaction/scrub_process_stats_integrationtest.cc index 2b081e527..cce2b6b38 100644 --- a/src/trace_redaction/scrub_process_stats_integrationtest.cc +++ b/src/trace_redaction/scrub_process_stats_integrationtest.cc @@ -20,7 +20,6 @@ #include "perfetto/base/status.h" #include "src/base/test/status_matchers.h" #include "src/trace_redaction/collect_timeline_events.h" -#include "src/trace_redaction/optimize_timeline.h" #include "src/trace_redaction/scrub_process_stats.h" #include "src/trace_redaction/trace_redaction_framework.h" #include "src/trace_redaction/trace_redaction_integration_fixture.h" @@ -38,7 +37,6 @@ class ScrubProcessStatsTest : public testing::Test, protected: void SetUp() override { trace_redactor()->emplace_collect<CollectTimelineEvents>(); - trace_redactor()->emplace_build<OptimizeTimeline>(); trace_redactor()->emplace_transform<ScrubProcessStats>(); // Package "com.Unity.com.unity.multiplayer.samples.coop"; diff --git a/src/trace_redaction/scrub_process_trees_integrationtest.cc b/src/trace_redaction/scrub_process_trees_integrationtest.cc index 58396b2b9..a001a36cf 100644 --- a/src/trace_redaction/scrub_process_trees_integrationtest.cc +++ b/src/trace_redaction/scrub_process_trees_integrationtest.cc @@ -21,7 +21,6 @@ #include "src/base/test/status_matchers.h" #include "src/trace_redaction/collect_timeline_events.h" #include "src/trace_redaction/find_package_uid.h" -#include "src/trace_redaction/optimize_timeline.h" #include "src/trace_redaction/scrub_process_trees.h" #include "src/trace_redaction/trace_redaction_framework.h" #include "src/trace_redaction/trace_redaction_integration_fixture.h" @@ -45,20 +44,8 @@ class ScrubProcessTreesIntegrationTest protected TraceRedactionIntegrationFixure { protected: void SetUp() override { - // ScrubProcessTrees depends on: - // - FindPackageUid (creates: uid) - // - OptimizeTimeline (creates: optimized timeline) - // - // OptimizeTimeline depends on: - // - FindPackageUid (uses: uid) - // - CollectTimelineEvents (uses: timeline) - // - // CollectTimelineEvents depends on.... nothing - // FindPackageUid depends on... nothing - trace_redactor()->emplace_collect<FindPackageUid>(); trace_redactor()->emplace_collect<CollectTimelineEvents>(); - trace_redactor()->emplace_build<OptimizeTimeline>(); trace_redactor()->emplace_transform<ScrubProcessTrees>(); // In this case, the process and package have the same name. |