WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] Recent trace patch not arch-neutral

To: Muli Ben-Yehuda <mulix@xxxxxxxxx>
Subject: Re: [Xen-devel] Recent trace patch not arch-neutral
From: Rob Gardner <rob.gardner@xxxxxx>
Date: Mon, 31 Oct 2005 23:38:15 -0700
Cc: "Magenheimer, Dan \(HP Labs Fort Collins\)" <dan.magenheimer@xxxxxx>, Ian Pratt <m+Ian.Pratt@xxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Tue, 01 Nov 2005 06:36:09 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20051101061830.GB7234@xxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <A95E2296287EAD4EB592B5DEEFCE0E9D32E6D0@xxxxxxxxxxxxxxxxxxxxxxxxxxx> <4366A2B4.6070406@xxxxxx> <4366A81B.2050509@xxxxxx> <20051101061830.GB7234@xxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
Muli Ben-Yehuda wrote:
On Mon, Oct 31, 2005 at 04:26:19PM -0700, Rob Gardner wrote:
  
Rob Gardner wrote:

    
Now, to answer Dan's question- the rdtscll thing is just a time stamp 
counter, expressed in cycles. So on ia64 you could probably replace it 
with an asm statement to read ar.itc to make everything work. We just 
need a little wrapper to do the right thing for each architecture. Now 
Dan, if you were more conveniently located, perhaps we could work 
together and fix this. ;)

      
I imagine we just need something that looks like this in trace.c:

#ifdef x86
      rdtscll(rec->cycles);
#endif
#ifdef IA64
      __asm__ __volatile ("mov %0=ar.itc;;" : "=r"(rec->cycles) :: 
"memory");
#endif
    

Can we please stick with the Linux method and put such arch dependant
ifdefs in headers and not in .c files? e.g. define a cycle_counter()
or somesuch inline function that expands to the right thing for each
arch and put it in asm-arch/... Otherwise, it gets messy very quickly
with the addition of new architectures.

  

Of course it'll be done the right way... That's why I sent out my code "suggestion" along with this comment:

Dan, perhaps you know the nice clean way of doing this sort of thing?

Rob

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>