DragonFly On-Line Manual Pages

Search: Section:  

TBRIDGE(9)	      DragonFly Kernel Developer's Manual	    TBRIDGE(9)


tbridge_printf, tbridge_test_done, TBRIDGE_TESTCASE_MODULE -- kernel test bridge for dfregress


#include <sys/systm.h> #include <sys/kernel.h> #include <sys/module.h> #include <sys/tbridge.h> Functions: int tbridge_printf(const char *fmt, ...); void tbridge_test_done(int result); Macros: TBRIDGE_TESTCASE_MODULE(name, struct tbridge_testcase *testcase); Defines: RESULT_TIMEOUT, RESULT_SIGNALLED, RESULT_NOTRUN, RESULT_FAIL, RESULT_PASS, RESULT_UNKNOWN Callbacks: typedef int (*tbridge_abort_t)(void); typedef void (*tbridge_run_t)(void *);


To create a new kernel testcase `testfoo' the following is required: TBRIDGE_TESTCASE_MODULE(testfoo, &testfoo_case); struct tbridge_testcase testfoo_case = { .tb_run = testfoo_run, /* The following are optional */ .tb_abort = testfoo_abort }; The tb_run callback is called from a separate kernel thread to start testcase execution. The tb_abort callback is optional, but highly recommended. It is called whenever a testcase execution times out, so that the testcase can clean up and abort all running tasks, if possible. If this is not applicable to your test because it is impossible to interrupt, set to NULL.


The TBRIDGE_TESTCASE_MODULE() macro declares a tbridge_printf testcase kernel module. testcase is a structure of type struct tbridge_testcase, as described above. The tbridge_printf() function acts as a kprintf replacement that will log all the output into the testcase metadata that is passed back to userland upon completion. Its syntax is equivalent to that of kprintf(9). The tbridge_test_done() function should be called whenever a result for the testcase is available. The parameter result should be set to one of the RESULT_ defines.




The tbridge_printf module first appeared in DragonFly 2.13.


The tbridge_printf module was written by Alex Hornung. DragonFly 4.7 November 18, 2011 DragonFly 4.7

Search: Section: