-
Notifications
You must be signed in to change notification settings - Fork 723
Allow heapprofd_standalone_client to build for Chrome #5162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -135,12 +135,16 @@ shared_library("heapprofd_api_noop") { | |
|
|
||
| # This target does absolutely nothing, so we do not want to depend on | ||
| # liblog. | ||
| configs -= [ "//gn/standalone:android_liblog" ] # nogncheck | ||
| if (perfetto_build_standalone) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (here and below) well also `|| build_with_android) no? (or !build_with_chromium to be more conservative) |
||
| configs -= [ "//gn/standalone:android_liblog" ] # nogncheck | ||
| } | ||
| sources = [ "client_api_noop.cc" ] | ||
| } | ||
|
|
||
| shared_library("heapprofd_client_api") { | ||
| configs -= [ "//gn/standalone:android_liblog" ] # nogncheck | ||
| if (perfetto_build_standalone) { | ||
| configs -= [ "//gn/standalone:android_liblog" ] # nogncheck | ||
| } | ||
| if (perfetto_build_with_android) { | ||
| cflags = [ "-DPERFETTO_ANDROID_ASYNC_SAFE_LOG" ] | ||
| } else { | ||
|
|
@@ -352,33 +356,35 @@ perfetto_unittest_source_set("unittests") { | |
| } | ||
| } | ||
|
|
||
| source_set("end_to_end_tests") { | ||
| testonly = true | ||
| deps = [ | ||
| ":client", | ||
| ":daemon", | ||
| ":wire_protocol", | ||
| "../../../gn:default_deps", | ||
| "../../../gn:gtest_and_gmock", | ||
| "../../../gn:libunwindstack", | ||
| "../../../protos/perfetto/config/profiling:cpp", | ||
| "../../../protos/perfetto/trace/interned_data:cpp", | ||
| "../../../protos/perfetto/trace/profiling:cpp", | ||
| "../../../test:integrationtest_initializer", | ||
| "../../../test:test_helper", | ||
| "../../base", | ||
| "../../base:test_support", | ||
| "../../trace_processor:lib", | ||
| "../../tracing/test:test_support", | ||
| ] | ||
| sources = [ | ||
| "heapprofd_end_to_end_test.cc", | ||
| "heapprofd_producer_integrationtest.cc", | ||
| ] | ||
| if (perfetto_build_with_android) { | ||
| deps += [ ":heapprofd_client_api" ] | ||
| } else { | ||
| deps += [ ":heapprofd_standalone_client" ] | ||
| if (enable_perfetto_integration_tests) { | ||
| source_set("end_to_end_tests") { | ||
| testonly = true | ||
| deps = [ | ||
| ":client", | ||
| ":daemon", | ||
| ":wire_protocol", | ||
| "../../../gn:default_deps", | ||
| "../../../gn:gtest_and_gmock", | ||
| "../../../gn:libunwindstack", | ||
| "../../../protos/perfetto/config/profiling:cpp", | ||
| "../../../protos/perfetto/trace/interned_data:cpp", | ||
| "../../../protos/perfetto/trace/profiling:cpp", | ||
| "../../../test:integrationtest_initializer", | ||
| "../../../test:test_helper", | ||
| "../../base", | ||
| "../../base:test_support", | ||
| "../../trace_processor:lib", | ||
| "../../tracing/test:test_support", | ||
| ] | ||
| sources = [ | ||
| "heapprofd_end_to_end_test.cc", | ||
| "heapprofd_producer_integrationtest.cc", | ||
| ] | ||
| if (perfetto_build_with_android) { | ||
| deps += [ ":heapprofd_client_api" ] | ||
| } else { | ||
| deps += [ ":heapprofd_standalone_client" ] | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,7 +47,7 @@ constexpr size_t kMaxRegisterDataSize = | |
| sizeof(uint64_t) * unwindstack::ARM64_REG_LAST, | ||
| sizeof(uint32_t) * unwindstack::X86_REG_LAST, | ||
| sizeof(uint64_t) * unwindstack::X86_64_REG_LAST, | ||
| sizeof(uint64_t) * unwindstack::RISCV64_REG_COUNT}); | ||
| sizeof(uint64_t) * unwindstack::RISCV64_REG_MAX}); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is preceisely the problem I was describing. You are effetively trying to undo https://android-review.git.corp.google.com/c/platform/external/perfetto/+/2918494 likely becuase your libunwindstack version is behind upstream. Unfortunately this creates a upstream XOR your_version situation that doesn't work for us
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As far as I can tell, Chrome's libunwindstack is mostly only used for Perfetto so I think it's fine to align the two versions. |
||
|
|
||
| // Types needed for the wire format used for communication between the client | ||
| // and heapprofd. The basic format of a record sent by the client is | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so this is likely to cause problems in the rolls.
libunwind stack is subjected to breaking changes every now and then. when it happens, we have to catch up with upstream (Android). But this means whenver we do, the chromium roll will fail.
It's the biggest worry I have about this PR. This is going to doom us to get stuck on the chromium rolls.
I think the best ay forward would be to create an indirection layer in the unwinder, and allow chrome to plug in its unwinder (you can use your own copy of libunwindstack, and that's better because there is no direct coupling)
This dependency is going to be a time-bomb unfortunately
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I've noticed that libunwindstack in Chrome is also broken (it does not successfully strip the pointer-authentication bits). Is there an underlying reason why libunwindstack is used for Perfetto instead of the canonical LLVM libunwind?