Changes between Version 2 and Version 3 of Debugging/LowLevelProfiling/oprofile


Ignore:
Timestamp:
Nov 3, 2009 4:01:00 PM (6 years ago)
Author:
guest
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Debugging/LowLevelProfiling/oprofile

    v2 v3  
    1919$ sudo opreport
    2020}}}
    21 check that the program you ran is at the top of the profile somewhere.  Sometimes for me it doesn't appear, and have to run it again.  To see a list of possible `<event>`s, use
    22 {{{
    23 $ opcontrol --list-events
    24 }}}
     21check that the program you ran is at the top of the profile somewhere.  Sometimes for me it doesn't appear, and have to run it again.  To see a list of possible `<event>`s, use `$ opcontrol --list-events`.
    2522
    2623Then to annotate the source:
    2724{{{
    28 $ sudo opannotate --source <program> >&! log}}}
     25$ sudo opannotate --source <program> >&! log
     26}}}
    2927lists the contents of source files in order of importance.  Alternatively use --output-dir to put the source files in a directory, but then
    3028you don't get to find out which are the important ones.
     29
     30
     31== Things to be aware of ==
     32
     33  * You might think that you could use the `-fvia-C -optc-g` options to force GHC to export C-source-level debugging symbols.  The Evil Mangler script that post-processes the `.s` file output by `gcc` does not understand the debug annotations added by `gcc`'s `-g` flag, and so `-optc-g` will not work.  You can, however, get GHC to output assembly-level debugging symbols by using `-opta-g`.  You'll probably also want to use the `-keep-s-files` option so that `opannotate` can get at the relevant `.s` files.
     34
     35  * Suppose that you do
     36    {{{
     37$ sudo opcontrol --setup --event=<eventname>:<count>
     38    }}}
     39    and receive an error message that "Count `<count>` for event `<eventname>` is below the minimum."  If you check the minimum value for
     40    `<eventname>` using the `--list-events` option and see that `<count>` is in fact not below the purported minimum count, then you may have passed
     41    in a non-zero value for `--callgraph` option.  When doing callgraph profiling, OProfile requires that the sample count be at least 15 times the
     42    minimum.
     43    [[BR]][[BR]]
     44    `opcontrol --status` will show you if callgraph is currently set.  To reset it, make sure the oprofile daemon is stopped and reset the callgraph
     45    value:
     46    {{{
     47$ sudo opcontrol --shutdown
     48$ sudo opcontrol --callgraph=0
     49    }}}
     50    Now you can re-run your profiling and the original `<count>` should work.
     51