]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/oprofile/oprofile-0.9/arm_offsetfix.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / oprofile / oprofile-0.9 / arm_offsetfix.patch
1 Index: oprofile/libpp/profile.cpp
2 ===================================================================
3 --- oprofile.orig/libpp/profile.cpp     2005-05-02 16:07:03.000000000 +0100
4 +++ oprofile/libpp/profile.cpp  2005-06-13 14:28:22.000000000 +0100
5 @@ -127,6 +127,11 @@
6         // if the image contains no symbol the vma range is [0 - filesize]
7         // in this case we can't substract start_offset else we will underflow
8         // and the iterator range will be empty.
9 +       
10 +       if (start < start_offset)
11 +               return make_pair(const_iterator(ordered_samples.end(), 0), 
12 +                       const_iterator(ordered_samples.end(), 0));
13 +       
14         if (start)
15                 start -= start_offset;
16  
17 Index: oprofile/libpp/callgraph_container.cpp
18 ===================================================================
19 --- oprofile.orig/libpp/callgraph_container.cpp 2005-05-02 16:07:02.000000000 +0100
20 +++ oprofile/libpp/callgraph_container.cpp      2005-06-13 14:27:57.000000000 +0100
21 @@ -139,21 +139,24 @@
22                 unsigned long end;
23                 b.get_symbol_range(i, start, end);
24  
25 -               profile_t::iterator_pair p_it = profile.samples_range(
26 -                       caller_to_key(start - boffset),
27 -                       caller_to_key(end - boffset));
28 -
29 -               // Our odb_key_t contain (from_eip << 32 | to_eip), the range
30 -               // of key we selected above contain one caller but different
31 -               // callee and due to the ordering callee offsets are not
32 -               // consecutive so we must sort them first.
33 -
34 -               samples.clear();
35 -
36 -               for (; p_it.first != p_it.second; ++p_it.first) {
37 -                       samples.push_back(make_pair(p_it.first.vma(),
38 -                               p_it.first.count()));
39 -               }
40 +               if (start > boffset) {
41 +                       profile_t::iterator_pair p_it = profile.samples_range(
42 +                               caller_to_key(start - boffset),
43 +                               caller_to_key(end - boffset));
44 +
45 +                       // Our odb_key_t contain (from_eip << 32 | to_eip), the range
46 +                       // of key we selected above contain one caller but different
47 +                       // callee and due to the ordering callee offsets are not
48 +                       // consecutive so we must sort them first.
49 +
50 +                       samples.clear();
51 +
52 +                       for (; p_it.first != p_it.second; ++p_it.first) {
53 +                               samples.push_back(make_pair(p_it.first.vma(),
54 +                                       p_it.first.count()));
55 +                       }
56 +               } else
57 +                       samples.clear();
58  
59                 sort(samples.begin(), samples.end(), compare_by_callee_vma);
60