Lines Matching +full:conf +full:- +full:pd
72 #define DMODE_VERS 0 /* display version information and exit (-V) */
73 #define DMODE_EXEC 1 /* compile program for enabling (-a/e/E) */
74 #define DMODE_ANON 2 /* compile program for anonymous tracing (-A) */
75 #define DMODE_LINK 3 /* compile program for linking with ELF (-G) */
76 #define DMODE_LIST 4 /* compile program and list probes (-l) */
77 #define DMODE_HEADER 5 /* compile program for headergen (-h) */
126 "* \"dtrace -A\" without additional arguments. See the \"Anonymous Tracing\"",
137 (void) fprintf(fp, "Usage: %s [-32|-64] [-aACdeFGhHlqSvVwZ] " in usage()
138 "[-b bufsz] [-c cmd] [-D name[=def]]\n\t[-I path] [-L path] " in usage()
139 "[-o output] [-p pid] [-s script] [-U name]\n\t" in usage()
140 "[-x opt[=val]] [-X a|c|s|t]\n\n" in usage()
141 "\t[-P provider %s]\n" in usage()
142 "\t[-m [ provider: ] module %s]\n" in usage()
143 "\t[-f [[ provider: ] module: ] func %s]\n" in usage()
144 "\t[-n [[[ provider: ] module: ] func: ] name %s]\n" in usage()
145 "\t[-i probe-id %s] [ args ... ]\n\n", g_pname, in usage()
148 (void) fprintf(fp, "\tpredicate -> '/' D-expression '/'\n"); in usage()
149 (void) fprintf(fp, "\t action -> '{' D-statements '}'\n"); in usage()
152 "\t-32 generate 32-bit D programs and ELF files\n" in usage()
153 "\t-64 generate 64-bit D programs and ELF files\n\n" in usage()
154 "\t-a claim anonymous tracing state\n" in usage()
155 "\t-A generate driver.conf(4) directives for anonymous tracing\n" in usage()
156 "\t-b set trace buffer size\n" in usage()
157 "\t-c run specified command and exit upon its completion\n" in usage()
158 "\t-C run cpp(1) preprocessor on script files\n" in usage()
159 "\t-d dump script after syntactic transformations\n" in usage()
160 "\t-D define symbol when invoking preprocessor\n" in usage()
161 "\t-e exit after compiling request but prior to enabling probes\n" in usage()
162 "\t-f enable or list probes matching the specified function name\n" in usage()
163 "\t-F coalesce trace output by function\n" in usage()
164 "\t-G generate an ELF file containing embedded dtrace program\n" in usage()
165 "\t-h generate a header file with definitions for static probes\n" in usage()
166 "\t-H print included files when invoking preprocessor\n" in usage()
167 "\t-i enable or list probes matching the specified probe id\n" in usage()
168 "\t-I add include directory to preprocessor search path\n" in usage()
169 "\t-l list probes matching specified criteria\n" in usage()
170 "\t-L add library directory to library search path\n" in usage()
171 "\t-m enable or list probes matching the specified module name\n" in usage()
172 "\t-n enable or list probes matching the specified probe name\n" in usage()
173 "\t-o set output file\n" in usage()
174 "\t-O print output upon exiting (specific to oformat)\n" in usage()
175 "\t-p grab specified process-ID and cache its symbol tables\n" in usage()
176 "\t-P enable or list probes matching the specified provider name\n" in usage()
177 "\t-q set quiet mode (only output explicitly traced data)\n" in usage()
178 "\t-s enable or list probes according to the specified D script\n" in usage()
179 "\t-S print D compiler intermediate code\n" in usage()
180 "\t-U undefine symbol when invoking preprocessor\n" in usage()
181 "\t-v set verbose mode (report stability attributes, arguments)\n" in usage()
182 "\t-V report DTrace API version\n" in usage()
183 "\t-w permit destructive actions\n" in usage()
184 "\t-x enable or modify compiler and tracing options\n" in usage()
185 "\t-X specify ISO C conformance settings for preprocessor\n" in usage()
186 "\t-Z permit probe descriptions that match zero probes\n"); in usage()
199 if (fmt[strlen(fmt) - 1] != '\n') in verror()
241 if (fmt != NULL && fmt[strlen(fmt) - 1] != '\n') { in dfatal()
281 return; /* -q or quiet pragma suppresses notice()s */ in notice()
340 if ((fd = open(fname, O_RDONLY)) == -1) { in dof_prune()
349 if (fstat(fd, &sbuf) == -1) in dof_prune()
361 if ((fd = open(fname, O_WRONLY | O_TRUNC)) == -1) in dof_prune()
364 len = strlen("dof-data-"); in dof_prune()
367 if (strncmp(&buf[i], "dof-data-", len) != 0) in dof_prune()
373 if (i != 0 && buf[i - 1] != '\n') in dof_prune()
385 if (write(fd, &buf[mark], i - mark) != i - mark) in dof_prune()
405 if (write(fd, &buf[mark], sz - mark) != sz - mark) in dof_prune()
423 "nextboot", "-a", in bootdof_add()
424 "-e", "dtraceall_load=\"YES\"", in bootdof_add()
425 "-e", "dtrace_dof_load=\"YES\"", in bootdof_add()
426 "-e", "dtrace_dof_name=\"/boot/dtrace.dof\"", in bootdof_add()
427 "-e", "dtrace_dof_type=\"dtrace_dof\"", in bootdof_add()
457 if ((fd = open(fname, O_RDONLY)) == -1) in etcsystem_prune()
460 if (fstat(fd, &sbuf) == -1) in etcsystem_prune()
502 O_WRONLY | O_CREAT | O_EXCL, sbuf.st_mode)) == -1) in etcsystem_prune()
518 if (rename(tmpname, fname) == -1) in etcsystem_prune()
541 sizeof (mods) / sizeof (char *) - 1); in etcsystem_add()
570 dtrace_stability_name(p->dtp_attr.dtat_name)); in print_probe_info()
572 dtrace_stability_name(p->dtp_attr.dtat_data)); in print_probe_info()
574 dtrace_class_name(p->dtp_attr.dtat_class)); in print_probe_info()
579 dtrace_stability_name(p->dtp_arga.dtat_name)); in print_probe_info()
581 dtrace_stability_name(p->dtp_arga.dtat_data)); in print_probe_info()
583 dtrace_class_name(p->dtp_arga.dtat_class)); in print_probe_info()
587 for (i = 0; i < p->dtp_argc; i++) { in print_probe_info()
588 if (p->dtp_argv[i].dtt_flags & DTT_FL_USER) in print_probe_info()
592 if (ctf_type_name(p->dtp_argv[i].dtt_ctfp, in print_probe_info()
593 p->dtp_argv[i].dtt_type, buf, sizeof (buf)) == NULL) in print_probe_info()
598 if (p->dtp_argc == 0) in print_probe_info()
609 dtrace_ecbdesc_t *edp = stp->dtsd_ecbdesc; in info_stmt()
610 dtrace_probedesc_t *pdp = &edp->dted_probe; in info_stmt()
617 pdp->dtpd_provider, pdp->dtpd_mod, pdp->dtpd_func, pdp->dtpd_name); in info_stmt()
628 * If -e has been specified, we get the program info but do not enable it. If
629 * -v has been specified, we print a stability report for the program.
638 dtrace_program_info(g_dtp, dcp->dc_prog, &dpi); in exec_prog()
639 } else if (dtrace_program_exec(g_dtp, dcp->dc_prog, &dpi) == -1) { in exec_prog()
640 dfatal("failed to enable '%s'", dcp->dc_name); in exec_prog()
643 dcp->dc_desc, dcp->dc_name, in exec_prog()
649 dcp->dc_desc, dcp->dc_name); in exec_prog()
669 (void) dtrace_stmt_iter(g_dtp, dcp->dc_prog, in exec_prog()
680 * storing in a driver.conf(4) file associated with the dtrace driver.
688 dfatal("failed to create DOF image for '%s'", dcp->dc_name); in anon_prog()
691 q = p + dof->dofh_filesz; in anon_prog()
695 * On FreeBSD, the DOF file is read directly during boot - just write in anon_prog()
698 oprintf("dof-data-%d=", n); in anon_prog()
705 oprintf("dof-data-%d=0x%x", n, *p++); in anon_prog()
718 * helpers, userland provider definitions, or both. If -o was specified, that
719 * path is used as the output file name. If -o wasn't specified and the input
729 (void) strlcpy(dcp->dc_ofile, g_ofile, sizeof (dcp->dc_ofile)); in link_prog()
730 } else if ((p = strrchr(dcp->dc_arg, '.')) != NULL && in link_prog()
733 (void) snprintf(dcp->dc_ofile, sizeof (dcp->dc_ofile), in link_prog()
734 "%s.o", basename(dcp->dc_arg)); in link_prog()
736 (void) snprintf(dcp->dc_ofile, sizeof (dcp->dc_ofile), in link_prog()
737 "d.out.%td", dcp - g_cmdv); in link_prog()
739 (void) snprintf(dcp->dc_ofile, sizeof (dcp->dc_ofile), in link_prog()
743 if (dtrace_program_link(g_dtp, dcp->dc_prog, DTRACE_D_PROBES, in link_prog()
744 dcp->dc_ofile, g_objc, g_objv) != 0) in link_prog()
745 dfatal("failed to link %s %s", dcp->dc_desc, dcp->dc_name); in link_prog()
754 oprintf("%5d %10s %17s %33s %s\n", pdp->dtpd_id, in list_probe()
755 pdp->dtpd_provider, pdp->dtpd_mod, pdp->dtpd_func, pdp->dtpd_name); in list_probe()
771 dtrace_ecbdesc_t *edp = stp->dtsd_ecbdesc; in list_stmt()
776 if (dtrace_probe_iter(g_dtp, &edp->dted_probe, list_probe, NULL) != 0) { in list_stmt()
778 edp->dted_probe.dtpd_provider, edp->dted_probe.dtpd_mod, in list_stmt()
779 edp->dted_probe.dtpd_func, edp->dted_probe.dtpd_name, in list_stmt()
796 (void) dtrace_stmt_iter(g_dtp, dcp->dc_prog, in list_prog()
806 if ((fp = fopen(dcp->dc_arg, "r")) == NULL) in compile_file()
807 fatal("failed to open %s", dcp->dc_arg); in compile_file()
810 g_argv[0] = dcp->dc_arg; in compile_file()
812 if ((dcp->dc_prog = dtrace_program_fcompile(g_dtp, fp, in compile_file()
814 dfatal("failed to compile script %s", dcp->dc_arg); in compile_file()
819 dcp->dc_desc = "script"; in compile_file()
820 dcp->dc_name = dcp->dc_arg; in compile_file()
828 if ((dcp->dc_prog = dtrace_program_strcompile(g_dtp, dcp->dc_arg, in compile_str()
829 dcp->dc_spec, g_cflags | DTRACE_C_PSPEC, g_argc, g_argv)) == NULL) in compile_str()
830 dfatal("invalid probe specifier %s", dcp->dc_arg); in compile_str()
832 if ((p = strpbrk(dcp->dc_arg, "{/;")) != NULL) in compile_str()
835 dcp->dc_desc = "description"; in compile_str()
836 dcp->dc_name = dcp->dc_arg; in compile_str()
845 int pid = Pstatus(P)->pr_pid;
872 if (prp != NULL && WIFSIGNALED(prp->pr_wstat)) {
874 proc_signame(WTERMSIG(prp->pr_wstat),
882 } else if (prp != NULL && WEXITSTATUS(prp->pr_wstat) != 0) {
884 pid, WEXITSTATUS(prp->pr_wstat));
893 g_pslive--;
897 notice("pid %d exec'd a set-id or unobservable program\n", pid);
898 g_pslive--;
907 error(data->dteda_msg);
916 error(data->dtdda_msg);
926 if (strcmp(data->dtsda_option, "quiet") == 0)
927 g_quiet = data->dtsda_newval != DTRACEOPT_UNSET;
929 if (strcmp(data->dtsda_option, "flowindent") == 0)
930 g_flowindent = data->dtsda_newval != DTRACEOPT_UNSET;
940 if ((ptr)->field != NULL) { \
941 const char *c = (ptr)->field; \
961 (long long)(ptr)->field);
965 (ptr)->field != NULL ? "<non-NULL>" : "<NULL>");
971 const dtrace_aggdata_t *agg = bufdata->dtbda_aggdata;
972 const dtrace_recdesc_t *rec = bufdata->dtbda_recdesc;
973 const dtrace_probedesc_t *pd; local
974 uint32_t flags = bufdata->dtbda_flags;
990 if (bufdata->dtbda_probe != NULL) {
991 pd = bufdata->dtbda_probe->dtpda_pdesc;
993 pd = agg->dtada_pdesc;
995 pd = NULL;
1007 (void) snprintf(c, end - c, "0x%x ", bufdata->dtbda_flags);
1014 (void) snprintf(c, end - c,
1021 (void) snprintf(c, end - c, ")");
1026 if (pd != NULL) {
1028 BUFDUMPSTR(pd, dtpd_provider);
1029 BUFDUMPSTR(pd, dtpd_mod);
1030 BUFDUMPSTR(pd, dtpd_func);
1031 BUFDUMPSTR(pd, dtpd_name);
1042 int lim = rec->dtrd_size;
1044 (void) sprintf(buf, "%d (data: ", rec->dtrd_offset);
1050 data = (uint8_t *)agg->dtada_data + rec->dtrd_offset;
1053 (void) snprintf(c, end - c, "%s%02x",
1058 (void) snprintf(c, end - c,
1059 "%s)", lim < rec->dtrd_size ? " ..." : "");
1069 dtrace_aggdesc_t *desc = agg->dtada_desc;
1100 act = rec->dtrd_action;
1101 addr = (uintptr_t)data->dtpda_data;
1115 dtrace_probedesc_t *pd = data->dtpda_pdesc; local
1116 processorid_t cpu = data->dtpda_cpu;
1131 oprintf("%3s %-41s\n", "CPU", "FUNCTION");
1138 dtrace_oformat_probe(g_dtp, data, cpu, pd);
1143 pd->dtpd_func, pd->dtpd_name);
1145 oprintf("%3d %6d %32s ", cpu, pd->dtpd_id, name);
1148 int indent = data->dtpda_indent;
1152 if (data->dtpda_flow == DTRACEFLOW_NONE) {
1156 data->dtpda_prefix, pd->dtpd_func,
1157 pd->dtpd_name);
1162 data->dtpda_prefix, pd->dtpd_func);
1165 oprintf("%3d %-41s ", cpu, name);
1193 if (dtrace_getopt(g_dtp, bufs[i].optname, &bufs[i].val) == -1)
1198 if (dtrace_getopt(g_dtp, rates[i].optname, &rates[i].val) == -1)
1202 if (dtrace_go(g_dtp) == -1)
1217 if (nsize >= bufs[i].val - sizeof (uint64_t))
1223 if (!(nsize & ((INT64_C(1) << (mul - 10)) - 1))) {
1225 (long long)nsize >> (mul - 10), " kmgtpe"[j]);
1372 while ((c = getopt(argc, argv, DTRACE_OPTSTR)) != -1) {
1377 "%s: illegal option -- 3%s\n",
1388 "%s: illegal option -- 6%s\n",
1414 g_cflags |= DTRACE_C_ZDEFS; /* -h implies -Z */
1422 g_cflags |= DTRACE_C_ZDEFS; /* -G implies -Z */
1429 g_cflags |= DTRACE_C_ZDEFS; /* -l implies -Z */
1449 (void) fprintf(stderr, "%s: only one of the [-AGhlV] options "
1470 if ((fd = open64(g_argv[i], O_RDONLY)) == -1)
1490 fatal("can't mix 32-bit and 64-bit "
1496 fatal("can't mix 32-bit and 64-bit "
1521 /* XXX The 32-bit seems to need more buffer space by default -sson */
1531 * If -G is specified, enable -xlink=dynamic and -xunodefs to permit
1533 * If -A is specified, enable -xlink=primary to permit static linking
1544 g_objc = g_argc - 1;
1565 while ((c = getopt(argc, argv, DTRACE_OPTSTR)) != -1) {
1569 dfatal("failed to set -a");
1575 dfatal("failed to set -b %s", optarg);
1592 dfatal("failed to set -D %s", optarg);
1597 dcp->dc_func = compile_str;
1598 dcp->dc_spec = DTRACE_PROBESPEC_FUNC;
1599 dcp->dc_arg = optarg;
1604 dfatal("failed to set -F");
1609 dfatal("failed to set -H");
1614 dcp->dc_func = compile_str;
1615 dcp->dc_spec = DTRACE_PROBESPEC_NAME;
1616 dcp->dc_arg = optarg;
1621 dfatal("failed to set -I %s", optarg);
1626 dfatal("failed to set -L %s", optarg);
1631 dcp->dc_func = compile_str;
1632 dcp->dc_spec = DTRACE_PROBESPEC_MOD;
1633 dcp->dc_arg = optarg;
1638 dcp->dc_func = compile_str;
1639 dcp->dc_spec = DTRACE_PROBESPEC_NAME;
1640 dcp->dc_arg = optarg;
1645 dcp->dc_func = compile_str;
1646 dcp->dc_spec = DTRACE_PROBESPEC_PROVIDER;
1647 dcp->dc_arg = optarg;
1656 dfatal("failed to set -q");
1665 dcp->dc_func = compile_file;
1666 dcp->dc_spec = DTRACE_PROBESPEC_NONE;
1667 dcp->dc_arg = optarg;
1676 dfatal("failed to set -U %s", optarg);
1685 dfatal("failed to set -w");
1693 dfatal("failed to set -x %s", optarg);
1698 dfatal("failed to set -X %s", optarg);
1713 (void) fprintf(stderr, "%s: -B not valid in combination"
1714 " with [-AGl] options\n", g_pname);
1719 (void) fprintf(stderr, "%s: -B not valid in combination"
1720 " with -o option\n", g_pname);
1725 * In our third pass we handle any command-line options related to
1730 while ((c = getopt(argc, argv, DTRACE_OPTSTR)) != -1) {
1769 if (dtrace_handle_err(g_dtp, &errhandler, NULL) == -1)
1772 if (dtrace_handle_drop(g_dtp, &drophandler, NULL) == -1)
1775 if (dtrace_handle_proc(g_dtp, &prochandler, NULL) == -1)
1778 if (dtrace_handle_setopt(g_dtp, &setopthandler, NULL) == -1)
1782 dtrace_handle_buffered(g_dtp, &bufhandler, NULL) == -1)
1802 * turned into programs and saved in g_cmdv[], performing any mode-
1805 * other modes, we will exit dtrace once mode-specific work is done.
1827 g_ofile = "/kernel/drv/dtrace.conf";
1859 * current options as the final DOF property in the .conf file.
1869 * we don't want them suppressed when -A is run on a D program
1886 (void) fprintf(stderr, "%s: -G requires one or more "
1929 (void) fprintf(stderr, "%s: -h requires one or more "
1939 (void) fprintf(stderr, "%s: -h requires an "
1948 (void) fprintf(stderr, "%s: -h requires an "
1975 * If -a and -Z were not specified and no probes have been matched, no
2044 if (dtrace_stop(g_dtp) == -1)
2067 * Since there is no way to format a probe here and machine-readable
2069 * nothing upon Ctrl-C if oformat is specified. If the user wishes to
2075 if (dtrace_aggregate_print(g_dtp, g_ofp, NULL) == -1 &&