Lines Matching refs:sbuf
73 struct sample_buf *sbuf = NULL; in gprof_start_pc_sampling() local
82 if (s->sbuf) { in gprof_start_pc_sampling()
92 sbuf = calloc(1, sizeof(*sbuf)); in gprof_start_pc_sampling()
93 if (!sbuf) in gprof_start_pc_sampling()
96 sbuf->samples = (uint16_t *)buf; in gprof_start_pc_sampling()
97 sbuf->nsamples = len / sizeof(*sbuf->samples); in gprof_start_pc_sampling()
98 sbuf->offset = offset; in gprof_start_pc_sampling()
99 sbuf->scale = scale; in gprof_start_pc_sampling()
100 sbuf->freq = read_cntfrq(); in gprof_start_pc_sampling()
101 sbuf->enabled = true; in gprof_start_pc_sampling()
102 s->sbuf = sbuf; in gprof_start_pc_sampling()
115 struct sample_buf *sbuf = NULL; in gprof_stop_pc_sampling() local
121 sbuf = s->sbuf; in gprof_stop_pc_sampling()
122 if (!sbuf) in gprof_stop_pc_sampling()
124 assert(sbuf->samples); in gprof_stop_pc_sampling()
127 if (sbuf->enabled) in gprof_stop_pc_sampling()
128 sbuf->enabled = false; in gprof_stop_pc_sampling()
130 rate = ((uint64_t)sbuf->count * sbuf->freq) / sbuf->usr; in gprof_stop_pc_sampling()
134 " cntfrq=%" PRIu32 " rate=%" PRIu32, sbuf->count, sbuf->usr, in gprof_stop_pc_sampling()
135 sbuf->freq, rate); in gprof_stop_pc_sampling()
137 free(sbuf); in gprof_stop_pc_sampling()
138 s->sbuf = NULL; in gprof_stop_pc_sampling()