Skip to content

Commit 2c573a0

Browse files
committed
gate taskdump to linux only
1 parent 674e7bd commit 2c573a0

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

crates/core/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ test-util = [
2020
"restate-types/test-util",
2121
"tokio/test-util"
2222
]
23-
taskdump = ["tokio/taskdump"]
23+
taskdump = []
2424

2525
[dependencies]
2626
restate-workspace-hack = { workspace = true }
@@ -83,3 +83,6 @@ googletest = { workspace = true }
8383
test-log = { workspace = true }
8484
tracing-subscriber = { workspace = true }
8585
tracing-test = { workspace = true }
86+
87+
[target.'cfg(all(target_os = "linux", any(target_arch = "aarch64", target_arch = "x86", target_arch = "x86_64")))'.dependencies]
88+
tokio = { workspace = true, features = ["taskdump"] }

crates/core/src/task_center.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -802,12 +802,20 @@ impl TaskCenterInner {
802802
}
803803
}
804804

805-
#[cfg(not(feature = "taskdump"))]
805+
#[cfg(not(all(
806+
feature = "taskdump",
807+
target_os = "linux",
808+
any(target_arch = "aarch64", target_arch = "x86", target_arch = "x86_64")
809+
)))]
806810
async fn dump_tasks(self: &Arc<Self>, _: impl std::io::Write) {
807811
warn!("Cannot dump tokio tasks; taskdump feature was not enabled at compile time")
808812
}
809813

810-
#[cfg(feature = "taskdump")]
814+
#[cfg(all(
815+
feature = "taskdump",
816+
target_os = "linux",
817+
any(target_arch = "aarch64", target_arch = "x86", target_arch = "x86_64")
818+
))]
811819
async fn dump_tasks(self: &Arc<Self>, mut writer: impl std::io::Write) {
812820
let managed_tasks: HashMap<_, _> = self
813821
.managed_tasks

0 commit comments

Comments
 (0)