The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/xen/interface/xenoprof.h

Version: -  FREEBSD  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-2  -  FREEBSD-11-1  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-4  -  FREEBSD-10-3  -  FREEBSD-10-2  -  FREEBSD-10-1  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-3  -  FREEBSD-9-2  -  FREEBSD-9-1  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-4  -  FREEBSD-8-3  -  FREEBSD-8-2  -  FREEBSD-8-1  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-4  -  FREEBSD-7-3  -  FREEBSD-7-2  -  FREEBSD-7-1  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-4  -  FREEBSD-6-3  -  FREEBSD-6-2  -  FREEBSD-6-1  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-5  -  FREEBSD-5-4  -  FREEBSD-5-3  -  FREEBSD-5-2  -  FREEBSD-5-1  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  linux-2.6  -  linux-2.4.22  -  MK83  -  MK84  -  PLAN9  -  DFBSD  -  NETBSD  -  NETBSD5  -  NETBSD4  -  NETBSD3  -  NETBSD20  -  OPENBSD  -  xnu-517  -  xnu-792  -  xnu-792.6.70  -  xnu-1228  -  xnu-1456.1.26  -  xnu-1699.24.8  -  xnu-2050.18.24  -  OPENSOLARIS  -  minix-3-1-1 
SearchContext: -  none  -  3  -  10 

    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  */
   28 
   29 #ifndef __XEN_PUBLIC_XENOPROF_H__
   30 #define __XEN_PUBLIC_XENOPROF_H__
   31 
   32 #include "xen.h"
   33 
   34 /*
   35  * Commands to HYPERVISOR_xenoprof_op().
   36  */
   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
   53 
   54 /* AMD IBS support */
   55 #define XENOPROF_get_ibs_caps       16
   56 #define XENOPROF_ibs_counter        17
   57 #define XENOPROF_last_op            17
   58 
   59 #define MAX_OPROF_EVENTS    32
   60 #define MAX_OPROF_DOMAINS   25
   61 #define XENOPROF_CPU_TYPE_SIZE 64
   62 
   63 /* Xenoprof performance events (not Xen events) */
   64 struct event_log {
   65     uint64_t eip;
   66     uint8_t mode;
   67     uint8_t event;
   68 };
   69 
   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
   74 
   75 /* Xenoprof buffer shared between Xen and domain - 1 per VCPU */
   76 struct xenoprof_buf {
   77     uint32_t event_head;
   78     uint32_t event_tail;
   79     uint32_t event_size;
   80     uint32_t vcpu_id;
   81     uint64_t xen_samples;
   82     uint64_t kernel_samples;
   83     uint64_t user_samples;
   84     uint64_t lost_samples;
   85     struct event_log event_log[1];
   86 };
   87 #ifndef __XEN__
   88 typedef struct xenoprof_buf xenoprof_buf_t;
   89 DEFINE_XEN_GUEST_HANDLE(xenoprof_buf_t);
   90 #endif
   91 
   92 struct xenoprof_init {
   93     int32_t  num_events;
   94     int32_t  is_primary;
   95     char cpu_type[XENOPROF_CPU_TYPE_SIZE];
   96 };
   97 typedef struct xenoprof_init xenoprof_init_t;
   98 DEFINE_XEN_GUEST_HANDLE(xenoprof_init_t);
   99 
  100 struct xenoprof_get_buffer {
  101     int32_t  max_samples;
  102     int32_t  nbuf;
  103     int32_t  bufsize;
  104     uint64_t buf_gmaddr;
  105 };
  106 typedef struct xenoprof_get_buffer xenoprof_get_buffer_t;
  107 DEFINE_XEN_GUEST_HANDLE(xenoprof_get_buffer_t);
  108 
  109 struct xenoprof_counter {
  110     uint32_t ind;
  111     uint64_t count;
  112     uint32_t enabled;
  113     uint32_t event;
  114     uint32_t hypervisor;
  115     uint32_t kernel;
  116     uint32_t user;
  117     uint64_t unit_mask;
  118 };
  119 typedef struct xenoprof_counter xenoprof_counter_t;
  120 DEFINE_XEN_GUEST_HANDLE(xenoprof_counter_t);
  121 
  122 typedef struct xenoprof_passive {
  123     uint16_t domain_id;
  124     int32_t  max_samples;
  125     int32_t  nbuf;
  126     int32_t  bufsize;
  127     uint64_t buf_gmaddr;
  128 } xenoprof_passive_t;
  129 DEFINE_XEN_GUEST_HANDLE(xenoprof_passive_t);
  130 
  131 struct xenoprof_ibs_counter {
  132     uint64_t op_enabled;
  133     uint64_t fetch_enabled;
  134     uint64_t max_cnt_fetch;
  135     uint64_t max_cnt_op;
  136     uint64_t rand_en;
  137     uint64_t dispatched_ops;
  138 };
  139 typedef struct xenoprof_ibs_counter xenoprof_ibs_counter_t;
  140 DEFINE_XEN_GUEST_HANDLE(xenoprof_ibs_counter_t);
  141 
  142 #endif /* __XEN_PUBLIC_XENOPROF_H__ */
  143 
  144 /*
  145  * Local variables:
  146  * mode: C
  147  * c-file-style: "BSD"
  148  * c-basic-offset: 4
  149  * tab-width: 4
  150  * indent-tabs-mode: nil
  151  * End:
  152  */

Cache object: 292bd688b602957e48eaa0af0a0845ba


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.