提交 428c6a5a 编写于 作者: hm12299's avatar hm12299

add beautiful table && add cpu_duration

上级 182f28bc
{"rustc_fingerprint":14933657470109532446,"outputs":{"4476964694761187371":["___\nlib___.rlib\nlib___.dylib\nlib___.dylib\nlib___.a\nlib___.dylib\n/Users/chenzhiyang/.rustup/toolchains/nightly-2021-01-30-aarch64-apple-darwin\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_arch=\"aarch64\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_family=\"unix\"\ntarget_feature=\"crc\"\ntarget_feature=\"crypto\"\ntarget_feature=\"fp\"\ntarget_feature=\"fp16\"\ntarget_feature=\"lse\"\ntarget_feature=\"neon\"\ntarget_feature=\"ras\"\ntarget_feature=\"rcpc\"\ntarget_feature=\"rdm\"\ntarget_feature=\"v8.1a\"\ntarget_feature=\"v8.2a\"\ntarget_feature=\"v8.3a\"\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"128\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store=\"128\"\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_os=\"macos\"\ntarget_pointer_width=\"64\"\ntarget_thread_local\ntarget_vendor=\"apple\"\nunix\n",""],"13789308117277828956":["___\nlib___.rlib\nlib___.dylib\nlib___.dylib\nlib___.a\nlib___.dylib\n/Users/chenzhiyang/.rustup/toolchains/nightly-2021-01-30-aarch64-apple-darwin\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_arch=\"aarch64\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_family=\"unix\"\ntarget_feature=\"crc\"\ntarget_feature=\"crypto\"\ntarget_feature=\"fp\"\ntarget_feature=\"fp16\"\ntarget_feature=\"lse\"\ntarget_feature=\"neon\"\ntarget_feature=\"ras\"\ntarget_feature=\"rcpc\"\ntarget_feature=\"rdm\"\ntarget_feature=\"v8.1a\"\ntarget_feature=\"v8.2a\"\ntarget_feature=\"v8.3a\"\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"128\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store=\"128\"\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_os=\"macos\"\ntarget_pointer_width=\"64\"\ntarget_thread_local\ntarget_vendor=\"apple\"\nunix\n",""],"5747014971574785997":["___\nlib___.rlib\nlib___.dylib\nlib___.dylib\nlib___.a\nlib___.dylib\n/Users/chenzhiyang/.rustup/toolchains/nightly-2021-01-30-aarch64-apple-darwin\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_arch=\"aarch64\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_family=\"unix\"\ntarget_feature=\"crc\"\ntarget_feature=\"crypto\"\ntarget_feature=\"fp\"\ntarget_feature=\"fp16\"\ntarget_feature=\"lse\"\ntarget_feature=\"neon\"\ntarget_feature=\"ras\"\ntarget_feature=\"rcpc\"\ntarget_feature=\"rdm\"\ntarget_feature=\"v8.1a\"\ntarget_feature=\"v8.2a\"\ntarget_feature=\"v8.3a\"\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"128\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store=\"128\"\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_os=\"macos\"\ntarget_pointer_width=\"64\"\ntarget_thread_local\ntarget_vendor=\"apple\"\nunix\n",""],"1164083562126845933":["rustc 1.51.0-nightly (b12290861 2021-01-29)\nbinary: rustc\ncommit-hash: b122908617436af187252572ed5db96850551380\ncommit-date: 2021-01-29\nhost: aarch64-apple-darwin\nrelease: 1.51.0-nightly\nLLVM version: 11.0.1\n",""]},"successes":{}}
\ No newline at end of file
{"rustc_fingerprint":9680999004345779706,"outputs":{"4476964694761187371":["___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/home/hm/.rustup/toolchains/nightly-2021-01-30-x86_64-unknown-linux-gnu\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_thread_local\ntarget_vendor=\"unknown\"\nunix\n",""],"1164083562126845933":["rustc 1.51.0-nightly (b12290861 2021-01-29)\nbinary: rustc\ncommit-hash: b122908617436af187252572ed5db96850551380\ncommit-date: 2021-01-29\nhost: x86_64-unknown-linux-gnu\nrelease: 1.51.0-nightly\nLLVM version: 11.0.1\n",""]},"successes":{}}
\ No newline at end of file
/Users/chenzhiyang/projects/github/rustperf/easy-fs-fuse/target/release/easy-fs-fuse: /Users/chenzhiyang/projects/github/rustperf/easy-fs/src/bitmap.rs /Users/chenzhiyang/projects/github/rustperf/easy-fs/src/block_cache.rs /Users/chenzhiyang/projects/github/rustperf/easy-fs/src/block_dev.rs /Users/chenzhiyang/projects/github/rustperf/easy-fs/src/efs.rs /Users/chenzhiyang/projects/github/rustperf/easy-fs/src/layout.rs /Users/chenzhiyang/projects/github/rustperf/easy-fs/src/lib.rs /Users/chenzhiyang/projects/github/rustperf/easy-fs/src/vfs.rs /Users/chenzhiyang/projects/github/rustperf/easy-fs-fuse/src/main.rs
/home/hm/RustPerf/easy-fs-fuse/target/release/easy-fs-fuse: /home/hm/RustPerf/easy-fs/src/bitmap.rs /home/hm/RustPerf/easy-fs/src/block_cache.rs /home/hm/RustPerf/easy-fs/src/block_dev.rs /home/hm/RustPerf/easy-fs/src/efs.rs /home/hm/RustPerf/easy-fs/src/layout.rs /home/hm/RustPerf/easy-fs/src/lib.rs /home/hm/RustPerf/easy-fs/src/vfs.rs /home/hm/RustPerf/easy-fs-fuse/src/main.rs
use lazy_static::*;
use core::cell::RefCell;
pub struct CpuStat{
inner: RefCell<CpuStatInner>,
}
struct CpuStatInner{
start: usize,
sample_duration: usize,
sample_busy_duration: usize,
}
impl CpuStat{
pub fn new() -> Self{
Self{
inner: RefCell::new(CpuStatInner{
start: 0,
sample_duration: 0,
sample_busy_duration: 0,
}),
}
}
}
unsafe impl Sync for CpuStat {}
lazy_static! {
pub static ref CPUSTAT: CpuStat = CpuStat::new();
}
pub fn add_sample_duration(num: usize){
let mut inner = CPUSTAT.inner.borrow_mut();
let add = num - inner.start;
inner.sample_duration += add;
}
pub fn add_sample_busy_duration(num: usize){
CPUSTAT.inner.borrow_mut().sample_busy_duration += num;
}
pub fn set_start(num: usize){
CPUSTAT.inner.borrow_mut().start = num;
}
pub fn get_info() -> (usize, usize){
let inner = CPUSTAT.inner.borrow_mut();
(inner.sample_duration, inner.sample_busy_duration)
}
\ No newline at end of file
......@@ -4,7 +4,9 @@ mod task;
mod manager;
mod processor;
mod pid;
mod cpu;
pub use cpu::{add_sample_busy_duration, add_sample_duration, set_start, get_info};
pub use crate::fs::{open_file, OpenFlags, ProcInfo};
use crate::timer::get_time_ms;
use switch::__switch;
......
......@@ -7,6 +7,8 @@ use lazy_static::*;
use super::{fetch_task, TaskStatus};
use super::__switch;
use crate::trap::TrapContext;
use super::cpu::{add_sample_duration,add_sample_busy_duration,set_start};
use crate::timer::r_cycle;
pub struct Processor {
inner: RefCell<ProcessorInner>,
......@@ -36,7 +38,7 @@ impl Processor {
//println!("run");
loop {
if let Some(task) = fetch_task() {
let busy_start = r_cycle();
let idle_task_cx_ptr2 = self.get_idle_task_cx_ptr2();
// acquire
let mut task_inner = task.acquire_inner_lock();
......@@ -58,6 +60,8 @@ impl Processor {
next_task_cx_ptr2,
);
}
add_sample_busy_duration(r_cycle() - busy_start);
add_sample_duration(r_cycle());
//task_inner.cpu_time += get_time_ms() - start_time;
......@@ -99,6 +103,8 @@ pub fn current_trap_cx() -> &'static mut TrapContext {
}
pub fn schedule(switched_task_cx_ptr2: *const usize) {
let busy_start = r_cycle();
set_start(busy_start);
let idle_task_cx_ptr2 = PROCESSOR.get_idle_task_cx_ptr2();
unsafe {
__switch(
......@@ -106,4 +112,5 @@ pub fn schedule(switched_task_cx_ptr2: *const usize) {
idle_task_cx_ptr2,
);
}
add_sample_busy_duration(r_cycle() - busy_start);
}
......@@ -9,6 +9,16 @@ pub fn get_time() -> usize {
time::read()
}
pub fn r_cycle() -> usize{
let mut ret = 0;
unsafe {
llvm_asm!("csrr $0, cycle"
: "=r" (ret)
);
}
ret
}
pub fn get_time_ms() -> usize {
time::read() / (CLOCK_FREQ / MSEC_PER_SEC)
}
......
{"rustc_fingerprint":14933657470109532446,"outputs":{"13789308117277828956":["___\nlib___.rlib\nlib___.dylib\nlib___.dylib\nlib___.a\nlib___.dylib\n/Users/chenzhiyang/.rustup/toolchains/nightly-2021-01-30-aarch64-apple-darwin\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_arch=\"aarch64\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_family=\"unix\"\ntarget_feature=\"crc\"\ntarget_feature=\"crypto\"\ntarget_feature=\"fp\"\ntarget_feature=\"fp16\"\ntarget_feature=\"lse\"\ntarget_feature=\"neon\"\ntarget_feature=\"ras\"\ntarget_feature=\"rcpc\"\ntarget_feature=\"rdm\"\ntarget_feature=\"v8.1a\"\ntarget_feature=\"v8.2a\"\ntarget_feature=\"v8.3a\"\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"128\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store=\"128\"\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_os=\"macos\"\ntarget_pointer_width=\"64\"\ntarget_thread_local\ntarget_vendor=\"apple\"\nunix\n",""],"1164083562126845933":["rustc 1.51.0-nightly (b12290861 2021-01-29)\nbinary: rustc\ncommit-hash: b122908617436af187252572ed5db96850551380\ncommit-date: 2021-01-29\nhost: aarch64-apple-darwin\nrelease: 1.51.0-nightly\nLLVM version: 11.0.1\n",""],"4476964694761187371":["___\nlib___.rlib\nlib___.dylib\nlib___.dylib\nlib___.a\nlib___.dylib\n/Users/chenzhiyang/.rustup/toolchains/nightly-2021-01-30-aarch64-apple-darwin\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_arch=\"aarch64\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_family=\"unix\"\ntarget_feature=\"crc\"\ntarget_feature=\"crypto\"\ntarget_feature=\"fp\"\ntarget_feature=\"fp16\"\ntarget_feature=\"lse\"\ntarget_feature=\"neon\"\ntarget_feature=\"ras\"\ntarget_feature=\"rcpc\"\ntarget_feature=\"rdm\"\ntarget_feature=\"v8.1a\"\ntarget_feature=\"v8.2a\"\ntarget_feature=\"v8.3a\"\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"128\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store=\"128\"\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_os=\"macos\"\ntarget_pointer_width=\"64\"\ntarget_thread_local\ntarget_vendor=\"apple\"\nunix\n",""],"5747014971574785997":["___\nlib___.rlib\nlib___.dylib\nlib___.dylib\nlib___.a\nlib___.dylib\n/Users/chenzhiyang/.rustup/toolchains/nightly-2021-01-30-aarch64-apple-darwin\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_arch=\"aarch64\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_family=\"unix\"\ntarget_feature=\"crc\"\ntarget_feature=\"crypto\"\ntarget_feature=\"fp\"\ntarget_feature=\"fp16\"\ntarget_feature=\"lse\"\ntarget_feature=\"neon\"\ntarget_feature=\"ras\"\ntarget_feature=\"rcpc\"\ntarget_feature=\"rdm\"\ntarget_feature=\"v8.1a\"\ntarget_feature=\"v8.2a\"\ntarget_feature=\"v8.3a\"\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"128\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store=\"128\"\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_os=\"macos\"\ntarget_pointer_width=\"64\"\ntarget_thread_local\ntarget_vendor=\"apple\"\nunix\n",""],"3451674829631148818":["___\nlib___.rlib\nlib___.a\n/Users/chenzhiyang/.rustup/toolchains/nightly-2021-01-30-aarch64-apple-darwin\ndebug_assertions\npanic=\"abort\"\nproc_macro\ntarget_arch=\"riscv64\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_feature=\"a\"\ntarget_feature=\"c\"\ntarget_feature=\"d\"\ntarget_feature=\"f\"\ntarget_feature=\"m\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_os=\"none\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\n","warning: dropping unsupported crate type `dylib` for target `riscv64gc-unknown-none-elf`\n\nwarning: dropping unsupported crate type `cdylib` for target `riscv64gc-unknown-none-elf`\n\nwarning: dropping unsupported crate type `proc-macro` for target `riscv64gc-unknown-none-elf`\n\nwarning: 3 warnings emitted\n\n"],"4014748978772980884":["___\nlib___.rlib\nlib___.a\n/Users/chenzhiyang/.rustup/toolchains/nightly-2021-01-30-aarch64-apple-darwin\ndebug_assertions\npanic=\"abort\"\nproc_macro\ntarget_arch=\"riscv64\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_feature=\"a\"\ntarget_feature=\"c\"\ntarget_feature=\"d\"\ntarget_feature=\"f\"\ntarget_feature=\"m\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_os=\"none\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\n","warning: dropping unsupported crate type `dylib` for target `riscv64gc-unknown-none-elf`\n\nwarning: dropping unsupported crate type `cdylib` for target `riscv64gc-unknown-none-elf`\n\nwarning: dropping unsupported crate type `proc-macro` for target `riscv64gc-unknown-none-elf`\n\nwarning: 3 warnings emitted\n\n"]},"successes":{}}
\ No newline at end of file
{"rustc_fingerprint":9680999004345779706,"outputs":{"1164083562126845933":["rustc 1.51.0-nightly (b12290861 2021-01-29)\nbinary: rustc\ncommit-hash: b122908617436af187252572ed5db96850551380\ncommit-date: 2021-01-29\nhost: x86_64-unknown-linux-gnu\nrelease: 1.51.0-nightly\nLLVM version: 11.0.1\n",""],"4476964694761187371":["___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/home/hm/.rustup/toolchains/nightly-2021-01-30-x86_64-unknown-linux-gnu\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_thread_local\ntarget_vendor=\"unknown\"\nunix\n",""],"3451674829631148818":["___\nlib___.rlib\nlib___.a\n/home/hm/.rustup/toolchains/nightly-2021-01-30-x86_64-unknown-linux-gnu\ndebug_assertions\npanic=\"abort\"\nproc_macro\ntarget_arch=\"riscv64\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_feature=\"a\"\ntarget_feature=\"c\"\ntarget_feature=\"d\"\ntarget_feature=\"f\"\ntarget_feature=\"m\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_os=\"none\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\n","warning: dropping unsupported crate type `dylib` for target `riscv64gc-unknown-none-elf`\n\nwarning: dropping unsupported crate type `cdylib` for target `riscv64gc-unknown-none-elf`\n\nwarning: dropping unsupported crate type `proc-macro` for target `riscv64gc-unknown-none-elf`\n\nwarning: 3 warnings emitted\n\n"]},"successes":{}}
\ No newline at end of file
{"message":"the name `get_info` is defined multiple times","code":{"code":"E0252","explanation":"Two items of the same name cannot be imported without rebinding one of the\nitems under a new local name.\n\nErroneous code example:\n\n```compile_fail,E0252\nuse foo::baz;\nuse bar::baz; // error, do `use bar::baz as quux` instead\n\nfn main() {}\n\nmod foo {\n pub struct baz;\n}\n\nmod bar {\n pub mod baz {}\n}\n```\n\nYou can use aliases in order to fix this error. Example:\n\n```\nuse foo::baz as foo_baz;\nuse bar::baz; // ok!\n\nfn main() {}\n\nmod foo {\n pub struct baz;\n}\n\nmod bar {\n pub mod baz {}\n}\n```\n\nOr you can reference the item with its parent:\n\n```\nuse bar::baz;\n\nfn main() {\n let x = foo::baz; // ok!\n}\n\nmod foo {\n pub struct baz;\n}\n\nmod bar {\n pub mod baz {}\n}\n```\n"},"level":"error","spans":[{"file_name":"src/task/mod.rs","byte_start":636,"byte_end":644,"line_start":29,"line_end":29,"column_start":29,"column_end":37,"is_primary":true,"text":[{"text":"pub use manager::{add_task, get_info};","highlight_start":29,"highlight_end":37}],"label":"`get_info` reimported here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"src/task/mod.rs","byte_start":154,"byte_end":162,"line_start":9,"line_end":9,"column_start":73,"column_end":81,"is_primary":false,"text":[{"text":"pub use cpu::{add_sample_busy_duration, add_sample_duration, set_start, get_info};","highlight_start":73,"highlight_end":81}],"label":"previous import of the value `get_info` here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`get_info` must be defined only once in the value namespace of this module","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"you can use `as` to change the binding name of the import","code":null,"level":"help","spans":[{"file_name":"src/task/mod.rs","byte_start":636,"byte_end":644,"line_start":29,"line_end":29,"column_start":29,"column_end":37,"is_primary":true,"text":[{"text":"pub use manager::{add_task, get_info};","highlight_start":29,"highlight_end":37}],"label":null,"suggested_replacement":"get_info as other_get_info","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;9merror[E0252]\u001b[0m\u001b[0m\u001b[1m: the name `get_info` is defined multiple times\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/task/mod.rs:29:29\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m9\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0mpub use cpu::{add_sample_busy_duration, add_sample_duration, set_start, get_info};\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--------\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12mprevious import of the value `get_info` here\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m...\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m29\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0mpub use manager::{add_task, get_info};\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9m^^^^^^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9m`get_info` reimported here\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mnote\u001b[0m\u001b[0m: `get_info` must be defined only once in the value namespace of this module\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;14mhelp\u001b[0m\u001b[0m: you can use `as` to change the binding name of the import\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m29\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0mpub use manager::{add_task, get_info as other_get_info};\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;14m^^^^^^^^^^^^^^^^^^^^^^^^^^\u001b[0m\n\n"}
{"message":"can't find crate for `test`","code":{"code":"E0463","explanation":"A plugin/crate was declared but cannot be found.\n\nErroneous code example:\n\n```compile_fail,E0463\n#![feature(plugin)]\n#![plugin(cookie_monster)] // error: can't find crate for `cookie_monster`\nextern crate cake_is_a_lie; // error: can't find crate for `cake_is_a_lie`\n```\n\nYou need to link your code to the relevant crate in order to be able to use it\n(through Cargo or the `-L` option of rustc example). Plugins are crates as\nwell, and you link to them the same way.\n"},"level":"error","spans":[{"file_name":"src/main.rs","byte_start":0,"byte_end":0,"line_start":1,"line_end":1,"column_start":1,"column_end":1,"is_primary":true,"text":[],"label":"can't find crate","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;9merror[E0463]\u001b[0m\u001b[0m\u001b[1m: can't find crate for `test`\u001b[0m\n\n"}
{"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;9merror\u001b[0m\u001b[0m\u001b[1m: aborting due to previous error\u001b[0m\n\n"}
{"message":"For more information about this error, try `rustc --explain E0463`.","code":null,"level":"failure-note","spans":[],"children":[],"rendered":"\u001b[0m\u001b[1mFor more information about this error, try `rustc --explain E0463`.\u001b[0m\n"}
{"message":"aborting due to 2 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[38;5;9merror\u001b[0m\u001b[0m\u001b[1m: aborting due to 2 previous errors\u001b[0m\n\n"}
{"message":"Some errors have detailed explanations: E0252, E0463.","code":null,"level":"failure-note","spans":[],"children":[],"rendered":"\u001b[0m\u001b[1mSome errors have detailed explanations: E0252, E0463.\u001b[0m\n"}
{"message":"For more information about an error, try `rustc --explain E0252`.","code":null,"level":"failure-note","spans":[],"children":[],"rendered":"\u001b[0m\u001b[1mFor more information about an error, try `rustc --explain E0252`.\u001b[0m\n"}
/home/hm/RustPerf/os/target/riscv64gc-unknown-none-elf/debug/deps/os-1b160dc4522f292b.rmeta: src/main.rs src/console.rs src/lang_items.rs src/sbi.rs src/syscall/mod.rs src/syscall/fs.rs src/syscall/process.rs src/trap/mod.rs src/trap/context.rs src/config.rs src/task/mod.rs src/task/context.rs src/task/switch.rs src/task/task.rs src/task/manager.rs src/task/processor.rs src/task/pid.rs src/timer.rs src/mm/mod.rs src/mm/heap_allocator.rs src/mm/address.rs src/mm/frame_allocator.rs src/mm/page_table.rs src/mm/memory_set.rs src/fs/mod.rs src/fs/pipe.rs src/fs/stdio.rs src/fs/inode.rs src/fs/proc.rs src/drivers/mod.rs src/drivers/block/mod.rs src/drivers/block/virtio_blk.rs src/drivers/block/sdcard.rs src/trap/trap.S src/task/switch.S src/entry.asm
/home/hm/RustPerf/os/target/riscv64gc-unknown-none-elf/debug/deps/os-1b160dc4522f292b.rmeta: src/main.rs src/console.rs src/lang_items.rs src/sbi.rs src/syscall/mod.rs src/syscall/fs.rs src/syscall/process.rs src/trap/mod.rs src/trap/context.rs src/config.rs src/task/mod.rs src/task/context.rs src/task/switch.rs src/task/task.rs src/task/manager.rs src/task/processor.rs src/task/pid.rs src/task/cpu.rs src/timer.rs src/mm/mod.rs src/mm/heap_allocator.rs src/mm/address.rs src/mm/frame_allocator.rs src/mm/page_table.rs src/mm/memory_set.rs src/fs/mod.rs src/fs/pipe.rs src/fs/stdio.rs src/fs/inode.rs src/fs/proc.rs src/drivers/mod.rs src/drivers/block/mod.rs src/drivers/block/virtio_blk.rs src/drivers/block/sdcard.rs src/trap/trap.S src/task/switch.S src/entry.asm
/home/hm/RustPerf/os/target/riscv64gc-unknown-none-elf/debug/deps/os-1b160dc4522f292b.d: src/main.rs src/console.rs src/lang_items.rs src/sbi.rs src/syscall/mod.rs src/syscall/fs.rs src/syscall/process.rs src/trap/mod.rs src/trap/context.rs src/config.rs src/task/mod.rs src/task/context.rs src/task/switch.rs src/task/task.rs src/task/manager.rs src/task/processor.rs src/task/pid.rs src/timer.rs src/mm/mod.rs src/mm/heap_allocator.rs src/mm/address.rs src/mm/frame_allocator.rs src/mm/page_table.rs src/mm/memory_set.rs src/fs/mod.rs src/fs/pipe.rs src/fs/stdio.rs src/fs/inode.rs src/fs/proc.rs src/drivers/mod.rs src/drivers/block/mod.rs src/drivers/block/virtio_blk.rs src/drivers/block/sdcard.rs src/trap/trap.S src/task/switch.S src/entry.asm
/home/hm/RustPerf/os/target/riscv64gc-unknown-none-elf/debug/deps/os-1b160dc4522f292b.d: src/main.rs src/console.rs src/lang_items.rs src/sbi.rs src/syscall/mod.rs src/syscall/fs.rs src/syscall/process.rs src/trap/mod.rs src/trap/context.rs src/config.rs src/task/mod.rs src/task/context.rs src/task/switch.rs src/task/task.rs src/task/manager.rs src/task/processor.rs src/task/pid.rs src/task/cpu.rs src/timer.rs src/mm/mod.rs src/mm/heap_allocator.rs src/mm/address.rs src/mm/frame_allocator.rs src/mm/page_table.rs src/mm/memory_set.rs src/fs/mod.rs src/fs/pipe.rs src/fs/stdio.rs src/fs/inode.rs src/fs/proc.rs src/drivers/mod.rs src/drivers/block/mod.rs src/drivers/block/virtio_blk.rs src/drivers/block/sdcard.rs src/trap/trap.S src/task/switch.S src/entry.asm
src/main.rs:
src/console.rs:
......@@ -19,6 +19,7 @@ src/task/task.rs:
src/task/manager.rs:
src/task/processor.rs:
src/task/pid.rs:
src/task/cpu.rs:
src/timer.rs:
src/mm/mod.rs:
src/mm/heap_allocator.rs:
......
/home/hm/RustPerf/os/target/riscv64gc-unknown-none-elf/release/deps/os-41ca51d7c7825e66: src/main.rs src/console.rs src/lang_items.rs src/sbi.rs src/syscall/mod.rs src/syscall/fs.rs src/syscall/process.rs src/trap/mod.rs src/trap/context.rs src/config.rs src/task/mod.rs src/task/context.rs src/task/switch.rs src/task/task.rs src/task/manager.rs src/task/processor.rs src/task/pid.rs src/timer.rs src/mm/mod.rs src/mm/heap_allocator.rs src/mm/address.rs src/mm/frame_allocator.rs src/mm/page_table.rs src/mm/memory_set.rs src/fs/mod.rs src/fs/pipe.rs src/fs/stdio.rs src/fs/inode.rs src/fs/proc.rs src/drivers/mod.rs src/drivers/block/mod.rs src/drivers/block/virtio_blk.rs src/drivers/block/sdcard.rs src/trap/trap.S src/task/switch.S src/entry.asm
/home/hm/RustPerf/os/target/riscv64gc-unknown-none-elf/release/deps/os-41ca51d7c7825e66: src/main.rs src/console.rs src/lang_items.rs src/sbi.rs src/syscall/mod.rs src/syscall/fs.rs src/syscall/process.rs src/trap/mod.rs src/trap/context.rs src/config.rs src/task/mod.rs src/task/context.rs src/task/switch.rs src/task/task.rs src/task/manager.rs src/task/processor.rs src/task/pid.rs src/task/cpu.rs src/timer.rs src/mm/mod.rs src/mm/heap_allocator.rs src/mm/address.rs src/mm/frame_allocator.rs src/mm/page_table.rs src/mm/memory_set.rs src/fs/mod.rs src/fs/pipe.rs src/fs/stdio.rs src/fs/inode.rs src/fs/proc.rs src/drivers/mod.rs src/drivers/block/mod.rs src/drivers/block/virtio_blk.rs src/drivers/block/sdcard.rs src/trap/trap.S src/task/switch.S src/entry.asm
/home/hm/RustPerf/os/target/riscv64gc-unknown-none-elf/release/deps/os-41ca51d7c7825e66.d: src/main.rs src/console.rs src/lang_items.rs src/sbi.rs src/syscall/mod.rs src/syscall/fs.rs src/syscall/process.rs src/trap/mod.rs src/trap/context.rs src/config.rs src/task/mod.rs src/task/context.rs src/task/switch.rs src/task/task.rs src/task/manager.rs src/task/processor.rs src/task/pid.rs src/timer.rs src/mm/mod.rs src/mm/heap_allocator.rs src/mm/address.rs src/mm/frame_allocator.rs src/mm/page_table.rs src/mm/memory_set.rs src/fs/mod.rs src/fs/pipe.rs src/fs/stdio.rs src/fs/inode.rs src/fs/proc.rs src/drivers/mod.rs src/drivers/block/mod.rs src/drivers/block/virtio_blk.rs src/drivers/block/sdcard.rs src/trap/trap.S src/task/switch.S src/entry.asm
/home/hm/RustPerf/os/target/riscv64gc-unknown-none-elf/release/deps/os-41ca51d7c7825e66.d: src/main.rs src/console.rs src/lang_items.rs src/sbi.rs src/syscall/mod.rs src/syscall/fs.rs src/syscall/process.rs src/trap/mod.rs src/trap/context.rs src/config.rs src/task/mod.rs src/task/context.rs src/task/switch.rs src/task/task.rs src/task/manager.rs src/task/processor.rs src/task/pid.rs src/task/cpu.rs src/timer.rs src/mm/mod.rs src/mm/heap_allocator.rs src/mm/address.rs src/mm/frame_allocator.rs src/mm/page_table.rs src/mm/memory_set.rs src/fs/mod.rs src/fs/pipe.rs src/fs/stdio.rs src/fs/inode.rs src/fs/proc.rs src/drivers/mod.rs src/drivers/block/mod.rs src/drivers/block/virtio_blk.rs src/drivers/block/sdcard.rs src/trap/trap.S src/task/switch.S src/entry.asm
src/main.rs:
src/console.rs:
......@@ -19,6 +19,7 @@ src/task/task.rs:
src/task/manager.rs:
src/task/processor.rs:
src/task/pid.rs:
src/task/cpu.rs:
src/timer.rs:
src/mm/mod.rs:
src/mm/heap_allocator.rs:
......
/Users/chenzhiyang/projects/github/rustperf/os/target/riscv64gc-unknown-none-elf/release/os: /Users/chenzhiyang/projects/github/rustperf/easy-fs/src/bitmap.rs /Users/chenzhiyang/projects/github/rustperf/easy-fs/src/block_cache.rs /Users/chenzhiyang/projects/github/rustperf/easy-fs/src/block_dev.rs /Users/chenzhiyang/projects/github/rustperf/easy-fs/src/efs.rs /Users/chenzhiyang/projects/github/rustperf/easy-fs/src/layout.rs /Users/chenzhiyang/projects/github/rustperf/easy-fs/src/lib.rs /Users/chenzhiyang/projects/github/rustperf/easy-fs/src/vfs.rs /Users/chenzhiyang/projects/github/rustperf/os/build.rs /Users/chenzhiyang/projects/github/rustperf/os/src/config.rs /Users/chenzhiyang/projects/github/rustperf/os/src/console.rs /Users/chenzhiyang/projects/github/rustperf/os/src/drivers/block/mod.rs /Users/chenzhiyang/projects/github/rustperf/os/src/drivers/block/sdcard.rs /Users/chenzhiyang/projects/github/rustperf/os/src/drivers/block/virtio_blk.rs /Users/chenzhiyang/projects/github/rustperf/os/src/drivers/mod.rs /Users/chenzhiyang/projects/github/rustperf/os/src/entry.asm /Users/chenzhiyang/projects/github/rustperf/os/src/fs/inode.rs /Users/chenzhiyang/projects/github/rustperf/os/src/fs/mod.rs /Users/chenzhiyang/projects/github/rustperf/os/src/fs/pipe.rs /Users/chenzhiyang/projects/github/rustperf/os/src/fs/proc.rs /Users/chenzhiyang/projects/github/rustperf/os/src/fs/stdio.rs /Users/chenzhiyang/projects/github/rustperf/os/src/lang_items.rs /Users/chenzhiyang/projects/github/rustperf/os/src/main.rs /Users/chenzhiyang/projects/github/rustperf/os/src/mm/address.rs /Users/chenzhiyang/projects/github/rustperf/os/src/mm/frame_allocator.rs /Users/chenzhiyang/projects/github/rustperf/os/src/mm/heap_allocator.rs /Users/chenzhiyang/projects/github/rustperf/os/src/mm/memory_set.rs /Users/chenzhiyang/projects/github/rustperf/os/src/mm/mod.rs /Users/chenzhiyang/projects/github/rustperf/os/src/mm/page_table.rs /Users/chenzhiyang/projects/github/rustperf/os/src/sbi.rs /Users/chenzhiyang/projects/github/rustperf/os/src/syscall/fs.rs /Users/chenzhiyang/projects/github/rustperf/os/src/syscall/mod.rs /Users/chenzhiyang/projects/github/rustperf/os/src/syscall/process.rs /Users/chenzhiyang/projects/github/rustperf/os/src/task/context.rs /Users/chenzhiyang/projects/github/rustperf/os/src/task/manager.rs /Users/chenzhiyang/projects/github/rustperf/os/src/task/mod.rs /Users/chenzhiyang/projects/github/rustperf/os/src/task/pid.rs /Users/chenzhiyang/projects/github/rustperf/os/src/task/processor.rs /Users/chenzhiyang/projects/github/rustperf/os/src/task/switch.S /Users/chenzhiyang/projects/github/rustperf/os/src/task/switch.rs /Users/chenzhiyang/projects/github/rustperf/os/src/task/task.rs /Users/chenzhiyang/projects/github/rustperf/os/src/timer.rs /Users/chenzhiyang/projects/github/rustperf/os/src/trap/context.rs /Users/chenzhiyang/projects/github/rustperf/os/src/trap/mod.rs /Users/chenzhiyang/projects/github/rustperf/os/src/trap/trap.S ../user/src/ ../user/target/riscv64gc-unknown-none-elf/release/ memory-k210.x
/home/hm/RustPerf/os/target/riscv64gc-unknown-none-elf/release/os: /home/hm/RustPerf/easy-fs/src/bitmap.rs /home/hm/RustPerf/easy-fs/src/block_cache.rs /home/hm/RustPerf/easy-fs/src/block_dev.rs /home/hm/RustPerf/easy-fs/src/efs.rs /home/hm/RustPerf/easy-fs/src/layout.rs /home/hm/RustPerf/easy-fs/src/lib.rs /home/hm/RustPerf/easy-fs/src/vfs.rs /home/hm/RustPerf/os/build.rs /home/hm/RustPerf/os/src/config.rs /home/hm/RustPerf/os/src/console.rs /home/hm/RustPerf/os/src/drivers/block/mod.rs /home/hm/RustPerf/os/src/drivers/block/sdcard.rs /home/hm/RustPerf/os/src/drivers/block/virtio_blk.rs /home/hm/RustPerf/os/src/drivers/mod.rs /home/hm/RustPerf/os/src/entry.asm /home/hm/RustPerf/os/src/fs/inode.rs /home/hm/RustPerf/os/src/fs/mod.rs /home/hm/RustPerf/os/src/fs/pipe.rs /home/hm/RustPerf/os/src/fs/proc.rs /home/hm/RustPerf/os/src/fs/stdio.rs /home/hm/RustPerf/os/src/lang_items.rs /home/hm/RustPerf/os/src/main.rs /home/hm/RustPerf/os/src/mm/address.rs /home/hm/RustPerf/os/src/mm/frame_allocator.rs /home/hm/RustPerf/os/src/mm/heap_allocator.rs /home/hm/RustPerf/os/src/mm/memory_set.rs /home/hm/RustPerf/os/src/mm/mod.rs /home/hm/RustPerf/os/src/mm/page_table.rs /home/hm/RustPerf/os/src/sbi.rs /home/hm/RustPerf/os/src/syscall/fs.rs /home/hm/RustPerf/os/src/syscall/mod.rs /home/hm/RustPerf/os/src/syscall/process.rs /home/hm/RustPerf/os/src/task/context.rs /home/hm/RustPerf/os/src/task/cpu.rs /home/hm/RustPerf/os/src/task/manager.rs /home/hm/RustPerf/os/src/task/mod.rs /home/hm/RustPerf/os/src/task/pid.rs /home/hm/RustPerf/os/src/task/processor.rs /home/hm/RustPerf/os/src/task/switch.S /home/hm/RustPerf/os/src/task/switch.rs /home/hm/RustPerf/os/src/task/task.rs /home/hm/RustPerf/os/src/timer.rs /home/hm/RustPerf/os/src/trap/context.rs /home/hm/RustPerf/os/src/trap/mod.rs /home/hm/RustPerf/os/src/trap/trap.S ../user/src/ ../user/target/riscv64gc-unknown-none-elf/release/ memory-k210.x
/home/hm/RustPerf/os/target/rls/riscv64gc-unknown-none-elf/debug/deps/os-1b160dc4522f292b.rmeta: src/main.rs src/console.rs src/lang_items.rs src/sbi.rs src/syscall/mod.rs src/syscall/fs.rs src/syscall/process.rs src/trap/mod.rs src/trap/context.rs src/config.rs src/task/mod.rs src/task/context.rs src/task/switch.rs src/task/task.rs src/task/manager.rs src/task/processor.rs src/task/pid.rs src/timer.rs src/mm/mod.rs src/mm/heap_allocator.rs src/mm/address.rs src/mm/frame_allocator.rs src/mm/page_table.rs src/mm/memory_set.rs src/fs/mod.rs src/fs/pipe.rs src/fs/stdio.rs src/fs/inode.rs src/fs/proc.rs src/drivers/mod.rs src/drivers/block/mod.rs src/drivers/block/virtio_blk.rs src/drivers/block/sdcard.rs src/trap/trap.S src/task/switch.S src/entry.asm
/home/hm/RustPerf/os/target/rls/riscv64gc-unknown-none-elf/debug/deps/os-1b160dc4522f292b.rmeta: src/main.rs src/console.rs src/lang_items.rs src/sbi.rs src/syscall/mod.rs src/syscall/fs.rs src/syscall/process.rs src/trap/mod.rs src/trap/context.rs src/config.rs src/task/mod.rs src/task/context.rs src/task/switch.rs src/task/task.rs src/task/manager.rs src/task/processor.rs src/task/pid.rs src/task/cpu.rs src/timer.rs src/mm/mod.rs src/mm/heap_allocator.rs src/mm/address.rs src/mm/frame_allocator.rs src/mm/page_table.rs src/mm/memory_set.rs src/fs/mod.rs src/fs/pipe.rs src/fs/stdio.rs src/fs/inode.rs src/fs/proc.rs src/drivers/mod.rs src/drivers/block/mod.rs src/drivers/block/virtio_blk.rs src/drivers/block/sdcard.rs src/trap/trap.S src/task/switch.S src/entry.asm
/home/hm/RustPerf/os/target/rls/riscv64gc-unknown-none-elf/debug/deps/os-1b160dc4522f292b.d: src/main.rs src/console.rs src/lang_items.rs src/sbi.rs src/syscall/mod.rs src/syscall/fs.rs src/syscall/process.rs src/trap/mod.rs src/trap/context.rs src/config.rs src/task/mod.rs src/task/context.rs src/task/switch.rs src/task/task.rs src/task/manager.rs src/task/processor.rs src/task/pid.rs src/timer.rs src/mm/mod.rs src/mm/heap_allocator.rs src/mm/address.rs src/mm/frame_allocator.rs src/mm/page_table.rs src/mm/memory_set.rs src/fs/mod.rs src/fs/pipe.rs src/fs/stdio.rs src/fs/inode.rs src/fs/proc.rs src/drivers/mod.rs src/drivers/block/mod.rs src/drivers/block/virtio_blk.rs src/drivers/block/sdcard.rs src/trap/trap.S src/task/switch.S src/entry.asm
/home/hm/RustPerf/os/target/rls/riscv64gc-unknown-none-elf/debug/deps/os-1b160dc4522f292b.d: src/main.rs src/console.rs src/lang_items.rs src/sbi.rs src/syscall/mod.rs src/syscall/fs.rs src/syscall/process.rs src/trap/mod.rs src/trap/context.rs src/config.rs src/task/mod.rs src/task/context.rs src/task/switch.rs src/task/task.rs src/task/manager.rs src/task/processor.rs src/task/pid.rs src/task/cpu.rs src/timer.rs src/mm/mod.rs src/mm/heap_allocator.rs src/mm/address.rs src/mm/frame_allocator.rs src/mm/page_table.rs src/mm/memory_set.rs src/fs/mod.rs src/fs/pipe.rs src/fs/stdio.rs src/fs/inode.rs src/fs/proc.rs src/drivers/mod.rs src/drivers/block/mod.rs src/drivers/block/virtio_blk.rs src/drivers/block/sdcard.rs src/trap/trap.S src/task/switch.S src/entry.asm
src/main.rs:
src/console.rs:
......@@ -19,6 +19,7 @@ src/task/task.rs:
src/task/manager.rs:
src/task/processor.rs:
src/task/pid.rs:
src/task/cpu.rs:
src/timer.rs:
src/mm/mod.rs:
src/mm/heap_allocator.rs:
......
......@@ -54,6 +54,17 @@ pub struct ProcInfoDirect {
pub syscall_cnt: SyscallCount,
}
macro_rules! format_to_string_ln {
($fmt: literal $(, $($arg: tt)+)?) => {
format_args!(concat!($fmt, "\n") $(, $($arg)+)?).to_string()
};
}
macro_rules! format_to_string {
($fmt: literal $(, $($arg: tt)+)?) => {
format_args!($fmt $(, $($arg)+)?).to_string()
};
}
#[no_mangle]
pub fn main() {
// if fork() == 0{
......@@ -61,12 +72,11 @@ pub fn main() {
// }
// else{
// let start_time = get_time();
let sart_time = get_time();
println!("\x1b[2J");
while true {
//let proc_stat : [ProcStat; 20];
//sleep(500);
sleep(1000);
let mut buf: [u8; 3500] = [WHITE_SPACE; 3500];
let sart_read_time = get_time();
//let c = getchar();
......@@ -82,125 +92,124 @@ pub fn main() {
if time_sec > 40{
exit(0);
}
println!("\x1b[1;1H");
println!("-----------------------------------------------------------------------------------------------------------------------");
println!(" rCore-Tutorial-v3 Resource Monitor Time: {} s Read Time: {}ms", time_sec, time_end_sec);
println!("-----------------------------------------------------------------------------------------------------------------------");
let mut pool = Vec::new();
pool.push(format_to_string_ln!("-------------------------------------------------------------------------------------------------------------------------"));
pool.push(format_to_string_ln!(" rCore-Tutorial-v3 Resource Monitor Time: {} s Read Time: {}ms", time_sec, time_end_sec));
pool.push(format_to_string_ln!("-------------------------------------------------------------------------------------------------------------------------"));
let proc_stat: Vec<ProcInfoDirect> = from_str(&temp).unwrap();
println!("Process | pid | ppid | status | heap | mem | cpu time | syscall | times | duration ");
println!("-----------------------------------------------------------------------------------------------------------------------");
pool.push(format_to_string_ln!("Process | pid | ppid | status | heap | mem | cpu time | syscall | times | duration "));
pool.push(format_to_string_ln!("-------------------------------------------------------------------------------------------------------------------------"));
for i in 0..proc_stat.len() {
if proc_stat[i].status == TaskStatus::Zombie {
continue;
}
//println!("{} ", proc_stat[i].name);
print!(
pool.push(format_to_string!(
"{:<15}{:<10}{:<10}",
proc_stat[i].name, proc_stat[i].pid, proc_stat[i].ppid
);
));
match proc_stat[i].status {
TaskStatus::Ready=> print!("Ready"),
TaskStatus::Running => print!("Running"),
TaskStatus::Ready=> pool.push(format_to_string!("Ready")),
TaskStatus::Running => pool.push(format_to_string!("Running")),
_ => panic!("wrong status"),
};
print!("\n{:<82}", "");
pool.push(format_to_string!("\n{:<82}", ""));
let sycall_cnt = proc_stat[i].syscall_cnt;
if sycall_cnt.syscall_dup.0 != 0 {
print!(
"{:<18}{:^4} {}ms",
pool.push(format_to_string!(
"{:<18}{:<6} {}ms",
"SYSCALL_DUP", sycall_cnt.syscall_dup.0, sycall_cnt.syscall_dup.1
);
print!("\n{:<82}", "");
));
pool.push(format_to_string!("\n{:<82}", ""));
}
if sycall_cnt.syscall_open.0 != 0 {
print!(
"{:<18}{:^4} {}ms",
pool.push(format_to_string!(
"{:<18}{:<6} {}ms",
"SYSCALL_OPEN", sycall_cnt.syscall_open.0, sycall_cnt.syscall_open.1
);
print!("\n{:<82}", "");
));
pool.push(format_to_string!("\n{:<82}", ""));
}
if sycall_cnt.syscall_close.0 != 0 {
print!(
"{:<18}{:^4} {}ms",
pool.push(format_to_string!(
"{:<18}{:<6} {}ms",
"SYSCALL_CLOSE", sycall_cnt.syscall_close.0, sycall_cnt.syscall_close.1
);
print!("\n{:<82}", "");
));
pool.push(format_to_string!("\n{:<82}", ""));
}
if sycall_cnt.syscall_pipe.0 != 0 {
print!(
"{:<18}{:^4} {}ms",
pool.push(format_to_string!(
"{:<18}{:<6} {}ms",
"SYSCALL_PIPE", sycall_cnt.syscall_pipe.0, sycall_cnt.syscall_pipe.1
);
print!("\n{:<82}", "");
));
pool.push(format_to_string!("\n{:<82}", ""));
}
if sycall_cnt.syscall_read.0 != 0 {
print!(
"{:<18}{:^4} {}ms",
pool.push(format_to_string!(
"{:<18}{:<6} {}ms",
"SYSCALL_READ", sycall_cnt.syscall_read.0, sycall_cnt.syscall_read.1
);
print!("\n{:<82}", "");
));
pool.push(format_to_string!("\n{:<82}", ""));
}
if sycall_cnt.syscall_write.0 != 0 {
print!(
"{:<18}{:^4} {}ms",
pool.push(format_to_string!(
"{:<18}{:<6} {}ms",
"SYSCALL_WRITE", sycall_cnt.syscall_write.0, sycall_cnt.syscall_write.1
);
print!("\n{:<82}", "");
));
pool.push(format_to_string!("\n{:<82}", ""));
}
if sycall_cnt.syscall_yield.0 != 0 {
print!(
"{:<18}{:^4} {}ms",
pool.push(format_to_string!(
"{:<18}{:<6} {}ms",
"SYSCALL_YIELD", sycall_cnt.syscall_yield.0, sycall_cnt.syscall_yield.1
);
print!("\n{:<82}", "");
));
pool.push(format_to_string!("\n{:<82}", ""));
}
if sycall_cnt.syscall_get_time.0 != 0 {
print!(
"{:<18}{:^4} {}ms",
pool.push(format_to_string!(
"{:<18}{:<6} {}ms",
"SYSCALL_GET_TIME",
sycall_cnt.syscall_get_time.0,
sycall_cnt.syscall_get_time.1
);
print!("\n{:<82}", "");
));
pool.push(format_to_string!("\n{:<82}", ""));
}
if sycall_cnt.syscall_getpid.0 != 0 {
print!(
"{:<18}{:^4} {}ms",
pool.push(format_to_string!(
"{:<18}{:<6} {}ms",
"SYSCALL_GETPID", sycall_cnt.syscall_getpid.0, sycall_cnt.syscall_getpid.1
);
print!("\n{:<82}", "");
));
pool.push(format_to_string!("\n{:<82}", ""));
}
if sycall_cnt.syscall_fork.0 != 0 {
print!(
"{:<18}{:^4} {}ms",
pool.push(format_to_string!(
"{:<18}{:<6} {}ms",
"SYSCALL_FORK", sycall_cnt.syscall_fork.0, sycall_cnt.syscall_fork.1
);
print!("\n{:<82}", "");
));
pool.push(format_to_string!("\n{:<82}", ""));
}
if sycall_cnt.syscall_exec.0 != 0 {
print!(
"{:<18}{:^4} {}ms",
pool.push(format_to_string!(
"{:<18}{:<6} {}ms",
"SYSCALL_EXEC", sycall_cnt.syscall_exec.0, sycall_cnt.syscall_exec.1
);
print!("\n{:<82}", "");
));
pool.push(format_to_string!("\n{:<82}", ""));
}
if sycall_cnt.syscall_waitpid.0 != 0 {
print!(
"{:<18}{:^4} {}ms",
pool.push(format_to_string!(
"{:<18}{:<6} {}ms",
"SYSCALL_WAITPID", sycall_cnt.syscall_waitpid.0, sycall_cnt.syscall_waitpid.1
);
print!("\n{:<82}", "");
));
pool.push(format_to_string!("\n{:<82}", ""));
}
println!("");
pool.push(format_to_string_ln!(""));
}
print!("-----------------------------------------------------------------------------------------------------------------------");
println!("\x1b[0J");
//pool.push(format_to_string!("-----------------------------------------------------------------------------------------------------------------------"));
//println!("{} ", proc_stat[i].total_size);
//println!("{} ", proc_stat[i].cpu_time);
let whole = pool.join("");
print!("\x1b[2J");
print!("\x1b[1;1H");
print!("{}",whole);
}
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册