From: John L. <mov...@us...> - 2007-05-22 00:26:39
|
Update of /cvsroot/oprofile/oprofile/pp In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11735/pp Modified Files: opreport.cpp opreport_options.cpp Log Message: XML callgraph patch. Index: opreport.cpp =================================================================== RCS file: /cvsroot/oprofile/oprofile/pp/opreport.cpp,v retrieving revision 1.58 retrieving revision 1.59 diff -u -p -d -r1.58 -r1.59 --- opreport.cpp 20 May 2007 17:31:43 -0000 1.58 +++ opreport.cpp 22 May 2007 00:26:27 -0000 1.59 @@ -378,7 +378,7 @@ void output_symbols(profile_container co format_output::opreport_formatter * text_out = 0; if (options::xml) { - xml_out = new format_output::xml_formatter(pc, symbols); + xml_out = new format_output::xml_formatter(&pc, symbols); xml_out->show_details(options::details); out = xml_out; // for XML always output long filenames @@ -450,21 +450,41 @@ void output_cg_symbols(callgraph_contain options::sort_by.sort(symbols, options::reverse_sort, options::long_filenames); - format_output::cg_formatter out(cg); + format_output::formatter * out; + format_output::xml_cg_formatter * xml_out = 0; + format_output::cg_formatter * text_out = 0; - out.set_nr_classes(nr_classes); - out.show_long_filenames(options::long_filenames); - out.show_header(options::show_header); - out.vma_format_64bit(output_hints & cf_64bit_vma); - out.show_global_percent(options::global_percent); + if (options::xml) { + xml_out = new format_output::xml_cg_formatter(&cg, symbols); + xml_out->show_details(options::details); + out = xml_out; + // for XML always output long filenames + out->show_long_filenames(true); + } else { + text_out = new format_output::cg_formatter(cg); + out = text_out; + out->show_long_filenames(options::long_filenames); + } + + out->set_nr_classes(nr_classes); + out->show_header(options::show_header); + out->vma_format_64bit(output_hints & cf_64bit_vma); + out->show_global_percent(options::global_percent); format_flags flags = get_format_flags(output_hints); if (multiple_apps) flags = format_flags(flags | ff_app_name); - out.add_format(flags); + out->add_format(flags); + + if (options::xml) { + xml_support = new xml_utils(xml_out, symbols, nr_classes, + &options::symbol_filter, options::archive_path); + xml_out->output(cout); + } else { + text_out->output(cout, symbols); + } - out.output(cout, symbols); } Index: opreport_options.cpp =================================================================== RCS file: /cvsroot/oprofile/oprofile/pp/opreport_options.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -u -p -d -r1.33 -r1.34 --- opreport_options.cpp 24 Nov 2006 03:39:27 -0000 1.33 +++ opreport_options.cpp 22 May 2007 00:26:27 -0000 1.34 @@ -177,11 +177,6 @@ void check_options(bool diff) } if (xml) { - if (callgraph) { - cerr << "--callgraph is incompatible with --xml" << endl; - do_exit = true; - } - if (accumulated) { cerr << "--accumulated is incompatible with --xml" << endl; do_exit = true; |