提交 55f41649 编写于 作者: hm12299's avatar hm12299

fix all bugs

上级 b96d27ca
......@@ -94,11 +94,11 @@ pub fn sys_exec(path: *const u8, mut args: *const usize) -> isize {
let argc = args_vec.len();
task.set_name(path);
task.exec(all_data.as_slice(), args_vec);
let current_task = current_task().unwrap();
let inner = current_task.acquire_inner_lock();
let mut syscall_inner = inner.syscall.lock();
syscall_inner.syscall_exec.0 += 1;
syscall_inner.syscall_exec.1 += get_time_ms() - start_time;
//let current_task = current_task().unwrap();
//let inner = current_task.acquire_inner_lock();
//let mut syscall_inner = inner.syscall.lock();
//syscall_inner.syscall_exec.0 += 1;
//syscall_inner.syscall_exec.1 += get_time_ms() - start_time;
// return argc because cx.x[10] will be covered with it later
argc as isize
} else {
......@@ -145,10 +145,6 @@ pub fn sys_proc_monitor() -> isize{
print!("{:<18}{:^4} {}ms","SYSCALL_WRITE",sycall_cnt.syscall_write.0, sycall_cnt.syscall_write.1);
print!("\n{:<69}", "");
}
if sycall_cnt.syscall_exit.0 != 0{
print!("{:<18}{:^4} {}ms","SYSCALL_EXIT",sycall_cnt.syscall_exit.0, sycall_cnt.syscall_exit.1);
print!("\n{:<69}", "");
}
if sycall_cnt.syscall_yield.0 != 0{
print!("{:<18}{:^4} {}ms","SYSCALL_YIELD",sycall_cnt.syscall_yield.0, sycall_cnt.syscall_yield.1);
print!("\n{:<69}", "");
......@@ -219,8 +215,6 @@ pub fn sys_waitpid(pid: isize, exit_code_ptr: *mut i32) -> isize {
let exit_code = child.acquire_inner_lock().exit_code;
// ++++ release child PCB lock
*translated_refmut(inner.memory_set.token(), exit_code_ptr) = exit_code;
let current_task = current_task().unwrap();
let inner = current_task.acquire_inner_lock();
let mut syscall_inner = inner.syscall.lock();
syscall_inner.syscall_waitpid.0 += 1;
syscall_inner.syscall_waitpid.1 += get_time_ms() - start_time;
......
......@@ -26,7 +26,6 @@ pub struct SyscallCount{
pub syscall_pipe: (usize, usize),
pub syscall_read: (usize, usize),
pub syscall_write: (usize, usize),
pub syscall_exit: (usize, usize),
pub syscall_yield: (usize, usize),
pub syscall_get_time: (usize, usize),
pub syscall_getpid: (usize, usize),
......@@ -166,7 +165,6 @@ impl TaskControlBlock {
syscall_pipe: (0, 0),
syscall_read: (0, 0),
syscall_write: (0, 0),
syscall_exit: (0, 0),
syscall_yield: (0, 0),
syscall_get_time: (0, 0),
syscall_getpid: (0, 0),
......@@ -291,7 +289,6 @@ impl TaskControlBlock {
syscall_pipe: (0, 0),
syscall_read: (0, 0),
syscall_write: (0, 0),
syscall_exit: (0, 0),
syscall_yield: (0, 0),
syscall_get_time: (0, 0),
syscall_getpid: (0, 0),
......
......@@ -3,9 +3,10 @@
{"message":"unused import: `k210_hal::cache::Uncache`","code":{"code":"unused_imports","explanation":null},"level":"warning","spans":[{"file_name":"src/task/processor.rs","byte_start":86,"byte_end":110,"line_start":4,"line_end":4,"column_start":5,"column_end":29,"is_primary":true,"text":[{"text":"use k210_hal::cache::Uncache;","highlight_start":5,"highlight_end":29}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"remove the whole `use` item","code":null,"level":"help","spans":[{"file_name":"src/task/processor.rs","byte_start":82,"byte_end":111,"line_start":4,"line_end":4,"column_start":1,"column_end":30,"is_primary":true,"text":[{"text":"use k210_hal::cache::Uncache;","highlight_start":1,"highlight_end":30}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[33mwarning\u001b[0m\u001b[0m\u001b[1m: unused import: `k210_hal::cache::Uncache`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/task/processor.rs:4:5\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;12m4\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0muse k210_hal::cache::Uncache;\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[33m^^^^^^^^^^^^^^^^^^^^^^^^\u001b[0m\n\n"}
{"message":"unused import: `ToString`","code":{"code":"unused_imports","explanation":null},"level":"warning","spans":[{"file_name":"src/fs/proc.rs","byte_start":79,"byte_end":87,"line_start":3,"line_end":3,"column_start":29,"column_end":37,"is_primary":true,"text":[{"text":"use alloc::string::{String, ToString};","highlight_start":29,"highlight_end":37}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"remove the unused import","code":null,"level":"help","spans":[{"file_name":"src/fs/proc.rs","byte_start":77,"byte_end":87,"line_start":3,"line_end":3,"column_start":27,"column_end":37,"is_primary":true,"text":[{"text":"use alloc::string::{String, ToString};","highlight_start":27,"highlight_end":37}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[33mwarning\u001b[0m\u001b[0m\u001b[1m: unused import: `ToString`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/fs/proc.rs:3: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;12m3\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0muse alloc::string::{String, ToString};\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[33m^^^^^^^^\u001b[0m\n\n"}
{"message":"unused import: `Deserialize`","code":{"code":"unused_imports","explanation":null},"level":"warning","spans":[{"file_name":"src/fs/proc.rs","byte_start":231,"byte_end":242,"line_start":10,"line_end":10,"column_start":23,"column_end":34,"is_primary":true,"text":[{"text":"use super::{Serialize,Deserialize};","highlight_start":23,"highlight_end":34}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"remove the unused import","code":null,"level":"help","spans":[{"file_name":"src/fs/proc.rs","byte_start":230,"byte_end":242,"line_start":10,"line_end":10,"column_start":22,"column_end":34,"is_primary":true,"text":[{"text":"use super::{Serialize,Deserialize};","highlight_start":22,"highlight_end":34}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[33mwarning\u001b[0m\u001b[0m\u001b[1m: unused import: `Deserialize`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/fs/proc.rs:10:23\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;12m10\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0muse super::{Serialize,Deserialize};\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[33m^^^^^^^^^^^\u001b[0m\n\n"}
{"message":"unused variable: `start_time`","code":{"code":"unused_variables","explanation":null},"level":"warning","spans":[{"file_name":"src/task/mod.rs","byte_start":963,"byte_end":973,"line_start":39,"line_end":39,"column_start":9,"column_end":19,"is_primary":true,"text":[{"text":" let start_time = get_time_ms();","highlight_start":9,"highlight_end":19}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`#[warn(unused_variables)]` on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"if this is intentional, prefix it with an underscore","code":null,"level":"help","spans":[{"file_name":"src/task/mod.rs","byte_start":963,"byte_end":973,"line_start":39,"line_end":39,"column_start":9,"column_end":19,"is_primary":true,"text":[{"text":" let start_time = get_time_ms();","highlight_start":9,"highlight_end":19}],"label":null,"suggested_replacement":"_start_time","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[33mwarning\u001b[0m\u001b[0m\u001b[1m: unused variable: `start_time`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/task/mod.rs:39:9\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;12m39\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m let start_time = get_time_ms();\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[33m^^^^^^^^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[33mhelp: if this is intentional, prefix it with an underscore: `_start_time`\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: `#[warn(unused_variables)]` on by default\u001b[0m\n\n"}
{"message":"unused variable: `start_time`","code":{"code":"unused_variables","explanation":null},"level":"warning","spans":[{"file_name":"src/syscall/process.rs","byte_start":2372,"byte_end":2382,"line_start":79,"line_end":79,"column_start":9,"column_end":19,"is_primary":true,"text":[{"text":" let start_time = get_time_ms();","highlight_start":9,"highlight_end":19}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`#[warn(unused_variables)]` on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"if this is intentional, prefix it with an underscore","code":null,"level":"help","spans":[{"file_name":"src/syscall/process.rs","byte_start":2372,"byte_end":2382,"line_start":79,"line_end":79,"column_start":9,"column_end":19,"is_primary":true,"text":[{"text":" let start_time = get_time_ms();","highlight_start":9,"highlight_end":19}],"label":null,"suggested_replacement":"_start_time","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[33mwarning\u001b[0m\u001b[0m\u001b[1m: unused variable: `start_time`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/syscall/process.rs:79:9\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;12m79\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m let start_time = get_time_ms();\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[33m^^^^^^^^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[33mhelp: if this is intentional, prefix it with an underscore: `_start_time`\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: `#[warn(unused_variables)]` on by default\u001b[0m\n\n"}
{"message":"unused variable: `start_time`","code":{"code":"unused_variables","explanation":null},"level":"warning","spans":[{"file_name":"src/task/mod.rs","byte_start":963,"byte_end":973,"line_start":39,"line_end":39,"column_start":9,"column_end":19,"is_primary":true,"text":[{"text":" let start_time = get_time_ms();","highlight_start":9,"highlight_end":19}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"if this is intentional, prefix it with an underscore","code":null,"level":"help","spans":[{"file_name":"src/task/mod.rs","byte_start":963,"byte_end":973,"line_start":39,"line_end":39,"column_start":9,"column_end":19,"is_primary":true,"text":[{"text":" let start_time = get_time_ms();","highlight_start":9,"highlight_end":19}],"label":null,"suggested_replacement":"_start_time","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[33mwarning\u001b[0m\u001b[0m\u001b[1m: unused variable: `start_time`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/task/mod.rs:39:9\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;12m39\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m let start_time = get_time_ms();\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[33m^^^^^^^^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[33mhelp: if this is intentional, prefix it with an underscore: `_start_time`\u001b[0m\n\n"}
{"message":"unused variable: `start_time`","code":{"code":"unused_variables","explanation":null},"level":"warning","spans":[{"file_name":"src/task/processor.rs","byte_start":1427,"byte_end":1437,"line_start":51,"line_end":51,"column_start":21,"column_end":31,"is_primary":true,"text":[{"text":" let start_time = get_time_ms();","highlight_start":21,"highlight_end":31}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"if this is intentional, prefix it with an underscore","code":null,"level":"help","spans":[{"file_name":"src/task/processor.rs","byte_start":1427,"byte_end":1437,"line_start":51,"line_end":51,"column_start":21,"column_end":31,"is_primary":true,"text":[{"text":" let start_time = get_time_ms();","highlight_start":21,"highlight_end":31}],"label":null,"suggested_replacement":"_start_time","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[33mwarning\u001b[0m\u001b[0m\u001b[1m: unused variable: `start_time`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/task/processor.rs:51:21\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;12m51\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m let start_time = get_time_ms();\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[33m^^^^^^^^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[33mhelp: if this is intentional, prefix it with an underscore: `_start_time`\u001b[0m\n\n"}
{"message":"unused variable: `buf`","code":{"code":"unused_variables","explanation":null},"level":"warning","spans":[{"file_name":"src/fs/proc.rs","byte_start":2334,"byte_end":2337,"line_start":102,"line_end":102,"column_start":21,"column_end":24,"is_primary":true,"text":[{"text":" fn write(&self, buf: UserBuffer) -> usize {","highlight_start":21,"highlight_end":24}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"if this is intentional, prefix it with an underscore","code":null,"level":"help","spans":[{"file_name":"src/fs/proc.rs","byte_start":2334,"byte_end":2337,"line_start":102,"line_end":102,"column_start":21,"column_end":24,"is_primary":true,"text":[{"text":" fn write(&self, buf: UserBuffer) -> usize {","highlight_start":21,"highlight_end":24}],"label":null,"suggested_replacement":"_buf","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[33mwarning\u001b[0m\u001b[0m\u001b[1m: unused variable: `buf`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/fs/proc.rs:102:21\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;12m102\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m fn write(&self, buf: UserBuffer) -> usize {\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[33m^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[33mhelp: if this is intentional, prefix it with an underscore: `_buf`\u001b[0m\n\n"}
{"message":"variable does not need to be mutable","code":{"code":"unused_mut","explanation":null},"level":"warning","spans":[{"file_name":"src/fs/proc.rs","byte_start":1099,"byte_end":1106,"line_start":63,"line_end":63,"column_start":20,"column_end":27,"is_primary":true,"text":[{"text":" fn read(&self, mut buf: UserBuffer) -> usize {","highlight_start":20,"highlight_end":27}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`#[warn(unused_mut)]` on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"remove this `mut`","code":null,"level":"help","spans":[{"file_name":"src/fs/proc.rs","byte_start":1099,"byte_end":1103,"line_start":63,"line_end":63,"column_start":20,"column_end":24,"is_primary":true,"text":[{"text":" fn read(&self, mut buf: UserBuffer) -> usize {","highlight_start":20,"highlight_end":24}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[33mwarning\u001b[0m\u001b[0m\u001b[1m: variable does not need to be mutable\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/fs/proc.rs:63:20\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;12m63\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m fn read(&self, mut buf: UserBuffer) -> usize {\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[1m\u001b[33m^^^\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\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;12mhelp: remove this `mut`\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: `#[warn(unused_mut)]` on by default\u001b[0m\n\n"}
{"message":"variable does not need to be mutable","code":{"code":"unused_mut","explanation":null},"level":"warning","spans":[{"file_name":"src/fs/proc.rs","byte_start":1145,"byte_end":1162,"line_start":66,"line_end":66,"column_start":13,"column_end":30,"is_primary":true,"text":[{"text":" let mut vec_proc_info:Vec<ProcInfo>= get_info().0;","highlight_start":13,"highlight_end":30}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"remove this `mut`","code":null,"level":"help","spans":[{"file_name":"src/fs/proc.rs","byte_start":1145,"byte_end":1149,"line_start":66,"line_end":66,"column_start":13,"column_end":17,"is_primary":true,"text":[{"text":" let mut vec_proc_info:Vec<ProcInfo>= get_info().0;","highlight_start":13,"highlight_end":17}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[33mwarning\u001b[0m\u001b[0m\u001b[1m: variable does not need to be mutable\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/fs/proc.rs:66:13\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;12m66\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m let mut vec_proc_info:Vec<ProcInfo>= get_info().0;\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[1m\u001b[33m^^^^^^^^^^^^^\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\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;12mhelp: remove this `mut`\u001b[0m\n\n"}
{"message":"10 warnings emitted","code":null,"level":"warning","spans":[],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[33mwarning\u001b[0m\u001b[0m\u001b[1m: 10 warnings emitted\u001b[0m\n\n"}
{"message":"11 warnings emitted","code":null,"level":"warning","spans":[],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[33mwarning\u001b[0m\u001b[0m\u001b[1m: 11 warnings emitted\u001b[0m\n\n"}
......@@ -25,7 +25,6 @@ pub struct SyscallCount {
pub syscall_pipe: (usize, usize),
pub syscall_read: (usize, usize),
pub syscall_write: (usize, usize),
pub syscall_exit: (usize, usize),
pub syscall_yield: (usize, usize),
pub syscall_get_time: (usize, usize),
pub syscall_getpid: (usize, usize),
......@@ -62,15 +61,11 @@ pub fn main() {
// else{
// let start_time = get_time();
let mut buf: [u8; 3500] = [WHITE_SPACE; 3500];
let sart_time = get_time();
while true {
//let proc_stat : [ProcStat; 20];
sleep(1000);
let mut buf: [u8; 3500] = [WHITE_SPACE; 3500];
read(PROC_INFO, &mut buf);
//println!("{}",from_utf8(&buf).unwrap().to_string());
let temp = from_utf8(&buf).unwrap().trim();
......@@ -143,13 +138,6 @@ pub fn main() {
);
print!("\n{:<82}", "");
}
if sycall_cnt.syscall_exit.0 != 0 {
print!(
"{:<18}{:^4} {}ms",
"SYSCALL_EXIT", sycall_cnt.syscall_exit.0, sycall_cnt.syscall_exit.1
);
print!("\n{:<82}", "");
}
if sycall_cnt.syscall_yield.0 != 0 {
print!(
"{:<18}{:^4} {}ms",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册