Commit graph

25 commits

Author SHA1 Message Date
Rafael Ávila de Espíndola
395940f7e3 Dead code elimination. 2011-05-24 19:07:30 -04:00
Rafael Ávila de Espíndola
fe90159b86 "constant propagate" rust_new_exit_task_glue to its only use. 2011-05-24 15:51:22 -04:00
Rafael Ávila de Espíndola
96516e9ca2 One exit_task_glue to rule them all. 2011-05-18 15:43:48 -04:00
Rafael Ávila de Espíndola
d108bfe2ee Remove a bit more dead code. 2011-05-18 14:02:53 -04:00
Rafael Ávila de Espíndola
cebc9b359d Remove dead rustboot code. 2011-05-18 13:48:57 -04:00
Marijn Haverbeke
880be6a940 Overhaul logging system in runtime
See https://github.com/graydon/rust/wiki/Logging-vision

The runtime logging categories are now treated in the same way as
modules in compiled code. Each domain now has a log_lvl that can be
used to restrict the logging from that domain (will be used to allow
logging to be restricted to a single domain).

Features dropped (can be brought back to life if there is interest):
  - Logger indentation
  - Multiple categories per log statement
  - I possibly broke some of the color code -- it confuses me
2011-04-19 16:57:13 +02:00
Marijn Haverbeke
ef62fae9db Add a proper check for rustboot
Uncomment log initialization.
2011-04-18 19:59:49 +02:00
Marijn Haverbeke
c40cf96656 Temporarily turn off logging initialization
Will be restored as soon as I find a way for the runtime
to figure out whether it is on rustboot or rustc.
2011-04-18 18:29:20 +02:00
Marijn Haverbeke
f6be25a870 Update foregoing patches to leave rust_crate alone.
Apparently it can't live in the main binary, since on non-Linux
platforms, dynamics libs won't find symbols in the binary. This
removes the crate_map pointer from rust_crate again, and instead
passes it as an extra argument to rust_start. Rustboot doesn't pass
this argument, but supposedly that's okay as long as we don't actually
use it on that platform.
2011-04-18 16:21:49 +02:00
Marijn Haverbeke
148e6f7b00 Make log the log level configurable per module
This overloads the meaning of RUST_LOG to also allow
'module.submodule' or 'module.somethingelse=2' forms. The first turn
on all logging for a module (loglevel 3), the second sets its loglevel
to 2. Log levels are:

 0: Show only errors
 1: Errors and warnings
 2: Errors, warnings, and notes
 3: Everything, including debug logging

Right now, since we only have one 'log' operation, everything happens
at level 1 (warning), so the only meaningful thing that can be done
with the new RUST_LOG support is disable logging (=0) for some
modules.

TODOS:
 * Language support for logging at a specific level
 * Also add a log level field to tasks, query the current task as well
   as the current module before logging (log if one of them allows it)
 * Revise the C logging API to conform to this set-up (globals for
   per-module log level, query the task level before logging, stop
   using a global mask)

Implementation notes:

Crates now contain two extra data structures. A 'module map' that
contains names and pointers to the module-log-level globals for each
module in the crate that logs, and a 'crate map' that points at the
crate's module map, as well as at the crate maps of all external
crates it depends on. These are walked by the runtime (in
rust_crate.cpp) to set the currect log levels based on RUST_LOG.

These module log globals are allocated as-needed whenever a log
expression is encountered, and their location is hard-coded into the
logging code, which compares the current level to the log statement's
level, and skips over all logging code when it is lower.
2011-04-18 15:28:47 +02:00
Marijn Haverbeke
9a7576fe2c Move to macro-based logging checks in the C++ code
No functions should be called for log statements that turn out to be
inactive.
2011-04-07 15:15:30 -07:00
Graydon Hoare
af4d6ae76b Add ABI tagging to crates, adjust rustc output and runtime stack-frame setup so access to argv works. 2011-02-22 16:37:27 -08:00
Michael Bebenita
de611a3090 Lots of design changes around proxies and message passing. Made it so that domains can only talk to other domains via handles, and with the help of the rust_kernel. 2010-09-07 18:44:12 -07:00
Michael Bebenita
f8ff013e3c Added a few utility classes, cleaned up the include order of .h files, and started to make the Rust kernel own domain message queues rather than the Rust domains themselves. 2010-09-07 18:41:07 -07:00
Michael Bebenita
b40a9fa787 Pulled rust_srv in its own file. Some cleanup, and added varargs to assertion macros. 2010-08-16 15:05:57 -07:00
Graydon Hoare
dbe8760af3 Merge commit 'jyasskin/work'
Conflicts:
	src/rt/rust_dom.cpp
	src/rt/rust_upcall.cpp
2010-08-10 13:26:00 -07:00
Michael Bebenita
76ba8f1d84 Changed array_list::replace() return behavior. 2010-08-09 06:59:46 -07:00
Jeffrey Yasskin
b71340552f Add names to tasks and domains. These can either be an explicit literal string
after the "spawn" keyword, or implicitly the call expression used to start the
spawn.
2010-08-09 11:43:16 +02:00
Michael Bebenita
06b52b70db Fix typos in comments, delete obsolete comments and dead commented code. 2010-07-28 20:30:29 -07:00
Michael Bebenita
d786469785 Add a warning interface to rust_srv. 2010-07-28 20:30:28 -07:00
Michael Bebenita
6afb6c767e Move allocation-tracking into rust_srv. 2010-07-28 20:30:28 -07:00
Michael Bebenita
00d1465d13 Added a message passing system based on lock free queues for inter-thread communication. Channels now buffer on the sending side, and no longer require blocking when sending. Lots of other refactoring and bug fixes. 2010-07-19 14:05:18 -07:00
Roy Frostig
5d10a264de Add another null byte preceding commandline args passed to the root task, in position of closure/obj pointer. 2010-07-15 12:30:46 -07:00
Graydon Hoare
f2861448ab Fix bug in win32 command-line arg processing. 2010-07-04 20:06:18 -07:00
Graydon Hoare
d6b7c96c3e Populate tree. 2010-06-23 21:03:09 -07:00