Commit Graph

145 Commits

Author SHA1 Message Date
Marco Castelluccio
e04a715222 Bug 1790816 - Reformat toolkit/ with isort. r=linter-reviewers,Standard8 DONTBUILD
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D162670
2022-11-22 18:23:54 +00:00
Mike Hommey
cdb0e73562 Bug 1799751 - Reduce the size of code, data and relocations for Vec<String>s used in metrics. r=janerik
Differential Revision: https://phabricator.services.mozilla.com/D161663
2022-11-09 09:19:03 +00:00
Chris H-C
4b5957c1e1 Bug 1767055 - Support Glean metrics in Artifact Builds r=nalexander,janerik
If there's no `COMPILE_ENVIRONMENT`, generate jogfile.json during build.
It contains information about all the metrics and pings.

If we are both not MOZILLA_OFFICIAL _and_ mozilla::IsDevelopmentBuild,
we look for the jogfile on the first use of the Glean or GleanPings global.

If we find the jogfile, we load our metric and ping info from there,
making it available to JS.

JOG isn't instrumented as it only does anything when !MOZILLA_OFFICIAL,
which is exactly the condition for disabling ping upload (see rust feature
`glean_disable_upload`), so we wouldn't expect to ever hear anything.

Differential Revision: https://phabricator.services.mozilla.com/D160540
2022-11-03 14:08:27 +00:00
Cosmin Sabou
fcbabfb45f Backed out changeset a66be20c8f9f (bug 1767055) for gtest failures on FOGFixture.TestJogfile. CLOSED TREE 2022-11-02 22:12:06 +02:00
Chris H-C
42bf882616 Bug 1767055 - Support Glean metrics in Artifact Builds r=nalexander,janerik
If there's no `COMPILE_ENVIRONMENT`, generate jogfile.json during build.
It contains information about all the metrics and pings.

If we are both not MOZILLA_OFFICIAL _and_ mozilla::IsDevelopmentBuild,
we look for the jogfile on the first use of the Glean or GleanPings global.

If we find the jogfile, we load our metric and ping info from there,
making it available to JS.

JOG isn't instrumented as it only does anything when !MOZILLA_OFFICIAL,
which is exactly the condition for disabling ping upload (see rust feature
`glean_disable_upload`), so we wouldn't expect to ever hear anything.

Differential Revision: https://phabricator.services.mozilla.com/D160540
2022-11-02 16:52:07 +00:00
Iulian Moraru
852c772a56 Backed out changeset 7e6ddb806ce0 (bug 1767055) for causing gtest failures on FOGFixture.TestJogfile. CLOSED TREE 2022-11-02 16:48:23 +02:00
Chris H-C
e1ce6eff23 Bug 1767055 - Support Glean metrics in Artifact Builds r=nalexander,janerik
If there's no `COMPILE_ENVIRONMENT`, generate jogfile.json during build.
It contains information about all the metrics and pings.

If we are both not MOZILLA_OFFICIAL _and_ mozilla::IsDevelopmentBuild,
we look for the jogfile on the first use of the Glean or GleanPings global.

If we find the jogfile, we load our metric and ping info from there,
making it available to JS.

JOG isn't instrumented as it only does anything when !MOZILLA_OFFICIAL,
which is exactly the condition for disabling ping upload (see rust feature
`glean_disable_upload`), so we wouldn't expect to ever hear anything.

Differential Revision: https://phabricator.services.mozilla.com/D160540
2022-11-02 12:49:00 +00:00
Chris H-C
e01e97a473 Bug 1794123 - Update the Glean SDK Update documentation r=perry.mcmanis,janerik DONTBUILD
While we're here, quote the gtest arg for shells that greedily glob.

Differential Revision: https://phabricator.services.mozilla.com/D159436
2022-10-17 15:04:40 +00:00
Chris H-C
8f877b6f06 Bug 1767039 - Expand JOG to support event metrics r=TravisLong
Differential Revision: https://phabricator.services.mozilla.com/D158060
2022-10-12 16:35:28 +00:00
Chris H-C
6f407fdebb Bug 1767040 - Support runtime-registered pings in Glean r=TravisLong
Differential Revision: https://phabricator.services.mozilla.com/D158023
2022-10-07 20:27:50 +00:00
Butkovits Atila
f7b8ddb53d Backed out changeset e34d6904966b (bug 1767040) for causing build bustages. CLOSED TREE 2022-10-07 18:10:25 +03:00
Chris H-C
a1752e40bf Bug 1767040 - Support runtime-registered pings in Glean r=TravisLong
Differential Revision: https://phabricator.services.mozilla.com/D158023
2022-10-07 14:45:37 +00:00
Nika Layzell
24ddcc4984 Bug 1686265 - Don't re-parse the same glean files multiple times, r=chutten
This reduces the number of times we re-parse the same glean file, and means we
only use 2 GeneratedFiles directives to generate the relevant files for Glean.

This will also make errors generated by the validator only print once.

The problem in the original patch appears to be caused by the use of the rust
file ('api/src/metrics.rs'), as the first argument to the GeneratedFile. This
messed with the location of things like generated deps files for the build
script, and the path of the stub file, which were placed alongside the
`metrics.rs` file, and not in the directory the build system was expecting.

This issue appears to be fixed if the arguments are re-ordered, such that a
header file appears first instead.

Differential Revision: https://phabricator.services.mozilla.com/D158273
2022-09-30 00:42:45 +00:00
Csoregi Natalia
e3b0970cdf Backed out changeset 6f1d00d07032 (bug 1767040) for causing build bustages. CLOSED TREE 2022-09-23 19:17:30 +03:00
Chris H-C
7d87dfd426 Bug 1767040 - Support runtime-registered pings in Glean r=TravisLong
Differential Revision: https://phabricator.services.mozilla.com/D158023
2022-09-23 15:49:33 +00:00
Chris H-C
f504deed34 Bug 1789917 - Use a full mozbuild config to find glean tags r=saschanaz,janerik
Also, update tags to include newly-added and newly-revealed components.

Differential Revision: https://phabricator.services.mozilla.com/D156888
2022-09-09 15:09:39 +00:00
Chris H-C
0e89d4563f Bug 1784551 - Remove unnecessary and vocal build-time print r=janerik
Differential Revision: https://phabricator.services.mozilla.com/D154560
2022-08-15 12:48:48 +00:00
Jan-Erik Rediger
85dcae1bb7 Bug 1781030 - Upgrade to Glean v51.0.1. r=perry.mcmanis,supply-chain-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D152626
2022-08-01 10:50:47 +00:00
Jan-Erik Rediger
819eaa2c21 Bug 1779992 - mach subcommand to upgrade Glean across all files. r=chutten DONTBUILD
This only modifies the files and prints the steps to be done manually.

Differential Revision: https://phabricator.services.mozilla.com/D152627
2022-07-26 13:51:31 +00:00
Bas Schouten
187dc0fb33 Bug 1772510: Add 'mach perf-data-review' command that generates a template data review for simple performance monitoring probes. r=chutten,ahochheiden
Differential Revision: https://phabricator.services.mozilla.com/D148255
2022-07-08 12:40:44 +00:00
Chris H-C
d0a181d9f3 Bug 1698184 - Build a factory for runtime-defined metrics r=janerik
Pieces include
* A script for collecting all the ids for metric _types_
* A template for generating the factory that can build each of those types
* mozbuild integration

Differential Revision: https://phabricator.services.mozilla.com/D143048
2022-06-21 20:34:54 +00:00
Chris H-C
bb292484a9 Bug 1698184 - Move submetrics to 2^25 to make room for dynamic metrics r=janerik
Previously we used the 27th bit to signal if a metric instance was actually a
labeled_* metric's "submetric". This bit is actually part of the metric type
part of the lower (upper?) 32 bits of the metric_entry_t, but that was okay
because builtin metrics all have their top 5 bits scrubbed.

itsFreeRealEstate.jpg

This can no longer work, though, since JOG will need to be able to have its
own submetrics that don't conflict _and_ will need to keep the type bits
around so we know what instances to build.

(( Yes, yes, I could've designed the system so that we didn't need to,
but this was the less complicated way. We can go down this route when we
provision the 34 Millionth metric and run out of space. ))

So that means taking two bits away from the id portion: one for runtime (we'll
give it 2^26) and one for submetric (2^25).

Differential Revision: https://phabricator.services.mozilla.com/D143044
2022-06-21 20:34:52 +00:00
Jan-Erik Rediger
71d82443ad Bug 1720494 - Call glean_parser's translate.transform_metrics directly. r=chutten
Differential Revision: https://phabricator.services.mozilla.com/D145951
2022-06-07 12:37:21 +00:00
Jan-Erik Rediger
4ca6841988 Bug 1768834 - Switch to Glean with UniFFI integration r=glandium,chutten
Upgrades to Glean v50.0.1, which comes with a rewritten core and
UniFFI-powered bindings.
Glean has some API changes, so we swap it over to that. Mostly mechanical changes.
Also upgrades to inherent v1.0 in fog.
This matches what Glean uses internally and gets rid of one duplicated crate.

Also upgrades to glean-parser==6.0.1

One crate duplication now (change in `python/mozbuild/mozbuild/vendor/vendor_rust.py` required).
Some new crates now vendored.
These are transitive dependencies of Glean dependencies, all with valid
licenses and already used in other products (mobile).

Differential Revision: https://phabricator.services.mozilla.com/D146062
2022-06-07 12:37:20 +00:00
Chris H-C
5698e27df3 Bug 1768636 - Scope GIFFT timer maps to metrics r=TravisLong
TimerIds are only unique for a given metric, not globally.

Differential Revision: https://phabricator.services.mozilla.com/D145988
2022-05-10 20:38:30 +00:00
Alessio Placitelli
ce5636eb29 Bug 1766980 - Implement the URL type in FOG. r=chutten
This adds both the core Rust implementation and the
code to enable the needed language bindings. This
additionally enables GIFFT on the URL type, mirroring
them to a string scalar.

Differential Revision: https://phabricator.services.mozilla.com/D145215
2022-05-02 16:05:55 +00:00
Chris H-C
a89db552ac Bug 1763593 - Bypass NS_DispatchToMainThread's assert while handling the leak. r=TravisLong
Differential Revision: https://phabricator.services.mozilla.com/D144175
2022-04-21 20:57:41 +00:00
Chris H-C
780d421a5f Bug 1763593 - Clear the map immediately if already late in shutdown r=TravisLong
Differential Revision: https://phabricator.services.mozilla.com/D144174
2022-04-21 20:57:41 +00:00
Chris H-C
0b70e659ac Bug 1763593 - GIFFT mirroring is now fallible r=janerik
We need to clear state at shutdown that we hold for GIFFT mirroring purposes.
However, more data can come in even later (there's nothing stopping it. Plus,
Glean can meaningfully record later given its shutdown happens in a later
phase), so the naive approach of lazy-instantiate and RunOnShutdown-clear
doesn't work.

Since Telemetry is only good to AppShutdownTelemetry, we now fail to mirror to
it after AppShutdownTelemetry and clear state in the immediately-next phase.

Also, data can come in earlier than we have a main thread to dispatch to,
requiring some careful finagling of threads to ensure our cleanup routine
is appropriately registered.

Differential Revision: https://phabricator.services.mozilla.com/D143522
2022-04-14 15:17:29 +00:00
Chris H-C
78ee8295fb Bug 1758795 - Run cleanup registration on main thread r=TravisLong
If we don't, we assert if the first GIFFT-enabled timing distribution's
instrumentation thread on a given process is not the main thread.

Differential Revision: https://phabricator.services.mozilla.com/D141632
2022-03-21 21:19:26 +00:00
Alessio Placitelli
1f413b4f52 Bug 1754474 - Update FOG tests to use Glean's expiration by version. r=chutten
Depends on D138448

Differential Revision: https://phabricator.services.mozilla.com/D138466
2022-02-15 13:35:08 +00:00
Alessio Placitelli
da2efe54e4 Bug 1754474 - Enable Glean built-in expiration by version in FOG. r=chutten
Depends on D138446

Differential Revision: https://phabricator.services.mozilla.com/D138447
2022-02-15 13:35:08 +00:00
Marian-Vasile Laza
74eb39b9b5 Backed out 4 changesets (bug 1754474) for causing bc test failures. CLOSED TREE
Backed out changeset c6dd8b681aca (bug 1754474)
Backed out changeset 596955256cc6 (bug 1754474)
Backed out changeset fc692b3c27a2 (bug 1754474)
Backed out changeset 59eb7951a5eb (bug 1754474)
2022-02-11 17:30:03 +02:00
Alessio Placitelli
289fd0f870 Bug 1754474 - Update FOG tests to use Glean's expiration by version. r=chutten
Differential Revision: https://phabricator.services.mozilla.com/D138466
2022-02-11 14:27:39 +00:00
Alessio Placitelli
b117dea769 Bug 1754474 - Enable Glean built-in expiration by version in FOG. r=chutten
Differential Revision: https://phabricator.services.mozilla.com/D138447
2022-02-11 14:27:38 +00:00
Alexandre Lissy
ec2ff1ac12 Bug 1751177 - Revert glean workaround for HashMap r=janerik
Differential Revision: https://phabricator.services.mozilla.com/D137317
2022-01-31 20:46:48 +00:00
Chris H-C
be38aca544 Bug 1752417 - Clean GIFFT Maps at shutdown r=janerik
This wasn't caught by test_GIFFT because xpcshell doesn't run a leakcheck.

Differential Revision: https://phabricator.services.mozilla.com/D137208
2022-01-28 21:16:59 +00:00
Csoregi Natalia
c95198d74e Backed out changeset 71a21bee6a2c (bug 1752417) for failures on browser_labeled_gifft.js. CLOSED TREE 2022-01-28 20:29:51 +02:00
Chris H-C
94823e1787 Bug 1752417 - Clean GIFFT Maps at shutdown r=janerik
This wasn't caught by test_GIFFT because xpcshell doesn't run a leakcheck.

Differential Revision: https://phabricator.services.mozilla.com/D137208
2022-01-28 17:07:23 +00:00
William Lachance
e52fe70191 Bug 1746941 - Add tags to all Firefox-on-Glean metrics r=janerik
Based on our experience with Firefox for Android, annotating Glean metrics
with issue tracker component information can provide valuable context to
anyone searching for metrics.

This adds a new set of tags corresponding to the components in the
tree, annotates the existing Glean metrics. Finally, it also adds a new
mach command called `update-glean-tags` to update the tags files based
on build metadata.

Differential Revision: https://phabricator.services.mozilla.com/D134332
2022-01-14 18:11:08 +00:00
Sandor Molnar
22d98c8bb4 Backed out changeset c0de94959204 (bug 1746941) for causing pythong unit test failures. CLOSED TREE 2022-01-14 18:59:04 +02:00
William Lachance
3b8109f402 Bug 1746941 - Add tags to all Firefox-on-Glean metrics r=janerik
Based on our experience with Firefox for Android, annotating Glean metrics
with issue tracker component information can provide valuable context to
anyone searching for metrics.

This adds a new set of tags corresponding to the components in the
tree, annotates the existing Glean metrics. Finally, it also adds a new
mach command called `update-glean-tags` to update the tags files based
on build metadata.

Differential Revision: https://phabricator.services.mozilla.com/D134332
2022-01-14 16:43:08 +00:00
Jan-Erik Rediger
ccb8ab9de0 Bug 1746254 - Use simple default hash state to avoid random seeding r=chutten,padenot
This replaces the default-used `RandomState`[1] on the hashmaps used in
FOG's IPC with a simple wrapper around `DefaultHasher`.

`RandomState` uses `DefaultHasher` internally, which at the moment of
this commit, uses `SipHasher13` internally.
Our `HashState` does the same, but with default keys of `(0, 0)`
(whereas `RandomState` uses some random keys).

This will result in the same hashes used for the same values in
different hashmaps.
But this should be fine for the use here:
The key for all those hash maps is a `MetricId`, which is a simple `u32`.
It's already a unique identifier generated from defined metrics and not
user-manipulated.
Therefore we shouldn't need to worry about HashDos-resistance.

[1]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html

Differential Revision: https://phabricator.services.mozilla.com/D135208
2022-01-12 10:10:30 +00:00
Jan-Erik Rediger
0bfc8e749c Bug 1708668 - Enable Counter, String, Boolean and labeled metrics on Android. r=chutten
With the former 3 enabled we can enable labeled metrics as well,
because they only exist for these 3.
That also makes testing easier because we don't need to special case
that.

Differential Revision: https://phabricator.services.mozilla.com/D126800
2021-10-22 08:53:29 +00:00
Chris H-C
6e04617493 Bug 1716340 - GIFFT codegen should enforce no more than 1 metric may mirror to any probe r=janerik
The code was already trying to do this but was comparing tuples instead of
mirror probe names. Guess it got missed in a refactor.

Amusingly I was violating the invariant in two places and had to fix 'em : |

Differential Revision: https://phabricator.services.mozilla.com/D127546
2021-10-05 13:55:03 +00:00
Alex Lopez
5db2d91e9f Bug 1696251: Allow mach commands as stand-alone functions and adapt existing commands. r=mhentges,webdriver-reviewers,perftest-reviewers,sparky,whimboo
This removes the `@CommandProvider` decorator and the need to implement
mach commands inside subclasses of `MachCommandBase`, and moves all
existing commands out from classes to module level functions.

Differential Revision: https://phabricator.services.mozilla.com/D121512
2021-09-27 18:12:51 +00:00
Butkovits Atila
776d615efa Backed out changeset 53b1fa0faa6d (bug 1696251) for breaking the static-analysis integration. a=backout 2021-09-23 13:06:40 +03:00
Alex Lopez
05519dde6e Bug 1696251: Allow mach commands as stand-alone functions and adapt existing commands. r=mhentges,webdriver-reviewers,perftest-reviewers,sparky,whimboo
This removes the `@CommandProvider` decorator and the need to implement
mach commands inside subclasses of `MachCommandBase`, and moves all
existing commands out from classes to module level functions.

Differential Revision: https://phabricator.services.mozilla.com/D121512
2021-09-21 20:38:16 +00:00
Butkovits Atila
c1ea191790 Backed out changeset 510dd46a9de7 (bug 1696251) for causing Android build bustages. 2021-09-21 05:16:50 +03:00
Alex Lopez
f3dec7c4dd Bug 1696251: Allow mach commands as stand-alone functions and adapt existing commands. r=mhentges,webdriver-reviewers,perftest-reviewers,sparky,whimboo
This removes the `@CommandProvider` decorator and the need to implement
mach commands inside subclasses of `MachCommandBase`, and moves all
existing commands out from classes to module level functions.

Differential Revision: https://phabricator.services.mozilla.com/D121512
2021-09-20 20:21:07 +00:00