Skip to content

Commit

Permalink
Instrument handle_tunnel_state_transition
Browse files Browse the repository at this point in the history
  • Loading branch information
Serock3 committed Jul 26, 2024
1 parent bcfea26 commit 8ea552e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
13 changes: 13 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ env_logger = "0.10.0"
thiserror = "1.0.57"
log = "0.4"
tracing = "0.1.40"
tracing-futures = "0.2"

shadowsocks = { version = "1.16" }
shadowsocks-service = { version = "1.16" }
Expand Down
3 changes: 2 additions & 1 deletion mullvad-daemon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ api-override = ["mullvad-api/api-override"]
[dependencies]
chrono = { workspace = true }
thiserror = { workspace = true }
tracing-subscriber = { version = "0.3", features = ["env-filter", "chrono"] }
futures = "0.3"
once_cell = { workspace = true }
libc = "0.2"
log = { workspace = true }
tracing = { workspace = true }
tracing-subscriber = { version = "0.3", features = ["env-filter", "chrono"] }
tracing-futures = { workspace = true }
regex = "1.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
Expand Down
3 changes: 3 additions & 0 deletions mullvad-daemon/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -948,6 +948,7 @@ where
should_stop
}

#[tracing::instrument(name = "Handle state transition", skip_all)]
async fn handle_tunnel_state_transition(
&mut self,
tunnel_state_transition: TunnelStateTransition,
Expand Down Expand Up @@ -1029,6 +1030,7 @@ where
/// [`InternalDaemonEvent::LocationEvent`].
///
/// See [`Daemon::handle_location_event()`]
#[tracing::instrument(skip_all)]
fn fetch_am_i_mullvad(&mut self) {
// Always abort any ongoing request when entering a new tunnel state
self.location_handler.abort_current_request();
Expand Down Expand Up @@ -1128,6 +1130,7 @@ where
}
}

#[tracing::instrument(skip_all)]
async fn handle_command(&mut self, command: DaemonCommand) {
use self::DaemonCommand::*;
if self.tunnel_state.is_disconnected() {
Expand Down

0 comments on commit 8ea552e

Please sign in to comment.