Lines Matching defs:probe
95 * of tracepoints to enable. If a probe is activated, it adds its ID to
149 * fasttrap.conf file. Each time a probe is created, fasttrap_total is
151 * probe; fasttrap_total is capped at fasttrap_max.
578 fasttrap_tracepoint_enable(proc_t *p, fasttrap_probe_t *probe, uint_t index)
586 ASSERT(index < probe->ftp_ntps);
588 pid = probe->ftp_pid;
589 pc = probe->ftp_tps[index].fit_tp->ftt_pc;
590 id = &probe->ftp_tps[index].fit_id;
592 ASSERT(probe->ftp_tps[index].fit_tp->ftt_pid == pid);
598 * on the generation in which this probe was last modified.
600 fasttrap_mod_barrier(probe->ftp_gen);
628 * This can't be the first interested probe. We don't have
703 * Initialize the tracepoint that's been preallocated with the probe.
705 new_tp = probe->ftp_tps[index].fit_tp;
709 ASSERT(new_tp->ftt_proc == probe->ftp_prov->ftp_proc);
745 fasttrap_tracepoint_disable(proc_t *p, fasttrap_probe_t *probe, uint_t index)
748 fasttrap_provider_t *provider = probe->ftp_prov;
754 ASSERT(index < probe->ftp_ntps);
756 pid = probe->ftp_pid;
757 pc = probe->ftp_tps[index].fit_tp->ftt_pc;
758 id = &probe->ftp_tps[index].fit_id;
760 ASSERT(probe->ftp_tps[index].fit_tp->ftt_pid == pid);
799 while ((*idp)->fti_probe != probe) {
808 ASSERT(id->fti_probe == probe);
812 * all done, but if this was the last probe assocated with this
818 * If the current probe's tracepoint is in use, swap it
821 if (tp == probe->ftp_tps[index].fit_tp) {
837 ASSERT(*tmp_tp != probe->ftp_tps[index].fit_tp);
841 probe->ftp_tps[index].fit_tp = *tmp_tp;
849 * Tag the modified probe with the generation in which it was
852 probe->ftp_gen = fasttrap_mod_gen;
890 * Remove the probe from the hash table of active tracepoints.
906 * Tag the modified probe with the generation in which it was changed.
908 probe->ftp_gen = fasttrap_mod_gen;
949 * on CPU B. A probe fires on A, and is allowed to enter. BOOM!
972 fasttrap_probe_t *probe = parg;
976 ASSERT(probe != NULL);
977 ASSERT(!probe->ftp_enabled);
978 ASSERT(id == probe->ftp_id);
982 * Increment the count of enabled probes on this probe's provider;
983 * the provider can't go away while the probe still exists. We
985 * this probe.
987 lck_mtx_lock(&probe->ftp_prov->ftp_mtx);
988 probe->ftp_prov->ftp_rcount++;
989 lck_mtx_unlock(&probe->ftp_prov->ftp_mtx);
992 * If this probe's provider is retired (meaning it was valid in a
996 if (probe->ftp_prov->ftp_retired)
1004 if ((p = sprlock(probe->ftp_pid)) == PROC_NULL) {
1018 p = prfind(probe->ftp_pid);
1039 * time a probe has been enabled in this process, we need to allocate scratch
1058 * Enable all the tracepoints and add this probe's id to each
1061 for (i = 0; i < (int)probe->ftp_ntps; i++) {
1062 if ((rc = fasttrap_tracepoint_enable(p, probe, i)) != 0) {
1075 * created so far for this probe.
1078 fasttrap_tracepoint_disable(p, probe, i);
1086 * Since we're not actually enabling this probe,
1097 probe->ftp_enabled = 1;
1105 fasttrap_probe_t *probe = parg;
1106 fasttrap_provider_t *provider = probe->ftp_prov;
1110 ASSERT(id == probe->ftp_id);
1116 * DTrace consumers from disabling this probe.
1118 if ((p = sprlock(probe->ftp_pid)) != PROC_NULL) {
1128 if (probe->ftp_enabled) {
1129 for (i = 0; i < (int)probe->ftp_ntps; i++) {
1130 fasttrap_tracepoint_disable(p, probe, i);
1152 * last probe to be disabled to be able to free it.
1162 if (!probe->ftp_enabled)
1165 probe->ftp_enabled = 0;
1177 fasttrap_probe_t *probe = parg;
1184 if (probe->ftp_prov->ftp_retired != 0 ||
1185 desc->dtargd_ndx >= probe->ftp_nargs) {
1193 if (probe->ftp_argmap != NULL)
1194 desc->dtargd_mapping = probe->ftp_argmap[desc->dtargd_ndx];
1196 str = probe->ftp_ntypes;
1203 if (probe->ftp_xtypes == NULL)
1206 str = probe->ftp_xtypes;
1219 fasttrap_probe_t *probe = parg;
1222 ASSERT(probe != NULL);
1223 ASSERT(!probe->ftp_enabled);
1224 ASSERT(fasttrap_total >= probe->ftp_ntps);
1226 atomic_add_32(&fasttrap_total, -probe->ftp_ntps);
1228 size_t size = offsetof(fasttrap_probe_t, ftp_tps[probe->ftp_ntps]);
1231 if (probe->ftp_gen + 1 >= fasttrap_mod_gen)
1232 fasttrap_mod_barrier(probe->ftp_gen);
1234 for (i = 0; i < probe->ftp_ntps; i++) {
1236 kmem_free(probe->ftp_tps[i].fit_tp, sizeof (fasttrap_tracepoint_t));
1238 zfree(fasttrap_tracepoint_t_zone, probe->ftp_tps[i].fit_tp);
1243 kmem_free(probe, size);
1245 if (probe->ftp_ntps < FASTTRAP_PROBE_T_ZONE_MAX_TRACEPOINTS) {
1246 zfree(fasttrap_probe_t_zones[probe->ftp_ntps], probe);
1248 size_t size = offsetof(fasttrap_probe_t, ftp_tps[probe->ftp_ntps]);
1249 kmem_free(probe, size);
1715 * actively adding a new probe associated with this provider. This
1949 * each static probe being created. We want to get rid of that check.
2130 * table. Later, when the probe fires, we only remap the arguments
2141 * The probe is fully constructed -- register it with DTrace.
2180 fasttrap_probe_spec_t *probe;
2205 if (noffs > ((1024 * 1024) - sizeof(fasttrap_probe_spec_t)) / sizeof(probe->ftps_offs[0]))
2209 sizeof (probe->ftps_offs[0]) * (noffs - 1);
2211 probe = kmem_alloc(size, KM_SLEEP);
2213 if (copyin((user_addr_t)(unsigned long)uprobe, probe, size) != 0) {
2214 kmem_free(probe, size);
2222 for (i = 0, c = &probe->ftps_func[0]; i < sizeof(probe->ftps_func) && *c != '\0'; i++, c++) {
2233 for (i = 0, c = &probe->ftps_mod[0]; i < sizeof(probe->ftps_mod) && *c != '\0'; i++, c++) {
2246 pid_t pid = probe->ftps_pid;
2268 ret = fasttrap_add_probe(probe);
2271 kmem_free(probe, size);