PERFORCE change 223022 for review
Robert Watson
rwatson at FreeBSD.org
Mon Mar 18 21:35:29 UTC 2013
http://p4web.freebsd.org/@@223022?ac=10
Change 223022 by rwatson at rwatson_cinnamon on 2013/03/18 21:35:01
Merge new libtesla parts -- specifically, loopback of
(and enhancements to) events exposed via DTrace.
Affected files ...
.. //depot/projects/ctsrd/tesla/src/sys/libtesla/Makefile#2 integrate
.. //depot/projects/ctsrd/tesla/src/sys/libtesla/state-perthread.c#8 integrate
.. //depot/projects/ctsrd/tesla/src/sys/libtesla/state.c#6 integrate
.. //depot/projects/ctsrd/tesla/src/sys/libtesla/tesla.h#4 integrate
.. //depot/projects/ctsrd/tesla/src/sys/libtesla/tesla_dtrace.c#2 integrate
.. //depot/projects/ctsrd/tesla/src/sys/libtesla/tesla_internal.h#9 integrate
.. //depot/projects/ctsrd/tesla/src/sys/libtesla/tesla_notification.c#1 branch
.. //depot/projects/ctsrd/tesla/src/sys/libtesla/update.c#6 integrate
Differences ...
==== //depot/projects/ctsrd/tesla/src/sys/libtesla/Makefile#2 (text+ko) ====
@@ -7,8 +7,8 @@
CFLAGS+= -I${.CURDIR}
INCS= tesla.h libtesla.h
-SRCS= debug.c key.c state.c state-global.c state-perthread.c \
- store.c update.c util.c
+SRCS= debug.c key.c tesla_dtrace.c tesla_notification.c state.c state-global.c
+ state-perthread.c store.c update.c util.c
.include <bsd.lib.mk>
==== //depot/projects/ctsrd/tesla/src/sys/libtesla/state-perthread.c#8 (text+ko) ====
==== //depot/projects/ctsrd/tesla/src/sys/libtesla/state.c#6 (text+ko) ====
@@ -241,11 +241,9 @@
key_str, trans_str);
break;
-#ifdef NOTYET
case TESLA_ACTION_DTRACE:
- dtrace_probe(...);
+ tesla_assert_fail_dtrace(class, NULL, trans);
return;
-#endif
case TESLA_ACTION_PRINTF:
#if defined(_KERNEL) && defined(KDB)
@@ -280,11 +278,11 @@
tsp->ts_name, tsp->ts_description,
transition_matrix(trans), tip->ti_state);
break; /* A bit gratuitous. */
-#ifdef NOTYET
+
case TESLA_ACTION_DTRACE:
- dtrace_probe(...);
+ tesla_assert_fail_dtrace(tsp, tip, trans);
return;
-#endif
+
case TESLA_ACTION_PRINTF:
#if defined(_KERNEL) && defined(KDB)
kdb_backtrace();
==== //depot/projects/ctsrd/tesla/src/sys/libtesla/tesla.h#4 (text+ko) ====
@@ -47,8 +47,11 @@
* * a counter to ensure uniqueness (__COUNTER__)
* * the TESLA context (per-thread or global)
*/
-void __tesla_inline_assertion(const char *filename, int line, int count,
- __tesla_locality*, ...);
+inline void
+__tesla_inline_assertion(const char *filename, int line, int count,
+ __tesla_locality *loc, ...)
+{
+}
/* Only define the following things if doing TESLA analysis, not compiling. */
==== //depot/projects/ctsrd/tesla/src/sys/libtesla/tesla_dtrace.c#2 (text+ko) ====
==== //depot/projects/ctsrd/tesla/src/sys/libtesla/tesla_internal.h#9 (text+ko) ====
@@ -287,12 +287,30 @@
void tesla_class_perthread_destroy(struct tesla_class*);
/*
+ * Event notification:
+ */
+void tesla_state_notify_new_instance(struct tesla_class *,
+ struct tesla_instance *);
+
+void tesla_state_notify_transition(struct tesla_class *,
+ struct tesla_instance *, const struct tesla_transitions *, uint32_t index);
+
+void tesla_state_notify_clone(struct tesla_class *, struct tesla_instance *,
+ const struct tesla_transitions *, uint32_t index);
+
+void tesla_state_notify_fail(struct tesla_class *, struct tesla_instance *,
+ const struct tesla_transitions *);
+
+void tesla_state_notify_pass(struct tesla_class *, struct tesla_instance *);
+
+/*
* DTrace notifications of various events.
*/
void tesla_state_transition_dtrace(struct tesla_class *,
- struct tesla_instance *);
+ struct tesla_instance *, const struct tesla_transitions *,
+ uint32_t transition_index);
void tesla_assert_fail_dtrace(struct tesla_class *,
- struct tesla_instance *);
+ struct tesla_instance *, const struct tesla_transitions *);
void tesla_assert_pass_dtrace(struct tesla_class *,
struct tesla_instance *);
==== //depot/projects/ctsrd/tesla/src/sys/libtesla/update.c#6 (text+ko) ====
@@ -83,8 +83,6 @@
}
tesla_table *table = class->ts_table;
- tesla_instance *start = table->tt_instances;
-
assert(table->tt_length <= 32);
// Did we match any instances?
@@ -141,8 +139,8 @@
// instructed to fork), just update the state.
if (!(t->flags & TESLA_TRANS_FORK)
&& key->tk_mask == k->tk_mask) {
- VERBOSE_PRINT("update %td: %tx->%tx\n",
- inst - start, t->from, t->to);
+ tesla_state_notify_transition(class, inst,
+ trans, j);
inst->ti_state = t->to;
break;
@@ -150,14 +148,12 @@
// If the keys weren't an exact match, we need to fork
// a new (more specific) automaton instance.
+ tesla_state_notify_clone(class, inst, trans, j);
+
struct tesla_instance *clone = clones + cloned++;
*clone = *inst;
clone->ti_state = t->to;
- VERBOSE_PRINT("clone %td:%tx -> %tx\n",
- inst - start, inst->ti_state,
- t->to);
-
CHECK(tesla_key_union, &clone->ti_key, key);
break;
}
@@ -184,8 +180,7 @@
assert(tesla_instance_active(inst));
matched_something = true;
- VERBOSE_PRINT("new %td: %tx\n",
- inst - start, inst->ti_state);
+ tesla_state_notify_new_instance(class, inst);
}
if (t->flags & TESLA_TRANS_CLEANUP) {
More information about the p4-projects
mailing list