+---
+ libpp/callgraph_container.cpp | 22 ++-
+ libpp/callgraph_container.h | 7 -
+ libpp/format_output.cpp | 245 ++++++++++++++++++++++++++++++++++++------
+ libpp/format_output.h | 41 +++++--
+ libpp/symbol.h | 15 +-
+ libpp/symbol_sort.cpp | 17 --
+ libpp/symbol_sort.h | 6 -
+ libpp/xml_utils.cpp | 17 --
+ libutil++/xml_output.cpp | 3
+ libutil++/xml_output.h | 3
+ pp/opreport.cpp | 40 +++++-
+ pp/opreport_options.cpp | 5
+ 12 files changed, 314 insertions(+), 107 deletions(-)
+
Index: oprofile/libpp/callgraph_container.cpp
===================================================================
---- oprofile.orig/libpp/callgraph_container.cpp
-+++ oprofile/libpp/callgraph_container.cpp
+--- oprofile.orig/libpp/callgraph_container.cpp 2007-02-22 18:19:11.000000000 +0000
++++ oprofile/libpp/callgraph_container.cpp 2007-02-22 18:19:12.000000000 +0000
@@ -379,17 +379,19 @@ process(count_array_t total, double thre
process_children(sym, threshold);
}
Index: oprofile/libpp/callgraph_container.h
===================================================================
---- oprofile.orig/libpp/callgraph_container.h
-+++ oprofile/libpp/callgraph_container.h
+--- oprofile.orig/libpp/callgraph_container.h 2007-02-22 18:19:11.000000000 +0000
++++ oprofile/libpp/callgraph_container.h 2007-02-22 18:19:12.000000000 +0000
@@ -53,7 +53,7 @@ public:
count_array_t const & arc_count);
/**
Index: oprofile/libpp/format_output.cpp
===================================================================
---- oprofile.orig/libpp/format_output.cpp
-+++ oprofile/libpp/format_output.cpp
+--- oprofile.orig/libpp/format_output.cpp 2007-02-22 18:19:11.000000000 +0000
++++ oprofile/libpp/format_output.cpp 2007-02-22 18:19:12.000000000 +0000
@@ -489,7 +489,7 @@ cg_formatter::cg_formatter(callgraph_con
}
ostringstream str;
for (; it != end; ++it) {
-@@ -725,10 +742,10 @@ output_symbol_details(symbol_entry const
+@@ -725,10 +742,11 @@ output_symbol_details(symbol_entry const
void xml_formatter::
output_symbol(ostream & out,
- symbol_collection::const_iterator const it, size_t lo, size_t hi)
-+ symbol_entry const * symb, size_t lo, size_t hi)
++ symbol_entry const * symb, size_t lo, size_t hi, bool is_module)
{
- symbol_entry const * symb = *it;
ostringstream str;
-+ size_t indx;
++ // pointless reference to is_module, remove insane compiler warning
++ size_t indx = is_module ? 0 : 1;
// output symbol's summary data for each profile class
bool got_samples = false;
-@@ -750,27 +767,21 @@ output_symbol(ostream & out,
+@@ -750,27 +768,21 @@ output_symbol(ostream & out,
string const image = get_image_name(symb->image_name, true);
string const qname = image + ":" + name;
details << detail_str;
}
-@@ -826,5 +837,170 @@ output_attribute(ostream & out, field_da
+@@ -826,5 +838,176 @@ output_attribute(ostream & out, field_da
}
}
+
+void xml_cg_formatter::
+output_symbol_core(ostream & out,
-+ symbol_entry const * symb, size_t lo, size_t hi)
++ symbol_entry const * symb, size_t lo, size_t hi, bool is_module)
+{
+ cg_symbol const * cg_symb = dynamic_cast<const cg_symbol *>(symb);
+ ostringstream str;
+ if (!got_samples)
+ continue;
+
-+ out << open_element(MODULE, true);
-+ out << init_attr(NAME, module) << close_element(NONE, true);
-+
+ cverb << vxml << " <!-- symbol_ref=" << symbol_names.name(cit->name) << " -->" << endl;
+
++ if (is_module) {
++ out << open_element(MODULE, true);
++ out << init_attr(NAME, module) << close_element(NONE, true);
++ }
++
+ out << open_element(SYMBOL, true);
+
+ string const name1 = symbol_names.name(cit->name);
+
+ out << close_element(SYMBOL);
+
-+ out << close_element(MODULE);
++ if (is_module)
++ out << close_element(MODULE);
+ }
+ }
+ out << close_element(CALLERS);
+ if (!got_samples)
+ continue;
+
-+ out << open_element(MODULE, true);
-+ out << init_attr(NAME, module) << close_element(NONE, true);
-+
+ cverb << vxml << " <!-- symbol_ref=" << symbol_names.name(cit->name) << " -->" << endl;
+
++ if (is_module) {
++ out << open_element(MODULE, true);
++ out << init_attr(NAME, module) << close_element(NONE, true);
++ }
++
+ out << open_element(SYMBOL, true);
+
+ string name1 = symbol_names.name(cit->name);
+
+ out << close_element(SYMBOL);
+
-+ out << close_element(MODULE);
++ if (is_module)
++ out << close_element(MODULE);
+ }
+ }
+ out << close_element(CALLEES);
+
+void xml_cg_formatter::
+output_symbol(ostream & out,
-+ symbol_entry const * symb, size_t lo, size_t hi)
++ symbol_entry const * symb, size_t lo, size_t hi, bool is_module)
+{
-+ output_symbol_core(out, symb, lo, hi);
++ output_symbol_core(out, symb, lo, hi, is_module);
+}
} // namespace format_output
Index: oprofile/libpp/format_output.h
===================================================================
---- oprofile.orig/libpp/format_output.h
-+++ oprofile/libpp/format_output.h
+--- oprofile.orig/libpp/format_output.h 2007-02-22 18:19:11.000000000 +0000
++++ oprofile/libpp/format_output.h 2007-02-22 18:19:12.000000000 +0000
@@ -201,7 +201,7 @@ public:
/** output callgraph information according to the previously format
symbol_collection & symbols);
// output body of XML output
-@@ -235,9 +235,8 @@ public:
+@@ -235,9 +235,9 @@ public:
/** output one symbol symb to out according to the output format
* specifier previously set by call(s) to add_format() */
- symbol_collection::const_iterator const it,
- size_t lo, size_t hi);
+ virtual void output_symbol(std::ostream & out,
-+ symbol_entry const * symb, size_t lo, size_t hi);
++ symbol_entry const * symb, size_t lo, size_t hi,
++ bool is_module);
/// output details for the symbol
std::string output_symbol_details(symbol_entry const * symb,
-@@ -246,9 +245,12 @@ public:
+@@ -246,9 +246,12 @@ public:
/// set the output_details boolean
void show_details(bool);
// ordered collection of symbols associated with this profile
symbol_collection & symbols;
-@@ -256,9 +258,6 @@ private:
+@@ -256,9 +259,6 @@ private:
/// true if we need to show details for each symbols
bool need_details;
// count of DetailData items output so far
size_t detail_count;
-@@ -270,6 +269,28 @@ private:
+@@ -270,6 +270,29 @@ private:
format_flags fl, tag_t tag);
};
+ /** output one symbol symb to out according to the output format
+ * specifier previously set by call(s) to add_format() */
+ virtual void output_symbol(std::ostream & out,
-+ symbol_entry const * symb, size_t lo, size_t hi);
++ symbol_entry const * symb, size_t lo, size_t hi, bool is_module);
+
+private:
+ /// container we work from
+ callgraph_container const * callgraph;
+
+ void output_symbol_core(std::ostream & out,
-+ symbol_entry const * symb, size_t lo, size_t hi);
++ symbol_entry const * symb, size_t lo, size_t hi,
++ bool is_module);
+};
} // namespace format_output
Index: oprofile/libpp/symbol.h
===================================================================
---- oprofile.orig/libpp/symbol.h
-+++ oprofile/libpp/symbol.h
+--- oprofile.orig/libpp/symbol.h 2007-02-22 18:19:11.000000000 +0000
++++ oprofile/libpp/symbol.h 2007-02-22 18:19:12.000000000 +0000
@@ -55,8 +55,11 @@ struct sample_entry {
+/// a collection of sorted callgraph symbols (the objects themselves)
+typedef std::vector<cg_symbol> cg_collection_objs;
-+
-/// a collection of sorted callgraph symbols
-typedef std::vector<cg_symbol> cg_collection;
++
+/// a collection of sorted callgraph symbols (pointers too, compatible with symbol_collection)
+//typedef std::vector<cg_symbol const *> cg_collection;
/// for storing diff %ages
Index: oprofile/libpp/symbol_sort.cpp
===================================================================
---- oprofile.orig/libpp/symbol_sort.cpp
-+++ oprofile/libpp/symbol_sort.cpp
+--- oprofile.orig/libpp/symbol_sort.cpp 2007-02-22 18:19:11.000000000 +0000
++++ oprofile/libpp/symbol_sort.cpp 2007-02-22 18:19:12.000000000 +0000
@@ -146,23 +146,6 @@ sort(symbol_collection & syms, bool reve
long_filenames = lf;
Index: oprofile/libpp/symbol_sort.h
===================================================================
---- oprofile.orig/libpp/symbol_sort.h
-+++ oprofile/libpp/symbol_sort.h
+--- oprofile.orig/libpp/symbol_sort.h 2007-02-22 18:19:11.000000000 +0000
++++ oprofile/libpp/symbol_sort.h 2007-02-22 18:19:12.000000000 +0000
@@ -44,12 +44,6 @@ struct sort_options {
/**
* Sort the given container by the given criteria.
Index: oprofile/libpp/xml_utils.cpp
===================================================================
---- oprofile.orig/libpp/xml_utils.cpp
-+++ oprofile/libpp/xml_utils.cpp
-@@ -257,13 +257,6 @@ void xml_utils::output_xml_header(string
+--- oprofile.orig/libpp/xml_utils.cpp 2007-02-22 18:19:12.000000000 +0000
++++ oprofile/libpp/xml_utils.cpp 2007-02-22 18:24:58.000000000 +0000
+@@ -268,13 +268,6 @@ void xml_utils::output_xml_header(string
cout << close_element(SETUP) << endl;
}
class subclass_info_t {
public:
string unitmask;
-@@ -589,7 +582,7 @@ void module_info::output_summary(ostream
- void module_info::output_symbols(ostream & out)
+@@ -443,7 +436,7 @@ public:
+ bool is_closed(string const & n);
+ protected:
+ void output_summary(ostream & out);
+- void output_symbols(ostream & out);
++ void output_symbols(ostream & out, bool is_module);
+
+ string name;
+ sym_iterator begin;
+@@ -593,7 +586,7 @@ void module_info::output(ostream & out)
+ out << open_element(MODULE, true);
+ out << init_attr(NAME, name) << close_element(NONE, true);
+ output_summary(out);
+- output_symbols(out);
++ output_symbols(out, true);
+ out << close_element(MODULE);
+ }
+
+@@ -605,13 +598,13 @@ void module_info::output_summary(ostream
+ }
+
+
+-void module_info::output_symbols(ostream & out)
++void module_info::output_symbols(ostream & out, bool is_module)
{
+ if (begin == (sym_iterator)0)
+ return;
+
for (sym_iterator it = begin; it != end; ++it)
- xml_out->output_symbol(out, it, lo, hi);
-+ xml_out->output_symbol(out, *it, lo, hi);
++ xml_out->output_symbol(out, *it, lo, hi, is_module);
}
+@@ -791,7 +784,7 @@ void binary_info::output(ostream & out)
+ out << init_attr(NAME, name) << close_element(NONE, true);
+
+ output_summary(out);
+- output_symbols(out);
++ output_symbols(out, false);
+ for (size_t a = 0; a < nr_modules; ++a)
+ my_modules[a].output(out);
+
Index: oprofile/libutil++/xml_output.cpp
===================================================================
---- oprofile.orig/libutil++/xml_output.cpp
-+++ oprofile/libutil++/xml_output.cpp
+--- oprofile.orig/libutil++/xml_output.cpp 2007-02-22 18:19:11.000000000 +0000
++++ oprofile/libutil++/xml_output.cpp 2007-02-22 18:19:12.000000000 +0000
@@ -47,8 +47,11 @@ string const xml_tag_map[] = {
"binary",
"module",
"symboltable",
Index: oprofile/libutil++/xml_output.h
===================================================================
---- oprofile.orig/libutil++/xml_output.h
-+++ oprofile/libutil++/xml_output.h
+--- oprofile.orig/libutil++/xml_output.h 2007-02-22 18:19:11.000000000 +0000
++++ oprofile/libutil++/xml_output.h 2007-02-22 18:19:12.000000000 +0000
@@ -28,7 +28,8 @@ typedef enum {
THREAD, THREAD_ID,
BINARY,
SOURCE_FILE, SOURCE_LINE, CODE_LENGTH,
Index: oprofile/pp/opreport.cpp
===================================================================
---- oprofile.orig/pp/opreport.cpp
-+++ oprofile/pp/opreport.cpp
+--- oprofile.orig/pp/opreport.cpp 2007-02-22 18:19:11.000000000 +0000
++++ oprofile/pp/opreport.cpp 2007-02-22 18:19:12.000000000 +0000
@@ -378,7 +378,7 @@ void output_symbols(profile_container co
format_output::opreport_formatter * text_out = 0;
Index: oprofile/pp/opreport_options.cpp
===================================================================
---- oprofile.orig/pp/opreport_options.cpp
-+++ oprofile/pp/opreport_options.cpp
+--- oprofile.orig/pp/opreport_options.cpp 2007-02-22 18:19:11.000000000 +0000
++++ oprofile/pp/opreport_options.cpp 2007-02-22 18:19:12.000000000 +0000
@@ -177,11 +177,6 @@ void check_options(bool diff)
}