Lines Matching defs:probe

92  * of tracepoints to enable. If a probe is activated, it adds its ID to
145 * fasttrap.conf file. Each time a probe is created, fasttrap_total is
147 * probe; fasttrap_total is capped at fasttrap_max.
501 fasttrap_tracepoint_enable(proc_t *p, fasttrap_probe_t *probe, uint_t index)
509 ASSERT(index < probe->ftp_ntps);
511 pid = probe->ftp_pid;
512 pc = probe->ftp_tps[index].fit_tp->ftt_pc;
513 id = &probe->ftp_tps[index].fit_id;
515 ASSERT(probe->ftp_tps[index].fit_tp->ftt_pid == pid);
521 * on the generation in which this probe was last modified.
523 fasttrap_mod_barrier(probe->ftp_gen);
557 * This can't be the first interested probe. We don't have
632 * Initialize the tracepoint that's been preallocated with the probe.
634 new_tp = probe->ftp_tps[index].fit_tp;
638 ASSERT(new_tp->ftt_proc == probe->ftp_prov->ftp_proc);
674 fasttrap_tracepoint_disable(proc_t *p, fasttrap_probe_t *probe, uint_t index)
677 fasttrap_provider_t *provider = probe->ftp_prov;
683 ASSERT(index < probe->ftp_ntps);
685 pid = probe->ftp_pid;
686 pc = probe->ftp_tps[index].fit_tp->ftt_pc;
687 id = &probe->ftp_tps[index].fit_id;
689 ASSERT(probe->ftp_tps[index].fit_tp->ftt_pid == pid);
726 while ((*idp)->fti_probe != probe) {
735 ASSERT(id->fti_probe == probe);
739 * all done, but if this was the last probe assocated with this
745 * If the current probe's tracepoint is in use, swap it
748 if (tp == probe->ftp_tps[index].fit_tp) {
766 ASSERT(*tmp_tp != probe->ftp_tps[index].fit_tp);
770 probe->ftp_tps[index].fit_tp = *tmp_tp;
777 * Tag the modified probe with the generation in which it was
780 probe->ftp_gen = fasttrap_mod_gen;
818 * Remove the probe from the hash table of active tracepoints.
834 * Tag the modified probe with the generation in which it was changed.
836 probe->ftp_gen = fasttrap_mod_gen;
892 fasttrap_probe_t *probe = parg;
896 ASSERT(probe != NULL);
897 ASSERT(!probe->ftp_enabled);
898 ASSERT(id == probe->ftp_id);
902 * Increment the count of enabled probes on this probe's provider;
903 * the provider can't go away while the probe still exists. We
905 * this probe.
907 mutex_enter(&probe->ftp_prov->ftp_mtx);
908 probe->ftp_prov->ftp_rcount++;
909 mutex_exit(&probe->ftp_prov->ftp_mtx);
912 * If this probe's provider is retired (meaning it was valid in a
916 if (probe->ftp_prov->ftp_retired)
924 if ((p = sprlock(probe->ftp_pid)) == NULL) {
929 p = prfind(probe->ftp_pid);
966 * Enable all the tracepoints and add this probe's id to each
969 for (i = 0; i < probe->ftp_ntps; i++) {
970 if ((rc = fasttrap_tracepoint_enable(p, probe, i)) != 0) {
983 * created so far for this probe.
986 fasttrap_tracepoint_disable(p, probe, i);
994 * Since we're not actually enabling this probe,
1005 probe->ftp_enabled = 1;
1013 fasttrap_probe_t *probe = parg;
1014 fasttrap_provider_t *provider = probe->ftp_prov;
1018 ASSERT(id == probe->ftp_id);
1024 * DTrace consumers from disabling this probe.
1026 if ((p = sprlock(probe->ftp_pid)) != NULL) {
1036 if (probe->ftp_enabled) {
1037 for (i = 0; i < probe->ftp_ntps; i++) {
1038 fasttrap_tracepoint_disable(p, probe, i);
1060 * last probe to be disabled to be able to free it.
1070 if (!probe->ftp_enabled)
1073 probe->ftp_enabled = 0;
1084 fasttrap_probe_t *probe = parg;
1091 if (probe->ftp_prov->ftp_retired != 0 ||
1092 desc->dtargd_ndx >= probe->ftp_nargs) {
1097 ndx = (probe->ftp_argmap != NULL) ?
1098 probe->ftp_argmap[desc->dtargd_ndx] : desc->dtargd_ndx;
1100 str = probe->ftp_ntypes;
1108 if (probe->ftp_xtypes == NULL)
1111 str = probe->ftp_xtypes;
1124 fasttrap_probe_t *probe = parg;
1128 ASSERT(probe != NULL);
1129 ASSERT(!probe->ftp_enabled);
1130 ASSERT(fasttrap_total >= probe->ftp_ntps);
1132 atomic_add_32(&fasttrap_total, -probe->ftp_ntps);
1133 size = offsetof(fasttrap_probe_t, ftp_tps[probe->ftp_ntps]);
1135 if (probe->ftp_gen + 1 >= fasttrap_mod_gen)
1136 fasttrap_mod_barrier(probe->ftp_gen);
1138 for (i = 0; i < probe->ftp_ntps; i++) {
1139 kmem_free(probe->ftp_tps[i].fit_tp,
1143 kmem_free(probe, size);
1581 * actively adding a new probe associated with this provider. This
1650 * We later assume that each probe has exactly one tracepoint
1788 * We know a few things about our context here: we know that the probe being
1792 * this is a new probe and that there is no way for us to race with another
1794 * lookup a probe before adding it. Saving this lookup is important because
1890 * table. Later, when the probe fires, we only remap the arguments
1901 * The probe is fully constructed -- register it with DTrace.
1942 fasttrap_probe_spec_t *probe;
1958 sizeof (probe->ftps_offs[0]) * (noffs - 1);
1963 probe = kmem_alloc(size, KM_SLEEP);
1965 if (copyin(uprobe, probe, size) != 0 ||
1966 probe->ftps_noffs != noffs) {
1967 kmem_free(probe, size);
1975 if (u8_validate(probe->ftps_func, strlen(probe->ftps_func),
1981 if (u8_validate(probe->ftps_mod, strlen(probe->ftps_mod),
1989 pid_t pid = probe->ftps_pid;
2012 ret = fasttrap_add_probe(probe);
2014 kmem_free(probe, size);
2351 nulldev, /* probe */