// SPDX-License-Identifier: GPL-2.0-only /* * (C) 2003 - 2004 Dominik Brodowski <linux@dominikbrodowski.de> * * Based on code found in * linux/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c * and originally developed by Jeremy Fitzhardinge. * * USAGE: simply run it to decode the current settings on CPU 0, * or pass the CPU number as argument, or pass the MSR content * as argument.
*/
staticint decode_live(unsignedint cpu)
{ unsignedint lo, hi; int err;
err = rdmsr(cpu, MSR_IA32_PERF_STATUS, &lo, &hi);
if (err) {
printf("can't get MSR_IA32_PERF_STATUS for cpu %d\n", cpu);
printf("Possible trouble: you don't run an Enhanced SpeedStep capable cpu\n");
printf("or you are not root, or the msr driver is not present\n"); return 1;
}
decode(lo);
return 0;
}
int main (int argc, char **argv)
{ unsignedint cpu, mode = 0;
if (argc < 2)
cpu = 0; else {
cpu = strtoul(argv[1], NULL, 0); if (cpu >= MCPU)
mode = 1;
}
if (mode)
decode(cpu); else
decode_live(cpu);
return 0;
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.