about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-12-08 19:43:29 +0000
committerbors <bors@rust-lang.org>2019-12-08 19:43:29 +0000
commit59947fcae6a40df12e33af8c8c7291014b7603e0 (patch)
tree1a907c4e7eb84627dcbfdafa847e88fac671860b
parentdb7ca254ea6740d15ca37be25822265357f7abcc (diff)
parentedcca15c5b2aeccc4dc0fb7946b283e9f2fe319c (diff)
downloadrust-59947fcae6a40df12e33af8c8c7291014b7603e0.tar.gz
rust-59947fcae6a40df12e33af8c8c7291014b7603e0.zip
Auto merge of #66981 - michaelwoerister:measureme-0.5.0, r=Mark-Simulacrum
Update measureme crate to 0.5.0

This PR updates the `measureme` self-profiling crate to the latest release. Heads up, this version changes the trace file format, so the `summarize` tool on perf.rlo needs to be updated to 0.5 too.

r? @Mark-Simulacrum
cc @wesleywiser
-rw-r--r--Cargo.lock9
-rw-r--r--src/librustc/Cargo.toml2
-rw-r--r--src/librustc_codegen_ssa/Cargo.toml2
-rw-r--r--src/librustc_data_structures/Cargo.toml2
-rw-r--r--src/librustc_data_structures/profiling.rs19
-rw-r--r--src/librustc_metadata/Cargo.toml2
6 files changed, 17 insertions, 19 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 161c9d3aade..5484f240031 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2055,12 +2055,13 @@ dependencies = [
 
 [[package]]
 name = "measureme"
-version = "0.4.0"
+version = "0.5.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cd21b0e6e1af976b269ce062038fe5e1b9ca2f817ab7a3af09ec4210aebf0d30"
+checksum = "c420bbc064623934620b5ab2dc0cf96451b34163329e82f95e7fa1b7b99a6ac8"
 dependencies = [
  "byteorder",
  "memmap",
+ "parking_lot 0.9.0",
  "rustc-hash",
 ]
 
@@ -2072,9 +2073,9 @@ checksum = "2efc7bc57c883d4a4d6e3246905283d8dae951bb3bd32f49d6ef297f546e1c39"
 
 [[package]]
 name = "memmap"
-version = "0.6.2"
+version = "0.7.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e2ffa2c986de11a9df78620c01eeaaf27d94d3ff02bf81bfcca953102dd0c6ff"
+checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b"
 dependencies = [
  "libc",
  "winapi 0.3.8",
diff --git a/src/librustc/Cargo.toml b/src/librustc/Cargo.toml
index f8ad6f8f30e..791d72d6b77 100644
--- a/src/librustc/Cargo.toml
+++ b/src/librustc/Cargo.toml
@@ -37,6 +37,6 @@ byteorder = { version = "1.3" }
 chalk-engine = { version = "0.9.0", default-features=false }
 rustc_fs_util = { path = "../librustc_fs_util" }
 smallvec = { version = "1.0", features = ["union", "may_dangle"] }
-measureme = "0.4"
+measureme = "0.5"
 rustc_error_codes = { path = "../librustc_error_codes" }
 rustc_session = { path = "../librustc_session" }
diff --git a/src/librustc_codegen_ssa/Cargo.toml b/src/librustc_codegen_ssa/Cargo.toml
index 53d3c51b5f8..d489852a1a4 100644
--- a/src/librustc_codegen_ssa/Cargo.toml
+++ b/src/librustc_codegen_ssa/Cargo.toml
@@ -13,7 +13,7 @@ test = false
 bitflags = "1.2.1"
 cc = "1.0.1"
 num_cpus = "1.0"
-memmap = "0.6"
+memmap = "0.7"
 log = "0.4.5"
 libc = "0.2.44"
 jobserver = "0.1.11"
diff --git a/src/librustc_data_structures/Cargo.toml b/src/librustc_data_structures/Cargo.toml
index 0fd47115022..7fa40b8a869 100644
--- a/src/librustc_data_structures/Cargo.toml
+++ b/src/librustc_data_structures/Cargo.toml
@@ -26,7 +26,7 @@ rustc-hash = "1.0.1"
 smallvec = { version = "1.0", features = ["union", "may_dangle"] }
 rustc_index = { path = "../librustc_index", package = "rustc_index" }
 bitflags = "1.2.1"
-measureme = "0.4"
+measureme = "0.5"
 
 [dependencies.parking_lot]
 version = "0.9"
diff --git a/src/librustc_data_structures/profiling.rs b/src/librustc_data_structures/profiling.rs
index 86f59bfabe6..f9bfe5a1652 100644
--- a/src/librustc_data_structures/profiling.rs
+++ b/src/librustc_data_structures/profiling.rs
@@ -7,7 +7,7 @@ use std::sync::Arc;
 use std::thread::ThreadId;
 use std::u32;
 
-use measureme::{StringId, TimestampKind};
+use measureme::{StringId};
 
 /// MmapSerializatioSink is faster on macOS and Linux
 /// but FileSerializationSink is faster on Windows
@@ -63,8 +63,8 @@ const EVENT_FILTERS_BY_NAME: &[(&str, EventFilter)] = &[
     ("incr-cache-load", EventFilter::INCR_CACHE_LOADS),
 ];
 
-fn thread_id_to_u64(tid: ThreadId) -> u64 {
-    unsafe { mem::transmute::<ThreadId, u64>(tid) }
+fn thread_id_to_u32(tid: ThreadId) -> u32 {
+    unsafe { mem::transmute::<ThreadId, u64>(tid) as u32 }
 }
 
 
@@ -149,11 +149,10 @@ impl SelfProfilerRef {
     /// Record a query in-memory cache hit.
     #[inline(always)]
     pub fn query_cache_hit(&self, query_name: impl QueryName) {
-        self.non_guard_query_event(
+        self.instant_query_event(
             |profiler| profiler.query_cache_hit_event_kind,
             query_name,
             EventFilter::QUERY_CACHE_HITS,
-            TimestampKind::Instant,
         );
     }
 
@@ -184,22 +183,20 @@ impl SelfProfilerRef {
     }
 
     #[inline(always)]
-    fn non_guard_query_event(
+    fn instant_query_event(
         &self,
         event_kind: fn(&SelfProfiler) -> StringId,
         query_name: impl QueryName,
         event_filter: EventFilter,
-        timestamp_kind: TimestampKind
     ) {
         drop(self.exec(event_filter, |profiler| {
             let event_id = SelfProfiler::get_query_name_string_id(query_name);
-            let thread_id = thread_id_to_u64(std::thread::current().id());
+            let thread_id = thread_id_to_u32(std::thread::current().id());
 
-            profiler.profiler.record_event(
+            profiler.profiler.record_instant_event(
                 event_kind(profiler),
                 event_id,
                 thread_id,
-                timestamp_kind,
             );
 
             TimingGuard::none()
@@ -306,7 +303,7 @@ impl<'a> TimingGuard<'a> {
         event_kind: StringId,
         event_id: StringId,
     ) -> TimingGuard<'a> {
-        let thread_id = thread_id_to_u64(std::thread::current().id());
+        let thread_id = thread_id_to_u32(std::thread::current().id());
         let raw_profiler = &profiler.profiler;
         let timing_guard = raw_profiler.start_recording_interval_event(event_kind,
                                                                        event_id,
diff --git a/src/librustc_metadata/Cargo.toml b/src/librustc_metadata/Cargo.toml
index b70cc529386..88d1c501bae 100644
--- a/src/librustc_metadata/Cargo.toml
+++ b/src/librustc_metadata/Cargo.toml
@@ -12,7 +12,7 @@ doctest = false
 [dependencies]
 flate2 = "1.0"
 log = "0.4"
-memmap = "0.6"
+memmap = "0.7"
 smallvec = { version = "1.0", features = ["union", "may_dangle"] }
 rustc = { path = "../librustc" }
 rustc_data_structures = { path = "../librustc_data_structures" }