Node.js writes one with node --cpu-prof as a .cpuprofile JSON file. Each sample points to a call stack; counting the samples whose top frame is a function gives its self time.