#28 assembly functions not found by oprofpp


I am using oprofile 0.0.6 on Red Hat 6.2 with kernel 2.4.8

I have a program in which some of the code is written in C-callable assembly using nasm to
assemble it (mmx stuff).

I can find the assembly functions in gdb (e.g. set breakpoints), and if I use op_to_source -a I see
them in the (tons of) output.

But when I try to use oprofpp (oprofpp -l -d ./myprog), I don't see any of the functions written in
assembler. If I give it -s and and the name of a function written in assembler, it says symbol not

I am running on an athlon (t-bird) if that makes any difference. I am using the RETIRED_OPS

I am using gcc 2.95.3 and nasm 0.98.


  • Philippe Elie

    Philippe Elie - 2001-10-27

    Logged In: YES

    That's probably a problem with nasm which incorrectly
    export the symbol. oprofpp filter symbol name to avoid
    flooding of symbol op_to_source -a use currently objdump
    to get assembly output so you can see them. Can you send
    the result of:

    $nm application_name | grep symbol_name

  • Philippe Elie

    Philippe Elie - 2001-10-28
    • status: open --> open-fixed
  • Philippe Elie

    Philippe Elie - 2001-10-28

    Logged In: YES

    With nasm you must declare your function as

    GLOBAL:function function_name

    else the linker do not put BSF_FUNCTION flag to your symbol.

  • Philippe Elie

    Philippe Elie - 2001-10-28
    • status: open-fixed --> closed-fixed
  • Nobody/Anonymous

    Logged In: NO

    I tried declaring my functions as

    GLOBAL:function function_name

    But nasm didn't like the :function after the GLOBAL

    The way they are (were) was

    global function_name

    This is what happens when I run oprofpp

    [root@gtec72 tnvd]# oprofpp -d -l ./tnvd | grep -i mmx
    DetectMMX (0 samples)
    jpeg_detect_mmx (0 samples)

    (jpeg_detect_mmx is a C function)

    I know the mmx stuff is getting called because I get there in gdb. Anyway, it not showing up with even 0
    count like it should even if it weren't being called.

    And this is what nm spits out.

    [root@gtec72 tnvd]# nm tnvd | grep -i mmx | grep -i jpeg
    0805ace4 T jpeg_detect_mmx
    08070500 T jpeg_idct_2x2_mmx
    080700c0 T jpeg_idct_4x4_mmx
    08064330 T jpeg_idct_ifast_mmx
    0806ed40 T jpeg_idct_islow_mmx
    [root@gtec72 tnvd]#


Log in to post a comment.