internal: switch to tracing from log

This commit also adds `tracing` to NotificationDispatcher/RequestDispatcher,
bumps `rust-analyzer-salsa` to 0.17.0-pre.6, `always-assert` to 0.2, and
removes the homegrown `hprof` implementation in favor of a vendored
tracing-span-tree.
This commit is contained in:
David Barsky 2024-01-17 18:27:38 -08:00
parent 63123ab408
commit e1ea7c8844
96 changed files with 658 additions and 825 deletions

View file

@ -75,7 +75,7 @@ impl ImportMap {
}
pub(crate) fn import_map_query(db: &dyn DefDatabase, krate: CrateId) -> Arc<Self> {
let _p = profile::span("import_map_query");
let _p = tracing::span!(tracing::Level::INFO, "import_map_query").entered();
let map = Self::collect_import_map(db, krate);
@ -126,7 +126,7 @@ impl ImportMap {
}
fn collect_import_map(db: &dyn DefDatabase, krate: CrateId) -> ImportMapIndex {
let _p = profile::span("collect_import_map");
let _p = tracing::span!(tracing::Level::INFO, "collect_import_map").entered();
let def_map = db.crate_def_map(krate);
let mut map = FxIndexMap::default();
@ -216,7 +216,7 @@ impl ImportMap {
is_type_in_ns: bool,
trait_import_info: &ImportInfo,
) {
let _p = profile::span("collect_trait_assoc_items");
let _p = tracing::span!(tracing::Level::INFO, "collect_trait_assoc_items").entered();
for &(ref assoc_item_name, item) in &db.trait_data(tr).items {
let module_def_id = match item {
AssocItemId::FunctionId(f) => ModuleDefId::from(f),
@ -398,7 +398,7 @@ pub fn search_dependencies(
krate: CrateId,
ref query: Query,
) -> FxHashSet<ItemInNs> {
let _p = profile::span("search_dependencies").detail(|| format!("{query:?}"));
let _p = tracing::span!(tracing::Level::INFO, "search_dependencies", ?query).entered();
let graph = db.crate_graph();