Lines Matching +full:buffered +full:- +full:negative

78 	p = s + strlen(s) - 1;  in dtrace_xstr2desc()
82 p--; /* move backward until we find a delimiter */ in dtrace_xstr2desc()
98 vlen = (size_t)(q + len - v); in dtrace_xstr2desc()
99 len = (size_t)(v - q); in dtrace_xstr2desc()
107 vlen--; in dtrace_xstr2desc()
117 wlen = vlen - (w - v); in dtrace_xstr2desc()
125 if (yypcb != NULL && yypcb->pcb_sargv == argv) in dtrace_xstr2desc()
126 yypcb->pcb_sflagv[i] |= DT_IDFLG_REF; in dtrace_xstr2desc()
132 (void) strncpy(vstr, v + 1, vlen - 1); in dtrace_xstr2desc()
133 vstr[vlen - 1] = '\0'; in dtrace_xstr2desc()
134 idp = dt_idhash_lookup(dtp->dt_macros, vstr); in dtrace_xstr2desc()
140 vlen = snprintf(buf, 32, "%d", idp->di_id); in dtrace_xstr2desc()
152 off = dtrace_probespecs[spec--].dtps_offset; in dtrace_xstr2desc()
156 } while (--p >= s); in dtrace_xstr2desc()
158 pdp->dtpd_id = DTRACE_IDNONE; in dtrace_xstr2desc()
173 pdp->dtpd_id = id; in dtrace_id2desc()
175 if (dt_ioctl(dtp, DTRACEIOC_PROBES, pdp) == -1 || in dtrace_id2desc()
176 pdp->dtpd_id != id) in dtrace_id2desc()
185 if (pdp->dtpd_id == 0) { in dtrace_desc2str()
186 (void) snprintf(buf, len, "%s:%s:%s:%s", pdp->dtpd_provider, in dtrace_desc2str()
187 pdp->dtpd_mod, pdp->dtpd_func, pdp->dtpd_name); in dtrace_desc2str()
189 (void) snprintf(buf, len, "%u", pdp->dtpd_id); in dtrace_desc2str()
233 return (-1); /* invalid function arguments */ in dtrace_str2attr()
244 attr->dtat_name = s; in dtrace_str2attr()
250 return (-1); in dtrace_str2attr()
257 attr->dtat_data = s; in dtrace_str2attr()
263 return (-1); in dtrace_str2attr()
270 attr->dtat_class = c; in dtrace_str2attr()
276 return (-1); in dtrace_str2attr()
343 * a1's to obtain a negative result if an a1 attribute is less than its a2
345 * twos-complement property that if any result is negative, the bitwise union
346 * will also be negative since the highest bit will be set in the result.
351 return (((int)a1.dtat_name - a2.dtat_name) | in dt_attr_cmp()
352 ((int)a1.dtat_data - a2.dtat_data) | in dt_attr_cmp()
353 ((int)a1.dtat_class - a2.dtat_class)); in dt_attr_cmp()
397 n[i] = n[i] * 10 + c - '0'; in dt_version_str2num()
398 else if (c != '.' || i++ >= sizeof (n) / sizeof (n[0]) - 1) in dt_version_str2num()
399 return (-1); in dt_version_str2num()
405 return (-1); in dt_version_str2num()
431 if (dtp->dt_cpp_argc == dtp->dt_cpp_args) { in dt_cpp_add_arg()
432 int olds = dtp->dt_cpp_args; in dt_cpp_add_arg()
434 char **argv = realloc(dtp->dt_cpp_argv, sizeof (char *) * news); in dt_cpp_add_arg()
440 dtp->dt_cpp_argv = argv; in dt_cpp_add_arg()
441 dtp->dt_cpp_args = news; in dt_cpp_add_arg()
447 assert(dtp->dt_cpp_argc < dtp->dt_cpp_args); in dt_cpp_add_arg()
448 dtp->dt_cpp_argv[dtp->dt_cpp_argc++] = arg; in dt_cpp_add_arg()
457 if (dtp->dt_cpp_argc <= 1) in dt_cpp_pop_arg()
460 arg = dtp->dt_cpp_argv[--dtp->dt_cpp_argc]; in dt_cpp_pop_arg()
461 dtp->dt_cpp_argv[dtp->dt_cpp_argc] = NULL; in dt_cpp_pop_arg()
487 const dtrace_vector_t *v = dtp->dt_vector; in dt_ioctl()
495 return (v->dtv_ioctl(dtp->dt_varg, val, arg)); in dt_ioctl()
497 if (dtp->dt_fd >= 0) in dt_ioctl()
498 return (ioctl(dtp->dt_fd, val, arg)); in dt_ioctl()
501 return (-1); in dt_ioctl()
507 const dtrace_vector_t *v = dtp->dt_vector; in dt_status()
516 return (cpu == 0 ? 1 : -1); in dt_status()
518 return (cpu <= maxid ? 1 : -1); in dt_status()
522 return (v->dtv_status(dtp->dt_varg, cpu)); in dt_status()
528 const dtrace_vector_t *v = dtp->dt_vector; in dt_sysconf()
533 return (v->dtv_sysconf(dtp->dt_varg, name)); in dt_sysconf()
552 resid -= len; in dt_write()
559 return (n - resid); in dt_write()
565 * dt_sprintf_buflen will be non-zero; in this case, we sprintf into the
566 * specified buffer and return. Otherwise, if output is buffered (denoted by
567 * a NULL fp), we sprintf the desired output into the buffered buffer
590 * On FreeBSD, check if output is currently being re-directed in dt_printf()
594 if (dtp->dt_freopen_fp != NULL) in dt_printf()
595 fp = dtp->dt_freopen_fp; in dt_printf()
600 if (dtp->dt_sprintf_buflen != 0) { in dt_printf()
604 assert(dtp->dt_sprintf_buf != NULL); in dt_printf()
606 buf = &dtp->dt_sprintf_buf[len = strlen(dtp->dt_sprintf_buf)]; in dt_printf()
607 len = dtp->dt_sprintf_buflen - len; in dt_printf()
625 * Using buffered output is not allowed if a handler has in dt_printf()
628 if (dtp->dt_bufhdlr == NULL) { in dt_printf()
633 if (dtp->dt_buffered_buf == NULL) { in dt_printf()
634 assert(dtp->dt_buffered_size == 0); in dt_printf()
635 dtp->dt_buffered_size = 1; in dt_printf()
636 dtp->dt_buffered_buf = malloc(dtp->dt_buffered_size); in dt_printf()
638 if (dtp->dt_buffered_buf == NULL) { in dt_printf()
643 dtp->dt_buffered_offs = 0; in dt_printf()
644 dtp->dt_buffered_buf[0] = '\0'; in dt_printf()
664 assert(dtp->dt_buffered_offs < dtp->dt_buffered_size); in dt_printf()
665 avail = dtp->dt_buffered_size - dtp->dt_buffered_offs; in dt_printf()
670 if ((newbuf = realloc(dtp->dt_buffered_buf, in dt_printf()
671 dtp->dt_buffered_size << 1)) == NULL) { in dt_printf()
676 dtp->dt_buffered_buf = newbuf; in dt_printf()
677 dtp->dt_buffered_size <<= 1; in dt_printf()
681 if (vsnprintf(&dtp->dt_buffered_buf[dtp->dt_buffered_offs], in dt_printf()
690 dtp->dt_buffered_offs += needed; in dt_printf()
691 assert(dtp->dt_buffered_buf[dtp->dt_buffered_offs] == '\0'); in dt_printf()
715 if (dtp->dt_buffered_offs == 0) in dt_buffered_flush()
719 data.dtbda_buffered = dtp->dt_buffered_buf; in dt_buffered_flush()
725 if ((*dtp->dt_bufhdlr)(&data, dtp->dt_bufarg) == DTRACE_HANDLE_ABORT) in dt_buffered_flush()
728 dtp->dt_buffered_offs = 0; in dt_buffered_flush()
729 dtp->dt_buffered_buf[0] = '\0'; in dt_buffered_flush()
737 free(dtp->dt_buffered_buf); in dt_buffered_destroy()
738 dtp->dt_buffered_buf = NULL; in dt_buffered_destroy()
739 dtp->dt_buffered_offs = 0; in dt_buffered_destroy()
740 dtp->dt_buffered_size = 0; in dt_buffered_destroy()
780 dt_free(dtp, dp->dtdo_buf); in dt_difo_free()
781 dt_free(dtp, dp->dtdo_inttab); in dt_difo_free()
782 dt_free(dtp, dp->dtdo_strtab); in dt_difo_free()
783 dt_free(dtp, dp->dtdo_vartab); in dt_difo_free()
784 dt_free(dtp, dp->dtdo_kreltab); in dt_difo_free()
785 dt_free(dtp, dp->dtdo_ureltab); in dt_difo_free()
786 dt_free(dtp, dp->dtdo_xlmtab); in dt_difo_free()
814 * from "Hacker's Delight" by Henry Warren, Jr with a 64-bit equivalent added.
820 x = x - ((x >> 1) & 0x55555555UL); in dt_popc()
827 x = x - ((x >> 1) & 0x5555555555555555ULL); in dt_popc()
840 * dt_popcb() is a bitmap-based version of population count that returns the
856 return (popc + dt_popc(bp[maxw] & ((1UL << maxb) - 1))); in dt_popcb()
903 (void) strncpy(str, s, nbytes - 1); in dt_string2str()
906 * that the string is null-terminated. in dt_string2str()
908 str[nbytes - 1] = '\0'; in dt_string2str()
933 dts.dts_name, (u_longlong_t)addr - sym.st_value); in dtrace_addr2str()
940 * GElf_Sym -- indicating that we're only interested in the in dtrace_addr2str()
980 name, (u_longlong_t)(addr - sym.st_value)); in dtrace_uaddr2str()
1001 dtp->dt_oformat = xo_get_style(NULL) == XO_STYLE_TEXT ? in dtrace_oformat_configure()
1012 return (dtp->dt_oformat != DTRACE_OFORMAT_TEXT); in dtrace_oformat()