Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tools/power turbostat: Dump hypervisor name

Sometimes useful to know which hypervisor is running beneath us...

Signed-off-by: Len Brown <len.brown@intel.com>

Len Brown 61764831 00b9e2a7

+23
+23
tools/power/x86/turbostat/turbostat.c
··· 8772 8772 for_all_cpus(print_epb, ODD_COUNTERS); 8773 8773 for_all_cpus(print_perf_limit, ODD_COUNTERS); 8774 8774 } 8775 + void dump_word_chars(unsigned int word) 8776 + { 8777 + int i; 8778 + 8779 + for (i = 0; i < 4; ++i) 8780 + fprintf(outf, "%c", (word >> (i * 8)) & 0xFF); 8781 + } 8782 + void dump_cpuid_hypervisor(void) 8783 + { 8784 + unsigned int ebx = 0; 8785 + unsigned int ecx = 0; 8786 + unsigned int edx = 0; 8787 + 8788 + __cpuid(0x40000000, max_extended_level, ebx, ecx, edx); 8789 + 8790 + fprintf(outf, "Hypervisor: "); 8791 + dump_word_chars(ebx); 8792 + dump_word_chars(ecx); 8793 + dump_word_chars(edx); 8794 + fprintf(outf, "\n"); 8795 + } 8775 8796 8776 8797 void process_cpuid() 8777 8798 { ··· 8860 8839 edx_flags & (1 << 5) ? "" : "No-", 8861 8840 edx_flags & (1 << 22) ? "" : "No-", edx_flags & (1 << 28) ? "" : "No-", edx_flags & (1 << 29) ? "" : "No-"); 8862 8841 } 8842 + if (!quiet && cpuid_has_hv) 8843 + dump_cpuid_hypervisor(); 8863 8844 8864 8845 probe_platform_features(family, model); 8865 8846