1 /* $NetBSD: xenoprof.h,v 1.2 2007/09/23 16:25:29 bouyer Exp $ */
2 /******************************************************************************
5 * Interface for enabling system wide profiling based on hardware performance
8 * Permission is hereby granted, free of charge, to any person obtaining a copy
9 * of this software and associated documentation files (the "Software"), to
10 * deal in the Software without restriction, including without limitation the
11 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12 * sell copies of the Software, and to permit persons to whom the Software is
13 * furnished to do so, subject to the following conditions:
15 * The above copyright notice and this permission notice shall be included in
16 * all copies or substantial portions of the Software.
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24 * DEALINGS IN THE SOFTWARE.
26 * Copyright (C) 2005 Hewlett-Packard Co.
27 * Written by Aravind Menon & Jose Renato Santos
30 #ifndef __XEN_PUBLIC_XENOPROF_H__
31 #define __XEN_PUBLIC_XENOPROF_H__
36 * Commands to HYPERVISOR_xenoprof_op().
38 #define XENOPROF_init 0
39 #define XENOPROF_reset_active_list 1
40 #define XENOPROF_reset_passive_list 2
41 #define XENOPROF_set_active 3
42 #define XENOPROF_set_passive 4
43 #define XENOPROF_reserve_counters 5
44 #define XENOPROF_counter 6
45 #define XENOPROF_setup_events 7
46 #define XENOPROF_enable_virq 8
47 #define XENOPROF_start 9
48 #define XENOPROF_stop 10
49 #define XENOPROF_disable_virq 11
50 #define XENOPROF_release_counters 12
51 #define XENOPROF_shutdown 13
52 #define XENOPROF_get_buffer 14
53 #define XENOPROF_set_backtrace 15
54 #define XENOPROF_last_op 15
56 #define MAX_OPROF_EVENTS 32
57 #define MAX_OPROF_DOMAINS 25
58 #define XENOPROF_CPU_TYPE_SIZE 64
60 /* Xenoprof performance events (not Xen events) */
67 /* PC value that indicates a special code */
68 #define XENOPROF_ESCAPE_CODE ~0UL
69 /* Transient events for the xenoprof->oprofile cpu buf */
70 #define XENOPROF_TRACE_BEGIN 1
72 /* Xenoprof buffer shared between Xen and domain - 1 per VCPU */
79 uint64_t kernel_samples
;
80 uint64_t user_samples
;
81 uint64_t lost_samples
;
82 struct event_log event_log
[1];
85 typedef struct xenoprof_buf xenoprof_buf_t
;
86 DEFINE_XEN_GUEST_HANDLE(xenoprof_buf_t
);
89 struct xenoprof_init
{
92 char cpu_type
[XENOPROF_CPU_TYPE_SIZE
];
94 typedef struct xenoprof_init xenoprof_init_t
;
95 DEFINE_XEN_GUEST_HANDLE(xenoprof_init_t
);
97 struct xenoprof_get_buffer
{
103 typedef struct xenoprof_get_buffer xenoprof_get_buffer_t
;
104 DEFINE_XEN_GUEST_HANDLE(xenoprof_get_buffer_t
);
106 struct xenoprof_counter
{
116 typedef struct xenoprof_counter xenoprof_counter_t
;
117 DEFINE_XEN_GUEST_HANDLE(xenoprof_counter_t
);
119 typedef struct xenoprof_passive
{
125 } xenoprof_passive_t
;
126 DEFINE_XEN_GUEST_HANDLE(xenoprof_passive_t
);
129 #endif /* __XEN_PUBLIC_XENOPROF_H__ */
137 * indent-tabs-mode: nil