getrusage
commit917339c45d1db0d474c5e72a5dfd0e63fac48bb3
authorGabe Levi <gabe@fb.com>
Mon, 5 Mar 2018 18:45:29 +0000 (5 10:45 -0800)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Mon, 5 Mar 2018 18:58:42 +0000 (5 10:58 -0800)
treee6e2dc1bb3de8bb3e7898bf3ff3d477862e34ab3
parent29fe1912e1548629d46a3ff63317660fe02c5b0b
getrusage

Summary:
Recently I was debugging some worker perf issue, and I wanted
to know how often the workers were being voluntarily or involuntarily
context switched by the kernel. This information is available using the
[getrusage](http://man7.org/linux/man-pages/man2/getrusage.2.html)
system call.

I thought this might be worth checking in, in case anyone else needs
this in the future.

Reviewed By: gregory-nisbet

Differential Revision: D7075560

fbshipit-source-id: 4306ee8bae05284c219c6cb38ee9ec29004cda10
hphp/hack/src/Makefile
hphp/hack/src/utils/sys/getrusage.c [new file with mode: 0644]
hphp/hack/src/utils/sys/sys_utils.ml