Skip to content

Instantly share code, notes, and snippets.

@rsevilla87
Last active January 22, 2021 18:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rsevilla87/379d2f27e542d111ff293e1170c7d74d to your computer and use it in GitHub Desktop.
Save rsevilla87/379d2f27e542d111ff293e1170c7d74d to your computer and use it in GitHub Desktop.
#!/usr/bin/bpftrace
BEGIN
{
printf("Tracing masked_flow_lookup... Hit Ctrl-C to end\n");
}
kprobe:masked_flow_lookup{
@start[tid] = nsecs;
@count++
}
kretprobe:masked_flow_lookup /@start[tid]/{
$latency = nsecs - @start[tid];
delete(@start[tid]);
@lat = lhist($latency, 0, 2000, 100);
}
END
{
printf("\nTotal masked_flow_lookup calls: %d", @count);
clear(@start);
clear(@count);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment