static int splat_taskq_test_order(splat_taskq_arg_t *tq_arg, int *order) { int i, j; for (i = 0; i < SPLAT_TASKQ_ORDER_MAX; i++) { if (tq_arg->order[i] != order[i]) { splat_vprint(tq_arg->file, tq_arg->name, "Taskq '%s' incorrect completion " "order\n", tq_arg->name); splat_vprint(tq_arg->file, tq_arg->name, "%s", "Expected { "); for (j = 0; j < SPLAT_TASKQ_ORDER_MAX; j++) splat_print(tq_arg->file, "%d ", order[j]); splat_print(tq_arg->file, "%s", "}\n"); splat_vprint(tq_arg->file, tq_arg->name, "%s", "Got { "); for (j = 0; j < SPLAT_TASKQ_ORDER_MAX; j++) splat_print(tq_arg->file, "%d ", tq_arg->order[j]); splat_print(tq_arg->file, "%s", "}\n"); return -EILSEQ; } } splat_vprint(tq_arg->file, tq_arg->name, "Taskq '%s' validated correct completion order\n", tq_arg->name); return 0; }
static void splat_kmem_cache_test_debug(struct file *file, char *name, kmem_cache_priv_t *kcp) { int j; splat_vprint(file, name, "%s cache objects %d", kcp->kcp_cache->skc_name, kcp->kcp_count); if (kcp->kcp_cache->skc_flags & (KMC_KMEM | KMC_VMEM)) { splat_vprint(file, name, ", slabs %u/%u objs %u/%u", (unsigned)kcp->kcp_cache->skc_slab_alloc, (unsigned)kcp->kcp_cache->skc_slab_total, (unsigned)kcp->kcp_cache->skc_obj_alloc, (unsigned)kcp->kcp_cache->skc_obj_total); if (!(kcp->kcp_cache->skc_flags & KMC_NOMAGAZINE)) { splat_vprint(file, name, "%s", "mags"); for_each_online_cpu(j) splat_print(file, "%u/%u ", kcp->kcp_cache->skc_mag[j]->skm_avail, kcp->kcp_cache->skc_mag[j]->skm_size); } } splat_print(file, "%s\n", ""); }
static int splat_time_test2(struct file *file, void *arg) { hrtime_t tm1, tm2; int i; tm1 = gethrtime(); splat_vprint(file, SPLAT_TIME_TEST2_NAME, "time is %lld\n", tm1); for(i = 0; i < 100; i++) { tm2 = gethrtime(); splat_vprint(file, SPLAT_TIME_TEST2_NAME, "time is %lld\n", tm2); if(tm1 > tm2) { splat_print(file, "%s: gethrtime() is not giving " "monotonically increasing values\n", SPLAT_TIME_TEST2_NAME); return 1; } tm1 = tm2; set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(10); } return 0; }
static void splat_kmem_cache_test_debug(struct file *file, char *name, kmem_cache_priv_t *kcp) { int j; splat_vprint(file, name, "%s cache objects %d, slabs %u/%u objs %u/%u mags ", kcp->kcp_cache->skc_name, kcp->kcp_count, (unsigned)kcp->kcp_cache->skc_slab_alloc, (unsigned)kcp->kcp_cache->skc_slab_total, (unsigned)kcp->kcp_cache->skc_obj_alloc, (unsigned)kcp->kcp_cache->skc_obj_total); for_each_online_cpu(j) splat_print(file, "%u/%u ", kcp->kcp_cache->skc_mag[j]->skm_avail, kcp->kcp_cache->skc_mag[j]->skm_size); splat_print(file, "%s\n", ""); }