ia64/xen-unstable

view xen/include/public/xenoprof.h @ 12541:1d7d5d48fcdc

[XENOPROFILE] Make xenoprof arch-generic with dynamic mapping/unmapping xenoprof
buffer support and auto translated mode support.
renamed xenoprof_get_buffer::buf_maddr, xenoprof_passive::buf_maddr to
xenoprof_get_buffer::buf_gmaddr, xenoprof_passive::buf_gmaddr
to support auto translated mode. With auto translated mode enabled,
it is gmaddr, not maddr.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>

Simplify the share function.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Wed Nov 22 10:09:28 2006 +0000 (2006-11-22)
parents 8d0e06c38c0c
children 4876e7ebca6e
line source
1 /******************************************************************************
2 * xenoprof.h
3 *
4 * Interface for enabling system wide profiling based on hardware performance
5 * counters
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to
9 * deal in the Software without restriction, including without limitation the
10 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
11 * sell copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23 * DEALINGS IN THE SOFTWARE.
24 *
25 * Copyright (C) 2005 Hewlett-Packard Co.
26 * Written by Aravind Menon & Jose Renato Santos
27 */
29 #ifndef __XEN_PUBLIC_XENOPROF_H__
30 #define __XEN_PUBLIC_XENOPROF_H__
32 /*
33 * Commands to HYPERVISOR_xenoprof_op().
34 */
35 #define XENOPROF_init 0
36 #define XENOPROF_reset_active_list 1
37 #define XENOPROF_reset_passive_list 2
38 #define XENOPROF_set_active 3
39 #define XENOPROF_set_passive 4
40 #define XENOPROF_reserve_counters 5
41 #define XENOPROF_counter 6
42 #define XENOPROF_setup_events 7
43 #define XENOPROF_enable_virq 8
44 #define XENOPROF_start 9
45 #define XENOPROF_stop 10
46 #define XENOPROF_disable_virq 11
47 #define XENOPROF_release_counters 12
48 #define XENOPROF_shutdown 13
49 #define XENOPROF_get_buffer 14
50 #define XENOPROF_last_op 14
52 #define MAX_OPROF_EVENTS 32
53 #define MAX_OPROF_DOMAINS 25
54 #define XENOPROF_CPU_TYPE_SIZE 64
56 /* Xenoprof performance events (not Xen events) */
57 struct event_log {
58 uint64_t eip;
59 uint8_t mode;
60 uint8_t event;
61 };
63 /* Xenoprof buffer shared between Xen and domain - 1 per VCPU */
64 struct xenoprof_buf {
65 uint32_t event_head;
66 uint32_t event_tail;
67 uint32_t event_size;
68 uint32_t vcpu_id;
69 uint64_t xen_samples;
70 uint64_t kernel_samples;
71 uint64_t user_samples;
72 uint64_t lost_samples;
73 struct event_log event_log[1];
74 };
75 typedef struct xenoprof_buf xenoprof_buf_t;
76 DEFINE_XEN_GUEST_HANDLE(xenoprof_buf_t);
78 struct xenoprof_init {
79 int32_t num_events;
80 int32_t is_primary;
81 char cpu_type[XENOPROF_CPU_TYPE_SIZE];
82 };
83 typedef struct xenoprof_init xenoprof_init_t;
84 DEFINE_XEN_GUEST_HANDLE(xenoprof_init_t);
86 struct xenoprof_get_buffer {
87 int32_t max_samples;
88 int32_t nbuf;
89 int32_t bufsize;
90 uint64_t buf_gmaddr;
91 };
92 typedef struct xenoprof_get_buffer xenoprof_get_buffer_t;
93 DEFINE_XEN_GUEST_HANDLE(xenoprof_get_buffer_t);
95 struct xenoprof_counter {
96 uint32_t ind;
97 uint64_t count;
98 uint32_t enabled;
99 uint32_t event;
100 uint32_t hypervisor;
101 uint32_t kernel;
102 uint32_t user;
103 uint64_t unit_mask;
104 };
105 typedef struct xenoprof_counter xenoprof_counter_t;
106 DEFINE_XEN_GUEST_HANDLE(xenoprof_counter_t);
108 typedef struct xenoprof_passive {
109 uint16_t domain_id;
110 int32_t max_samples;
111 int32_t nbuf;
112 int32_t bufsize;
113 uint64_t buf_gmaddr;
114 } xenoprof_passive_t;
115 DEFINE_XEN_GUEST_HANDLE(xenoprof_passive_t);
118 #endif /* __XEN_PUBLIC_XENOPROF_H__ */
120 /*
121 * Local variables:
122 * mode: C
123 * c-set-style: "BSD"
124 * c-basic-offset: 4
125 * tab-width: 4
126 * indent-tabs-mode: nil
127 * End:
128 */