Skip to content

Commit 39e21a9

Browse files
committed
Auto merge of #13538 - epage:trace, r=weihanglo
fix(log): Trace parameters to align with profile This is a follow up to #13532 and prep for #13399
2 parents 19141bd + f16067a commit 39e21a9

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

src/cargo/core/compiler/fingerprint/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,10 @@ pub use dirty_reason::DirtyReason;
399399
/// transitively propagate throughout the dependency graph, it only forces this
400400
/// one unit which is very unlikely to be what you want unless you're
401401
/// exclusively talking about top-level units.
402-
#[tracing::instrument(skip(build_runner, unit))]
402+
#[tracing::instrument(
403+
skip(build_runner, unit),
404+
fields(package_id = %unit.pkg.package_id(), target = unit.target.name())
405+
)]
403406
pub fn prepare_target(
404407
build_runner: &mut BuildRunner<'_, '_>,
405408
unit: &Unit,

src/cargo/core/global_cache_tracker.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ impl GlobalCacheTracker {
697697
///
698698
/// These orphaned files will be added to `delete_paths` so that the
699699
/// caller can delete them.
700-
#[tracing::instrument(skip_all)]
700+
#[tracing::instrument(skip(conn, gctx, base, delete_paths))]
701701
fn sync_db_with_files(
702702
conn: &Connection,
703703
now: Timestamp,
@@ -797,7 +797,7 @@ impl GlobalCacheTracker {
797797
}
798798

799799
/// For parent tables, add any entries that are on disk but aren't tracked in the db.
800-
#[tracing::instrument(skip_all)]
800+
#[tracing::instrument(skip(conn, now, base_path))]
801801
fn update_parent_for_missing_from_db(
802802
conn: &Connection,
803803
now: Timestamp,
@@ -825,7 +825,7 @@ impl GlobalCacheTracker {
825825
///
826826
/// This could happen for example if the user manually deleted the file or
827827
/// any such scenario where the filesystem and db are out of sync.
828-
#[tracing::instrument(skip_all)]
828+
#[tracing::instrument(skip(conn, base_path))]
829829
fn update_db_for_removed(
830830
conn: &Connection,
831831
parent_table_name: &str,
@@ -855,7 +855,7 @@ impl GlobalCacheTracker {
855855
}
856856

857857
/// Removes database entries for any files that are not on disk for the parent tables.
858-
#[tracing::instrument(skip_all)]
858+
#[tracing::instrument(skip(conn, base_path, child_base_paths, delete_paths))]
859859
fn update_db_parent_for_removed_from_disk(
860860
conn: &Connection,
861861
parent_table_name: &str,
@@ -893,7 +893,7 @@ impl GlobalCacheTracker {
893893
/// Updates the database to add any `.crate` files that are currently
894894
/// not tracked (such as when they are downloaded by an older version of
895895
/// cargo).
896-
#[tracing::instrument(skip_all)]
896+
#[tracing::instrument(skip(conn, now, base_path))]
897897
fn populate_untracked_crate(
898898
conn: &Connection,
899899
now: Timestamp,
@@ -928,7 +928,7 @@ impl GlobalCacheTracker {
928928

929929
/// Updates the database to add any files that are currently not tracked
930930
/// (such as when they are downloaded by an older version of cargo).
931-
#[tracing::instrument(skip_all)]
931+
#[tracing::instrument(skip(conn, now, gctx, base_path, populate_size))]
932932
fn populate_untracked(
933933
conn: &Connection,
934934
now: Timestamp,
@@ -994,7 +994,7 @@ impl GlobalCacheTracker {
994994
/// size.
995995
///
996996
/// `update_db_for_removed` should be called before this is called.
997-
#[tracing::instrument(skip_all)]
997+
#[tracing::instrument(skip(conn, gctx, base_path))]
998998
fn update_null_sizes(
999999
conn: &Connection,
10001000
gctx: &GlobalContext,

0 commit comments

Comments
 (0)