NAME
readprofile - read kernel profiling information
SYNOPSIS
readprofile [options]
VERSION
This manpage documents version 2.0 of the program.
DESCRIPTION
The readprofile command uses the /proc/profile information to print ascii data on standard output. The output is organized in three columns: the first is the number of clock ticks, the second is the name of the C function in the kernel where those many ticks occurred, and the third is the normalized `load' of the procedure, calculated as a ratio between the number of ticks and the length of the procedure. The output is filled with blanks to ease readability.
OPTIONS
-a, --all Print all symbols in the mapfile. By default the procedures with reported ticks are not printed. -b, --histbin Print individual histogram-bin counts. -i, --info Info. This makes readprofile only print the profiling step used by the kernel. The profiling step is the resolution of the profiling buffer, and is chosen during kernel configuration (through `make config'), or in the kernel's command line. If the -t (terse) switch is used together with -i only the decimal number is printed. -m, --mapfile mapfile Specify a mapfile, which by default is /usr/src/linux/System.map. You should specify the map file on cmdline if your current kernel isn't the last one you compiled, or if you keep System.map elsewhere. If the name of the map file ends with `.gz' it is decompressed on the fly. -M, --multiplier multiplier On some architectures it is possible to alter the frequency at which the kernel delivers profiling interrupts to each CPU. This option allows you to set the frequency, as a multiplier of the system clock frequency, HZ. This is supported on i386-SMP (2.2 and 2.4 kernel) and also on sparc-SMP and sparc64-SMP (2.4 kernel). This option also resets the profiling buffer, and requires superuser privileges. -p, --profile pro-file Specify a different profiling buffer, which by default is /proc/profile. Using a different pro-file is useful if you want to `freeze' the kernel profiling at some time and read it later. The /proc/profile file can be copied using `cat' or `cp'. There is no more support for compressed profile buffers, like in readprofile-1.1, because the program needs to know the size of the buffer in advance. -r, --reset Reset the profiling buffer. This can only be invoked by root, because /proc/profile is readable by everybody but writable only by the superuser. However, you can make readprofile setuid 0, in order to reset the buffer without gaining privileges. -s, --counters Print individual counters within functions. -v, --verbose Verbose. The output is organized in four columns and filled with blanks. The first column is the RAM address of a kernel function, the second is the name of the function, the third is the number of clock ticks and the last is the normalized load. -V, --version Display version information and exit. -h, --help Display help text and exit.
EXAMPLES
Browse the profiling buffer ordering by clock ticks: readprofile | sort -nr | less Print the 20 most loaded procedures: readprofile | sort -nr +2 | head -20 Print only filesystem profile: readprofile | grep _ext2 Look at all the kernel information, with ram addresses: readprofile -av | less Browse a `freezed' profile buffer for a non current kernel: readprofile -p ~/profile.freeze -m /zImage.map.gz Request profiling at 2kHz per CPU, and reset the profiling buffer: sudo readprofile -M 20
BUGS
readprofile only works with an 1.3.x or newer kernel, because /proc/profile changed in the step from 1.2 to 1.3 This program only works with ELF kernels. The change for a.out kernels is trivial, and left as an exercise to the a.out user. To enable profiling, the kernel must be rebooted, because no profiling module is available, and it wouldn't be easy to build. To enable profiling, you can specify "profile=2" (or another number) on the kernel commandline. The number you specify is the two-exponent used as profiling step. Profiling is disabled when interrupts are inhibited. This means that many profiling ticks happen when interrupts are re-enabled. Watch out for misleading information.
FILES
/proc/profile A binary snapshot of the profiling buffer. /usr/src/linux/System.map The symbol table for the kernel. /usr/src/linux/* The program being profiled :-)
AVAILABILITY
The readprofile command is part of the util-linux package and is available from Linux Kernel Archive ftp://ftp.kernel.org/pub/linux /utils/util-linux/.
More Linux Commands
manpages/iptables-save.8.html
iptables-save(8) - dump iptables rules to stdout (Man Page)
iptables-save and ip6tables-save are used to dump the contents of IP or IPv6 Table in easily parseable format to STDOUT. Use I/O-redirection provided by your sh
manpages/setcontext.3.html
setcontext(3) get or set the user context - Linux man page
In a System V-like environment, one has the two types mcontext_t and ucontext_t defined in <ucontext.h> and the four functions getcontext(), setcontext(), makec
manpages/streqvmap.3.html
streqvmap(3) Set the character mappings for the streqv funct
Set the character mapping. If the count (ct) is set to zero, then the map is cleared by setting all entries in the map to their index value. Otherwise, the From
manpages/in_wch.3ncurses.html
in_wch(3ncurses) - extract a complex character and rendition
in_wch.3ncurses - These functions extract the complex character and rendition from the current position in the named window into the cchar_t object referenced b
manpages/after.n.html
after(n) - Execute a command after a time delay (Man Page)
This command is used to delay execution of the program or to execute a command in background sometime in the future. It has several forms, depending on the firs
manpages/rtacct.8.html
rtacct(8) - network statistics tools. - Linux manual page...
nstat and rtacct are simple tools to monitor kernel snmp counters and network interface statistics. OPTIONS -h, --help Print help -V, --version Print version -z
manpages/bgerror.n.html
bgerror(n) - Command invoked to process background errors...
Release 8.5 of Tcl supports the interp bgerror command, which allows applications to register in an interpreter the command that will handle background errors i
manpages/rsyslogd.8.html
rsyslogd(8) - reliable and extended syslogd - Linux man page
Rsyslogd is a system utility providing support for message logging. Support of both internet and unix domain sockets enables this utility to support both local
manpages/getopt_long.3.html
getopt_long(3) - Parse command-line options - Linux man page
The getopt() function parses the command-line arguments. Its arguments argc and argv are the argument count and array as passed to the main() function on progra
manpages/getwchar_unlocked.3.html
getwchar_unlocked(3) - nonlocking stdio functions (ManPage)
Each of these functions has the same behavior as its counterpart without the _unlocked suffix, except that they do not use locking (they do not set locks themse
manpages/Encode::CN.3pm.html
Encode::CN(3pm) - China-based Chinese Encodings (Man Page)
This module implements China-based Chinese charset encodings. Encodings supported are as follows. Canonical Alias Description ----------------------------------
manpages/usermod.8.html
usermod(8) - modify a user account - Linux manual page......
The usermod command modifies the system account files to reflect the changes that are specified on the command line. OPTIONS The options which apply to the user
