Commit graph

129 commits

Author SHA1 Message Date
Chris H-C
66a9f375c8 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
94b2463ce2 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
21fd159579 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
740a43ba09 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
2219ed2a49 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
6a8e5cb0fb 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
5c0d663676 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
8182bee632 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
14fee064de 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
2449975afb 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
e3d4d5098d 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
bb93306954 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
80631a305a 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
d956dfa608 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
52f4d17c8f 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
92fb8ee097 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
013d79e7e6 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
124d54e0d7 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
6a820246b0 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
24c7f6aaca 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
f3655031f0 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
399df8bf8b 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
8e57f596de 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
af8f04a00d 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
c5d5f045aa Backed out changeset c0de94959204 (bug 1746941) for causing pythong unit test failures. CLOSED TREE 2022-01-14 18:59:04 +02:00
William Lachance
cf406dbbc9 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
f14d782241 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
14f625808d 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
8cbbdae43c 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
63022efc7a 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
eb735ac57e Backed out changeset 53b1fa0faa6d (bug 1696251) for breaking the static-analysis integration. a=backout 2021-09-23 13:06:40 +03:00
Alex Lopez
a8e7083c84 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
c06a3dd9fa Backed out changeset 510dd46a9de7 (bug 1696251) for causing Android build bustages. 2021-09-21 05:16:50 +03:00
Alex Lopez
fe61e94ec8 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
Noemi Erli
91aa2e2b9c Backed out changeset 5f5b612878f3 (bug 1696251) for causing multiple bustages 2021-09-18 02:22:39 +03:00
Alex Lopez
bf860fe7dc 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-17 19:00:39 +00:00
Chris H-C
86fc7a1397 Bug 1715639 - Introducing mach data-review for one of your Glean data review needs r=janerik,mhentges
Differential Revision: https://phabricator.services.mozilla.com/D124464
2021-09-03 20:20:12 +00:00
Chris H-C
278838b824 Bug 1720491 - Refactor run_glean_parser to be more testable r=janerik
Differential Revision: https://phabricator.services.mozilla.com/D121127
2021-07-29 13:40:16 +00:00
Chris H-C
0a41e710fe Bug 1694496 - Annotate FOG JS PHF entries for their widths r=janerik
Without these annotations the literals will be assumed to be `int` so as soon
as there's a literal that cannot be represented as such it'll warn.
And CI builds with warnings as errors.

`metric_entry_t` is `uint64_t` which is `unsigned long long int` which is `ull`
`category_entry_t` is `uint32_t` which is `unsigned long int` which is `ul`

Differential Revision: https://phabricator.services.mozilla.com/D119978
2021-07-15 16:05:52 +00:00
Chris H-C
025e7eb04f Bug 1694496 - GIFFT for FOG rate metric r=janerik
Differential Revision: https://phabricator.services.mozilla.com/D119788
2021-07-15 16:05:52 +00:00
Chris H-C
e9bc7d86c7 Bug 1694496 - Add 'rate' metric type to FOG (Rust) r=janerik
Differential Revision: https://phabricator.services.mozilla.com/D119785
2021-07-15 16:05:51 +00:00
Butkovits Atila
40a0e20486 Backed out 5 changesets (bug 1694496) for causing build bustages on GleanJSMetricsLookup.h. CLOSED TREE
Backed out changeset 86dc6a0fd554 (bug 1694496)
Backed out changeset 9ccad5fe13e7 (bug 1694496)
Backed out changeset 887eaee3ab5c (bug 1694496)
Backed out changeset 36421c124795 (bug 1694496)
Backed out changeset 9591dcd4369d (bug 1694496)
2021-07-14 19:46:38 +03:00
Chris H-C
895c3c8aac Bug 1694496 - GIFFT for FOG rate metric r=janerik
Differential Revision: https://phabricator.services.mozilla.com/D119788
2021-07-14 16:13:49 +00:00
Chris H-C
30f1f5d53c Bug 1694496 - Add 'rate' metric type to FOG (Rust) r=janerik
Differential Revision: https://phabricator.services.mozilla.com/D119785
2021-07-14 16:13:48 +00:00
Chris H-C
4f3313d052 Bug 1683171 - JS/C++ FOG test APIs will now fail if there are errors r=janerik
Differential Revision: https://phabricator.services.mozilla.com/D117923
2021-06-22 18:34:33 +00:00
Csoregi Natalia
e46aba44fe Backed out 2 changesets (bug 1683171) for bustage on Counter.cpp. CLOSED TREE
Backed out changeset 50d55b80e7a1 (bug 1683171)
Backed out changeset 0e14f3d135e1 (bug 1683171)
2021-06-22 19:55:50 +03:00
Chris H-C
cb30e92549 Bug 1683171 - JS/C++ FOG test APIs will now fail if there are errors r=janerik
Differential Revision: https://phabricator.services.mozilla.com/D117923
2021-06-22 15:15:31 +00:00
Butkovits Atila
eef7eae906 Backed out 2 changesets (bug 1683171) for causing Python3 failures. CLOSED TREE
Backed out changeset 401623bf09ce (bug 1683171)
Backed out changeset 2782440566b7 (bug 1683171)
2021-06-21 23:00:59 +03:00
Chris H-C
33a4af2c00 Bug 1683171 - JS/C++ FOG test APIs will now fail if there are errors r=janerik
Differential Revision: https://phabricator.services.mozilla.com/D117923
2021-06-21 19:08:46 +00:00
Jan-Erik Rediger
d0fd4c9cbc Bug 1713398 - Implement the Glean custom distribution. r=chutten
Also includes an upgrade to glean_parser.
Enables GIFFT as well, mapping between Glean's custom distribution and
Firefox Telemetry's linear or exponential histograms directly.

Differential Revision: https://phabricator.services.mozilla.com/D117420
2021-06-15 07:42:15 +00:00