全部博文(75)
分类: LINUX
2008-08-06 11:44:49
# opreport --callgraph 'image:/work/apps/*'
warning: /no-vmlinux could not be found.
CPU: CPU with timer interrupt, speed 0 MHz (estimated)
Profiling through timer interrupt
samples % image name app name symbol name
-------------------------------------------------------------------------------
22004 41.3555 multi-threads multi-threads slow_multiply
22004 100.000 multi-threads multi-threads slow_multiply [self]
-------------------------------------------------------------------------------
16408 30.8380 libc-
16408 100.000 libc-
-------------------------------------------------------------------------------
3686 6.9277 libc-
3686 100.000 libc-
-------------------------------------------------------------------------------
2651 4.9824 libc-
2651 100.000 libc-
-------------------------------------------------------------------------------
1662 3.1236 libc-
1662 100.000 libc-
-------------------------------------------------------------------------------
1615 3.0353 libc-
1615 100.000 libc-
-------------------------------------------------------------------------------
1116 2.0975 cg cg compare
1116 100.000 cg cg compare [self]
-------------------------------------------------------------------------------
665 1.2498 libc-
665 100.000 libc-
-------------------------------------------------------------------------------
562 1.0563 libc-
562 100.000 libc-
-------------------------------------------------------------------------------
503 0.9454 libc-
503 100.000 libc-
-------------------------------------------------------------------------------
495 0.9303 no-vmlinux cg (no symbols)
495 100.000 no-vmlinux cg (no symbols) [self]
-------------------------------------------------------------------------------
429 0.8063 libc-
429 100.000 libc-
-------------------------------------------------------------------------------
371 0.6973 libc-
371 100.000 libc-
-------------------------------------------------------------------------------
360 0.6766 cg cg .plt
360 100.000 cg cg .plt [self]
-------------------------------------------------------------------------------
170 0.3195 cg cg repeat
170 100.000 cg cg repeat [self]
-------------------------------------------------------------------------------
133 0.2500 libc-
133 100.000 libc-
-------------------------------------------------------------------------------
108 0.2030 multiple multiple slow_multiply
108 100.000 multiple multiple slow_multiply [self]
-------------------------------------------------------------------------------
49 0.0921 libc-
49 100.000 libc-
-------------------------------------------------------------------------------
41 0.0771 no-vmlinux multi-threads (no symbols)
41 100.000 no-vmlinux multi-threads (no symbols) [self]
-------------------------------------------------------------------------------
40 0.0752 libc-
40 100.000 libc-
-------------------------------------------------------------------------------
32 0.0601 multi-threads multi-threads main
32 100.000 multi-threads multi-threads main [self]
-------------------------------------------------------------------------------
25 0.0470 no-vmlinux multiple (no symbols)
25 100.000 no-vmlinux multiple (no symbols) [self]
-------------------------------------------------------------------------------
22 0.0413 libc-
22 100.000 libc-
-------------------------------------------------------------------------------
21 0.0395 multi-threads multi-threads fast_multiply
21 100.000 multi-threads multi-threads fast_multiply [self]
-------------------------------------------------------------------------------
19 0.0357 multi-threads multi-threads thread_proc
19 100.000 multi-threads multi-threads thread_proc [self]
-------------------------------------------------------------------------------
13 0.0244 no-vmlinux hello (no symbols)
13 100.000 no-vmlinux hello (no symbols) [self]
-------------------------------------------------------------------------------
2 0.0038 ld-linux.so.2 multiple _dl_relocate_object
2 100.000 ld-linux.so.2 multiple _dl_relocate_object [self]
-------------------------------------------------------------------------------
2 0.0038 multiple multiple main
2 100.000 multiple multiple main [self]
-------------------------------------------------------------------------------
1 0.0019 ld-linux.so.2 cg _dl_relocate_object
1 100.000 ld-linux.so.2 cg _dl_relocate_object [self]
-------------------------------------------------------------------------------
1 0.0019 ld-linux.so.2 multi-threads do_lookup_versioned
1 100.000 ld-linux.so.2 multi-threads do_lookup_versioned [self]
-------------------------------------------------------------------------------
1 0.0019 libc-
1 100.000 libc-
-------------------------------------------------------------------------------
#
#
# opreport --merge=kernel 'image:/work/apps/cg'
unknown merge option: kernel
# opreport --merge=all 'image:/work/apps/cg'
CPU: CPU with timer interrupt, speed 0 MHz (estimated)
Profiling through timer interrupt
TIMER:0|
samples| %|
------------------
28797 93.0767 libc-
1646 5.3201 cg
495 1.5999 no-vmlinux
1 0.0032 ld-linux.so.2
# opreport 'image:/work/apps/cg'
CPU: CPU with timer interrupt, speed 0 MHz (estimated)
Profiling through timer interrupt
TIMER:0|
samples| %|
------------------
30939 100.000 cg
TIMER:0|
samples| %|
------------------
28797 93.0767 libc-
1646 5.3201 cg
495 1.5999 no-vmlinux
1 0.0032 ld-linux.so.2
#
#
# opreport -i 'strcmp' 'image:/work/apps/cg'
--exclude-symbols and --include-symbols are meaningless without --symbols
# opreport -i 'strcmp' -l 'image:/work/apps/cg'
warning: /no-vmlinux could not be found.
CPU: CPU with timer interrupt, speed 0 MHz (estimated)
Profiling through timer interrupt
samples % image name symbol name
1615 100.000 libc-
#
#
#
# opreport -i 'strcmp,repeat' 'image:/work/apps/cg'
--exclude-symbols and --include-symbols are meaningless without --symbols
# opreport -i 'strcmp,repeat' -l 'image:/work/apps/cg'
warning: /no-vmlinux could not be found.
CPU: CPU with timer interrupt, speed 0 MHz (estimated)
Profiling through timer interrupt
samples % image name symbol name
1615 90.4762 libc-
170 9.5238 cg repeat
# opreport -l 'image:/work/apps/cg'
warning: /no-vmlinux could not be found.
CPU: CPU with timer interrupt, speed 0 MHz (estimated)
Profiling through timer interrupt
samples % image name symbol name
16408 53.0334 libc-
3686 11.9138 libc-
2651 8.5685 libc-
1662 5.3719 libc-
1615 5.2199 libc-
1116 3.6071 cg compare
665 2.1494 libc-
562 1.8165 libc-
503 1.6258 libc-
495 1.5999 no-vmlinux (no symbols)
429 1.3866 libc-
371 1.1991 libc-
360 1.1636 cg .plt
170 0.5495 cg repeat
133 0.4299 libc-
49 0.1584 libc-
40 0.1293 libc-
22 0.0711 libc-
1 0.0032 ld-linux.so.2 _dl_relocate_object
1 0.0032 libc-
# opannotate --source 'image:/work/apps/cg'
warning: /no-vmlinux could not be found.
/*
* Command line: opannotate --source image:/work/apps/cg
*
* Interpretation of command line:
* Output annotated source file with samples
* Output all files
*
* CPU: CPU with timer interrupt, speed 0 MHz (estimated)
* Profiling through timer interrupt
*/
opannotate (warning): unable to open for reading: /home/jollen/ictc/crosstool-0.38/build/arm-9tdmi-linux-gnu/gcc-
/*
* Total samples for file : "/home/jollen/ictc/crosstool-0.38/build/arm-9tdmi-linux-gnu/gcc-
*
* 16408 53.0334
*/
/* __umodsi3 total: 16408 53.0334 */
opannotate (warning): unable to open for reading: libgcc2.c
/*
* Total samples for file : "libgcc2.c"
*
* 11997 38.7763
*/
/* _dl_relocate_object total: 1 0.0032 */
/* msort_with_tmp total: 1662 5.3719 */
/* random_r total: 3686 11.9138 */
/* _IO_file_stat total: 1 0.0032 */
/* _int_malloc total: 562 1.8165 */
/* strcmp total: 1615 5.2199 */
/* strdup total: 133 0.4299 */
/* strlen total: 40 0.1293 */
/* Laligned total: 665 2.1494 */
/* Llastword total: 49 0.1584 */
/* memcpy total: 429 1.3866 */
/* _wordcopy_fwd_aligned total: 503 1.6258 */
/* strfry total: 2651 8.5685 */
/*
* Total samples for file : "/work/cg.c"
*
* 1286 4.1566
*/
:#include
:#include
:#include
:
:#define SIZE 500000
:
:static int compare(const void *s1, const void *s2)
596 1.9264 :{ /* compare total: 1116 3.6071 */
372 1.2024 : return strcmp(s1, s2);
148 0.4784 :}
:
:static void repeat(void)
:{ /* repeat total: 170 0.5495 */
: int i;
: char *strings[SIZE];
: char str[] = "abcdefghijklmnopqrstuvwxyz";
:
81 0.2618 : for (i = 0; i < SIZE; ++i) {
57 0.1842 : strings[i] = strdup(str);
32 0.1034 : strfry(strings[i]);
: }
:
: qsort(strings, SIZE, sizeof(char *), compare);
:}
:
:int main()
:{
: while (1)
: repeat();
:}
:
:
#
# opannotate --source --base-dirs='/work' --search-dirs='work/apps/' 'image:/work/apps/cg'
warning: /no-vmlinux could not be found.
/*
* Command line: opannotate --source --base-dirs=/work --search-dirs=work/apps/ image:/work/apps/cg
*
* Interpretation of command line:
* Output annotated source file with samples
* Output all files
*
* CPU: CPU with timer interrupt, speed 0 MHz (estimated)
* Profiling through timer interrupt
*/
opannotate (warning): unable to open for reading: /home/jollen/ictc/crosstool-0.38/build/arm-9tdmi-linux-gnu/gcc-
/*
* Total samples for file : "/home/jollen/ictc/crosstool-0.38/build/arm-9tdmi-linux-gnu/gcc-
*
* 16408 53.0334
*/
/* __umodsi3 total: 16408 53.0334 */
opannotate (warning): unable to open for reading: libgcc2.c
/*
* Total samples for file : "libgcc2.c"
*
* 11997 38.7763
*/
/* _dl_relocate_object total: 1 0.0032 */
/* msort_with_tmp total: 1662 5.3719 */
/* random_r total: 3686 11.9138 */
/* _IO_file_stat total: 1 0.0032 */
/* _int_malloc total: 562 1.8165 */
/* strcmp total: 1615 5.2199 */
/* strdup total: 133 0.4299 */
/* strlen total: 40 0.1293 */
/* Laligned total: 665 2.1494 */
/* Llastword total: 49 0.1584 */
/* memcpy total: 429 1.3866 */
/* _wordcopy_fwd_aligned total: 503 1.6258 */
/* strfry total: 2651 8.5685 */
/*
* Total samples for file : "/work/cg.c"
*
* 1286 4.1566
*/
:#include
:#include
:#include
:
:#define SIZE 500000
:
:static int compare(const void *s1, const void *s2)
596 1.9264 :{ /* compare total: 1116 3.6071 */
372 1.2024 : return strcmp(s1, s2);
148 0.4784 :}
:
:static void repeat(void)
:{ /* repeat total: 170 0.5495 */
: int i;
: char *strings[SIZE];
: char str[] = "abcdefghijklmnopqrstuvwxyz";
:
81 0.2618 : for (i = 0; i < SIZE; ++i) {
57 0.1842 : strings[i] = strdup(str);
32 0.1034 : strfry(strings[i]);
: }
:
: qsort(strings, SIZE, sizeof(char *), compare);
:}
:
:int main()
:{
: while (1)
: repeat();
:}
:
:
:}
6. References
[1] Oprofile User Manual
[2]
[3] Comsys training slide “Hardware Abstraction Layer”
[4] Comsys “White Paper: Incremental Redundancy”