From c8e241211445db065745c0e171c3b00e1aff5431 Mon Sep 17 00:00:00 2001
From: David Li
Date: Sun, 10 Jan 2016 10:13:09 -0700
Subject: Add some syscall logging
---
src/main.rs | 4 ++++
src/system.rs | 4 ++++
2 files changed, 8 insertions(+)
(limited to 'src')
diff --git a/src/main.rs b/src/main.rs
index ff5ed3a..c7ee66f 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,4 +1,6 @@
extern crate docopt;
+#[macro_use] extern crate log;
+extern crate env_logger;
extern crate rustc_serialize;
extern crate rustv;
extern crate time;
@@ -62,6 +64,8 @@ fn load_program(memory: &mut memory::Memory,
}
fn main() {
+ env_logger::init().unwrap();
+
let args: Args = Docopt::new(USAGE)
.and_then(|d| d.decode())
.unwrap_or_else(|e| e.exit());
diff --git a/src/system.rs b/src/system.rs
index b8b928e..8875f28 100644
--- a/src/system.rs
+++ b/src/system.rs
@@ -57,12 +57,16 @@ impl<'a> SyscallHandler<'a> {
fn enable_secondary(&mut self, core_id: usize,
registers: &mut RegisterFile) -> Option {
+ debug!("[syscall] [memory] Secondary cache enabled for core {}",
+ core_id);
self.caches[core_id].borrow_mut().enable_secondary();
None
}
fn disable_secondary(&mut self, core_id: usize,
registers: &mut RegisterFile) -> Option {
+ debug!("[syscall] [memory] Secondary cache disabled for core {}",
+ core_id);
self.caches[core_id].borrow_mut().disable_secondary();
None
}
--
cgit v1.2.3