debuggers.hg

view xen/include/xen/xenoprof.h @ 0:7d21f7218375

Exact replica of unstable on 051908 + README-this
author Mukesh Rathor
date Mon May 19 15:34:57 2008 -0700 (2008-05-19)
parents
children 46f8fc57b1a4
line source
1 /******************************************************************************
2 * xenoprof.h
3 *
4 * Xenoprof: Xenoprof enables performance profiling in Xen
5 *
6 * Copyright (C) 2005 Hewlett-Packard Co.
7 * written by Aravind Menon & Jose Renato Santos
8 */
10 #ifndef __XEN_XENOPROF_H__
11 #define __XEN_XENOPROF_H__
13 #include <xen/config.h>
14 #include <public/xenoprof.h>
15 #include <asm/xenoprof.h>
17 #define XENOPROF_DOMAIN_IGNORED 0
18 #define XENOPROF_DOMAIN_ACTIVE 1
19 #define XENOPROF_DOMAIN_PASSIVE 2
21 #define XENOPROF_IDLE 0
22 #define XENOPROF_COUNTERS_RESERVED 1
23 #define XENOPROF_READY 2
24 #define XENOPROF_PROFILING 3
26 #ifndef CONFIG_COMPAT
27 typedef struct xenoprof_buf xenoprof_buf_t;
28 #else
29 #include <compat/xenoprof.h>
30 typedef union {
31 struct xenoprof_buf native;
32 struct compat_oprof_buf compat;
33 } xenoprof_buf_t;
34 #endif
36 struct xenoprof_vcpu {
37 int event_size;
38 xenoprof_buf_t *buffer;
39 };
41 struct xenoprof {
42 char *rawbuf;
43 int npages;
44 int nbuf;
45 int bufsize;
46 int domain_type;
47 int domain_ready;
48 int is_primary;
49 #ifdef CONFIG_COMPAT
50 int is_compat;
51 #endif
52 struct xenoprof_vcpu vcpu [MAX_VIRT_CPUS];
53 };
55 #ifndef CONFIG_COMPAT
56 #define XENOPROF_COMPAT(x) 0
57 #define xenoprof_buf(d, b, field) ((b)->field)
58 #else
59 #define XENOPROF_COMPAT(x) ((x)->is_compat)
60 #define xenoprof_buf(d, b, field) (*(!(d)->xenoprof->is_compat ? \
61 &(b)->native.field : \
62 &(b)->compat.field))
63 #endif
65 struct domain;
66 void free_xenoprof_pages(struct domain *d);
68 int do_xenoprof_op(int op, XEN_GUEST_HANDLE(void) arg);
69 int xenoprof_add_trace(struct domain *d, struct vcpu *v,
70 unsigned long eip, int mode);
72 #define PMU_OWNER_NONE 0
73 #define PMU_OWNER_XENOPROF 1
74 #define PMU_OWNER_HVM 2
75 int acquire_pmu_ownship(int pmu_ownership);
76 void release_pmu_ownship(int pmu_ownership);
78 #endif /* __XEN__XENOPROF_H__ */