Date: Mon, 18 Mar 2013 20:51:40 GMT From: Jonathan Anderson <jonathan@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 223019 for review Message-ID: <201303182051.r2IKpenL038590@skunkworks.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@223019?ac=10 Change 223019 by jonathan@jonathan-on-joe on 2013/03/18 20:51:04 Update to upstream commit 388531c0. Obtained from: https://github.com/CTSRD-TESLA/TESLA/commit/388531c0fb048e8f5f783bcc8d4c244d5304b237 Affected files ... .. //depot/projects/ctsrd/tesla/src/lib/libtesla/Makefile#2 edit .. //depot/projects/ctsrd/tesla/src/lib/libtesla/state-perthread.c#4 edit .. //depot/projects/ctsrd/tesla/src/lib/libtesla/state.c#4 edit .. //depot/projects/ctsrd/tesla/src/lib/libtesla/tesla_dtrace.c#1 add .. //depot/projects/ctsrd/tesla/src/lib/libtesla/tesla_internal.h#4 edit .. //depot/projects/ctsrd/tesla/src/lib/libtesla/tesla_notification.c#1 add .. //depot/projects/ctsrd/tesla/src/lib/libtesla/update.c#5 edit Differences ... ==== //depot/projects/ctsrd/tesla/src/lib/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/lib/libtesla/state-perthread.c#4 (text+ko) ==== @@ -68,7 +68,7 @@ } static void -tesla_perthread_dtor(struct thread *td) +tesla_perthread_dtor(__unused void *arg, struct thread *td) { struct tesla_store *store; ==== //depot/projects/ctsrd/tesla/src/lib/libtesla/state.c#4 (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/lib/libtesla/tesla_internal.h#4 (text+ko) ==== @@ -46,6 +46,8 @@ #include <sys/sx.h> #include <sys/systm.h> +#include <machine/_inttypes.h> + #include <libtesla/libtesla.h> #else #include <assert.h> @@ -285,6 +287,34 @@ 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 *, const struct tesla_transitions *, + uint32_t transition_index); +void tesla_assert_fail_dtrace(struct tesla_class *, + struct tesla_instance *, const struct tesla_transitions *); +void tesla_assert_pass_dtrace(struct tesla_class *, + struct tesla_instance *); + +/* * Debug helpers. */ ==== //depot/projects/ctsrd/tesla/src/lib/libtesla/update.c#5 (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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201303182051.r2IKpenL038590>