Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] Prec: add x86 insn rdtsc
@ 2010-04-06  6:05 Hui Zhu
  2010-04-08  6:53 ` Hui Zhu
  0 siblings, 1 reply; 4+ messages in thread
From: Hui Zhu @ 2010-04-06  6:05 UTC (permalink / raw)
  To: gdb-patches ml

Hi,

This patch add x86 insn rdtsc support for prec.

Please help me review it.

Thanks,
Hui

2010-04-06  Hui Zhu  <teawater@gmail.com>

	* i386-tdep.c (i386_process_record): Add support for insn
	rdtsc.


--- a/i386-tdep.c
+++ b/i386-tdep.c
@@ -4958,10 +4954,8 @@ reswitch:

       /* rdtsc */
     case 0x0f31:
-      printf_unfiltered (_("Process record doesn't support "
-			   "instruction rdtsc.\n"));
-      ir.addr -= 2;
-      goto no_support;
+      I386_RECORD_ARCH_LIST_ADD_REG (X86_RECORD_REAX_REGNUM);
+      I386_RECORD_ARCH_LIST_ADD_REG (X86_RECORD_REDX_REGNUM);
       break;

       /* sysenter */


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

* Re: [RFA] Prec: add x86 insn rdtsc
  2010-04-06  6:05 [RFA] Prec: add x86 insn rdtsc Hui Zhu
@ 2010-04-08  6:53 ` Hui Zhu
  2010-04-08  9:12   ` Mark Kettenis
  0 siblings, 1 reply; 4+ messages in thread
From: Hui Zhu @ 2010-04-08  6:53 UTC (permalink / raw)
  To: gdb-patches ml

Update follow cvs-head.
Please help me review it.

Thanks,
Hui

2010-04-08  Hui Zhu  <teawater@gmail.com>

	* i386-tdep.c (i386_process_record): Add support for insn
	rdtsc.

---
 i386-tdep.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

--- a/i386-tdep.c
+++ b/i386-tdep.c
@@ -5395,10 +5395,8 @@ i386_process_record (struct gdbarch *gdb
       break;

     case 0x0f31:    /* rdtsc */
-      printf_unfiltered (_("Process record does not support "
-			   "instruction rdtsc.\n"));
-      ir.addr -= 2;
-      goto no_support;
+      I386_RECORD_ARCH_LIST_ADD_REG (X86_RECORD_REAX_REGNUM);
+      I386_RECORD_ARCH_LIST_ADD_REG (X86_RECORD_REDX_REGNUM);
       break;

     case 0x0f34:    /* sysenter */


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

* Re: [RFA] Prec: add x86 insn rdtsc
  2010-04-08  6:53 ` Hui Zhu
@ 2010-04-08  9:12   ` Mark Kettenis
  2010-04-08  9:28     ` Hui Zhu
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Kettenis @ 2010-04-08  9:12 UTC (permalink / raw)
  To: teawater; +Cc: gdb-patches

> From: Hui Zhu <teawater@gmail.com>
> Date: Thu, 8 Apr 2010 14:52:50 +0800
> 
> Update follow cvs-head.
> Please help me review it.
> 
> Thanks,
> Hui
> 
> 2010-04-08  Hui Zhu  <teawater@gmail.com>
> 
> 	* i386-tdep.c (i386_process_record): Add support for insn
> 	rdtsc.

Fine with me (although I suspect some funny interactions if you
actually start using process record on software that really uses this
instruction).


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

* Re: [RFA] Prec: add x86 insn rdtsc
  2010-04-08  9:12   ` Mark Kettenis
@ 2010-04-08  9:28     ` Hui Zhu
  0 siblings, 0 replies; 4+ messages in thread
From: Hui Zhu @ 2010-04-08  9:28 UTC (permalink / raw)
  To: Mark Kettenis; +Cc: gdb-patches

On Thu, Apr 8, 2010 at 17:12, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
>> From: Hui Zhu <teawater@gmail.com>
>> Date: Thu, 8 Apr 2010 14:52:50 +0800
>>
>> Update follow cvs-head.
>> Please help me review it.
>>
>> Thanks,
>> Hui
>>
>> 2010-04-08  Hui Zhu  <teawater@gmail.com>
>>
>>       * i386-tdep.c (i386_process_record): Add support for insn
>>       rdtsc.
>
> Fine with me (although I suspect some funny interactions if you
> actually start using process record on software that really uses this
> instruction).
>

Checked in.  Thanks Mark.

I use this insn to count the exec time of the insns.  :)

Best regards,
Hui


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

end of thread, other threads:[~2010-04-08  9:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-06  6:05 [RFA] Prec: add x86 insn rdtsc Hui Zhu
2010-04-08  6:53 ` Hui Zhu
2010-04-08  9:12   ` Mark Kettenis
2010-04-08  9:28     ` Hui Zhu

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