Lines Matching defs:tbp
46 fmd_tracebuf_t *tbp = fmd_zalloc(sizeof (fmd_tracebuf_t), FMD_SLEEP);
49 (void) fmd_conf_getprop(fmd.d_conf, "trace.frames", &tbp->tb_frames);
50 (void) fmd_conf_getprop(fmd.d_conf, "trace.recs", &tbp->tb_recs);
69 tbp->tb_frames = (tbp->tb_frames & ~1UL) + 1;
71 tbp->tb_frames = P2ROUNDUP(tbp->tb_frames, 2);
73 tbp->tb_size = sizeof (fmd_tracerec_t) +
74 sizeof (uintptr_t) * (MAX(tbp->tb_frames, 1) - 1);
76 bufsize = tbp->tb_size * tbp->tb_recs;
78 tbp->tb_buf = fmd_zalloc(bufsize, FMD_SLEEP);
79 tbp->tb_end = (void *)((uintptr_t)tbp->tb_buf + bufsize - tbp->tb_size);
80 tbp->tb_ptr = tbp->tb_buf;
82 return (tbp);
86 fmd_trace_destroy(fmd_tracebuf_t *tbp)
88 fmd_free(tbp->tb_buf, tbp->tb_size * tbp->tb_recs);
89 fmd_free(tbp, sizeof (fmd_tracebuf_t));
106 fmd_trace_none(fmd_tracebuf_t *tbp, uint_t tag, const char *format, va_list ap)
112 fmd_trace_lite(fmd_tracebuf_t *tbp, uint_t tag, const char *format, va_list ap)
115 fmd_tracerec_t *trp = tbp->tb_ptr;
118 if (tbp->tb_depth++ != 0) {
119 tbp->tb_depth--;
134 if (tbp->tb_ptr != tbp->tb_end)
135 tbp->tb_ptr = (void *)((uintptr_t)tbp->tb_ptr + tbp->tb_size);
137 tbp->tb_ptr = tbp->tb_buf;
139 tbp->tb_depth--;
144 fmd_trace_full(fmd_tracebuf_t *tbp, uint_t tag, const char *format, va_list ap)
147 fmd_tracerec_t *trp = tbp->tb_ptr;
151 if (tbp->tb_depth++ != 0) {
152 tbp->tb_depth--;
157 trp->tr_tag = tbp->tb_frames; /* for use by fmd_trace_frame() */
174 if (tbp->tb_ptr != tbp->tb_end)
175 tbp->tb_ptr = (void *)((uintptr_t)tbp->tb_ptr + tbp->tb_size);
177 tbp->tb_ptr = tbp->tb_buf;
179 tbp->tb_depth--;