Skip to content

Commit edcca15

Browse files
Update measureme crate to 0.5.0.
1 parent 4787e97 commit edcca15

File tree

6 files changed

+17
-19
lines changed

6 files changed

+17
-19
lines changed

Cargo.lock

+5-4
Original file line numberDiff line numberDiff line change
@@ -2053,12 +2053,13 @@ dependencies = [
20532053

20542054
[[package]]
20552055
name = "measureme"
2056-
version = "0.4.0"
2056+
version = "0.5.0"
20572057
source = "registry+https://github.com/rust-lang/crates.io-index"
2058-
checksum = "cd21b0e6e1af976b269ce062038fe5e1b9ca2f817ab7a3af09ec4210aebf0d30"
2058+
checksum = "c420bbc064623934620b5ab2dc0cf96451b34163329e82f95e7fa1b7b99a6ac8"
20592059
dependencies = [
20602060
"byteorder",
20612061
"memmap",
2062+
"parking_lot 0.9.0",
20622063
"rustc-hash",
20632064
]
20642065

@@ -2070,9 +2071,9 @@ checksum = "2efc7bc57c883d4a4d6e3246905283d8dae951bb3bd32f49d6ef297f546e1c39"
20702071

20712072
[[package]]
20722073
name = "memmap"
2073-
version = "0.6.2"
2074+
version = "0.7.0"
20742075
source = "registry+https://github.com/rust-lang/crates.io-index"
2075-
checksum = "e2ffa2c986de11a9df78620c01eeaaf27d94d3ff02bf81bfcca953102dd0c6ff"
2076+
checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b"
20762077
dependencies = [
20772078
"libc",
20782079
"winapi 0.3.8",

src/librustc/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,5 @@ byteorder = { version = "1.3" }
3737
chalk-engine = { version = "0.9.0", default-features=false }
3838
rustc_fs_util = { path = "../librustc_fs_util" }
3939
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
40-
measureme = "0.4"
40+
measureme = "0.5"
4141
rustc_error_codes = { path = "../librustc_error_codes" }

src/librustc_codegen_ssa/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ test = false
1313
bitflags = "1.2.1"
1414
cc = "1.0.1"
1515
num_cpus = "1.0"
16-
memmap = "0.6"
16+
memmap = "0.7"
1717
log = "0.4.5"
1818
libc = "0.2.44"
1919
jobserver = "0.1.11"

src/librustc_data_structures/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ rustc-hash = "1.0.1"
2626
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
2727
rustc_index = { path = "../librustc_index", package = "rustc_index" }
2828
bitflags = "1.2.1"
29-
measureme = "0.4"
29+
measureme = "0.5"
3030

3131
[dependencies.parking_lot]
3232
version = "0.9"

src/librustc_data_structures/profiling.rs

+8-11
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use std::sync::Arc;
77
use std::thread::ThreadId;
88
use std::u32;
99

10-
use measureme::{StringId, TimestampKind};
10+
use measureme::{StringId};
1111

1212
/// MmapSerializatioSink is faster on macOS and Linux
1313
/// but FileSerializationSink is faster on Windows
@@ -63,8 +63,8 @@ const EVENT_FILTERS_BY_NAME: &[(&str, EventFilter)] = &[
6363
("incr-cache-load", EventFilter::INCR_CACHE_LOADS),
6464
];
6565

66-
fn thread_id_to_u64(tid: ThreadId) -> u64 {
67-
unsafe { mem::transmute::<ThreadId, u64>(tid) }
66+
fn thread_id_to_u32(tid: ThreadId) -> u32 {
67+
unsafe { mem::transmute::<ThreadId, u64>(tid) as u32 }
6868
}
6969

7070

@@ -149,11 +149,10 @@ impl SelfProfilerRef {
149149
/// Record a query in-memory cache hit.
150150
#[inline(always)]
151151
pub fn query_cache_hit(&self, query_name: impl QueryName) {
152-
self.non_guard_query_event(
152+
self.instant_query_event(
153153
|profiler| profiler.query_cache_hit_event_kind,
154154
query_name,
155155
EventFilter::QUERY_CACHE_HITS,
156-
TimestampKind::Instant,
157156
);
158157
}
159158

@@ -184,22 +183,20 @@ impl SelfProfilerRef {
184183
}
185184

186185
#[inline(always)]
187-
fn non_guard_query_event(
186+
fn instant_query_event(
188187
&self,
189188
event_kind: fn(&SelfProfiler) -> StringId,
190189
query_name: impl QueryName,
191190
event_filter: EventFilter,
192-
timestamp_kind: TimestampKind
193191
) {
194192
drop(self.exec(event_filter, |profiler| {
195193
let event_id = SelfProfiler::get_query_name_string_id(query_name);
196-
let thread_id = thread_id_to_u64(std::thread::current().id());
194+
let thread_id = thread_id_to_u32(std::thread::current().id());
197195

198-
profiler.profiler.record_event(
196+
profiler.profiler.record_instant_event(
199197
event_kind(profiler),
200198
event_id,
201199
thread_id,
202-
timestamp_kind,
203200
);
204201

205202
TimingGuard::none()
@@ -306,7 +303,7 @@ impl<'a> TimingGuard<'a> {
306303
event_kind: StringId,
307304
event_id: StringId,
308305
) -> TimingGuard<'a> {
309-
let thread_id = thread_id_to_u64(std::thread::current().id());
306+
let thread_id = thread_id_to_u32(std::thread::current().id());
310307
let raw_profiler = &profiler.profiler;
311308
let timing_guard = raw_profiler.start_recording_interval_event(event_kind,
312309
event_id,

src/librustc_metadata/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ doctest = false
1212
[dependencies]
1313
flate2 = "1.0"
1414
log = "0.4"
15-
memmap = "0.6"
15+
memmap = "0.7"
1616
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
1717
rustc = { path = "../librustc" }
1818
rustc_data_structures = { path = "../librustc_data_structures" }

0 commit comments

Comments
 (0)