xref: /OK3568_Linux_fs/kernel/arch/arc/oprofile/common.c (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun // SPDX-License-Identifier: GPL-2.0-only
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * Based on orig code from @author John Levon <levon@movementarian.org>
6*4882a593Smuzhiyun  */
7*4882a593Smuzhiyun 
8*4882a593Smuzhiyun #include <linux/oprofile.h>
9*4882a593Smuzhiyun #include <linux/perf_event.h>
10*4882a593Smuzhiyun 
oprofile_arch_init(struct oprofile_operations * ops)11*4882a593Smuzhiyun int __init oprofile_arch_init(struct oprofile_operations *ops)
12*4882a593Smuzhiyun {
13*4882a593Smuzhiyun 	/*
14*4882a593Smuzhiyun 	 * A failure here, forces oprofile core to switch to Timer based PC
15*4882a593Smuzhiyun 	 * sampling, which will happen if say perf is not enabled/available
16*4882a593Smuzhiyun 	 */
17*4882a593Smuzhiyun 	return oprofile_perf_init(ops);
18*4882a593Smuzhiyun }
19*4882a593Smuzhiyun 
oprofile_arch_exit(void)20*4882a593Smuzhiyun void oprofile_arch_exit(void)
21*4882a593Smuzhiyun {
22*4882a593Smuzhiyun 	oprofile_perf_exit();
23*4882a593Smuzhiyun }
24