use x86::cpuid::CpuId;

fn main() {
    let cpu_id = CpuId::new();
    println!("Vendor: {:?}", cpu_id.get_vendor_info().map(|v| v.as_string().to_owned()));
    println!("Feature: {:?}", cpu_id.get_feature_info());
    println!("Cache: {:?}", cpu_id.get_cache_info());
    cpu_id.get_cache_info().map(|c| {
        for i in c {
            println!("- {}", i.desc());
        }
    });
    println!("Processor: {:?}", cpu_id.get_processor_serial());
    println!("Cache parameters: {:?}", cpu_id.get_cache_parameters());
    println!("Performace monitoring: {:?}", cpu_id.get_performance_monitoring_info());
    println!("Performace monitoring, number of counters: {:?}", cpu_id.get_performance_monitoring_info().unwrap().number_of_counters());
    println!("SGX: {:?}", cpu_id.get_sgx_info());
    println!("SoC vendor: {:?}", cpu_id.get_soc_vendor_info());
    println!("Extended function: {:?}", cpu_id.get_extended_function_info());
}
