下面是使用oprofile分析性能的一些命令。
-
[root@10-150-110-85 samples]# opcontrol --start
-
Profiler running.
-
[root@10-150-110-85 samples]# opcontrol --stop
-
Stopping profiling.
-
[root@10-150-110-85 samples]# opcontrol --help
-
opcontrol: usage:
-
-l/--list-events list event types and unit masks
-
-?/--help this message
-
-v/--version show version
-
--init loads the oprofile module and oprofilefs
-
--setup give setup arguments (may be omitted)
-
--status show configuration
-
--start-daemon start daemon without starting profiling
-
-s/--start start data collection
-
-d/--dump flush the collected profiling data
-
-t/--stop stop data collection
-
-h/--shutdown stop data collection and kill daemon
-
-V/--verbose[=all,sfile,arcs,samples,module,misc,ext]
-
be verbose in the daemon log
-
--reset clears out data from current session
-
--save=name save data from current session to session_name
-
--deinit unload the oprofile module and oprofilefs
-
-
-e/--event=eventspec
-
-
Choose an event. May be specified multiple times. Of the form
-
"default" or "name:count:unitmask:kernel:user", where :
-
-
name: event name, e.g. CPU_CLK_UNHALTED or RTC_INTERRUPTS
-
count: reset counter value e.g. 100000
-
unitmask: hardware unit mask e.g. 0x0f
-
kernel: whether to profile kernel: 0 or 1
-
user: whether to profile userspace: 0 or 1
-
-
-p/--separate=type,[types]
-
-
Separate profiles as follows :
-
-
none: no profile separation
-
library: separate shared library profiles per-application
-
kernel: same as library, plus kernel profiles
-
thread: per-thread/process profiles
-
cpu: per CPU profiles
-
all: all of the above
-
-
-c/--callgraph=#depth enable callgraph sample collection with a
-
maximum depth. Use '0' to disable callgraph
-
profiling.
-
--session-dir=dir place sample database in dir instead of
-
default location (/var/lib/oprofile)
-
-i/--image=name[,names] list of binaries to profile (default is "all")
-
--vmlinux=file vmlinux kernel image
-
--no-vmlinux no kernel image (vmlinux) available
-
--kernel-range=start,end kernel range vma address in hexadecimal
-
--buffer-size=num kernel buffer size in sample units.
-
Rules: A non-zero value goes into effect after
-
a '--shutdown/start' sequence. A value of
-
zero sets this parameter back to default value
-
but does not go into effect until after a
-
'--deinit/init' sequence.
-
--buffer-watershed kernel buffer watershed in sample units (2.6
-
kernel). Same rules as defined for
-
buffer-size.
-
--cpu-buffer-size=num per-cpu buffer size in units (2.6 kernel)
-
Same rules as defined for buffer-size.
-
--note-table-size kernel notes buffer size in notes units (2.4
-
kernel)
-
-
--xen Xen image (for Xen only)
-
--active-domains=
List of domains in profiling session (for Xen)
-
(list contains domain ids separated by commas)
-
[root@10-150-110-85 samples]# oprofile stop
-
-bash: oprofile: command not found
-
[root@10-150-110-85 samples]# oprofile --stop
-
-bash: oprofile: command not found
-
[root@10-150-110-85 samples]# opcontrol --stop
-
[root@10-150-110-85 samples]# opcontrol -l|more
-
oprofile: available events for CPU type "Intel Sandy Bridge microarchitecture"
-
-
See Intel Architecture Developer's Manual Volume 3B, Appendix A and
-
Intel Architecture Optimization Reference Manual (730795-001)
-
-
For architectures using unit masks, you may be able to specify
-
unit masks by name. See 'opcontrol' man page for more details.
-
-
CPU_CLK_UNHALTED: (counter: all)
-
Clock cycles when not halted (min count: 6000)
-
UNHALTED_REFERENCE_CYCLES: (counter: all)
-
Unhalted reference cycles (min count: 6000)
-
Unit masks (default 0x1)
-
----------
-
0x01: No unit mask
-
INST_RETIRED: (counter: all)
-
number of instructions retired (min count: 6000)
-
LLC_MISSES: (counter: all)
-
Last level cache demand requests from this core that missed the LLC (min count: 6000)
-
Unit masks (default 0x41)
-
----------
-
0x41: No unit mask
-
LLC_REFS: (counter: all)
-
Last level cache demand requests from this core (min count: 6000)
-
Unit masks (default 0x4f)
-
----------
-
0x4f: No unit mask
-
BR_INST_RETIRED: (counter: all)
-
number of branch instructions retired (min count: 500)
-
BR_MISS_PRED_RETIRED: (counter: all)
-
number of mispredicted branches retired (precise) (min count: 500)
-
ld_blocks: (counter: all)
-
blocked loads (min count: 100000)
-
Unit masks (default 0x1)
link 1 http://www.ibm.com/developerworks/cn/linux/l-oprof/
link 2
link 3
阅读(1320) | 评论(0) | 转发(0) |