[tbb-commits] [tor-browser] 231/311: Bug 1758795: Also call GIFFT code when calling members on TimingDistributionMetric::Child. r=chutten a=dmeehan

gitolite role git at cupani.torproject.org
Tue Apr 26 15:30:31 UTC 2022


This is an automated email from the git hooks/post-receive script.

pierov pushed a commit to branch geckoview-99.0.1-11.0-1
in repository tor-browser.

commit 3bb2288294c0adc7ed7bd0fcdcf200a309f25f2a
Author: Bas Schouten <bschouten at mozilla.com>
AuthorDate: Mon Mar 21 21:19:26 2022 +0000

    Bug 1758795: Also call GIFFT code when calling members on TimingDistributionMetric::Child. r=chutten a=dmeehan
    
    Depends on D140681
    
    Differential Revision: https://phabricator.services.mozilla.com/D140691
---
 .../glean/api/src/private/timing_distribution.rs   | 30 ++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/toolkit/components/glean/api/src/private/timing_distribution.rs b/toolkit/components/glean/api/src/private/timing_distribution.rs
index 1e2bd79a1117f..03a73b8ed1deb 100644
--- a/toolkit/components/glean/api/src/private/timing_distribution.rs
+++ b/toolkit/components/glean/api/src/private/timing_distribution.rs
@@ -124,6 +124,16 @@ impl TimingDistribution for TimingDistributionMetric {
                 if let Some(_v) = map.insert(id, Instant::now()) {
                     // TODO: report an error and find a different TimerId.
                 }
+                #[cfg(feature = "with_gecko")]
+                {
+                    extern "C" {
+                        fn GIFFT_TimingDistributionStart(metric_id: u32, timer_id: u64);
+                    }
+                    // SAFETY: using only primitives, no return value.
+                    unsafe {
+                        GIFFT_TimingDistributionStart(c.metric_id.0, id);
+                    }
+                }
                 id
             }
         }
@@ -159,6 +169,16 @@ impl TimingDistribution for TimingDistributionMetric {
                 inner.stop_and_accumulate(id);
             }
             TimingDistributionMetric::Child(c) => {
+                #[cfg(feature = "with_gecko")]
+                {
+                    extern "C" {
+                        fn GIFFT_TimingDistributionStopAndAccumulate(metric_id: u32, timer_id: u64);
+                    }
+                    // SAFETY: using only primitives, no return value.
+                    unsafe {
+                        GIFFT_TimingDistributionStopAndAccumulate(c.metric_id.0, id);
+                    }
+                }
                 let mut map = c
                     .instants
                     .write()
@@ -229,6 +249,16 @@ impl TimingDistribution for TimingDistributionMetric {
                 if map.remove(&id).is_none() {
                     // TODO: report an error (cancelled a non-started id).
                 }
+                #[cfg(feature = "with_gecko")]
+                {
+                    extern "C" {
+                        fn GIFFT_TimingDistributionCancel(metric_id: u32, timer_id: u64);
+                    }
+                    // SAFETY: using only primitives, no return value.
+                    unsafe {
+                        GIFFT_TimingDistributionCancel(c.metric_id.0, id);
+                    }
+                }
             }
         }
     }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the tbb-commits mailing list