aboutsummaryrefslogtreecommitdiff
path: root/cpu-all.h
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2006-02-08 22:40:15 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2006-02-08 22:40:15 +0000
commit5f1ce9487c7ab600433d6ebf059b45adad267c27 (patch)
tree7c7a5c01278df3fe4fb86bc744f9c6b2c013ecfb /cpu-all.h
parent05c2a3e7313870811c8a7ec9837f5e75d40ea080 (diff)
downloadqemu-5f1ce9487c7ab600433d6ebf059b45adad267c27.zip
qemu-5f1ce9487c7ab600433d6ebf059b45adad267c27.tar.gz
qemu-5f1ce9487c7ab600433d6ebf059b45adad267c27.tar.bz2
support for builtin profiler
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1751 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'cpu-all.h')
-rw-r--r--cpu-all.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/cpu-all.h b/cpu-all.h
index b374fe8..e0b60d9 100644
--- a/cpu-all.h
+++ b/cpu-all.h
@@ -867,4 +867,24 @@ void cpu_tlb_update_dirty(CPUState *env);
void dump_exec_info(FILE *f,
int (*cpu_fprintf)(FILE *f, const char *fmt, ...));
+/* profiling */
+#ifdef CONFIG_PROFILER
+static inline int64_t profile_getclock(void)
+{
+ int64_t val;
+ asm volatile ("rdtsc" : "=A" (val));
+ return val;
+}
+
+extern int64_t kqemu_time, kqemu_time_start;
+extern int64_t qemu_time, qemu_time_start;
+extern int64_t tlb_flush_time;
+extern int64_t kqemu_exec_count;
+extern int64_t dev_time;
+extern int64_t kqemu_ret_int_count;
+extern int64_t kqemu_ret_excp_count;
+extern int64_t kqemu_ret_intr_count;
+
+#endif
+
#endif /* CPU_ALL_H */