static int cpu_profiling_partpause(perf_cpu_t *cpu, void *arg) { count_id_t count_id = (count_id_t)arg; int i; if ((count_id == COUNT_INVALID) || (count_id == 0)) { return (pf_profiling_allstop(cpu)); } for (i = 1; i < COUNT_NUM; i++) { if (i != count_id) { pf_profiling_stop(cpu, i); } else { pf_profiling_start(cpu, i); } } return (0); }
static int cpu_profiling_restore(perf_cpu_t *cpu, void *arg) { count_id_t count_id = (count_id_t)arg; int i; if ((count_id == COUNT_INVALID) || (count_id == 0)) { return (pf_profiling_allstart(cpu)); } pf_profiling_stop(cpu, count_id); /* * Discard the existing records in ring buffer. */ pf_profiling_record(cpu, NULL, NULL); for (i = 1; i < COUNT_NUM; i++) { pf_profiling_start(cpu, i); } return (0); }
int pf_profiling_allstart(struct _perf_cpu *cpu) { return (pf_profiling_start(cpu, 0)); }