Skip to content

Commit

Permalink
Update to USDT 0.5.0
Browse files Browse the repository at this point in the history
- Update diesel-dtrace
- Update usdt
- Handle API change in how providers are named, since dunders are no
  longer translated to dashes.
  • Loading branch information
bnaecker committed Jan 25, 2024
1 parent 2634aad commit d8e5e1a
Show file tree
Hide file tree
Showing 8 changed files with 199 additions and 54 deletions.
221 changes: 180 additions & 41 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ tui-tree-widget = "0.16.0"
unicode-width = "0.1.11"
update-common = { path = "update-common" }
update-engine = { path = "update-engine" }
usdt = "0.3"
usdt = "0.5.0"
uuid = { version = "1.7.0", features = ["serde", "v4"] }
walkdir = "2.4"
wicket = { path = "wicket" }
Expand Down
2 changes: 1 addition & 1 deletion nexus/db-queries/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ extern crate newtype_derive;
#[macro_use]
extern crate diesel;

#[usdt::provider(provider = "nexus__db__queries")]
#[usdt::provider(provider = "nexus_db_queries")]
mod probes {
// Fires before we start a search over a range for a VNI.
//
Expand Down
2 changes: 1 addition & 1 deletion oximeter/db/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ use tokio::fs;
use tokio::sync::Mutex;
use uuid::Uuid;

#[usdt::provider(provider = "clickhouse__client")]
#[usdt::provider(provider = "clickhouse_client")]
mod probes {
fn query__start(_: &usdt::UniqueId, sql: &str) {}
fn query__done(_: &usdt::UniqueId) {}
Expand Down
4 changes: 2 additions & 2 deletions tools/dtrace/aggregate-query-latency.d
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ dtrace:::BEGIN
printf("Tracing database query latency by connection ID for nexus PID %d, use Ctrl-C to exit\n", $target);
}

diesel-db$target:::query-start
diesel_db$target:::query-start
{
@total_queries = count();
this->conn_id = json(copyinstr(arg1), "ok");
self->ts[this->conn_id] = timestamp;
}

diesel-db$target:::query-done
diesel_db$target:::query-done
/self->ts[json(copyinstr(arg1), "ok")] != 0/
{
this->conn_id = json(copyinstr(arg1), "ok");
Expand Down
6 changes: 3 additions & 3 deletions tools/dtrace/slowest-queries.d
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ dtrace:::BEGIN
printf("Tracing slowest queries for nexus PID %d, use Ctrl-C to exit\n", $target);
}

diesel-db$target:::query-start
diesel_db$target:::query-start
{
this->conn_id = json(copyinstr(arg1), "ok");
ts[this->conn_id] = timestamp;
query[this->conn_id] = copyinstr(arg2);
}


diesel-db$target:::query-done
diesel_db$target:::query-done
{
this->conn_id = json(copyinstr(arg1), "ok");
}

diesel-db$target:::query-done
diesel_db$target:::query-done
/ts[this->conn_id]/
{
this->latency = timestamp - ts[this->conn_id];
Expand Down
6 changes: 3 additions & 3 deletions tools/dtrace/trace-db-queries.d
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ dtrace:::BEGIN
printf("Tracing all database queries for nexus PID %d, use Ctrl-C to exit\n", $target);
}

diesel-db$target:::query-start
diesel_db$target:::query-start
{
this->conn_id = json(copyinstr(arg1), "ok");
ts[this->conn_id] = timestamp;
query[this->conn_id] = copyinstr(arg2);
}

diesel-db$target:::query-done
diesel_db$target:::query-done
{
this->conn_id = json(copyinstr(arg1), "ok");
}

diesel-db$target:::query-done
diesel_db$target:::query-done
/ts[this->conn_id]/
{
this->latency = (timestamp - ts[this->conn_id]) / 1000;
Expand Down
10 changes: 8 additions & 2 deletions workspace-hack/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,10 @@ trust-dns-proto = { version = "0.22.0" }
unicode-bidi = { version = "0.3.13" }
unicode-normalization = { version = "0.1.22" }
usdt = { version = "0.3.5" }
usdt-impl = { version = "0.5.0", default-features = false, features = ["asm", "des"] }
uuid = { version = "1.7.0", features = ["serde", "v4"] }
yasna = { version = "0.5.2", features = ["bit-vec", "num-bigint", "std", "time"] }
zerocopy = { version = "0.7.31", features = ["derive", "simd"] }
zerocopy = { version = "0.7.32", features = ["derive", "simd"] }
zeroize = { version = "1.7.0", features = ["std", "zeroize_derive"] }
zip = { version = "0.6.6", default-features = false, features = ["bzip2", "deflate"] }

Expand Down Expand Up @@ -222,20 +223,23 @@ trust-dns-proto = { version = "0.22.0" }
unicode-bidi = { version = "0.3.13" }
unicode-normalization = { version = "0.1.22" }
usdt = { version = "0.3.5" }
usdt-impl = { version = "0.5.0", default-features = false, features = ["asm", "des"] }
uuid = { version = "1.7.0", features = ["serde", "v4"] }
yasna = { version = "0.5.2", features = ["bit-vec", "num-bigint", "std", "time"] }
zerocopy = { version = "0.7.31", features = ["derive", "simd"] }
zerocopy = { version = "0.7.32", features = ["derive", "simd"] }
zeroize = { version = "1.7.0", features = ["std", "zeroize_derive"] }
zip = { version = "0.6.6", default-features = false, features = ["bzip2", "deflate"] }

[target.x86_64-unknown-linux-gnu.dependencies]
bitflags-f595c2ba2a3f28df = { package = "bitflags", version = "2.4.0", default-features = false, features = ["std"] }
dof = { version = "0.3.0", default-features = false, features = ["des"] }
mio = { version = "0.8.9", features = ["net", "os-ext"] }
once_cell = { version = "1.19.0", features = ["unstable"] }
rustix = { version = "0.38.30", features = ["fs", "termios"] }

[target.x86_64-unknown-linux-gnu.build-dependencies]
bitflags-f595c2ba2a3f28df = { package = "bitflags", version = "2.4.0", default-features = false, features = ["std"] }
dof = { version = "0.3.0", default-features = false, features = ["des"] }
mio = { version = "0.8.9", features = ["net", "os-ext"] }
once_cell = { version = "1.19.0", features = ["unstable"] }
rustix = { version = "0.38.30", features = ["fs", "termios"] }
Expand Down Expand Up @@ -270,6 +274,7 @@ rustix = { version = "0.38.30", features = ["fs", "termios"] }

[target.x86_64-unknown-illumos.dependencies]
bitflags-f595c2ba2a3f28df = { package = "bitflags", version = "2.4.0", default-features = false, features = ["std"] }
dof = { version = "0.3.0", default-features = false, features = ["des"] }
errno = { version = "0.3.8", default-features = false, features = ["std"] }
mio = { version = "0.8.9", features = ["net", "os-ext"] }
once_cell = { version = "1.19.0", features = ["unstable"] }
Expand All @@ -279,6 +284,7 @@ toml_edit-cdcf2f9584511fe6 = { package = "toml_edit", version = "0.19.15", featu

[target.x86_64-unknown-illumos.build-dependencies]
bitflags-f595c2ba2a3f28df = { package = "bitflags", version = "2.4.0", default-features = false, features = ["std"] }
dof = { version = "0.3.0", default-features = false, features = ["des"] }
errno = { version = "0.3.8", default-features = false, features = ["std"] }
mio = { version = "0.8.9", features = ["net", "os-ext"] }
once_cell = { version = "1.19.0", features = ["unstable"] }
Expand Down

0 comments on commit d8e5e1a

Please sign in to comment.