Upgrade to measureme 9.0.0
This commit is contained in:
parent
f58ffc9381
commit
5ac5556d63
5 changed files with 22 additions and 25 deletions
19
Cargo.lock
19
Cargo.lock
|
@ -1957,6 +1957,17 @@ dependencies = [
|
||||||
"rustc-hash",
|
"rustc-hash",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "measureme"
|
||||||
|
version = "9.0.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "22bf8d885d073610aee20e7fa205c4341ed32a761dbde96da5fd96301a8d3e82"
|
||||||
|
dependencies = [
|
||||||
|
"parking_lot 0.11.0",
|
||||||
|
"rustc-hash",
|
||||||
|
"smallvec 1.4.2",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "memchr"
|
name = "memchr"
|
||||||
version = "2.3.3"
|
version = "2.3.3"
|
||||||
|
@ -3089,7 +3100,7 @@ dependencies = [
|
||||||
"indexmap",
|
"indexmap",
|
||||||
"jobserver",
|
"jobserver",
|
||||||
"libc",
|
"libc",
|
||||||
"measureme",
|
"measureme 0.7.1",
|
||||||
"parking_lot 0.11.0",
|
"parking_lot 0.11.0",
|
||||||
"rustc-ap-rustc_graphviz",
|
"rustc-ap-rustc_graphviz",
|
||||||
"rustc-ap-rustc_index",
|
"rustc-ap-rustc_index",
|
||||||
|
@ -3491,7 +3502,7 @@ version = "0.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"libc",
|
"libc",
|
||||||
"measureme",
|
"measureme 9.0.0",
|
||||||
"rustc-demangle",
|
"rustc-demangle",
|
||||||
"rustc_ast",
|
"rustc_ast",
|
||||||
"rustc_attr",
|
"rustc_attr",
|
||||||
|
@ -3557,7 +3568,7 @@ dependencies = [
|
||||||
"indexmap",
|
"indexmap",
|
||||||
"jobserver",
|
"jobserver",
|
||||||
"libc",
|
"libc",
|
||||||
"measureme",
|
"measureme 9.0.0",
|
||||||
"parking_lot 0.11.0",
|
"parking_lot 0.11.0",
|
||||||
"rustc-hash",
|
"rustc-hash",
|
||||||
"rustc-rayon",
|
"rustc-rayon",
|
||||||
|
@ -3862,7 +3873,7 @@ version = "0.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"chalk-ir",
|
"chalk-ir",
|
||||||
"measureme",
|
"measureme 9.0.0",
|
||||||
"polonius-engine",
|
"polonius-engine",
|
||||||
"rustc-rayon-core",
|
"rustc-rayon-core",
|
||||||
"rustc_apfloat",
|
"rustc_apfloat",
|
||||||
|
|
|
@ -11,7 +11,7 @@ doctest = false
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bitflags = "1.0"
|
bitflags = "1.0"
|
||||||
libc = "0.2"
|
libc = "0.2"
|
||||||
measureme = "0.7.1"
|
measureme = "9.0.0"
|
||||||
snap = "1"
|
snap = "1"
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
rustc_middle = { path = "../rustc_middle" }
|
rustc_middle = { path = "../rustc_middle" }
|
||||||
|
|
|
@ -25,7 +25,7 @@ rustc-hash = "1.1.0"
|
||||||
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
|
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
|
||||||
rustc_index = { path = "../rustc_index", package = "rustc_index" }
|
rustc_index = { path = "../rustc_index", package = "rustc_index" }
|
||||||
bitflags = "1.2.1"
|
bitflags = "1.2.1"
|
||||||
measureme = "0.7.1"
|
measureme = "9.0.0"
|
||||||
libc = "0.2"
|
libc = "0.2"
|
||||||
stacker = "0.1.12"
|
stacker = "0.1.12"
|
||||||
tempfile = "3.0.5"
|
tempfile = "3.0.5"
|
||||||
|
|
|
@ -94,23 +94,9 @@ use std::process;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::time::{Duration, Instant};
|
use std::time::{Duration, Instant};
|
||||||
|
|
||||||
use measureme::{EventId, EventIdBuilder, SerializableString, StringId};
|
use measureme::{EventId, EventIdBuilder, Profiler, SerializableString, StringId};
|
||||||
use parking_lot::RwLock;
|
use parking_lot::RwLock;
|
||||||
|
|
||||||
cfg_if! {
|
|
||||||
if #[cfg(any(windows, target_os = "wasi"))] {
|
|
||||||
/// FileSerializationSink is faster on Windows
|
|
||||||
type SerializationSink = measureme::FileSerializationSink;
|
|
||||||
} else if #[cfg(target_arch = "wasm32")] {
|
|
||||||
type SerializationSink = measureme::ByteVecSink;
|
|
||||||
} else {
|
|
||||||
/// MmapSerializatioSink is faster on macOS and Linux
|
|
||||||
type SerializationSink = measureme::MmapSerializationSink;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
type Profiler = measureme::Profiler<SerializationSink>;
|
|
||||||
|
|
||||||
bitflags::bitflags! {
|
bitflags::bitflags! {
|
||||||
struct EventFilter: u32 {
|
struct EventFilter: u32 {
|
||||||
const GENERIC_ACTIVITIES = 1 << 0;
|
const GENERIC_ACTIVITIES = 1 << 0;
|
||||||
|
@ -389,7 +375,7 @@ impl SelfProfiler {
|
||||||
output_directory: &Path,
|
output_directory: &Path,
|
||||||
crate_name: Option<&str>,
|
crate_name: Option<&str>,
|
||||||
event_filters: &Option<Vec<String>>,
|
event_filters: &Option<Vec<String>>,
|
||||||
) -> Result<SelfProfiler, Box<dyn Error>> {
|
) -> Result<SelfProfiler, Box<dyn Error + Send + Sync>> {
|
||||||
fs::create_dir_all(output_directory)?;
|
fs::create_dir_all(output_directory)?;
|
||||||
|
|
||||||
let crate_name = crate_name.unwrap_or("unknown-crate");
|
let crate_name = crate_name.unwrap_or("unknown-crate");
|
||||||
|
@ -500,13 +486,13 @@ impl SelfProfiler {
|
||||||
self.event_filter_mask.contains(EventFilter::QUERY_KEYS)
|
self.event_filter_mask.contains(EventFilter::QUERY_KEYS)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn event_id_builder(&self) -> EventIdBuilder<'_, SerializationSink> {
|
pub fn event_id_builder(&self) -> EventIdBuilder<'_> {
|
||||||
EventIdBuilder::new(&self.profiler)
|
EventIdBuilder::new(&self.profiler)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub struct TimingGuard<'a>(Option<measureme::TimingGuard<'a, SerializationSink>>);
|
pub struct TimingGuard<'a>(Option<measureme::TimingGuard<'a>>);
|
||||||
|
|
||||||
impl<'a> TimingGuard<'a> {
|
impl<'a> TimingGuard<'a> {
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|
|
@ -28,5 +28,5 @@ rustc_ast = { path = "../rustc_ast" }
|
||||||
rustc_span = { path = "../rustc_span" }
|
rustc_span = { path = "../rustc_span" }
|
||||||
chalk-ir = "0.32.0"
|
chalk-ir = "0.32.0"
|
||||||
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
|
smallvec = { version = "1.0", features = ["union", "may_dangle"] }
|
||||||
measureme = "0.7.1"
|
measureme = "9.0.0"
|
||||||
rustc_session = { path = "../rustc_session" }
|
rustc_session = { path = "../rustc_session" }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue