diff options
author | Andrew Waterman <waterman@cs.berkeley.edu> | 2016-08-10 12:46:09 -0700 |
---|---|---|
committer | Andrew Waterman <waterman@cs.berkeley.edu> | 2016-08-10 12:46:09 -0700 |
commit | 0a7862c79ffcf931d5369d50b15774cc1ec8f396 (patch) | |
tree | 8e703ef3164e19938b773982094373e6c8f10ea2 /pk/pk.c | |
parent | 7520a474199df8b9ef7cee32eebcea7577813814 (diff) | |
download | riscv-pk-0a7862c79ffcf931d5369d50b15774cc1ec8f396.zip riscv-pk-0a7862c79ffcf931d5369d50b15774cc1ec8f396.tar.gz riscv-pk-0a7862c79ffcf931d5369d50b15774cc1ec8f396.tar.bz2 |
when -s is passed, print time, instret, cycle, and CPI
Diffstat (limited to 'pk/pk.c')
-rw-r--r-- | pk/pk.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -13,7 +13,7 @@ static void handle_option(const char* s) switch (s[1]) { case 's': // print cycle count upon termination - current.t0 = 1; + current.cycle0 = 1; break; default: @@ -105,8 +105,11 @@ static void run_loaded_program(size_t argc, char** argv, uintptr_t kstack_top) STACK_INIT(uintptr_t); - if (current.t0) // start timer if so requested - current.t0 = rdcycle(); + if (current.cycle0) { // start timer if so requested + current.time0 = rdtime(); + current.cycle0 = rdcycle(); + current.instret0 = rdinstret(); + } trapframe_t tf; init_tf(&tf, current.entry, stack_top); |