Skip to content

Allow heapprofd_standalone_client to build for Chrome#5162

Open
Sentimentron wants to merge 1 commit intogoogle:mainfrom
Sentimentron:chrome-libheaprofd
Open

Allow heapprofd_standalone_client to build for Chrome#5162
Sentimentron wants to merge 1 commit intogoogle:mainfrom
Sentimentron:chrome-libheaprofd

Conversation

@Sentimentron
Copy link

This allows libheaprofd_standalone_client.so to be included in the chrome_public_apk target for tracing Chrome's custom allocators.

Main changes:

  • Re-plumbs the GN build to remove/simplify dependencies for Chromium.
  • Adds a "lib" prefix to kSkipMaps.

AI disclosure: I used Gemini CLI to get started and find the main things that needed to change. This PR is derived from that, alongside human review and cleanup.

This allows libheaprofd_standalone_client to be included in the
chrome_public_apk target for tracing Chrome's custom allocators.

* Re-plumbs the GN build to remove/simplify dependencies for Chromium.
* Adds a "lib" prefix to kSkipMaps.

AI: Utilized
Bug: 493606829
@Sentimentron Sentimentron requested a review from a team as a code owner March 17, 2026 19:13
@primiano
Copy link
Member

I'm happy to look at this. I just am a bit delayed due to traveling in CN right now. i'll try to get this later today.
I skimmed through that and seems sensible

@primiano primiano self-requested a review March 18, 2026 01:19
Copy link
Member

@primiano primiano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, as much as I'm sympathetic with what you are trying to do, this change as proposed is unfeasible because of version skews of libunwindstack. see comments below.

public_deps = [ "//buildtools:libunwindstack" ]
if (build_with_chromium && is_android) {
public_configs = [ "//third_party/libunwindstack:libunwindstack_config" ]
public_deps = [ "//third_party/libunwindstack" ]
Copy link
Member

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

# This target does absolutely nothing, so we do not want to depend on
# liblog.
configs -= [ "//gn/standalone:android_liblog" ] # nogncheck
if (perfetto_build_standalone) {
Copy link
Member

Choose a reason for hiding this comment

The 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)

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});
Copy link
Member

@primiano primiano Mar 19, 2026

Choose a reason for hiding this comment

The 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

@primiano
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants