Hide the sanity_check() function, as it is used nowhere. By putting it
under #ifdef CONFIG_TEST it will stay around, but it won't be
included in normal production builds.
Call sanity_check() from the periodic thread of the test app, causing
a sanity check every second.
Since any application linked with Mini-OS can't call sanity_check()
(there is no EXPORT_SYMBOL for it), there is zero chance of breaking
any use case.
Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
#define BUG_ON(x) ASSERT(!(x))
+#ifdef CONFIG_TEST
/* Consistency check as much as possible. */
void sanity_check(void);
+#endif
/* Get own domid. */
domid_t get_domid(void);
{
}
+#ifdef CONFIG_TEST
void sanity_check(void)
{
int x;
}
}
}
+#endif
{
gettimeofday(&tv, NULL);
printk("T(s=%ld us=%ld)\n", tv.tv_sec, tv.tv_usec);
+ sanity_check();
msleep(1000);
}
}