packaging: update version to 1.4.0
[platform/upstream/oprofile.git] / TODO
1 This is a list (not exhaustive) of some of the stuff to cleanup/fix.
2
3 If you're interested in hacking on any of these, please contact the list first
4 for some pointers and/or read HACKING and doc/CodingStyle.
5
6 1.0 release
7 -----------
8
9 (this is a minimal selection of stuff I think we need)
10  o Remove opcontrol and all daemon-related stuff (as it's been deprecated
11    since 0.9.8)
12  o the various open bugs
13
14 Later
15 -----
16 (Thoughts from John Levon. Some of these may no longer be valid.
17 And for opcontrol-related issues, we don't care, since oprofile 1.0
18 will no longer support opcontrol.)
19
20  o consider tagging opreport -c entries with a number like gprof
21  o --details for opreport -c, or diff??
22  o should [self] entries be ommitted if 0 ??
23  o oparchive could fix up {kern} paths with -p (what about diff between
24    archive and current though?)
25  o consider a sort option for diff %
26  o opannotate is silent about symbols missing debug info
27  o odb_insert() can fail on ftruncate or mremap() in db_manage.c but we don't
28   try to recover gracefully.
29  o output column shortname headers for opreport -l
30  o is relative_to_absolute_path guaranteeing a trailing '/' documented ?
31  o move oprofiled.log to OP_SAMPLE_DIR/current ?
32  o pp tools must handle samples count overflow (marked as (unsigned)-1)
33  o callgraph patch: better way to skip ignored backtrace ?
34  o lib-image: and image: behavior depend on --separate=, if --separate=library
35   opreport "lib-image:*libc*" --merge=lib works but not
36   opreport "image:*libc*" --merge=lib whilst the behavior is reversed if
37   --separate==none. Must we take care ?
38  o dependencies between profile_container.h symbol_container.h and
39   sample_container.h become more and more ugly, I needed to include them
40   in a specific order in some source (still true??)
41  o add event aliases for common things like icache misses, we must start to 
42   think about metrics including simple like event alias mapped to two or more
43   events and intepreted specially by user space tools like using the ratio
44   of samples; more tricky will be to select an event used as call count (no
45   cg on it) and  used to emulate the call count field in gprof. I think this is
46   a after 1.0 thing but event aliases must be specified in a way allowing such
47   extension
48  o do we need an opreport like opreport -c (showing caller/callee at binary
49   boundary not symbols) ?
50  o we can add lots more unit tests yet
51  o Itanium event constraints are not implemented
52  o GUI still has a physical-counter interface, should have a general one
53    like opcontrol --event
54  o I think we should have the ability to have *fixed* width headers, e.g. :
55
56 vma      samples  cum. samples  %           cum. %     symbol name             image name              app name
57 0804c350 64582    64582         35.0757     35.0757    odb_insert              /usr/loc...in/oprofiled /usr/local/oprofile-pp/bin/oprofiled
58
59   Note the ellipsis
60  o should we make the sighup handler re-read counter config and re-start profiling too ?
61  o improve --smart-demangle
62         o allow user to add it's own pattern in user.pat, document it.
63         o hard code ${typename} regular definition to remove all current limitations (difficult, perhaps after 1.0 ?).
64  o oprof_start dialog size is too small initially
65  o i18n. We need a good formatter, and also remember format_percent()
66  o opannotate --source --output-dir=~moz/op/ /usr/bin/oprofiled
67    will fail because the ~ is not expanded (no space around it) (popt bug I say)
68  o opannotate : I added this to the doc about difference between nr samples
69   credited to a source function and total number of samples for this function:
70    "The missing samples are not lost, they will be credited to another source
71     location where the inlined function is defined. The inlined function will
72     be credited from multiple call site and merged in one place in the
73    annotated source file so there is no way to see from what call site are
74    coming the samples for an inlined function."
75   I think we can work around this: output multiple instances of inlined
76   function like :
77   inline foo() { foo: total 1500 30.00 ...
78   ... annotated source from all call site 
79   inline foo() { foo (call site bar()): total 500 10.00
80   .. annotated source from call site bar() etc.
81   what about template..., can we do/must we do something like that
82   template <class T> eat_cpu() and do a similar things, merging and annotating
83   all instantation then annotating for each distinct instantation, this will
84   break our "keep the source line number in annotated source file identical to
85   the original source"
86  o events/mips/34k/events, some events does not make sense, they get identical
87   event number, um and counter nr so they overlap, currently commented
88  o can we find a more efficient implementation for sparse_array ?
89  o libpp/profile.cpp:is_spu_sample_file() can be simplified by using
90   read_header()
91  o while fixing #1819350 I needed to make extra_images per profile session
92    rather than a global var so I think we need to revisit find_image_path(),
93    extra_found_images, --image-path (-p).
94    Actually we can't do something ala:
95    opreport { archive:tmp1 search_path=/lib/modules/2.6.20 } { archive:tmp2 search_path=/.../2.6.20.9 }
96    because search_path is specified through -p which is not a part of the
97    profile spec. Fixing #1819350 covered all case except this one but w/o any
98    user visible change. Another way will be to save the -p option used with
99    oparchive in a file at the toplevel of the archive, use it with all tools
100    when an archive: is specified on the command line and deprecate the use of
101    -p in such case.
102  o consider to make extra_images a ref counted object, it's copied by value
103   a few time but can contain a lot of string. There is also some ugly public
104   member extra_images to fix.
105  o daemon bss size can be improved, grep for MAX_PATH to see where dynamic
106    allocation can be used, try $ nm oprofiled --size-sort too.
107
108 Documentation
109 -------------
110
111  o the docs should mention the default event for each arch somewhere
112  o more discussion of problematic code needs to go in the "interpreting" section. 
113  o document gcc 2.95 and linenr info problems especially for inline functions
114  o finish the internals manual
115
116 JIT support
117 -----------
118
119  o We need a more dynamic structure to handle entries_address_ascending and
120    entries_symbols_ascending, actually many scaling problem occur because they
121    are array, this was perfect to get a first implementation focusing on
122    handling overlap and all but the need to qsort/copy arrays at each iteration
123    is a performance killer. Some sort of AVL tree will do the job.
124  o Related to the previous, it's possible to do all processing in opjitconv.c
125    in a single left to right walk of the jitentry list.
126  o see the FIXME at parse_dump.c:parse_code_unload()
127  o Increment JITHEADER_VERSION in jitdump.h to be sure that the new code only
128    accepts dump file created by the new code.
129  o opjitconv.c:replacement_name() should be enough clever to avoid name
130    collision so we can remove the recursive call to disambiguate_symbol_names(),
131    need a hash table or some sort of associative array to check quickly if a
132    name exists, we will need some sort of avl tree so it's probably better
133    to do not implement a hash table only for this purpose.
134  o op_write_native_code() must accept one more parameter, the real code size
135    which can be zero or equal to code_size, this will allow to create elf
136    file w/o any code contents, only a symbol table and .text sections w/o
137    contents (yes ELF format allow that). For dynamic binary translation it'll
138    avoid to dump tons of code for little use, opannotate --assembly will not
139    work on such elf file but it can be a real win. It'll need to add to
140    jitrecord0 a real_size field, and some trickery when building the elf file,
141    taking care about the case we mix zero code size with non zero code size.
142    Perhaps we can use it too for java, filtering native method etc. Actually
143    we allow a simplified form of this feature by allowing to disable/enable
144    code dumping but at the whole dump level not on a symbol basis, quite
145    possible sufficient. [mpj: We're backing away from the idea of dumping
146    JIT records without code.  Since BFD asymbol type does not include symbol size,
147    the op_bfd technique for determining symbol size relies on knowing the true
148    file size; and if code is not included in the .jo file, we don't have true size.]
149  o The pipe used for triggering JIT dump conversion should be used for normal
150    dumping too.
151  o See FIXME in agents/jvmti/libjvmti_oprofile.c:
152    If enablement to get line number info would be configurable through command line,
153    what should be the default on/off?
154  o See FIXME in opjitconv/debug_line.c
155  o The way to use the pipe should be made more secure to avoid denial of service
156    attacks. We have to think about it.
157  o Callgraph does not work properly for the .jo files the JIT support creates.
158    See section Chapter 4, sect 2.3.2 "Callgraph and JIT support". Try to figure
159    out a way to correlate an anonymous sample callgraph entry with
160    the .jo file that may exist for the anonymous code.
161  o see mail from Gisle Dankel:
162    "JIT_SUPPORT: Adding support for file-backed non-ELF JIT code"
163    -> should be changed (if useful) before next release
164  o See FIXME in op_header.cpp:
165    The check for header.mtime of JIT sample files is not correct because currently
166    this mtime value is set to zero due to missing cookie setting for JIT sample files.
167    Some additional check/setting to header.mtime should be made for JIT sample files.
168  o Mono JIT support:
169
170    2007-11-08: with callgraph massi got
171    <massi> oparchive error: parse_filename() invalid filename: /var/lib/oprofile/samples/current/{root}/var/lib/oprofile/samples/current/{root}/home/massi/mono/amd64/bin/mono/{dep}/{anon:anon}/32432.0x40a26000.0x40a36000/CPU_CLK_UNHALTED.100000.0.all.all.all/{dep}/{root}/var/lib/oprofile/samples/current/{root}/home/massi/mono/amd64/bin/mono/{dep}/{anon:anon}/32432.0x40a26000.0x40a36000/CPU_CLK_UNHALTED.100000.0.all.all.all/{cg}/{root}/usr/oprofile/bin/oprofiled/CPU_CLK_
172
173    Massi added Mono JIT support, code on the stack is never unloaded and there is
174    no byte code, code is always compiled to native machine code, this mean than
175    for mono at least we can do callgraph if we can fix this samples filename
176    problem.
177
178 General checks to make
179 ----------------------
180  
181  o rgrep FIXME
182  o run Coverity
183  o valgrind (--show-reachable=yes --leak-check=yes)
184  o audit to track unnecessary include <>
185  o gcc 3.0/3.x compile
186  o Qt2/3 check, no Qt check
187  o verify builds (modversions, kernel versions, athlon etc.). I have the
188   necessary stuff to check kernel versions/configurations on PIII core (Phil)
189  o use nm and a little script to track unused function
190  o test it to hell and back
191  o compile all C++ programs with STL_port and test them (gcc 3.4 contain a
192    debug mode too but std::string iterator are not checked)
193  o There is probably place of post profile tools where looking at errno will give better error messages.
194