mes: Make debug levels 4 and 5 usable.

* HACKING: Update debug policy.
* lib/linux/read.c (read): Print read in level 5.
* src/mes.c (eval_apply): Print module in level 6.
(main): Likewise.  Remove redundant module printing.
* src/gc.c (gc): Print symbols in level 6.
This commit is contained in:
Jan Nieuwenhuizen 2019-05-27 21:30:48 +02:00
parent c33d6d00bc
commit 952b92dfec
No known key found for this signature in database
GPG key ID: F3C1A0D9C1D65273
4 changed files with 11 additions and 25 deletions

View file

@ -132,8 +132,10 @@ enough to work on compiling tinycc's tcc.c albeit a somewhat modified version.
- list of symbol - list of symbol
- opened input strings - opened input strings
- gc details - gc details
5) usage of opened input strings 5) lots of data
- usage of opened input strings
- bytes read
6) globals
* Bugs * Bugs
** mes: performance, Mes is now 2-10x slower than Guile. ** mes: performance, Mes is now 2-10x slower than Guile.

View file

@ -22,7 +22,7 @@ ssize_t
read (int filedes, void *buffer, size_t size) read (int filedes, void *buffer, size_t size)
{ {
ssize_t bytes = _sys_call3 (SYS_read, (int) filedes, (long) buffer, (long) size); ssize_t bytes = _sys_call3 (SYS_read, (int) filedes, (long) buffer, (long) size);
if (__mes_debug () > 3) if (__mes_debug () > 4)
{ {
if (bytes == 1) if (bytes == 1)
{ {

View file

@ -225,7 +225,7 @@ gc_ () ///((internal))
SCM SCM
gc () gc ()
{ {
if (g_debug > 4) if (g_debug > 5)
{ {
eputs ("symbols: "); eputs ("symbols: ");
write_error_ (g_symbols); write_error_ (g_symbols);
@ -237,7 +237,7 @@ gc ()
gc_push_frame (); gc_push_frame ();
gc_ (); gc_ ();
gc_pop_frame (); gc_pop_frame ();
if (g_debug > 4) if (g_debug > 5)
{ {
eputs ("symbols: "); eputs ("symbols: ");
write_error_ (g_symbols); write_error_ (g_symbols);

View file

@ -1547,7 +1547,7 @@ begin_expand:
push_cc (input, r2, r0, cell_vm_return); push_cc (input, r2, r0, cell_vm_return);
x = read_input_file_env (r0); x = read_input_file_env (r0);
if (g_debug > 3) if (g_debug > 5)
module_printer (m0); module_printer (m0);
gc_pop_frame (); gc_pop_frame ();
input = r1; input = r1;
@ -2307,7 +2307,7 @@ main (int argc, char *argv[])
m0 = make_initial_module (a); m0 = make_initial_module (a);
g_macros = make_hash_table_ (0); g_macros = make_hash_table_ (0);
if (g_debug > 3) if (g_debug > 5)
module_printer (m0); module_printer (m0);
SCM program = read_boot (); SCM program = read_boot ();
@ -2334,7 +2334,7 @@ main (int argc, char *argv[])
} }
if (g_debug) if (g_debug)
{ {
if (g_debug > 3) if (g_debug > 5)
module_printer (m0); module_printer (m0);
eputs ("\ngc stats: ["); eputs ("\ngc stats: [");
@ -2345,25 +2345,9 @@ main (int argc, char *argv[])
eputs (" => "); eputs (" => ");
eputs (itoa (g_free)); eputs (itoa (g_free));
eputs ("]\n"); eputs ("]\n");
if (g_debug > 3)
module_printer (m0);
eputs ("\n"); eputs ("\n");
gc (g_stack); if (g_debug > 5)
eputs (" => ");
eputs (itoa (g_free));
eputs ("]\n");
if (g_debug > 3)
module_printer (m0);
eputs ("\n");
gc (g_stack);
eputs (" => ");
eputs (itoa (g_free));
eputs ("]\n");
if (g_debug > 3)
module_printer (m0);
if (g_debug > 3)
{ {
eputs ("ports:"); eputs ("ports:");
write_error_ (g_ports); write_error_ (g_ports);