Skip to content

Instantly share code, notes, and snippets.

@KJTsanaktsidis
Created September 23, 2021 07:49
Show Gist options
  • Save KJTsanaktsidis/a0af8eeb1f2e878d5ca2d7d497eeeb42 to your computer and use it in GitHub Desktop.
Save KJTsanaktsidis/a0af8eeb1f2e878d5ca2d7d497eeeb42 to your computer and use it in GitHub Desktop.
bpftrace
usdt:/usr/local/lib/librdkafka.so.1:librdkafka:rd_malloc {
@allocated_addrs[arg0] = ustack();
@allocation_time[arg0] = nsecs;
}
usdt:/usr/local/lib/librdkafka.so.1:librdkafka:rd_free {
delete(@allocated_addrs[arg0]);
delete(@allocation_time[arg0]);
}
// plus similar entries for functions like rd_calloc, rd_strdup, etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment