Chinaunix首页 | 论坛 | 博客
  • 博客访问: 641164
  • 博文数量: 75
  • 博客积分: 7001
  • 博客等级: 少将
  • 技术积分: 1465
  • 用 户 组: 普通用户
  • 注册时间: 2007-07-11 17:39
文章分类

全部博文(75)

文章存档

2010年(1)

2009年(25)

2008年(49)

我的朋友

分类: 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-2.3.3.so            cg                       __umodsi3

  16408    100.000  libc-2.3.3.so            cg                       __umodsi3 [self]

-------------------------------------------------------------------------------

3686      6.9277  libc-2.3.3.so            cg                       random_r

  3686     100.000  libc-2.3.3.so            cg                       random_r [self]

-------------------------------------------------------------------------------

2651      4.9824  libc-2.3.3.so            cg                       strfry

  2651     100.000  libc-2.3.3.so            cg                       strfry [self]

-------------------------------------------------------------------------------

1662      3.1236  libc-2.3.3.so            cg                       msort_with_tmp

  1662     100.000  libc-2.3.3.so            cg                       msort_with_tmp [self]

-------------------------------------------------------------------------------

1615      3.0353  libc-2.3.3.so            cg                       strcmp

  1615     100.000  libc-2.3.3.so            cg                       strcmp [self]

-------------------------------------------------------------------------------

1116      2.0975  cg                       cg                       compare

  1116     100.000  cg                       cg                       compare [self]

-------------------------------------------------------------------------------

665       1.2498  libc-2.3.3.so            cg                       Laligned

  665      100.000  libc-2.3.3.so            cg                       Laligned [self]

-------------------------------------------------------------------------------

562       1.0563  libc-2.3.3.so            cg                       _int_malloc

  562      100.000  libc-2.3.3.so            cg                       _int_malloc [self]

-------------------------------------------------------------------------------

503       0.9454  libc-2.3.3.so            cg                       _wordcopy_fwd_aligned

  503      100.000  libc-2.3.3.so            cg                       _wordcopy_fwd_aligned [self]

-------------------------------------------------------------------------------

495       0.9303  no-vmlinux               cg                       (no symbols)

  495      100.000  no-vmlinux               cg                       (no symbols) [self]

-------------------------------------------------------------------------------

429       0.8063  libc-2.3.3.so            cg                       memcpy

  429      100.000  libc-2.3.3.so            cg                       memcpy [self]

-------------------------------------------------------------------------------

371       0.6973  libc-2.3.3.so            cg                       malloc

  371      100.000  libc-2.3.3.so            cg                       malloc [self]

-------------------------------------------------------------------------------

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-2.3.3.so            cg                       strdup

  133      100.000  libc-2.3.3.so            cg                       strdup [self]

-------------------------------------------------------------------------------

108       0.2030  multiple                 multiple                 slow_multiply

  108      100.000  multiple                 multiple                 slow_multiply [self]

-------------------------------------------------------------------------------

49        0.0921  libc-2.3.3.so            cg                       Llastword

  49       100.000  libc-2.3.3.so            cg                       Llastword [self]

-------------------------------------------------------------------------------

41        0.0771  no-vmlinux               multi-threads            (no symbols)

  41       100.000  no-vmlinux               multi-threads            (no symbols) [self]

-------------------------------------------------------------------------------

40        0.0752  libc-2.3.3.so            cg                       strlen

  40       100.000  libc-2.3.3.so            cg                       strlen [self]

-------------------------------------------------------------------------------

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-2.3.3.so            cg                       .plt

  22       100.000  libc-2.3.3.so            cg                       .plt [self]

-------------------------------------------------------------------------------

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-2.3.3.so            cg                       _IO_file_stat

  1        100.000  libc-2.3.3.so            cg                       _IO_file_stat [self]

-------------------------------------------------------------------------------

#

#

# 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-2.3.3.so

     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-2.3.3.so

             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-2.3.3.so            strcmp

#

#

#

# 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-2.3.3.so            strcmp

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-2.3.3.so            __umodsi3

3686     11.9138  libc-2.3.3.so            random_r

2651      8.5685  libc-2.3.3.so            strfry

1662      5.3719  libc-2.3.3.so            msort_with_tmp

1615      5.2199  libc-2.3.3.so            strcmp

1116      3.6071  cg                       compare

665       2.1494  libc-2.3.3.so            Laligned

562       1.8165  libc-2.3.3.so            _int_malloc

503       1.6258  libc-2.3.3.so            _wordcopy_fwd_aligned

495       1.5999  no-vmlinux               (no symbols)

429       1.3866  libc-2.3.3.so            memcpy

371       1.1991  libc-2.3.3.so            malloc

360       1.1636  cg                       .plt

170       0.5495  cg                       repeat

133       0.4299  libc-2.3.3.so            strdup

49        0.1584  libc-2.3.3.so            Llastword

40        0.1293  libc-2.3.3.so            strlen

22        0.0711  libc-2.3.3.so            .plt

1         0.0032  ld-linux.so.2            _dl_relocate_object

1         0.0032  libc-2.3.3.so            _IO_file_stat

 

# 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-3.4.1-glibc-2.3.3/gcc-3.4.1/gcc/config/arm/lib1funcs.asm

/*

 * Total samples for file : "/home/jollen/ictc/crosstool-0.38/build/arm-9tdmi-linux-gnu/gcc-3.4.1-glibc-2.3.3/gcc-3.4.1/gcc/config/arm/lib1funcs.asm"

 *

 *  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

 */

 

  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-3.4.1-glibc-2.3.3/gcc-3.4.1/gcc/config/arm/lib1funcs.asm

/*

 * Total samples for file : "/home/jollen/ictc/crosstool-0.38/build/arm-9tdmi-linux-gnu/gcc-3.4.1-glibc-2.3.3/gcc-3.4.1/gcc/config/arm/lib1funcs.asm"

 *

 *  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

 */

 

  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

阅读(2280) | 评论(0) | 转发(0) |
0

上一篇:OProfile usage [2]

下一篇:OProfile usage [4]

给主人留下些什么吧!~~