Skip to content

Commit 5aa4113

Browse files
authored
refactor(crashtracker): update imports to linux only (#2036)
# What does this PR do? Put some import under linux os only. # Motivation These imports were falsely reported as unused on my IDE. # Additional Notes Anything else we should know when reviewing? # How to test the change? Describe here in detail how the change can be validated. Co-authored-by: anais.raison <anais.raison@datadoghq.com>
1 parent 54afa6f commit 5aa4113

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

bin_tests/tests/crashtracker_bin_test.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ use bin_tests::{
2121
ArtifactsBuild, BuildProfile,
2222
};
2323
use libdd_crashtracker::{
24-
default_max_threads, CrashtrackerConfiguration, Metadata, SiCodes, SigInfo, SignalNames,
25-
StacktraceCollection,
24+
CrashtrackerConfiguration, Metadata, SiCodes, SigInfo, SignalNames, StacktraceCollection,
2625
};
2726
use serde_json::Value;
2827

@@ -313,7 +312,7 @@ fn test_crash_tracking_multi_thread_collection() {
313312
#[cfg(target_os = "linux")]
314313
#[cfg_attr(miri, ignore)]
315314
fn test_crash_tracking_thread_limit() {
316-
const THREAD_COUNT: usize = default_max_threads();
315+
const THREAD_COUNT: usize = libdd_crashtracker::default_max_threads();
317316

318317
let config = CrashTestConfig::new(
319318
BuildProfile::Release,

libdd-crashtracker/src/receiver/receive_report.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use crate::{
55
crash_info::{
66
CrashInfo, CrashInfoBuilder, ErrorKind, SigInfo, Span, StackFrame, TelemetryCrashUploader,
7-
Threads, Ucontext,
7+
Ucontext,
88
},
99
runtime_callback::RuntimeStack,
1010
shared::constants::*,
@@ -560,7 +560,7 @@ fn collect_and_add_thread_contexts(
560560
crashing_tid: Option<u32>,
561561
budget: Duration,
562562
) -> anyhow::Result<()> {
563-
use crate::crash_info::ThreadData;
563+
use crate::crash_info::{ThreadData, Threads};
564564
use crate::receiver::ptrace_collector::stream_thread_contexts;
565565

566566
let crashing_tid = crashing_tid.unwrap_or(0) as i32;

0 commit comments

Comments
 (0)