Skip to content

Commit

Permalink
update bundled hyperkit
Browse files Browse the repository at this point in the history
Signed-off-by: António Meireles <[email protected]>
  • Loading branch information
AntonioMeireles committed Sep 12, 2017
1 parent a180a1b commit c8937f7
Show file tree
Hide file tree
Showing 4 changed files with 149 additions and 80 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ VERSION := $(shell git describe --abbrev=6 --dirty=+untagged --always --tags)
BUILDDATE = $(shell /bin/date "+%FT%T%Z")

OPAMROOT ?= ~/.opam
HYPERKIT_GIT = "https://github.com/docker/hyperkit.git"
HYPERKIT_COMMIT = 8975f80ae46ef315e600552328ba63af09b742f7
HYPERKIT_GIT = "https://github.com/moby/hyperkit.git"
HYPERKIT_COMMIT = 3e31617

MKDIR = /bin/mkdir -p
CP = /bin/cp
Expand Down Expand Up @@ -102,10 +102,10 @@ hyperkit: force
$(GIT) checkout $(HYPERKIT_COMMIT); \
$(MAKE) clean; \
$(shell opam config env) $(MAKE) all
$(CP) $@/build/com.docker.hyperkit $(BUILD_DIR)/corectld.runner
$(CP) $@/build/hyperkit $(BUILD_DIR)/corectld.runner
$(RM) examples/dtrace
cd $@; \
$(SED) -i.bak -e "s,com.docker.hyperkit,corectld.runner,g" dtrace/*.d; \
$(SED) -i.bak -e "s,hyperkit,corectld.runner,g" dtrace/*.d; \
$(RM) dtrace/*.bak ; \
$(CP) -r dtrace ../examples

Expand Down
24 changes: 12 additions & 12 deletions components/common/assets/assets_vfsdata.go

Large diffs are not rendered by default.

72 changes: 67 additions & 5 deletions examples/dtrace/eptfault.d
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,80 @@

#pragma D option quiet

string lapic_map[uint32_t];

dtrace:::BEGIN
{
printf("Tracing... Hit Ctrl-C to end.\n");
start = timestamp;

// from src/include/xhyve/vmm/io/vlapic_priv.h
lapic_map[0x20] = "ID";
lapic_map[0x30] = "VER";
lapic_map[0x80] = "TPR";
lapic_map[0x90] = "APR";
lapic_map[0xA0] = "PPR";
lapic_map[0xB0] = "EOI";
lapic_map[0xC0] = "RRR";
lapic_map[0xD0] = "LDR";
lapic_map[0xE0] = "DFR";
lapic_map[0xF0] = "SVR";
lapic_map[0x100] = "ISR0";
lapic_map[0x110] = "ISR1";
lapic_map[0x130] = "ISR3";
lapic_map[0x150] = "ISR5";
lapic_map[0x170] = "ISR7";
lapic_map[0x190] = "TMR1";
lapic_map[0x1B0] = "TMR3";
lapic_map[0x1D0] = "TMR5";
lapic_map[0x1F0] = "TMR7";
lapic_map[0x210] = "IRR1";
lapic_map[0x230] = "IRR3";
lapic_map[0x250] = "IRR5";
lapic_map[0x270] = "IRR7";
lapic_map[0x2F0] = "CMCI_LVT";
lapic_map[0x300] = "ICR_LOW";
lapic_map[0x310] = "ICR_HI";
lapic_map[0x330] = "THERM_LVT";
lapic_map[0x340] = "PERF_LVT";
lapic_map[0x350] = "LINT0_LVT";
lapic_map[0x360] = "LINT1_LVT";
lapic_map[0x370] = "ERROR_LVT";
lapic_map[0x380] = "TIMER_ICR";
lapic_map[0x390] = "TIMER_CCR";
lapic_map[0x3E0] = "TIMER_DCR";
lapic_map[0x3F0] = "SELF_IPI";

printf("Tracing... Hit Ctrl-C to end.\n");
}

corectld.runner$target:::vmx-ept-fault
/(arg1 & 0xfff00000) == 0xfee00000/
{
// LAPIC FAULTS

@lapic_faults[lapic_map[arg1 & 0x000fffff], arg0] = count();
}

hyperkit$target:::vmx-ept-fault
corectld.runner$target:::vmx-ept-fault
{
@num[arg1, arg0] = count();
@all_faults[arg1, arg0] = count();
}

dtrace:::END
{
printf("%18s %-4s %8s\n", "ADDRESS", "vCPU", "COUNT");
printa("%18x %-4d %@8d\n", @num);
#ifdef TOTAL
printf("%18s %-4s %10s\n", "ADDRESS", "vCPU", "COUNT");
#else
printf("%18s %-4s %10s\n", "ADDRESS", "vCPU", "RATE (1/s)");
normalize(@all_faults, (timestamp - start) / 1000000000);
#endif
printa("%18x %-4d %@10d\n", @all_faults);

#ifdef TOTAL
printf("%18s %-4s %10s\n", "LAPIC REGISTER", "vCPU", "COUNT");
#else
printf("%18s %-4s %10s\n", "LAPIC REGISTER", "vCPU", "RATE (1/s)");
normalize(@lapic_faults, (timestamp - start) / 1000000000);
#endif
printa("%18s %-4d %@10d\n", @lapic_faults);
}
125 changes: 66 additions & 59 deletions examples/dtrace/vmxexit.d
Original file line number Diff line number Diff line change
Expand Up @@ -11,71 +11,78 @@ string reasons[int];

dtrace:::BEGIN
{
reasons[0] = "EXCEPTION";
reasons[1] = "EXT_INTR";
reasons[2] = "TRIPLE_FAULT";
reasons[3] = "INIT";
reasons[4] = "SIPI";
reasons[5] = "IO_SMI";
reasons[6] = "SMI";
reasons[7] = "INTR_WINDOW";
reasons[8] = "NMI_WINDOW";
reasons[9] = "TASK_SWITCH";
reasons[10] = "CPUID";
reasons[11] = "GETSEC";
reasons[12] = "HLT";
reasons[13] = "INVD";
reasons[14] = "INVLPG";
reasons[15] = "RDPMC";
reasons[16] = "RDTSC";
reasons[17] = "RSM";
reasons[18] = "VMCALL";
reasons[19] = "VMCLEAR";
reasons[20] = "VMLAUNCH";
reasons[21] = "VMPTRLD";
reasons[22] = "VMPTRST";
reasons[23] = "VMREAD";
reasons[24] = "VMRESUME";
reasons[25] = "VMWRITE";
reasons[26] = "VMXOFF";
reasons[27] = "VMXON";
reasons[28] = "CR_ACCESS";
reasons[29] = "DR_ACCESS";
reasons[30] = "INOUT";
reasons[31] = "RDMSR";
reasons[32] = "WRMSR";
reasons[33] = "INVAL_VMCS";
reasons[34] = "INVAL_MSR";
reasons[36] = "MWAIT";
reasons[37] = "MTF";
reasons[39] = "MONITOR";
reasons[40] = "PAUSE";
reasons[41] = "MCE_DURING_ENTRY";
reasons[43] = "TPR";
reasons[44] = "APIC_ACCESS";
reasons[45] = "VIRTUALIZED_EOI";
reasons[46] = "GDTR_IDTR";
reasons[47] = "LDTR_TR";
reasons[48] = "EPT_FAULT";
reasons[49] = "EPT_MISCONFIG";
reasons[50] = "INVEPT";
reasons[51] = "RDTSCP";
reasons[52] = "VMX_PREEMPT";
reasons[53] = "INVVPID";
reasons[54] = "WBINVD";
reasons[55] = "XSETBV";
reasons[56] = "APIC_WRITE";
start = timestamp;

printf("Tracing... Hit Ctrl-C to end.\n");
reasons[0] = "EXCEPTION";
reasons[1] = "EXT_INTR";
reasons[2] = "TRIPLE_FAULT";
reasons[3] = "INIT";
reasons[4] = "SIPI";
reasons[5] = "IO_SMI";
reasons[6] = "SMI";
reasons[7] = "INTR_WINDOW";
reasons[8] = "NMI_WINDOW";
reasons[9] = "TASK_SWITCH";
reasons[10] = "CPUID";
reasons[11] = "GETSEC";
reasons[12] = "HLT";
reasons[13] = "INVD";
reasons[14] = "INVLPG";
reasons[15] = "RDPMC";
reasons[16] = "RDTSC";
reasons[17] = "RSM";
reasons[18] = "VMCALL";
reasons[19] = "VMCLEAR";
reasons[20] = "VMLAUNCH";
reasons[21] = "VMPTRLD";
reasons[22] = "VMPTRST";
reasons[23] = "VMREAD";
reasons[24] = "VMRESUME";
reasons[25] = "VMWRITE";
reasons[26] = "VMXOFF";
reasons[27] = "VMXON";
reasons[28] = "CR_ACCESS";
reasons[29] = "DR_ACCESS";
reasons[30] = "INOUT";
reasons[31] = "RDMSR";
reasons[32] = "WRMSR";
reasons[33] = "INVAL_VMCS";
reasons[34] = "INVAL_MSR";
reasons[36] = "MWAIT";
reasons[37] = "MTF";
reasons[39] = "MONITOR";
reasons[40] = "PAUSE";
reasons[41] = "MCE_DURING_ENTRY";
reasons[43] = "TPR";
reasons[44] = "APIC_ACCESS";
reasons[45] = "VIRTUALIZED_EOI";
reasons[46] = "GDTR_IDTR";
reasons[47] = "LDTR_TR";
reasons[48] = "EPT_FAULT";
reasons[49] = "EPT_MISCONFIG";
reasons[50] = "INVEPT";
reasons[51] = "RDTSCP";
reasons[52] = "VMX_PREEMPT";
reasons[53] = "INVVPID";
reasons[54] = "WBINVD";
reasons[55] = "XSETBV";
reasons[56] = "APIC_WRITE";

printf("Tracing... Hit Ctrl-C to end.\n");
}

hyperkit$target:::vmx-exit
corectld.runner$target:::vmx-exit
{
@num[reasons[arg1], arg0] = count();
@num[reasons[arg1], arg0] = count();
}

dtrace:::END
{
printf("%16s %-4s %8s\n", "REASON", "vCPU", "COUNT");
printa("%16s %-4d %@8d\n", @num);
#ifdef TOTAL
printf("%16s %-4s %8s\n", "REASON", "vCPU", "COUNT");
#else
printf("%16s %-4s %8s\n", "REASON", "vCPU", "RATE (1/s)");
normalize(@num, (timestamp - start) / 1000000000);
#endif
printa("%16s %-4d %@8d\n", @num);
}

0 comments on commit c8937f7

Please sign in to comment.