/*
* Copyright 2009, Intel Corporation
* Copyright 2009, Sun Microsystems, Inc
*
* This file is part of PowerTOP
*
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program in a file named COPYING; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA
*
* Authors:
* Arjan van de Ven <arjan@linux.intel.com>
* Eric C Saxe <eric.saxe@sun.com>
* Aubrey Li <aubrey.li@intel.com>
*/
/*
* GPL Disclaimer
*
* For the avoidance of doubt, except that if any license choice other
* than GPL or LGPL is available it will apply instead, Sun elects to
* use only the General Public License version 2 (GPLv2) at this time
* for any software where a choice of GPL license versions is made
* available with the language indicating that GPLv2 or any later
* version may be used, or where a choice of which version of the GPL
* is applied is otherwise unspecified.
*/
#include <stdarg.h>
#include <stdlib.h>
#include <libgen.h>
#include <unistd.h>
#include <strings.h>
#include <sys/systeminfo.h>
#include <kstat.h>
#include <errno.h>
#include "powertop.h"
static char *progname;
void
{
}
/*PRINTFLIKE1*/
void
{
if (g_gui)
return;
}
/*
* Returns the number of online CPUs.
*/
pt_enumerate_cpus(void)
{
int cpuid;
/* Fall back to one CPU if any of the sysconf calls above failed */
}
return (0);
ncpus++;
}
}
return (ncpus);
}
void
pt_usage(void)
{
"times and print list of top offenders\n");
"data in seconds [1-30s]\n");
"kernel cyclic activity\n");
" CPU\n");
"message\n");
}
int
pt_get_bit_depth(void)
{
/*
* This little routine was derived from isainfo.c to look up
* the system's bit depth. It feeds a 10 byte long buffer to
* sysinfo (we only need the first word, sysinfo truncates and
* \0 terminates the rest) from which we figure out which isa
* we're running on.
*/
return (-2);
return (32);
return (64);
return (-3);
}
/*
* Simple integer comparison routine for the event report qsort(3C).
*/
int
{
if (i.total_count > j.total_count)
return (-1);
if (i.total_count < j.total_count)
return (1);
return (0);
}