Lines Matching refs:tbp
1119 struct trace_buf *tbp;
1121 tbp = malloc(sizeof(*tbp) + bufsize);
1122 INIT_LIST_HEAD(&tbp->head);
1123 tbp->len = 0;
1124 tbp->buf = (void *)(tbp + 1);
1125 tbp->cpu = cpu;
1126 tbp->dpp = NULL; /* Will be set when tbp is added */
1128 return tbp;
1172 struct trace_buf *tbp = *tbpp;
1175 tbp->dpp = dpp;
1178 list_add_tail(&tbp->head, &hd->head);
1254 static int flush_subbuf_net(struct trace_buf *tbp)
1256 int fd = cl_fds[tbp->cpu];
1257 struct devpath *dpp = tbp->dpp;
1259 if (net_send_header(fd, tbp->cpu, dpp->buts_name, tbp->len))
1261 else if (net_send_data(fd, tbp->buf, tbp->len) != tbp->len)
1271 struct trace_buf *tbp;
1276 tbp = list_entry(p, struct trace_buf, head);
1278 list_del(&tbp->head);
1281 if (cl_fds[tbp->cpu] >= 0) {
1282 if (flush_subbuf_net(tbp)) {
1283 close(cl_fds[tbp->cpu]);
1284 cl_fds[tbp->cpu] = -1;
1288 free(tbp);
1295 * Tack 'tbp's buf onto the tail of 'prev's buf
1298 struct trace_buf *tbp)
1302 tot_len = prev->len + tbp->len;
1305 * tbp->head isn't connected (it was 'prev'
1315 memcpy(prev->buf + prev->len, tbp->buf, tbp->len);
1318 free(tbp);
1329 struct trace_buf *tbp, *prev;
1333 tbp = list_entry(p, struct trace_buf, head);
1334 list_del(&tbp->head);
1342 tbp = tb_combine(prev, tbp);
1350 while (off + (int)sizeof(*t) <= tbp->len) {
1351 t = (struct blk_io_trace *)(tbp->buf + off);
1353 if (off + t_len > tbp->len)
1360 pdc_nev_update(tbp->dpp, tbp->cpu, nevents);
1367 if (write_data(tbp->buf, off) || off == tbp->len) {
1368 free(tbp);
1375 tbp->len -= off;
1376 memmove(tbp->buf, tbp->buf + off, tbp->len);
1377 prev = tbp;
1380 prev = tbp;
1743 struct trace_buf *tbp;
1747 tbp = alloc_trace_buf(tp->cpu, buf_size);
1750 tbp->len = read(iop->ifd, tbp->buf, buf_size);
1751 if (tbp->len > 0) {
1752 pdc_dr_update(iop->dpp, tp->cpu, tbp->len);
1753 add_trace_buf(iop->dpp, tp->cpu, &tbp);
1755 } else if (tbp->len == 0) {
1771 free(tbp);