18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-only
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Based on orig code from @author John Levon <levon@movementarian.org>
68c2ecf20Sopenharmony_ci */
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci#include <linux/oprofile.h>
98c2ecf20Sopenharmony_ci#include <linux/perf_event.h>
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ciint __init oprofile_arch_init(struct oprofile_operations *ops)
128c2ecf20Sopenharmony_ci{
138c2ecf20Sopenharmony_ci	/*
148c2ecf20Sopenharmony_ci	 * A failure here, forces oprofile core to switch to Timer based PC
158c2ecf20Sopenharmony_ci	 * sampling, which will happen if say perf is not enabled/available
168c2ecf20Sopenharmony_ci	 */
178c2ecf20Sopenharmony_ci	return oprofile_perf_init(ops);
188c2ecf20Sopenharmony_ci}
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_civoid oprofile_arch_exit(void)
218c2ecf20Sopenharmony_ci{
228c2ecf20Sopenharmony_ci	oprofile_perf_exit();
238c2ecf20Sopenharmony_ci}
24