diff --git a/Android.bp b/Android.bp index ffa415a917..0b974a108c 100644 --- a/Android.bp +++ b/Android.bp @@ -2491,7 +2491,6 @@ cc_test { ":perfetto_src_trace_processor_importers_i2c_full", ":perfetto_src_trace_processor_importers_instruments_instruments", ":perfetto_src_trace_processor_importers_instruments_row", - ":perfetto_src_trace_processor_importers_json_full", ":perfetto_src_trace_processor_importers_json_minimal", ":perfetto_src_trace_processor_importers_memory_tracker_graph_processor", ":perfetto_src_trace_processor_importers_ninja_ninja", @@ -12619,15 +12618,6 @@ filegroup { name: "perfetto_src_trace_processor_importers_instruments_row", } -// GN: //src/trace_processor/importers/json:full -filegroup { - name: "perfetto_src_trace_processor_importers_json_full", - srcs: [ - "src/trace_processor/importers/json/json_trace_parser_impl.cc", - "src/trace_processor/importers/json/json_trace_tokenizer.cc", - ], -} - // GN: //src/trace_processor/importers/json:minimal filegroup { name: "perfetto_src_trace_processor_importers_json_minimal", @@ -15642,7 +15632,6 @@ cc_test { ":perfetto_src_trace_processor_importers_i2c_full", ":perfetto_src_trace_processor_importers_instruments_instruments", ":perfetto_src_trace_processor_importers_instruments_row", - ":perfetto_src_trace_processor_importers_json_full", ":perfetto_src_trace_processor_importers_json_minimal", ":perfetto_src_trace_processor_importers_memory_tracker_graph_processor", ":perfetto_src_trace_processor_importers_memory_tracker_unittests", @@ -16715,7 +16704,6 @@ cc_binary { ":perfetto_src_trace_processor_importers_i2c_full", ":perfetto_src_trace_processor_importers_instruments_instruments", ":perfetto_src_trace_processor_importers_instruments_row", - ":perfetto_src_trace_processor_importers_json_full", ":perfetto_src_trace_processor_importers_json_minimal", ":perfetto_src_trace_processor_importers_memory_tracker_graph_processor", ":perfetto_src_trace_processor_importers_ninja_ninja", @@ -17142,7 +17130,6 @@ cc_binary_host { ":perfetto_src_trace_processor_importers_i2c_full", ":perfetto_src_trace_processor_importers_instruments_instruments", ":perfetto_src_trace_processor_importers_instruments_row", - ":perfetto_src_trace_processor_importers_json_full", ":perfetto_src_trace_processor_importers_json_minimal", ":perfetto_src_trace_processor_importers_memory_tracker_graph_processor", ":perfetto_src_trace_processor_importers_ninja_ninja", diff --git a/BUILD b/BUILD index 7dd6f1e8fa..bbd999cf26 100644 --- a/BUILD +++ b/BUILD @@ -242,7 +242,7 @@ perfetto_cc_library( ":src_trace_processor_importers_i2c_full", ":src_trace_processor_importers_instruments_instruments", ":src_trace_processor_importers_instruments_row", - ":src_trace_processor_importers_json_full", + ":src_trace_processor_importers_json_json", ":src_trace_processor_importers_json_minimal", ":src_trace_processor_importers_memory_tracker_graph_processor", ":src_trace_processor_importers_ninja_ninja", @@ -1810,9 +1810,9 @@ perfetto_filegroup( ], ) -# GN target: //src/trace_processor/importers/json:full +# GN target: //src/trace_processor/importers/json:json perfetto_filegroup( - name = "src_trace_processor_importers_json_full", + name = "src_trace_processor_importers_json_json", srcs = [ "src/trace_processor/importers/json/json_trace_parser_impl.cc", "src/trace_processor/importers/json/json_trace_parser_impl.h", @@ -6438,7 +6438,7 @@ perfetto_cc_library( ":src_trace_processor_importers_i2c_full", ":src_trace_processor_importers_instruments_instruments", ":src_trace_processor_importers_instruments_row", - ":src_trace_processor_importers_json_full", + ":src_trace_processor_importers_json_json", ":src_trace_processor_importers_json_minimal", ":src_trace_processor_importers_memory_tracker_graph_processor", ":src_trace_processor_importers_ninja_ninja", @@ -6642,7 +6642,7 @@ perfetto_cc_binary( ":src_trace_processor_importers_i2c_full", ":src_trace_processor_importers_instruments_instruments", ":src_trace_processor_importers_instruments_row", - ":src_trace_processor_importers_json_full", + ":src_trace_processor_importers_json_json", ":src_trace_processor_importers_json_minimal", ":src_trace_processor_importers_memory_tracker_graph_processor", ":src_trace_processor_importers_ninja_ninja", @@ -6903,7 +6903,7 @@ perfetto_cc_binary( ":src_trace_processor_importers_i2c_full", ":src_trace_processor_importers_instruments_instruments", ":src_trace_processor_importers_instruments_row", - ":src_trace_processor_importers_json_full", + ":src_trace_processor_importers_json_json", ":src_trace_processor_importers_json_minimal", ":src_trace_processor_importers_memory_tracker_graph_processor", ":src_trace_processor_importers_ninja_ninja", diff --git a/src/trace_processor/BUILD.gn b/src/trace_processor/BUILD.gn index 0ab175fb15..eac41c0ca4 100644 --- a/src/trace_processor/BUILD.gn +++ b/src/trace_processor/BUILD.gn @@ -175,7 +175,6 @@ if (enable_perfetto_trace_processor_sqlite) { "importers/etw:full", "importers/ftrace:full", "importers/fuchsia:full", - "importers/json:full", "importers/json:minimal", "importers/ninja", "importers/perf", @@ -209,7 +208,10 @@ if (enable_perfetto_trace_processor_sqlite) { deps += [ "importers/instruments" ] } if (enable_perfetto_trace_processor_json) { - deps += [ "importers/gecko" ] + deps += [ + "importers/gecko", + "importers/json", + ] } } diff --git a/src/trace_processor/importers/common/trace_parser.h b/src/trace_processor/importers/common/trace_parser.h index b2a85126c4..a672a07681 100644 --- a/src/trace_processor/importers/common/trace_parser.h +++ b/src/trace_processor/importers/common/trace_parser.h @@ -57,7 +57,6 @@ class ProtoTraceParser { virtual void ParseFtraceEvent(uint32_t, int64_t, TracePacketData) = 0; virtual void ParseInlineSchedSwitch(uint32_t, int64_t, InlineSchedSwitch) = 0; virtual void ParseInlineSchedWaking(uint32_t, int64_t, InlineSchedWaking) = 0; - virtual void ParseLegacyV8ProfileEvent(int64_t, LegacyV8CpuProfileEvent) = 0; }; class JsonTraceParser { @@ -65,6 +64,7 @@ class JsonTraceParser { virtual ~JsonTraceParser(); virtual void ParseJsonPacket(int64_t, std::string) = 0; virtual void ParseSystraceLine(int64_t, SystraceLine) = 0; + virtual void ParseLegacyV8ProfileEvent(int64_t, LegacyV8CpuProfileEvent) = 0; }; class FuchsiaRecordParser { diff --git a/src/trace_processor/importers/json/BUILD.gn b/src/trace_processor/importers/json/BUILD.gn index d83ac83ac5..c7921d2265 100644 --- a/src/trace_processor/importers/json/BUILD.gn +++ b/src/trace_processor/importers/json/BUILD.gn @@ -30,30 +30,31 @@ source_set("minimal") { } } -source_set("full") { - sources = [ - "json_trace_parser_impl.cc", - "json_trace_parser_impl.h", - "json_trace_tokenizer.cc", - "json_trace_tokenizer.h", - ] - deps = [ - ":minimal", - "../../../../gn:default_deps", - "../../sorter", - "../../storage", - "../../tables", - "../../types", - "../common", - "../systrace:full", - "../systrace:systrace_line", - ] - if (enable_perfetto_trace_processor_json) { - public_deps = [ "../../../../gn:jsoncpp" ] +if (enable_perfetto_trace_processor_json) { + source_set("json") { + sources = [ + "json_trace_parser_impl.cc", + "json_trace_parser_impl.h", + "json_trace_tokenizer.cc", + "json_trace_tokenizer.h", + ] + deps = [ + ":minimal", + "../../../../gn:default_deps", + "../../sorter", + "../../storage", + "../../tables", + "../../types", + "../common", + "../common:parser_types", + "../systrace:full", + "../systrace:systrace_line", + ] + if (enable_perfetto_trace_processor_json) { + public_deps = [ "../../../../gn:jsoncpp" ] + } } -} -if (enable_perfetto_trace_processor_json) { perfetto_unittest_source_set("unittests") { testonly = true sources = [ @@ -61,7 +62,7 @@ if (enable_perfetto_trace_processor_json) { "json_utils_unittest.cc", ] deps = [ - ":full", + ":json", ":minimal", "../../../../gn:default_deps", "../../../../gn:gtest_and_gmock", diff --git a/src/trace_processor/importers/json/json_trace_parser_impl.cc b/src/trace_processor/importers/json/json_trace_parser_impl.cc index e54002a149..ba2e08a178 100644 --- a/src/trace_processor/importers/json/json_trace_parser_impl.cc +++ b/src/trace_processor/importers/json/json_trace_parser_impl.cc @@ -24,11 +24,14 @@ #include "perfetto/base/build_config.h" #include "perfetto/base/logging.h" +#include "perfetto/base/status.h" #include "perfetto/ext/base/hash.h" #include "perfetto/ext/base/string_utils.h" #include "perfetto/ext/base/string_view.h" #include "src/trace_processor/importers/common/event_tracker.h" #include "src/trace_processor/importers/common/flow_tracker.h" +#include "src/trace_processor/importers/common/legacy_v8_cpu_profile_tracker.h" +#include "src/trace_processor/importers/common/parser_types.h" #include "src/trace_processor/importers/common/process_tracker.h" #include "src/trace_processor/importers/common/slice_tracker.h" #include "src/trace_processor/importers/common/track_tracker.h" @@ -39,10 +42,8 @@ #include "src/trace_processor/tables/slice_tables_py.h" #include "src/trace_processor/types/trace_processor_context.h" -namespace perfetto { -namespace trace_processor { +namespace perfetto::trace_processor { -#if PERFETTO_BUILDFLAG(PERFETTO_TP_JSON) namespace { std::optional MaybeExtractFlowIdentifier(const Json::Value& value, @@ -60,7 +61,6 @@ std::optional MaybeExtractFlowIdentifier(const Json::Value& value, } } // namespace -#endif // PERFETTO_BUILDFLAG(PERFETTO_TP_JSON) JsonTraceParserImpl::JsonTraceParserImpl(TraceProcessorContext* context) : context_(context), systrace_line_parser_(context) {} @@ -75,7 +75,6 @@ void JsonTraceParserImpl::ParseJsonPacket(int64_t timestamp, std::string string_value) { PERFETTO_DCHECK(json::IsJsonSupported()); -#if PERFETTO_BUILDFLAG(PERFETTO_TP_JSON) auto opt_value = json::ParseJsonString(base::StringView(string_value)); if (!opt_value) { context_->storage->IncrementStats(stats::json_parser_failure); @@ -381,18 +380,11 @@ void JsonTraceParserImpl::ParseJsonPacket(int64_t timestamp, } } } -#else - perfetto::base::ignore_result(timestamp); - perfetto::base::ignore_result(context_); - perfetto::base::ignore_result(string_value); - PERFETTO_ELOG("Cannot parse JSON trace due to missing JSON support"); -#endif // PERFETTO_BUILDFLAG(PERFETTO_TP_JSON) } void JsonTraceParserImpl::MaybeAddFlow(TrackId track_id, const Json::Value& event) { PERFETTO_DCHECK(json::IsJsonSupported()); -#if PERFETTO_BUILDFLAG(PERFETTO_TP_JSON) auto opt_bind_id = MaybeExtractFlowIdentifier(event, /* version2 = */ true); if (opt_bind_id) { FlowTracker* flow_tracker = context_->flow_tracker.get(); @@ -410,11 +402,18 @@ void JsonTraceParserImpl::MaybeAddFlow(TrackId track_id, context_->storage->IncrementStats(stats::flow_without_direction); } } -#else - perfetto::base::ignore_result(track_id); - perfetto::base::ignore_result(event); -#endif // PERFETTO_BUILDFLAG(PERFETTO_TP_JSON) } -} // namespace trace_processor -} // namespace perfetto +void JsonTraceParserImpl::ParseLegacyV8ProfileEvent( + int64_t ts, + LegacyV8CpuProfileEvent event) { + base::Status status = context_->legacy_v8_cpu_profile_tracker->AddSample( + ts, event.session_id, event.pid, event.tid, event.callsite_id); + if (!status.ok()) { + context_->storage->IncrementStats( + stats::legacy_v8_cpu_profile_invalid_sample); + } + context_->args_tracker->Flush(); +} + +} // namespace perfetto::trace_processor diff --git a/src/trace_processor/importers/json/json_trace_parser_impl.h b/src/trace_processor/importers/json/json_trace_parser_impl.h index c675f23ea9..8b89897b75 100644 --- a/src/trace_processor/importers/json/json_trace_parser_impl.h +++ b/src/trace_processor/importers/json/json_trace_parser_impl.h @@ -43,6 +43,7 @@ class JsonTraceParserImpl : public JsonTraceParser { // TraceParser implementation. void ParseJsonPacket(int64_t, std::string) override; void ParseSystraceLine(int64_t, SystraceLine) override; + void ParseLegacyV8ProfileEvent(int64_t, LegacyV8CpuProfileEvent) override; private: TraceProcessorContext* const context_; diff --git a/src/trace_processor/importers/json/json_trace_tokenizer.cc b/src/trace_processor/importers/json/json_trace_tokenizer.cc index 2cceb0e7e9..705fcfb33f 100644 --- a/src/trace_processor/importers/json/json_trace_tokenizer.cc +++ b/src/trace_processor/importers/json/json_trace_tokenizer.cc @@ -22,15 +22,15 @@ #include #include #include -#include #include "perfetto/base/logging.h" #include "perfetto/base/status.h" #include "perfetto/ext/base/string_utils.h" #include "perfetto/ext/base/string_view.h" +#include "perfetto/public/compiler.h" #include "perfetto/trace_processor/trace_blob_view.h" +#include "src/trace_processor/importers/common/legacy_v8_cpu_profile_tracker.h" #include "src/trace_processor/importers/json/json_utils.h" -#include "src/trace_processor/importers/systrace/systrace_line.h" #include "src/trace_processor/sorter/trace_sorter.h" // IWYU pragma: keep #include "src/trace_processor/storage/stats.h" #include "src/trace_processor/util/status_macros.h" @@ -551,6 +551,14 @@ base::Status JsonTraceTokenizer::HandleTraceEvent(const char* start, break; } + // Metadata events may omit ts. In all other cases error: + std::optional opt_raw_ph; + RETURN_IF_ERROR(ExtractValueForJsonKey(unparsed, "ph", &opt_raw_ph)); + if (PERFETTO_UNLIKELY(opt_raw_ph == "P")) { + RETURN_IF_ERROR(ParseV8SampleEvent(unparsed)); + continue; + } + std::optional opt_raw_ts; RETURN_IF_ERROR(ExtractValueForJsonKey(unparsed, "ts", &opt_raw_ts)); std::optional opt_ts = @@ -563,9 +571,6 @@ base::Status JsonTraceTokenizer::HandleTraceEvent(const char* start, if (opt_ts.has_value()) { ts = opt_ts.value(); } else { - // Metadata events may omit ts. In all other cases error: - std::optional opt_raw_ph; - RETURN_IF_ERROR(ExtractValueForJsonKey(unparsed, "ph", &opt_raw_ph)); if (!opt_raw_ph || *opt_raw_ph != "M") { context_->storage->IncrementStats(stats::json_tokenizer_failure); continue; @@ -576,6 +581,58 @@ base::Status JsonTraceTokenizer::HandleTraceEvent(const char* start, return SetOutAndReturn(next, out); } +base::Status JsonTraceTokenizer::ParseV8SampleEvent(base::StringView unparsed) { + auto opt_evt = json::ParseJsonString(unparsed); + if (!opt_evt) { + return base::OkStatus(); + } + const auto& evt = *opt_evt; + std::optional id = base::StringToUInt32(evt["id"].asString(), 16); + if (!id) { + return base::OkStatus(); + } + uint32_t pid = evt["pid"].asUInt(); + uint32_t tid = evt["tid"].asUInt(); + const auto& val = evt["args"]["data"]; + if (val.isMember("startTime")) { + context_->legacy_v8_cpu_profile_tracker->SetStartTsForSessionAndPid( + *id, pid, val["startTime"].asInt64() * 1000); + return base::OkStatus(); + } + const auto& profile = val["cpuProfile"]; + for (const auto& n : profile["nodes"]) { + uint32_t node_id = n["id"].asUInt(); + std::optional parent_node_id = + n.isMember("parent") ? std::make_optional(n["parent"].asUInt()) + : std::nullopt; + const auto& frame = n["callFrame"]; + base::StringView url = + frame.isMember("url") ? frame["url"].asCString() : base::StringView(); + base::StringView function_name = frame["functionName"].asCString(); + base::Status status = context_->legacy_v8_cpu_profile_tracker->AddCallsite( + *id, pid, node_id, parent_node_id, url, function_name); + if (!status.ok()) { + context_->storage->IncrementStats( + stats::legacy_v8_cpu_profile_invalid_callsite); + continue; + } + } + const auto& samples = profile["samples"]; + const auto& deltas = val["timeDeltas"]; + if (samples.size() != deltas.size()) { + return base::ErrStatus( + "v8 legacy profile: samples and timestamps do not have same size"); + } + for (uint32_t i = 0; i < samples.size(); ++i) { + ASSIGN_OR_RETURN(int64_t ts, + context_->legacy_v8_cpu_profile_tracker->AddDeltaAndGetTs( + *id, pid, deltas[i].asInt64() * 1000)); + context_->sorter->PushLegacyV8CpuProfileEvent(ts, *id, pid, tid, + samples[i].asUInt()); + } + return base::OkStatus(); +} + base::Status JsonTraceTokenizer::HandleDictionaryKey(const char* start, const char* end, const char** out) { diff --git a/src/trace_processor/importers/json/json_trace_tokenizer.h b/src/trace_processor/importers/json/json_trace_tokenizer.h index 00af4ca5b8..398b67ddf1 100644 --- a/src/trace_processor/importers/json/json_trace_tokenizer.h +++ b/src/trace_processor/importers/json/json_trace_tokenizer.h @@ -140,6 +140,8 @@ class JsonTraceTokenizer : public ChunkedTraceReader { const char* end, const char** out); + base::Status ParseV8SampleEvent(base::StringView unparsed); + base::Status HandleTraceEvent(const char* start, const char* end, const char** out); diff --git a/src/trace_processor/importers/proto/proto_trace_parser_impl.cc b/src/trace_processor/importers/proto/proto_trace_parser_impl.cc index 393bd79590..5d838e8266 100644 --- a/src/trace_processor/importers/proto/proto_trace_parser_impl.cc +++ b/src/trace_processor/importers/proto/proto_trace_parser_impl.cc @@ -158,18 +158,6 @@ void ProtoTraceParserImpl::ParseInlineSchedWaking(uint32_t cpu, context_->args_tracker->Flush(); } -void ProtoTraceParserImpl::ParseLegacyV8ProfileEvent( - int64_t ts, - LegacyV8CpuProfileEvent event) { - base::Status status = context_->legacy_v8_cpu_profile_tracker->AddSample( - ts, event.session_id, event.pid, event.tid, event.callsite_id); - if (!status.ok()) { - context_->storage->IncrementStats( - stats::legacy_v8_cpu_profile_invalid_sample); - } - context_->args_tracker->Flush(); -} - void ProtoTraceParserImpl::ParseChromeEvents(int64_t ts, ConstBytes blob) { TraceStorage* storage = context_->storage.get(); protos::pbzero::ChromeEventBundle::Decoder bundle(blob.data, blob.size); diff --git a/src/trace_processor/importers/proto/proto_trace_parser_impl.h b/src/trace_processor/importers/proto/proto_trace_parser_impl.h index f6b23047f5..0c1db93a69 100644 --- a/src/trace_processor/importers/proto/proto_trace_parser_impl.h +++ b/src/trace_processor/importers/proto/proto_trace_parser_impl.h @@ -61,8 +61,6 @@ class ProtoTraceParserImpl : public ProtoTraceParser { int64_t /*ts*/, InlineSchedWaking data) override; - void ParseLegacyV8ProfileEvent(int64_t ts, LegacyV8CpuProfileEvent) override; - private: StringId GetMetatraceInternedString(uint64_t iid); diff --git a/src/trace_processor/importers/proto/track_event_parser.cc b/src/trace_processor/importers/proto/track_event_parser.cc index ae80ada225..afb0244e3a 100644 --- a/src/trace_processor/importers/proto/track_event_parser.cc +++ b/src/trace_processor/importers/proto/track_event_parser.cc @@ -38,8 +38,6 @@ #include "src/trace_processor/importers/common/cpu_tracker.h" #include "src/trace_processor/importers/common/event_tracker.h" #include "src/trace_processor/importers/common/flow_tracker.h" -#include "src/trace_processor/importers/common/global_args_tracker.h" -#include "src/trace_processor/importers/common/legacy_v8_cpu_profile_tracker.h" #include "src/trace_processor/importers/common/parser_types.h" #include "src/trace_processor/importers/common/process_track_translation_table.h" #include "src/trace_processor/importers/common/process_tracker.h" diff --git a/src/trace_processor/importers/proto/track_event_tokenizer.cc b/src/trace_processor/importers/proto/track_event_tokenizer.cc index 268f45f59c..6e614e60c8 100644 --- a/src/trace_processor/importers/proto/track_event_tokenizer.cc +++ b/src/trace_processor/importers/proto/track_event_tokenizer.cc @@ -23,7 +23,7 @@ #include #include -#include "perfetto/base/compiler.h" +#include "perfetto/base/build_config.h" #include "perfetto/base/logging.h" #include "perfetto/base/status.h" #include "perfetto/ext/base/status_or.h" diff --git a/src/trace_processor/sorter/trace_sorter.cc b/src/trace_processor/sorter/trace_sorter.cc index 739a772690..4fff091e10 100644 --- a/src/trace_processor/sorter/trace_sorter.cc +++ b/src/trace_processor/sorter/trace_sorter.cc @@ -261,7 +261,7 @@ void TraceSorter::ParseTracePacket(TraceProcessorContext& context, event.ts, token_buffer_.Extract(id)); return; case TimestampedEvent::Type::kLegacyV8CpuProfileEvent: - context.proto_trace_parser->ParseLegacyV8ProfileEvent( + context.json_trace_parser->ParseLegacyV8ProfileEvent( event.ts, token_buffer_.Extract(id)); return; case TimestampedEvent::Type::kGeckoEvent: diff --git a/src/trace_processor/trace_processor_impl.cc b/src/trace_processor/trace_processor_impl.cc index f4fc643171..f9f2d3295a 100644 --- a/src/trace_processor/trace_processor_impl.cc +++ b/src/trace_processor/trace_processor_impl.cc @@ -440,13 +440,11 @@ TraceProcessorImpl::TraceProcessorImpl(const Config& cfg) context_.json_trace_parser = std::make_unique(&context_); -#if PERFETTO_BUILDFLAG(PERFETTO_TP_JSON) context_.reader_registry ->RegisterTraceReader( kGeckoTraceType); context_.gecko_trace_parser = std::make_unique(&context_); -#endif } context_.reader_registry->RegisterTraceReader( diff --git a/test/data/v8-samples.json.sha256 b/test/data/v8-samples.json.sha256 new file mode 100644 index 0000000000..58baadc32c --- /dev/null +++ b/test/data/v8-samples.json.sha256 @@ -0,0 +1 @@ +b0714096a2112ed161bda0aa4bbd6ab80f0ac195c72ff2be1a1a57272fd14735 \ No newline at end of file diff --git a/test/trace_processor/diff_tests/parser/chrome/tests_v8.py b/test/trace_processor/diff_tests/parser/chrome/tests_v8.py index f77a47aa9d..87c858493e 100644 --- a/test/trace_processor/diff_tests/parser/chrome/tests_v8.py +++ b/test/trace_processor/diff_tests/parser/chrome/tests_v8.py @@ -105,15 +105,40 @@ def test_v8_cpu_samples(self): return DiffTestBlueprint( trace=DataPath('v8-samples.pftrace'), query=''' - include perfetto module callstacks.stack_profile; + include perfetto module stacks.cpu_profiling; select name, source_file, self_count - from _callstacks_for_cpu_profile_stack_samples!( - cpu_profile_stack_sample - ) - where self_count > 0 - order by self_count desc - limit 20 + from cpu_profiling_summary_tree + where self_count >= 15 + order by self_count desc, source_file + ''', + out=Csv(''' + "name","source_file","self_count" + "(program)","[NULL]",17083 + "(program)","[NULL]",15399 + "(program)","[NULL]",9853 + "(program)","[NULL]",9391 + "(program)","[NULL]",7299 + "(program)","[NULL]",5245 + "(program)","[NULL]",2443 + "(garbage collector)","[NULL]",107 + "_.mg","chrome-untrusted://new-tab-page/one-google-bar?paramsencoded=",38 + "(garbage collector)","[NULL]",34 + "","https://www.google.com/xjs/_/js/k=xjs.hd.en.nSJdbfIGUiE.O/am=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAACAEKAAAABR4AAAAgAAAAAAAAAAQIAQDEAQAAAgA4AAAEAQAEABQQAAAKEATgUTYAgAAwAQAIAAAQAAACQAAACAAAAAMAACAIAAAAAKAAAAAAAAAAAAAAAAAAYAABBAAAAAAAAAAAAIACAAAAoAMAAAAAgAAAgIAAANghAwgAAAQAAACgDwCCB8AghQcAAAAAAAAAAAAAAAKQIJgLCSgIQAAAAAAAAAAAAAAAAACkpIkLCw/d=1/ed=1/dg=3/br=1/rs=ACT90oH8sSQRHJq5R0DO9ABVW-vZJa5Baw/ee=ALeJib:B8gLwd;AfeaP:TkrAjf;BMxAGc:E5bFse;BgS6mb:fidj5d;BjwMce:cXX2Wb;CxXAWb:YyRLvc;DULqB:RKfG5c;Dkk6ge:wJqrrd;DpcR3d:zL72xf;EABSZ:MXZt9d;ESrPQc:mNTJvc;EVNhjf:pw70Gc;EmZ2Bf:zr1jrb;EnlcNd:WeHg4;Erl4fe:FloWmf,FloWmf;F9mqte:UoRcbe;Fmv9Nc:O1Tzwc;G0KhTb:LIaoZ;G6wU6e:hezEbd;GleZL:J1A7Od;HMDDWe:G8QUdb;HoYVKb:PkDN7e;HqeXPd:cmbnH;IBADCc:RYquRb;IZrNqe:P8ha2c;IoGlCf:b5lhvb;IsdWVc:qzxzOb;JXS8fb:Qj0suc;JbMT3:M25sS;JsbNhc:Xd8iUd;KOxcK:OZqGte;KQzWid:ZMKkN;KcokUb:KiuZBf;KpR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ikZe:byfTOb,lsjVmc;LXA8b:q7OdKd;LsNahb:ucGLNb;Me32dd:MEeYgc;NPKaK:SdcwHb;NSEoX:lazG7b;Np8Qkd:Dpx6qc;Nyt6ic:jn2sGd;OgagBe:",18 + "da","https://www.google.com/",15 + ''')) + + def test_v8_cpu_samples_json(self): + return DiffTestBlueprint( + trace=DataPath('v8-samples.json'), + query=''' + include perfetto module stacks.cpu_profiling; + + select name, source_file, self_count + from cpu_profiling_summary_tree + where self_count >= 15 + order by self_count desc, name ''', out=Csv(''' "name","source_file","self_count" @@ -130,11 +155,4 @@ def test_v8_cpu_samples(self): "","https://www.google.com/xjs/_/js/k=xjs.hd.en.nSJdbfIGUiE.O/am=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAACAEKAAAABR4AAAAgAAAAAAAAAAQIAQDEAQAAAgA4AAAEAQAEABQQAAAKEATgUTYAgAAwAQAIAAAQAAACQAAACAAAAAMAACAIAAAAAKAAAAAAAAAAAAAAAAAAYAABBAAAAAAAAAAAAIACAAAAoAMAAAAAgAAAgIAAANghAwgAAAQAAACgDwCCB8AghQcAAAAAAAAAAAAAAAKQIJgLCSgIQAAAAAAAAAAAAAAAAACkpIkLCw/d=1/ed=1/dg=3/br=1/rs=ACT90oH8sSQRHJq5R0DO9ABVW-vZJa5Baw/ee=ALeJib:B8gLwd;AfeaP:TkrAjf;BMxAGc:E5bFse;BgS6mb:fidj5d;BjwMce:cXX2Wb;CxXAWb:YyRLvc;DULqB:RKfG5c;Dkk6ge:wJqrrd;DpcR3d:zL72xf;EABSZ:MXZt9d;ESrPQc:mNTJvc;EVNhjf:pw70Gc;EmZ2Bf:zr1jrb;EnlcNd:WeHg4;Erl4fe:FloWmf,FloWmf;F9mqte:UoRcbe;Fmv9Nc:O1Tzwc;G0KhTb:LIaoZ;G6wU6e:hezEbd;GleZL:J1A7Od;HMDDWe:G8QUdb;HoYVKb:PkDN7e;HqeXPd:cmbnH;IBADCc:RYquRb;IZ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qzxzOb;JXS8fb:Qj0suc;JbMT3:M25sS;JsbNhc:Xd8iUd;KOxcK:OZqGte;KQzWid:ZMKkN;KcokUb:KiuZBf;KpRAue:Tia57b;LBgRLc:SdcwHb,XVMNvd;LEikZe:byfTOb,lsjVmc;LXA8b:q7OdKd;LsNahb:ucGLNb;Me32dd:MEeYgc;NPKaK:SdcwHb;NSEoX:lazG7b;Np8Qkd:Dpx6qc;Nyt6ic:jn2sGd;OgagBe:",18 "da","https://www.google.com/",15 - "","https://www.gstatic.com/_/mss/boq-one-google/_/js/k=boq-one-google.OneGoogleWidgetUi.en.Dv_TT86KXl4.es5.O/ck=boq-one-google.OneGoogleWidgetUi.xexmpZqkioA.L.B1.O/am=QKBgwGw/d=1/exm=_b,_tp/excm=_b,_tp,calloutview/ed=1/wt=2/ujg=1/rs=AM-SdHu61g-i-YBZiLcGm3tURf4VJO5hyA/ee=EVNhjf:pw70Gc;EmZ2Bf:zr1jrb;Erl4fe:FloWmf;JsbNhc:Xd8iUd;LBgRLc:SdcwHb;Me32dd:MEeYgc;NPKaK:SdcwHb;NSEoX:lazG7b;Oj465e:KG2eXe;Pjplud:EEDORb;QGR0gd:Mlhmy;SNUn3:ZwDk9d;a56pNe:JEfCwb;cEt90b:ws9Tlc;dIoSBb:SpsfSb;eBAeSb:zbML3c;iFQyKf:QIhFr;io8t5d:yDVVkb;kMFpHd:OTA3Ae;nAFL3:s39S4;oGtAuc:sOXFj;pXdRYb:MdUzUe;qddgKe:xQtZb;sP4Vbe:VwDzFe;uY49fb:COQbmf;ul9GGd:VDovNc;wR5FRb:O1Gjze;xqZiqf:wmnU7d;yxTchf:KUM7Z;zxnPse:GkRiKb/m=ws9Tlc,n73qwf,GkRiKb,e5qFLc,IZT63,UUJqVe,O1Gjze,byfTOb,lsjVmc,xUdipf,OTA3Ae,COQbmf,fKUV3e,aurFic,U0aPgd,ZwDk9d,V3dDOb,mI3LFb,yYB61,O6y8ed,PrPYRd,MpJwZc,LEikZe,NwH0H,OmgaI,lazG7b,XVMNvd,L1AAkb,KUM7Z,Mlhmy,s39S4,lwddkf,gychg,w9hDv,EEDORb,RMhBfe,SdcwHb,aW3pY,pw70Gc,EFQ78c,Ulmmrd,ZfAoz,mdR7q,wmnU7d,xQtZb,JNoxi,kWgXee,MI6k7c,kjKdXe,BVgquf,QIhFr,ov",13 - "updateAttrs","https://ui.perfetto.dev/v46.0-0a53e685b/frontend_bundle.js",12 - "","https://www.gstatic.com/_/mss/boq-one-google/_/js/k=boq-one-google.OneGoogleWidgetUi.en.Dv_TT86KXl4.es5.O/am=QKBgwGw/d=1/excm=_b,_tp,calloutview/ed=1/dg=0/wt=2/ujg=1/rs=AM-SdHsuxqEW2z6uUf-9MJvUVpOyFk0ecQ/m=_b,_tp",11 - "a._isVisible","https://ogs.google.com/widget/callout?prid=19037050&pgid=19037049&puid=6a851fbb7ce797ac&eom=1&cce=1&dc=1&origin=https%3A%2F%2Fwww.google.com&cn=callout&pid=1&spid=538&hl=en&dm=",11 - "","chrome-untrusted://read-anything-side-panel.top-chrome/read_anything.js",11 - "","https://www.google.com/xjs/_/js/k=xjs.hd.en.nSJdbfIGUiE.O/ck=xjs.hd.F00K1IyvS9A.L.B1.O/am=IFEAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAIAAAEAAAAAAAASAEakAAABZ5sAMBiAAAABAAIAAQIAQDEAQAAAwQ4AAAEAQAUABQREAEKEgTgUTYAhIAwAQQoQAgUQAICQBCFCAAAAAMAACEIDDAMQKgAYBQgAAAAAEBABAAAYAA3BhAgAMAPAAAYAKICAAAhoAMQAAABgAJAgIACAtghAwgAAAQAAACgDwCCB8AghQcAAAAAAAAAAAAAAAKQIJgLCSgIQAAAAAAAAAAAAAAAAACkpIkLCw/d=0/dg=0/br=1/ujg=1/rs=ACT90oFYV6TnvY5P3NcVPbMRvVPRlxmm8A/m=sb_wiz,aa,abd,sytt,syts,sytn,syfx,sytr,sytd,sy101,syz7,syti,syz6,syto,sytq,sytm,syu7,sytb,syu8,syu9,syu0,syu4,sytj,syty,syu1,syu2,sytv,sytw,syte,sytf,sys4,syru,syrs,syrr,syth,syz5,syug,syuh,syuf,async,syvk,ifl,pHXghd,sf,sy1c2,sy1c5,sy4e0,sonic,TxCJfd,sy4e4,qzxzOb,IsdWVc,sy4e6,sy1gs,sy1d4,sy1d0,syrq,syro,syrp,syrn,syrm,sy4cl,sy4co,sy2ib,sy18p,sy18r,sy13l,sy13m,syrj,syrh,syfb,sybv,syby,sybt,sybx,sybw,sycp,spch,sys7,sys6,rtH1bd,sy1ea,sy19r,sy18g,syg9,sy1e9,sy13t,sy1e8,sy18h,sygb,sy1eb,SMquOb,sy8f,sygh,sygf,sygg,sygi,syge,sygp,sygn,sygl,sygd,sycm,sych,syck,syak,syac,syb6,syaj,syai,sya",10 - "maybeUpdateMoreOptions","chrome-untrusted://read-anything-side-panel.top-chrome/read_anything.js",10 '''))