Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Output execution stats from ARM simulator
@ 2004-11-29 14:39 Jon Beniston
  2004-11-29 14:47 ` Richard Earnshaw
  0 siblings, 1 reply; 4+ messages in thread
From: Jon Beniston @ 2004-11-29 14:39 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 304 bytes --]

Hi,

The attached patch outputs the number of instructions executed and the
number of cycles taken by the ARM simulator.

Cheers,
Jon

2004-11-29  Jon Beniston  <jon@beniston.com>

        * wrapper.c (sim_info): Output number of instructions
        executed and number of cycles taken to execute them.

[-- Attachment #2: sim_info.patch --]
[-- Type: application/octet-stream, Size: 1352 bytes --]

Index: wrapper.c
===================================================================
RCS file: /cvs/src/src/sim/arm/wrapper.c,v
retrieving revision 1.27
diff -c -p -r1.27 wrapper.c
*** wrapper.c	30 Mar 2003 10:39:22 -0000	1.27
--- wrapper.c	29 Nov 2004 14:34:13 -0000
*************** sim_create_inferior (sd, abfd, argv, env
*** 398,405 ****
  void
  sim_info (sd, verbose)
       SIM_DESC sd ATTRIBUTE_UNUSED;
!      int verbose ATTRIBUTE_UNUSED;
  {
  }
  
  static int
--- 398,415 ----
  void
  sim_info (sd, verbose)
       SIM_DESC sd ATTRIBUTE_UNUSED;
!      int verbose;
  {
+   (*sim_callback->printf_filtered) (sim_callback, "Instructions executed: %d\n", state->NumInstrs);  
+   if (verbose) 
+     {
+       (*sim_callback->printf_filtered) (sim_callback, "S cycles: %d\n", state->NumScycles);  
+       (*sim_callback->printf_filtered) (sim_callback, "N cycles: %d\n", state->NumNcycles);  
+       (*sim_callback->printf_filtered) (sim_callback, "I cycles: %d\n", state->NumIcycles);  
+       (*sim_callback->printf_filtered) (sim_callback, "C cycles: %d\n", state->NumCcycles);  
+       (*sim_callback->printf_filtered) (sim_callback, "F cycles: %d\n", state->NumFcycles); 
+     }
+   (*sim_callback->printf_filtered) (sim_callback, "Total cycles: %d\n", ARMul_Time (state));  
  }
  
  static int

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-11-29 15:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-29 14:39 [PATCH] Output execution stats from ARM simulator Jon Beniston
2004-11-29 14:47 ` Richard Earnshaw
2004-11-29 14:57   ` Jon Beniston
2004-11-29 15:06     ` Richard Earnshaw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox