-
Notifications
You must be signed in to change notification settings - Fork 2.2k
fix: android: do not initialize tracing if it is disabled #38956
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: master
Are you sure you want to change the base?
Conversation
f6715f3
to
c525049
Compare
PR #38956: Size comparison from 162df09 to c525049 Full report (3 builds for cc32xx, stm32)
|
c525049
to
0294d9d
Compare
PR #38956: Size comparison from 162df09 to 0294d9d Full report (44 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, nrfconnect, psoc6, qpg, stm32, telink, tizen)
|
6b3dc3e
to
06cfe7c
Compare
PR #38956: Size comparison from 162df09 to 06cfe7c Full report (5 builds for cc32xx, stm32, tizen)
|
06cfe7c
to
16032b3
Compare
PR #38956: Size comparison from 0238fed to 16032b3 Full report (3 builds for cc32xx, stm32)
|
@j0tunn until now android is always built with tracing enabled. Do you have specific needs to compile it without tracing? The question that needs to be answered in the PR summary is also why something is needed. Design currently seems to be "this platform always wants tracing". |
16032b3
to
5ccf921
Compare
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.
Changes requested:
- update summary to give detail about testing (since it is manual, provide full instructions for the issue to be reproducible)
- describe in the summary on why we want to support android without tracing? Is this a size difference or performance increase or a customer requested thing (do we have a reported issue for this with explanation) or something else
- fix build/CI
87c2306
to
33a7337
Compare
PR #38956: Size comparison from 4cb3032 to 33a7337 Full report (3 builds for cc32xx, stm32)
|
33a7337
to
2b22353
Compare
PR #38956: Size comparison from a8b1926 to 2b22353 Full report (73 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
src/platform/android/BUILD.gn
Outdated
"${chip_root}/src/tracing/perfetto:event_storage", | ||
"${chip_root}/src/tracing/perfetto:simple_initialization", | ||
] | ||
deps = [ "${chip_root}/src/tracing:tracing_buildconfig" ] |
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.
these deps do not seem used if the source files are not compiled?
Why are we not keeping tracing source_set as is, but add a dependency on it based on matter_enable_tracing_support? And the AndroidChipPlatform-JNI is the one that uses build_config.
So we should have: static_library('android') changed:
- it requires the buildconfig dependency
- it requires to make the tracing dependency optional. Also is it needed to be excluded? Would link-time optimization not remove the tracing.h/cpp calls if they are not referenced?
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.
Request changes: build.gn should be updated:
- add dependency where you need it (not in a empty source set)
- conditional seems to be needed on the dependency addition not in wiping out the entire tracing bit
I believe the CI will guide you to do these changes as well (I see build failing without it).
Since CI is red: did you actually test your changes locally? Summary claims you did however I do not understand how that test passed when CI is red.
2b22353
to
7d311f0
Compare
PR #38956: Size comparison from c745bea to 7d311f0 Full report (73 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
I've tested it in on our custom build which is generated from gn files. |
7d311f0
to
d84ae7e
Compare
PR #38956: Size comparison from 2ed64bc to d84ae7e Full report (73 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
} | ||
|
||
public_deps = [ | ||
"${chip_root}/src/platform:platform_base", |
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.
Is there a reason we need platform-base?
Can these be "deps" instead of "public_deps" (given that changes occur in cpp only, so we do not need to expose these beyond that in headers)?
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.
platform_base
was here before my changes. I've just add tracing_buildconfig
here.
@andy31415 Can you suggest somebody who can review this PR. Looks like CI still waiting for second approve |
For now android build always include perfetto tracing. We shouldn't build it if tracing is disabled via build argument
matter_enable_tracing_support
.Tracing increases the target binary size and build time. Thats a "pay-for-use" thing: do not compile tracing code into target binary if tracing is disabled.
Testing
Manual build. Steps:
matter_enable_tracing_support = false