#182 opreport --callgraph --xml missing symbols with zero samples

closed-fixed
None
5
2009-07-31
2009-04-02
TikiTDO
No

Calling `opreport --callgraph --xml` outputs an xml with missing samples.

To Reproduce:

1. Compile a program with two processing heavy functions called by several small intermediate functions (Example provided as test.cpp)

Discussion

  • TikiTDO

    TikiTDO - 2009-04-02

    example code

     
  • TikiTDO

    TikiTDO - 2009-04-02

    Issue submitted in error before finishing up description. Continued from above:

    2. Profile with call-graph enabled
    3. `opreport -c` reports several symbols with 0 samples:
    -------------------------------------------------------------------------------
    9933 100.000 test b()
    0 0 test bb()
    9935 100.000 test bbb()
    0 0 test bb() [self]
    -------------------------------------------------------------------------------
    9935 100.000 test bb()
    0 0 test bbb()
    9935 100.000 test bbbb()
    0 0 test bbb() [self]
    -------------------------------------------------------------------------------
    9935 100.000 test bbb()
    0 0 test bbbb()
    9935 100.000 test c()
    0 0 test bbbb() [self]
    -------------------------------------------------------------------------------

    4. `opreport -X -c` is missing functions that were called from other functions with 0 samples. In the above case the symbol bbb() is missing. This creates problems when trying to use GUI utilities to visualize the call tree.
    <symboltable>
    <symboldata id="0" name="aa()" startingaddr="080484e8"/>
    <symboldata id="3" name="a()" startingaddr="08048536"/>
    <symboldata id="2" name="b()" startingaddr="0804849a"/>
    <symboldata id="5" name="c()" startingaddr="0804842e"/>
    <symboldata id="7" name="d()" startingaddr="080483e4"/>
    <symboldata id="4" name="bb()" startingaddr="08048490"/>
    <symboldata id="6" name="bbbb()" startingaddr="0804847c"/>
    <symboldata id="1" name="main" startingaddr="08048584"/>
    </symboltable>

     
  • TikiTDO

    TikiTDO - 2009-04-02

    opreport -c output

     
  • TikiTDO

    TikiTDO - 2009-04-02

    opreport -c -X output

     
  • Maynard Johnson

    Maynard Johnson - 2009-05-07

    I reproduced this problem on oprofile 0.9.3, but it seems to have been fixed in current oprofile CVS. Here's the XML output I get for the symbol table:

    <symboltable>
    <symboldata id="9" name="anon (tgid:23062 range:0xf7fb4000-0xf7fb6000)" startingaddr="00000000"/>
    <symboldata id="6" name="bbbb()" startingaddr="100005d8"/>
    <symboldata id="10" name="do_lookup_x" startingaddr="0000a690"/>
    <symboldata id="11" name="_dl_lookup_symbol_x" startingaddr="0000aac0"/>
    <symboldata id="12" name="_dl_elf_hash" startingaddr="0000a580"/>
    <symboldata id="13" name="_dl_relocate_object" startingaddr="0000bc00"/>
    <symboldata id="14" name="dl_main" startingaddr="00003a30"/>
    <symboldata id="1" name="main" startingaddr="10000800"/>
    <symboldata id="0" name="aa()" startingaddr="100006f0"/>
    <symboldata id="2" name="b()" startingaddr="10000668"/>
    <symboldata id="3" name="a()" startingaddr="10000778"/>
    <symboldata id="4" name="bb()" startingaddr="10000638"/>
    <symboldata id="5" name="c()" startingaddr="10000550"/>
    <symboldata id="7" name="d()" startingaddr="100004dc"/>
    <symboldata id="8" name="bbb()" startingaddr="10000608"/>
    </symboltable>

    ------------------------------------
    Please let me know if current CVS code provides a sufficient fix for your problem.

    Thanks.

     
  • Maynard Johnson

    Maynard Johnson - 2009-05-07
    • assigned_to: nobody --> maynardj
     
  • TikiTDO

    TikiTDO - 2009-05-27

    I find this is still happening with the latest CVS code (Checked out May 27 - See attached dump). One difference I have noticed is that I am running with --no-vmlinux, whereas you have the kernel image loaded.

     
  • TikiTDO

    TikiTDO - 2009-05-27

    Execution information from May 27th CVS build

     
  • Maynard Johnson

    Maynard Johnson - 2009-05-29

    Patch to fix this bug

     
  • Maynard Johnson

    Maynard Johnson - 2009-05-29

    OK, I reproduced your problem. I had to collect several profiles before I finally got one with the right conditions: bb() -> bbb() -> bbbb(), all with 0 samples.

    Please apply the patch I attached to this bug to the latest pull from CVS. Please respond as soon as you can, since we want to roll out a new release soon, and I'd like to get your fix into the new release. Of course, I'll need to first post it to the list so the entire oprofile community can see/review it.

    ATTENTION: This patch changes the behavior of callgraph XML output such that all symbols that are found in the sample data (whether from the primary sample or as a member of a callee or caller list) will be reported, even if there are zero actual samples for a given symbol.

     
  • TikiTDO

    TikiTDO - 2009-06-01

    I can confirm that the patch fixes my issue. Many thanks.

     
  • Maynard Johnson

    Maynard Johnson - 2009-06-26
    • status: open --> open-fixed
     
  • Maynard Johnson

    Maynard Johnson - 2009-06-26

    This bug is resolved and the fix was committed on June 18, 2009.

     
  • Maynard Johnson

    Maynard Johnson - 2009-07-31
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks