win-pvdrivers

annotate common/include/public/xenoprof.h @ 62:edd4a2ad5b44

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