component("startup_tracing") {Justin CohenIf there isn't a need for this to be separate from "tracing_config" above, I'd lean towards folding it into the same target for simplicity (I think conceptually that target covers startup_tracing_controller; funnily "tracing_config" used to be called something like "startup_tracing").
Etienne Pierre-DorayThis was to avoid
ERROR Dependency cycle:
//services/tracing/public/cpp:cpp ->
//components/tracing:tracing_config ->
//services/tracing/public/cpp:cpp
Justin CohenAh I see!
Come to think of it, any reason we can't put startup_tracing_controller.h directly in services/tracing/public/cpp?
Done
class EmergencyTraceFinalisationCoordinator {
public:
static EmergencyTraceFinalisationCoordinator& GetInstance() {
static base::NoDestructor<EmergencyTraceFinalisationCoordinator> instance;
return *instance;
}Justin CohenI don't like the lifetime of EmergencyTraceFinalisationCoordinator (and the design in general), and saw it's making things more complicated in the follow-up.
I tried something here: https://chromium-review.git.corp.google.com/c/chromium/src/+/7779464
To delete EmergencyTraceFinalisationCoordinator entirely and manage all lifetime in StartupTracingController.
Feel free to incorporate in your CL.
Done
if (startup_tracing_controller_) {
startup_tracing_controller_->ShutdownAndWaitForStopIfNeeded();
}Justin CohenWe might want to move this at the end of the function so the move is a no-op.
Done
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
class EmergencyTraceFinalisationCoordinator {
public:
static EmergencyTraceFinalisationCoordinator& GetInstance() {
static base::NoDestructor<EmergencyTraceFinalisationCoordinator> instance;
return *instance;
}Justin CohenI don't like the lifetime of EmergencyTraceFinalisationCoordinator (and the design in general), and saw it's making things more complicated in the follow-up.
I tried something here: https://chromium-review.git.corp.google.com/c/chromium/src/+/7779464
To delete EmergencyTraceFinalisationCoordinator entirely and manage all lifetime in StartupTracingController.
Feel free to incorporate in your CL.
Done
Reverted this change.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
[iOS tracing] Move StartupTracingController to components/tracing/commonArthur SonzogniI will defer to components/tracing/OWNERS (e.g. @etie...@chromium.org)
Please close this to add visibility again, and I will stamp after a sanity check.
(-visibility, still waiting on this)
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
if (GetOutputLocation() ==
OutputLocation::kDirectoryWithDefaultBasename ||
GetOutputLocation() ==
OutputLocation::kDirectoryWithBasenameUpdatedBeforeStop) {
tracing::StartupTracingController::SetDefaultBasenameForTest(
"trace1", tracing::StartupTracingController::ExtensionType::
kAppendAppropriate);
} else {
// Fallback to explicitly initializing it if we don't set a basename
tracing::TraceStartupConfig::GetInstance();
}I'm not sure why this change is needed, but specifically, OutputLocation has 3 values (already handled), so it looks like the `else {}` doesn't handle anything.
Am I missing something?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
[iOS tracing] Move StartupTracingController to components/tracing/commonArthur SonzogniI will defer to components/tracing/OWNERS (e.g. @etie...@chromium.org)
Please close this to add visibility again, and I will stamp after a sanity check.
(-visibility, still waiting on this)
Etienne stamped with a followup (which I'll look at now!)
Can you also PTAL?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Auto-Submit | +1 |
| Commit-Queue | +1 |
class EmergencyTraceFinalisationCoordinator {
public:
static EmergencyTraceFinalisationCoordinator& GetInstance() {
static base::NoDestructor<EmergencyTraceFinalisationCoordinator> instance;
return *instance;
}Justin CohenI don't like the lifetime of EmergencyTraceFinalisationCoordinator (and the design in general), and saw it's making things more complicated in the follow-up.
I tried something here: https://chromium-review.git.corp.google.com/c/chromium/src/+/7779464
To delete EmergencyTraceFinalisationCoordinator entirely and manage all lifetime in StartupTracingController.
Feel free to incorporate in your CL.
Justin CohenDone
Reverted this change.
Done
if (GetOutputLocation() ==
OutputLocation::kDirectoryWithDefaultBasename ||
GetOutputLocation() ==
OutputLocation::kDirectoryWithBasenameUpdatedBeforeStop) {
tracing::StartupTracingController::SetDefaultBasenameForTest(
"trace1", tracing::StartupTracingController::ExtensionType::
kAppendAppropriate);
} else {
// Fallback to explicitly initializing it if we don't set a basename
tracing::TraceStartupConfig::GetInstance();
}I'm not sure why this change is needed, but specifically, OutputLocation has 3 values (already handled), so it looks like the `else {}` doesn't handle anything.
Am I missing something?
Removed the incorrect inner GetOutputLocation() checks, but left the else fallback, so we explicitly force TraceStartupConfig creation when SetDefaultBasenameForTest is skipped.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Auto-Submit | +0 |
+thakis for base/thread/thread_restrictions.h class move.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Thanks!
if (BrowserMainLoop::GetInstance() &&
BrowserMainLoop::GetInstance()->startup_tracing_controller()) {Previously, there was no "if". What happens if you turn the "if" into a CHECK?
AndroidPathGeneratorCallback android_path_generator_callback_;Can we make this argument Android specific (e.g. BUILDFLAG(..))
AndroidPathGeneratorCallback android_path_generator_callback,Can we make this argument Android specific (e.g. BUILDFLAG(..))
// Signature of the callback used to generate a path on Android.
// The callback should return a FilePath matching the given basename.
using AndroidPathGeneratorCallback =
base::RepeatingCallback<base::FilePath(std::string_view)>;Can we make this argument Android specific (e.g. BUILDFLAG(..))
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
if (BrowserMainLoop::GetInstance() &&
BrowserMainLoop::GetInstance()->startup_tracing_controller()) {Previously, there was no "if". What happens if you turn the "if" into a CHECK?
Done
AndroidPathGeneratorCallback android_path_generator_callback_;Can we make this argument Android specific (e.g. BUILDFLAG(..))
Done
AndroidPathGeneratorCallback android_path_generator_callback,Can we make this argument Android specific (e.g. BUILDFLAG(..))
Done
// Signature of the callback used to generate a path on Android.
// The callback should return a FilePath matching the given basename.
using AndroidPathGeneratorCallback =
base::RepeatingCallback<base::FilePath(std::string_view)>;Can we make this argument Android specific (e.g. BUILDFLAG(..))
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
if (BrowserMainLoop::GetInstance() &&
BrowserMainLoop::GetInstance()->startup_tracing_controller()) {Previously, there was no "if". What happens if you turn the "if" into a CHECK?
Acknowledged
AndroidPathGeneratorCallback android_path_generator_callback,Can we make this argument Android specific (e.g. BUILDFLAG(..))
Acknowledged
// Signature of the callback used to generate a path on Android.
// The callback should return a FilePath matching the given basename.
using AndroidPathGeneratorCallback =
base::RepeatingCallback<base::FilePath(std::string_view)>;Can we make this argument Android specific (e.g. BUILDFLAG(..))
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +2 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
[tracing] Move StartupTracingController to services/tracing/public/cpp
This CL extracts `StartupTracingController` out of `content/browser` and
moves it into `services/tracing/public/cpp`. This allows the startup
tracing logic to be shared and reused across different platforms and
components that do not depend on the full `content/` layer (such as
iOS).
As part of this migration, several architectural improvements were made:
- Removed the global singleton `g_instance` from `StartupTracingController`.
- The `EmergencyTraceFinalisationCoordinator` helper class was moved to
`services/tracing/public/cpp` and updated to use `base::WaitableEvent`
and `base::AtomicFlag` for cleaner thread-safe coordination during
emergency stop.
- The controller is now explicitly instantiated and owned by
`content::BrowserMainLoop`.
- The finalization of startup tracing in `BrowserMainLoop::PreShutdown()`
was moved to the end of the function to ensure other services have
finished their work before tracing stops.
- Simplified how tests override tracing behaviors. Parameters like
default basename and temporary file policies are now configured via
static methods on `StartupTracingController` rather than being plumbed
through `ContentMainParams`.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |