summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/oprofile/oprofile/xml_callgraph_details.patch
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-08-27 15:14:24 +0100
committerRichard Purdie <rpurdie@linux.intel.com>2010-08-27 15:29:45 +0100
commit29d6678fd546377459ef75cf54abeef5b969b5cf (patch)
tree8edd65790e37a00d01c3f203f773fe4b5012db18 /meta/recipes-kernel/oprofile/oprofile/xml_callgraph_details.patch
parentda49de6885ee1bc424e70bc02f21f6ab920efb55 (diff)
downloadpoky-29d6678fd546377459ef75cf54abeef5b969b5cf.tar.gz
Major layout change to the packages directory
Having one monolithic packages directory makes it hard to find things and is generally overwhelming. This commit splits it into several logical sections roughly based on function, recipes.txt gives more information about the classifications used. The opportunity is also used to switch from "packages" to "recipes" as used in OpenEmbedded as the term "packages" can be confusing to people and has many different meanings. Not all recipes have been classified yet, this is just a first pass at separating things out. Some packages are moved to meta-extras as they're no longer actively used or maintained. Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta/recipes-kernel/oprofile/oprofile/xml_callgraph_details.patch')
-rw-r--r--meta/recipes-kernel/oprofile/oprofile/xml_callgraph_details.patch232
1 files changed, 232 insertions, 0 deletions
diff --git a/meta/recipes-kernel/oprofile/oprofile/xml_callgraph_details.patch b/meta/recipes-kernel/oprofile/oprofile/xml_callgraph_details.patch
new file mode 100644
index 0000000000..e5ab3d916e
--- /dev/null
+++ b/meta/recipes-kernel/oprofile/oprofile/xml_callgraph_details.patch
@@ -0,0 +1,232 @@
1Work in Progress- This patch breaks output_symbol_bytes
2---
3 ChangeLog | 9 +++++++++
4 libpp/callgraph_container.cpp | 10 ++++++++--
5 libpp/callgraph_container.h | 14 ++++++++++----
6 libpp/format_output.cpp | 30 +++++++++++++++++++++++++-----
7 libpp/format_output.h | 6 +++---
8 pp/opreport.cpp | 5 +++--
9 pp/opreport_options.cpp | 4 ++--
10 7 files changed, 60 insertions(+), 18 deletions(-)
11
12Index: oprofile1/pp/opreport.cpp
13===================================================================
14--- oprofile1.orig/pp/opreport.cpp 2007-05-24 15:32:20.000000000 +0100
15+++ oprofile1/pp/opreport.cpp 2007-05-24 20:07:14.000000000 +0100
16@@ -555,10 +555,11 @@ int opreport(options::spec const & spec)
17
18 output_diff_symbols(pc1, pc2, multiple_apps);
19 } else if (options::callgraph) {
20- callgraph_container cg_container;
21+ callgraph_container cg_container(options::debug_info,
22+ options::details);
23 cg_container.populate(options::archive_path, iprofiles,
24 options::extra_found_images,
25- options::debug_info, options::threshold,
26+ options::threshold,
27 options::merge_by.lib, options::symbol_filter);
28
29 output_cg_symbols(cg_container, multiple_apps);
30Index: oprofile1/ChangeLog
31===================================================================
32--- oprofile1.orig/ChangeLog 2007-05-24 18:30:47.000000000 +0100
33+++ oprofile1/ChangeLog 2007-05-24 20:07:14.000000000 +0100
34@@ -1,5 +1,14 @@
35 2007-05-24 Richard Purdie <rpurdie@openedhand.com>
36
37+ * libpp/callgraph_container.cpp:
38+ * libpp/callgraph_container.h:
39+ * libpp/format_output.cpp:
40+ * libpp/format_output.h:
41+ * pp/opreport.cpp:
42+ * pp/opreport_options.cpp: Add callgraph XML detail support
43+
44+2007-05-24 Richard Purdie <rpurdie@openedhand.com>
45+
46 * events/arm/xscale1/events:
47 * events/arm/xscale2/events: Add extra Xscale PMU event definitions
48
49Index: oprofile1/libpp/callgraph_container.cpp
50===================================================================
51--- oprofile1.orig/libpp/callgraph_container.cpp 2007-05-24 15:32:20.000000000 +0100
52+++ oprofile1/libpp/callgraph_container.cpp 2007-05-24 20:07:14.000000000 +0100
53@@ -391,15 +391,21 @@ const symbol_collection & arc_recorder::
54 return cg_syms;
55 }
56
57+callgraph_container::callgraph_container(bool debug_info, bool need_details)
58+ :
59+ pc(debug_info, need_details),
60+ debug_info(debug_info)
61+{
62+}
63+
64
65 void callgraph_container::populate(string const & archive_path,
66 list<inverted_profile> const & iprofiles,
67- extra_images const & extra, bool debug_info, double threshold,
68+ extra_images const & extra, double threshold,
69 bool merge_lib, string_filter const & sym_filter)
70 {
71 // non callgraph samples container, we record sample at symbol level
72 // not at vma level.
73- profile_container pc(debug_info, false);
74
75 list<inverted_profile>::const_iterator it;
76 list<inverted_profile>::const_iterator const end = iprofiles.end();
77Index: oprofile1/libpp/callgraph_container.h
78===================================================================
79--- oprofile1.orig/libpp/callgraph_container.h 2007-05-24 15:32:20.000000000 +0100
80+++ oprofile1/libpp/callgraph_container.h 2007-05-24 20:07:14.000000000 +0100
81@@ -19,8 +19,8 @@
82 #include "symbol.h"
83 #include "symbol_functors.h"
84 #include "string_filter.h"
85+#include "profile_container.h"
86
87-class profile_container;
88 class inverted_profile;
89 class profile_t;
90 class extra_images;
91@@ -103,6 +103,8 @@ private:
92 */
93 class callgraph_container {
94 public:
95+ callgraph_container(bool debug_info, bool need_details);
96+
97 /**
98 * Populate the container, must be called once only.
99 * @param archive_path oparchive prefix path
100@@ -118,9 +120,8 @@ public:
101 */
102 void populate(std::string const & archive_path,
103 std::list<inverted_profile> const & iprofiles,
104- extra_images const & extra, bool debug_info,
105- double threshold, bool merge_lib,
106- string_filter const & sym_filter);
107+ extra_images const & extra, double threshold,
108+ bool merge_lib, string_filter const & sym_filter);
109
110 /// return hint on how data must be displayed.
111 column_flags output_hint() const;
112@@ -131,6 +132,9 @@ public:
113 // return all the cg symbols
114 const symbol_collection & get_symbols() const;
115
116+ // profile container callgraph is based on
117+ profile_container pc;
118+
119 private:
120 /**
121 * Record caller/callee for one cg file
122@@ -162,6 +166,8 @@ private:
123 profile_container const & pc, bool debug_info,
124 bool merge_lib);
125
126+ bool debug_info;
127+
128 /// record all main symbols
129 void add_symbols(profile_container const & pc);
130
131Index: oprofile1/pp/opreport_options.cpp
132===================================================================
133--- oprofile1.orig/pp/opreport_options.cpp 2007-05-24 15:32:20.000000000 +0100
134+++ oprofile1/pp/opreport_options.cpp 2007-05-24 20:07:14.000000000 +0100
135@@ -165,8 +165,8 @@ void check_options(bool diff)
136
137 if (callgraph) {
138 symbols = true;
139- if (details) {
140- cerr << "--callgraph is incompatible with --details" << endl;
141+ if (details && !xml) {
142+ cerr << "--callgraph is incompatible with --details without --xml" << endl;
143 do_exit = true;
144 }
145
146Index: oprofile1/libpp/format_output.cpp
147===================================================================
148--- oprofile1.orig/libpp/format_output.cpp 2007-05-24 15:32:20.000000000 +0100
149+++ oprofile1/libpp/format_output.cpp 2007-05-24 20:07:14.000000000 +0100
150@@ -594,9 +594,9 @@ xml_formatter::
151 xml_formatter(profile_container const * p,
152 symbol_collection & s)
153 :
154+ need_details(false),
155 profile(p),
156- symbols(s),
157- need_details(false)
158+ symbols(s)
159 {
160 if (profile)
161 counts.total = profile->samples_count();
162@@ -673,8 +673,8 @@ void xml_formatter::output_symbol_data(o
163 if (name.size() > 0 && name[0] != '?') {
164 output_attribute(out, datum, ff_vma, STARTING_ADDR);
165
166- if (need_details)
167- xml_support->output_symbol_bytes(bytes_out, symb, sd_it->second);
168+ //if (need_details)
169+ // xml_support->output_symbol_bytes(bytes_out, symb, sd_it->second);
170 }
171 out << close_element();
172
173@@ -843,7 +843,7 @@ output_attribute(ostream & out, field_da
174 xml_cg_formatter::
175 xml_cg_formatter(callgraph_container const * cg, symbol_collection & s)
176 :
177- xml_formatter(0, s),
178+ xml_formatter(&cg->pc, s),
179 callgraph(cg)
180 {
181 counts.total = callgraph->samples_count();
182@@ -946,6 +946,26 @@ output_symbol(ostream & out,
183
184 out << init_attr(ID_REF, indx);
185
186+ if (need_details) {
187+ ostringstream details;
188+ symbol_details_t & sd = symbol_details[indx];
189+ size_t const detail_lo = sd.index;
190+
191+ string detail_str = output_symbol_details(symb, sd.index, lo, hi);
192+
193+ if (detail_str.size() > 0) {
194+ if (sd.id < 0)
195+ sd.id = indx;
196+ details << detail_str;
197+ }
198+
199+ if (sd.index > detail_lo) {
200+ sd.details = sd.details + details.str();
201+ out << init_attr(DETAIL_LO, detail_lo);
202+ out << init_attr(DETAIL_HI, sd.index-1);
203+ }
204+ }
205+
206 out << close_element(NONE, true);
207
208 out << open_element(CALLERS);
209Index: oprofile1/libpp/format_output.h
210===================================================================
211--- oprofile1.orig/libpp/format_output.h 2007-05-24 15:32:20.000000000 +0100
212+++ oprofile1/libpp/format_output.h 2007-05-24 20:07:14.000000000 +0100
213@@ -249,6 +249,9 @@ public:
214 // output SymbolData XML elements
215 void output_symbol_data(std::ostream & out);
216
217+ /// true if we need to show details for each symbols
218+ bool need_details;
219+
220 private:
221 /// container we work from
222 profile_container const * profile;
223@@ -256,9 +259,6 @@ private:
224 // ordered collection of symbols associated with this profile
225 symbol_collection & symbols;
226
227- /// true if we need to show details for each symbols
228- bool need_details;
229-
230 // count of DetailData items output so far
231 size_t detail_count;
232