pt_sparcv9.c revision 9bbf5ba14ae201f78f3d6b47a9fac96d68649275
2N/A * Copyright 2009, Intel Corporation 2N/A * Copyright 2009, Sun Microsystems, Inc 2N/A * This file is part of PowerTOP 2N/A * This program file is free software; you can redistribute it and/or modify it 2N/A * under the terms of the GNU General Public License as published by the 2N/A * Free Software Foundation; version 2 of the License. 2N/A * This program is distributed in the hope that it will be useful, but WITHOUT 2N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 2N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 2N/A * You should have received a copy of the GNU General Public License 2N/A * along with this program in a file named COPYING; if not, write to the 2N/A * Free Software Foundation, Inc., 2N/A * 51 Franklin Street, Fifth Floor, 2N/A * Boston, MA 02110-1301 USA 2N/A * Arjan van de Ven <arjan@linux.intel.com> 2N/A * Eric C Saxe <eric.saxe@sun.com> 2N/A * Aubrey Li <aubrey.li@intel.com> 2N/A * For the avoidance of doubt, except that if any license choice other 2N/A * than GPL or LGPL is available it will apply instead, Sun elects to 2N/A * use only the General Public License version 2 (GPLv2) at this time 2N/A * for any software where a choice of GPL license versions is made 2N/A * available with the language indicating that GPLv2 or any later 2N/A * version may be used, or where a choice of which version of the GPL 2N/A * is applied is otherwise unspecified. 2N/A * DTrace scripts for observing interrupts, callouts and cyclic events 2N/A * that cause CPU activity. Such activity prevents the processor from 2N/A * entering lower power states and reducing power consumption. 2N/A * g_dtp_events is the default script 2N/A"/arg0 != NULL && arg3 !=0/" 2N/A" this->devi = (struct dev_info *)arg0;" 2N/A" @interrupts[stringof(`devnamesp[this->devi->devi_major].dn_name)," 2N/A" this->devi->devi_instance] = count();" 2N/A"sdt:::callout-start" 2N/A"/(caddr_t)((callout_t *)arg0)->c_func == (caddr_t)&`setrun/" 2N/A" this->thr = (kthread_t *)(((callout_t *)arg0)->c_arg);" 2N/A" @events_u[stringof(this->thr->t_procp->p_user.u_comm)] = count();" 2N/A"sdt:::callout-start" "/(caddr_t)((callout_t *)arg0)->c_func != (caddr_t)&`setrun/" " @events_k[(caddr_t)((callout_t *)arg0)->c_func] = count();" "/(caddr_t)((cyclic_t *)arg0)->cy_handler == (caddr_t)&`clock/" " @events_k[(caddr_t)((cyclic_t *)arg0)->cy_handler] = count();" "fbt::xt_one_unchecked:entry," " @events_x[execname, self->xc_func] = sum(arg0);" * g_dtp_events_v is enabled through the -v option, it includes cyclic events * in the report, allowing a complete view of system activity "/arg0 != NULL && arg3 !=0/" " this->devi = (struct dev_info *)arg0;" " @interrupts[stringof(`devnamesp[this->devi->devi_major].dn_name)," " this->devi->devi_instance] = count();" "/(caddr_t)((callout_t *)arg0)->c_func == (caddr_t)&`setrun/" " this->thr = (kthread_t *)(((callout_t *)arg0)->c_arg);" " @events_u[stringof(this->thr->t_procp->p_user.u_comm)] = count();" "/(caddr_t)((callout_t *)arg0)->c_func != (caddr_t)&`setrun/" " @events_k[(caddr_t)((callout_t *)arg0)->c_func] = count();" "/(caddr_t)((cyclic_t *)arg0)->cy_handler != (caddr_t)&`dtrace_state_deadman &&" " (caddr_t)((cyclic_t *)arg0)->cy_handler != (caddr_t)&`dtrace_state_clean/" " @events_k[(caddr_t)((cyclic_t *)arg0)->cy_handler] = count();" "fbt::xt_one_unchecked:entry," " @events_x[execname, self->xc_func] = sum(arg0);" * This script is selected through the -c option, it takes the CPU id as * argument and observes activity generated by that CPU " arg0 != NULL && arg3 != 0/" " this->devi = (struct dev_info *)arg0;" " @interrupts[stringof(`devnamesp[this->devi->devi_major].dn_name)," " this->devi->devi_instance] = count();" " (caddr_t)((callout_t *)arg0)->c_func == (caddr_t)&`setrun/" " this->thr = (kthread_t *)(((callout_t *)arg0)->c_arg);" " @events_u[stringof(this->thr->t_procp->p_user.u_comm)] = count();" " (caddr_t)((callout_t *)arg0)->c_func != (caddr_t)&`setrun/" " @events_k[(caddr_t)((callout_t *)arg0)->c_func] = count();" " (caddr_t)((cyclic_t *)arg0)->cy_handler == (caddr_t)&`clock/" " @events_k[(caddr_t)((cyclic_t *)arg0)->cy_handler] = count();" * xcalls to all CPUs. We're only interested in firings from other CPUs since * the system doesn't xcall itself * xcalls to a subset of CPUs. No way of knowing if the observed CPU is in * it, so account it in the generic @events_x aggregation. Again, we don't * xcalls to a specific CPU, with all the necessary information "fbt::xt_one_unchecked:entry," " @events_x[execname, self->xc_func] = sum(arg0);" " @events_xc[execname, self->xc_func, self->xc_cpu] = sum(arg0);" * sparcv9 platform specific display messages