Page MenuHomePhabricator

h2-spdy-stats.stp

Authored By
ema
Mar 8 2016, 8:55 AM
Size
1 KB
Referenced Files
None
Subscribers
None

h2-spdy-stats.stp

// To target systems running 4.4.0-1-amd64, compile as follows:
// stap -v -r 4.4.0-1-amd64 -m h2_spdy_stats h2-spdy-stats.stp -p 4
//
// These packages need to be installed on the production system:
// systemtap-runtime libssl1.0.0-dbg
//
// Run with:
// staprun -v h2_spdy_stats.ko
global bin
// ALPN
probe process("/usr/lib/x86_64-linux-gnu/libssl.so.1.0.0").function("SSL_select_next_proto") {
value = text_str(user_string($client))
if (value =~ "h2") {
if (value =~ "spdy") {
bin["both"]++
} else {
bin["h2"]++
}
}
}
// NPN
probe process("/usr/lib/x86_64-linux-gnu/libssl.so.1.0.0").function("SSL_get0_next_proto_negotiated") {
if ($s->s3->next_proto_neg_seen && $s->next_proto_negotiated_len > 0) {
value = text_str(user_string_n($s->next_proto_negotiated, $s->next_proto_negotiated_len))
if (value =~ "http/1.1") {
bin["npn_http1"]++
}
if (value =~ "spdy") {
bin["spdy"]++
}
}
}
probe process("/usr/lib/x86_64-linux-gnu/libssl.so.1.0.0").function("SSL_accept") {
bin["total"]++
}
probe end {
foreach (key in bin) {
printf("%s: %d \n", key, bin[key])
}
}

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3479828
Default Alt Text
h2-spdy-stats.stp (1 KB)

Event Timeline