2 * This file is part of the Palacios Virtual Machine Monitor developed
3 * by the V3VEE Project with funding from the United States National
4 * Science Foundation and the Department of Energy.
6 * The V3VEE Project is a joint project between Northwestern University
7 * and the University of New Mexico. You can find out more at
10 * Copyright (c) 2013, The V3VEE Project <http://www.v3vee.org>
11 * All rights reserved.
13 * Author: Chang S. Bae <chang.bae@eecs.northwestern.edu>
14 * Peter Dinda <pdinda@northwestern.edu>
16 * This is free software. You are permitted to use,
17 * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
20 #ifndef __VMM_PMU_TELEMETRY_H__
21 #define __VMM_PMU_TELEMETRY_H__
25 #ifdef V3_CONFIG_PMU_TELEMETRY
27 #include <interfaces/vmm_pmu.h>
28 #include <palacios/vmm_list.h>
32 #define PMU_NUM_COUNTERS 6
34 struct v3_core_pmu_telemetry {
35 enum {AWAIT_FIRST_ENTRY=0, AWAIT_ENTRY, AWAIT_EXIT} state;
36 uint8_t active_counters[PMU_NUM_COUNTERS];
37 uint64_t guest_counts[PMU_NUM_COUNTERS];
38 uint64_t host_counts[PMU_NUM_COUNTERS];
39 uint64_t last_snapshot[PMU_NUM_COUNTERS];
40 uint64_t guest_ucpi_estimate; // cycles per instruction * 1e6
41 uint64_t guest_umpl_estimate; // cache misses per load * 1e6
42 uint64_t host_ucpi_estimate; // cycles per instruction * 1e6
43 uint64_t host_umpl_estimate; // cache misses per load * 1e6
47 void v3_pmu_telemetry_start(struct guest_info *info);
48 void v3_pmu_telemetry_enter(struct guest_info *info);
49 void v3_pmu_telemetry_exit(struct guest_info *info);
50 void v3_pmu_telemetry_end(struct guest_info *info);