Add get_cycles(), to be defined in asm/time.h, as a

generic method to access cpu-specific local cycle counter.
Signed-off-by: Keir Fraser <keir@xensource.com>
This commit is contained in:
kaf24@firebug.cl.cam.ac.uk committed 2005-11-01 10:28:41 +01:00
1 parent bde1fa0a22
commit 157a708a28
2 files changed
+12 -1

No files matched your search

+1 -1
View File
@@ -260,7 +260,7 @@ void trace(u32 event, unsigned long d1, unsigned long d2,
}
rec = &t_recs[smp_processor_id()][buf->prod % nr_recs];
rdtscll(rec->cycles);
rec->cycles = (u64)get_cycles();
rec->event = event;
rec->data[0] = d1;
rec->data[1] = d2;
+11
View File
@@ -2,6 +2,8 @@
#ifndef __X86_TIME_H__
#define __X86_TIME_H__
#include <asm/msr.h>
extern int timer_ack;
extern void calibrate_tsc_bp(void);
@@ -10,4 +12,13 @@ extern void calibrate_tsc_ap(void);
struct domain;
extern void init_domain_time(struct domain *d);
typedef u64 cycles_t;
static inline cycles_t get_cycles(void)
{
cycles_t c;
rdtscll(c);
return c;
}
#endif /* __X86_TIME_H__ */
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.