This CL adds
- `kRequiresCallbacksUnderLock=false` to several chrome data sources: while true is the default for backward compatibility, these don't need it.
- Explicit Flush in BackgroundMetadataDataSource, to prevent data
loss; I'm investigating reasons why we often miss this event, this should help rule out data loss related to SMB scraping issue.
Change-Id: I37c386a85341797d69a18bf2452a59581f60cdcb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6305392
Reviewed-by: Mikhail Khokhlov <khokhlov@google.com>
Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1427109}
This UI was identified as an internal debugging tool in the WebUI
survey. Place it behind the InternalOnlyUisEnabled pref, so that its
availability is controlled from chrome://chrome-urls and it appears in
the "internal debugging pages" list on that page.
Bug: 379889249
Change-Id: I599f1ca5cb8183119c3184bd3e4cd342c5f2465b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6283647
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: Etienne Pierre-Doray <etiennep@chromium.org>
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1424158}
This UI was identified as an internal debugging tool in the WebUI
survey. Place it behind the InternalOnlyUisEnabled pref, so that its
availability is controlled from chrome://chrome-urls and it appears in
the "internal debugging pages" list on that page.
Bug: 379889249
Change-Id: Ie4db9ac8a4d40d188a89196380483e37166728ad
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6283168
Reviewed-by: Eric Seckler <eseckler@chromium.org>
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1423371}
This CL changes the histogram creation APIs to take a durable
string view (i.e., a pointer+size pair referring to memory that
the programmer has annotated that it will not be freed) instead
of just an implicit pointer. The HistogramBase class internally
represents the name's length and the histogram's flags using
16 bits in order to not grow the in-memory size of Histogram
objects. The name of the histogram is subsequently exposed by
HistogramBase as a string_view.
This CL updates consumers of the histogram name's to use a
string_view of the name. This removes many string length
calculations and string copy operations. For histograms
allocated in shared memory, it also avoids potential out-of-
bounds reads if the underlying string data is modified or
corrupted such that it no longer has a trailing NUL char
at the end of the string.
Lastly, this CL updates a number of call-sites where the
histogram names were being copied into short-lived string
objects for use as search keys into various containers to
perform the functionality without making any unnecessary
copies.
Low-Coverage-Reason: TRIVIAL_CHANGE Use of string_view instead of string/char* in some error/logging paths have low coverage.
AX-Relnotes: n/a
Bug: 393394360, 40818143
Change-Id: Iee9ee5ae62335b9e7815f4ae11bde4ff80cfd4a2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6231451
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: Antonio Rivera <antoniori@google.com>
Commit-Queue: Roger McFarlane <rogerm@chromium.org>
Reviewed-by: Etienne Pierre-Doray <etiennep@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1422750}
This prevent triggering the wrong rule if multiple rules
have the same names and the histogram is emitted outside the
browser process.
Bug: 40257548
Change-Id: Id352dea12fa77389da893a550e1d6d4a5d359d7a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6282886
Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1422556}
To record all or specific histogram on threshold.
This has a few advantages over CustomEventRecorder
- Supports perfetto config coming from field tracing
- Supports thresholds
- Supports multiple sessions
- Doesn't rely on chrome_config string
Change-Id: I05287bd98901056c6a2b4cd46b97772dd8493d45
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6254221
Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
Reviewed-by: Mikhail Khokhlov <khokhlov@google.com>
Reviewed-by: Giovanni Ortuno Urquidi <ortuno@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1422191}
This CL adds a histogram scoper to connect flow id to observers,
to links histogram samples to semantically related events in tracing.
This is more robust and extensible than the previous solution
based on hashing histogram names.
Bug: 40257548
Change-Id: Ib1d5d5da42c84ff548a16b622f8932eb5dd206ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6233616
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: Dave Tapuska <dtapuska@chromium.org>
Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
Reviewed-by: Giovanni Ortuno Urquidi <ortuno@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1418857}
I'm pushing for more triggers to share the same scenario for simplicity.
The downside is that upload quota is currently per-scenario;
It's hard to ensure that triggers are well balanced; The workaround
is to enforce upload quota per (scenario,rule).
Change-Id: I9fd1f99108e0e9c500d8fdbf1c90813db8cd966f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6240296
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1417339}
DatabaseOptions is getting too large for the "explicit out of line
constructor for complex types" presubmit. Adding a constructor to it
prevents it from being an aggregate type, which is how most of the
callers currently use it.
This Cl makes DatabaseOptions members private and adds builder-type
setters for each member. It also updates all callers, and adds an out of
line constructor.
A future improvement could be to add a passkey to the setters for
discouraged options.
Bug: None
Change-Id: I63562f43c8b290247878d194039487b240e958c2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6216099
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: Greg Thompson <grt@chromium.org>
Owners-Override: Gabriel Charette <gab@chromium.org>
Commit-Queue: Anthony Vallée-Dubois <anthonyvd@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1414974}
This page was reported by the team and confirmed via code review as an
internal debugging tool, but after reviewing the implementation of
placing the UI behind a pref controlled via chrome://chrome-urls, the
team would now prefer this to be considered an external facing UI.
Bug: 379889249
Change-Id: I277f1e53285ad61aea70c20f458bf8e69fe9a506
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6208369
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Reviewed-by: Eric Seckler <eseckler@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1413659}
This change allows tracing scenarios to collect system-wide traces using
the system tracing backend (traced).
To enable this feature:
This revision adds the support of system-wide background tracing in
tracing scenarios. A tracing scenario switches to the system tracing
backend (traced) when the following conditions are all met:
1. EnablePerfettoSystemTracing is enabled: Chrome sends trace data to
the system backend.
2. EnablePerfettoSystemBackgroundTracing is enabled: this feature flag
controls whether the scenarios are allowed to use the system backend.
3 use_system_backend is set to true in the scenario config. The scenario
needs to explicitly specify that it will use the system backend.
In cases of mismatched configuration between feature flags and scenario
config:
* If the scenario requests the system backend but the feature flags
are disabled, the scenario will be ignored (considered a server
config error).
* If the feature flags are enabled but the scenario doesn't request the
system backend, the default custom backend will be used.
Bug: b:388424720
Test: unit tests TracingScenarioSystemBackendTest.*
Change-Id: I33cb2f45e59194e4348a09573e2db3f44df43d60
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5581575
Reviewed-by: Eric Seckler <eseckler@chromium.org>
Reviewed-by: Etienne Pierre-Doray <etiennep@chromium.org>
Commit-Queue: Chinglin Yu <chinglinyu@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1413380}
This CL uses scenario names to identify enabled scenario presets.
This allows us to keep enabled scenarios when the config is updated.
This also renames "Clear" button to "Reset" to make it clear that
this resets to the default state.
Change-Id: Iaf0243769a07aaabd31da865a92e4c3a5e83117c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6204122
Reviewed-by: Giovanni Ortuno Urquidi <ortuno@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1412526}
Tracing "net-log" category captures NetLog events but trace logs
don't contain //net constants. This prevent us from converting a trace
log to a NetLog. Since tracing has better capabilities than NetLog
(e.g., tracing can capture NetLog events even after the network
service crashes), it would be nice to have a way to convert
tracing logs to NetLogs. The NetLog format and the NetLog viewer [1]
is still useful for investigating //net specific bugs. This CL adds
//net constants to metadata of a trace log.
[1] https://netlog-viewer.appspot.com/
Bug: 385170278
Change-Id: I9c64e1b6efb578c9fc1741d08146a16250794d12
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6176642
Reviewed-by: Eric Seckler <eseckler@chromium.org>
Commit-Queue: Kenichi Ishibashi <bashi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1407210}
This should make metrics reporting more accurate, and allow
retry uploading if chrome shuts down before serialize_log_callback
finishes.
Change-Id: Id0413f166c35eb307730abce1788ca743c354c91
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6132289
Owners-Override: Gabriel Charette <gab@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1401799}
Specifically extending from chrome://tracing and
chrome://webrtc-internals. These UIs were identified by OWNERS in a
recent Chromium WebUI survey as targeted at Chromium developers and
as UIs that could be placed behind a pref.
The pref behavior is currently behind the InternalOnlyUisPref
feature flag.
Bug: 379889249
Change-Id: I05eae03748661e58d7dcf994e0c5a0d97cfe8c1c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6107298
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: Eric Seckler <eseckler@chromium.org>
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1399306}
trace_report.mojom includes
content/browser/tracing/trace_report/trace_report_database.h which
depends on an auto-generated file sql/sql_name_variants.h.
This CL makes sure that sql_name_variants.h is generated before
generating C++ file from trace_report.mojom.
Bug: 385158081
Change-Id: Ibd6fc5714302b3642e4b88e3e2487a7e39dced39
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6114572
Commit-Queue: Peter Wen <wnwen@chromium.org>
Commit-Queue: Alex Ilin <alexilin@chromium.org>
Reviewed-by: Peter Wen <wnwen@chromium.org>
Auto-Submit: Alex Ilin <alexilin@chromium.org>
Owners-Override: Peter Wen <wnwen@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1399254}
Previously, PerfettoTaskRunner was exposed publicly
by PerfettoTracedProcess and used to post tasks.
This CL avoids exposing it and makes sure
it's only create to interface with perfetto.
This also deletes RebindableTaskRunner and simplify testing code.
Bug: 343404899
Change-Id: I4a36f700dd8ae59c12d606c52b7d8f57f4798e82
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6078187
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: Francois Pierre Doray <fdoray@chromium.org>
Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
Reviewed-by: Alex Rudenko <alexrudenko@chromium.org>
Reviewed-by: Yury Khmel <khmel@chromium.org>
Reviewed-by: Mikhail Khokhlov <khokhlov@google.com>
Cr-Commit-Position: refs/heads/main@{#1396904}
This CL implements test replacements for MockProducer
and TestDataSource, and deletes ProducerClient.
This temporarily moves RebindableTaskRunner to tracing::TestUtils
(to be deleted in follow-up), to fix TracingServiceTest.
Bug: 343404899
Change-Id: Id78a73dd55c461b362fe1a5010c9a9b603846e81
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6078882
Reviewed-by: Yury Khmel <khmel@chromium.org>
Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
Reviewed-by: Francois Pierre Doray <fdoray@chromium.org>
Reviewed-by: Mikhail Khokhlov <khokhlov@google.com>
Cr-Commit-Position: refs/heads/main@{#1395562}
This CL adds a flow that connects to scenario triggers.
The flow is added on all histogram samples and named triggers.
It can also be connected to specific trace events: this
connects "MainThreadsCongestion" as an example.
Drive-by: rename rule_id/rule_name to avoid ambiguity
Drive-by: delete unused BackgroundTracingRule::trigger_delay_
Change-Id: I94959c5323172fd6a75f9361c5d47dbba199fa6f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6055229
Reviewed-by: Etienne Bergeron <etienneb@chromium.org>
Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1391114}