Flashnux

GNU/Linux man pages

Livre :
Expressions régulières,
Syntaxe et mise en oeuvre :

ISBN : 978-2-7460-9712-4
EAN : 9782746097124
(Editions ENI)

GNU/Linux

CentOS 3.3

op_merge(1)


OPROFILE

OPROFILE

NAME
SYNOPSIS
DESCRIPTION
COMMONS OPTIONS
OPTIONS
USAGE
ENVIRONMENT
FILES
VERSION
SEE ALSO
COPYRIGHT
AUTHORS

NAME

oprofile − a sytem-wide profiler

SYNOPSIS

opcontrol [ options ]
oprofpp
[ options ] [ sample-file ] [ binary ]
op_to_source
[ options ]
op_time
[ options ] [ samples-files-directory ]
op_merge
[ options ] [ samples-filenames or binary-filename]
op_help
[ event-name ]
oprof_convert

DESCRIPTION

OProfile is a profiling system for systems running Linux 2.2,2.4, and 2.5. Profiling runs transparently in the background and profile data can be collected at any time. OProfile makes use of the hardware performance counters provided on Intel P6, Intel Pentium 4, and AMD Athlon family processors, and OProfile can use the RTC for profiling on other processor. In the following description, options that begin with ctrN- define N as a logical counter number in the range 0-7, which is processor specific. See the HTML documentation for further details.

COMMONS OPTIONS

All utilities share the following options
--help -? --usage

Show help message.

--version -v

Show version.

OPTIONS

opcontrol options
--list-events

Shows the monitorable events.

--init

Load the OProfile module if required and make the OProfile driver interface available.

--setup

Followed by list options for profiling setup. Store setup in /root/.oprofile/daemonrc.

--start-daemon

Start the oprofile daemon without starting profiling. Not available in 2.2/2.4 kernels.

--start

Start data collection with either arguments provided by --setup of information saved in /root/.oprofile/daemonrc.

--dump

Force a flush of the collected profiling data to the daemon.

--stop

Stop data collection.

--shutdown

Stop data collection and remove daemon.

--reset

Clear out data from current session, but leaves saved sessions.

--save=sessionname

Save data from current session to sessionname.

--deinit

Shut down daemon. Unload the oprofile module and oprofilefs.

--buffer-size=num

Set kernel buffer to num samples.

--ctrN-event=[name|none]

Set counter N to measure symbolic event name, or to the string ’none’ to disable the counter.

--ctrN-count=val

Number of events between samples for counter N.

--ctrN-unit-mask=val

Set unit mask for counter N (e.g. --ctr0-unit-mask=0xf).

--ctrN-kernel=[0|1]

Count events in kernel mode when 1, do not count when 0 (default 1).

--ctrN-user=[0|1]

Count events in user mode when 1, do not count when 0 (default 1).

--pid-filter=pid

Only profile process pid (only available for 2.4 version). Set to ’none’ to enable profiling of all PIDs again.

--pgrp-filter=pgrp

Only profile process tty group pgrp (only available for 2.4 version). Set to ’none’ to enable profiling of all PIDs again.

--separate=[none,library,kernel,all]

Separate samples based on the given separator. ’library’ per-application dynamically linked libraries samples files. ’kernel’ per-application modules and kernel samples files, ’kernel’ imply ’library’. ’all’ imply all the above options and ’none’ turns off separation.

--vmlinux=file

vmlinux kernel image.

--no-vmlinux

Use this when you don’t have a kernel vmlinux file, and you don’t want to profile the kernel. Note that overall profiling time through op_time always counts kernel samples.

--verbose

Be verbose in the daemon log.

--kernel-range=start,end

Set kernel range vma address in hexadecimal.

oprofpp options
--samples-file
filename, -f filename

Analyze sample filename.

--image-file filename, -i filename

Analyze image filename.

--list-symbols -l

List samples by symbol.

--dump-gprof-file filename, -g filename

Dump gprof format file.

--list-symbol name, -s name

Give detailed samples for the symbol name.

--list-all-symbols-details -L

Give detailed samples for all symbols.

--output-linenr-info -o

Output filename:linenr info for all samples, usable only with --list-all-symbols-details, --list-symbol and --list-symbols.

--demangle -d

Demangle GNU C++ symbol names.

--smart-demangle -D

Demangle GNU C++ symbol names then apply a set of regular expression to simplify stl library demangled name.

--counter counter_nr, -c counter_nr

Analyze using counter nr.

--verbose -V

Generate verbose output.

--exclude-symbol symbols -e symbols

Exclude list of comma separated symbols.

--show-shared-libs -k

Show the details for each shared lib which belongs to one application. This option is useful only if you have profiled with --separate=library option and you don’t specify on the oprofpp command line --dump-gprof-file.

--reverse -r

Sort the entries in reverse order, from largest to smallest (only with --list-symbols).

--output-format vsSpPqQnlLiIh, -t vsSpPqQnlLiIdh

Specify the output format where a single format char is a field intended for: ’v’ vma, ’s’ nr samples, ’S’ nr cumulated samples, ’p’ percent samples, ’P’ cumulated percent samples, ’n’ symbol name, ’l’ source file name and line nr, ’L’ ditto as ’l’ but with basename of source file name, ’i’ image name, ’I’ ditto as ’i’ but with base name of image name, ’d’ details for each samples for the selected symbols and ’h’ for the header itself. ’q’,’Q’ are identical to ’p’, ’P’ but the percentage are relative to the total number of symbols. This option is not available with --dump-gprof-file.

--session session-name

Specify the session name you want to use, session-name can be an absolute path where samples reside or a session name relative to samples files base directory. If you specify a samples filename with an absolute path this option is ignored

--path path_list, -p path_list

Specify an alternate list of pathnames to locate image files. Use if the sample filenames do not match the image filenames, e.g. modules loaded at boot time through a RAM disk. The path_list is a comma-separated list of directories. Each directory is scanned recursively.

op_to_source options
--samples-file
filename, -f filename

Annotate sample sample filename.

--image-file filename, -i filename

Annotate image filename.

--demangle -d

Demangle GNU C++ symbol names.

--smart-demangle -D

Demangle GNU C++ symbol names then apply a set of regular expression to simplify stl library demangled name.

--assembly -a

Output assembly code.

--source-dir base_directory

Search the base directory for the source files. All source file outside this base directory are ignored. If neither --source-dir nor --output-dir specified, annotated source files go to stdout.

--output-dir base_directory

Output annotated source file into base directory. If neither --source-dir nor --output-dir specified, annotated source files go to stdout.

--output pattern

Generate annotations only for the files matching pattern. Multiple patterns can be specified by separating the patterns with commas.

--no-output pattern

Do not generate annotations for files matching pattern. Multiple patterns can be specified by separating the patterns with commas.

--source-with-assembly -s

Output assembly mixed with source file.

--until-more-than-samples percent_nr, -m percent_nr

Output source files until the amount of samples in these files reach percent_nr samples.

--with-more-than-samples percent_nr, -w percent_nr

Annotate source files with more than percent_nr samples.

--sort-by-counter counter_nr, -c counter_nr

Sort on counter_nr.

--verbose -V

Generate verbose output.

--exclude-symbol symbols, -e symbols

Exclude comma separated list of symbols.

--include-symbol symbol, -y symbol

Include comma separated list of symbol.

--session session-name

Specify the session name you want to use, session-name can be an absolute path where samples reside or a session name relative to samples files base directory. If you specify a samples filename, with an absolute path this option is ignored.

--objdump-params ’params’, -o ’params’

Pass the comma separated additional parameters to objdump. Check the objdump man page to see what options objdump accept e.g. -o ’--disassembler-options=intel’ to get Intel assembly syntax instead of AT&T syntax. This option can be used only with --assembly or --source-with-assembly.

op_time options [image_name [image_names]]
--counter
counter_nr, -c counter_nr

Sort on counter_nr.

--show-shared-libs -k

Show the details for each shared lib which belongs to one application. This option is useful only if you have profiled with --separate=library option.

--list-symbols -l

Show details for each symbol in each profiled file.

--demangle -d

Demangle GNU C++ symbol names.

--smart-demangle -D

Demangle GNU C++ symbol names then apply a set of regular expression to simplify stl library demangled name.

--show-image-name -n

Show the image name when specifying --list-symbols.

--output-format vsSpPnlLiIeEh, -t vsSpPnlLiIeEh

Specify the output format where a single format char is a field intended for: ’v’ vma, ’s’ nr samples, ’S’ nr cumulated samples, ’p’ percent samples, ’P’ cumulated percent samples, ’n’ symbol name, ’l’ source file name and line nr, ’L’ ditto as ’l’ but with basename of source file name, ’i’ image name, ’I’ ditto as ’i’ but with base name of image name, ’e’ application name, ’E’ basename of application name ’e’ and ’E’ are useless unless you profile with --separate=[library|kernel], ’d’ details for each samples for the selected symbols and ’h’ for the header itself. This option is available only with --list-symbols

--reverse -r

Sort output from largest to smallest count.

--path path_list, -p path_list

Specify an alternate list of pathnames to locate image files. Use if the sample filenames do not match the image filenames, e.g. modules loaded at boot time through a RAM disk. The path_list is a comma-separated list of directories. Each directory is scanned recursively.

--session session-name

Specify the session name you want to use, session-name can be an absolute path where samples reside or a session name relative to samples files base directory

op_merge options
--counter
counter_nr, -c counter_nr

Select sample files for counter_nr rather than the default 0.

USAGE

Setup and start the profiler with the provided opcontrol shell script. You are required to specify vmlinux, as well as specify a counter event and value, e.g. :

opcontrol --setup --vmlinux=/sys/vmlinux --ctr0-event=CPU_CLK_UNHALTED --ctr0-count=600000

If you are using a linux 2.4 kernel on a machine that doesn’t support the performance counters, you can use the RTC driver instead, e.g. :

opcontrol --setup --vmlinux=/sys/vmlinux --rtc-value=128

If you are using a linux 2.5 kernel on a machine that doesn’t support the performance counters, you can use the TIMER_INT driver instead, e.g. :

opcontrol --setup --vmlinux=/sys/vmlinux

Then actually start profiling with :

opcontrol --start

Profiles will be stored in the sample files periodically. You can force a collection at any time :

opcontrol --dump

Stopping profiling is done using

opcontrol --shutdown

which also flushes all samples to disk.

As an alternative you can use the oprof_start GUI to start the profiler. See the HTML documentation for further details

You can then collect profiles for any binary or shared library by using oprofpp to read the sample file :

oprofpp -l /lib/libc-2.1.92.so

or by using : op_to_source

op_to_source -i /lib/libc-2.1.92.so

op_time utility can be used to get an overall view of all profiled applications.

op_merge utility can be used to merge multiple samples files which belongs to the same binary image.

ENVIRONMENT

No environment variables are recognised by oprofile.

FILES

$HOME/.oprofile/

Configuration files

/root/.oprofile/daemonrc

Configuration file for opcontrol

/var/lib/oprofile/oprofiled.log

The user-space daemon logfile.

/var/lib/oprofile/opdev, /var/lib/oprofile/ophashmapdev,
/var/lib/oprofile/opnotedev

The device files for communication with the Linux 2.4 kernel module.

/dev/oprofile

The device filesystem for communication with the Linux 2.5 kernel module.

/var/lib/oprofile/samples/

The location of the generated sample files.

VERSION

This man page is current for oprofile-0.5.4.

SEE ALSO

gprof(1), readprofile(1), Intel IA32 Architecture Developer’s Manual, Volume 3

COPYRIGHT

oprofile is Copyright (C) 1998-2003 University of Manchester, UK, John Levon, and others. OProfile is released under the GNU General Public License, Version 2, or (at your option) any later version.

AUTHORS

John Levon <levon@movementarian.org> is the primary author. See the documentation for other contributors.



op_merge(1)