コード例 #1
0
ファイル: nmi_timer_int.c プロジェクト: AlexShiLucky/linux
static void nmi_timer_shutdown(void)
{
	struct perf_event *event;
	int cpu;

	cpuhp_remove_state(hp_online);
	for_each_possible_cpu(cpu) {
		event = per_cpu(nmi_timer_events, cpu);
		if (!event)
			continue;
		perf_event_disable(event);
		per_cpu(nmi_timer_events, cpu) = NULL;
		perf_event_release_kernel(event);
	}
}
コード例 #2
0
static void nmi_shutdown(void)
{
	struct op_msrs *msrs;

	cpuhp_remove_state(cpuhp_nmi_online);
	nmi_enabled = 0;
	ctr_running = 0;

	/* make variables visible to the nmi handler: */
	smp_mb();
	unregister_nmi_handler(NMI_LOCAL, "oprofile");
	msrs = &get_cpu_var(cpu_msrs);
	model->shutdown(msrs);
	free_msrs();
	put_cpu_var(cpu_msrs);
}
コード例 #3
0
ファイル: intel_epb.c プロジェクト: pranith/linux
static __init int intel_epb_init(void)
{
	int ret;

	if (!boot_cpu_has(X86_FEATURE_EPB))
		return -ENODEV;

	ret = cpuhp_setup_state(CPUHP_AP_X86_INTEL_EPB_ONLINE,
				"x86/intel/epb:online", intel_epb_online,
				intel_epb_offline);
	if (ret < 0)
		goto err_out_online;

	register_syscore_ops(&intel_epb_syscore_ops);
	return 0;

err_out_online:
	cpuhp_remove_state(CPUHP_AP_X86_INTEL_EPB_ONLINE);
	return ret;
}
コード例 #4
0
static void __exit msr_exit(void)
{
	cpuhp_remove_state(cpuhp_msr_state);
	class_destroy(msr_class);
	__unregister_chrdev(MSR_MAJOR, 0, NR_CPUS, "cpu/msr");
}