Exemple #1
0
static int ktap_lib_histogram(ktap_state *ks)
{
	ktap_value *v = kp_arg(ks, 1);

	if (G(ks)->mainthread != ks) {
		kp_error(ks, "only mainthread can call table historgram\n");
		return -1;
	}

	if (ttistable(v))
		kp_table_histogram(ks, hvalue(v));
	else if (ttisaggrtable(v))
		kp_aggrtable_histogram(ks, ahvalue(v));

	return 0;
}
Exemple #2
0
static int ktap_lib_histogram(ktap_State *ks)
{
	kp_table_histogram(ks, hvalue(GetArg(ks, 1))); /* need to check firstly */
	return 0;
}