[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



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@xxxxxxxxxxx>
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.
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits