psrecord is a small utility that uses the psutil library to record the CPU and memory activity of a process.