Since the GC can sometimes cause delays that can make problems
for latency-sensitive programs, it may be useful to notice when
it has run.
To that end, I've adapted Brendan Gregg's killsnoop (
https://github.com/brendangregg/perf-tools/blob/master/killsnoop
) to `gcsnoop`, a tool to supervise `tgkill` syscalls (used by
the GC for `SIGUSR1`/`SIGUSR2`) and log time, PID and GC delay.
https://gist.github.com/FeepingCreature/a2efe19f15eb582af274b23002c25706
Since it uses the kernel event tracing API, it needs to run as
root.
Time is seconds since boot.
Sample output:
```
$ sudo ./gcsnoop -t
Tracing GC runs. Ctrl-C to end.
TIMEsCOMM PIDTGID LENGTH
355487.807757gctest-360995360996 360995 1.364406
355489.930831gctest-360995360996 360995 1.291132
355492.119666gctest-360995360996 360995 1.403598
355494.446310gctest-360995360996 360995 1.543637
^C
Ending tracing...
```