1N/A/*
1N/A * This file is part of PowerTOP
1N/A *
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 *
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 * for more details.
1N/A *
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 *
1N/A * Authors:
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 */
1N/A
1N/A/*
1N/A * Copyright (c) 2009, Intel Corporation.
1N/A * All Rights Reserved.
1N/A */
1N/A
1N/A/*
2N/A * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
1N/A */
1N/A
1N/A/*
1N/A * GPL Disclaimer
1N/A *
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 */
1N/A
1N/A/*
1N/A * DTrace scripts for observing interrupts, callouts and cyclic events
1N/A * that cause CPU activity. Such activity prevents the processor from
1N/A * entering lower power states and reducing power consumption.
1N/A *
1N/A * g_dtp_events is the default script
1N/A */
1N/Aconst char *g_dtp_events =
1N/A"interrupt-complete"
1N/A"/arg0 != NULL && arg3 !=0/"
1N/A"{"
1N/A" this->devi = (struct dev_info *)arg0;"
1N/A" @interrupts[stringof(`devnamesp[this->devi->devi_major].dn_name),"
1N/A" this->devi->devi_instance] = count();"
1N/A"}"
1N/A""
1N/A"sdt:::callout-start"
1N/A"/(caddr_t)((callout_t *)arg0)->c_func == (caddr_t)&`setrun/"
1N/A"{"
1N/A" this->thr = (kthread_t *)(((callout_t *)arg0)->c_arg);"
1N/A" @events_u[stringof(this->thr->t_procp->p_user.u_comm)] = count();"
1N/A"}"
1N/A""
1N/A"sdt:::callout-start"
1N/A"/(caddr_t)((callout_t *)arg0)->c_func != (caddr_t)&`setrun/"
1N/A"{"
1N/A" @events_k[(caddr_t)((callout_t *)arg0)->c_func] = count();"
1N/A"}"
1N/A""
1N/A"sdt:::cyclic-start"
1N/A"/(caddr_t)((cyclic_t *)arg0)->cy_handler == (caddr_t)&`clock/"
1N/A"{"
1N/A" @events_k[(caddr_t)((cyclic_t *)arg0)->cy_handler] = count();"
1N/A"}"
1N/A""
1N/A"fbt::xt_all:entry,"
1N/A"fbt::xc_all:entry"
1N/A"{"
1N/A" self->xc_func = arg0;"
1N/A"}"
1N/A""
1N/A"fbt::xt_one_unchecked:entry,"
1N/A"fbt::xt_some:entry,"
1N/A"fbt::xc_one:entry,"
1N/A"fbt::xc_some:entry"
1N/A"{"
1N/A" self->xc_func = arg1;"
1N/A"}"
1N/A""
1N/A"sysinfo:::xcalls"
1N/A"/pid != $pid/"
1N/A"{"
1N/A" @events_x[execname, self->xc_func] = sum(arg0);"
1N/A" self->xc_func = 0;"
1N/A"}";
1N/A
1N/A/*
1N/A * g_dtp_events_v is enabled through the -v option, it includes cyclic events
1N/A * in the report, allowing a complete view of system activity
1N/A */
1N/Aconst char *g_dtp_events_v =
1N/A"interrupt-complete"
1N/A"/arg0 != NULL && arg3 !=0/"
1N/A"{"
1N/A" this->devi = (struct dev_info *)arg0;"
1N/A" @interrupts[stringof(`devnamesp[this->devi->devi_major].dn_name),"
1N/A" this->devi->devi_instance] = count();"
1N/A"}"
1N/A""
1N/A"sdt:::callout-start"
1N/A"/(caddr_t)((callout_t *)arg0)->c_func == (caddr_t)&`setrun/"
1N/A"{"
1N/A" this->thr = (kthread_t *)(((callout_t *)arg0)->c_arg);"
1N/A" @events_u[stringof(this->thr->t_procp->p_user.u_comm)] = count();"
1N/A"}"
1N/A""
1N/A"sdt:::callout-start"
1N/A"/(caddr_t)((callout_t *)arg0)->c_func != (caddr_t)&`setrun/"
1N/A"{"
1N/A" @events_k[(caddr_t)((callout_t *)arg0)->c_func] = count();"
1N/A"}"
1N/A""
1N/A"sdt:::cyclic-start"
1N/A"/(caddr_t)((cyclic_t *)arg0)->cy_handler != (caddr_t)&`dtrace_state_deadman &&"
1N/A" (caddr_t)((cyclic_t *)arg0)->cy_handler != (caddr_t)&`dtrace_state_clean/"
1N/A"{"
1N/A" @events_k[(caddr_t)((cyclic_t *)arg0)->cy_handler] = count();"
1N/A"}"
1N/A""
1N/A"fbt::xt_all:entry,"
1N/A"fbt::xc_all:entry"
1N/A"{"
1N/A" self->xc_func = arg0;"
1N/A"}"
1N/A""
1N/A"fbt::xt_one_unchecked:entry,"
1N/A"fbt::xt_some:entry,"
1N/A"fbt::xc_one:entry,"
1N/A"fbt::xc_some:entry"
1N/A"{"
1N/A" self->xc_func = arg1;"
1N/A"}"
1N/A""
1N/A"sysinfo:::xcalls"
1N/A"/pid != $pid/"
1N/A"{"
1N/A" @events_x[execname, self->xc_func] = sum(arg0);"
1N/A" self->xc_func = 0;"
1N/A"}";
1N/A
1N/A/*
1N/A * This script is selected through the -c option, it takes the CPU id as
1N/A * argument and observes activity generated by that CPU
1N/A */
1N/Aconst char *g_dtp_events_c =
1N/A"interrupt-complete"
1N/A"/cpu == $0 &&"
1N/A" arg0 != NULL && arg3 != 0/"
1N/A"{"
1N/A" this->devi = (struct dev_info *)arg0;"
1N/A" @interrupts[stringof(`devnamesp[this->devi->devi_major].dn_name),"
1N/A" this->devi->devi_instance] = count();"
1N/A"}"
1N/A""
1N/A"sdt:::callout-start"
1N/A"/cpu == $0 &&"
1N/A" (caddr_t)((callout_t *)arg0)->c_func == (caddr_t)&`setrun/"
1N/A"{"
1N/A" this->thr = (kthread_t *)(((callout_t *)arg0)->c_arg);"
1N/A" @events_u[stringof(this->thr->t_procp->p_user.u_comm)] = count();"
1N/A"}"
1N/A""
1N/A"sdt:::callout-start"
1N/A"/cpu == $0 &&"
1N/A" (caddr_t)((callout_t *)arg0)->c_func != (caddr_t)&`setrun/"
1N/A"{"
1N/A" @events_k[(caddr_t)((callout_t *)arg0)->c_func] = count();"
1N/A"}"
1N/A""
1N/A"sdt:::cyclic-start"
1N/A"/cpu == $0 &&"
1N/A" (caddr_t)((cyclic_t *)arg0)->cy_handler == (caddr_t)&`clock/"
1N/A"{"
1N/A" @events_k[(caddr_t)((cyclic_t *)arg0)->cy_handler] = count();"
1N/A"}"
1N/A""
1N/A/*
1N/A * xcalls to all CPUs. We're only interested in firings from other CPUs since
1N/A * the system doesn't xcall itself
1N/A */
1N/A"fbt::xt_all:entry,"
1N/A"fbt::xc_all:entry"
1N/A"/pid != $pid &&"
1N/A" cpu != $0/"
1N/A"{"
1N/A" self->xc_func = arg0;"
1N/A" self->xc_cpu = cpu;"
1N/A" self->cpu_known = 1;"
1N/A"}"
1N/A""
1N/A/*
1N/A * xcalls to a subset of CPUs. No way of knowing if the observed CPU is in
1N/A * it, so account it in the generic @events_x aggregation. Again, we don't
1N/A * xcall the current CPU.
1N/A */
1N/A"fbt::xt_some:entry,"
1N/A"fbt::xc_some:entry"
1N/A"/pid != $pid &&"
1N/A" cpu != $0/"
1N/A"{"
1N/A" self->xc_func = arg1;"
1N/A"}"
1N/A""
1N/A/*
1N/A * xcalls to a specific CPU, with all the necessary information
1N/A */
1N/A"fbt::xt_one_unchecked:entry,"
1N/A"fbt::xc_one:entry"
1N/A"/arg0 == $0/"
1N/A"{"
1N/A" self->xc_func = arg1;"
1N/A" self->xc_cpu = arg0;"
1N/A" self->cpu_known = 1;"
1N/A"}"
1N/A""
1N/A"sysinfo:::xcalls"
1N/A"/pid != $pid &&"
1N/A" self->xc_func &&"
1N/A" !self->cpu_known/"
1N/A"{"
1N/A" @events_x[execname, self->xc_func] = sum(arg0);"
1N/A" self->xc_func = 0;"
1N/A"}"
1N/A""
1N/A"sysinfo:::xcalls"
1N/A"/pid != $pid &&"
1N/A" self->xc_func &&"
1N/A" self->cpu_known/"
1N/A"{"
1N/A" @events_xc[execname, self->xc_func, self->xc_cpu] = sum(arg0);"
1N/A" self->xc_func = 0;"
1N/A" self->xc_cpu = 0;"
1N/A" self->cpu_known = 0;"
1N/A"}";
1N/A
1N/A/*
1N/A * sparcv9 platform specific display messages
1N/A */
2N/Aconst char *g_msg_cstate = "Idle Power States";
2N/Aconst char *g_msg_pstate = "Frequency Levels";