Skip to content

Commit d3e1c8c

Browse files
committed
Add more native tracing
1 parent 3e78481 commit d3e1c8c

File tree

8 files changed

+15
-0
lines changed

8 files changed

+15
-0
lines changed

Cargo.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/forge-runner/src/running/config_run.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ impl StateReader for PhantomStateReader {
5858
}
5959
}
6060

61+
#[tracing::instrument(skip_all, level = "debug")]
6162
pub fn run_config_pass(
6263
test_details: &TestDetails,
6364
casm_program: &AssembledProgramWithDebugInfo,

crates/forge-runner/src/running/with_config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ pub fn test_target_with_config(
8888
})
8989
}
9090

91+
#[tracing::instrument(skip_all, level = "debug")]
9192
fn build_test_details(
9293
func: &GenFunction<StatementIdx>,
9394
type_declarations: &HashMap<u64, &TypeDeclaration>,

crates/scarb-api/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ universal-sierra-compiler-api = { path = "../universal-sierra-compiler-api" }
2424
foundry-ui = { path = "../foundry-ui" }
2525
cairo-native.workspace = true
2626
native-api = { path = "../native-api" }
27+
tracing.workspace = true
2728

2829
[dev-dependencies]
2930
assert_fs.workspace = true

crates/scarb-api/src/artifacts.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ impl StarknetArtifactsFiles {
5454
self
5555
}
5656

57+
#[tracing::instrument(skip_all, level = "debug")]
5758
pub(crate) fn load_contracts_artifacts(
5859
self,
5960
) -> Result<HashMap<String, (StarknetContractArtifacts, Utf8PathBuf)>> {
@@ -79,6 +80,7 @@ impl StarknetArtifactsFiles {
7980
Ok(base_artifacts)
8081
}
8182

83+
#[tracing::instrument(skip_all, level = "debug")]
8284
fn compile_artifacts(
8385
&self,
8486
artifacts: Vec<(String, Utf8PathBuf)>,
@@ -92,6 +94,7 @@ impl StarknetArtifactsFiles {
9294
.collect::<Result<_>>()
9395
}
9496

97+
#[tracing::instrument(skip_all, level = "debug")]
9598
fn compile_artifact_at_path(&self, path: &Utf8Path) -> Result<StarknetContractArtifacts> {
9699
let sierra = fs::read_to_string(path)?;
97100

@@ -106,6 +109,7 @@ impl StarknetArtifactsFiles {
106109
})
107110
}
108111

112+
#[tracing::instrument(skip_all, level = "debug")]
109113
fn compile_to_native(&self, sierra: &str) -> Result<Option<AotContractExecutor>> {
110114
Ok(if self.compile_native {
111115
Some(native_api::compile_contract_class(&serde_json::from_str(
@@ -117,6 +121,7 @@ impl StarknetArtifactsFiles {
117121
}
118122
}
119123

124+
#[tracing::instrument(skip_all, level = "debug")]
120125
fn unique_artifacts(
121126
artifact_representations: Vec<StarknetArtifactsRepresentation>,
122127
current_artifacts: &HashMap<String, (StarknetContractArtifacts, Utf8PathBuf)>,

crates/scarb-api/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const INTEGRATION_TEST_TYPE: &str = "integration";
2323
/// If artifacts with `test_type` of `INTEGRATION_TEST_TYPE` are present, we use them base path
2424
/// and extend with paths to other artifacts.
2525
/// If `INTEGRATION_TEST_TYPE` is not present, we take first artifacts found.
26+
#[tracing::instrument(skip_all, level = "debug")]
2627
fn get_starknet_artifacts_paths_from_test_targets(
2728
target_dir: &Utf8Path,
2829
test_targets: &HashMap<String, &TargetMetadata>,
@@ -72,6 +73,7 @@ fn get_starknet_artifacts_paths_from_test_targets(
7273

7374
/// Try getting the path to `starknet_artifacts.json` related to `starknet-contract` target. This file that is generated by `scarb build` command.
7475
/// If the file is not present, `None` is returned.
76+
#[tracing::instrument(skip_all, level = "debug")]
7577
fn get_starknet_artifacts_path(
7678
target_dir: &Utf8Path,
7779
target_name: &str,
@@ -100,6 +102,7 @@ pub struct CompilationOpts {
100102
}
101103

102104
/// Get the map with `StarknetContractArtifacts` for the given package
105+
#[tracing::instrument(skip_all, level = "debug")]
103106
pub fn get_contracts_artifacts_and_source_sierra_paths(
104107
artifacts_dir: &Utf8Path,
105108
package: &PackageMetadata,

crates/universal-sierra-compiler-api/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ tempfile.workspace = true
1313
num-bigint.workspace = true
1414
cairo-lang-casm.workspace = true
1515
camino.workspace = true
16+
tracing.workspace = true

crates/universal-sierra-compiler-api/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ pub fn compile_sierra<T: UniversalSierraCompilerOutput>(
6666
)
6767
}
6868

69+
#[tracing::instrument(skip_all, level = "debug")]
6970
pub fn compile_sierra_at_path<T: UniversalSierraCompilerOutput>(
7071
sierra_file_path: &Utf8Path,
7172
sierra_type: &SierraType,

0 commit comments

Comments
 (0)