Various timing experimenten.

This commit is contained in:
C. Guy Yarvin 2014-09-27 11:37:04 -07:00
parent e106fab629
commit e8bdd555a9
6 changed files with 39 additions and 25 deletions

View File

@ -59,7 +59,7 @@ INCLUDE=include
MDEFINES=-DU2_OS_$(OS) -DU2_OS_ENDIAN_$(ENDIAN) -D U2_LIB=\"$(LIB)\"
# NOTFORCHECKIN - restore -O2
CFLAGS= $(COSFLAGS) -g -msse3 -ffast-math \
CFLAGS= $(COSFLAGS) -O2 -msse3 -ffast-math \
-funsigned-char \
-I/usr/local/include \
-I/opt/local/include \

2
g/e.c
View File

@ -674,7 +674,9 @@ u3_ce_boot(c3_o nuu_o, c3_c* cpu_c)
/* Map at fixed address.
*/
#if 0
u3_Loom = (void *)U2_OS_LoomBase;
#endif
{
c3_w len_w = u3_cc_bytes;
void* map_v;

5
g/j.c
View File

@ -591,8 +591,7 @@ u3_cj_mine(u3_noun clu,
c3_assert(0 != jax_l);
free(nam_c);
printf("mine: bound jet %d/%s\r\n",
cop_u->jax_l, cop_u->cos_c);
// printf("mine: bound jet %d/%s\r\n", cop_u->jax_l, cop_u->cos_c);
break;
}
i_l++;
@ -608,7 +607,7 @@ u3_cj_mine(u3_noun clu,
fak_u.axe_l = axe_l;
jax_l = _cj_insert(&fak_u);
printf("mine: dummy jet %d/%s\r\n", jax_l, fak_u.cos_c);
// printf("mine: dummy jet %d/%s\r\n", jax_l, fak_u.cos_c);
}
u3_ch_put(u3R->jed.har_u, u3h(cor), jax_l);
u3z(clu);

3
g/m.c
View File

@ -216,7 +216,7 @@ u3_cm_bail(c3_m how_m)
str_c[2] = ((how_m >> 16) & 0xff);
str_c[3] = ((how_m >> 24) & 0xff);
str_c[4] = 0;
printf("bail: %s (at %llu)\n", str_c, u3N);
printf("bail: %s (at %llu)\r\n", str_c, u3N);
_cm_punt();
u3_cv_louse(how_m);
@ -534,7 +534,6 @@ u3_cm_tape(u3_noun tep)
void
u3_cm_wall(u3_noun wol)
{
FILE* fil_u = stdout;
u3_noun wal = wol;
while ( u3_nul != wal ) {

47
g/t.c
View File

@ -94,40 +94,51 @@ u3_ct_flee(void)
void
u3_ct_damp(void)
{
u3_noun wol = u3_do("pi-tell", u3R->pro.day);
if ( 0 != u3R->pro.day ) {
u3_noun wol = u3_do("pi-tell", u3R->pro.day);
u3_cm_wall(wol);
printf("knox: %llu\r\n", (u3R->pro.nox_d / 1000ULL));
u3R->pro.nox_d = 0;
u3R->pro.day = u3_cv_do("doss", 0);
}
u3R->pro.day = u3_cv_do("doss", 0);
u3_cm_wall(wol);
if ( 0 != u3R->pro.nox_d ) {
printf("knox: %llu\r\n", (u3R->pro.nox_d / 1000ULL));
u3R->pro.nox_d = 0;
}
}
/* _ct_sigaction(): profile sigaction callback.
*/
static void _ct_sigaction(c3_i x_i) { u3_ct_samp(); }
void _ct_sigaction(c3_i x_i) { u3_ct_samp(); }
/* u3_ct_boot(): turn sampling on.
*/
void
u3_ct_boot(void)
{
#if defined(U2_OS_osx)
struct itimerval itm_v;
struct sigaction sig_s;
printf("ct: now profiling.\r\n");
sig_s.__sigaction_u.__sa_handler = _ct_sigaction;
sig_s.sa_mask = 0;
sig_s.sa_flags = 0;
sigaction(SIGPROF, &sig_s, 0);
printf("knox: %llu\r\n", (u3R->pro.nox_d / 1000ULL));
u3R->pro.nox_d = 0;
itm_v.it_interval.tv_sec = 0;
itm_v.it_interval.tv_usec = 10000;
itm_v.it_value = itm_v.it_interval;
#if defined(U2_OS_osx)
#if 0
{
struct itimerval itm_v;
struct sigaction sig_s;
setitimer(ITIMER_PROF, &itm_v, 0);
sig_s.__sigaction_u.__sa_handler = _ct_sigaction;
sig_s.sa_mask = 0;
sig_s.sa_flags = 0;
sigaction(SIGPROF, &sig_s, 0);
itm_v.it_interval.tv_sec = 0;
itm_v.it_interval.tv_usec = 10000;
itm_v.it_value = itm_v.it_interval;
setitimer(ITIMER_PROF, &itm_v, 0);
}
#endif
#elif defined(U2_OS_linux)
// TODO: support profiling on linux
#elif defined(U2_OS_bsd)

View File

@ -16,8 +16,11 @@
**/
/* u3_Loom: base of loom, as a word pointer.
*/
#if 0
c3_global c3_w* u3_Loom;
#else
# define u3_Loom ((c3_w *)(void *)0x200000000)
#endif
/* u3_Home / u3H: root of thread. Always north.
*/
c3_global u3_cs_home* u3_Home;