Lines Matching refs:buf
385 cpc_buf_t *buf;
393 if ((buf = malloc(sizeof (*buf))) == NULL)
396 buf->cb_size = set->cs_nreqs * sizeof (uint64_t);
397 if ((buf->cb_data = malloc(buf->cb_size)) == NULL) {
398 free(buf);
402 bzero(buf->cb_data, buf->cb_size);
404 buf->cb_hrtime = 0;
405 buf->cb_tick = 0;
408 buf->cb_next = cpc->cpc_bufs;
409 cpc->cpc_bufs = buf;
412 return (buf);
416 cpc_buf_destroy(cpc_t *cpc, cpc_buf_t *buf)
422 * Remove this buf from the cpc handle's list of bufs.
426 if (cbp == buf)
675 cpc_set_sample(cpc_t *cpc, cpc_set_t *set, cpc_buf_t *buf)
685 buf->cb_size != set->cs_nreqs * sizeof (uint64_t)) {
692 return (syscall(SYS_cpc, CPC_SAMPLE, -1, buf->cb_data,
693 &buf->cb_hrtime, &buf->cb_tick));
695 args.udata1 = buf->cb_data;
696 args.udata2 = &buf->cb_hrtime;
697 args.udata3 = &buf->cb_tick;
701 buf->cb_data, &buf->cb_hrtime, &buf->cb_tick,
702 buf->cb_size));
757 cpc_buf_zero(cpc_t *cpc, cpc_buf_t *buf)
759 bzero(buf->cb_data, buf->cb_size);
760 buf->cb_hrtime = 0;
761 buf->cb_tick = 0;
769 cpc_buf_get(cpc_t *cpc, cpc_buf_t *buf, int index, uint64_t *val)
771 *val = buf->cb_data[index];
778 cpc_buf_set(cpc_t *cpc, cpc_buf_t *buf, int index, uint64_t val)
780 buf->cb_data[index] = val;
787 cpc_buf_hrtime(cpc_t *cpc, cpc_buf_t *buf)
789 return (buf->cb_hrtime);
794 cpc_set_hrtime(cpc_t *cpc, cpc_buf_t *buf, uint64_t hrtime)
796 buf->cb_hrtime = hrtime;
801 cpc_buf_tick(cpc_t *cpc, cpc_buf_t *buf)
803 return (buf->cb_tick);
808 cpc_set_tick(cpc_t *cpc, cpc_buf_t *buf, uint64_t ticks)
810 buf->cb_tick = ticks;