Turning on gprof again, and adding signal handler to not lose gprof data on ctrl+c