Lines Matching defs:probe

120  * of tracepoints to enable. If a probe is activated, it adds its ID to
183 * Each time a probe is created, fasttrap_total is incremented by the number
184 * of tracepoints that may be associated with that probe; fasttrap_total is capped
754 fasttrap_tracepoint_enable(proc_t *p, fasttrap_probe_t *probe, uint_t index)
762 ASSERT(index < probe->ftp_ntps);
764 pid = probe->ftp_pid;
765 pc = probe->ftp_tps[index].fit_tp->ftt_pc;
766 id = &probe->ftp_tps[index].fit_id;
768 ASSERT(probe->ftp_tps[index].fit_tp->ftt_pid == pid);
776 * on the generation in which this probe was last modified.
778 fasttrap_mod_barrier(probe->ftp_gen);
812 * This can't be the first interested probe. We don't have
889 * Initialize the tracepoint that's been preallocated with the probe.
891 new_tp = probe->ftp_tps[index].fit_tp;
895 ASSERT(new_tp->ftt_proc == probe->ftp_prov->ftp_proc);
938 fasttrap_tracepoint_disable(proc_t *p, fasttrap_probe_t *probe, uint_t index)
941 fasttrap_provider_t *provider = probe->ftp_prov;
947 ASSERT(index < probe->ftp_ntps);
949 pid = probe->ftp_pid;
950 pc = probe->ftp_tps[index].fit_tp->ftt_pc;
951 id = &probe->ftp_tps[index].fit_id;
953 ASSERT(probe->ftp_tps[index].fit_tp->ftt_pid == pid);
990 while ((*idp)->fti_probe != probe) {
999 ASSERT(id->fti_probe == probe);
1003 * all done, but if this was the last probe assocated with this
1009 * If the current probe's tracepoint is in use, swap it
1012 if (tp == probe->ftp_tps[index].fit_tp) {
1030 ASSERT(*tmp_tp != probe->ftp_tps[index].fit_tp);
1034 probe->ftp_tps[index].fit_tp = *tmp_tp;
1041 * Tag the modified probe with the generation in which it was
1044 probe->ftp_gen = fasttrap_mod_gen;
1086 * Remove the probe from the hash table of active tracepoints.
1102 * Tag the modified probe with the generation in which it was changed.
1104 probe->ftp_gen = fasttrap_mod_gen;
1151 fasttrap_probe_t *probe = parg;
1155 ASSERT(probe != NULL);
1156 ASSERT(!probe->ftp_enabled);
1157 ASSERT(id == probe->ftp_id);
1163 * Increment the count of enabled probes on this probe's provider;
1164 * the provider can't go away while the probe still exists. We
1166 * this probe.
1168 mutex_enter(&probe->ftp_prov->ftp_mtx);
1169 probe->ftp_prov->ftp_rcount++;
1170 mutex_exit(&probe->ftp_prov->ftp_mtx);
1173 * If this probe's provider is retired (meaning it was valid in a
1177 if (probe->ftp_prov->ftp_retired)
1186 if ((p = sprlock(probe->ftp_pid)) == NULL) {
1191 p = prfind(probe->ftp_pid);
1220 if (pget(probe->ftp_pid, PGET_HOLD | PGET_NOTWEXIT, &p) != 0)
1232 * Enable all the tracepoints and add this probe's id to each
1235 for (i = 0; i < probe->ftp_ntps; i++) {
1236 if ((rc = fasttrap_tracepoint_enable(p, probe, i)) != 0) {
1249 * created so far for this probe.
1252 fasttrap_tracepoint_disable(p, probe, i);
1264 * Since we're not actually enabling this probe,
1278 probe->ftp_enabled = 1;
1285 fasttrap_probe_t *probe = parg;
1286 fasttrap_provider_t *provider = probe->ftp_prov;
1290 ASSERT(id == probe->ftp_id);
1298 * DTrace consumers from disabling this probe.
1300 if (pget(probe->ftp_pid, PGET_HOLD | PGET_NOTWEXIT, &p) != 0)
1306 if (probe->ftp_enabled) {
1307 for (i = 0; i < probe->ftp_ntps; i++) {
1308 fasttrap_tracepoint_disable(p, probe, i);
1327 * last probe to be disabled to be able to free it.
1341 if (!probe->ftp_enabled)
1344 probe->ftp_enabled = 0;
1357 fasttrap_probe_t *probe = parg;
1364 if (probe->ftp_prov->ftp_retired != 0 ||
1365 desc->dtargd_ndx >= probe->ftp_nargs) {
1370 ndx = (probe->ftp_argmap != NULL) ?
1371 probe->ftp_argmap[desc->dtargd_ndx] : desc->dtargd_ndx;
1373 str = probe->ftp_ntypes;
1381 if (probe->ftp_xtypes == NULL)
1384 str = probe->ftp_xtypes;
1397 fasttrap_probe_t *probe = parg;
1401 ASSERT(probe != NULL);
1402 ASSERT(!probe->ftp_enabled);
1403 ASSERT(fasttrap_total >= probe->ftp_ntps);
1405 atomic_add_32(&fasttrap_total, -probe->ftp_ntps);
1406 size = offsetof(fasttrap_probe_t, ftp_tps[probe->ftp_ntps]);
1408 if (probe->ftp_gen + 1 >= fasttrap_mod_gen)
1409 fasttrap_mod_barrier(probe->ftp_gen);
1411 for (i = 0; i < probe->ftp_ntps; i++) {
1412 kmem_free(probe->ftp_tps[i].fit_tp,
1416 kmem_free(probe, size);
1885 * actively adding a new probe associated with this provider. This
1954 * We later assume that each probe has exactly one tracepoint
2092 * We know a few things about our context here: we know that the probe being
2096 * this is a new probe and that there is no way for us to race with another
2098 * lookup a probe before adding it. Saving this lookup is important because
2194 * table. Later, when the probe fires, we only remap the arguments
2205 * The probe is fully constructed -- register it with DTrace.
2248 fasttrap_probe_spec_t *probe;
2264 sizeof (probe->ftps_offs[0]) * (noffs - 1);
2269 probe = kmem_alloc(size, KM_SLEEP);
2271 if (copyin(uprobe, probe, size) != 0 ||
2272 probe->ftps_noffs != noffs) {
2273 kmem_free(probe, size);
2281 if (u8_validate(probe->ftps_func, strlen(probe->ftps_func),
2287 if (u8_validate(probe->ftps_mod, strlen(probe->ftps_mod),
2296 pid_t pid = probe->ftps_pid;
2319 ret = fasttrap_add_probe(probe);
2321 kmem_free(probe, size);