1N/A * Copyright 2009, Intel Corporation 2N/A * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. 1N/A * This file is part of PowerTOP 1N/A * This program file is free software; you can redistribute it and/or modify it 1N/A * under the terms of the GNU General Public License as published by the 1N/A * Free Software Foundation; version 2 of the License. 1N/A * This program is distributed in the hope that it will be useful, but WITHOUT 1N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1N/A * You should have received a copy of the GNU General Public License 1N/A * along with this program in a file named COPYING; if not, write to the 1N/A * Free Software Foundation, Inc., 1N/A * 51 Franklin Street, Fifth Floor, 1N/A * Boston, MA 02110-1301 USA 1N/A * Arjan van de Ven <arjan@linux.intel.com> 1N/A * Eric C Saxe <eric.saxe@sun.com> 1N/A * Aubrey Li <aubrey.li@intel.com> 1N/A * For the avoidance of doubt, except that if any license choice other 1N/A * than GPL or LGPL is available it will apply instead, Sun elects to 1N/A * use only the General Public License version 2 (GPLv2) at this time 1N/A * for any software where a choice of GPL license versions is made 1N/A * available with the language indicating that GPLv2 or any later 1N/A * version may be used, or where a choice of which version of the GPL 1N/A * is applied is otherwise unspecified. 1N/A * Global turbo related variables definitions 1N/A * The variables to store kstat snapshot 1N/A * Perform setup necessary to enumerate and track CPU turbo information 1N/A * check if the CPU turbo is supported 1N/A * Initialize turbo information structure if turbo mode is supported 1N/A * Take a snapshot of each CPU's turbo information 1N/A * by looking through the turbo kstats. 1N/A * snapshot IA32_MPERF_MSR 1N/A * snapshot IA32_APERF_MSR 1N/A * Turbo support checking and information initialization 1N/A * When doing the statistics collection, we compare two kstat snapshot 1N/A * and get a delta. the final ratio of performance boost will be worked 1N/A * out according to the kstat delta 1N/A * Take a snapshot of turbo information to setup turbo_info_t 1N/A * Calculate the kstat delta and work out the performance boost ratio 1N/A * Update the structure of the kstat for the next time calculation