1 /******************************************************************************
4 * Interface for enabling system wide profiling based on hardware performance
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:
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
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.
25 * Copyright (C) 2005 Hewlett-Packard Co.
26 * Written by Aravind Menon & Jose Renato Santos
29 #ifndef __XEN_PUBLIC_XENOPROF_H__
30 #define __XEN_PUBLIC_XENOPROF_H__
35 * Commands to HYPERVISOR_xenoprof_op().
37 #define XENOPROF_init 0
38 #define XENOPROF_reset_active_list 1
39 #define XENOPROF_reset_passive_list 2
40 #define XENOPROF_set_active 3
41 #define XENOPROF_set_passive 4
42 #define XENOPROF_reserve_counters 5
43 #define XENOPROF_counter 6
44 #define XENOPROF_setup_events 7
45 #define XENOPROF_enable_virq 8
46 #define XENOPROF_start 9
47 #define XENOPROF_stop 10
48 #define XENOPROF_disable_virq 11
49 #define XENOPROF_release_counters 12
50 #define XENOPROF_shutdown 13
51 #define XENOPROF_get_buffer 14
52 #define XENOPROF_set_backtrace 15
55 #define XENOPROF_get_ibs_caps 16
56 #define XENOPROF_ibs_counter 17
57 #define XENOPROF_last_op 17
59 #define MAX_OPROF_EVENTS 32
60 #define MAX_OPROF_DOMAINS 25
61 #define XENOPROF_CPU_TYPE_SIZE 64
63 /* Xenoprof performance events (not Xen events) */
70 /* PC value that indicates a special code */
71 #define XENOPROF_ESCAPE_CODE (~0ULL)
72 /* Transient events for the xenoprof->oprofile cpu buf */
73 #define XENOPROF_TRACE_BEGIN 1
75 /* Xenoprof buffer shared between Xen and domain - 1 per VCPU */
82 uint64_t kernel_samples;
83 uint64_t user_samples;
84 uint64_t lost_samples;
85 struct event_log event_log[1];
88 typedef struct xenoprof_buf xenoprof_buf_t;
89 DEFINE_XEN_GUEST_HANDLE(xenoprof_buf_t);
92 struct xenoprof_init {
95 char cpu_type[XENOPROF_CPU_TYPE_SIZE];
97 typedef struct xenoprof_init xenoprof_init_t;
98 DEFINE_XEN_GUEST_HANDLE(xenoprof_init_t);
100 struct xenoprof_get_buffer {
106 typedef struct xenoprof_get_buffer xenoprof_get_buffer_t;
107 DEFINE_XEN_GUEST_HANDLE(xenoprof_get_buffer_t);
109 struct xenoprof_counter {
119 typedef struct xenoprof_counter xenoprof_counter_t;
120 DEFINE_XEN_GUEST_HANDLE(xenoprof_counter_t);
122 typedef struct xenoprof_passive {
128 } xenoprof_passive_t;
129 DEFINE_XEN_GUEST_HANDLE(xenoprof_passive_t);
131 struct xenoprof_ibs_counter {
133 uint64_t fetch_enabled;
134 uint64_t max_cnt_fetch;
137 uint64_t dispatched_ops;
139 typedef struct xenoprof_ibs_counter xenoprof_ibs_counter_t;
140 DEFINE_XEN_GUEST_HANDLE(xenoprof_ibs_counter_t);
142 #endif /* __XEN_PUBLIC_XENOPROF_H__ */
150 * indent-tabs-mode: nil