aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Dodd <mdodd@google.com>2010-11-17 11:12:26 -0800
committerMike Dodd <mdodd@google.com>2010-11-17 13:38:54 -0800
commit8cfa702f803c5ef6a2b062a489a1b2cf66b45b5e (patch)
tree9e688c406914b1368096e2ac7b141509728324f9
parent8a572b129c9755959b4421970947aeda4119c3b7 (diff)
downloadoprofile-8cfa702f803c5ef6a2b062a489a1b2cf66b45b5e.tar.gz
Copy in the rest of the oprofile 0.9.6 tree so we have a source copy to match the prebuilt binaries that are checked into external/. Change-Id: Iaac327571d5d583594a4194973bf256569061048
-rw-r--r--COPYING340
-rw-r--r--ChangeLog401
-rw-r--r--ChangeLog-20012327
-rw-r--r--ChangeLog-20024416
-rw-r--r--ChangeLog-20036251
-rw-r--r--ChangeLog-20041034
-rw-r--r--ChangeLog-2005963
-rw-r--r--ChangeLog-2006296
-rw-r--r--ChangeLog-2007757
-rw-r--r--ChangeLog-2008451
-rw-r--r--Makefile.am107
-rw-r--r--Makefile.in787
-rw-r--r--README46
-rw-r--r--README_PACKAGERS79
-rw-r--r--TODO268
-rw-r--r--aclocal.m47257
-rw-r--r--agents/Makefile.am30
-rw-r--r--agents/Makefile.in546
-rw-r--r--agents/jvmpi/Makefile.am12
-rw-r--r--agents/jvmpi/Makefile.in521
-rw-r--r--agents/jvmpi/jvmpi_oprofile.cpp239
-rw-r--r--agents/jvmti/Makefile.am14
-rw-r--r--agents/jvmti/Makefile.in522
-rw-r--r--agents/jvmti/libjvmti_oprofile.c326
-rwxr-xr-xautogen.sh42
-rwxr-xr-xcompile142
-rwxr-xr-xconfig.guess1526
-rw-r--r--config.h.in104
-rwxr-xr-xconfig.sub1658
-rwxr-xr-xconfigure27289
-rw-r--r--configure.in293
-rw-r--r--daemon/Makefile.am58
-rw-r--r--daemon/Makefile.in686
-rw-r--r--daemon/liblegacy/Makefile.am28
-rw-r--r--daemon/liblegacy/Makefile.in510
-rw-r--r--daemon/liblegacy/init.c387
-rw-r--r--daemon/liblegacy/opd_24_stats.c62
-rw-r--r--daemon/liblegacy/opd_24_stats.h39
-rw-r--r--daemon/liblegacy/opd_image.c264
-rw-r--r--daemon/liblegacy/opd_image.h111
-rw-r--r--daemon/liblegacy/opd_kernel.c464
-rw-r--r--daemon/liblegacy/opd_kernel.h67
-rw-r--r--daemon/liblegacy/opd_mapping.c170
-rw-r--r--daemon/liblegacy/opd_mapping.h111
-rw-r--r--daemon/liblegacy/opd_parse_proc.c223
-rw-r--r--daemon/liblegacy/opd_parse_proc.h23
-rw-r--r--daemon/liblegacy/opd_proc.c432
-rw-r--r--daemon/liblegacy/opd_proc.h151
-rw-r--r--daemon/liblegacy/opd_sample_files.c179
-rw-r--r--daemon/liblegacy/opd_sample_files.h63
-rw-r--r--daemon/liblegacy/p_module.h207
-rwxr-xr-xdepcomp530
-rw-r--r--doc/Makefile.am92
-rw-r--r--doc/Makefile.in555
-rw-r--r--doc/buffers.pngbin0 -> 34679 bytes
-rw-r--r--doc/internals.html2009
-rw-r--r--doc/internals.xml1194
-rw-r--r--doc/op-jit-devel.html455
-rw-r--r--doc/op-jit-devel.xml319
-rw-r--r--doc/opannotate.1.in119
-rw-r--r--doc/oparchive.1.in76
-rw-r--r--doc/opcontrol.1.in177
-rw-r--r--doc/opgprof.1.in67
-rw-r--r--doc/ophelp.1.in58
-rw-r--r--doc/opimport.1.in59
-rw-r--r--doc/opreport.1.in140
-rw-r--r--doc/opreport.xsd279
-rw-r--r--doc/oprofile.1193
-rw-r--r--doc/oprofile.1.in193
-rw-r--r--doc/oprofile.html5373
-rw-r--r--doc/oprofile.xml2942
-rw-r--r--doc/srcdoc/Doxyfile.in184
-rw-r--r--doc/srcdoc/Makefile9
-rw-r--r--doc/xsl/catalog-1.xml.in16
-rw-r--r--doc/xsl/xhtml-chunk.xsl52
-rw-r--r--doc/xsl/xhtml-common.xsl55
-rw-r--r--doc/xsl/xhtml.xsl13
-rw-r--r--events/Makefile.am83
-rw-r--r--events/Makefile.in450
-rw-r--r--events/arm/armv6/events23
-rw-r--r--events/arm/armv6/unit_masks4
-rw-r--r--events/arm/armv7/events53
-rw-r--r--events/arm/armv7/unit_masks4
-rw-r--r--events/arm/mpcore/events28
-rw-r--r--events/arm/mpcore/unit_masks4
-rw-r--r--events/arm/xscale1/events23
-rw-r--r--events/arm/xscale1/unit_masks4
-rw-r--r--events/arm/xscale2/events23
-rw-r--r--events/arm/xscale2/unit_masks4
-rw-r--r--gui/Makefile.am43
-rw-r--r--gui/Makefile.in669
-rw-r--r--gui/oprof_start.cpp1071
-rw-r--r--gui/oprof_start.h164
-rw-r--r--gui/oprof_start_config.cpp112
-rw-r--r--gui/oprof_start_config.h56
-rw-r--r--gui/oprof_start_main.cpp27
-rw-r--r--gui/oprof_start_util.cpp331
-rw-r--r--gui/oprof_start_util.h39
-rw-r--r--gui/ui/Makefile.am24
-rw-r--r--gui/ui/Makefile.in493
-rw-r--r--gui/ui/oprof_start.base.ui1190
-rw-r--r--include/sstream343
-rwxr-xr-xinstall-sh323
-rw-r--r--libabi/Makefile.am24
-rw-r--r--libabi/Makefile.in677
-rw-r--r--libabi/tests/Makefile.am21
-rw-r--r--libabi/tests/Makefile.in492
-rw-r--r--libabi/tests/abi_test.cpp96
-rw-r--r--libdb/Makefile.am18
-rw-r--r--libdb/Makefile.in603
-rw-r--r--libdb/tests/Makefile.am15
-rw-r--r--libdb/tests/Makefile.in556
-rw-r--r--libdb/tests/db_test.c187
-rw-r--r--libop/Makefile.am29
-rw-r--r--libop/Makefile.in623
-rw-r--r--libop/tests/Makefile.am33
-rw-r--r--libop/tests/Makefile.in601
-rw-r--r--libop/tests/alloc_counter_tests.c219
-rw-r--r--libop/tests/cpu_type_tests.c79
-rw-r--r--libop/tests/load_events_files_tests.c31
-rw-r--r--libop/tests/mangle_tests.c67
-rw-r--r--libop/tests/parse_event_tests.c59
-rw-r--r--libopagent/Makefile.am25
-rw-r--r--libopagent/Makefile.in556
-rw-r--r--libopagent/jitdump.h101
-rw-r--r--libopagent/opagent.c389
-rw-r--r--libopagent/opagent.h145
-rw-r--r--libopagent/opagent_symbols.ver14
-rw-r--r--libopt++/Makefile.am5
-rw-r--r--libopt++/Makefile.in484
-rw-r--r--libopt++/popt_options.cpp327
-rw-r--r--libopt++/popt_options.h123
-rw-r--r--libpp/Makefile.am57
-rw-r--r--libpp/Makefile.in565
-rw-r--r--libpp/arrange_profiles.cpp868
-rw-r--r--libpp/arrange_profiles.h246
-rw-r--r--libpp/callgraph_container.cpp606
-rw-r--r--libpp/callgraph_container.h171
-rw-r--r--libpp/diff_container.cpp159
-rw-r--r--libpp/diff_container.h50
-rw-r--r--libpp/filename_spec.cpp81
-rw-r--r--libpp/filename_spec.h84
-rw-r--r--libpp/format_flags.h69
-rw-r--r--libpp/format_output.cpp1049
-rw-r--r--libpp/format_output.h324
-rw-r--r--libpp/image_errors.cpp87
-rw-r--r--libpp/image_errors.h43
-rw-r--r--libpp/locate_images.cpp225
-rw-r--r--libpp/locate_images.h107
-rw-r--r--libpp/name_storage.cpp102
-rw-r--r--libpp/name_storage.h159
-rw-r--r--libpp/op_header.cpp264
-rw-r--r--libpp/op_header.h56
-rw-r--r--libpp/parse_filename.cpp245
-rw-r--r--libpp/parse_filename.h65
-rw-r--r--libpp/populate.cpp110
-rw-r--r--libpp/populate.h25
-rw-r--r--libpp/populate_for_spu.cpp166
-rw-r--r--libpp/populate_for_spu.h42
-rw-r--r--libpp/profile.cpp187
-rw-r--r--libpp/profile.h187
-rw-r--r--libpp/profile_container.cpp333
-rw-r--r--libpp/profile_container.h188
-rw-r--r--libpp/profile_spec.cpp576
-rw-r--r--libpp/profile_spec.h143
-rw-r--r--libpp/sample_container.cpp141
-rw-r--r--libpp/sample_container.h77
-rw-r--r--libpp/symbol.cpp49
-rw-r--r--libpp/symbol.h148
-rw-r--r--libpp/symbol_container.cpp124
-rw-r--r--libpp/symbol_container.h94
-rw-r--r--libpp/symbol_functors.cpp30
-rw-r--r--libpp/symbol_functors.h38
-rw-r--r--libpp/symbol_sort.cpp190
-rw-r--r--libpp/symbol_sort.h53
-rw-r--r--libpp/xml_utils.cpp1038
-rw-r--r--libpp/xml_utils.h65
-rw-r--r--libregex/Makefile.am17
-rw-r--r--libregex/Makefile.in641
-rw-r--r--libregex/demangle_java_symbol.cpp238
-rw-r--r--libregex/demangle_java_symbol.h19
-rw-r--r--libregex/demangle_symbol.cpp70
-rw-r--r--libregex/demangle_symbol.h40
-rw-r--r--libregex/op_regex.cpp309
-rw-r--r--libregex/op_regex.h130
-rw-r--r--libregex/stl.pat.in160
-rw-r--r--libregex/tests/Makefile.am21
-rw-r--r--libregex/tests/Makefile.in574
-rw-r--r--libregex/tests/java_test.cpp65
-rw-r--r--libregex/tests/mangled-name.in453
-rw-r--r--libregex/tests/regex_test.cpp94
-rw-r--r--libutil++/Makefile.am44
-rw-r--r--libutil++/Makefile.in653
-rw-r--r--libutil++/bfd_spu_support.cpp116
-rw-r--r--libutil++/bfd_support.cpp637
-rw-r--r--libutil++/bfd_support.h156
-rw-r--r--libutil++/cached_value.h52
-rw-r--r--libutil++/child_reader.cpp276
-rw-r--r--libutil++/child_reader.h111
-rw-r--r--libutil++/comma_list.h102
-rw-r--r--libutil++/cverb.cpp123
-rw-r--r--libutil++/cverb.h83
-rw-r--r--libutil++/file_manip.cpp181
-rw-r--r--libutil++/file_manip.h89
-rw-r--r--libutil++/generic_spec.h97
-rw-r--r--libutil++/glob_filter.cpp39
-rw-r--r--libutil++/glob_filter.h57
-rw-r--r--libutil++/growable_vector.h105
-rw-r--r--libutil++/op_bfd.cpp472
-rw-r--r--libutil++/op_bfd.h305
-rw-r--r--libutil++/op_exception.cpp55
-rw-r--r--libutil++/op_exception.h60
-rw-r--r--libutil++/op_spu_bfd.cpp185
-rw-r--r--libutil++/path_filter.cpp68
-rw-r--r--libutil++/path_filter.h48
-rw-r--r--libutil++/sparse_array.h100
-rw-r--r--libutil++/stream_util.cpp31
-rw-r--r--libutil++/stream_util.h39
-rw-r--r--libutil++/string_filter.cpp49
-rw-r--r--libutil++/string_filter.h55
-rw-r--r--libutil++/string_manip.cpp148
-rw-r--r--libutil++/string_manip.h107
-rw-r--r--libutil++/tests/Makefile.am49
-rw-r--r--libutil++/tests/Makefile.in632
-rw-r--r--libutil++/tests/cached_value_tests.cpp80
-rw-r--r--libutil++/tests/comma_list_tests.cpp70
-rw-r--r--libutil++/tests/file_manip_tests.cpp241
-rw-r--r--libutil++/tests/glob_filter_tests.cpp53
-rw-r--r--libutil++/tests/path_filter_tests.cpp78
-rw-r--r--libutil++/tests/string_filter_tests.cpp90
-rw-r--r--libutil++/tests/string_manip_tests.cpp325
-rw-r--r--libutil++/tests/utility_tests.cpp118
-rw-r--r--libutil++/unique_storage.h110
-rw-r--r--libutil++/utility.h102
-rw-r--r--libutil++/xml_output.cpp82
-rw-r--r--libutil++/xml_output.h22
-rw-r--r--libutil/Makefile.am31
-rw-r--r--libutil/Makefile.in627
-rw-r--r--libutil/op_cpufreq.c5
-rw-r--r--libutil/tests/Makefile.am15
-rw-r--r--libutil/tests/Makefile.in563
-rw-r--r--libutil/tests/file_tests.c69
-rw-r--r--libutil/tests/string_tests.c91
-rw-r--r--ltmain.sh6956
-rw-r--r--m4/Makefile.am21
-rw-r--r--m4/Makefile.in387
-rw-r--r--m4/binutils.m453
-rw-r--r--m4/builtinexpect.m415
-rw-r--r--m4/cellspubfdsupport.m452
-rw-r--r--m4/compileroption.m426
-rw-r--r--m4/configmodule.m480
-rw-r--r--m4/copyifchange.m413
-rw-r--r--m4/docbook.m453
-rw-r--r--m4/extradirs.m436
-rw-r--r--m4/findkernel.m427
-rw-r--r--m4/kerneloption.m413
-rw-r--r--m4/kernelversion.m416
-rw-r--r--m4/mallocattribute.m412
-rw-r--r--m4/poptconst.m416
-rw-r--r--m4/precompiledheader.m415
-rw-r--r--m4/qt.m4217
-rw-r--r--m4/resultyn.m46
-rw-r--r--m4/sstream.m49
-rw-r--r--m4/typedef.m446
-rwxr-xr-xmissing360
-rw-r--r--module/Makefile.in22
-rw-r--r--module/compat.c63
-rw-r--r--module/compat.h70
-rw-r--r--module/compat22.h153
-rw-r--r--module/compat24.h61
-rw-r--r--module/ia64/IA64entry.h79
-rw-r--r--module/ia64/IA64minstate.h280
-rw-r--r--module/ia64/IA64syscallstub.h197
-rw-r--r--module/ia64/Makefile.in30
-rw-r--r--module/ia64/cpu_type.c34
-rw-r--r--module/ia64/op_ia64_model.h32
-rw-r--r--module/ia64/op_pmu.c661
-rw-r--r--module/ia64/op_syscalls.c383
-rw-r--r--module/ia64/oprofile_stubs.S140
-rw-r--r--module/op_cache.h57
-rw-r--r--module/op_dcache.h87
-rw-r--r--module/op_dname.c227
-rw-r--r--module/op_init.c33
-rw-r--r--module/op_util.c103
-rw-r--r--module/op_util.h21
-rw-r--r--module/oprofile.c880
-rw-r--r--module/oprofile.h161
-rw-r--r--module/x86/Makefile.in28
-rw-r--r--module/x86/apic_compat.h80
-rw-r--r--module/x86/cpu_type.c192
-rw-r--r--module/x86/op_apic.c239
-rw-r--r--module/x86/op_apic.h71
-rw-r--r--module/x86/op_arch.h24
-rw-r--r--module/x86/op_fixmap.c200
-rw-r--r--module/x86/op_model_athlon.c139
-rw-r--r--module/x86/op_model_p4.c727
-rw-r--r--module/x86/op_model_ppro.c123
-rw-r--r--module/x86/op_msr.h337
-rw-r--r--module/x86/op_nmi.c376
-rw-r--r--module/x86/op_rtc.c194
-rw-r--r--module/x86/op_syscalls.c352
-rw-r--r--module/x86/op_x86_model.h52
-rw-r--r--module/x86/oprofile_nmi.S63
-rw-r--r--opjitconv/Makefile.am20
-rw-r--r--opjitconv/Makefile.in522
-rw-r--r--opjitconv/conversion.c92
-rw-r--r--opjitconv/create_bfd.c272
-rw-r--r--opjitconv/debug_line.c526
-rw-r--r--opjitconv/jitsymbol.c555
-rw-r--r--opjitconv/opjitconv.c641
-rw-r--r--opjitconv/opjitconv.h140
-rw-r--r--opjitconv/parse_dump.c247
-rw-r--r--pp/Makefile.am45
-rw-r--r--pp/Makefile.in584
-rw-r--r--pp/common_option.cpp292
-rw-r--r--pp/common_option.h72
-rw-r--r--pp/opannotate.cpp858
-rw-r--r--pp/opannotate_options.cpp153
-rw-r--r--pp/opannotate_options.h47
-rw-r--r--pp/oparchive.cpp237
-rw-r--r--pp/oparchive_options.cpp119
-rw-r--r--pp/oparchive_options.h39
-rw-r--r--pp/opgprof.cpp322
-rw-r--r--pp/opgprof_options.cpp124
-rw-r--r--pp/opgprof_options.h36
-rw-r--r--pp/opreport.cpp591
-rw-r--r--pp/opreport_options.cpp335
-rw-r--r--pp/opreport_options.h58
-rw-r--r--utils/Makefile.am10
-rw-r--r--utils/Makefile.in529
-rw-r--r--utils/opcontrol2020
-rw-r--r--utils/ophelp.c678
332 files changed, 136797 insertions, 5 deletions
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..d60c31a
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..202f3cb
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,401 @@
+2009-11-24 Maynard Johnson <maynardj@us.ibm.com>
+
+ * configure.in: bump version in AM_INIT_AUTOMAKE to 0.9.6
+
+2009-10-29 William Cohen <wcohen@redhat.com>
+
+ * daemon/opd_perfmon.c: Fix start-daemon problem on ia64
+
+2009-10-29 Maynard Johnson <maynardj@us.ibm.com>
+
+ * events/ppc64/power7/events:
+ * events/ppc64/power7/event_mappings: Updates to POWER7 events and
+ groups
+
+2009-10-28 Maynard Johnson <maynardj@us.ibm.com>
+
+ * doc/opreport.xsd: Fix up schema and bump version to match 2009-06-18 fix;
+ other schema fixups for correctness and to facilitate XML document-to-schema
+ validation works
+ * libpp/xml_utils.cpp: bump schema version
+ * libpp/format_output.cpp:
+ * libpp/format_output.h: Fix regression in XML callgraph output
+ caused by 2009-06-18 fix
+
+2009-10-26 Robert Richter <robert.richter@amd.com>
+
+ * doc/oprofile.1.in: fix user-space daemon logfile in man page
+
+2009-10-26 Maynard Johnson <maynardj@us.ibm.com>
+
+ * libutil++/bfd_support.cpp:
+ * libutil++/bfd_support.h: Fix regression in handling separate
+ debuginfo files
+
+2009-10-23 Robert Richter <robert.richter@amd.com>
+
+ * autogen.sh: create copies with libtoolize instead of symlinks
+
+2009-10-23 Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
+
+ * events/x86-64/family10/events:
+ * events/x86-64/family10/unit_masks: Update events and unitmasks
+ from publication 31116 revision 3.34 and fixes
+
+2009-10-23 Maynard Johnson <maynardj@us.ibm.com>
+
+ * README_PACKAGERS: Add mention of new opjitconv binary
+
+2009-10-14 Maynard Johnson <maynardj@us.ibm.com>
+
+ * agents/jvmpi/jvmpi_oprofile.cpp: Add extra #includes since new
+ libstdc++ header files do not include standard C header files
+
+2009-10-13 Maynard Johnson <maynardj@us.ibm.com>
+
+ * utils/opcontrol: Remove incorrect redundant invocation of
+ get_image_range
+
+2009-10-09 Robert Richter <robert.richter@amd.com>
+
+ * libop/op_xml_events.c:
+ * libop/op_xml_out.c:
+ * libop/op_xml_out.h:
+ * libutil++/xml_output.cpp: fix buffer overflows in xml generator
+
+2009-09-14 Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
+
+ * utils/opcontrol: Fix timer mode
+
+2009-09-08 Robert Richter <robert.richter@amd.com>
+
+ * utils/opcontrol: fix deinit; kill daemon only if running to prevent
+ unnecessary "Daemon not running" message
+
+2009-09-08 Robert Richter <robert.richter@amd.com>
+
+ * utils/opcontrol: fix help message
+
+2009-09-04 Robert Richter <robert.richter@amd.com>
+
+ * utils/opcontrol: Do stop only if enabled
+
+2009-08-20 Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
+
+ * libop/op_xml_events.c:
+ * libop/op_xml_out.h:
+ * libop/op_xml_out.c: Fix ophelp -X output for IBS events
+ * utils/ophelp.c: Fix ophelp output for "counter:cpuid" and
+ "ext:xxx" case.
+
+2009-07-31 Maynard Johnson <maynardj@us.ibm.com>
+
+ * configure.in: bump version in AM_INIT_AUTOMAKE to 0.9.6cvs
+
+2009-07-31 Maynard Johnson <maynardj@us.ibm.com>
+
+ * configure.in: bump version in AM_INIT_AUTOMAKE to 0.9.5
+
+2009-07-31 Andi Kleen <ak@linux.intel.com>
+
+ * events/i386/nehalem/events: Fix name of event 0xa7
+
+2009-07-20 Jeffrey Yasskin <jyasskin@google.com>
+
+ * libutil++/bfd_support.h(find_nearest_line):
+ * libutil++/bfd_support.cpp(find_nearest_line):
+ * libutil++/op_bfd.h(op_bfd::get_linenr):
+ * libutil++/op_bfd.cpp(op_bfd::get_linenr): Change the type of offset
+ from unsigned int to bfd_vma to accommodate addresses above 4G
+
+2009-07-17 Maynard Johnson <maynardj@us.ibm.com>
+
+ * libutil++/bfd_support.cpp: Fix logic error from previous
+ patch to this file
+
+2009-07-14 Maynard Johnson <maynardj@us.ibm.com>
+
+ * Makefile.am: Add ChangeLog-2008 to EXTRA_DIST
+
+2009-07-10 Maynard Johnson <maynardj@us.ibm.com>
+
+ * libpp/profile_spec.cpp:
+ * pp/oparchive.cpp:
+ * utils/opcontrol: Handle bad samples from kernel due to overflows
+
+2009-06-29 Maynard Johnson <maynardj@us.ibm.com>
+
+ * events/ppc64/power7/events:
+ * events/ppc64/power7/event_mappings: Update to IBM POWER7 events
+ and groups
+
+2009-06-23 Maynard Johnson <maynardj@us.ibm.com>
+
+ * libutil++/bfd_support.cpp: Discard symbols from sections that do
+ not have SEC_LOAD flag set; this prevents issues with bogus symbol
+ size computation, resulting in "samples_range(): start > end" message
+
+2009-06-23 Maynard Johnson <maynardj@us.ibm.com>
+
+ * libpp/profile_spec.cpp:
+ * pp/common_option.cpp: Fix image-path option to be appended
+ to archive path
+
+2009-06-18 Maynard Johnson <maynardj@us.ibm.com>
+
+ * libpp/format_output.h:
+ * libpp/format_output.cpp: Make sure that all callgraph symbols are
+ reported, even if 0 samples
+
+2009-06-05 William Cohen <wcohen@redhat.com>
+
+ * libutil++/bfd_support.cpp: Avoid calling bfd_find_nearest_line
+ with NULL syms argument
+
+2009-06-05 Andi Kleen <ak@linux.intel.com>
+
+ * libop/op_events.h: (find_event_by_name):
+ * libop/op_events.c: (find_event_by_name): Match unit mask.
+ * libop/op_parse_event.c: (parse_events): Set unit_mask_valid
+ * libop/op_parse_event.h: (parsed_eventd): Add unit_mask_valid
+ * libop/tests/alloc_counter_tests.c: (do_test):
+ * libop/tests/parse_event_tests.c:
+ * daemon/opd_ibs: (ibs_parse_and_set_events):
+ * gui/oprof_start.cpp (alloc_selected_events):
+ * utils/ophelp.c: (resolve_events, show_unit_mask):
+ Update find_event_by_name call.
+
+2009-06-05 Andi Kleen <ak@linux.intel.com>
+
+ * libop/tests/alloc_counter_tests.c:
+ Don't use non existent unit masks in P4 counter tests.
+
+2009-06-03 Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
+
+ * events/x86-64/family10/events:
+ * events/x86-64/family10/unit_masks: Update events and unitmasks
+ for the AMD Six-core Opteron processor support from
+ publication 31116 revision 3.28
+
+2009-05-27 Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
+
+ * utils/opcontrol: Fix IBS initialization
+
+2009-05-27 Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
+
+ * daemon/oprofiled.c:
+ * daemon/opd_ext.c: Fix extended feature initialization
+
+2009-05-27 Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
+
+ * doc/oprofile.xml:
+ * doc/internals.xml: Add Extended-Interface and IBS documentation,
+
+2009-05-19 Andi Kleen <ak@linux.intel.com>
+
+ * utils/ophelp.c: (cleanup) Fix cleanup crash.
+
+2009-05-19 Andi Kleen <ak@linux.intel.com>
+
+ * events/i386/atom/events: Use hardcoded counters. Readd
+ UNHALTED_REFERENCE_CLOCK.
+ * events/i386/nehalem/events:
+ * events/i386/nehalem/unit_masks: Use hardcoded counters.
+ Clarify CPU_CLOCKS_UNHALTED.REF_P
+
+2009-05-19 Andi Kleen <ak@linux.intel.com>
+
+ * libop/op_hw_specific.h: (arch_get_filter):
+ Return -1 when CPUID is not available.
+
+2009-05-18 Brian Bloniarz <bmb@athenacr.com>
+
+ * libutil/op_file.c: Fix crash when chasing broken symlinks
+
+2009-05-13 Maynard Johnson <maynardj@us.ibm.com>
+
+ * pp/oparchive.cpp: Fixes for oparchive session-dir as reported in
+ bugs 2646389 and 2646376
+
+2009-05-13 Maynard Johnson <maynardj@us.ibm.com>
+
+ * utils/opcontrol: Fix for session-dir setup, bug report 2646398
+
+2009-05-13 Brian Bloniarz <bmb@athenacr.com>
+
+ * utils/opcontrol: Replace bash built-in let with posix statements
+
+2009-05-07 Andi Kleen <ak@linux.intel.com>
+ * utils/ophelp.c:
+ * libop/op_cpu_type.c:
+ * libop/op_cpu_type.h:
+ * libop/op_events.c:
+ * libop/op_hw_specific.h: Add workaround_nehalem_aaj79
+ * events/Makefile.am:
+ * events/i386/atom/events: Add Atom support (New file)
+ * events/i386/atom/unit_masks: Add Atom support (New file)
+ * events/i386/nehalem/events: Add Nehalem support (New file)
+ * events/i386/nehalem/unit_masks: Add Nehalem support (New file)
+ * events/i386/core_i7/events: Add Core i7 support (New file)
+ * events/i386/core_i7/unit_masks: Add Core i7 support (New file)
+
+2009-05-07 Maynard Johnson <maynardj@us.ibm.com>
+
+ * oprof-compat/events/Makefile.am:
+ * oprof-compat/events/ppc64/ibm-compat-v1/event_mappings: (new)
+ * oprof-compat/events/ppc64/ibm-compat-v1/events: (new)
+ * oprof-compat/events/ppc64/ibm-compat-v1/unit_masks: (new)
+ * oprof-compat/libop/op_cpu_type.c:
+ * oprof-compat/libop/op_cpu_type.h:
+ * oprof-compat/libop/op_events.c:
+ * oprof-compat/utils/ophelp.c: Add support for IBM ppc64 architected events
+
+2009-05-06 Andi Kleen <ak@linux.intel.com>
+
+ * utils/ophelp.c: Use word wrap to output event descriptions
+
+2009-05-01 Andi Kleen <ak@linux.intel.com>
+
+ * events/i386/arch_perfmon/events: Update event names to conform to manual.
+
+2009-05-01 Maynard Johnson <maynardj@us.ibm.com>
+
+ * configure.in:
+ * m4/binutils.m4: Workaround to make oprofile build on recent SUSE
+
+2009-04-29 Andi Kleen <ak@linux.intel.com>
+
+ * libop/op_events.c: Add support for include and unit mask merging
+ statements in event files
+
+2009-04-29 Andi Kleen <ak@linux.intel.com>
+
+ * libop/op_events.c: Allow make check to accumulate some errors
+ before exiting
+
+2009-04-28 Maynard Johnson <maynardj@us.ibm.com>
+
+ * events/Makefile.am:
+ * events/ppc64/power7/event_mappings: (new)
+ * events/ppc64/power7/events: (new)
+ * events/ppc64/power7/unit_masks: (new)
+ * libop/op_cpu_type.c:
+ * libop/op_cpu_type.h:
+ * libop/op_events.c:
+ * utils/ophelp.c: Add support for IBM POWER7 processor
+
+2009-04-22 Maynard Johnson <maynardj@us.ibm.com>
+
+ * agents/jvmpi/jvmpi_oprofile.cpp: Change this file to use LGPL license
+ to allow JVMPI agent library to link to non-GPL code
+
+2009-04-17 Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
+
+ * utils/opcontrol: Add IBS support, patch 4 of 4
+
+2009-04-17 Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
+
+ * pp/opannotate.cpp: Add IBS support, patch 3 of 4
+
+2009-04-17 Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
+
+ * events/x86-64/family10/events:
+ * events/x86-64/family10/unit_masks: Add IBS support, patch 2 of 4
+
+
+2009-04-17 Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
+
+ * daemon/Makefile.am:
+ * daemon/opd_extended.c:
+ * daemon/opd_ibs.c: New File
+ * daemon/opd_ibs.h: New File
+ * daemon/opd_ibs_macro.h: New File
+ * daemon/opd_ibs_trans.c: New File
+ * daemon/opd_ibs_trans.h: New File
+ * daemon/opd_interface.h:
+ * daemon/opd_sfile.c:
+ * daemon/opd_sfile.h:
+ * daemon/opd_trans.c:
+ * libdb/db_insert.c:
+ * libdb/odb.h: Add IBS support, patch 1 of 4
+
+2009-04-15 Maynard Johnson <maynardj@us.ibm.com>
+
+ * libpp/xml_utils.cpp: Fix binary count total in XML output
+ when using --separate=lib
+
+2009-04-08 William Cohen <wcohen@redhat.com>
+
+ * configure.in: Add check for basename declaration
+
+2009-04-01 Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
+
+ * daemon/Makefile.am:
+ * daemon/opd_events.c:
+ * daemon/opd_extended.h: New File
+ * daemon/opd_extended.c: New File
+ * daemon/opd_printf.h:
+ * daemon/opd_sfile.h:
+ * daemon/opd_sfile.c:
+ * daemon/opd_stats.c:
+ * daemon/opd_trans.h:
+ * daemon/opd_trans.c:
+ * daemon/oprofiled.c:
+ * libop/op_events.h:
+ * libop/op_events.c:
+ * libop/op_alloc_counter.c:
+ * utils/ophelp.c: Add Extended Feature Interface
+
+2009-03-17 Suraveee Suthikulpanit <suravee.suthikulpanit@amd.com>
+
+ * events/Makefile.am
+ * events/x86-64/family11h/events: New event file
+ * events/x86-64/family11h/unit_masks: New Unitmask file
+ * libop/op_cpu_type.c: Adding family11h
+ * libop/op_cpu_type.h: Adding family11h
+ * libop/op_events.c: Adding family11h
+ * utils/ophelp.c: Adding family11h and update documents
+
+2009-03-17 Maynard Johnson <maynardj@us.ibm.com>
+
+ * libop/op_allocate_counter.c: Make map_event_to_counter handle
+ a non-native cpu_type
+
+2009-03-05 Robert Richter <robert.richter@amd.com>
+
+ * libutil++/bfd_support.cpp: suppress 'unused parameter' warning
+
+2009-02-10 Maynard Johnson <maynardj@us.ibm.com>
+
+ * libabi/tests/abi_test.cpp:
+ * libregex/tests/java_test.cpp:
+ * libregex/tests/regex_test.cpp: Use C++ style #includes
+ for stdlib and string
+
+
+2009-02-09 Kjetil Barvik <barvik@broadpark.no>
+
+ * libabi/tests/abi_test.cpp:
+ * libregex/tests/java_test.cpp:
+ * libregex/tests/regex_test.cpp:
+ * libutil/tests/file_tests.c: Fix gcc warnings
+
+2009-02-06 Maynard Johnson <maynardj@us.ibm.com>
+
+ * libutil++/bfd_support.cpp:
+ * libutil++/bfd_support.h:
+ * libutil++/op_bfd.cpp: Fixup debuginfo processing for ppc64
+
+2009-02-03 Carl Love <cel@us.ibm.com>
+
+ * utils/opcontrol:
+ * doc/oprofile.xml:
+ * events/ppc64/cell-be/events:
+ * events/ppc64/cell-be/unit_masks: Added IBM CELL SPU event profiling support
+
+2009-01-05 Maynard Johnson <maynardj@us.ibm.com>
+
+ * m4/binutils.m4: Fix error in AC_CHECK_LIB action
+
+
+See ChangeLog-2008 for earlier changelogs.
diff --git a/ChangeLog-2001 b/ChangeLog-2001
new file mode 100644
index 0000000..acc5be4
--- /dev/null
+++ b/ChangeLog-2001
@@ -0,0 +1,2327 @@
+2001-12-31 Philippe Elie <ph_e@club-internet.fr>
+
+ * module/op_init.c:
+ * module/oprofile.c: export cpu type preparing for user space
+ cpu detection change
+ * module/oprofile.h: preparatory work to add support for
+ preempt patch
+
+ * pp/oprofpp.cpp: cleanup #if 0 ... #else ... #endif
+ * pp/orofpp_util.cpp: allow to deduce image name from
+ shared lib samples files name produced with
+ --separate-samples
+
+ * gui/oprof_start.cpp: minor fix
+
+2001-12-31 John Levon <moz@compsoc.man.ac.uk>
+
+ * various files: use op_cpu enum for cpu type
+
+ * all .cvsignore:
+ * Rules.make.in:
+ * all Makefile.in: hide .d files in .deps directories
+
+2001-12-31 John Levon <moz@compsoc.man.ac.uk>
+
+ * Makefile.in: move config.h.in to maintainerclean - it is included
+ in a tarball so a distclean shouldn't remove it
+
+2001-12-31 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+ * gui/ui/oprof_start.base.ui:
+ * doc/oprofile.sgml:
+ * doc/oprofile.1.in: small updates
+
+ * oprofile.c: more detail on locking requirements for wake_up
+
+2001-12-31 Michel Dagenais <michel.dagenais@polymtl.ca>
+
+ * gui/oprof_start.cpp:
+ * gui/oprof_start.h: show total samples so far
+
+2001-12-29 Philippe Elie <ph_e@club-internet.fr>
+
+ * dae/oprofiled.c:
+ * dae/op_start: --separate-samples is working
+
+ * gui/oprof_start.cpp:
+ * gui/oprof_start_config.cpp:
+ * gui/oprof_start_config.h:
+ * gui/ui/oprof_start.base.ui: handle separating for
+ shared libs, off by default.
+
+ * doc/oprofile.sgml:
+ * doc/oprofile.1.in: document --show-shared-libs
+
+ * pp/opf_filter.h:
+ * pp/opf_container.cpp: new class samples_files_t
+ to easier access to subset of symbols/samples or
+ source filename from multiple image
+
+ * pp/Makefile.in:
+ * pp/op_time.cpp:
+ * pp/opf_filter.cpp:
+ * pp/oprofpp.cpp:
+ * pp/oprofpp.h:
+ * pp/oprofpp_util.cpp: implement --show-shared-libs except
+ for opf_filter
+
+ * util/file_manip.h:
+ * util/file_manip.cpp: new function to manipulate sample
+ file name and list of sample file name.
+
+2001-12-27 Philippe Elie <ph_e@club-internet.fr>
+
+ * dae/op_stop: always do an op_dump before stopping
+ * gui/oprof_start.cpp: op_dump before op_stop
+ no longer required
+
+2001-12-26 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/opf_filter.cpp:
+ * pp/opf_filter.h:
+ * pp/oprofpp.h:
+ * pp/opf_filter.cpp:
+ * pp/oprofpp_util.cpp:
+ * pp/oprofpp.cpp:
+ * pp/op_time.c: remove some use of global var
+ samplefile and imagefile
+
+ * pp/oprofpp.cpp: do_dump_gprof() free memory
+ too soon. (was bugged from 2001-12-05)
+
+ * doc/oprofile.sgml: remove mention about oprof-thread
+
+2001-12-23 Philippe Elie <ph_e@club-internet.fr>
+
+ * util/string_manip.h:
+ * util/string_manip.cpp: separate_token() new function
+
+ * pp/opf_filter.cpp:
+ * pp/oprofpp.cpp:
+ * pp/oprofpp.h:
+ * pp/oprofpp_util.cpp:
+ * doc/oprofil.1.in:
+ * doc/oprofile.sgml: add support for --exclude-symbol
+
+ * TODO: update
+
+2001-12-22 Philippe Elie <ph_e@club-internet.fr>
+
+ * dae/op_start: add --separate-samples
+ * dae/oprofiled.c: ditto
+ * dae/opd_proc.c:
+ * dae/opd_util.h:
+ * dae/opd_util.c:
+ * dae/oprofiled.h: implementation of above
+ * pp/op_time.cpp:
+ * doc/oprofile.1.in:
+ * doc/oprfile.sgml: handle and document above
+ * pp/oprofpp_util.cpp: minor change related
+
+ * dae/oprofiled.c: bug fix while blocking signal
+
+ * doc/Makefile.in: avoid unecessary build of html doc
+
+2001-12-22 Dave Jones <davej@suse.de>
+
+ * config.h.in: Readd to CVS.
+
+2001-12-18 Dave Jones <davej@suse.de>
+
+ * Makefile.in: Make documentation build again.
+
+2001-12-14 Philippe Elie <ph_e@club-internet.fr>
+
+ * dae/opd_proc.c: memory leak fix in opd_init_images()
+
+2001-12-12 Philippe Elie <ph_e@club-internet.fr>
+
+ * module/oprofile.h: change slightly op_hash()
+
+ * util/file_manip.h:
+ * util/file_manip.cpp:
+ * util/string_manip.h:
+ * util/string_manip.cpp:
+ * util/child_reader.h:
+ * util/child_reader.cpp: cleanup John's FIXME
+
+ * dae/opd_util.h:
+ * dae/opd_util.c: move libiberty things to ...
+ * util/misc.h:
+ * util/misc.c: here
+ * util/Makefile.in: update
+ * dae/Makefile.in:
+ * pp/Makefile.in:
+
+ * doc/Makefile.in: install the html doc
+
+2001-12-10 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/oprofiled.c: fix sigprocmask() blooper
+
+2001-12-09 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update again
+
+ * util/child_reader.h:
+ * util/child_reader.cpp:
+ * util/file_manip.cpp:
+ * util/string_manip.cpp: pedantic cleanup + FIXMEs
+
+2001-12-09 John Levon <moz@compsoc.man.ac.uk>
+
+ * configure.in: add FIXME comment
+
+ * util/file_manip.h: add FIXME comment,
+ avoid warning with //
+
+2001-12-09 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+2001-12-09 Philippe Elie <ph_e@club-internet.fr>
+
+ * dae/opd_proc.c: verbprintf() what cause the
+ deletion of a sample file + minor cleanup
+ * doc/oprofile.sgml: document samples files backup
+
+2001-12-07 Philippe Elie <ph_e@club-internet.fr>
+
+ * dae/oprofiled.h:
+ * dae/opd_proc.c: handle an accessed field of
+ deleted of deleted procs to defer deleting
+ the procs. This greatly reduce the Nr of lost
+ samples due to no proc information.
+
+2001-12-06 Philippe Elie <ph_e@club-internet.fr>
+
+ * dae/oprofiled.h:
+ * dae/opd_proc.c: separate stats for kernel
+ and modules address space and minor cleanup
+
+2001-12-05 Philippe Elie <ph_e@club-internet.fr>
+
+ * Rules.make.in:
+ * dae/Makefile.in:
+ * events/Makefile.in:
+ * pp/Makefile.in:
+ * util/Makefile.in: tidy
+ * module/Makefile.in:
+ * gui/Makefile.in: use auto-deps
+
+ * util/child_reader.h: allow to compile with -ansi
+ * util/child_reader.cpp: fix memory leak fix
+ * pp/oprofpp.cpp: fix memory leak
+
+ * TODO: update
+
+2001-12-05 Philippe Elie <ph_e@club-internet.fr>
+
+ * autogen.sh: use autoheader to create config.h
+ * configure.in: handle missing libiberty.h and
+ missing xcalloc in libiberty.a
+ * dae/opd_util.cpp:
+ * dae/opd_proc.c:
+ * dae/opd_util.h:
+ * dae/oprofiled.c:
+ * evets/Makefile.in
+ * pp/oprof_convert.c:
+ * pp/oprofpp.cpp:
+ * pp/oprofpp_util.cpp: replace opd_malloc() and related
+ by xmalloc.
+ * util/op_popt.c: add call to xmalloc_set_program_name()
+ * ./cvsignore: add config.h, config.h.in
+
+2001-12-04 Dave Jones <davej@suse.de>
+
+ * events/op_events_desc.c:
+ Add recognition for alternative PIII string.
+ Reported by Lev Iserovich <lev@ciprico.com>
+
+2001-12-04 Philippe Elie <ph_e@club-internet.fr>
+
+ * dae/opd_util.c:
+ * dae/opd_util.c: move common fuctionnality to ...
+ * util/file_manip.h
+ * util/file_manip.c: here
+ * pp/oprof_convert.c: reflect above change
+ * pp/oprof_convert.c:
+ * pp/opf_filter.cpp: ditto + minor cleanup
+ * gui/Makefile.in:
+ * pp/Makefile.in: reflect above change
+
+2001-12-02 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/oprofpp.h:
+ * pp/oprofpp.cpp:
+ * pp/oprofpp_util.cpp:
+ * pp/opf_filter.cpp: small tidies
+
+2001-12-01 Philippe Elie <ph_e@club-internet.fr>
+
+ * Makefile.in: build util sub-dir first
+
+ * dae/opd_util.h:
+ * dae/opd_util.c: move opd_GetContext() ...
+ * util/opd_popt.h:
+ * util/opd_popt.c: in these new files
+
+ * pp/oprofpp.cpp:
+ * pp/opf_filter.cpp:
+ * pp/op_time.cpp:
+ * dae/oprofiled.c: free the poptContext + cleanup popt
+
+ * events/op_help.c:
+ * events/Makefile.in: use the popt library
+
+ * pp/oprofpp.cpp: allow to use --output-linenr-info with
+ --list-symbols.
+ * doc/oprofile.1.in:
+ * doc/oprofile.sgml: reflect it
+
+2001-12-01 Philippe Elie <ph_e@club-internet.fr>
+
+ * dae/opd_proc.c:
+ * dae/opd_util.c:
+ * dae/opd_util.h:
+ * dae/oprofiled.c: backup if needed old samples files
+ in a separate directory
+
+ * pp/oprofpp.h:
+ * pp/oprofpp_util.cpp: cleanup + minor buglet fix
+
+ * util/file_manip.h:
+ * util/file_manip.cpp: create_file_list() new to create
+ a list of all the file in a directory
+
+ * pp/op_time.cpp: new utility
+ * pp/Makefile.in: handle op_time
+
+ * doc/oprofile.sgml:
+ * doc/oprofile.1.in: Document op_time
+
+2001-11-30 Philippe Elie <ph_e@club-internet.fr>
+
+ * configure.in: cvs add Rules.make.in.
+
+2001-11-30 Dave Jones <davej@suse.de>
+
+ * configure.in: suppress reference to an inexistant
+ Rules.make.in
+
+2001-11-29 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/oprofpp_util.cpp: do not remove leading underscore to
+ avoid C++ demangling failure
+
+2001-11-27 Philippe Elie <ph_e@club-internet.fr>
+
+ * configure.in:
+ * pp/Makefile.in: work-around for gcc 3.0 and bfd pre-1998
+
+ * doc/oprofile.sgml: typo
+
+2001-11-26 Philippe Elie <ph_e@club-internet.fr>
+
+ * Rules.make.in: new to add autodeps and share commons
+ definitions
+ * all Makefile.in except module, gui: use autodeps
+
+ * doc/oprofile.1.in: typo
+
+ * util/filemanip.h: missing std::
+
+2001-11-25 Philippe Elie <ph_e@club-internet.fr>
+
+ * oprofile-tests/understanding/persistent.cpp: new
+ * util/persistent.h: new. An attempt to provide a better
+ configuration saving/restoring library. Not yet linked to
+ oprof_start.
+
+2001-11-22 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/oprofpp_util.cpp: take care than get_linenr() get
+ line nr and filename info from bfd for the right symbol
+ and not for the nearest symbol with debug info (#484660)
+
+2001-11-15 Philippe Elie <ph_e@club-internet.fr>
+
+ * module/oprofile.h: work around against a gcc
+ 2.91.66 code generation bug in oprof_exit()
+
+2001-11-14 Philippe Elie <ph_e@club-internet.fr>
+
+ * dae/op_start: do not pass bufsize, note_bufsize and
+ kernel_only as option to the daemon but ...
+ * dae/oprofiled.c: read them from sysctl
+
+ * dae/opd_proc.c: in opd_handle_old_sample_file() do not
+ delete sample file if mtime differ but backup it.
+
+ * doc/oprofile.sgml:
+ * pp/oprof_convert.c:
+ * pp/oprofpp_util.cpp: replace session number by
+ backup number
+
+ * util/string_manip.cpp: fix stupid bug in rtrim()
+
+2001-11-13 Philippe Elie <ph_e@club-internet.fr>
+
+ * gui/oprof_start.h:
+ * gui/oprof_start.cpp:
+ * dae/opd_util.h:
+ * dae/opd_util.cpp: small cleanup
+
+ * module/oprofile.c: simplify a little what the
+ nmi handler
+
+ * doc/oprofile.sgml: clarify op_to_source options
+
+ * pp/child_reader.cpp:
+ * pp/child_reader.h: move these ...
+ * util/child_reader.cpp:
+ * util/child_reader.h: here
+ * util/file_manip.h:
+ * util/file_manip.cpp: new
+ * gui/Makefile.in:
+ * gui/oprof_start_util.h:
+ * gui/oprof_start_util.cpp:
+ * pp/Makefile.in:
+ * pp/opf_filter.cpp: use child_reader and file_manip
+
+ * pp/oprofpp_util.cpp: change ordering of opening in
+ opp_bfd ctr to avoid cryptic error message
+
+ * TODO: update
+
+2001-11-12 Philippe Elie <ph_e@club-internet.fr>
+
+ * events: new directory
+
+ * events/Makefile.in:
+ * events/op_events.c:
+ * events/op_events_desc.c:
+ * events/op_help.c: new, splitted from op_events.c
+
+ * pp/oprofpp_util.cpp: new, splitted from oprofpp.cpp
+
+ * pp/oprofpp.h:
+ * pp/oprofpp.c:
+ * op_user.h:
+ * all Makefile.in: update
+ * op_events.c: remove
+
+2001-11-12 Philippe Elie <ph_e@club-internet.fr>
+
+ * op_events.c: last commit was bad
+
+ * pp/oprofpp.c: use sstream
+
+2001-11-12 Philippe Elie <ph_e@club-internet.fr>
+
+ * util: new directory
+ * util/string_manip.cpp:
+ * util/string_manip.h: new
+ * Makefile.in: handle util directory
+ * pp/Makefile.in:
+ * pp/opf_filter.h:
+ * pp/opf_filter.cpp:
+ * gui/Makefile.in:
+ * gui/oprof_start_util.cpp:
+ * gui/oprof_start_util.h: update to use string_manip.cpp
+
+ * op_events.c:
+ * op_user.h:
+ * pp/opf_filter.h:
+ * pp/opf_filter.cpp:
+ * pp/opf_container.cpp: remove dead code
+
+2001-11-11 Dave Jones <davej@suse.de>
+
+ * module/oprofile.[c|h]: Change MSR defines from
+ MSR_IA32_xxx from MSR_P6_xxx, based on info on
+ Linux kernel from Mikael Pettersson that these MSRs
+ don't exist on Pentium 4.
+
+2001-11-11 Philippe Elie <ph_e@club-internet.fr>
+
+ * gui/oprof_start.cpp: fix record_config()
+
+ * op_user.h: fix one comment
+
+2001-11-10 Bob Montgomery <bob_montgomery@hp.com>
+
+ * module/oprofile.c: fix pid/pgrp filter to reset counter
+
+2001-11-08 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+ * configure.in: bump to 0.0.8cvs
+
+2001-11-07 John Levon <moz@compsoc.man.ac.uk>
+
+ * acinclude.m4:
+ * configure.in: fixes for configuration when Qt2 not found
+
+ * child_reader.h:
+ * child_reader.cpp: compile with gcc 3.0
+
+2001-11-07 John Levon <moz@compsoc.man.ac.uk>
+
+ * configure.in: bump to 0.0.7
+
+2001-11-07 John Levon <moz@compsoc.man.ac.uk>
+
+ * configure.in:
+ * module/oprofile.h:
+ * module/oprofile.c: fail if hard_get_current() exists
+ - this won't work
+
+2001-11-06 Philippe Elie <ph_e@club-internet.fr>
+
+ * doc/oprofile.1.in: reformat options
+ * doc/oprofile.sgml: clarify options that require argument.
+ Document short option
+
+ * gui/oprof_start_util.cpp: fix basename()
+
+ * pp/oprofpp.cpp:
+ * pp/oprofpp.h:
+ * pp/opf_filter.cpp: better options handling
+
+ * module/oprofile.c: update one comment
+
+ * TODO: update
+
+2001-11-06 John Levon <moz@compsoc.man.ac.uk>
+
+ * configure.in:
+ * module/oprofile.h:
+ * module/oprofile.c: support for hard_get_current()
+
+2001-11-06 John Levon <moz@compsoc.man.ac.uk>
+
+ * module/oprofile.h:
+ * module/oprofile.c: make allow_unload exist for UP
+ too (default to 1)
+
+2001-11-05 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+ * module/oprofile.c: fix nr_interrupts sysctl
+
+2001-11-04 Philippe Elie <ph_e@club-internet.fr>
+
+ * dae/op_start:
+ * gui/oprof_start.cpp:
+ * gui/oprof_start_config.cpp:
+ * gui/oprof_start_config.h:
+ * gui/ui/oprof_start.base.ui: handle note table size sysctl
+
+ * module/op_syscalls.c: handle dname hash coding collision with
+ a linear search.
+
+ * module/oprofile.c:
+ * module/oprofile.h:
+ * module/op_syscalls.c: Use a struct to hold the whole
+ sysctl settable things rather global var.
+
+2001-11-03 Philippe Elie <ph_e@club-internet.fr>
+
+ * modules/oprofile.h: add a sysctl struct to hold
+ all sysctl set-able variable
+
+ * modules/oprofile.c: two bugs fixes.
+
+2001-11-02 Philippe Elie <ph_e@club-internet.fr>
+
+ * modules/oprofile.h: minor cleanup
+ * modules/oprofile.c: better handling of irq statistics
+
+2001-10-31 John Levon <moz@compsoc.man.ac.uk>
+
+ * module/oprofile.c: add comment about unfixable
+ races.
+
+2001-10-30 John Levon <moz@compsoc.man.ac.uk>
+
+ * Move module code into module/ subdir. Bye
+ bye CVS history :/
+
+2001-10-30 John Levon <moz@compsoc.man.ac.uk>
+
+ * op_x86.c: complain properly about lAPIC-less
+ machines
+
+2001-10-26 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+2001-10-26 H. J. Lu <hjl@users.sf.net>
+
+ * Makefile.in: use $(LD) not ld
+
+2001-10-25 Philippe Elie <ph_e@club-internet.fr>
+
+ * configure.in: fix version.h checking for gcc 2.91.66
+
+2001-10-25 John Levon <moz@compsoc.man.ac.uk>
+
+ * Makefile.in:
+ * doc/Makefile.in:
+ * dae/Makefile.in:
+ * pp/Makefile.in:
+ * gui/Makefile.in: add $DESTDIR to prefix (part from
+ H.J. Lu)
+
+2001-10-25 H. J. Lu <hjl@users.sf.net>
+
+ * configure.in: better version.h workaround
+
+ * doc/*.1:
+ * doc/Makefile.in: better .so manpage install
+
+2001-10-25 Philippe Elie <ph_e@club-internet.fr>
+
+ * doc/oprofile.sgml: minor change.
+ * pp/opf_filter.cpp: repair short option -a and -s
+
+2001-10-24 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/op_to_source: remove from cvs
+ * pp/Makefile.in: opf_filter application renamed to op_to_source
+ * pp/child_reader.h: new
+ * pp/child_reader.cpp: new, allow to fork a child and read
+ its stdout/stderr
+ * pp/opf_filter.h:
+ * pp/opf_filter.cpp: use child_reader to launch objdump.
+ op_to_source -a and -s must be specified with long
+ form --assembly and --source-with-assembly. This also
+ speed-up assembly output. Doc not updated.
+
+2001-10-18 John Levon <moz@compsoc.man.ac.uk>
+
+ * configure.in: workaround #2, hopefully fixing
+ Mandrake (bug #471448)
+
+2001-10-17 John Levon <moz@compsoc.man.ac.uk>
+
+ * oprofile.c: don't mask when restoring MSR values
+
+ * doc/Makefile.in: don't use man symlinks
+
+2001-10-17 John Levon <moz@compsoc.man.ac.uk>
+
+ * oprofile.c: save original counter setup
+ and restore on unload (bug #464094)
+
+2001-10-16 John Levon <moz@compsoc.man.ac.uk>
+
+ * configure.in:
+ * oprofile.h: workaround for Mandrake randomly
+ back-porting things.
+
+2001-10-16 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/opd_proc.c:
+ * gui/oprof_start.cpp:
+ * gui/oprof_start_config.cpp:
+ * gui/oprof_start_config.h:
+ * gui/oprof_start_util.cpp:
+ * pp/opf_container.cpp:
+ * pp/opf_filter.h:
+ * pp/opf_filter.cpp:
+ * pp/oprof_convert.cpp: add note device to gui,
+ general cleanup
+
+2001-10-16 John Levon <moz@compsoc.man.ac.uk>
+
+ * oprofile.h: fix likely() macro
+
+2001-10-14 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+ * op_syscalls.c:
+ * op_user.h:
+ * oprofile.h:
+ * oprofile.c:
+ * dae/op_start:
+ * dae/opd_proc.c:
+ * dae/oprofiled.h:
+ * dae/oprofiled.c: use a separate map buffer.
+
+2001-10-14 John Levon <moz@compsoc.man.ac.uk>
+
+ * acinclude.m4: don't give up if we can't find moc
+
+2001-10-14 John Levon <moz@compsoc.man.ac.uk>
+
+ * oprofile.c: merge no-thread code
+
+2001-10-14 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/opd_proc.c:
+ * dae/oprofiled.c:
+ * op_user.h:
+ * oprofile.h:
+ * op_syscalls.c: use string pool. Prime hash table
+ with common entries. Consider parent in name_hash.
+
+2001-10-13 Philippe Elie <ph_e@club-internet.fr>
+
+ * doc/oprofile.sgml: minor change
+ * pp/opf_filter.cpp: better warning
+
+2001-10-13 John Levon <moz@compsoc.man.ac.uk>
+
+ * configure.in: 0.0.6 has been released -> 0.0.7cvs
+
+2001-10-12 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+ * doc/oprofile.sgml: new docs for annotation filter
+
+2001-10-12 John Levon <moz@compsoc.man.ac.uk>
+
+ * pp/opf_filter.cpp: make output filters more like diff (needs doc),
+ briefer info message
+
+2001-10-12 John Levon <moz@compsoc.man.ac.uk>
+
+ * doc/Makefile.in: add FIXME
+
+ * gui/oprof_start.cpp: fix std::
+
+ * acinclude.m4: more fixes
+
+2001-10-12 Philippe Elie <ph_e@club-internet.fr>
+
+ * gui/oprof_start_util.cpp: use select() rather non-blocking
+ mode to read output from the child process
+
+2001-10-11 Philippe Elie <ph_e@club-internet.fr>
+
+ * doc/oprofile.sgml:
+ * doc/oprofile.1.in:
+ * pp/opf_filter: make --output and --no-output more intuitive
+
+2001-10-09 Philippe Elie <ph_e@club-internet.fr>
+
+ * doc/oprofile.sgml:
+ * doc/oprofile.1.in: clarify doc
+ * pp/opf_filter.cpp: corner case fix in --output-dir and
+ --source-dir handling.
+
+2001-10-08 John Levon <moz@compsoc.man.ac.uk>
+
+ * acinclude.m4:
+ * configure.in:
+ * gui/Makefile.in: fix idiot config bug of mine
+
+2001-10-06 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/opf_filter.cpp:
+ * pp/op_to_source: small cleanup
+
+2001-10-05 Philippe Elie <ph_e@club-internet.fr>
+
+ * doc/oprofile.1.in:
+ * doc/oprofile.sgml:
+ * pp/op_to_source:
+ * pp/opf_filter.cpp: implement --output and --no-output to
+ allow output file generation filtering
+
+2001-10-04 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+2001-10-03 Philippe Elie <ph_e@club-internet.fr>
+
+ * doc/oprofile.1.in:
+ * doc/oprofile.sgml:
+ * pp/op_to_source:
+ * pp/opf_filter.cpp: implement --source-dir and --output-dir
+ to generated separated annoted source file.
+
+2001-10-03 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/oprofpp.cpp
+ * pp/oprofpp.h
+ * pp/opf_filter.cpp: minor cleanup
+
+2001-10-03 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+ * Makefile.in: remove generated files on make distclean
+
+ * acinclude.m4: update from source
+
+2001-10-02 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/oprofpp.cpp: fix a silly bug in do_list_symbols (oprofpp -l)
+
+2001-10-02 John Levon <moz@compsoc.man.ac.uk>
+
+ * doc/oprofile.sgml: fix
+
+ * Makefile.in: dist fix
+
+2001-10-02 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+ * configure.in: -> 0.0.5 for release
+
+2001-10-01 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/opf_container.cpp:
+ * pp/opf_filter.h: comment
+ * pp/opf_filter.cpp: speed-up
+
+2001-09-30 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/opf_container.cpp:
+ * pp/opf_filter.cpp:
+ * pp/oprofpp.cpp:
+ * pp/oprofpp.h: cleanup
+
+2001-09-30 Philippe Elie <ph_e@club-internet.fr>
+
+ * gui/oprof_start.cpp:
+ * gui/oprof_start.h:
+ * gui/ui/oprof_start.base.ui: cleanup
+
+2001-09-29 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/opf_filter.cpp: check if we need debug info to work.
+
+ * gui/oprof_start.cpp: use one config file by counter. Store
+ selected counter in oprof_start_config
+
+ * gui/oprof_start.cpp:
+ * gui/persistent_config.h: remove dirty flag in
+ persistent_config_t template class
+
+2001-09-29 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+ * gui/oprof_start.cpp:
+ * gui/ui/oprof_start_base.ui:
+ * gui/oprof_start_config.h:
+ * gui/oprof_start_config.cpp: add verbose option
+
+ * pp/opf_container.cpp:
+ * pp/opf_filter.cpp: some FIXMEs and little cleanups
+
+2001-09-29 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/oprofpp.cpp: bug fix when calling the bfd lib.
+
+2001-09-29 Philippe Elie <ph_e@club-internet.fr>
+
+ * gui/oprof_start.cpp: two minor fixes.
+
+2001-09-28 John Levon <moz@compsoc.man.ac.uk>
+
+ * various files: the footer is now a header !
+
+ * dae/opd_start.c: fix msync !!
+
+ * gui/oprof_start.cpp:
+ * gui/oprof_start_util.h:
+ * gui/oprof_start_util.cpp: better default event count
+ value. Save CPU type to oprofile file.
+
+2001-09-28 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/opf_filter.c: fix op_to_source [-a] [-s]
+
+2001-09-28 Philippe Elie <ph_e@club-internet.fr>
+
+ * doc/oprofile.sgml: oops, correct bad merging with
+ John's last update.
+
+2001-09-27 Philippe Elie <ph_e@club-internet.fr>
+
+ * doc/oprofile.1.in: minor change
+ * op_events.c: remove --gui-description stuff
+ * pp/opf_filter.cpp: remove use of temporary array to
+ pass argument to the popt library
+
+2001-09-27 John Levon <moz@compsoc.man.ac.uk>
+
+ * doc/oprofile.sgml: updates
+
+ * gui/oprof_start_util.cpp: fix compile, revert
+ g++ extension (different on g++ 3.0)
+
+2001-09-27 John Levon <moz@compsoc.man.ac.uk>
+
+ * gui/oprof_start_util.cpp: use g++ extension to
+ avoid using temporary files
+
+2001-09-27 John Levon <moz@compsoc.man.ac.uk>
+
+ * gui/oprof_start_util.cpp: fix crasher bug
+
+2001-09-27 John Levon <moz@compsoc.man.ac.uk>
+
+ * gui/oprof_start.h:
+ * gui/oprof_start.cpp: get per-counter config working
+
+2001-09-27 John Levon <moz@compsoc.man.ac.uk>
+
+ * pp/Makefile.in:
+ * pp/oprofpp.c:
+ * pp/oprofpp.cpp: rename file
+
+2001-09-27 John Levon <moz@compsoc.man.ac.uk>
+
+ * pp/opf_container.cpp:
+ * pp/oprofpp.h:
+ * pp/oprofpp.c: speed improvements
+
+2001-09-26 Philippe Elie <ph_e@club-internet.fr>
+
+ * configure.in: typo
+
+ * pp/oprofpp.c: fix oprofpp -s.
+ Use std::string (work not yet finish)
+ * pp/oprofpp.h: ditto
+ * pp/opf_filter.cpp: ditto
+
+2001-09-26 John Levon <moz@compsoc.man.ac.uk>
+
+ * oprofile.c: add nr_interrupts
+
+ * gui/oprof_start.h:
+ * gui/oprof_start.cpp:
+ * gui/oprof_start_util.h:
+ * gui/oprof_start_util.cpp:
+ * gui/oprof_start_config.h:
+ * gui/oprof_start_config.cpp:
+ * gui/ui/oprof_start_base.ui: add daemon status
+ display, fix basename()
+
+2001-09-26 John Levon <moz@compsoc.man.ac.uk>
+
+ * configure.in: remove broken bit
+
+ * pp/Makefile.in: fix options
+
+ * doc/oprofile.sgml: minor changes
+
+2001-09-26 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/Makefile.in: increase level of warning
+ * pp/oprof_convert.c: minor fix to avoid warning
+ * dae/opd_util.c: ditto
+ * pp/oprofpp.c: get_linenr() never return null in
+ filename (fix bug #464482). symcomp() ensure
+ correct vma comparison (fix #464093)
+ * dae/opd_util.c: minor fixe in op_poptGetContext()
+ * gui/oprof_start.cpp: minor cleanup
+
+2001-09-25 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/op_stop:
+ * gui/oprof_start_config.cpp: use pidof instead
+
+2001-09-25 John Levon <moz@compsoc.man.ac.uk>
+
+ * gui/oprof_start_config.cpp: fix is_profiler_started() too
+
+2001-09-25 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/op_stop: fix terribly stupid error
+
+2001-09-25 John Levon <moz@compsoc.man.ac.uk>
+
+ * op_event.c: whooops
+
+2001-09-25 John Levon <moz@compsoc.man.ac.uk>
+
+ * gui/oprof_start.cpp: std:: fix
+
+ * dae/op_start:
+ * op_events.c: robustness fix
+
+2001-09-25 John Levon <moz@compsoc.man.ac.uk>
+
+ * gui/oprof_start.cpp: fix silly bug
+
+2001-09-24 John Levon <moz@compsoc.man.ac.uk>
+
+ * pp/opf_filter.cpp: "fix" compile error
+
+2001-09-24 John Levon <moz@compsoc.man.ac.uk>
+
+ * gui/oprofile:
+ * gui/Makefile.in: remove old gui
+
+2001-09-24 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/op_start: make a little more robust
+
+2001-09-24 John Levon <moz@compsoc.man.ac.uk>
+
+ * include/sstream:
+ * Makefile.in:
+ * configure.in:
+ * pp/Makefile.in:
+ * gui/Makefile.in: configure/make fixes
+
+ * op_events.c: re-order for Athlon
+
+2001-09-23 John Levon <moz@compsoc.man.ac.uk>
+
+ * pp/oprofpp.c: small cleanup
+
+2001-09-23 John Levon <moz@compsoc.man.ac.uk>
+
+ * oprofile.h:
+ * op_x86.c: support for 2.4.10
+
+2001-09-23 John Levon <moz@compsoc.man.ac.uk>
+
+ * gui/oprof_start.h:
+ * gui/oprof_start.cpp: rework validator stuff a bit
+
+2001-09-23 John Levon <moz@compsoc.man.ac.uk>
+
+ * gui/oprof_start.cpp: use std::find_if
+
+ * gui/oprof_start_config.cpp:
+ * gui/oprof_start_util.cpp: minor tidies
+
+2001-09-23 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/op_dump:
+ * dae/op_start: echo errors to stderr
+
+ * gui/oprof_start_util.h:
+ * gui/oprof_start_util.cpp:
+ * gui/oprof_start.cpp: use fork/exec to spawn children
+
+2001-09-23 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+ * gui/Makefile.in:
+ * gui/oprof_start_config.h:
+ * gui/oprof_start_config.cpp:
+ * gui/oprof_start_util.h:
+ * gui/oprof_start_util.cpp:
+ * gui/oprof_start.h:
+ * gui/oprof_start.cpp: new file for util functions
+
+2001-09-23 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/opd_util.c:
+ * dae/opd_util.h:
+ * dae/oprofiled.c:
+ * pp/oprofpp.c:
+ * pp/opf_filter.cpp:
+ * configure.in: enable __builtin_expect, fix popt problem
+
+ * pp/oprof_convert.c: small fixes
+
+ * op_events.c: shorten event descriptions for GUI
+
+ * gui/*: many more updates
+
+ * pp/Makefile.in: fix
+
+2001-09-21 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/opd_proc.c: removed over-verbose line
+
+ * configure.in:
+ * oprofile.h:
+ * oprofile.c: add likely/unlikely, take note lock on dump
+
+2001-09-21 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/opf_filter.h: move declaration of counter_array_t to
+ * pp/oprofpp.h: here
+ * pp/oprofpp.c: define and use counter_array_t + minor cleanup
+ * pp/opf_filter.cpp: remove definition of counter_array_t
+
+2001-09-21 Philippe Elie <ph_e@club-internet.fr>
+
+ * Makefile.in: remove aclocal.m4 in distclean
+ * pp/Makefile.in: use $(CXX) and $(CXXFLAGS)
+
+ * pp/opf_container.cpp:
+ * pp/opf_filter.cpp:
+ * pp/opf_filter.h:
+ * pp/oprofpp.c:
+ * pp/oprofpp.h: cleanup
+
+2001-09-20 Philippe Elie <ph_e@club-internet.fr>
+
+ * Makefile.in: minor change in module building
+ * pp/Makefile.in: link oprofpp with opf_filter
+ * pp/op_to_source: avoid pipe from oprofpp to opf_filter
+ * pp/opf_filter.h: remove a few member function
+ * pp/opf_container.cpp: ditto + minor cleanup
+ * pp/opf_filter.cpp: oprofpp is no longer piped to opf_filter
+ but linked with it. Many change, needs additional cleanup
+ * pp/oprofpp.c: group all stuff in two class. Rather a
+ a C with class than a full C++ file for now. Fix a bug
+ in filename handling.
+ * pp/oprofpp.h: add opp_bfd and opp_samples_files class.
+
+ * dae/opd_util.c: add a few explicit cast for C++ compile
+ * dae/opd_util.h: wrap function declaratio with extern "C"
+
+2001-09-19 John Levon <moz@compsoc.man.ac.uk>
+
+ * oprofile.c: fix silly read valid bug
+
+2001-09-19 John Levon <moz@compsoc.man.ac.uk>
+
+ * Makefile.in: whoops, missed op_util.o from build
+
+2001-09-19 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/oprofiled.c: fix little bug, tidy a bit
+
+ * TODO: update
+
+2001-09-18 John Levon <moz@compsoc.man.ac.uk>
+
+ * Makefile.in:
+ * op_syscalls.c:
+ * op_util.c:
+ * oprofile.h: move some code around
+
+ * oprofile.c: fix a tiny bug
+
+2001-09-18 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/opd_proc.c:
+ * dae/oprofiled.h: implement hashing of images
+
+ * doc/oprofile.sgml: fix -- issue and use <screen>
+
+2001-09-18 John Levon <moz@compsoc.man.ac.uk>
+
+ * .cvsignore:
+ * README: update
+
+ * configure.in: small cleanup
+
+ * op_init.c: add comment
+
+ * oprofile.h:
+ * op_syscalls.c:
+ * op_x86.c: move fixmap stuff, remove disable APIC
+
+ * oprofile.c: init failure fix
+
+ * doc/oprofile.sgml:
+ * dae/opd_proc.c: fix handle_old_sample_files() bug,
+ check mtime hasn't changed on a new map
+
+2001-09-16 John Levon <moz@compsoc.man.ac.uk>
+
+ * acinclude.m4:
+ * autogen.sh:
+ * configure.in:
+ * gui/Makefile.in:
+ * gui/ui/Makefile.in:
+ * gui/ui/oprof_start.base.ui:
+ * gui/oprof_start.h: autoconfiscation for Qt2
+
+ * gui/oprof_start_config.cpp: add comments
+
+2001-09-16 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/opf_filter.cpp: fix unrecognized input
+ * pp/opf_container.cpp: better error messages. put
+ op_nr_counters in the global namespace (gcc 2.91
+ work around)
+
+2001-09-16 John Levon <moz@compsoc.man.ac.uk>
+
+ * pp/oprofpp.cpp: small tidy
+
+2001-09-16 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/opf_filter.cpp: minor tidy
+
+ * gui/oprof_start.base.ui: new oprof_start gui
+ * gui/oprof_start.cpp: new, derived class of oprof_start_base
+ * gui/oprof_start.h: ditto
+ * gui/oprof_start_impl.cpp: implementation of oprof_start class
+ * gui/oprof_start_config.cpp: utilities function for oprof_start
+ * gui/oprof_start_config.h: ditto
+ * gui/persistent_config.h: utility template
+ * gui/oprof_start_main.cpp: main() for oprof_start
+ * gui/Makefile.in: handle this stuff
+
+2001-09-15 John Levon <moz@compsoc.man.ac.uk>
+
+ * pp/oprofpp.c: some cleanup
+
+2001-09-15 John Levon <moz@compsoc.man.ac.uk>
+
+ * pp/oprofpp.c: allow non-matching mtimes in order
+ to allow pp on different machines. Make conflicting
+ counter specifications a fatal error
+
+2001-09-15 John Levon <moz@compsoc.man.ac.uk>
+
+ * all Makefile.in: install should depend on all
+
+ * pp/oprofpp.c: fixes for Athlon 4 counters. Enable debug info
+ for list-symbol. Some stricter checking
+
+2001-09-15 Philippe Elie <ph_e@club-internet.fr>
+
+ * op_events.c: some static variable to global
+ * op_user.h: export these
+
+ * oprofile.c: typo in comment
+
+ * dae/opd_proc.c: fix size of samples files
+
+2001-09-13 Dave Jones <davej@suse.de>
+
+ * doc/oprofile.1.in:
+ Update so it doesn't say 'Intel only'
+ * dae/op_start:
+ Fix output so that it prints [0-3] instead of [0-4[
+
+2001-09-12 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/oprofpp.c: fix cpu type output for opf_filter
+
+ * dae/op_stop: return error code properly
+
+2001-09-12 John Levon <moz@compsoc.man.ac.uk>
+
+ * pp/oprofpp.c: print name of cpu type
+
+ * dae/op_stop:
+ * dae/op_start: re-organise, tidy
+
+2001-09-12 John Levon <moz@compsoc.man.ac.uk>
+
+ * oprofile.c: fix small but triggerable
+ SMP dump race
+
+2001-09-12 John Levon <moz@compsoc.man.ac.uk>
+
+ * oprofile.h:
+ * oprofile.c:
+ * op_x86.c: move some code about
+
+ * op_syscalls.c: add comment
+
+2001-09-12 John Levon <moz@compsoc.man.ac.uk>
+
+ * configure.in: remove warning
+
+ * op_user.h:
+ * op_events.c: fix and clean up cpu type detection
+
+ * op_init.c: fix email
+
+ * oprofile.c: add IRQ stats. Not sure whether to keep...
+
+2001-09-12 John Levon <moz@compsoc.man.ac.uk>
+
+ * oprofile.h:
+ * oprofile.c: use cpu_number_map (pedantry thing)
+
+2001-09-07 Philippe Elie <ph_e@club-internet.fr>
+
+ * oprofile.c: remove /proc/.../cpu_type. Check if user
+ mode cpu type detection is identical to module cpu type
+ * op_events.h:
+ * op_events.c: add op_get_cpu_type(). script can get cpu_type
+ by op_help --get-cpu-type
+ * gui/oprofile: use it
+ * dae/oprofiled.c: ditto
+ * dae/op_start: ditto, pass expected_cpu_type to module
+ * doc/oprofile.sgml: update
+ * doc/oprofile.1.in: update
+ * pp/oprofpp.c: get cpu_type from samples file
+ * pp/opf_filter.cpp: get cpu type from stdin
+
+2001-09-06 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/opd_proc.c: use j not i in msync !
+
+2001-09-06 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/op_start: more sanity checking of options
+
+2001-09-06 John Levon <moz@compsoc.man.ac.uk>
+
+ * doc/oprofile.sgml: update a bit
+
+2001-09-06 John Levon <moz@compsoc.man.ac.uk>
+
+ * <most files>: make op_nr_counters a var (no pp support for > 2 yet)
+
+ * dae/oprofiled.c: don't print help when counter event etc. are wrong
+
+2001-09-06 John Levon <moz@compsoc.man.ac.uk>
+
+ * oprofile.h:
+ * oprofile.c: use MODULE_LICENSE
+
+2001-09-06 John Levon <moz@compsoc.man.ac.uk>
+
+ * op_user.h: add missing prototype
+
+ * dae/op_start: fix counter extraction
+
+2001-09-05 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/oprofpp.c: fix a few corner case, cleanup.
+ * dae/opd_proc: ditto.
+
+ * dae/op_start: better handling of counter number
+
+ * dae/opd_proc: minor change.
+
+ * op_user.h: enable support for four counters
+ * oprofile.c: ditto. Split functions
+
+ * op_events.c: expose op_get_cpu_type_str(int) to world.
+
+2001-09-04 John Levon <moz@compsoc.man.ac.uk>
+
+ * oprofile.h:
+ * oprofile.c: don't restore delivery mode to LVTPC (causes
+ APIC error on SMP). Fix for silly sem hang with do_dump
+
+2001-09-04 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/op_start: fix typo bug
+
+2001-09-04 John Levon <moz@compsoc.man.ac.uk>
+
+ * doc/oprofile.sgml: some small tidies
+
+2001-09-04 John Levon <moz@compsoc.man.ac.uk>
+
+ * oprofile.c: change lvtpc_apic_restore to be more careful !
+
+2001-09-02 John Levon <moz@compsoc.man.ac.uk>
+
+ * oprofile.c: don't allow unload on SMP unless allow_unload
+ is set. Still needs docs (no point till SMP works).
+
+2001-09-02 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/op_dump: complain if not root more clearly.
+
+2001-09-02 John Levon <moz@compsoc.man.ac.uk>
+
+ * oprofile.c: remove bogus setting for NMI oopser.
+ smp_apic_restore() -> lvtpc_apic_restore()
+
+2001-09-01 Philippe Elie <ph_e@club-internet.fr>
+
+ * oprofile.c: fix pmc_setup()
+
+ * pp/Makefile.in:
+ * dae/Makefile.in: fix uninstall problem
+
+2001-08-31 Philippe Elie <ph_e@club-internet.fr>
+
+ * oprofile.h:
+ * dae/oprofiled.h:
+ * op_user.h:
+ * oprofpp.h:
+ * dae/opd_util.h: share commmon declarations, put it in
+ op_user.h, include op_user.h in other .h when necessary.
+ * op_events.c:
+ * all Makefile.in: update dependancies.
+
+2001-08-30 Philippe Elie <ph_e@club-internet.fr>
+
+ * oprofile.c: use loop instead of fixed counter number
+
+2001-08-26 Philippe Elie <ph_e@club-internet.fr>
+
+ * op_events.c: add option to op_help for the gui
+ * gui/oprofile: use op_help to build description
+ of events, accept Athlon (only 2 counters)
+
+2001-08-25 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/oprofpp.c:
+ * dae/op_start: use loop instead of fixed number of counter.
+
+2001-08-24 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/oprof_convert.c: add v4 --> v5 conversion
+
+2001-08-23 Philippe Elie <ph_e@club-internet.fr>
+
+ * oprofile.c: correct some comment.
+
+2001-08-22 Philippe Elie <ph_e@club-internet.fr>
+
+ * op_user.h:
+ * dae/opd_proc.c:
+ * dae/opd_util.c:
+ * dae/opd_util.h:
+ * dae/oprofiled.h:
+ * dae/oprofiled.c:
+ * dae/oprofiled.c: row to column file format, lot of changes.
+
+2001-08-21 Philippe Elie <ph_e@club-internet.fr>
+
+ * op_events.c: Add Athlon string/unit maks description
+
+2001-08-20 Philippe Elie <ph_e@club-internet.fr>
+
+ * op_events.c: change in handling of search/check events
+ * dae/oprofiled.c:
+ * dae/oprofiled.h:
+ * oprofile.c:
+ * oprofile.h:
+ * pp/oprofpp.c:
+ * pp/oprofpp.h: reflects caller/prototype, lot of changes.
+
+2001-08-31 John Levon <moz@compsoc.man.ac.uk>
+
+ * Makefile.in:
+ * op_x86.c:
+ * oprofile.h:
+ * oprofile.c: a prototype detector for SMP hardware,
+ some small cleanup
+
+2001-08-20 Dave Jones <davej@suse.de>
+
+ * doc/oprofile.sgml:
+ Updated to reflect new Athlon/Duron capabilities.
+ * pp/oprof_convert.c:
+ * pp/oprofpp.c: use EXIT_FAILURE | EXIT_SUCCESS
+ in exit() calls.
+ * oprofile.c: Make non-exported functions static
+ and remove duplicate definitions.
+
+2001-08-19 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/op_start: handle celeries in cpu type
+
+2001-08-19 John Levon <moz@compsoc.man.ac.uk>
+
+ * op_init.c:
+ * oprofile.h:
+ * oprofile.c: small tidies of the Athlon support
+
+2001-08-19 Dave Jones <davej@suse.de>
+
+ * op_events.c:
+ * op_init.c:
+ * oprofile.h:
+ * oprofile.c:
+ * dae/op_start:
+ * dae/oprofiled.h:
+ * dae/oprofiled.c: initial Athlon support
+
+2001-08-19 Philippe Elie <ph_e@club-internet.fr>
+
+ * oprofile.c: use symbolic constant for all apic setup, no generated
+ code change
+
+2001-08-18 Philippe Elie <ph_e@club-internet.fr>
+
+ * Makefile.in:
+ * dae/Makefile.in:
+ * pp/Makefile.in:
+ * doc/Makefile.in:
+ * gui/Makefile.in: add uninstall target
+
+2001-08-18 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/opd_proc.c: tiny cleanup
+
+2001-08-17 Philippe Elie <ph_e@club-internet.fr>
+
+ * dae/opd_proc.c:
+ * TODO: minor cleanup.
+
+2001-08-16 Philippe Elie <ph_e@club-internet.fr>
+
+ * gui/oprofile:
+ * dae/op_start:
+ * doc/oprofile.1.in: document and use op_dump
+
+2001-08-16 John Levon <moz@compsoc.man.ac.uk>
+
+ * configure.in: bump version to 0.0.5cvs
+
+2001-08-16 John Levon <moz@compsoc.man.ac.uk>
+
+ * all Makefile.in: mkdir install files
+
+2001-08-15 Philippe Elie <ph_e@club-internet.fr>
+
+ * dae/opd_proc.c: fix a FILE* leak in opd_get_ascii_maps()
+
+2001-08-14 John Levon <moz@compsoc.man.ac.uk>
+
+ * op_syscalls.c: don't return negative hashes !
+ revert dname len "fix"
+ use a much better hash function
+
+ * dae/opd_proc.c: protect against negative hashes
+
+2001-08-14 John Levon <moz@compsoc.man.ac.uk>
+
+ * op_syscalls.c: some small fixes
+
+ * oprofile.c: add back unmasking code during set_gate, but only
+ LVTPC
+
+2001-08-11 John Levon <moz@compsoc.man.ac.uk>
+
+ * oprofile.h: 2.4.8 doesn't either. *sigh*. looks like we need
+ some autoconfery :(
+
+2001-08-11 John Levon <moz@compsoc.man.ac.uk>
+
+ * oprofile.h: 2.4.7-linus doesn't include the Andrew Morton
+ complete_and_exit(). Hopefully this will make it into 2.4.8,
+ I'm banking on this.
+
+2001-08-11 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/op_dump:
+ * doc/oprofile.sgml:
+ * dae/Makefile.in: a little utility for dumping
+
+2001-08-11 Dave Jones <davej@suse.de>
+
+ * oprofile.h:
+ * oprofile.c: back-compat code and use of new struct completion
+ for the thread
+
+2001-08-11 John Levon <moz@compsoc.man.ac.uk>
+
+ * oprofile.c: corner case where an a miss against a full count,
+ we were attributing wrong (reported by Bob Montgomery)
+
+2001-08-11 John Levon <moz@compsoc.man.ac.uk>
+
+ * oprofile.c: use a simple cli/sti when installing the NMI
+ handler. It should work and avoids the unmasking problem.
+
+2001-08-10 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/oprofiled.h: fix header include (from Dave Jones)
+
+ * op_syscalls.c:
+ * oprofile.c: fix undefined symbol (from Dave Jones)
+
+2001-08-10 John Levon <moz@compsoc.man.ac.uk>
+
+ * oprofile.c: small tidy in apic setup
+
+2001-08-02 John Levon <moz@compsoc.man.ac.uk>
+
+ * oprofile.c: fix mod unload race, small fixes
+
+ * dae/op_start: make sysctl error actually appear
+
+ * doc/oprofile.sgml: document need for modutils 2.4.6
+
+ * op_syscalls.c: fix stupid mod use count problem
+
+2001-07-28 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/opd_proc.c: d'oh, fat-fingered a slow memleak in the
+ a-ksymoops modules fix
+
+2001-07-27 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/oprof_convert.c: fix bug when conversion skip more than one
+ version.
+
+2001-07-27 John Levon <moz@compsoc.man.ac.uk>
+
+ * doc/Makefile.in: ln -s -> ln -sf
+
+ * dae/opd_util.c: actually include the right header
+
+ * dae/opd_util.h: compile freestanding from oprofiled.h
+
+2001-07-26 John Levon <moz@compsoc.man.ac.uk>
+
+ * oprofile.c: fix comment
+
+ * doc/oprofile.sgml: document symbolless modules not working
+
+ * dae/Makefile.in:
+ * dae/opd_proc.c:
+ * dae/oprofiled.h: catch modules with no symbols via query_module()
+ and ignore samples for them quickly
+
+2001-07-25 Philippe Elie <ph_e@club-internet.fr>
+
+ * dae/op_start: beautify the output of op_start --help
+ * pp/op_to_source: ditto. better argument checking.
+
+ * pp/oprof_convert.c:
+ * pp/oprofpp.h:
+ * dae/oprofiled.h: fix problem with opd_footer, don't bump
+ opd_footer version number !
+
+2001-07-25 John Levon <moz@compsoc.man.ac.uk>
+
+ * pp/Makefile.in:
+ * pp/oprof_convert.c: convert to v4
+
+ * pp/oprofpp.c: use opd_strdup
+
+2001-07-25 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/opd_util.c: small tidy
+
+2001-07-24 Philippe Elie <ph_e@club-internet.fr>
+
+ * dae/opd_util.c:
+ * dae/opd_util.h: add relative path name to absolute path name stuff
+ * pp/oprofpp.c: use it.
+ * pp/op_to_source: simplify code to reflect above change.
+
+2001-07-25 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/opd_proc.c: fix uninitialised pointer access (reported by
+ <bobm@fc.hp.com>) that could segfault oprofile in case of
+ module load/unload activity
+
+ * Makefile.in:
+ * dae/opd_proc.c:
+ * dae/opd_util.c:
+ * dae/opd_util.h:
+ * dae/oprofiled.c:
+ * dae/oprofiled.h:
+ * pp/Makefile.in:
+ * pp/oprofpp.c:
+ * pp/oprofpp.h: use mtime() instead of md5sum(). Still doesn't handle
+ "./a; gcc -o a a.c; ./a"
+
+2001-07-22 Philippe Elie <ph_e@club-internet.fr>
+
+ * doc/oprofile.1.in:
+ * doc/oprofile.sgml:
+ * pp/opf_filter.h:
+ * pp/opf_filter.cpp:
+ * pp/opf_container.cpp: implement and document filtering for assembly
+ output.
+
+2001-07-21 Philippe Elie <ph_e@club-internet.fr>
+
+ * doc/oprofile.sgml:
+ * gui/oprofile:
+ * oprofile.c: remove edge_detect support.
+
+ * pp/oprofpp.c: check counter range for each event type.
+ * oprofile.c: ditto.
+ * gui/oprofile: ditto and save setup for each event type.
+ * oprofile.h: op_check_range() : display the allowed range.
+
+2001-07-18 Philippe Elie <ph_e@club-internet.fr>
+
+ * dae/op_start: disable all counters before starting the setup.
+
+2001-07-18 John Levon <moz@compsoc.man.ac.uk>
+
+ * doc/oprofile.sgml: add in bit I forgot about not profiling ring 0
+
+2001-07-18 John Levon <moz@compsoc.man.ac.uk>
+
+ * doc/oprofile.sgml: added a warning about very low counter values
+ (from Philippe, modified)
+
+2001-07-15 John Levon <moz@compsoc.man.ac.uk>
+
+ * oprofile.c:
+ * oprofile.h:
+ * dae/op_start:
+ * dae/oprofiled.c:
+ * doc/oprofile.sgml: remove ability to set different values on
+ different CPUs
+
+2001-07-15 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: remove done thing
+
+2001-07-15 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/opd_proc.c: backup old sample files if the profiling
+ details (count, unit mask etc.) disagree. Fixes #435245
+
+2001-07-15 Philippe Elie <ph_e@club-internet.fr>
+
+ * dae/oprofiled.c: fix oprofiled --version to work even if the
+ profiler is not already started.
+
+ * gui/oprofile: many cleanup. Fix bug track #435248. Make the gui more
+ independant on the number of counter.
+
+ * pp/op_to_source: fix bug in command line arguments handling.
+
+ * pp/opf_filter.h:
+ * pp/opf_filter.cpp:
+ * pp/opf_container.cpp: Apply some cleanup suggested by John, principally
+ change few inheritance to composition.
+
+ * pp/oprof_convert.c: fix --version.
+
+2001-07-14 Philippe Elie <ph_e@club-internet.fr>
+
+ * doc/oprofile.sgml:
+ * doc/oprofile.1.in: minor doc fix.
+
+2001-07-14 John Levon <moz@compsoc.man.ac.uk>
+
+ * doc/oprofile.sgml: small tidies
+
+2001-07-01 Philippe Elie <ph_e@club-internet.fr>
+
+ * doc/oprofile.1.in:
+ * doc/oprofile.sgml: document op_to_source, oprof_convert and the
+ oprofile gui
+
+ * gui/oprofile: onStartProfiling() check that count is in the allowed
+ range. onStopProfiling() flush the samples
+
+2001-07-14 John Levon <moz@compsoc.man.ac.uk>
+
+ * Makefile.in: dist fix
+
+2001-07-14 John Levon <moz@compsoc.man.ac.uk>
+
+ * doc/oprofile.sgml: make it clear we want vmlinux not vmlinuz
+
+ * doc/html/: remove generated files from CVS
+
+ * Makefile.in: changes to create HTML files on dist
+
+2001-06-30 John Levon <moz@compsoc.man.ac.uk>
+
+ * pp/Makefile.in: fix the fix
+
+ * pp/opf_filter.h: very minor changes
+
+2001-06-29 John Levon <moz@compsoc.man.ac.uk>
+
+ * pp/Makefile.in: fix up for opf_filter
+
+ * configure.in: add AC_PROG_CXX
+
+2001-06-29 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/opf_filter.cpp:
+ * pp/opf_container.cpp:
+ * pp/opf_filter.h:
+ * pp/op_to_source: new file which provide a source annotation utility.
+ * pp/Makefile.in: build and install opf_filter / op_to_source
+
+2001-06-29 John Levon <moz@compsoc.man.ac.uk>
+
+ * configure.in:
+ * dae/opd_util.h: hide __attribute__((malloc)) warnings
+ when necessary. Document --with-cc bug.
+
+2001-06-29 Philippe Elie <ph_e@club-internet.fr>
+
+ * gui/oprofile: more saving of the user setup.
+
+2001-06-27 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/opd_util.c: document get_line() restriction
+
+2001-06-27 Philippe Elie <ph_e@club-internet.fr>
+
+ * dae/oprofiled.c: fix cpu_speed_str/cpu_speed variable setup logic.
+
+ * gui/oprofile: save advanced setup form to persistent storage.
+ Add many validation.
+
+2001-06-25 John Levon <moz@compsoc.man.ac.uk>
+
+ * op_events.c:
+ * pp/oprof_convert.c: add missing headers, remove CVS blip
+
+ * dae/opd_util.h: specify malloc attribute. gives warnings on
+ older compilers, who cares. I doubt this will help but it can't
+ harm
+
+2001-06-25 John Levon <moz@compsoc.man.ac.uk>
+
+ * pp/oprof_convert.c: continue if an error with one file occurs
+
+ * dae/op_stop: remove rmmod again - it is user's choice on when/whether
+ to unload
+
+2001-06-23 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/op_start: add missing support for specifying the log filename.
+ Get correct cpu speed information for smp as suggested by John.
+
+ * dae/oprofiled.c: Correct a warning with some older version of the
+ popt library.
+ * pp/oprofpp: as above.
+
+ * gui/oprofile: advanced setup form added.
+
+ * pp/oprof_convert.c: version and help option support.
+
+2001-06-23 John Levon <moz@compsoc.man.ac.uk>
+
+ * pp/.cvsignore: add oprof_convert
+
+2001-06-23 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/oprof_convert.c: new utility to convert samples files when the opd_footer
+ struct is changed.
+ * pp/Makefile.in: reflect the above change. Tidy some unnecessary blank.
+ * Makefile.in: Tidy some unnecessary blank/tabulation.
+
+2001-06-23 John Levon <moz@compsoc.man.ac.uk>
+
+ * README: update
+
+2001-06-22 John Levon <moz@compsoc.man.ac.uk>
+
+ * oprofile.c: always have smp_apic_restore()
+
+2001-06-22 John Levon <moz@compsoc.man.ac.uk>
+
+ * various: made spacing more consistent in C source,
+ removed unused utility functions.
+
+2001-06-22 John Levon <moz@compsoc.man.ac.uk>
+
+ * oprofile.c: actually call smp_apic_restore() on UP
+
+ * dae/op_start: don't remove the module immediately after
+ inserting it !
+
+2001-06-22 Philippe Elie <ph_e@club-internet.fr>
+
+ * dae/oprofiled.h, pp/oprofpp.h: change the opd_footer struct.
+ Bump OPD_VERSION to reflect the file format change.
+ * pp/oprofpp.c: reflect the above change
+ * dae/oprofiled.c: reflect the above change, many options supressed
+ because setup is read from the /proc/sys/dev/oprofile files.
+ * dae/opd_proc: suppress some "extern variable" which no longer exist.
+ * dae/op_start: reflect the above change
+
+2001-06-22 Philippe Elie <ph_e@club-internet.fr>
+
+ * dae/op_start: add --ctr[0|1]-edge-detect
+ * gui/oprofile: add edge detect stuff
+ * oprofile.c: add edge-detect stuff, the edge-detect is an
+ experimental feature which do not work actually (no effect for now).
+ Because this is experimental no documentation are provided on this
+ option.
+
+2001-06-22 John Levon <moz@compsoc.man.ac.uk>
+
+ * configure.in:
+ * dae/op_stop:
+ * doc/oprofile.sgml:
+ * op_init.c:
+ * op_syscalls.c:
+ * oprofile.h:
+ * oprofile.c: add and document the ability
+ to make the module unloadable. Not well tested
+ (but seems to work).
+
+ * doc/oprofile.sgml: document compile-time options
+ better, thank Philippe
+
+2001-06-21 John Levon <moz@compsoc.man.ac.uk>
+
+ * oprofile.c: remove stale comments. fix theoretical
+ memory leaks when setting up the sysctls fails, small tidy
+
+2001-06-19 John Levon <moz@compsoc.man.ac.uk>
+
+ * README:
+ * doc/oprofile.sgml:
+ * doc/html/: s/sourceforge/sf/
+
+2001-06-16 Philippe Elie <ph_e@club-internet.fr>
+
+ * op_events.c: op_check_events() fix two bad use of
+ op_check_unit_mask(). op_get_um_desc() fix a typo.
+
+2001-06-14 Philippe Elie <ph_e@club-internet.fr>
+
+ * op_events.c: struct op_unit_mask, struct op_unit_desc allow up to
+ seven unit masks. Reflect this change in data, op_check_unit_mask()
+ and callers of op_check_unit_mask().
+
+2001-06-12 John Levon <moz@compsoc.man.ac.uk>
+
+ * results/intro: tidy up
+
+ * results/kernel-compile/time-aves.pl: fix regexps
+
+ * results/latex/: results from the LaTeX runs
+
+2001-06-09 Philippe Elie <ph_e@club-internet.fr>
+
+ * dae/op_start: avoid chmod to a non existing directory and setup access
+ mode from 700 to 755. Replace use of the sysctl utility by a
+ do_sysctl() function.
+
+ * gui/oprofile: some cleanup and bugfix.
+
+ * pp/oprofpp.c: add new output options --list-all-symbols-details,
+ --output-linenr-info
+
+ * doc/oprofile.1.in:
+ * doc/oprofile.sgml: update documentation about the new oprofpp
+ option
+
+2001-06-09 John Levon <moz@compsoc.man.ac.uk>
+
+ * configure.in: fix build with CONFIG_MODVERSIONS
+ enabled.
+
+2001-06-04 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/oprofiled.c: move logfile message to
+ before close(1) to not need to use stderr
+
+2001-06-03 John Levon <moz@compsoc.man.ac.uk>
+
+ * gui/: new directory
+
+ * Makefile.in:
+ * configure.in:
+ * gui/.cvsignore:
+ * gui/Makefile.in:
+ * gui/oprofile: Philippe's prototype tcl/tk startup
+ script. Requires more work.
+
+2001-06-03 John Levon <moz@compsoc.man.ac.uk>
+
+ * pp/oprofpp.h: remove libiberty header that was
+ apparently breaking install on slackware
+
+2001-06-03 John Levon <moz@compsoc.man.ac.uk>
+
+ * README: update
+
+2001-06-03 Philippe Elie <ph_e@club-internet.fr>
+
+ * op_events.c: allow unit mask option to be bit mask
+
+2001-06-01 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/opd_proc.c: actually use opd_get_count -
+ fix bug with counter 1 reported results
+
+ * dae/op_start: fix broken shell scripting
+
+ * dae/oprofpp.c: fix list-symbols output
+
+2001-04-30 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/op_start: better error reporting
+
+ * dae/opd_proc.c: fix indentation
+
+2001-04-08 John Levon <moz@compsoc.man.ac.uk>
+
+ * configure.in: 0.0.3 has been released. Bump cvs version
+ to 0.0.4
+
+2001-04-05 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/opd_proc.c: remove forced dumping. It was
+ causing overhead spikes
+
+ * doc/html/results.html:
+ * doc/oprofile.sgml:
+ * dae/op_start: Hopefully document dump clearly enough
+
+2001-04-05 John Levon <moz@compsoc.man.ac.uk>
+
+ * oprofile.h:
+ * op_syscalls.c: 2.4.3 and above have a rw mmap_sem
+
+2001-04-05 John Levon <moz@compsoc.man.ac.uk>
+
+ * doc/html/: added missing files
+
+2001-04-05 John Levon <moz@compsoc.man.ac.uk>
+
+ * doc/oprofile.sgml:
+ * doc/html/resources.html: add URLs
+
+2001-04-05 John Levon <moz@compsoc.man.ac.uk>
+
+ * pp/oprofpp.c: fix gprof output bug. It works OK now,
+ but MULTIPLIER == 1 will break for some reason
+
+2001-04-05 John Levon <moz@compsoc.man.ac.uk>
+
+ * doc/oprofile.sgml:
+ * doc/html/: finish SGML documentation (for now)
+
+2001-04-04 John Levon <moz@compsoc.man.ac.uk>
+
+ * doc/Makefile.in:
+ * doc/oprofile.sgml:
+ * doc/oprofile: start SGML documentation
+
+2001-04-04 John Levon <moz@compsoc.man.ac.uk>
+
+ * configure.in:
+ * Makefile.in:
+ * doc/Makefile.in:
+ * doc/oprofile.1.in: add a manpage
+
+2001-04-04 John Levon <moz@compsoc.man.ac.uk>
+
+ * pp/oprofpp.c: get some sort of half-working output
+ in gprof format. Currently the numbers are screwed up,
+ need a major trawl through gprof source to see what's
+ going on.
+
+2001-04-04 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/Makefile.in:
+ * dae/md5.c:
+ * dae/md5.h:
+ * dae/opd_proc.c:
+ * dae/oprofiled.h:
+ * pp/Makefile.in:
+ * pp/oprofpp.c:
+ * pp/oprofpp.h: use md5sums to verify sample file
+ integrity. Stored in each sample file footer are
+ md5sums of the binary. These are checked by the daemon
+ when re-using an old file, and by the post-processor.
+ Bump OPD_VERSION to reflect the file format change.
+
+ * dae/oprofiled.c: make start up more friendly
+
+ * dae/op_start: make script more friendly
+
+2001-03-10 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/opd_proc.c: fixed some error messages
+
+ * results/kernel-compile/raw/ccu.gnuplot: add
+
+2001-02-05 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+ * results/intro: update
+
+ * results/kernel-compile/: update, add FIG files
+
+ * results/lmbench: lmbench results
+
+ * results/output/kernel-ac12-output: add readprofile output
+
+2001-02-04 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+ * op_syscalls.c: small re-org, some micro-optimisations
+ to do_hash()
+
+ * pp/oprofpp.c: clean up --list-symbol output a little
+
+ * results/kernel-compile/overhead: update with results
+
+ * results/kernel-compile/time-aves.pl: add gnuplot output
+
+ * results/kernel-compile/raw/ : raw output files
+
+ * results/output/ : new dir for example output
+
+ * results/output/libc-2.1.92.so: output from libc profile
+
+ * results/output/kernel-ac12-output: output from kernel profile
+
+ * results/output/do_anonymous_page: detailed symbol profile
+
+ * results/output/oprofile.module: output for oprofile module
+
+2001-02-03 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+ * oprofile.h:
+ * op_syscalls.c: make do_hash() non-recursive
+
+ * oprofile.c: make thread wake up half as often
+
+ * dae/opd_proc.c: quiesce dump sysctl
+ make resilient against broken sample (don't exceed mmap)
+
+ * pp/oprofpp.c: --gcc-demangle -> --demangle, just too
+ annoying to live
+
+2001-02-01 John Levon <moz@compsoc.man.ac.uk>
+
+ * oprofile.h: add op_save_syscalls()
+
+ * oprofile.c: let interrupt_sleep_on() die
+ add kernel_only option
+ sysctl dumps everything it can now
+
+ * op_syscalls.c: add op_save_syscalls()
+
+ * dae/opd_proc.c:
+ * dae/oprofiled.c:
+ * dae/op_start: add --kernel-only
+
+ * doc/guide.lyx: mention --kernel-only
+
+ * TODO: update
+
+2001-02-01 John Levon <moz@compsoc.man.ac.uk>
+
+ * Makefile.in: split out op_init.c
+
+ * autogen.sh: new file
+
+ * configure.in: fix --with-cc. Split out op_init.c
+
+ * op_init.c: new file, to allow rest -march=i686
+
+ * oprofile.c: cut out init stuff to op_init.c
+
+ * opd_proc.c: more verbose
+
+ * results/kernel-compile/time-aves.pl: work with other
+ time format too
+
+2001-01-25 John Levon <moz@compsoc.man.ac.uk>
+
+ * configure.in: add --with-cc option
+
+ * pp/oprofpp.c: fix const discard warnings
+
+2001-01-25 John Levon <moz@compsoc.man.ac.uk>
+
+ * configure.in: must check for liberty *after*
+ libdl
+
+2001-01-24 John Levon <moz@compsoc.man.ac.uk>
+
+ * oprofile.c: we're not using op_check_ctr()
+ return value, so don't have one
+
+2001-01-23 John Levon <moz@compsoc.man.ac.uk>
+
+ * configure.in:
+ * op_syscalls.c:
+ * oprofile.c:
+ * oprofile.h: stripped the NMI error handling stuff
+
+ * op_events.c: fixed silly bug in the other place too :P
+
+ * dae/oprofiled.c: improved error messages
+
+2001-01-22 John Levon <moz@compsoc.man.ac.uk>
+
+ * op_events.c: fix silly bug so you can set both
+ counters at once
+
+ * oprofile.c: don't disable/enable counters in
+ the interrupt handler. It's expensive and
+ doesn't really buy anything.
+ Fix a silly EBUSY bug when open fails once.
+
+ * dae/op_start: don't remove old sample files
+ pass correct event to daemon for ctr1
+
+2001-01-22 John Levon <moz@compsoc.man.ac.uk>
+
+ * op_syscalls.c:do_hash(): use strcpy not strncpy.
+ It's probably faster, and if d_name.len is corrupted
+ the kernel has bigger things to worry about.
+
+2001-01-22 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/guide.lyx:
+ * dae/guide.html: update docs a little
+
+2001-01-22 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/op_start:
+ * op_user.h: bump up hash table size
+
+ * results/kernel-compile/overhead: intro to kernel
+ compile tests
+
+ * results/kernel-compile/time-aves.pl: script
+ to generate averages + overheads
+
+ * op_syscalls.c: three fixes to do_hash(). It's
+ going to be a pain to make iterative :(
+
+2001-01-21 John Levon <moz@compsoc.man.ac.uk>
+
+ * results/: Started a collection of results
+
+2001-01-20 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+ * configure.in: add comment
+
+ * Makefile.in: moved oprofile_k.c to op_syscalls.c, op_user.h added
+
+ * op_syscalls.c: rename of oprofile_k.c
+ map buffer is dead now
+ use vmalloc() and friends for hash map
+ Reworking of hash_map stuff into abb's linked
+ hash map structure
+
+ * op_user.h: new file representing shared structs etc.
+ between daemon and kernel module
+ Reworked OP_ flags in count.
+ Reworked hash map structure
+
+ * oprofile.c: get along with the new UP APIC stuff in 2.4.0ac9
+ remove extraneous lock_kernel()
+ default buffer size added
+ map buffer died
+ Use up_and_exit() in kernel thread to fix zombies :P
+ Set diethreaddie = 0 in start_thread()
+ oprof_put_mapping() added
+ we weren't turning OFF kernel/user counting when asked to
+
+ * oprofile.h: move shared stuff to op_user.h
+ increase the watermark to a much safer 768
+
+ * dae/Makefile.in: dependencies on op_user.h and version.h
+
+ * dae/op_start: hide confusing output of op_stop
+ --verbose option
+ map buffer died
+
+ * dae/opd_proc.c: --verbose option
+ don't insist on new sample files
+ Rework mapping code
+ Be a little more forgiving with unstattable images
+
+ * dae/opd_util.h:
+ * dae/opd_util.c: add fatal flag to opd_get_fsize().
+
+ * dae/oprofiled.h: --verbose option
+ move common code to op_user.h
+
+ * dae/oprofiled.c: add --verbose option (very verbose !)
+ map buffer died
+ Add code for unpacking mapping notifications, rework
+ mapping recognition
+
+ * doc/guide.html:
+ * doc/guide.lyx: some small updates
+
+ * pp/oprofpp.c: fix segfault on failure to open binary.
+ add --verbose option
+
+ * pp/oprofpp.h: add --verbose option
+
+2000-01-12 John Levon <moz@compsoc.man.ac.uk>
+
+ * oprofile.c: use standard kernel names for MSRs.
+ Don't re-do fixmap if UP oopser patch is installed.
+ Allow UP oopser to work if patches enabled, disable
+ otherwise
+
+ * oprofile.h: use standard kernel names for MSRs.
+
+ * oprofile_k.c: only include fixmap code if necessary
+
+ * configure.in: bump minor version
+
+2000-12-15 John Levon <moz@compsoc.man.ac.uk>
+
+ * configure.in: default to /lib/modules/`uname -r`/build
+ as kernel source directory
+
+ * doc/guide.lyx:
+ * doc/guide.html: update documentation
+
+2000-12-13 John Levon <moz@compsoc.man.ac.uk>
+
+ * configure.in: bump minor version
+
+ * oprofile.c: added KERN_<whatever> where needed,
+ exclude the Pentium IV
+
+ * pp/oprofpp.c: allow "oprofpp -l /bin/mv" and friends,
+ some minor fixes
+
+2000-12-12 John Levon <moz@compsoc.man.ac.uk>
+
+ * Makefile.in:
+ * configure.in: approximate working modversions
+ a little more
+
+ * op_events.c: op_help INST_RETIRED will print out
+ the value now
+
+ * op_ioctl.h:
+ * oprofile.c:
+ * oprofile.h:
+ * oprofile_k.c:
+ * dae/Makefile.in:
+ * dae/op_start:
+ * dae/op_stop:
+ * dae/opd_proc.c:
+ * dae/oprofctl.c:
+ * dae/oprofctl.h:
+ * dae/oprofiled.h: ioctl() didn't last long. Replaced with
+ sysctls. This has had a knock-on effect of moving the
+ start/stop mechanism into the driver open/close routines
+
+ * dae/oprofiled.c: must open devices in "reverse" order now
+
+ * oprofile_k.c: fix X86_FEATURE_PGE testing
+
+ * oprofile.c: use daemonize()
+
+ * pp/oprofpp.c: fix working on constant argv
+
+2000-11-04 John Levon <moz@compsoc.man.ac.uk>
+
+ * oprofile.c: what if signal happens later ?
+ * dae/opd_util.c: clarify opd_read_device() API
+
+2000-11-04 John Levon <moz@compsoc.man.ac.uk>
+
+ * ChangeLog: started ChangeLog (cue gc koan)
+ * op_ioctl.h: added FIXME comment
+ * oprofile.c: slight cleanup
+ * oprofile.h: cleanups, use u16 for data->ctrs,
+ data->next
+
+ * pp/oprofpp.c: added comments
+ * pp/oprofpp.h: fixed #defines
diff --git a/ChangeLog-2002 b/ChangeLog-2002
new file mode 100644
index 0000000..edb20ea
--- /dev/null
+++ b/ChangeLog-2002
@@ -0,0 +1,4416 @@
+2002-12-21 John Levon <levon@movementarian.org>
+
+ * Makefile.am: list module files explicitly, needed
+ for make dist from separate objdir
+
+ * configure.in: make both x86/ and ia64/ changelogs
+
+2002-12-21 John Levon <levon@movementarian.org>
+
+ * module/Makefile.am:
+ * configure.in: remove the ln -s arch in favour of
+ using -I and AC_SUBST
+
+ * module/ia64/arch.h:
+ * module/x86/arch.h: rename to op_arch.h
+
+ * utils/Makefile.am: fix make uninstall
+
+2002-12-21 John Levon <levon@movementarian.org>
+
+ * utils/Makefile.am: fix back-compat scripts install
+ for 2.5 kernel
+
+2002-12-19 Will Cohen <wcohen@redhat.com>
+
+ * utils/opcontrol: Revise kernel range computation.
+
+2002-12-19 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/op_time.cpp: minor formating fix
+ * pp/oprofpp.cpp: fix #656123 corner case with --separate-sample
+
+2002-12-17 John Levon <levon@movementarian.org>
+
+ * configure.in: remove oprof_report - breaks make dist
+
+2002-12-17 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libdb/*.c *.h:
+ * libutil/op_fileio.c:
+ * dae/opd_proc.c: doxygen comment fix
+
+2002-12-16 Philippe Elie <phil.el@wanadoo.fr>
+
+ * module/ia64/op_syscalls.c:
+ * module/x86/hammer_op_syscalls.c:
+ * module/x86/op_syscalls.c: u16 pid to u32, tested/compiled only with
+ 32 bits x86
+
+2002-12-15 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/string_manip.cpp: minor fix
+ * pp/derive_files.cpp: comment
+
+2002-12-14 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/format_output.cpp:
+ * pp/format_output.h:
+ * pp/outsymbflag.h:
+ * pp/opp_symbol.h: add an app_name field in file_location and
+ formater options for this field.
+
+ * pp/profile_container.cpp:
+ * pp/profile_container.h: add_samples() add app_name parameter
+
+ * pp/oprofpp.cpp:
+ * pp/op_to_source.cpp:
+ * pp/op_time.cpp:
+ * pp/op_time_options.cpp:
+ * pp/op_time_options.h: honor app_name parameter. No user visible
+ change except for op_time -l when profiling with --separate-samples
+
+ * doc/oprofile.1.in:
+ * doc/oprofile.xml: update doc
+
+2002-12-13 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml: lots of fixes. Remove sysctl documentation
+ as its really an internal feature and was cluttering up
+ the user manual.
+
+2002-12-13 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml: some clarifications on timer interrupt
+
+2002-12-12 John Levon <levon@movementarian.org>
+
+ * opcontrol: set one_enabled if timer interrupt. No
+ behaviour change, but "safer"
+
+2002-12-11 John Levon <levon@movementarian.org>
+
+ * pp/derive_files.h:
+ * pp/op_time.cpp:
+ * pp/op_time_options.cpp:
+ * pp/op_to_source.cpp:
+ * pp/opp_symbol.h:
+ * pp/profile.h:
+ * pp/profile_container.h:
+ * utils/Makefile.am: small pedantries
+
+2002-12-10 Will Cohen <wcohen@redhat.com>
+
+ * utils/op_dump_25:
+ * utils/opcontrol (do_dump): Correct TMPFILE.
+
+2002-12-10 Will Cohen <wcohen@redhat.com>
+
+ * daemon/opd_image.c (complete_dump): New.
+ * libop/op_config.h (OP_DUMP_STATUS): New.
+ * utils/op_dump_25: New file.
+ * utils/Makefile.am: Add op_dump_25.
+ * utils/opcontrol (do_dump): Revise how dump performed.
+
+2002-12-10 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/profile.cpp : oprofpp reported incorrectly counter setting when
+ using multiple counter. Fix #651183
+
+2002-12-10 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/op_time.cpp: honor --excude-symbols. Fix #651165
+
+2002-12-09 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/op_bfd.cpp: stupid segfault when filtering included symbols
+
+2002-12-09 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/op_bfd.h:
+ * libutil++/op_bfd.cpp: replace a 0(N²) by a 0(N) behavior
+
+ * pp/output_format.cpp: actualize comment
+
+2002-12-08 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/profile.cpp: use scoped_ptr<counter_profile_t>
+
+ * libopt++/popt_options.h:
+ * pp/counter_profile.cpp: minor cleanup
+
+2002-12-08 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/counter_profile.cpp:
+ * pp/counter_profile.h: use scoped_ptr
+
+2002-12-08 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/counter_profile.h:
+ * pp/counter_profile.cpp: relax samples_db_t sooner
+
+2002-12-08 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opp_samples_files.cpp:
+ * pp/opp_samples_files.h:
+ * pp/samples_container.cpp:
+ * pp/samples_container.h:
+ * pp/samples_file.cpp:
+ * pp/samples_file.h: rename class samples_file_t to counter_profile_t
+ rename class opp_samples_files to profile_t
+ rename class samples_container_t to profile_container_t
+ rename file using the new class name as filename w/o _t suffix
+
+ * pp/format_output.cpp:
+ * pp/format_output.h:
+ * pp/op_merge.cpp:
+ * pp/op_time.cpp:
+ * pp/op_to_source.cpp:
+ * pp/oprofpp.cpp:
+ * pp/symbol_container_imp.cpp:
+ * pp/symbol_container_imp.h:
+ * pp/Makefile.am: reflect above class/file name change
+
+2002-12-06 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libdb/db_manage.c:
+ * libdb/db_hash.h: db_init() new to properly initialize a samples_db_t
+
+ * dae/opd_image.c:
+ * daemon/opd_imge.c: earlier init a samples_db_t object using
+ db_init() rather a memset. This fix a potential bogosity cause we
+ closed a lot of time file descriptor 0
+
+2002-12-06 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/opd_image.c:
+ * dae/opd_image.h:
+ * dae/opd_kernel.c: use hash table entry 0 for kernel and module image
+
+2002-12-04 John Levon <levon@movementarian.org>
+
+ * pp/opp_symbol.h:
+ * pp/opp_symbol.cpp:
+ * pp/format_output.h:
+ * pp/format_output.cpp:
+ * others from above: create format_output namespace, some
+ clean up
+
+2002-12-04 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/opd_image.c: revert last change, it break daemon...
+
+2002-12-04 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/opd_image.c: re-enable opd_check_image_mtime() it's not
+ perfect but better than nothing
+
+ * libutil++/cverb.cpp: comment fix
+
+2002-12-04 Will Cohen <wcohen@redhat.com>
+
+ * utils/opcontrol: Revised checking to determine kernel
+ interface.
+
+
+2002-12-04 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libdb/db_test.c: measure system + user time
+
+ * dae/oprofiled.c: better error message
+ * daemon/oprofiled.c: write_abi() is static
+
+2002-12-03 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libdb/db_stat.c:
+ * libdb/db_debug.c: Alex whisp me than a few code was not 64 bits
+ size_t safe.
+
+2002-12-03 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml:
+ * doc/oprofile.1.in:
+ * doc/Makefile.am: remove references to deprecated stuff
+
+2002-12-03 John Levon <levon@movementarian.org>
+
+ * utils/opcontrol: add --version
+
+2002-12-03 John Levon <levon@movementarian.org>
+
+ * utils/op_start:
+ * utils/op_start_25:
+ * utils/op_stop_25:
+ * utils/op_stop: print deprecation notice
+
+2002-12-03 John Levon <levon@movementarian.org>
+
+ * utils/op_session.c:
+ * utils/op_dump: print deprecation notice
+
+2002-12-03 John Levon <levon@movementarian.org>
+
+ * utils/opcontrol: do not shutdown on --reset. Send
+ signal on --reset/--save like op_session. Try to dump
+ like op_session to hack race "fix"
+
+2002-12-03 John Levon <levon@movementarian.org>
+
+ * utils/opcontrol: complain on opcontrol --save
+
+2002-12-03 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/opd_kernel.c:
+ * daemon/opd_kernel.h: minor cleanup
+
+ * libabi/abi.cpp:
+ * libabi/abi_test.cpp:
+ * libabi/op_import.cpp: fix bad include filename.
+
+2002-12-03 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libdb/.cvsignore:
+ * libdb/Makefile.am:
+ * libdb/*.c --> db-hash-name.c to db_name.c
+
+ * dae/opd_image.h:
+ * daemon/opd_image.h:
+ * pp/samples_file.h: include db_hash.h
+
+2002-12-03 Philippe Elie <phil.el@wanadoo.fr>
+
+ * gui/oprof_start_config.cpp: allow default value change w/o
+ breaking actual user.
+
+2002-12-03 Philippe Elie <phil.el@wanadoo.fr>
+
+ * TODO: update
+
+ * dae/opd_image.h:
+ * dae/opd_kernel.c:
+ * dae/opd_kernel.h:
+ * dae/opd_parse_proc.c:
+ * dae/opd_proc.c:
+ * dae/opd_proc.h:
+ * dae/opd_sample_files.c:
+ * dae/oprofiled.c:
+ * daemon/opd_image.h:
+ * pp/op_merge.cpp:
+ * pp/samples_file.h:
+ * pp/samples_file.cpp:
+ * pp/Makefile.am:
+ * libabi/Makefile.am:
+ * libabi/abi.cpp:
+ * libabi/abi_test.cpp:
+ * libabi/op_import.cpp: use hash table implementation of libdb
+
+ * gui/oprof_start.cpp:
+ * gui/oprof_start_config.cpp:
+ * gui/oprof_start_config.h:
+ * gui/ui/oprof_start.base.ui:
+ * utils/op_start:
+ * doc/oprofile.1.in:
+ * doc/oprofile.xml: remove module hash table size
+
+ * libdb/.cvsignore: update
+ * libdb/Makefile.am: build libdb-hash.a
+ * libdb/db-hash.h:
+ * libdb/db-hash-debug.c:
+ * libdb/db-hash-manage.c:
+ * libdb/db-hash-test.c:
+ * libdb/db-hash-insert.c:
+ * libdb/db-hash-stat.c:
+ * libdb/db-hash-travel.c: new files implementing a growable hash table
+ * libdb/Makefile.am: update
+
+ * libop/op_config_24.h: remove module hash table. Increase
+ OP_PRE_WATERMARK, OP_DEFAULT_BUF_SIZE.
+ * libop/op_interface.h: struct op_sample update.
+
+ * module/oprofile.h:
+ * module/oprofile.c: remove hash table
+
+2002-12-02 John Levon <levon@movementarian.org>
+
+ * configure.in: remove annoying AC_REVISION()
+
+2002-12-02 John Levon <levon@movementarian.org>
+
+ * utils/opcontrol: couple of minor cleanups
+
+2002-12-02 John Levon <levon@movementarian.org>
+
+ * utils/opcontrol: fix --deinit, complain on missing
+ argument
+
+2002-12-02 Will Cohen <wcohen@redhat.com>
+
+ * doc/Makefile.am: Generate opcontrol.
+ * doc/oprofile.1.in: Add opcontrol information.
+ * doc/oprofile.xml: Add opcontrol information.
+
+2002-12-01 Will Cohen <wcohen@redhat.com>
+
+ * utils/Makefile.am: Add opcontrol.
+ * utils/opcontrol: New.
+
+2002-12-01 John Levon <levon@movementarian.org>
+
+ * various files: don't use db_tree name outside of libdb,
+ it's implementation detail for most case
+
+2002-11-29 Graydon Hoare <graydon@redhat.com>
+
+ * module/x86/op_model_p4.c: fix dropped overflows.
+
+2002-11-26 Graydon Hoare <graydon@redhat.com>
+
+ * module/x86/op_model_p4.c: fix CCCR-clearing logic.
+ * module/x86/cpu_type.c: re-enable Pentium IV.
+
+2002-11-25 John Levon <levon@movementarian.org>
+
+ * module/x86/cpu_type.c: disable Pentium IV till it works
+
+2002-11-23 Philippe Elie <phil.el@wanadoo.fr>
+
+ * doc/oprofile.xml: start a FAQ. Clarify debug information vs
+ symbol information. Explain why we don't use dynamic symbol
+
+2002-11-20 John Levon <levon@movementarian.org>
+
+ * daemon/oprofiled.c:
+ * utils/op_start_25: kernel_only is a no-op on 2.5, no point
+ in it existing
+
+2002-11-19 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/oprofiled.c: /dev/oprofile/kernel_only doesn't exists
+ in timer int mode (second pass to fix #637804 ...)
+
+2002-11-17 Graydon Hoare <graydon@redhat.com>
+
+ * module/x86/op_apic.h:
+ * module/x86/op_apic.c: revert, use copy of kernel code.
+
+2002-11-16 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/opd_kernel.c:
+ * dae/opd_mapping.c:
+ * dae/opd_proc.c:
+ * daemon/opd_image.c:
+ * daemon/opd_kernel.c:
+ * libop++/op_mangling.h:
+ * libutil++/cverb.h:
+ * pp/opp_samples_files.cpp:
+ * pp/samples_file.cpp: doxygen fix
+ * doc/srcdoc/Doxyfile: bump to 0.5 cvs
+
+2002-11-14 Will Cohen <wcohen@redhat.com>
+
+ * gui/Makefile.am: Use $(bindir).
+ * oprof_report/Makefile.am: Use $(bindir).
+
+2002-11-15 Dave Jones <davej@suse.de>
+
+ * module/x86/cputype.c: Make the AMD case a bit simpler.
+
+2002-11-14 John Levon <levon@movementarian.org>
+
+ * dae/Makefile.am:
+ * daemon/Makefile.am: proper fix for c++ link
+ as suggested by Alexandre Duret-Lutz
+
+2002-11-14 Philippe Elie <phil.el@wanadoo.fr>
+
+ * Makefile.am: we installed module in the wrong directory.
+
+2002-11-14 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil/op_file.c: op_simplify_path_name(): strip leading '/'
+ * daemon/oprofiled.c:
+ * dae/oprofiled.c: fix incorrect specification of vmlinux file
+ through --vmlinux=/foo//bar fixing #637805
+
+2002-11-14 Philippe Elie <phil.el@wanadoo.fr>
+
+ * utils/op_start_25: /dev/oprofile/kernel_only doesn't exists
+ in timer int mode. fix #637804
+
+2002-11-14 John Levon <levon@movementarian.org>
+
+ * dae/*:
+ * daemon/*:
+ * libutil++/op_bfd.h:
+ * pp/samples_container.cpp:
+ * pp/samples_container.h: doxygen anality
+
+2002-11-14 John Levon <levon@movementarian.org>
+
+ * libopt++/popt_options.h:
+ * libopt++/popt_options.cpp: place in popt
+ namespace to avoid clash with getopt.h
+
+ * libabi/abi_test.cpp:
+ * libabi/op_import.cpp:
+ * pp/op_merge.cpp:
+ * pp/op_time_options.cpp:
+ * pp/op_to_source_options.cpp:
+ * pp/oprofpp_options.cpp:
+ * pp/session.cpp: fix for above
+
+ * libabi/abi.cpp:
+ * libabi/abi.h: g++ 3.2 fixes
+
+ * libabi/op_import.cpp: uninline extract
+
+ * dae/Makefile.am:
+ * daemon/Makefile.am: fix c++ link hack for -Werror
+
+2002-11-13 Graydon Hoare <graydon@redhat.com>
+
+ ( this changeset is mostly Dave Jones' work )
+
+ * README:
+ * TODO:
+ * configure.in:
+ * doc/oprofile.xml:
+ * libop/op_cpu_type.c:
+ * libop/op_cpu_type.h:
+ * libop/op_events.c:
+ * utils/op_help.c:
+ * module/compat.h:
+ * module/compat24.h:
+ * module/op_util.c:
+ * module/x86/Makefile.in:
+ * module/x86/apic_compat.h:
+ * module/x86/arch.h:
+ * module/x86/cpu_type.c:
+ * module/x86/op_fixmap.c:
+ * module/x86/op_nmi.c: minor additions for hammer support.
+
+ * module/x86/op_apic.c:
+ * module/x86/op_apic.h: major cleanup; add hammer support.
+
+ * module/x86/hammer_entry.S:
+ * module/x86/hammer_ia32entry.S:
+ * module/x86/hammer_op_syscalls.c:
+ * module/x86/hammer_oprofile_nmi.S: new hammer support files.
+
+2002-11-14 John Levon <levon@movementarian.org>
+
+ * configure.in: hack around case where clean checkout
+ then ./configure --with-kernel-support
+
+2002-11-12 Graydon Hoare <graydon@redhat.com>
+
+ * autogen.sh: support overriding autotool binary names.
+
+2002-11-11 Philippe Elie <phil.el@wanadoo.fr>
+
+ * configure.in: honor --with-extra-libs
+
+2002-11-11 Philippe Elie <phil.el@wanadoo.fr>
+
+ * configure.in: add -W -Wall and optionnaly -Werror to user space
+ compilation
+
+2002-11-11 John Levon <levon@movementarian.org>
+
+ * dae/Makefile.am:
+ * daemon/Makefile.am: don't dist dummy.cpp
+
+2002-11-11 John Levon <levon@movementarian.org>
+
+ * dae/Makefile.am:
+ * daemon/Makefile.am: hack to fix --enable-abi
+
+2002-11-10 John Levon <levon@movementarian.org>
+
+ * configure.in:
+ * gui/Makefile.am:
+ * oprof_report/Makefile.am: only use X libs where
+ they're actually wanted
+
+2002-11-10 John Levon <levon@movementarian.org>
+
+ * configure.in: make included sstream work again
+
+2002-11-08 Will Cohen <wcohen@redhat.com>
+
+ * doc/oprofile.xml: Update with IA64 information.
+
+2002-11-10 John Levon <levon@movementarian.org>
+
+ * Makefile.am: remove oprof_report from SUBDIRS to
+ avoid separate objdir problem
+
+2002-11-10 John Levon <levon@movementarian.org>
+
+ * most Makefile.am: do the dist_sources trick
+ properly
+
+2002-11-10 John Levon <levon@movementarian.org>
+
+ * Makefile.am:
+ * configure.in:
+ * dae/Makefile.am:
+ * daemon/Makefile.am:
+ * utils/Makefile.am: s/WITH_KERNEL_SUPPORT/kernel_support
+
+ * configure.in:
+ * dae/Makefile.am:
+ * dae/oprofiled.c:
+ * daemon/Makefile.am:
+ * daemon/oprofiled.c:
+ * libabi/Makefile.am: approximate working --enable-abi more
+
+2002-11-10 John Levon <levon@movementarian.org>
+
+ * dae/oprofiled.c:
+ * daemon/oprofiled.c: abi tidy
+
+2002-11-10 John Levon <levon@movementarian.org>
+
+ * autogen.sh: be verbose
+
+ * gui/Makefile.am:
+ * gui/ui/Makefile.am:
+ * oprof_report/Makefile.am:
+ * oprof_report/ui/Makefile.am: remove duplicate
+ set MOC/UIC
+
+2002-11-10 John Levon <levon@movementarian.org>
+
+ * Makefile.am: add comment
+
+ * configure.in: no need to subst OPROFILE_25
+
+2002-11-09 John Levon <levon@movementarian.org>
+
+ * TODO: update
+
+ * configure.in:
+ * most Makefile.am: make separate objdir work,
+ except for module (impossible I suppose)
+
+2002-11-09 John Levon <levon@movementarian.org>
+
+ * autogen.sh: use --foreign
+
+2002-11-09 John Levon <levon@movementarian.org>
+
+ * configure.in: fix --with-kernel-support
+
+ * doc/.cvsignore: add *.1
+
+ * libabi/Makefile.am: don't install abi_test
+
+2002-11-09 John Levon <levon@movementarian.org>
+
+ * all cvsignore: add Makefile.in
+
+ * gui/Makefile.am: move EXTRA_DIST out of qt check
+
+ * gui/ui/Makefile.am:
+ * oprof_report/ui/Makefile.am: fix AM_CPPFLAGS typo
+
+2002-11-09 John Levon <levon@movementarian.org>
+
+ * all build files: use automake, written by Phil
+
+2002-11-09 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/samples_file.cpp: check than samples files version
+ match expected version fixing #635759
+
+2002-11-07 John Levon <levon@movementarian.org>
+
+ * configure.in:
+ * module/compat.h:
+ * module/compat24.h:
+ * module/op_dname.c:
+ * module/oprofile.c:
+ * module/x86/op_fixmap.c:
+ * module/x86/op_nmi.c: remove 2.5 support from old
+ module code
+
+2002-11-06 Will Cohen <wcohen@redhat.com>
+
+ * configure.in: Tests for ia64 architecture.
+ * dae/opd_mapping.c: Added includes.
+ * oprofile/dae/oprofiled.c (opd_do_samples): Typecast.
+ * libop/op_cpu_type.c (cpu_names, cpu_nr_counters): Add IA64 info.
+ * libop/op_cpu_type.h (op_cpu): Add IA64 enums.
+ * libop/op_events.c: Add defines for IA64 and IA64 events.
+ * libop++/op_print_event.cpp: Change include order to work on IA64.
+ * module/oprofile.c: Include "arch.h" file.
+ (evict_op_entry): Use IRQ_ENABLED macro.
+ (op_do_profile): Use INST_PTR and STATUS macros.
+ (oprof_init_data): Factor out computation.
+ * module/op_util.c (rvmalloc, rvfree): Typecasts.
+ * module/x86/arch.h: New.
+ * README: Update.
+ * utils/op_help.c (main): Add IA64 information.
+
+ * module/ia64/arch.h:
+ * module/ia64/cpu_type.c:
+ * module/ia64/IA64entry.h:
+ * module/ia64/IA64minstate.h:
+ * module/ia64/IA64syscallstub.h:
+ * module/ia64/Makefile.in:
+ * module/ia64/op_ia64_model.h:
+ * module/ia64/op_pmu.c:
+ * module/ia64/oprofile_stubs.S:
+ * module/ia64/op_syscalls.c: New.
+
+2002-11-06 John Levon <levon@movementarian.org>
+
+ * configure.in: 0.5cvs
+
+ * Makefile.in: mention doxyfile in release steps
+
+2002-11-06 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/op_to_source.cpp: op_to_source --source-with-assembly: avoid
+ to be confused by source line which look like an asm line and
+ stop incorrectly the output. This change go in 0.4 release
+
+2002-11-06 John Levon <levon@movementarian.org>
+
+ * configure.in: bump to 0.4 in prep for release
+
+2002-11-06 John Levon <levon@movementarian.org>
+
+ * module/x86/cpu_type.c: detect if we actually are
+ using HT (from Alex T)
+
+2002-11-05 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml: manual fixes from Will Cohen
+
+2002-11-01 John Levon <levon@movementarian.org>
+
+ * daemon/opd_image.c: fix lookup_dcookie usage
+
+ * libabi/.cvsignore: add
+
+2002-11-01 Philippe Elie <phil.el@wanadoo.fr>
+
+ * module/x86/op_apic.c: restore correctly the lvtpc register
+
+2002-11-01 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libop/op_hw_config.h: define DCOOKIE_SHIFT
+ * daemon/opd_image.c: use it
+
+2002-11-01 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/Makefile.in: cleanup, build and use libpp.a
+
+2002-10-31 John Levon <levon@movementarian.org>
+
+ * pp/counter_array.cpp: using namespace std
+
+2002-10-31 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/.cvsignore:
+ * dae/opd_image.c:
+ * dae/opd_kernel.c:
+ * dae/opd_sample_files.c:
+ * dae/opd_stats.c:
+ * dae/oprofiled.c:
+ * daemon/opd_image.c:
+ * daemon/opd_sample_files.c:
+ * libop/op_config_24.h: cleanup, including some little merging
+ from daemon to dae
+
+ * daemon/opd_image.c: change dcookie hashing function
+
+ * doc/oprofile.xml: typo
+
+2002-10-26 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/file_manip.cpp:
+ * libutil++/op_bfd.h:
+ * libutil++/op_bfd.cpp: cleanup
+
+ * pp/counter_array.h:
+ * pp/counter_array.cpp: add a bool empty() member to counter_array_t
+ * pp/sample_container_imp.cpp: use it
+
+2002-10-26 Philippe Elie <phil.el@wanadoo.fr>
+
+ * configure.in: minor cleanup. Use config.h rather than gcc -D option
+
+ * libutil/op_libiberty.h:
+ * libutil++/op_bfd.h:
+ * pp/opp_symbol.h: #include <config.h>
+
+ * libutil/Makefile.in:
+ * pp/Makefile.in: remove BFD_CXXFLAGS
+
+2002-10-24 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/op_bfd.cpp:
+ * libutil++/op_bfd.h: allow to specify explicetly on which symbol we
+ want to work.
+
+ * pp/op_to_source_options.h:
+ * pp/op_to_source_options.cpp:
+ * pp/op_to_source.cpp: handle --include-symbol, for asm output only
+ output for symbols with samplels or selected symbols.
+
+ * pp/oprofp.cpp:
+ * pp/samplesc_ontainer.cpp: minor change to reflect op_bfd api change
+
+2002-10-24 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/opd_image.c: revert 64 bit dcookie patch commited
+ accidentally with 2002-10-18 abi patch.
+
+2002-10-21 Graydon Hoare <graydon@redhat.com>
+
+ * doc/oprofile.xml: Describe op_import and --enable-abi.
+
+2002-10-20 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/Makefile.in:
+ * pp/session.cpp:
+ * pp/session.h:
+ * pp/op_time_options.cpp:
+ * pp/op_to_source.cpp:
+ * pp/oprofpp.cpp:
+ * doc/oprofile.1.in:
+ * doc/oprofile.xml: handle --session options
+
+2002-10-19 John Levon <levon@movementarian.org>
+
+ * configure.in: AC_HELP_STRING is too new for my autoconf
+
+2002-10-18 Graydon Hoare <graydon@redhat.com>
+
+ * libabi/*: Add support for abi descriptions, for portability.
+ * daemon/oprofiled.c:
+ * dae/oprofiled.c: Emit abi description on startup.
+ * configure.in: Add --enable-abi option.
+ * make.common.in:
+ * Makefile.in: Support building libabi/
+
+2002-10-19 John Levon <levon@movementarian.org>
+
+ * utils/op_start_25: grep -o does not exist on any of
+ my systems - fix
+
+2002-10-19 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/op_bfd.cpp: calculate symbol size after removing duplicate
+ symbol. Fix #625678
+
+2002-10-19 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/op_to_source.cpp:
+ * pp/op_to_source_options.cpp:
+ * pp/op_to_source_options.h:
+ * doc/oprofile.1.in:
+ * doc/oprofile.xml: allow to pass multiple options to objdump
+
+ * pp/opp_symbol.h:
+ * pp/samples_container.cpp: store symbol size in symbol_entry object.
+
+2002-10-19 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/child_reader.cpp: In some pathological case getline()
+ finished too early when child process write on stderr.
+
+2002-10-18 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutill++/child_reader.cpp: read_block() : cumulate stderr
+ output rather to overwrite always the same buffer space ...
+
+2002-10-16 John Levon <levon@movementarian.org>
+
+ * utils/op_start_25: check if mounted, from Will Cohen
+ Also mkdir the mountpoint
+
+2002-10-16 Philippe Elie <phil.el@wanadoo.fr>
+
+ * configure.in: get linux include path earlier
+
+2002-10-15 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/oprofiled.c:
+ * daemon/oprofiled: strerrno --> strerror
+
+2002-10-14 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libop/op_events.c: typo in L2_DBUS_BUSY_RD PPro event name
+
+2002-10-13 Philippe Elie <phil.el@wanadoo.fr>
+
+ * README: update contrib
+ * TODO: update
+
+ * gui/oprof_start.cpp: better error message, fixme removal
+
+ * libdb/db-insert.c: fix samples count overflow.
+
+ * libdb/db.h:
+ * libdb/db-manage.c:
+ * libdb/db-debug.c: don't use page zero, use this value as nil page
+ number, avoid to touch mmaped memory when growing the samples file.
+ * libop/op_config.h: bump OPD_VERSION
+
+2002-10-12 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/samples_file.h:
+ * pp/samples_file.cpp: move class opp_samples_files ...
+ * pp/opp_samples_files.h:
+ * pp/opp_samples_files.cpp: to these new files
+
+ * pp/Makefile.in:
+ * pp/op_to_source.cpp:
+ * pp/oprofpp.cpp: reflect above change
+
+2002-10-12 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/opd_sample_files.c: fixme remove
+ * dae/oprofiled.c:
+ * daemon/oprofiled.c: minor error message improvement
+
+ * pp/op_time.cpp:
+ * pp/symbol_container.cpp: fixme remove
+
+ * pp/samples_file.cpp:
+ * pp/sample_file.h: privatize more data members
+
+2002-10-12 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/utility.h: op_ratio() new
+ * pp/op_time.cpp:
+ * pp/op_to_source.cpp:
+ * pp/opp_symbol.cpp:
+ * pp/samples_container.cpp: use op_ratio()
+
+2002-10-11 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/file_manip.cpp:
+ * libutil++/filename_match.cpp:
+ * libutil++/string_manip.cpp:
+ * libutil++/string_manip.h: fix dirname(), basename(), remove rtrim()
+
+2002-10-07 John Levon <levon@movementarian.org>
+
+ * daemon/opd_image.h:
+ * daemon/opd_image.c:
+ * daemon/oprofiled.c:
+ * libop/op_interface_25.h: update to latest interface
+
+2002-10-06 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/opd_image.c: allow to free(image->app_name)
+
+2002-10-05 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/opd_image.c:
+ * dae/opd_image.c: spacing
+
+ * dae/opd_mapping.c:
+ * dae/opd_mapping.h: kill op_grow_maps() simplify adding map path
+ * dae/opd_parse_proc.c: use opd_add_mapping()
+
+2002-10-05 Philippe Elie <phil.el@wanadoo.fr>
+
+ * TODO: update
+
+ * doc/oprofile.xml: more doc in interpreting results
+
+2002-10-04 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opp_symbols.cpp:
+ * pp/opp_symbols.h:
+ * pp/outsymbflag.h: implement 'q' 'Q' format flags. Fix #618165
+ * pp/op_time_options.cpp: reject these formats for op_time
+ * doc/oprofile.1.in:
+ * doc/oprofile.xml: document them
+
+2002-10-02 John Levon <levon@movementarian.org>
+
+ * Makefile.in: use -P to strip dead dirs on dist
+
+ * dae/opd_parse_proc.c: spacing
+
+2002-10-02 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libdb/db-*.c/*.h: typedef tweaking for 64 bits arch (signaled
+ by Dave Jones)
+
+ * remove libdb/ChangeLog, old entries are:
+
+ 2002-04-20 Philippe Elie <phil.el@wanadoo.fr>
+ * db-insert.c: check for count overflow
+
+ 2002-04-20 Philippe Elie <phil.el@wanadoo.fr>
+ * db-manage.c: properly handle already existing db file
+ * db.h: extern "C" wrapper
+
+ 2002-04-19 Philippe Elie <phil.el@wanadoo.fr>
+ * *.c;*.h: make plugin db in oprofile more easy.
+
+ 2002-04-18 Philippe Elie <phil.el@wanadoo.fr>
+ * *.c;*.h: prefix all public identifier with db_.
+ Use typedef as much I can rather than plain unsigned int.
+
+ 2002-04-17 Philippe Elie <phil.el@wanadoo.fr>
+ * db-debug.c:
+ * db-insert.c:
+ * db-manage.c:
+ * dbtest.c:
+ * db-travel.c:
+ * db.h: add file locking and necessary stuff to allow
+ plugging db in an imbedded file format like oprofile
+ samples files.
+
+ 2002-04-16 Philippe Elie <phil.el@wanadoo.fr>
+ * db-manage.c: silly bug fix, db works now with
+ malloc/realloc or mmap/mremap memory allocation
+ selected at compile time.
+
+ 2002-04-14 Philippe Elie <phil.el@wanadoo.fr>
+ * first import standalone code to test btree samples files
+
+2002-10-02 Philippe Elie <phil.el@wanadoo.fr>
+
+ * module/x86/op_msr.h: Hyper threading #define
+ * module/x86/cpu_type.c: include op_msr.h
+
+2002-10-02 Philippe Elie <phil.el@wanadoo.fr>
+
+ * */*.cpp: using std::xxx; --> using namespace std;
+
+2002-10-01 Will Cohen <wcohen@redhat.com>
+
+ * module/x86/cpu_type.c (p4_threads): New.
+ (get_cpu_type): Use p4_threads().
+ * doc/oprofile.xml: Add comment about P4 HT support.
+
+2002-10-01 John Levon <levon@movementarian.org>
+
+ * daemon/opd_image.c: fix non --separate-samples. Still broke.
+
+2002-10-01 John Levon <levon@movementarian.org>
+
+ * libop/op_cpu_type.h:
+ * libop/op_cpu_type.c: make this work on 2.5/normal both.
+ Does not respect different mounted oprofilefs (yet)
+
+2002-10-01 John Levon <levon@movementarian.org>
+
+ * daemon/.cvsignore: add
+
+ * libop/op_interface_25.h:
+ * daemon/opd_image.h:
+ * daemon/opd_image.c:
+ * daemon/oprofiled.c: fixups for new encoded interface. Fix
+ --separate-samples
+
+ * utils/op_start_25: startup fixes
+
+2002-09-26 Will Cohen <wcohen@redhat.com>
+
+ * module/x86/op_model_p4.c: Correct TC_DELIVER_MODE cccr select.
+
+2002-09-23 Graydon Hoare <graydon@redhat.com>
+
+ * dae/oprofiled.c:
+ * daemon/op_sample_files.c:
+ * daemon/oprofiled.c:
+ * pp/op_to_source.c:
+ * utils/op_help.c: u8 unit mask -> u16 unit-mask. I'm not sure this
+ catches *all* the instances, but it does appear to be an improvement
+
+2002-09-30 William Cohen <wcohen@redhat.com>
+
+ * libutil++/string_manip.cpp (sample_filename): Correct declaration.
+ * pp/samples_container.h: Correct add_samples() declaration.
+
+2002-09-29 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/string_manip.cpp:
+ * libutil++/string_manip.h: sample_filename() new
+
+ * pp/samples_container.cpp:
+ * pp/samples_container.h: add_samples() new
+
+ * pp/op_merge.cpp:
+ * pp/op_time.cpp:
+ * pp/oprofpp.cpp:
+ * pp/samples_file.cpp: use them + minor cleanup
+
+2002-09-28 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libopt++/popt_options.cpp: fix #615760, in rare case
+ oprofpp called with lot of invalid arguments segfault
+ during the help printing. All post-profile tools are
+ concerned by this fix.
+
+ * doc/oprofile.xml: small improvements
+
+ * libutil++/op_bfd.cpp: improve error message when bfd_openr() fails.
+
+ * TODO: update
+
+2002-09-28 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/opd_image.c:
+ * dae/opd_kernel.c:
+ * dae/opd_parse_proc.c:
+ * dae/opd_parse_parse.h:
+ * dae/opd_proc.c:
+ * dae/opd_sample_files.c:
+ * daemon/opd_image.c:
+ * daemon/opd_kernel.c:
+ * daemon/opd_sample_files.c:
+ * libop/op_cpu_type.c:
+ * libop/op_events.c:
+ * libop/op_events_desc.c:
+ * libopt++/popt_options.cpp:
+ * libutil/op_deviceio.c:
+ * libutil/op_file.c:
+ * libutil++/file_manip.cpp:
+ * libutil++/file_manip.h:
+ * libutil++/string_manip.h:
+ * pp/op_to_source.cpp: doxygen fix
+
+2002-09-27 John Levon <levon@movementarian.org>
+
+ * configure.in: add --with-kernel-support for 2.5
+
+ * daemon/oprofiled.c: fix comment, give exit message on sig
+
+ * utils/Makefile.in:
+ * utils/op_stop_25: add 2.5 op_stop, no 2.5 op_dump
+
+ * utils/op_start_25: use enable
+
+2002-09-25 Bob Montgomery <bobm@fc.hp.com>
+
+ * module/oprofile.c: avoid to dump zero samples count, fix #615087
+
+2002-09-25 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/opd_image.c: fix #615166, ensure we recognize an
+ existing image struct so we don't try to create db_tree_t
+ object for the same samples files.
+ * db/db-debug.c: display page index when something goes wrong
+ * db/db-insert.c: be more strict on assertion
+
+2002-09-25 Philippe Elie <phil.el@wanadoo.fr>
+
+ * doc/Makefile.in: remove dependencies for doc/html.xsl
+
+2002-09-25 Philippe Elie <phil.el@wanadoo.fr>
+
+ * doc/xsl/.cvsignore: new
+ * doc/oprofile.xml: document watchdog problem
+
+2002-09-25 John Levon <levon@movementarian.org>
+
+ * module/x86/op_nmi.c: OP_MAX_CPUS is not necessarily
+ static so use NR_CPUS for array instead. Fix a prototype.
+
+2002-09-23 Graydon Hoare <graydon@redhat.com>
+
+ * doc/oprofile.xml: Add some P4 documentation.
+ * configure.in: Add detection of different stylesheet paths.
+ * doc/xsl/xhtml.xsl.in: Parameterize by configure's result.
+ * doc/xsl/xhtml.xsl: Remove.
+ * dae/opd_sample_files.c: Change unit mask from 8 to 16 bits.
+ * gui/oprof_start.cpp: Change number of unit masks from 7 to 16.
+ * gui/ui/oprof_start.base.ui: Likewise.
+ * libop/op_cpu_type.c: Add P4 CPU type.
+ * libop/op_events.h: Change unit mask bit width, number.
+ * libop/op_events.c: Add P4 events, unit masks.
+ * libop_op_hw_config.h: Set OP_MAX_COUNTERS to 8.
+ * libop++/op_print_event.cpp: Change unit mask bit width.
+ * libop++/op_print_event.h: Likewise.
+ * module/oprofile.c: Add extra sysctls for counters 5-8.
+ * module/x86/Makefile.in: Add op_model_p4.o to obj list.
+ * module/x86/cpu_type.c: Change CPU identification to handle P4.
+ * module/x86/op_apic.c: (enable_apic): APIC_MAXLVT < 4, not != 4.
+ (check_cpu_ok): Accept CPU_P4.
+ * module/x86/op_model_p4.c: New file.
+ * module/x86/op_nmi.c: (get_model): Handle CPU_P4.
+ Add sysctl names for counters 5-8.
+ * module/x86/op_x86_model.h: Declare extern op_p4_spec.
+
+2002-09-24 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/opd_image.c:
+ * dae/opd_image.h:
+ * dae/opd_kernel.c:
+ * dae/oprofiled.c:
+ * dae/p_module.h:
+ * dae/opd_image.c:
+ * dae/opd_kernel.c:
+ * dae/oprofiled.c:
+ * dae/p_module.h: small blank/comment change to minimize
+ diff between daemon and dae dir.
+
+2002-09-23 John Levon <levon@movementarian.org>
+
+ * configure.in: fix for 2.5 patch to build
+
+2002-09-23 John Levon <levon@movementarian.org>
+
+ * utils/Makefile.in:
+ * utils/op_start_25: 2.5 patch start script
+
+2002-09-23 John Levon <levon@movementarian.org>
+
+ * dae/opd_image.c:
+
+ * libop/op_cpu_type.c: fix arrays
+
+2002-09-23 John Levon <levon@movementarian.org>
+
+ * utils/op_start: use right value for RTC CPU
+
+2002-09-23 John Levon <levon@movementarian.org>
+
+ * libop/op_config.h:
+ * libop/op_config_24.h:
+ * libop/op_config_25.h: split config file up
+
+ * daemon/opd_kernel.c:
+ * daemon/oprofiled.c: include op_config_25.h
+
+ * dae/oprofiled.c:
+ * dae/opd_image.c:
+ * dae/opd_kernel.c:
+ * dae/opd_mapping.c: include op_config_24.h
+
+ * module/oprofile.h: include op_config_24.h
+
+ * gui/oprof_start.cpp:
+ * gui/oprof_start_config.cpp: fix from above
+ (old support only right now)
+
+ * libop/op_cpu_type.h: introduce 2.5-patch CPU_TIMER_INT
+
+2002-09-23 John Levon <levon@movementarian.org>
+
+ * libop/op_interface_25.h: 2.5 interface
+
+ * daemon/opd_image.c:
+ * daemon/opd_sample_files.c:
+ * daemon/oprofiled.c:
+
+ * libop++/op_print_event.h: fix header
+
+ * pp/op_to_source.cpp: change from above
+
+2002-09-23 John Levon <levon@movementarian.org>
+
+ * daemon/: new 2.5 patch daemon code. WIP
+
+ * configure.in:
+ * Makefile.in: detect 2.5 patch and build appropriately
+
+2002-09-23 John Levon <levon@movementarian.org>
+
+ * module/x86/op_msr.h: match kernel naming
+
+ * module/x86/op_model_athlon.c: from above
+
+2002-09-22 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libdb/db-insert.c: bad cut&paste. Shame on me, I broke the build...
+
+2002-09-22 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libdb/db-insert.c: handle samples count overflow.
+
+ * libdb/Makefile.in: db-test new target not built by default.
+ * libdb/db-debug.c: more strict checking
+ * libdb/db-test.c: allow db-test to be used as "db-test samples_dir/*"
+
+2002-09-22 John Levon <levon@movementarian.org>
+
+ * dae/opd_stats.c: nicify
+
+ * module/x86/op_model_pproc.c:
+ * module/x86/op_model_athlon.c: drop macro prefixes, ws fixes
+
+ * module/x86/op_nmi.c: fix save/restore possible crash, init
+ possible leak
+
+2002-09-22 Philippe Elie <phil.el@wanadoo.fr>
+
+ * module/x86/op_model_pproc.c: fix p6_start()
+ * module/x86/op_model_athlon.c: fix athlon_start()
+ * module/x86/op_nmi.c: pmc_save_registers() typo when checking
+ null for kmalloc return value
+
+2002-09-20 Graydon Hoare <graydon@redhat.com>
+
+ * module/x86/op_x86_model.h: New interface for MSRs.
+ * module/x86/op_nmi.c: Use interface.
+ * module/x86/op_model_ppro.c: New, code from op_nmi.c.
+ * module/x86/op_model_athlon.c: New, code from op_nmi.c.
+ * module/x86/Makefile.in: Reflect new files.
+
+2002-09-20 John Levon <levon@movementarian.org>
+
+ * libutil++/op_bfd.cpp: fix a bug where we broke
+ with multiple executable sections due to sorting
+ the symbols wrongly. Fix #617288 and the duplicated
+ #617264
+
+ * libutil++/op_bfd.h: fix an outdated comment
+
+ * dae/opd_image.c: fix comment
+
+2002-09-19 Graydon Hoare <graydon@redhat.com>
+
+ * libop/op_events.h:
+ * libop/op_events_desc.c: Move descriptions from here.
+ * libop/op_events_desc.h:
+ * libop/op_events.c: To here.
+ (um_*): Add new static unit masks.
+ (op_events): Use pointers to static unit masks.
+ * libop++/op_print_event.h:
+ * libop++/op_print_event.cpp:
+ * gui/oprof_start.h:
+ * gui/oprof_start.cpp:
+ * utils/op_help.c: Make compatible with struct changes.
+
+2002-09-18 John Levon <levon@movementarian.org>
+
+ * utils/op_start: give an example for unit mask.
+
+2002-09-18 Will Cohen <wcohen@redhat.com>
+
+ * libop/op_mangle.c: (op_mangle_filename): Correct logic for
+ generating mangled name. Fix #611107
+
+2002-09-15 John Levon <levon@movementarian.org>
+
+ * libop/op_event.c: fix comment
+
+2002-09-15 Philippe Elie <phil.el@wanadoo.fr>
+
+ * module/x86/cpu_type.c: allow to force RTC mode.
+ * dae/oprofiled.c: checking when we need to backup samples
+ dir in RTC mode was broken.
+
+2002-09-14 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libop/op_config.h: remove OP_MIN/MAX_PID, OP_MIN/MAX_PGRP
+ * gui/oprof_start.cpp: pid_filter/pgrp_filter accept all integer
+
+2002-09-13 John Levon <levon@movementarian.org>
+
+ * acinclude.m4: another tweak
+
+2002-09-13 Philippe Elie <phil.el@wanadoo.fr>
+
+ * Makefile.in: never remove doc/oprofile.html.
+ * acinclude.m4: small work-around for sed-related problem
+
+2002-09-12 Will Cohen <wcohen@redhat.com>
+
+ * Makefile.in: Separate kernel and user code build rules.
+
+2002-09-12 Will Cohen <wcohen@redhat.com>
+
+ * libutil++/child_reader.h (child_reader): Add missing "std::".
+ * libutil++/child_reader.cpp (error_str): Ditto.
+
+2002-09-12 John Levon <levon@movementarian.org>
+
+ * acinclude.m4: update from upstream
+
+2002-09-12 John Levon <levon@movementarian.org>
+
+ * acinclude.m4: fix moc2/moc conflict, cache val
+
+2002-09-12 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/child_reader.cpp:
+ * libutil++/child_reader.h: fix for child terminated by a signal
+ * gui/oprof_start_util.cpp:
+ * pp/op_to_source.cpp: use the the new child_reader interface
+
+2002-09-11 John Levon <levon@movementarian.org>
+
+ * acinclude.m4:
+ * configure.in:
+ * gui/Makefile.in: replace with new Qt configure script
+
+2002-09-11 Philippe Elie <phil.el@wanadoo.fr>
+
+ * acinclude.m4: fix qt3 detection in some corner case.
+
+2002-09-11 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/samples_container.cpp:
+ * pp/samples_container.h: Check at run time we don't try to use an
+ unitialized samples_container_t.
+
+2002-09-11 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/op_time.cpp: exit sooner when no samples files are available.
+
+2002-09-09 Will Cohen <wcohen@redhat.com>
+
+ * dae/opd_kernel.c (struct opd_module):
+ (kernel_start, kernel_end):
+ (opd_parse_kernel_range):
+ (opd_drop_module_sample):
+ (opd_find_module_by_eip):
+ (opd_handle_module_sample):
+ (opd_handle_kernel_sample):
+ (opd_eip_is_kernel):
+ * dae/opd_kernel.h (opd_handle_kernel_sample):
+ (opd_eip_is_kernel):
+ * dae/opd_mapping.c (opd_put_mapping):
+ * dae/opd_mapping.h (struct opd_map):
+ (opd_is_in_map):
+ (opd_map_offset):
+ * dae/opd_parse_proc.c (opd_add_ascii_map):
+ * dae/opd_proc.c(verb_show_sample):
+ (opd_put_image_sample):
+ * dae/opd_proc.h (opd_put_image_sample): Change things referring
+ to addresses to unsigned long for operation on 64-bit machines.
+
+2002-09-07 Philippe Elie <phil.el@wanadoo.fr>
+
+ * all source file : remove email address from @author
+
+2002-09-05 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libop/op_interface.h: (op_sample, op_note): Make compatible with
+ 64-bit targets.
+ * dae/opd_proc.c: (opd_put_sample): Adjust verbprintf arguments.
+ (opd_handle_fork): Ditto.
+ * dae/oprofiled.c: (opd_do_samples): Ditto.
+
+2002-09-04 Will Cohen <wcohen@redhat.com>
+
+ * module/op_rtc.c: move to ...
+ * module/x86/op_rtc.c: here
+ * module/Makefile.in:
+ * module/x86/Makefile.in: reflect file move
+
+2002-09-03 Will Cohen <wcohen@redhat.com>
+
+ * module/oprofile.h: (regparm3): remove, use FASTCALL instead.
+ * module/oprofile.c: (op_do_profile): Eliminate regparm3.
+
+2002-09-03 Will Cohen <wcohen@redhat.com>
+
+ * module/oprofile.c: (oprof_read, oprof_note_read): Return ssize_t.
+
+2002-08-30 Will Cohen <wcohen@nc.rr.com>
+
+ * Makefile.in:
+ * make.common.in: more DESTDIR change
+
+2002-09-02 Dave Jones <davej@suse.de>
+
+ * module/x86/cpu_type.c: support hammer in ia32 mode
+
+2002-09-02 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml: mention Qt 3
+
+2002-08-30 Will Cohen <wcohen@nc.rr.com>
+
+ * doc/Makefile.in: Set MANDIR and CATDIR based on DESTDIR.
+
+2002-08-16 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/opd_kernel.c:
+ * dae/opd_kernel.h:
+ * dae/opd_proc.c:
+ * dae/opd_proc.h:
+ * dae/oprofiled.c:
+ * libop/op_hw_config.h:
+ * libop/op_interface.h:
+ * module/oprofile.c:
+ * module/oprofile.h: change the layout of data used between
+ daemon/module (32 bits pid fix for 2.5.31)
+
+ * gui/oprof_start_config.h: use pid_t
+
+ * libutil/op_fileio.c: op_read_file(), op_write_file(), use %lu
+ and cast, uglier solution but more portable than last fix
+
+ * utils/op_start: typo
+
+2002-08-14 William Cohen <wcohen@nc.rr.com>
+
+ * libutil/op_fileio.c (op_read_file): Change fprintf specifier.
+ (op_write_file): Ditto.
+
+2002-08-08 Will Cohen <wcohen@nc.rr.com>
+
+ * utils/op_start: Do not compute quantity of counters from
+ CPUTYPE. Get counter names directly from /proc/sys/dev/oprofile.
+
+2002-08-06 Philippe Elie <phil.el@wanadoo.fr>
+
+ * Makefile.in:
+ * doc/Makefile.in: delete generated doc only on a make maintainerclean
+
+ * pp/opp_symbol.cpp: small cleanup
+
+2002-08-06 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/opd_parse.c:
+ * dae/opd_proc.c:
+ * dae/opd_proc.h: fix #591275 which is a re-hash of #584723 we can
+ now safely assume than proc->maps[0] is the primary image.
+ Problem reported by William cohen
+
+2002-08-03 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/string_manip.h:
+ * libutil++/string_manip.cpp: separate_token() treat escape sequence
+
+2002-07-30 Philippe Elie <phil.el@wanadoo.fr>
+
+ * gui/oprof_start.cpp: apply misssing part from this patch
+ 2002-07-27 Will Cohen <wcohen@nc.rr.com>
+
+ * dae/oprofiled.c:
+ * doc/oprofile.1.in:
+ * util/oprof_start:
+ * doc/oprofile.xml: clarify than pgrp filter is the tty program
+ group id
+
+2002-07-28 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libop/op_cpu_type.c:
+ * libop/op_cpu_type.h:
+ * libop/op_events.h:
+ * pp/samples_file.cpp: op_get_cpu_nr_counters() / op_get_nr_counters()
+ merge
+
+ * module/compat22.h:
+ * module/x68/op_apic.c: __cli()/__sti() removal, this fix build up
+ to 2.5.29
+
+ * module/op_fixmap.c: fix test_bit() warning
+
+2002-07-27 Will Cohen <wcohen@nc.rr.com>
+
+ * gui/oprof_start_config.cpp: config_setting::config_setting()
+ uses uname to guess path to vmlinux.
+
+2002-07-27 John Levon <levon@movementarian.org>
+
+ * dae/opd_stats.h:
+ * dae/opd_stats.c:
+ * dae/opd_proc.c: log unique samples vs. sample entries
+
+2002-07-27 Will Cohen <wcohen@nc.rr.com>
+
+ * dae/oprofiled.c:
+ * gui/oprof_start.cpp:
+ * libop/op_cpu_type.h:
+ * libop/op_cpu_type.c: op_get_nr_counter() new, localize
+ op_nr_counter computations.
+
+2002-07-26 Philippe Elie <phil.el@wanadoo.fr>
+
+ * TODO: update
+
+ * utils/op_start: fix #587093, some option of op_start
+ was incorrectly checked
+
+2002-07-26 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/op_time_options.cpp:
+ * pp/oprofpp_options.cpp: output format header or details are illegal
+ if not combined with other output format flag
+
+ * pp/opp_symbol.cpp:
+ * pp/opp_symbol.h:
+ * pp/oprofpp.cpp:
+ * pp/outsymbflag.h: minor cleanup
+
+2002-07-25 John Levon <moz@compsoc.man.ac.uk>
+
+ * configure.in: bump to 0.4cvs
+
+2002-07-24 Kevin Puetz <puetzk@iastate.edu>
+
+ * gui/ui/oprof_start.base.ui: fix resize
+
+2002-07-22 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil/op_fileio.c:
+ * libutil/op_fileio.h: opd_get_link() new, read a symlink filename
+ * libutil++/file_manip.cpp:
+ * libutil++/file_manip.h: opd_read_link() use the above function
+
+ * dae/opd_image.c:
+ * dae/opd_parse_proc.c: fix #584723 we can not assume than the first
+ map in /proc/pid/maps is the the map for the binary image
+
+2002-07-21 John Levon <moz@compsoc.man.ac.uk>
+
+ * configure.in: bump to 0.3
+
+2002-07-17 William Cohen <wcohen@nc.rr.com>
+
+ * gui/oprof_start_util.cpp: get HZ from sysconf
+
+2002-07-17 Philippe Elie <phil.el@wanadoo.fr>
+
+ * gui/oprof_start.base.ui: revert patch 2002-07-13, reapply
+ the same modification with QT2 designer rather QT3 designer
+
+2002-07-14 John Levon <moz@compsoc.man.ac.uk>
+
+ * Makefile.in: set KVERS properly
+
+ * dae/oprofiled.c: remove eip == 0 checking
+
+ * module/oprofile.c: do check in evict_op_entry() instead,
+ as suggested by Philippe
+
+2002-07-13 Philippe Elie <phil.el@wanadoo.fr>
+
+ * TODO: update
+
+ * make.deps:
+ * gui/Makefile.in: fix include search path for dependencies generation
+
+2002-07-13 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/oprofiled.c: don't throw away last samples on shutdown
+ notification
+
+2002-07-13 Philippe Elie <phil.el@wanadoo.fr>
+
+ * TODO: update
+
+ * doc/oprofile.1.in:
+ * doc/oprofile.xml:
+ * gui/oprof_start.cpp:
+ * gui/oprof_start_config.cpp:
+ * gui/oprof_start_config.h:
+ * gui/oprof_start.base.ui: remove kernel-range specification UI
+
+2002-07-12 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+ * dae/oprofiled.c:
+ * libop/op_interface.h:
+ * module/oprofile.c:
+ * module/oprofile.h:
+ * module/x86/op_nmi.c:
+ * module/x86/op_syscalls.c: replace partial_stop,quitting,prof_on
+ with single state variable, and clean up how shutdown is triggered.
+
+ * module/oprofile.c: always init data->entries etc. for every CPU
+
+2002-07-12 Philippe Elie <phil.el@wanadoo.fr>
+
+ * Makefile.in: typo in clean target
+
+ * module/compat.h:
+ * module/compat24.h:
+ * module/oprofile.c:
+ * module/x86/op_nmi.c: support for online/offline cpu for 2.5.23+
+
+2002-07-11 Philippe Elie <phil.el@wanadoo.fr>
+
+ * Makefile.in:
+ * module/Makefile.in:
+ * module/x86/Makefile.in: move all goal to the topdir Makefile
+
+2002-07-10 Philippe Elie <phil.el@wanadoo.fr>
+
+ * TODO: update
+
+ * pp/op_time.cpp: errno for file permission problem is
+ EACCES not EPERM ...
+
+ * module/x86/op_apic.c:
+ * module/x86/op_fixmap.c:
+ * module/x86/op_nmi.c: revert partially the 2002-06-26 patch, preempt
+ need rather to be fixed before/after calling the
+ op_int_operation functions pointer.
+
+2002-07-09 Philippe Elie <phil.el@wanadoo.fr>
+
+ * gui/oprof_start.cpp: use <ctime> not <time.h>
+ * libutil/op_libiberty.c: don't assume than string.h is included
+ by libiberty.h as in old gcc release
+
+2002-07-08 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/op_bfd.h:
+ * libutil++/op_bfd.cpp: pass vector by const reference rather
+ than by value
+
+ * pp/op_to_source.cpp: always output file even if the corresponding
+ source file does not exist
+
+2002-07-06 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libopt++/popt_options.cpp: provide a dtor in derived class
+
+ * doc/oprofile.1.in:
+ * pp/op_to_source.cpp: --output --no-output are meaningfull
+ in all case.
+
+2002-07-06 Philippe Elie <phil.el@wanadoo.fr>
+
+ * gui/oprof_start.cpp:
+ * pp/sample_container_imp.cpp:
+ * pp/symbol_container_imp.cpp:
+ * pp/op_to_source.cpp: fix an ISO corner case (3.4.2 #2)
+
+2002-07-05 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/filename_match.h:
+ * libutil++/filename_match.cpp: constify
+
+ * module/Makefile.in: small typo
+ * Makefile.in: do not make uninstall in module/arch
+
+ * pp/op_to_source_options.h:
+ * pp/op_to_source_options.cpp:
+ * pp/op_to_source.cpp: general cleanup, remove the output class and
+ use free function instead, doxygen'ize them.
+
+2002-07-04 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libop/op_events.cpp:
+ * libop/op_events.h:
+ * module/x86/op_nmi.c:
+ * dae/oprofiled.c: op_check_events() no longer accept 0 as valid events
+
+ * pp/opp_symbol.cpp: small dead code removal
+ * pp/opp_symbol.h: doxygen comment fix
+
+ * configure.in: do not use AC_CHECK_FILE: this macro generate
+ spurious warning with autoconf 2.2.13
+
+ * pp/op_to_source_options.h:
+ * pp/op_to_source_options.cpp:
+ * pp/op_to_source.cpp:
+ * doc/oprofile.1.in:
+ * doc/oprofile.xml: implement --objdump-params='params_strings'
+ allowing to pass additional parameters to objdump.
+
+2002-07-03 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil/op_fileio.c: remove a FIXME, it's not worthwhile to try to
+ use GNU getline() instead of op_get_line()
+
+ * pp/op_time.cpp:
+ * pp/op_time_options.cpp:
+ * pp/op_time_options.h:
+ * pp/oprofpp.cpp: remove minor FIXME
+
+ * pp/opp_symbol.h: class outut_symbol: clarify why, with the current
+ design, some function are public member rather private.
+
+2002-07-01 Philippe Elie <phil.el@wanadoo.fr>
+
+ * configure.in:
+ * module/compat.h: fix compile error with kernel <= 2.2.17
+
+2002-07-01 Philippe Elie <phil.el@wanadoo.fr>
+
+ * TODO: minor upadte
+
+ * configure.in: support 2.5.20
+
+ * dae/opd_image.c:
+ * dae/opd_proc.c:
+ * libop++/op_print_event.h:
+ * libutil/op_popt.c:
+ * pp/op_merge.cpp:
+ * pp/samples_container.cpp:
+ * pp/symbol_container_imp.cpp:
+ * pp/symbol_functors.h: minor #include tweak
+
+2002-06-30 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libdb/db.h:
+ * libdb/db-manage.c: constify db_sync() parameter.
+
+ * dae/opd_image.c: fix #574459 "vmlinux samples file not backed up
+ by op_session". Small cleanup by adding opd_for_each_image()
+
+2002-06-29 Philippe Elie <phil.el@wanadoo.fr>
+
+ * TODO: update
+
+ * libutil++/filename_match.cpp:
+ * libutil++/filename_match.h: add a convenience ctor.
+
+ * doc/oprofile.1.in:
+ * doc/oprofile.xml:
+ * op_time.cpp: better error message for EPERM problem
+ * op_time_options.h:
+ * op_time_options.cpp: allow the user to specify explicitely on which
+ filename he want to work
+
+2002-06-29 Philippe Elie <phil.el@wanadoo.fr>
+
+ * TODO: update
+
+ * acinclude.m4:
+ * configure.in:
+ * make.common.in:
+ * gui/Makefile.in:
+ * gui/ui/Makefile.in: better qt3 handling
+
+ * doc/oprofile.1.in:
+ * doc/oprofile.xml: fix oprof_start --option=blah
+
+2002-06-28 Philippe Elie <phil.el@wanadoo.fr>
+
+ * .cvsignore: minor fix
+
+ * configure.in:
+ * acinclude.m4: ugly temporary hack to compile with kde3/qt3
+ * oprof_start.cpp:
+ * oprof_start_config.cpp: gcc-3.1 and qt3 fix (qt3 have an
+ hex() somewhere ...)
+
+ * module/x86/op_fixmap.c: minor comment fix
+
+2002-06-26 Philippe Elie <phil.el@wanadoo.fr>
+
+ * TODO: update
+
+ * module/compat.h:
+ * module/x86/op_apic.c:
+ * module/x86/op_fixmap.c:
+ * module/x86/op_nmi.c: preemptible kernel support. This fix point
+ #2 of kernel_src/Documentation/preempt-locking.txt
+
+2002-06-25 Philippe Elie <phil.el@wanadoo.fr>
+
+ * TODO: update
+
+ * doc/oprofile.1.in:
+ * doc/oprofile.xml: document op_start --kernel-range option
+ * gui/oprf_start.cpp:
+ * gui/oprof_start.h:
+ * gui/oprof_start_config.cpp:
+ * gui/oprof_start_config.h:
+ * gui/ui/oprof_start_base.ui:
+ * utils/op_start: implement --kernel-range
+
+ * gui/Makefile.in: force ui sub-dir build
+
+2002-06-25 Philippe Elie <phil.el@wanadoo.fr>
+
+ * TODO: update
+
+ * configure.in: new AX_KERNEL_VERSION() to allow kernel version check,
+ use it to check minimal kernel version and fix 2.5.19 breakage
+ * module/.cvsignore:
+ * module/x86/.cvsignore: add .*.cmd
+ * module/Makefile.in:
+ * module/x86/Makefile.in: fix 2.5.19 make through EXTRA_CFLAGS_MODULE
+ * module/compat22.h: fix missing BUG() definition in 2.2 kernel
+ * module/x86/oprofile_nmi.S: fix minor 2.2 compile problem
+
+ * pp/op_to_source.cpp: minor comment fix
+
+2002-06-18 John Levon <moz@compsoc.man.ac.uk>
+
+ * utils/op_start:
+ * pp/samples_file.h:
+ * libop/op_config.h:
+ * doc/oprofile.1.in:
+ * doc/oprofile.xml:
+ * dae/oprofiled.c:
+ * dae/opd_kernel.h:
+ * dae/opd_kernel.c: don't parse System.map any more,
+ now we work based off vmlinux alone
+
+ * dae/opd_proc.c: move eip_is_kernel() into opd_kernel.c
+
+2002-06-18 John Levon <moz@compsoc.man.ac.uk>
+
+ * README:
+ * doc/oprofile.xml: update credits
+
+2002-06-16 John Levon <moz@compsoc.man.ac.uk>
+
+ * pp/op_time_options.h:
+ * pp/op_time_options.cpp: move private stuff out of
+ options namespace
+
+2002-06-16 John Levon <moz@compsoc.man.ac.uk>
+
+ * pp/counter_util.cpp: stop when we reach the first
+ available counter for sorting
+
+ * pp/op_to_source.cpp: use absolute sample file name
+
+ * pp/samples_file.cpp: better error message
+
+2002-06-16 John Levon <moz@compsoc.man.ac.uk>
+
+ * various: remove spurious == false, == true
+
+2002-06-15 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/oprofiled.c:
+ * libop/op_interface.h:
+ * libop++/op_print_event.h:
+ * module/oprofile.c: define a buffer head for the module
+ buffer interface, and use it
+
+ * module/Makefile.in: oops, install the module properly
+
+2002-06-15 John Levon <moz@compsoc.man.ac.uk>
+
+ * libop/Makefile.in:
+ * libop/op_cpu_type.h:
+ * libop/op_cpu_type.c: new files split out, defines
+ changed
+
+ * dae/opd_proc.c:
+ * dae/opd_sample_files.c:
+ * dae/oprofiled.c:
+ * gui/oprof_start.cpp:
+ * libop/op_events.h:
+ * libop/op_events.c:
+ * libop/op_events_desc.h:
+ * libop/op_events_desc.c:
+ * libop/op_interface.h:
+ * libop++/op_print_event.h:
+ * module/oprofile.h:
+ * module/x86/op_nmi.c: changes from above
+
+2002-06-15 John Levon <moz@compsoc.man.ac.uk>
+
+ * Makefile.in: compile module early as it's most
+ likely to fail
+
+ * TODO: update
+
+ * doc/oprofile.xml:
+ * configure.in: remove unneeded --with-cc
+
+ * module/x86/Makefile.in: use USE_STANDARD_AS_RULE
+
+ * module/x86/op_nmi.c: add preemption exclusion
+
+2002-06-15 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/opd_parse_proc.c: remove FIXME. We are fine to
+ assume first entry in maps is the executable, because
+ this is exactly what the kernel does (see /proc/pid/exe)
+
+2002-06-15 John Levon <moz@compsoc.man.ac.uk>
+
+ * pp/oprofpp.cpp: call check_mtime() correctly
+ for shared libraries
+
+2002-06-14 John Levon <moz@compsoc.man.ac.uk>
+
+ * libop/op_events.c: add warning
+
+ * module/Makefile.in: link against libop.a like I meant to
+
+ * module/oprofile.h:
+ * module/oprofile.c: readability cleanup
+
+2002-06-11 John Levon <moz@compsoc.man.ac.uk>
+
+ * module/compat.h:
+ * module/x86/arch_compat.h: remove arch_compat.h,
+ add BUG_ON()
+
+ * module/op_util.c: return -EINVAL not 1 from check_range()
+
+ * module/oprofile.c: use BUG_ON() in release functions,
+ fix use of check_range, remove spurious check for malloc
+ failure (already checked)
+
+ * module/oprofile.h: clarify API
+
+ * module/x86/op_msr.h: new file, MSR back-compat
+
+ * module/x86/op_nmi.c:
+ * module/x86/op_apic.c: use it
+
+2002-06-10 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+ * configure.in: remove old checks we don't need.
+ Add to EXTRA_CFLAGS not KCFLAGS
+
+ * module/Makefile.in: update to use Rules.make and
+ kernel rules.
+
+ * module/op_init.c: make this one include kernel modversion
+ stuff for 2.2
+
+ * module/oprofile.h: remove __cacheline_aligned in wrong place
+
+ * module/x86/Makefile.in: use Rules.make (hacky)
+
+ * module/x86/arch.mak: remove
+
+ * module/x86/op_fixmap.c: add missing header
+
+ * module/x86/op_syscalls.c: my_sys_exit is not static
+
+2002-06-09 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/cverb.h:
+ * libutil++/cverb.cpp: cverb ostream initializations
+ * pp/op_merge.cpp:
+ * pp/op_time_options.cpp:
+ * pp/op_to_source_options.cpp:
+ * pp/oprofpp_options.cpp: use it
+
+ * utils/Makefile.in: fix a typo in lib dependencies
+
+2002-06-07 Philippe Elie <phil.el@wanadoo.fr>
+
+ * TODO: update
+
+ * pp/samples_container.cpp:
+ * pp/samples_container.h: add an hint parameter to add()
+ used to avoid recording all samples.
+ * pp/oprofpp.cpp: use it for the -s option. This change
+ slightly behavior of oprofpp -s, now percent are relative
+ to the selected symbol, not to the whole samples file.
+ Performance of oprofpp -s are improved a lot (40 times on vmlinux)
+
+ * utils/Makefile.in: missing libs dependencies
+
+2002-06-07 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/Makefile.in:
+ * dae/Makefile.in:
+ * gui/Makefile.in: update dependencies for library
+
+2002-06-07 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libopt++/popt_options.cpp:
+ * libopt++/popt_options.h: memory leak fix
+
+2002-06-07 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/Makefile.in: fix bfd compilation problem
+ with gcc >= 3.0 and old bfd.h
+ * module/Makefile.in:
+ * module/x86/Makefile.in: fix -Werror typo
+ * pp/op_merge.cpp:
+ * pp/op_time_options.cpp:
+ * pp/op_to_source_options.cpp:
+ * pp/oprofpp_options.cpp: work around for cverb
+ initialisations and gcc 2.91.
+ * pp/op_to_source.cpp: use the right comand line argument.
+
+2002-06-07 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+ * libutil++/utility.h: fix stupid bug, add scoped_array
+
+ * libutil++/op_bfd.h:
+ * libutil++/op_bfd.cpp: use it
+
+2002-06-07 John Levon <moz@compsoc.man.ac.uk>
+
+ * libutil++/utility.h: add a scoped_ptr
+
+ * pp/op_to_source.cpp:
+ * pp/samples_container.h:
+ * pp/samples_container.cpp: use it
+
+2002-06-07 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/opd_kernel.c: remove some duplicate code
+
+2002-06-07 John Levon <moz@compsoc.man.ac.uk>
+
+ * pp/opp_symbol.cpp: kill last of the accursed char
+ arrays
+
+2002-06-07 John Levon <moz@compsoc.man.ac.uk>
+
+ * libutil++/op_bfd.cpp:
+ * libutil++/op_bfd.h:
+ * libutil++/verbose_ostream.h:
+ * pp/op_merge.cpp:
+ * pp/op_time_options.cpp:
+ * pp/oprofpp_options.cpp:
+ * pp/op_to_source_options.cpp: remove verbose_ostream
+ in favour of a much simpler solution
+
+ * module/oprofile.h: remove dead prototype
+
+2002-06-06 John Levon <moz@compsoc.man.ac.uk>
+
+ * module/x86/Makefile.in:
+ * module/Makefile.in: remove 2.91 check, add 2.5 check
+
+ * module/compat22.h:
+ * module/compat24.h:
+ * module/apic_up_compat.h: move to ...
+
+ * module/x86/op_apic.h:
+ * module/x86/apic_compat.h: ... here
+
+ * module/compat.h: move arch stuff to ...
+
+ * module/x86/arch_compat.h: ... here
+
+2002-06-06 Philippe Elie <phil.el@wanadoo.fr>
+
+ * configure.in: remove gcc 2.91 check
+ * make.common.in: use -Werror even for gcc 2.91
+ * gui/oprof_start.cpp:
+ * libutil++/op_bfd.cpp:
+ * pp/derive_files.cpp:
+ * pp/op_to_source.cpp: small tweak for gcc 2.91 and -Werror
+
+2002-06-06 John Levon <moz@compsoc.man.ac.uk>
+
+ * module/op_rtc.c: use check_range
+
+2002-06-06 John Levon <moz@compsoc.man.ac.uk>
+
+ * configure.in: fix typo so non-2.91 is detected
+
+ * module/Makefile.in:
+ * module/x86/Makefile.in: enable -Werror
+
+ * module/op_dname.c:
+ * module/oprofile.h:
+ * module/oprofile.c:
+ * module/op_util.h:
+ * module/op_util.c:
+ * module/x86/op_nmi.c: add op_util.h, make
+ op_check_range a function check_range
+
+2002-06-06 John Levon <moz@compsoc.man.ac.uk>
+
+ * module/Makefile.in: use @CC@, add clean for x86
+
+ * module/compat24.h: add path_hash prototype
+
+ * module/x86/Makefile.in: use @CC@, make sure
+ options get picked up
+
+2002-06-06 John Levon <moz@compsoc.man.ac.uk>
+
+ * libutil/op_get_time.c: return "" not NULL
+ on failure, so we don't try to printf NULL
+
+ * module/op_dname.c: do_path_hash_2_4 should not be static now
+
+ * module/oprofile.c: add const
+
+2002-06-06 Philippe Elie <phil.el@wanadoo.fr>
+
+ * module/x86: new directory, for now some small portion
+ of x86 dependant code remains in module/* mainly in
+ oprofile.[ch]. This patch also don't take care about
+ libop/* which are architecture dependant
+
+ * module/op_apic.c:
+ * module/op_nmi.c:
+ * module/op_syscalls.c:
+ * module/oprofile_nmi.S:
+ * module/op_fixmap.c: move this file to ...
+ * module/x86/op_apic.c:
+ * module/x86/op_nmi.c:
+ * module/x86/op_syscalls.c:
+ * module/x86/oprofile_nmi.S:
+ * module/x86/op_fixmap.c: these new files
+ * module/x86/op_apic.c: x86 stuff
+ * module/x86/arch.mak: specific arch makefile fragment
+ * module/op_init.c: move cpu detection code ...
+ * module/x86/cpu_type.c: here
+ * module/Makefile: handle arch sub-dir
+ * module/x86/.cvsignore: new
+ * module/oprofile.h: declare the interface to the
+ architecture dependant code
+
+ * Makefile.in:
+ * configure.in: handle module/arch
+ * make.common.in: avoid -Werror with gcc 2.91
+ * make.deps: small tweak allowing to use it in module
+
+2002-06-06 John Levon <moz@compsoc.man.ac.uk>
+
+ * configure.in: use CXXINCLUDES not CXXFLAGS
+ for including sstream
+
+ * make.common.in: remove duplicate -g -O2
+
+ * include/sstream: fix compiler warning to
+ allow -Werror
+
+ * libutil/op_file.c:
+ * libutil/op_fileio.h:
+ * libutil/op_fileio.c: more API fixage
+
+ * libutil++/file_manip.cpp: add missing header
+
+2002-06-06 John Levon <moz@compsoc.man.ac.uk>
+
+ * make.common.in: enable -Werror for CVS builds
+ (not in module/)
+
+ * dae/opd_image.c:
+ * dae/oprofiled.c:
+ * libutil/op_deviceio.h:
+ * libutil/op_deviceio.c: API fixes
+
+ * libutil++/file_manip.h:
+ * libutil++/file_manip.cpp:
+ * libutil++/op_bfd.h:
+ * libutil++/op_bfd.cpp:
+ * pp/op_time.cpp:
+ * pp/oprofpp.cpp:
+ * libutil/op_lockfile.c:
+ * libutil/op_file.h:
+ * libutil/op_file.c: add op_file_readable(),
+ API fixes
+
+2002-06-06 John Levon <moz@compsoc.man.ac.uk>
+
+ * utils/op_stop: fail early if ! root
+
+2002-06-05 John Levon <moz@compsoc.man.ac.uk>
+
+ * pp/*: s/OutputSymbol/output_symbol/,
+ s/OutSymbFlag/outsymbflag/
+
+2002-06-05 John Levon <moz@compsoc.man.ac.uk>
+
+ * pp/op_time_options.cpp:
+ * pp/op_time_options.h:
+ * pp/op_to_source_options.h:
+ * pp/oprofpp_options.h: document
+
+2002-06-05 John Levon <moz@compsoc.man.ac.uk>
+
+ * pp/Makefile.in:
+ * pp/counter_util.h:
+ * pp/counter_util.cpp: move from ...
+
+ * pp/oprofpp.h:
+ * pp/oprofpp_util.cpp: ... here (removed)
+
+ * pp/op_time.cpp:
+ * pp/op_time_options.cpp:
+ * pp/op_to_source.cpp:
+ * pp/opp_symbol.h:
+ * pp/oprofpp.cpp:
+ * pp/oprofpp_options.h:
+ * pp/oprofpp_options.cpp:
+ * pp/samples_container.h:
+ * pp/samples_container.cpp:
+ * pp/samples_file.h:
+ * pp/samples_file.cpp: changes from above
+
+2002-06-05 John Levon <moz@compsoc.man.ac.uk>
+
+ * libutil++/file_manip.h:
+ * libutil++/file_manip.cpp: move oprofile specific stuff
+ to ...
+
+ * libop++/op_mangling.h:
+ * libop++/op_mangling.cpp: ... here
+
+ * pp/Makefile.in:
+ * pp/op_bfd.h:
+ * pp/op_bfd.cpp: move to ...
+
+ * libutil++/Makefile.in:
+ * libutil++/op_bfd.h:
+ * libutil++/op_bfd.cpp: ... here
+
+ * libutil++/verbose_ostream.h: add
+
+ * pp/op_merge.cpp:
+ * pp/op_time.cpp:
+ * pp/op_time_options.h:
+ * pp/op_time_options.cpp:
+ * pp/op_to_source.cpp:
+ * pp/op_to_source_options.h:
+ * pp/op_to_source_options.cpp:
+ * pp/oprofpp.h:
+ * pp/oprofpp.cpp:
+ * pp/oprofpp_options.h:
+ * pp/oprofpp_options.cpp:
+ * pp/oprofpp_util.cpp:
+ * pp/samples_file.h: various changes and
+ cleanups from above
+
+ * pp/derive_files.cpp: remove now duplicate code
+
+2002-06-05 John Levon <moz@compsoc.man.ac.uk>
+
+ * libutil++/file_manip.h:
+ * libutil++/file_manip.cpp: simplify but don't
+ break already absolute paths, remove dead code
+
+ * pp/op_time_options.h:
+ * pp/op_time_options.cpp:
+ * pp/op_time.cpp: remove dead code
+
+ * pp/op_to_source_options.h:
+ * pp/op_to_source_options.cpp:
+ * pp/oprofpp_options.h:
+ * pp/oprofpp_options.cpp: variable name tweaks
+
+ * pp/Makefile.in:
+ * pp/op_to_source.cpp:
+ * pp/oprofpp.cpp:
+ * pp/oprofpp.h:
+ * pp/oprofpp_util.cpp:
+ * pp/derive_files.h:
+ * pp/derive_files.cpp: factor command-line file
+ derivation guessing out
+
+2002-06-04 John Levon <moz@compsoc.man.ac.uk>
+
+ * libop++/op_print_event.cpp:
+ * pp/op_bfd.h:
+ * pp/op_time_options.cpp:
+ * pp/op_to_source_options.cpp:
+ * pp/oprofpp_options.cpp: fixes for std
+
+ * pp/Makefile.in:
+ * pp/oprofpp.h:
+ * pp/oprofpp_util.cpp:
+ * pp/samples_file.cpp:
+ * pp/opp_symbol.h:
+ * pp/counter_array.h:
+ * pp/counter_array.cpp: factor out counter_array
+
+2002-06-04 John Levon <moz@compsoc.man.ac.uk>
+
+ * pp/oprofpp.h:
+ * pp/samples_file.cpp:
+ * pp/oprofpp_util.cpp: remove a sanity check
+ that wasn't particularly useful
+
+2002-06-04 John Levon <moz@compsoc.man.ac.uk>
+
+ * libop++/Makefile.in:
+ * libop++/op_mangling.h:
+ * libop++/op_mangling.cpp:
+ * pp/op_merge.cpp:
+ * pp/op_time.cpp:
+ * pp/oprofpp.cpp:
+ * pp/oprofpp.h:
+ * pp/oprofpp_util.cpp: move mangle/unmangle to libop++
+
+2002-06-04 John Levon <moz@compsoc.man.ac.uk>
+
+ * pp/Makefile.in:
+ * pp/op_to_source.cpp:
+ * pp/opp_symbol.cpp:
+ * pp/demangle_symbol.h:
+ * pp/demangle_symbol.cpp: move this ...
+
+ * libutil++/Makefile.in:
+ * libutil++/demangle_symbol.h:
+ * libutil++/demangle_symbol.cpp: ... to here
+
+2002-06-04 John Levon <moz@compsoc.man.ac.uk>
+
+ * make.common.in:
+ * make.deps: split out CXXINCLUDES
+
+ * Makefile.in:
+ * configure.in:
+ * libop++/Makefile.in:
+ * libop++/op_print_event.h:
+ * libop++/op_print_event.cpp:
+ * pp/Makefile.in:
+ * pp/oprofpp.h:
+ * pp/oprofpp_util.cpp:
+ * pp/samples_file.cpp: start libop++ library,
+ move op_print_event there
+
+ * pp/op_bfd.h:
+ * pp/op_bfd.cpp:
+ * pp/op_time.cpp:
+ * pp/op_to_source.cpp:
+ * pp/oprofpp.cpp:
+ * pp/samples_file.h:
+ * pp/samples_file.cpp: remove all knowledge of
+ is_kernel from op_bfd, some minor cleanups
+
+2002-06-04 John Levon <moz@compsoc.man.ac.uk>
+
+ * pp/op_bfd.h:
+ * pp/op_bfd.cpp:
+ * pp/samples_container.cpp: kill another char*
+
+ * pp/outsymbflag.h: reduce fake dependencies with
+ new file, little cleanup
+
+ * pp/Makefile.in:
+ * pp/demangle_symbol.cpp:
+ * pp/op_merge.cpp:
+ * pp/op_time.cpp:
+ * pp/op_time_options.h:
+ * pp/op_time_options.cpp:
+ * pp/op_to_source.cpp:
+ * pp/op_to_source_options.h:
+ * pp/op_to_source_options.cpp:
+ * pp/opp_symbol.h:
+ * pp/oprofpp.h:
+ * pp/oprofpp.cpp:
+ * pp/oprofpp_options.h:
+ * pp/oprofpp_options.cpp:
+ * pp/oprofpp_util.cpp: Some more refactoring. More work
+ needed...
+
+2002-06-01 John Levon <moz@compsoc.man.ac.uk>
+
+ * doc/Makefile.in: fix DOCDIR (from Al Stone)
+
+2002-06-01 John Levon <moz@compsoc.man.ac.uk>
+
+ * libutil++/file_manip.h:
+ * libutil++/file_manip.cpp: clarify API
+
+ * pp/oprofpp.cpp: fix bug 563324 resulting from above
+
+2002-06-01 John Levon <moz@compsoc.man.ac.uk>
+
+ * make.common.in: make --with-extra-lib work again
+
+ * dae/opd_image.h:
+ * dae/opd_image.c: comment typos
+
+ * doc/srcdoc/Doxyfile: generate PNG not GIF
+
+2002-05-23 Philippe Elie <phil.el@wanadoo.fr>
+
+ * doc/srcdoc/Doxyfile:
+ * libopt++/popt_options.cpp:
+ * libopt++/popt_options.h:
+ * pp/symbol_container_impl.h: small doxygen tweak.
+
+2002-05-23 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/oprofiled.c: minor bug when backing up samples dir
+
+ * libopt++/popt_options.h:
+ * libopt++/popt_options.cpp: avoid to force client code to
+ explicitly select the option template specializations.
+
+ * pp/op_merge.cpp:
+ * pp/op_time.cpp:
+ * pp/op_to_source.pp:
+ * pp/oprofpp.cpp: we no longer need explicit template
+ instantiations for options
+
+2002-05-22 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/oprofpp.cpp: fix a missing SAMPLES_DIR prepend
+
+2002-05-22 John Levon <moz@compsoc.man.ac.uk>
+
+ * lib/util/op_file.c:
+ * utils/op_session.c: restore accidentally lost
+ commits :
+
+ 2002-05-05 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/op_session.c: tweak error message when session already
+ exist. Avoid to op_dump when profiler is not started.
+
+ 2002-05-05 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/op_session.c: do not create empty session directory
+ and backup oprofileg.log too
+ * dae/opd_util.c:
+ * op_user.h: minor related change
+
+2002-05-22 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/*: complete re-organisation of files
+
+ * libop/op_config.h: add VMA_OFFSET and MAX_MODULES
+ tunables
+
+2002-05-22 Philippe Elie <phil.el@wanadoo.fr>
+
+ * gui:
+ * libdb:
+ * libopt++:
+ * libutil:
+ * libutil++:
+ * oprof_report:
+ * pp: all C/c++ source/header file, fix a few doxygen warning,
+ many const type to type const + other minor comestic change.
+
+2002-05-22 John Levon <moz@compsoc.man.ac.uk>
+
+ * libopt++/popt_options.cpp: my usual boring shit
+
+ * libopt++/popt_options.h: document
+
+ * libutil/op_popt.h: POPT_TABLEEND missing in some popt.h
+
+ * TODO: update
+
+ * doc/oprofile.xml: add some to ack.html
+
+ * libop/op_events_desc.c: fix long-standing typo
+
+2002-05-22 Philippe Elie <phil.el@wanadoo.fr>
+
+ * configure.in:
+ * Makefile.in:
+ * libopt++/*: new directory, command line options handling
+
+ * make.common.in:
+ * pp/Makefile.in:
+ * pp/op_merge.cpp:
+ * pp/op_time.cpp:
+ * pp/op_to_source.cpp:
+ * pp/oprofpp.cpp:
+ * pp/oprofpp.h:
+ * pp/oprofpp_util.cpp: use libpopt++
+
+2002-05-19 Philippe Elie <phil.el@wanadoo.fr>
+
+ * TODO: update
+
+2002-05-19 John Levon <moz@compsoc.man.ac.uk>
+
+ * pp/op_bfd.cpp: fix bug coming from mis-placed
+ strlen() brackets
+
+ * pp/op_bfd.h:
+ * pp/op_bfd.cpp: kill some more char[]s to avoid silly
+ bugs like the above
+
+ * README: some minor change
+
+2002-05-18 Philippe Elie <phil.el@wanadoo.fr>
+
+ * module/compat.h:
+ * module/op_fixmap.c:
+ * module/op_syscalls.c:
+ * module/oprofile.c:
+ * module/oprofile.h:
+ * module/oprofile_nmi.S: fix module up to kernel 2.5.15
+
+ * module/compat22.h: small fix for 2.2
+
+2002-05-17 Philippe Elie <phil.el@wanadoo.fr>
+
+ * module/op_fixmap.c: revert my last change :/. Something is
+ wrong with oprofiel and 2.5.15 but elsewhere
+
+2002-05-17 Philippe Elie <phil.el@wanadoo.fr>
+
+ * module/op_fixmap.c: fix a long time outstanding bug,
+ we tested bit in the address of x86_capability
+ rather the capability itself.
+
+2002-05-17 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/opd_proc.c: from a typo in opd_put_image_samples first
+ incoming samples for each image was always ignored. As
+ a side effect if opd_open_sample_file() fail the daemon
+ will die with a seg fault. This behavior is in 0.2 release.
+ fix #556918
+
+2002-05-17 John Levon <moz@compsoc.man.ac.uk>
+
+ * utils/op_start: typo in detect stale lock file
+
+2002-05-17 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/*: gcc 3.1 compilation.
+
+2002-05-16 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/opd_proc.c: close samples files at cleanup
+
+ * libdb/db-insert.cpp: if we don't lock the file when creating
+ the root we must ensure than initialization is atomic
+
+ * pp/op_bfd.cpp:
+ * pp/op_bfd.h:
+ * pp/op_time.cpp:
+ * pp/op_to_source.cpp:
+ * pp/oprofpp.cpp:
+ * pp/oprofpp.h:
+ * pp/oprofpp_util.cpp:
+ * pp/samples_file.cpp:
+ * pp/samples_file.h: move all coherency check between a op_bfd and
+ it's related opp_samples_files outside these class
+
+ * pp/samples_container.cpp: small modification allowing to privatize
+ op_bfd::ibfd pointer.
+
+2002-05-16 John Levon <moz@compsoc.man.ac.uk>
+
+ * libutil/op_lockfile.c: detect and remove stale
+ lock files
+
+ * utils/op_start: detect stale lock file
+
+2002-05-15 John Levon <moz@compsoc.man.ac.uk>
+
+ * pp/Makefile.in:
+ * pp/op_time.cpp:
+ * pp/op_to_source.cpp:
+ * pp/oprofpp.cpp:
+ * pp/samples_container.h:
+ * pp/samples_container.cpp:
+ * pp/sample_container_imp.h:
+ * pp/sample_container_imp.cpp:
+ * pp/symbol_container_imp.h:
+ * pp/symbol_container_imp.cpp:
+ * pp/symbol_functors.h: some more file-refactoring, and some
+ minor changes
+
+2002-05-15 John Levon <moz@compsoc.man.ac.uk>
+
+ * pp/oprofpp.cpp: only allow -r with -l
+ * doc/oprofile.1.in: document -r for oprofpp
+
+2002-05-15 William Cohen <wcohen@nc.rr.com>
+
+ * pp/oprofpp.cpp: Added "-r" reverse sort option.
+
+2002-05-15 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/utility.h: fix a copyright problem, work-around
+ a (probable) gcc 2.91 bug.
+
+ * pp/op_bfd.cpp: valgrind exposed a delete problem.
+
+ * pp/op_time.cpp:
+ * pp/op_to_source.cpp:
+ * pp/oprofpp.cpp:
+ * pp/samples_container.cpp:
+ * pp/samples_container.h:
+ * pp/samples_container.cpp:
+ * pp/samples_container.h: change the handling of shared lib,
+ we no longer allow samples_container_t to auto load related
+ samples files belonging to a shared lib but we create at a higher
+ level an explicit list of samples files : fix #555276
+
+ * pp/op_to_source.cpp:
+ * pp/sample_container.cpp:
+ * pp/opp_symbol.cpp: demangle symbol only when we output
+ symbol name, not when we store symbol name in internal
+ representation of symbol.
+
+2002-05-14 Cliff Woolley <jwoolley@apache.org>
+
+ * gui/oprof_start.cpp: allow Qt3 compilation
+
+2002-05-13 Philippe Elie <phil.el@wanadoo.fr>
+
+ * doc/oprofile.xml: clarify RTC use, fix #555302
+
+ * gui/oprof_start_util.cpp: missing closedir(). Fix #555268
+ Thanks to William Cohen for his precise report.
+
+ * module/Makefile.in: fix #555304, a non-native compiler can
+ fail to compile oprofile
+
+ * libutil++/utility.h: class noncopyable
+ * pp/samples_file.h: use it
+
+2002-05-12 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libop/op_events_desc.c:
+ * libop/op_events_desc.h:
+
+ * pp/op_bfd.h:
+ * pp/op_bfd.cpp:
+ * pp/op_to_source.cpp:
+ * pp/oprofpp.h:
+ * pp/oprofpp.cpp:
+ * pp/oprofpp_util.cpp:
+ * pp/samples_file.cpp:
+ * pp/samples_file.h:
+ * pp/samplesfile.h: fix some FIXME
+
+2002-05-12 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/oprofiled.c: delete lockfile on SIGTERM
+
+ * pp/samples_file.h:
+ * pp/samples_file.cpp: minor changes
+
+2002-05-11 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/op_bfd.cpp:
+ * pp/op_bfd.h: ehance op_bfd_symbol ...
+ * pp/oprofpp.cpp:
+ * pp/samples_container.cpp: move handling of image w/o symbol
+ in op_bfd
+
+ * pp/samples_file.h: ehance comment (John's work)
+
+2002-05-11 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/op_bfd.cpp:
+ * pp/op_bfd.h:
+ * pp/oprofpp.cpp:
+ * pp/oprofpp.h:
+ * pp/samples_files.cpp: minor cleanup
+
+2002-05-10 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/op_bfd.h:
+ * pp/op_bfd.cpp:
+ * pp/opp_symbol.h:
+ * pp/opp_symbol.cpp:
+ * pp/oprofpp.cpp:
+ * pp/samples_container.h:
+ * pp/samples_container.cpp: more typedef for indexed things
+
+2002-05-10 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/*: split oprofpp_util.cpp, oprofpp.h to these ..
+ * pp/samples_file.cpp: new file
+ * pp/samples_file.h: new file
+ * pp/op_bfd.cpp: new file
+ * pp/opbfd.h: new file
+
+ * pp/*: add a symbol_index_t typedef
+
+2002-05-10 Philippe Elie <phil.el@wanadoo.fr>
+
+ * doc/srcdoc/Makefile: always clean before building
+ * doc/srcdoc/Doxyfile: ehance file filtering
+
+ * pp/oprofpp.h: small typo fix
+
+2002-05-10 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/oprofpp.h:
+ * pp/oprofpp.cpp:
+ * pp/oprofpp_util.cpp:
+ * pp/samples_container.cpp: generalize infrastucture for symbol
+ vma/size
+
+ * pp/op_time.cpp: allow to exclude symbol with op_time -l
+
+2002-05-09 John Levon <moz@compsoc.man.ac.uk>
+
+ * doc/xhtml-chunk.xsl:
+ * doc/xhtml-common.xsl:
+ * doc/xhtml.xsl:
+ * doc/Makefile.in: some small improvements
+
+ * doc/src/doc/Doyxfile: add FIXME
+
+ * gui/oprof_start.cpp:
+ * libop/op_events_desc.h:
+ * libop/op_events_desc.c:
+ * libutil/filename_match.h:
+ * oprof_report/oprofpp_view.h:
+ * pp/op_time.cpp:
+ * pp/opp_symbol.h:
+ * pp/oprofpp.h:
+ * pp/oprofpp_util.cpp:
+ * pp/samples_container.cpp:
+ * pp/samples_container.h: more doxygen etc. fixes
+
+2002-05-08 Philippe Elie <phil.el@wanadoo.fr>
+
+ * TODO: update
+
+ * pp/op_symbol.cpp: better column handling with oprofpp -L
+
+2002-05-08 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/Makefile.in:
+ * gui/Makefile.in:
+ * pp/Makefile.in:
+ * utils/Makefile.in: fix make uninstall
+
+2002-05-08 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opf_filter.cpp: move to ...
+ * pp/op_to_source.cpp:
+ * pp/opf_container.cpp: move to ..
+ * pp/samples_container.cpp:
+ * pp/opf_filter.h: move to ...
+ * pp/samples_container.h:
+ * pp/Makefile.in:
+ * pp/.cvsignore: update
+
+ * oprof_report/hotspotview.cpp:
+ * oprof_report/hotspotview.h:
+ * oprof_report/op_view.h:
+ * oprof_report/oprof_report.cpp:
+ * oprof_report/oprof_report.h:
+ * oprof_report/oprof_view.cpp:
+ * oprof_report/oprof_view.h:
+ * pp/op_time.cpp:
+ * pp/opf_container.cpp:
+ * pp/opf_filter.cpp:
+ * pp/opf_filter.h:
+ * pp/opp_symbol.cpp:
+ * pp/opp_symbol.h:
+ * pp/oprofpp.cpp:
+ * pp/oprofpp.h: samples_files_t -> samples_container_t
+
+ * ui/.cvsignore: update
+
+ * pp/opf_filter.cpp: move filename_match ...
+ * libutil++/filename_match.cpp: here
+ * libutil++/filename_match.cpp:
+ * libutil++/Makefile.in:
+
+ * pp/Makefile.in: fix typo that prevent op_to_source
+ to be recompiled
+
+2002-05-08 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+ * doc/Makefile.in: make clean delete *.html
+
+ * libdb/db-debug.c: pedantry
+
+ * libutil/op_fileio.h:
+ * libutil/op_fileio.c:
+ * pp/oprofpp.cpp: remove unused code and change
+ function names
+
+2002-05-08 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil/op_libiberty.h: fix compile error (missing
+ size_t definition)
+
+2002-05-08 John Levon <moz@compsoc.man.ac.uk>
+
+ * Makefile.in: missing backslash
+
+2002-05-07 John Levon <moz@compsoc.man.ac.uk>
+
+ * <various>: OK I lied. Fix some doxygen warnings,
+ and some char const *a -> const char * a
+
+ * doc/srcdoc/Makefile: add
+
+2002-05-07 John Levon <moz@compsoc.man.ac.uk>
+
+ * <all>: ok, fix the headers properly. Last tedious
+ patch, I promise.
+
+ * dae/opd_util.h: finally remove !
+
+2002-05-06 John Levon <moz@compsoc.man.ac.uk>
+
+ * <various>: move to new header style, doxygen
+ should use @param blah not @blah: or \param blah
+
+ * doc/srcdoc/Doxyfile: new file for api docs
+
+ * scripts/Doxyfile:
+ * scripts/dodoc: remove
+
+2002-05-06 John Levon <moz@compsoc.man.ac.uk>
+
+ * configure.in: don't add KINC to BKCFLAGS directly
+
+ * module/Makefile.in: re-write
+
+ * TODO: update
+
+2002-05-06 John Levon <moz@compsoc.man.ac.uk>
+
+ Massive re-organisation of code + build. Most
+ files have been changed. Some small cosmetic
+ changes.
+
+ * libutil/:
+ * libutil++/: general-purpose utility libs
+
+ * libop/: oprofile-specific utility lib
+
+ * utils/: moved op_start et al to this dir
+
+ * events/:
+ * util/: removed
+
+ * libutil++/child_reader.cpp: make sure to set
+ member "pid", not local variable
+
+2002-05-05 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/op_session.c: tweak error message when session already
+ exist. Avoid to op_dump when profiler is not started.
+
+2002-05-05 Philippe Elie <phil.el@wanadoo.fr>
+
+ * TODO: update:
+
+ * dae/op_session.c: do not create empty session directory
+ and backup oprofileg.log too
+ * dae/opd_util.c:
+ * op_user.h: minor related change
+
+2002-05-05 John Levon <moz@compsoc.man.ac.uk>
+
+ * doc/oprofile.xml: update copyright for 2002
+
+ * doc/xsl/xhtml-chunk.xsl: indent=yes
+
+2002-05-05 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+ * Makefile.in: update my release steps
+
+2002-05-05 John Levon <moz@compsoc.man.ac.uk>
+
+ * configure.in: ->0.3cvs
+
+ * results/: hmm, remove /all/ the files
+
+2002-05-04 John Levon <moz@compsoc.man.ac.uk>
+
+ * configure.in: bump to 0.2
+
+2002-05-04 William Cohen <wcohen@nc.rr.com>
+
+ * doc/oprofile.xml: add note on power management
+
+2002-05-03 John Levon <moz@compsoc.man.ac.uk>
+
+ * doc/Makefile.in:
+ * doc/xsl/xhtml-common.xsl:
+ * doc/xsl/xhtml.xsl:
+ * doc/xsl/xhtml-chunk.xsl: use some xsl to fix
+ some of the problems (not all :()
+
+2002-05-02 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+2002-05-02 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/op_session.c: couple of improvements
+
+ * dae/opd_util.c: fix warning
+
+ * doc/oprofile.xml: some docs on op_session
+
+ * pp/op_time.cpp: introduce -s parameter (should be
+ in all utils)
+
+2002-05-02 John Levon <moz@compsoc.man.ac.uk>
+
+ * oprof_report/Makefile.in: disable for release
+
+2002-05-02 John Levon <moz@compsoc.man.ac.uk>
+
+ * results/: nuke this in favour of oprofile-tests
+ module
+
+2002-05-02 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+ * op_user.h:
+ * dae/op_start:
+ * dae/op_stop:
+ * dae/opd_util.h:
+ * dae/opd_util.c:
+ * dae/oprofiled.c:
+ * dae/oprofiled.h:
+ * doc/oprofile.1.in:
+ * doc/oprofile.xml:
+ * gui/oprof_start.h:
+ * gui/oprof_start.cpp:
+ * gui/oprof_start_config.h:
+ * gui/oprof_start_config.cpp:
+ * gui/ui/oprof_start_base.ui:
+ * oprof_report/oprof_report.cpp:
+ * pp/op_merge.cpp:
+ * pp/op_time.cpp:
+ * pp/opf_filter.cpp:
+ * pp/oprofpp.cpp:
+ * pp/oprofpp.h:
+ * pp/oprofpp_util.cpp: remove useless command line
+ options in anticipation of the new spec
+
+ * libdb/db-manage.c: reset base_memory and fd
+ on close
+
+ * dae/.cvsignore:
+ * dae/Makefile.in:
+ * dae/op_session.c:
+ * dae/opd_proc.c:
+ * dae/opd_proc.h:
+ * dae/oprofiled.h:
+ * dae/oprofiled.c: use lock file for daemon.
+ Implement named sessions
+
+2002-05-02 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/oprofpp.cpp:
+ * pp/op_time.cpp:
+ * pp/opf_container.cpp:
+ * pp/opf_filter.cpp:
+ * pp/oprofpp.cpp:
+ * pp/oprofpp.h:
+ * pp/oprofpp_util.cpp: fix sect_offset problem. now all
+ class work on vma except samples_file_t which offset vma
+ to samples files offset
+
+2002-05-01 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/opd_proc.c:
+ * libdb/db-manage.c:
+ * libdb/db-test.c:
+ * libdb/db.h:
+ * pp/op_merge.cpp:
+ * pp/op_time.cpp:
+ * pp/oprofpp_util.cpp: allow read-only sample
+ file reading
+
+ * oprof_report/hotspot_view.cpp: fix warning
+
+2002-05-01 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/op_start:
+ * dae/oprofiled.c:
+ * doc/oprofile.1.in:
+ * doc/oprofile.xml:
+ * gui/oprof_start.cpp:
+ * module/op_nmi.c:
+ * module/op_rtc.c:
+ * module/op_syscalls.c:
+ * module/oprofile.h:
+ * module/oprofile.c: move pid/pgrp filter into
+ userspace only. Remove --ignore-myself
+
+2002-04-30 John Levon <moz@compsoc.man.ac.uk>
+
+ * op_user.h:
+ * dae/opd_proc.c:
+ * pp/oprofpp_util.cpp: first part of removing
+ OPD_KERNEL_OFFSET
+
+2002-04-30 John Levon <moz@compsoc.man.ac.uk>
+
+ * module/op_nmi.c: also allow user to see 0/ 1/ contents
+
+2002-04-30 William Cohen <wcohen@nc.rr.com>
+
+ * module/oprofile.c: Allow non-root examination of
+ /proc/sys/dev/oprofile and initiation of dump.
+
+ * dae/op_dump: modify message for above
+
+2002-04-30 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+ * libdb/Makefile: remove from CVS
+
+ * dae/oprofiled.c:
+ * module/oprofile.c:
+ * module/oprofile.h: use better hash function.
+ Fold unused/full entry case into eviction case
+ for faster common path
+
+2002-04-27 John Levon <moz@compsoc.man.ac.uk>
+
+ * configure.in: fix little blooper that shows up
+ when CONFIG_M386 is chosen
+
+2002-04-23 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/oprofpp.cpp:
+ * pp/oprofpp_util.cpp: yet another bug fix for --sort=
+ and counter nr command line specification ...
+
+2002-04-22 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/opd_proc.c: opd_alarm() flush properly samples files
+
+ * oprof_report/oprof_report.cpp: use the right filename
+ when selecting a shared lib profiled with --separate-samples
+
+2002-04-22 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/op_merge.c: implement merging of the new file format files.
+
+2002-04-21 Philippe Elie <phil.el@wanadoo.fr>
+
+ * oprof_report/Makefile.in:
+ * oprof_report/oprof_report.cpp: use db
+
+2002-04-20 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/opd_proc.c: OPD_KERNEL_OFFSET thing
+ * pp/oprofpp_util.cpp:
+
+2002-04-20 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/opd_proc.c: minor warning suppression
+
+ * pp/Makefile.in:
+ * pp/oprofpp.cpp:
+ * pp/op_time.cpp:
+ * pp/opf_container.cpp:
+ * pp/opf_filter.cpp:
+ * pp/oprofpp.h: handle the new db file format, this stuff is
+ not yet extensively tested
+
+ * pp/op_merge.c: not already updated, exit at run time
+ with an error message
+
+2002-04-19 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/opd_proc.h:
+ * dae/oprofiled.h: enable db samples file format
+
+2002-04-19 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libdb/*: initial import from oprofile-tests module
+ note than this direcroty have it's own ChangeLog file
+ * dae/Makefile.in: use libdb.a
+ * dae/opd_util.h: use db.h. These change do not yet enable
+ the db samples files format.
+
+2002-04-16 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO:
+ * doc/oprofile.xml:
+ * pp/oprof_convert.c:
+ * util/misc.h:
+ * util/misc.c:
+ * util/file_manip.h:
+ * pp/Makefile.in: kill oprof_convert
+
+2002-04-16 John Levon <moz@compsoc.man.ac.uk>
+
+ * pp/opf_container.cpp:
+ * pp/oprofpp.h:
+ * pp/demangle_symbol.h:
+ * pp/demangle_symbol.cpp:
+ * pp/Makefile.in: move demangle_symbol into own
+ file
+
+ * TODO: update some...
+
+2002-04-11 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opf_filter.cpp: fix a memory leak uncovered
+ by valgrind <http://developer.kde.org/~sewardj>
+
+2002-04-09 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/oprofiled.h: move definition of linked list to ...
+ * dae/opd_list.h: this new file
+
+ * dae/opd_proc.c: iterate on opened sample file
+ rather on image list to sync mmap'ed file
+
+2002-04-07 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/oprofpp.h:
+ * oprof_report/oprof_report.cpp:
+ * pp/op_time.cpp:
+ * pp/opf_container.cpp:
+ * pp/opf_filter.cpp:
+ * pp/oprofpp_util.cpp:
+ * pp/oprofpp.cpp: use samples_file_t as internal implementation
+ of opp_samples_files. Now all samples files read are made
+ through samples_file_t object.
+
+2002-04-04 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/op_start: fix bash1 detection
+
+ * doc/Makefile.in: fix install target
+
+2002-03-25 John Levon <moz@compsoc.man.ac.uk>
+
+ * configure.in: some preliminary stuff for NGPT
+
+ * TODO: update
+
+ * doc/Makefile.in:
+ * doc/oprofile.sgml:
+ * doc/oprofile.xml: move to DocBook/XML
+
+ * doc/oprofile.xml: document Bash 2 dependency
+
+ * dae/op_start: fix for /bin/bash being bash v1 - untested
+
+2002-04-02 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/oprofpp.cpp:
+ * pp/oprofp_util.cpp: debug and use opp_bfd::symbol_size()
+
+2002-03-30 Philippe Elie <phil.el@wanadoo.fr>
+
+ * ChangeLog: change my email address
+
+2002-03-22 Philippe Elie <ph_e@club-internet.fr>
+
+ * dae/op_start: default buffer size to zero and let module
+ override the default.
+
+ * module/op_rtc.c:
+ * module/oprofile.h:
+ * op_user.h:
+ * gui/oprof_start.cpp:
+ * gui/oprof_start_config.cpp:
+ * gui/oprof_start_config.h: an another coherency fix, unhopefully
+ this bug fix does not fix the configuration file (see # )
+
+ * pp/oprofpp.cpp: for gprof dump do not print events settings
+
+ * pp/oprofpp.h:
+ * pp/oprofpp_util.cpp: prepare using symbol size
+
+2002-03-21 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/opf_filter.cpp:
+ * pp/oprofpp.cpp:
+ * pp/oprofpp_util.cpp: factorize event settings output
+ * pp/oprofpp.h: ditto + do_list_xxx/do_dump_gprof : static
+ free function rather than member function.
+
+2002-03-21 Philippe Elie <ph_e@club-internet.fr>
+
+ * op_user.h:
+ * pp/oprofpp.h: more doxygen comments
+
+ * dae/opd_kernel.c:
+ * dae/opd_proc.c:
+ * dae/opd_util.c:
+ * dae/oprofiled.c:
+ * gui/oprof_start.cpp:
+ * gui/oprof_start_util.cpp: exit(): use {EXIT_FAILURE|EXIT_SUCCESS}
+
+2002-03-20 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/opf_filter.h: simplify slightly interface of samples_files_t
+ * oprof_report/oprof_report.cpp:
+ * pp/op_time.cpp:
+ * pp/opf_container.cpp:
+ * pp/opf_filter.cpp:
+ * pp/oprofp.cpp: reflect the new interface.
+
+ * pp/opp_symbol.cpp: ParseOutputOption --> static member of
+ OutputSymbol ...
+
+ * pp/opp_symbol.h:
+ * util/file_manip.h:
+ * util/string_manip.h: doxygen comments
+
+2002-03-19 Philippe Elie <ph_e@club-internet.fr>
+
+ * scripts/Doxyfile: small tweak
+ * op_user.h:
+ * pp/opp_symbol.h:
+ * pp/oprofpp.h:
+ * util/child_reader.h: doxygen comments.
+
+2002-03-19 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/opf_filter.h:
+ * pp/opf_container.cpp: remove delegation
+ {symbol|samples}_container_t -> xxx_impl, no functionnal change
+
+ * pp/*: start a more serious doxygenization. first step
+ include fixing prototype and a client documentation for
+ opp_bfd
+ * script/Doxyfile: doxygen script for pp/*.h, util/*.h
+
+2002-03-19 John Levon <moz@compsoc.man.ac.uk>
+
+ * module/op_fixmap.c: include pagemap.h, so
+ we pick up highmem.h, which is needed with
+ some kernels (missing kmap_pagetable define
+ via pte_offset)
+
+2002-03-18 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/op_time.cpp:
+ * doc/oprofile1.1.in:
+ * doc/oprofile.sgml: allow reverse sort in all case
+
+ * pp/opp_symbol.h:
+ * pp/opp_symbol.cpp: remove unnecessary cast
+
+ * oprof_report/oprof_report.cpp:
+ * oprof_report/oprof_report.h:
+ * oprof_report/*_view.*: revert partially 2002-03-17 patch,
+ making again data change notification in two step.
+
+2002-03-17 John Levon <moz@compsoc.man.ac.uk>
+
+ * pp/oprofpp_util.cpp: clarify binutils bug workaround
+
+2002-03-17 Philippe Elie <ph_e@club-internet.fr>
+
+ * oprof_report/op_view.h:
+ * oprof_report/hostpost_view.cpp:
+ * oprof_report/hostpost_view.h:
+ * oprof_report/oprof_report.cpp:
+ * oprof_report/oprof_report.h:
+ * oprof_report/oprof_view.cpp:
+ * oprof_report/oprof_view.h: simplify virtual interface +
+ minor graphic bug fix
+
+2002-03-16 Philippe Elie <ph_e@club-internet.fr>
+
+ * TODO: update
+
+ * oprof_report/hotspot_view.cpp: new
+ * oprof_report/hotspot_view.h: new HotspotView class
+ * oprof_report/oprof_report.cpp:
+ * oprof_report/oprof_report.h: use HotspotView
+ * oprof_report/Makefile.in: reflect above
+
+ * pp/op_time.cpp: small tidy
+
+2002-03-15 Philippe Elie <ph_e@club-internet.fr>
+
+ * TODO: update
+
+ * dae/oprofiled.c: fix --version when module is not loaded
+
+ * pp/opp_symbol.cpp:
+ * pp/opp_symbol.h: avoid to padd the last field, use a positive
+ form for osf_header
+
+ * pp/oprofpp.h:
+ * pp/oprofpp.cpp:
+ * pp/opf_filter.cpp:
+ * pp/opprofpp_util.cpp:
+ * pp/op_time.cpp: fix --sort option
+
+2002-03-14 Philippe Elie <ph_e@club-internet.fr>
+
+ * TODO: update
+
+ * pp/op_time.cpp:
+ * pp/opf_filter.cpp:
+ * pp/opp_symbol.cpp:
+ * pp/oprofpp_.cpp:
+ * pp/oprofpp.h:
+ * pp/oprofpp_util.cpp: handle -c0,1 and --sort #nr_ctr
+ for all post-profile tools allowing a more precise way
+ to specify on which counters tools must work
+
+2002-03-13 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/oprofpp_util.cpp: get_linenr() better handling
+ of bfd_find_nearest_line. Fix #529622
+
+ * pp/opf_container.cpp: simplify symbol_container_impl
+
+ * pp/opp_symbol.cpp: use ostringstream only when necessary
+
+2002-03-09 John Levon <moz@compsoc.man.ac.uk>
+
+ * doc/oprofile.sgml: some laptops have a usable local APIC
+
+2002-03-09 Philippe Elie <ph_e@club-internet.fr>
+
+ * oprof_report: new directory, oprofpp/op_time like GUI
+ * oprof_report/op_view.h: base class for view
+ * oprof_report/oprof_report_main.cpp:
+ * oprof_report/oprof_report.h:
+ * oprof_report/oprof_report.cpp: main class
+ * oprof_report/oprofpp_view.h:
+ * oprof_report/oprofpp_view.cpp: oproffp like view
+ * oprof_report/Makefile.in:
+ * oprof_report/ui/oprof_report.base.ui: oprof_report UI
+ * oprof_report/ui/Makefile.in:
+
+ * Makefile.in:
+ * configure.in: handle oprof_report
+
+ * ui/Makefile.in: clarify how dependencies work
+
+2002-03-08 John Levon <moz@compsoc.man.ac.uk>
+
+ * configure.in: bump to 0.2cvs
+
+ * TODO: update
+
+2002-03-07 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/opf_container.cpp: handle osf_short_linr_info
+ * pp/opp_symbol.cpp: tweak output output when
+ linenr/filename is not available
+
+2002-03-07 John Levon <moz@compsoc.man.ac.uk>
+
+ * util/Makefile.in: remove -pedantic (Phil don't you
+ read comments ? ;)
+
+2002-03-07 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+ * pp/: use "invalid" not "illegal"
+
+2002-03-06 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+2002-03-06 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/opfropp_util.cpp: more specific error messages
+
+ * doc/oprofile.sgml: clarify problem about sparse
+ samples files and filesystem.
+
+ * util/file_manip.h:
+ * util/file_manip.cpp: create_file_list() allow recursive
+ file list creation.
+ * pp/op_time.cpp: add option -p/-P to allow specifying
+ alternate path name where to search for image name
+ * doc/oprofile.1.in:
+ * doc/oprofile.sgml: update option for op_time
+
+2002-03-05 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/oprofpp_util.cpp: remove multiple symbols belonging
+ to the same vma (Fix #526098)
+ Accept also all symbol types, we filter them by name.
+
+2002-03-04 Philippe Elie <ph_e@club-internet.fr>
+
+ * util/misc.h: minor comment fix
+
+ * pp/oprofpp_util.cpp: tweak the last commit
+
+2002-03-04 John Levon <moz@compsoc.man.ac.uk>
+
+ * pp/oprofpp_util.cpp: welcome in the local symbols ...
+
+2002-03-03 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/opf_filter.h:
+ * pp/opf_container.cpp: samples_files_t::add() add an hint
+ parameter on what information will needed.
+ * pp/op_time.cpp:
+ * pp/oprofpp.cpp:
+ * pp/opf_filter.cpp: use it
+
+ * pp/op_time.cpp: when a samples files for one counter
+ does not exist avoid to load it (op_time -l) fix #525237
+
+2002-03-02 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/Makefile.in: add -pedantic to CXXFLAGS
+ * pp/oprofpp.h: replace macro verpbrintf with a function
+ * pp/oprofpp_util.cpp: implement it
+ * pp/opp_symbol.h:
+ * pp/op_time.cpp: fix pedantic warning
+
+ * pp/opevents.cpp:
+ * op_user.h: op_get_cpu_nr_counters() new
+
+ * pp/op_time.cpp:
+ * pp/opf_container.cpp:
+ * pp/opf_filter.cpp:
+ * pp/opf_filter.h:
+ * pp/opp_symbol.cpp:
+ * pp/oprofpp.cpp:
+ * pp/oprofpp_util.cpp: remove global var op_nr_counters
+
+2002-03-02 Philippe Elie <ph_e@club-internet.fr>
+
+ * module/op_syscalls.c: do not pre-allocate some dname
+ hash map entry for common pathname but pre alloc entry
+ zero to reserve it
+
+ * pp/op_time.cpp: add image name to the default output format
+
+ * module/compat22.h: move cacheline_aligned macro to ...
+ * module/op_cache.h: this new file
+ * module/compat.h: use it
+ * module/compat22.h:
+ * module/oprofile.c: replace some __cacheline_aligned by
+ __cacheline_aligned_in_smp
+
+2002-03-01 Philippe Elie <ph_e@club-internet.fr>
+
+ * dae/opd_kernel.c:
+ * dae/opd_proc.c: simplify handling of kernel samples
+
+ * pp/opt_time.cpp:
+ * pp/opp_symbol.cpp:
+ * pp/opp_symbol.h:
+ * pp/oprofpp.cpp:
+ * pp/oprofpp.h: tidy, gives a negative form to header output
+ format
+
+ * version.h.in: new macro show_version() to output version
+ * doc/oprofile.sgml: document it
+ * dae/oprofiled.c:
+ * events/op_help.c:
+ * pp/op_merge.cpp:
+ * pp/op_time.cpp:
+ * pp/opf_filter.cpp:
+ * pp/oprofpp.cpp: use it
+
+2002-03-01 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+ * module/oprofile.c:
+ * module/op_syscalls.c: merge note/map lock
+
+2002-02-27 Philippe Elie <ph_e@club-internet.fr>
+
+ * TODO: upadte
+
+ * doc/oprofile.1.in:
+ * doc/oprofile.sgml:
+ * pp/opp_symbol.h:
+ * pp/opp_symbol.cpp:
+ * pp/oprofpp.cpp: use columned output for oprofpp -L, -s
+
+ * pp/oprofpp.cpp: command-line counter specification
+ was broken by my last patch
+ * pp/opf_filter.cpp: ditto but bug comes from the far past
+
+2002-02-26 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/op_merge.cpp: small tidy
+
+ * pp/op_time.cpp:
+ * pp/opf_container.cpp:
+ * pp/opf_filter.h:
+ * pp/opf_filter.cpp:
+ * pp/oprofpp.cpp:
+ * pp/oprofpp.h:
+ * pp/oprofpp_util.cpp: remove the nasty global var int ctr;
+ pass it as parameter to each relevant function using it.
+
+ * module/compat.h: support for 2.5.5. 2.4.18 also tested
+
+ * pp/opp_symbol.h:
+ * pp/opp_symbol.cpp: new, mainly for implementing --output-format
+ * pp/op_time.cpp:
+ * pp/oprofpp.cpp: use output format stuff
+ * pp/Makefile.in: reflect above change
+ * doc/oprofile.1.in:
+ * doc/oprofile.sgml: document --output-format
+
+2002-02-13 Philippe Elie <ph_e@club-internet.fr>
+
+ * TODO: update
+
+ * module/compat22.h:
+ * module/compat24.h:
+ * module/oprofile_nmi.S: small tidy
+
+ * module/op_apic.c:
+ * module/op_fixmap.c:
+ * module/op_nmi.c:
+ * module/oprofile.h: avoid memory leak of apic mapping
+
+2002-02-12 Philippe Elie <ph_e@club-internet.fr>
+
+ * TODO: update
+
+ * pp/oprofpp_util.cpp: use stable sort and correct the comparison
+ function on symbol vma
+ * pp/opf_filter.cpp: remove a boring new line in output
+
+ * module/makefile.in: optimize for 686 but do not use any specific
+ 686 insn.
+
+ * configure.in: check against CONFIG_PREEMPT
+
+2002-02-10 John Levon <moz@compsoc.man.ac.uk>
+
+ * events/op_events_desc.c: remove dead code
+
+ * module/compat.h: RedHat backported MODULE_LICENSE()
+
+ * module/op_syscalls.c:
+ * module/op_util.c: remove FIXMEs
+
+2002-02-09 Bob Montgomery <bobm@fc.hp.com>
+
+ * module/op_rtc.c: right actual RTC value back
+
+ * doc/oprofile.sgml: document that
+
+2002-02-09 John Levon <moz@compsoc.man.ac.uk>
+
+ * module/op_init.c: set rtc cpu type directly
+
+2002-02-08 Philippe Elie <ph_e@club-internet.fr>
+
+ * TODO: update
+
+ * module/oprofile_nmi.S: cut and copy from oprofile_nmi24.s
+ * module/oprofile_nmi22.S: remove
+ * module/oprofile_nmi22.S: remove
+ * module/Makefile.in: reflect them
+
+ * pp/opf_filter.cpp: do not print unit mask for RTC cpu type
+
+ * doc/oprofile.sgml: document post-profile tools commons options
+
+2002-02-05 Philippe Elie <ph_e@club-internet.fr>
+
+ * TODO: update mainly by moving things to 0.1
+
+ * pp/opf_filter.h:
+ * pp/opf_container.cpp: small cleanup + minor tweak to get
+ more reliable sort order on filename.
+
+2002-02-05 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/opf_filter.h: declare create_artificial_symbol()
+ * pp/oprofpp_util.cpp: show how elf symbols size could
+ be handled.
+
+ * pp/oprofpp_util.cpp: add BSF_GLOBAL symbols to
+ symbols of interest.
+
+2002-02-04 John Levon <moz@compsoc.man.ac.uk>
+
+ * module/oprofile.c: add [un]lock_sysctl
+
+2002-02-04 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/oprofiled.h:
+ * dae/oprofiled.c:
+ * dae/opd_proc.c: free stuff on shutdown (to
+ clean dmalloc reports)
+
+2002-02-03 John Levon <moz@compsoc.man.ac.uk>
+
+ * configure.in: bump to 0.1
+
+ * TODO: update
+
+2002-02-02 John Levon <moz@compsoc.man.ac.uk>
+
+ * configure.in: bump to 0.0.9
+
+2002-02-02 John Levon <moz@compsoc.man.ac.uk>
+
+ * module/op_nmi.c: fix stupid bug spotted by Bob
+ Montgomery
+
+2002-02-01 Philippe Elie <ph_e@club-internet.fr>
+
+ * module/compat.h: define REMAP_PAGE_RANGE
+ * module/op_syscalls.c: use it (2.5.3 support)
+
+2002-01-30 Philippe Elie <ph_e@club-internet.fr>
+
+ * module/compat.h:
+ * module/op_nmi.c: re-add explicit constant for all MSR_
+ constants.
+
+2002-01-30 Philippe Elie <ph_e@club-internet.fr>
+
+ * configure.in:
+ * doc/oprofile.sgml:
+ * module/compat22.h: remove support for kernel version
+ prior to 2.2.11
+
+ * module/op_fixmap.c:
+ * module/compat.h: small cleanup
+
+ * module/oprofile.c: avoid multi-line literal string
+
+ * pp/oprofpp_util.cpp: better to get_symbols() ;)
+
+2002-01-29 John Levon <moz@compsoc.man.ac.uk>
+
+ * module/op_fixmap.c: remap fake mapping on 2.2 as well
+ when necessary
+
+2002-01-27 Philippe Elie <ph_e@club-internet.fr>
+
+ * module/Makefile.in: sorry, -Werror is only usefull
+ for test.
+
+ * doc/oprofile.1.in: a few words about op_stop
+
+ * module/compat.h:
+ * module/compat22.h:
+ * module/compat24.h: change pte_page_address definition
+ for 2.2.20
+
+ * pp/opf_container.cpp: no warning when creating artificial symbols
+ * pp/oprofpp_tuil.cpp: no warning for image without symbols
+
+2002-01-27 John Levon <moz@compsoc.man.ac.uk>
+
+ * gui/oprof_start.cpp:
+ * pp/op_merge.cpp:
+ * pp/op_time.cpp:
+ * pp/opf_container.cpp: std namespace fixes.
+
+2002-01-27 John Levon <moz@compsoc.man.ac.uk>
+
+ * pp/op_time.cpp: small hacky output cleanup
+
+2002-01-27 Philippe Elie <ph_e@club-internet.fr>
+
+ * TODO: update
+
+ * dae/opd_proc.c: small cleanup
+
+ * doc/opf_container.cpp: handle image without symbols
+
+ * doc/oprofile.1.in:
+ * doc/oprofile.sgml:
+ * doc/op_time.cpp: implement and document --demangle
+ and --show-image-name
+
+ * pp/oprofpp_util.cpp: add using elf symbols size but
+ disable it
+
+2002-01-26 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+ * dae/opd_proc.c: tiny clean
+
+ * doc/oprofile.sgml: spell fix
+
+2002-01-26 Philippe Elie <ph_e@club-internet.fr>
+
+ * TODO: update
+
+ * pp/op_merge.c: remove FIXME
+ * pp/op_time.cpp: minor fix
+
+ * pp/opf_filter.h:
+ * pp/opf_filter.cpp:
+ * pp/oprofpp.cpp:
+ * pp/opf_container.cpp: Show more clearly than
+ samples_files_t support adding any number of samples
+ files to the underlined container.
+
+2002-01-26 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/oprofpp_util.cpp: allow to load image without symbols
+
+ * pp/Makefile.in:
+ * pp/op_time: implement -l option that show symbols details.
+ Currently with separate-samples files symbols are showed
+ more than one time. This is a bug rather a feature.
+ * doc/oprofile.1.in:
+ * doc/oprofile.sgml: document op_time -l
+
+ * dae/opd_proc.c: bug fix from last change
+
+2002-01-25 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO:
+ * dae/opd_proc.c: search maps in reverse order so we prefer
+ newer mappings.
+
+2002-01-25 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/op_merge.cpp: minor fix + comment
+ * pp/op_time.cpp: comment, use samples_file_t
+ * pp/oprofpp.h:
+ * pp/oprofpp_util.cpp: minor change
+
+2002-01-24 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/opd_proc.c: remove stale comment
+
+ * TODO: update
+
+ * module/compat.h:
+ * module/compat22.h:
+ * module/compat24.h: fix for pte_page on 2.2.20+
+
+2002-01-24 Philippe Elie <ph_e@club-internet.fr>
+
+ * op_merge.cpp:
+ * oprofpp.h:
+ * oprofpp_util.cpp: code move + cleanup
+
+2002-01-23 Philippe Elie <ph_e@club-internet.fr>
+
+ * util/shared_ptr.h: a templatized shared pointer.
+
+ * pp/op_merge.c: new to merge samples files
+ * pp/Makefile.in:
+ * pp/opf_filter.cpp:
+ * pp/opf_filter.h:
+ * pp/oprofpp.h:
+ * pp/oprofpp_util.cpp: minor change to add op_merge support
+
+ * doc/Makefile.in:
+ * doc/oprofile.1.in:
+ * doc/oprofle.smgl: document op_merge
+
+2002-01-22 John Levon <moz@compsoc.man.ac.uk>
+
+ * module/Makefile.in: can only depmod if we run that kernel
+
+ * module/op_fixmap.c: deal with no APIC config for
+ 2.4.10+
+
+2002-01-22 John Levon <moz@compsoc.man.ac.uk>
+
+ * module/Makefile.in:
+ * module/oprofile.h:
+ * module/oprofile.c:
+ * module/op_x86.c:
+ * module/op_apic.c:
+ * module/op_fixmap.c: split op_x86.c. Various changes to
+ only enable the APIC if it's not, and to remap / map the APIC
+ as is necessary.
+
+ * module/apic_up_compat.h:
+ * module/compat.h:
+ * module/compat22.h: clean up V_*() macros
+
+ * module/op_init.c: remove FORCE_RTC
+
+2002-01-22 Philippe Elie <ph_e@club-internet.fr>
+
+ * TODO: update
+
+ * dae/opd_proc.c: use remove not unlink
+ * gui/oprof_start.cpp: use remove not system("rm xxx")
+
+ * doc/Makefile.in: slightly improvment
+ * doc/oprofile.1.in: move --help --version to a common section
+
+2002-01-21 John Levon <moz@compsoc.man.ac.uk>
+
+ * module/compat22.h: fix missing cli()
+
+2002-01-21 John Levon <moz@compsoc.man.ac.uk>
+
+ * module/oprofile.c:
+ * module/compat22.h:
+ * module/compat24.h: fix NMI wake-up for 2.2 SMP
+
+ * module/op_dcache.h: add KERN_ERR
+
+ * module/op_x86.c: cleanup a little
+
+2002-01-21 Philippe Elie <ph_e@club-internet.fr>
+
+ * TODO: update
+
+ * doc/oprofile.1.in:
+ * doc/oprofile.sgml: minor change
+
+ * module/Makefile.in: auto-dependencies for compat.c
+
+ * module/compat.c:
+ * module/compat22.h: FIXME remove for vmalloc_32
+
+2002-01-20 Philippe Elie <ph_e@club-internet.fr>
+
+ * gui/oprof_start.cpp: fix configuration saving when
+ switching of cpu_type.
+
+ * module/Makefile.in:
+ * module/compat.c: minor change
+
+ * compat.h: add minor macro
+ * oprofile.c: use minor instead MINOR (2.5.2 support)
+
+ * op_x86.c: check SPIV (missing from a previous patch)
+
+2002-01-20 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: punt some things to next release
+
+ * dae/opd_proc.c: fix printf of null
+
+2002-01-20 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+ * module/oprofile.c: add comment
+
+ * module/compat22.h:
+ * module/compat24.h:
+ * module/op_syscalls.c: fix locking for out_mmap
+
+2002-01-20 Philippe Elie <ph_e@club-internet.fr>
+
+ * module/op_x86.c: check MSR + SPIV for enabling APIC
+
+ * module/compat.c: don't attempt to get root
+
+ * module/compat.h: NEED_FIXMAP fixes
+
+2002-01-18 Philippe Elie <ph_e@club-internet.fr>
+
+ * TODO: update
+
+ * module/compat.h:
+ * module/compat24.h: move things needed for 2.2/2.4 in compat.h
+
+2002-01-18 John Levon <moz@compsoc.man.ac.uk>
+
+ * module/compat22.h: never wake up from NMI
+ on 2.2 SMP for now :(
+
+2002-01-18 John Levon <moz@compsoc.man.ac.uk>
+
+ * module/compat.h:
+ * module/compat22.h:
+ * module/compat24.h: s/VATLEAST/V_AT_LEAST/
+
+ * module/oprofile.c: remove dead code
+
+2002-01-17 John Levon <moz@compsoc.man.ac.uk>
+
+ * module/compat.c: don't need to re-take BKL for
+ d_path on 2.2
+
+2002-01-17 John Levon <moz@compsoc.man.ac.uk>
+
+ * module/compat22.h:
+ * module/compat24.h:
+ * module/op_syscalls.c: we mustn't take the mmap sem
+ under 2.2
+
+2002-01-17 John Levon <moz@compsoc.man.ac.uk>
+
+ * module/compat22.h:
+ * module/compat24.h:
+ * module/op_syscalls.c: whoops, handy to lock the
+ BKL when it is necessary.
+
+ * dae/oprofiled.c: fix warning
+
+2002-01-17 John Levon <moz@compsoc.man.ac.uk>
+
+ * op_user.h:
+ * dae/op_start:
+ * gui/oprof_start_config.h:
+ * module/oprofile.h: bump note size and watermark,
+ I was getting problems on my dual SMP box in kernel compiles
+
+2002-01-17 John Levon <moz@compsoc.man.ac.uk>
+
+ * module/Makefile.in:
+ * module/oprofile_nmi.S:
+ * module/oprofile_nmi22.S:
+ * module/oprofile_nmi24.S: split assembly for 2.2/4
+
+ * module/compat.h:
+ * module/compat22.h:
+ * module/compat24.h: s/AFTER/ATLEAST/
+
+2002-01-17 John Levon <moz@compsoc.man.ac.uk>
+
+ * module/compat24.h: define to have ->owner
+
+2002-01-17 Philippe Elie <ph_e@club-internet.fr>
+
+ * gui/oprof_start.h:
+ * gui/oprof_start_config.h:
+ * gui/oprof_start.cpp: validate the RTC max count
+
+2002-01-17 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+ * oprofile.c:
+ * module/compat24.h:
+ * module/compat22.h: fix compile, nmi wake up check
+
+ * module/op_rtc.c: user/kernel profiling feature
+
+2002-01-17 John Levon <moz@compsoc.man.ac.uk>
+
+ * doc/oprofile.sgml: clarification
+
+ * module/compat22.h:
+ * module/compat24.h:
+ * module/oprofile.c: ->owner fixes
+
+2002-01-17 John Levon <moz@compsoc.man.ac.uk>
+
+ * module/oprofile.h: clean up
+
+ * module/compat.h:
+ * module/compat22.h:
+ * module/compat24.h: split header files up
+ for readability
+
+2002-01-17 Philippe Elie <ph_e@club-internet.fr>
+
+ * TODO: update
+
+ * doc/oprofile.sgml: speach about assembler
+
+ * module/compat.h: small tweak for 2.2, no impact on 2.4
+
+2002-01-16 John Levon <moz@compsoc.man.ac.uk>
+
+ * configure.in: look for rtc_lock
+
+ * module/compat.h: use rtc_lock if there
+
+2002-01-16 Philippe Elie <ph_e@club-internet.fr>
+
+ * module/compat.h:
+ * module/apic_up_compat.h: cleanup + allow compile
+ !CONFIG_X86_LOCAL_APIC on 2.4/2.5. (only compile
+ tested)
+
+2002-01-15 Philippe Elie <ph_e@club-internet.fr>
+
+ * events/op_events.c: avoid gui crash: event name must
+ contain only one word. If you test RTC patch destroy
+ ~/.oprofile/oprof_start_event#0
+
+2002-01-15 John Levon <moz@compsoc.man.ac.uk>
+
+ * module/compat.h:
+ * module/compat.c:
+ * module/op_rtc.c: 2.2 modversions fix
+
+2002-01-15 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+ * module/compat.h:
+ * module/compat.c:
+ * module/op_rtc.c: fix 2.2 compile
+
+2002-01-15 John Levon <moz@compsoc.man.ac.uk>
+
+ * module/Makefile.in: whoops, forgot to commit this
+
+2002-01-15 John Levon <moz@compsoc.man.ac.uk>
+
+ * gui/oprof_start.cpp: some improvements for RTC
+
+2002-01-15 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/op_stop: fix "op_start && op_stop" bug using multiple
+ dump_stop writes.
+
+2002-01-14 Dave Jones <davej@suse.de>
+
+ * pp/op_time.cpp: fix for printing (NaN%) in the zero sample case.
+
+2002-01-14 John Levon <moz@compsoc.man.ac.uk>
+
+ * module/op_rtc.c: remove unneeded check
+
+2002-01-14 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/op_start: fix for PMC case
+
+2002-01-14 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+ * dae/op_start: take --rtc-value
+
+ * dae/oprofiled.c: set headers sensibly for RTC
+
+ * doc/oprofile.1.in: update
+
+ * doc/oprofile.sgml: RTC update
+
+ * events/op_events_descr.c:
+ * events/op_events.c: good name for RTC event
+
+ * gui/oprof_start.cpp: basic support for RTC
+
+ * module/op_rtc.c: implement and use rtc_value
+
+2002-01-14 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+ * dae/op_start: load module at start. Handle CPU_RTC.
+ Avoid sysctl for now on RTC case.
+
+ * dae/oprofiled.c: only read sysctls if PMC. Needs clean.
+
+ * events/op_events.c: add RTC event.
+
+ * events/op_events_desc.c: get CPU type from module.
+
+ * module/op_init.c: detect CPU_RTC.
+
+ * module/op_nmi.c: setup code moved from op_init.c
+
+ * module/op_rtc.c: enable interrupt, fixed at 128 for now.
+
+ * module/op_x86.c: add Athlon to needs_apic_setup checks
+
+ * module/oprofile.c: use correct interrupt handler based on
+ CPU type
+
+2002-01-14 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+ * op_user.h: add CPU_RTC
+
+ * op_init.c: add FIXMEs
+
+ * op_nmi.c:
+ * op_rtc.c:
+ * oprofile.h:
+ * oprofile.c: implement abstract interrupt handler code
+
+2002-01-14 John Levon <moz@compsoc.man.ac.uk>
+
+ * gui/oprof_start_config.cpp: fix vmlinux/system.map defaults
+
+2002-01-13 Philippe Elie <ph_e@club-internet.fr>
+
+ * configure.in: reject unsupported kernel version
+ * module/apic_up_compat.h:
+ * module/compat.h: small cleanup
+ * module/op_x86.c: ditto, always put apic memory page as
+ non cachable
+
+2002-01-12 John Levon <moz@compsoc.man.ac.uk>
+
+ * gui/oprof_start_util.h:
+ * gui/oprof_start_util.cpp: implement whitelist for arguments
+ to op_start
+
+ * TODO: update
+
+2002-01-13 Philippe Elie <ph_e@club-internet.fr>
+
+ * module/compat.h:
+ * module/apic_up_compat.h:
+ * module/op_x86.c: allow to run oprofile when
+ !CONFIG_X86_LOCAL_APIC on 2.2.x kernel
+
+2002-01-12 Philippe Elie <ph_e@club-internet.fr>
+
+ * module/compat.h: fix some FIXME
+ * module/op_x86.c: do not hang SMP kernel UP box with 2.2.x
+
+2002-01-11 Philippe Elie <ph_e@club-internet.fr>
+
+ * module/compat.h: support for UP from 2.2.0, for SMP
+ from 2.2.8. It is worthwhile to try more support.
+ !CONFIG_X86_LOCAL_APIC not yet supported.
+
+2002-01-11 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+ * dae/opd_proc.c:
+ * doc/oprofile.sgml:
+ * pp/op_time.cpp: add FIXMEs
+
+2002-01-11 John Levon <moz@compsoc.man.ac.uk>
+
+ * module/oprofile.c: never return 0 unless we're
+ really closing down
+
+2002-01-11 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+ * gui/Makefile.in:
+ * gui/oprof_start.cpp: use absolute paths
+
+2002-01-11 John Levon <moz@compsoc.man.ac.uk>
+
+ * doc/oprofile.sgml: add note about --with-linux
+
+2002-01-11 John Levon <moz@compsoc.man.ac.uk>
+
+ * Rules.make.in:
+ * gui/Makefile.in:
+ * gui/oprof_start_config.h:
+ * gui/oprof_start_config.cpp: remove kernel headers
+ from userland !
+
+2002-01-11 John Levon <moz@compsoc.man.ac.uk>
+
+ * configure.in: remove dead checks. comment out APIC check,
+ hide grep output
+
+ * module/Makefile.in: add compat.c
+
+ * apic_up_compat.h: UP 2.2 missing defines. Need to investigate
+ fixmap situation.
+
+ * compat.c: move 2.2 dcache code here
+
+ * compat.h: dcache compat support. check for whether we
+ should check for mptable. Don't do fixmap hack on 2.2
+
+ * op_dcache.h: shared dcache inline functions
+
+ * op_syscalls.c: clean up dcache code for 2.2/2.4
+
+ * op_x86.c: update apic_need_setup for 2.2 and the possibility
+ of not enabling APIC support on 2.4 too. Needs checking ! Also
+ don't do mptable check on 2.2
+
+ * oprofile.h: add missing include guard ;)
+
+2002-01-11 John Levon <moz@compsoc.man.ac.uk>
+
+ * module/compat.h: minor fixes
+
+2002-01-11 Philippe Elie <ph_e@club-internet.fr>
+
+ * module/compat.h: many change, can be used down to 2.2.8
+ * module/oprofile.h: move #ifdef on kernel version to compat.h
+ * module/op_util.c:
+ * module/op_syscalls.c: minor change
+ * configure.in: comment unnecessary stuf.
+
+ * module/Makefile.in: missing include path for oprofile.s
+
+2002-01-10 John Levon <moz@compsoc.man.ac.uk>
+
+ * Makefile.in: update checklist for dist
+
+ * module/oprofile.h: add apparently needed version.h
+
+2002-01-10 John Levon <moz@compsoc.man.ac.uk>
+
+ * configure.in: fix accidental trashing of BKCFLAGS
+
+ * module/op_util.c: include right header
+
+ * module/compat.h: use correct smp_call_function
+
+2002-01-10 Philippe Elie <ph_e@club-internet.fr>
+
+ * module/compat.h: new file include backward compatibility
+ stuff
+
+2002-01-09 John Levon <moz@compsoc.man.ac.uk>
+
+ * doc/oprofile.sgml: update infodragon's email
+ address
+
+ * configure.in: bump to 0.0.9cvs
+
+2002-01-08 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+ * configure.in: fix case when X isn't installed. Bump to 0.0.8
+
+2002-01-07 John Levon <moz@compsoc.man.ac.uk>
+
+ * util/Makefile.in: "fix" last g++ 3.0 problem
+ with libiberty.h and string.h clashing prototypes
+ by disabling -pedantic for this directory
+
+2002-01-07 John Levon <moz@compsoc.man.ac.uk>
+
+ * pp/opf_container.cpp:
+ * pp/opf_filter.h:
+ * pp/oprofpp.cpp:
+ * pp/oprofpp.h:
+ * pp/oprofpp_util.cpp:
+ * util/file_manip.h:
+ * util/file_manip.cpp:
+ * util/string_manip.h: fix most g++ 3.0 problems
+
+2002-01-07 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+2002-01-05 Philippe Elie <ph_e@club-internet.fr>
+
+ * doc/oprofile.sgml: Avoid to use -- inside
+ sgml comment
+
+2002-01-05 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/op_start:
+ * dae/op_stop: (very) hacky loop to wait for
+ daemon start and stop
+
+2002-01-05 John Levon <moz@compsoc.man.ac.uk>
+
+ * module/oprofile.c: revert my broken stop fix,
+ and fix the old (new) one
+
+2002-01-05 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/opd_kernel.c:
+ * dae/opd_proc.c:
+ * dae/opd_proc.h:
+ * dae/opd_util.c:
+ * dae/oprofiled.c:
+ * dae/oprofiled.h: further minor cleanups
+
+2002-01-04 John Levon <moz@compsoc.man.ac.uk>
+
+ * module/oprofile.c: change last change to have an
+ explicit check in the sysctl dump, rather than generalised
+ code.
+
+2002-01-04 Philippe Elie <ph_e@club-internet.fr>
+
+ * module/oprofile.c: do not re-enable counter during
+ shutdown
+
+ * dae/Makefile.in: fix opd_kernel.c dependancy
+
+2002-01-04 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/Makefile.in:
+ * dae/opd_proc.c:
+ * dae/opd_kernel.c: move kernel/module stuff into
+ new file. Some minor changes.
+
+2002-01-04 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/oprofiled.c: remove extra dump
+
+2002-01-04 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/opd_proc.c: minor crap
+
+2002-01-04 John Levon <moz@compsoc.man.ac.uk>
+
+ * TODO: update
+
+ * dae/oprofiled.c:
+ * dae/oprofiled.h:
+ * dae/opd_proc.c: print stats on shutdown too
+
+ * module/oprofile.c: additional check against daemon hanging on shutdown :(
+
+2002-01-04 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/op_stop:
+ * dae/oprofiled.c:
+ * doc/oprofile.sgml:
+ * module/oprofile.h:
+ * module/oprofile.c: implement new clean shutdown via
+ sysctl dump_stop
+
+2002-01-04 Philippe Elie <ph_e@club-internet.fr>
+
+ * module/oprofile.c: add a warning when note buff overflow.
+
+2002-01-04 John Levon <moz@compsoc.man.ac.uk>
+
+ * module/oprofile.c: pin note at the end on overflow
+
+2002-01-03 Philippe Elie <ph_e@club-internet.fr>
+
+ * dae/opd_proc.c: Apologies: stupid bug. Never forget
+ than LRU list of samples files must not contain already
+ unmaped files
+
+ * module/oprofile.c: another silly bug, detected cpu was
+ overwritten...
+
+2002-01-03 John Levon <moz@compsoc.man.ac.uk>
+
+ * doc/oprofile.sgml: some fixes, comments
+
+2002-01-03 Philippe Elie <ph_e@club-internet.fr>
+
+ * doc/oprofile.sgml: improve documentation, corrected
+ by John Levon
+
+2002-01-03 John Levon <moz@compsoc.man.ac.uk>
+
+ * gui/oprof_start.h:
+ * gui/oprof_start.cpp:
+ * gui/ui/oprof_start.base.ui: remove the config buttons
+ and save on a hide from the WM
+
+2002-01-03 John Levon <moz@compsoc.man.ac.uk>
+
+ * module/oprofile.c: make sure note_pos never goes
+ past the buffer :P
+
+2002-01-03 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/opd_util.c: allow EAGAINs through as well
+
+2002-01-02 Philippe Elie <ph_e@club-internet.fr>
+
+ * pp/opf_container.cpp:
+ * pp/opf_filter.cpp: minor change
+
+2002-01-02 John Levon <moz@compsoc.man.ac.uk>
+
+ * doc/oprofile.sgml: various docs improvements
+
+2002-01-02 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/oprofiled.c: better enable the actual
+ profiling again :P
+
+2002-01-02 John Levon <moz@compsoc.man.ac.uk>
+
+ * config.h.in: remove this again from CVS.
+
+2002-01-02 John Levon <moz@compsoc.man.ac.uk>
+
+ * dae/op_stop: send SIGUSR1 to stop profiler
+
+ * dae/opd_proc.c: reformat a little
+
+ * dae/opd_util.h:
+ * dae/opd_util.c: change opd_read_device semantics
+
+ * dae/oprofiled.c: clean shutdown from SIGUSR1
+
+ * module/oprofile.c: handle non-blocking reads
+
+ * pp/opf_filter.h:
+ * pp/opf_filter.cpp: slight cleanups
+
+ * TODO: update
+
+2002-01-01 John Levon <moz@compsoc.man.ac.uk>
+
+ * oprofile.sgml: clarify that -g is not necessary for
+ basic profiling (reported by Jeff Epler <jepler@inetnebr.com>)
+
+See ChangeLog-2001 for earlier changelogs.
diff --git a/ChangeLog-2003 b/ChangeLog-2003
new file mode 100644
index 0000000..6356abe
--- /dev/null
+++ b/ChangeLog-2003
@@ -0,0 +1,6251 @@
+2003-12-29 Philippe Elie <phil.el@wanadoo.fr>
+
+ * configure.in: my_op_prefix is not necessarily suffixed by a '/'
+
+2003-12-29 John Levon <levon@movementarian.org>
+
+ * configure.in:
+ * doc/*.1.in: add HTML docs to SEE ALSO
+
+2003-12-29 John Levon <levon@movementarian.org>
+
+ * doc/opcontrol.1.in:
+ * doc/oprofile.xml: minor language cleanups
+
+ * utils/opcontrol: only allow --verbose when it makes sense
+
+2003-12-28 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/tests/file_manip_tests.cpp: ensure filename passed to
+ op_realpath() exists
+
+2003-12-28 John Levon <levon@movementarian.org>
+
+ * doc/internals.xml:
+ * libutil++/file_manip.h: fix typos
+
+2003-12-16 Philippe Elie <phil.el@wanadoo.fr>
+
+ * utils/opcontrol: error message rewording
+
+2003-12-16 Carlo Wood <carlo@alinoe.com>
+
+ * libregex/tests/Makefile.am: avoid to install mangled-name test file
+
+2003-11-20 John Levon <levon@movementarian.org>
+
+ * libregex/op_regex.cpp: move global ctor out of namespace
+ anon (bug #845616)
+
+2003-11-19 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/arrange_profiles.cpp: merge all unit mask before generating
+ event description string
+
+2003-11-17 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/arrange_profiles.cpp: put unitmask in the same axis as
+ event:count, meaning than unitmask is now a part of the event
+ specification.
+
+2003-12-19 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/opd_sfile.c: we reversed to/from pc in call graph sample
+
+2003-11-23 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/profile.h:
+ * pp/opgprof.cpp: oops a simplify a bit too cg handling in my last
+ patch, it was segfaulting each time no cg file was found...
+
+2003-11-15 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opgprof.cpp: simplify a bit cg handling, we don't need to know
+ if we retrieved some cg files since the profile_t will be empty
+ in this case
+
+2003-11-15 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/profile.h: iterator::vma() must return the full key not only
+ an unsigned int.
+ * pp/opgprof.cpp: implement merging of cg files.
+
+2003-11-15 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/profile_spec.cpp:
+ * libpp/profile_spec.h:
+ * pp/opannotate_options.cpp:
+ * pp/opgprof_options.cpp:
+ * pp/opreport_options.cpp: filter call graph samples files
+
+2003-11-14 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/opd_mangling.c: oops, it's better to really open the cg file
+
+ * daemon/opd_sfile.c:
+ * daemon/opd_stats.c:
+ * daemon/opd_stats.h:
+ * daemon/liblegacy/opd_24_stats.c:
+ * daemon/liblegacy/opd_24_stats.h:
+ * daemon/liblegacy/opd_proc.c: log sample lost due to sample file open
+ failure
+
+2003-11-15 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/liblegacy/opd_parse_proc.c: always provide an image name
+ for parsed process in /proc
+
+2003-11-15 Philippe Elie <phil.el@wanadoo.fr>
+
+ * doc/oprofile.xml:
+ * libop/op_cpu_type.c: s/hammer/AMD64 processors/ for user visible
+ name.
+
+2003-11-13 John Levon <levon@movementarian.org>
+
+ * libutil/op_file.h:
+ * libutil/op_file.c: remove op_c_dirname(),
+ op_relative_to_absolute_path(), op_is_directory(),
+ op_follow_link(), in favour of using realpath(3)
+
+ * libutil/tests/file_tests.c: fixes for above changes
+
+ * libutil++/file_manip.h:
+ * libutil++/file_manip.cpp: changes from above. Add
+ op_realpath().
+
+ * libutil++/tests/file_manip_tests.cpp: changes from
+ above.
+
+ * daemon/oprofiled.c:
+ * daemon/liblegacy/opd_parse_proc.c:
+ * gui/oprof_start_util.cpp:
+ * libpp/locate_images.cpp:
+ * libpp/profile_spec.cpp:
+ * pp/opannotate.cpp: changes from above
+
+2003-11-12 John Levon <levon@movementarian.org>
+
+ * configure.in: bump to 0.8cvs
+
+2003-11-11 John Levon <levon@movementarian.org>
+
+ * configure.in: bump to 0.7.1
+
+2003-11-11 Joseph VanAndel <unknown@unknown.org>
+
+ * daemon/liblegacy/init.c: fix #840046 (segfault when starting profiler
+ with --no-vmlinux setup), this bug was present in 0.7.0.
+
+2003-11-11 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/profile_spec.cpp: more precise error message
+ * libutil++/tests/file_manip_tests.cpp: corner case test added
+ for dirname
+
+2003-11-11 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/arrange_profiles.cpp: report_error() shows only distinct
+ conflicting name.
+
+2003-11-10 Philippe Elie <phil.el@wanadoo.fr>
+
+ * doc/opcontrol.1.in: reverse kernel:user in event setting description.
+ Fix #838968
+
+2003-11-09 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/init.c:
+ * daemon/liblegacy/init.c: move opd_read_fs_int ...
+ * daemon/oprofiled.h:
+ * daemon/oprofiled.c: here
+ * daemon/liblegacy/opd_24_stats.c: dump kernel note buffer overflow and
+ buffer overlow
+
+2003-11-09 Philippe Elie <phil.el@wanadoo.fr>
+
+ * utils/op_help.c: do not use OP_MAX_COUNTERS but get counter number
+ at runtime
+
+2003-11-09 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/tests/string_manip_tests.cpp: rtrim/ltrim/trim tests
+
+2003-11-08 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libop/tests/Makefile.am:
+ * libop/tests/mangle_tests.c: new tests: sample filename mangling
+
+2003-11-08 Philippe Elie <phil.el@wanadoo.fr>
+
+ * module/x86/op_syscalls.c: fix build with 2.2 kernel
+
+2003-11-06 Philippe Elie <phil.el@wanadoo.fr>
+
+ * Makefile.am: use .PHONY for module goal to not statisfy this goal
+ with the subdir named module
+ * m4/findkernel.m4: minor fix.
+
+2003-11-06 John Levon <levon@movementarian.org>
+
+ * Makefile.am: minor cleanup
+
+2003-11-06 John Levon <levon@movementarian.org>
+
+ * gui/Makefile.am: remove unused -DKVERSION
+
+2003-11-06 John Levon <levon@movementarian.org>
+
+ * configure.in: add --disable-werror and --disable-optimization
+
+ * doc/oprofile.xml: document above. Remove docs for
+ * --enable-gcov (only useful to developers)
+
+2003-11-06 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/opd_kernel.c:
+ * daemon/liblegacy/opd_kernel.c: be less paranoid about kernel range,
+ this is slightly different than the patch Thomas Spatzier tested but
+ it can't hurt (famous last words ...). This fixes s390x where kernel
+ start can be zero and was rejected.
+
+2003-11-06 Thomas Spatzier <tspat@de.ibm.com>
+
+ * daemon/opd_cookie.c: changed an #if defined for selecting right
+ system call for IBM s390 or s390x, respectively
+
+2003-11-04 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/path_filter.cpp: remove 2 identical FIXME
+ * libutil++/tests/file_manip_tests.cpp:
+ * libutil++/tests/path_filter_tests.cpp: reflect the behavior by
+ new tests
+
+2003-11-04 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libdb/db_manage.c:
+ * libop/op_events.h: -pedantic fix
+
+2003-11-04 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/opd_sfile.c:
+ * daemon/liblegacy/opd_kernel.c:
+ * libutil/op_cpufreq.c:
+ * libutil/op_file.c: a few s/goto/break/
+ * libpp/format_output.cpp: padding never used after initialization
+
+2003-11-04 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/comma_list.h: don't accept cumulative behavior
+ * libutil++/string_manip.cpp: separate_token() return by value
+ * gui/oprof_start.cpp:
+ * libopt++/popt_options.cpp:
+ * libpp/parse_filename.cpp:
+ * libpp/profile_spec.cpp:
+ * libutil++/comma_list.h:
+ * libutil++/string_filter.cpp:
+ * libutil++/string_manip.cpp:
+ * libutil++/string_manip.h:
+ * libutil++/tests/comma_list_tests.cpp:
+ * libutil++/tests/string_manip_tests.cpp: update according
+ * libpp/profile_spec.cpp: remove all trace of defunct op_alias
+
+2003-11-04 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/liblegacy/opd_image.c:
+ * daemon/liblegacy/opd_image.h:
+ * daemon/liblegacy/opd_mapping.c:
+ * daemon/liblegacy/opd_mapping.h:
+ * daemon/liblegacy/opd_proc.c:
+ * gui/oprof_start.cpp:
+ * gui/oprof_start.h:
+ * gui/oprof_start_config.cpp:
+ * gui/oprof_start_util.cpp:
+ * libop/op_config_24.h:
+ * libpp/format_output.cpp:
+ * libpp/op_header.cpp:
+ * libpp/profile.h:
+ * libpp/profile_container.cpp:
+ * libpp/profile_spec.cpp:
+ * libpp/profile_spec.h:
+ * libpp/symbol.h:
+ * libpp/symbol_sort.cpp:
+ * libutil++/stream_util.cpp:
+ * libutil++/stream_util.h:
+ * libutil++/utility.h:
+ * pp/common_option.cpp:
+ * pp/common_option.h:
+ * pp/opannotate_options.h:
+ * pp/opgprof.cpp:
+ * pp/opgprof_options.cpp:
+ * pp/opgprof_options.h:
+ * pp/opreport_options.cpp:
+ * pp/opreport_options.h:
+ * pp/populate.cpp: remove some .h dependencies
+
+2003-11-03 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/tests/Makefile.am:
+ * libutil++/tests/utility_tests.cpp: new test files convering most of
+ utility.h and op_exception.h
+
+2003-11-02 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/parse_filename.cpp: avoid repetitive vector::erase(v.begin())
+ * libregex/stl.pat.in:
+ * libregex/tests/mangled-name.in: add (i|o)stream operator(>>|<<)
+
+2003-11-02 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/liblegacy/opd_image.h:
+ * daemon/liblegacy/opd_image.c:
+ * daemon/liblegacy/opd_proc.c:
+ * daemon/liblegacy/opd_sample_files.c: sparse sample file array
+ allocated by line.
+
+2003-11-02 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/glob_filter.h:
+ * libutil++/path_filter.h:
+ * libutil++/string_filter.h: comment fix to match implementation
+ * libutil++/tests/path_filter_tests.cpp: new file test
+ * libutil++/tests/Makefile.am: upate build
+ * libutil++/tests/string_filter_tests.cpp: test white space at start
+ of pattern
+
+2003-11-02 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/string_manip.cpp: format_double can only format percent
+ * libutil++/string_manip.h:
+ * libpp/format_output.cpp:
+ * libutil++/tests/string_manip_tests.cpp:
+ * pp/opannotate.cpp:
+ * pp/opreport.cpp: s/format_double/format_percent/
+
+2003-11-02 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/glob_filter.h:
+ * libutil++/string_filter.h:
+ * libutil++/tests/string_filter_tests.cpp: minor tidy
+
+ * libutil++/tests/glob_filter_tests.cpp: new file
+ * libutil++/tests/Makefile.am: update build
+
+2003-11-01 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/arrange_profiles.cpp: typo
+ * libutil++/generic_spec.cpp: removed file
+ * libutil++/Makefile.am: update according
+ * libutil++/generic_spec.h: ensure generic_spec<string> will not link
+ * libutil++/path_filter.cpp: minor tidy
+
+2003-11-01 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/tests/string_manip_tests.cpp: ehance output on failure
+ * module/oprofile.h:
+ * module/oprofile.c: two new read-only sysctl: nr_buffer_overflow and
+ nr_note_buffer_overflow
+
+2003-11-01 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/tests/Makefile.am:
+ * libutil++/tests/file_manip_tests.cpp: don't use getcwd nor __FILE__
+ but ${topdir} and hard coded filename
+
+2003-11-01 John Levon <levon@movementarian.org>
+
+ * daemon/liblegacy/opd_parse_proc.c: use op_follow_link
+
+ * libutil/op_file.c:
+ * libutil/op_file.h: make op_get_link() static, rename
+ op_basename to op_c_basename
+
+ * libutil++/file_manip.cpp:
+ * libutil++/file_manip.h: rename to op_basename()/op_dirname().
+ Use op_follow_link() for follow_link().
+
+ * libutil++/tests/file_manip_tests.cpp:
+ * gui/oprof_start_util.cpp:
+ * libpp/locate_images.cpp:
+ * libpp/name_storage.cpp:
+ * libutil++/path_filter.cpp:
+ * pp/opannotate.cpp:
+ * pp/opreport.cpp: fixup from above changes
+
+2003-11-01 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/op_bfd.h: has_debug_info() new member
+ * pp/populate.h:
+ * pp/populate.cpp:
+ * pp/opannotate.cpp: use it to error out when --assembly is not
+ requested and no debug information exists
+
+2003-10-31 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/common_option.cpp: don't exit() if merge_by.lib is set through
+ !allow_lib
+
+2003-10-31 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opreport_options.cpp: move handle_merge_option() ...
+ * pp/common_option.h:
+ * pp/common_option.cpp: here
+ * pp/opannotate_options.cpp: use it but disallow --merge=lib
+
+2003-10-31 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil/op_file.c:
+ * libutil/op_file.h: implement dirname(), is_directory() and
+ op_follow_link()
+ * daemon/oprofiled.c: follow symlink for image filter
+ * libutil++/file_manip.cpp:
+ * libutil++/file_manip.h:
+ * gui/oprof_start_util.cpp:
+ * libpp/profile_spec.cpp: rename op_follow_link() to follow_link()
+
+2003-10-31 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil/tests/file_tests.c: "//usr" --> "//usr"
+ * libutil++/tests/.cvsignore:
+ * libutil++/tests/Makefile.am:
+ * libutil++/tests/file_manip_tests.cpp: new tests file.
+
+2003-10-31 John Levon <levon@movementarian.org>
+
+ * daemon/opd_perfmon.c: fix compilation
+
+2003-10-30 John Levon <levon@movementarian.org>
+
+ * libpp/profile_spec.cpp: introduce a helper function
+ to make the comma_list matching clear
+
+2003-10-30 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/comma_list.h: is_set() new member
+ * libpp/profile_spec.cpp: fix matching logic for cpu/tid/tgid
+
+2003-10-30 John Levon <levon@movementarian.org>
+
+ * libutil++/generic_spec.h: add value() and
+ is_set(), remove bool parameter from T value
+ match() (it was never set to true)
+
+ * libutil++/comma_list.h: do not accept
+ generic_spec, the behaviour was to implicitly
+ not match an "all" generic_spec. Instead:
+
+ * libpp/profile_spec.cpp: encode the matching
+ behaviour explicitly, and add a comment.
+
+ * libutil++/tests/comma_list_tests.cpp: fix to
+ match the above
+
+2003-10-30 John Levon <levon@movementarian.org>
+
+ * Makefile.am: re-order build subdirs
+
+ * libabi/Makefile.am: only build abitest on
+ make check
+
+ * pp/Makefile.am: pp_common not pp_commons
+
+2003-10-30 John Levon <levon@movementarian.org>
+
+ * libutil++/tests/Makefile.am:
+ * libutil++/tests/comma_list_tests.cpp: Add.
+
+2003-10-30 John Levon <levon@movementarian.org>
+
+ * doc/Makefile.am: improve chunk rules
+
+2003-10-30 John Levon <levon@movementarian.org>
+
+ * libutil++/tests/Makefile.am:
+ * libutil++/tests/string_filter_tests.cpp: Add.
+
+ * libutil++/tests/string_manip_tests.cpp: fix header include
+
+2003-10-30 John Levon <levon@movementarian.org>
+
+ * libutil++/tests/string_manip_tests.cpp: fix tobool test
+ ("33" is not castable to bool)
+
+2003-10-30 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/string_manip.cpp:
+ * libutil++/string_manip.h: remove tostr()/tobool/touint(), rename
+ lexical_cast_no_ws<> to op_lexical_cast<>
+
+ * gui/oprof_start.cpp:
+ * gui/oprof_start_config.cpp:
+ * libpp/arrange_profiles.cpp:
+ * libpp/filename_spec.cpp:
+ * libpp/op_header.cpp:
+ * libutil++/comma_list.h:
+ * libutil++/generic_spec.h:
+ * libutil++/tests/string_manip_tests.cpp: use op_lexical_cast<>
+
+2003-10-29 John Levon <levon@movementarian.org>
+
+ * pp/common_option.h: use std namespace
+
+2003-10-28 Jason Lunz <lunz@falooley.org>
+
+ * doc/oprofile.1.in: document cpu,tid,tgid in profile
+ spec
+
+2003-10-29 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/profile_spec.cpp: error out for all tag:value specified
+ more than once.
+
+2003-10-29 Philippe Elie <phil.el@wanadoo.fr>
+
+ * doc/opannotate.1.in:
+ * doc/opreport.1.in:
+ * doc/oprofile.xml:
+ * libregex/demangle_symbol.cpp:
+ * libregex/demangle_symbol.h:
+ * pp/common_option.cpp:
+ * pp/common_option.h:
+ * pp/opannotate_options.cpp:
+ * pp/opannotate_options.h:
+ * pp/opreport_options.cpp:
+ * pp/opreport_options.h: remove --no-demangle, --smart-demangle and
+ --demangle, replace them with --demangle=none|smart|normal
+
+2003-10-29 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/tests: new directory
+ * libutil++/tests/string_manip_tests.cpp: new tests file
+ * configure.in:
+ * libutil++/Makefile.am:
+ * libutil++/tests/.cvsignore:
+ * libutil++/tests/Makefile.am: handle new test
+
+ * libutil++/string_manip.h:
+ * libutil++/string_manip.cpp: correct implementation of separate_token
+ to match the documentation
+ * daemon/liblegacy/opd_image.c: fix comment
+
+2003-10-28 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/count_array.cpp:
+ * libpp/count_array.h:
+ * libpp/locate_images.h:
+ * libpp/parse_filename.cpp:
+ * libpp/profile.cpp:
+ * libpp/profile.h:
+ * libpp/profile_spec.cpp:
+ * libpp/symbol_sort.cpp: minor tidy
+
+2003-10-28 Jason Lunz <lunz@falooley.org>
+
+ * doc/opcontrol.1.in: better wording for --separate=
+ * doc/oprofile.1.in: typo
+
+2003-10-28 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/liblegacy/init.c:
+ * daemon/liblegacy/opd_24_stats.c:
+ * daemon/liblegacy/opd_24_stats.h:
+ * daemon/liblegacy/opd_image.c:
+ * daemon/liblegacy/opd_image.h:
+ * daemon/liblegacy/opd_kernel.c:
+ * daemon/liblegacy/opd_kernel.h:
+ * daemon/liblegacy/opd_mapping.c:
+ * daemon/liblegacy/opd_mapping.h:
+ * daemon/liblegacy/opd_parse_proc.c:
+ * daemon/liblegacy/opd_parse_proc.h:
+ * daemon/liblegacy/opd_proc.c:
+ * daemon/liblegacy/opd_proc.h:
+ * daemon/liblegacy/opd_sample_files.c:
+ * daemon/liblegacy/opd_sample_files.h: move doygen comment from *.c to
+ *.h. Add some doxygen comment.
+
+2003-10-27 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/liblegacy/opd_24_stats.c:
+ * daemon/liblegacy/opd_image.h:
+ * daemon/liblegacy/opd_image.h: nr_images static
+
+2003-10-27 John Levon <levon@movementarian.org>
+
+ * doc/opcontrol.1.in: document --image=
+
+ * doc/oprofile.xml:
+ * utils/opcontrol: make user specify "--image=all"
+ to reset. Clean up help message. Ensure note table
+ size is given a value. Add '-t' for '--stop', and
+ '-i' for '--image'.
+
+2003-10-27 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml: document opcontrol --image=
+
+2003-10-27 John Levon <levon@movementarian.org>
+
+ * daemon/opd_events.h:
+ * daemon/opd_events.c: move code for handling
+ event descriptions here, and share find_counter_event(),
+ plus fill_header()
+
+ * daemon/opd_mangling.c:
+ * daemon/opd_perfmon.c:
+ * daemon/oprofiled.c:
+ * daemon/oprofiled.h:
+ * daemon/liblegacy/opd_proc.c:
+ * daemon/liblegacy/opd_sample_files.c: changes from
+ above
+
+2003-10-27 John Levon <levon@movementarian.org>
+
+ * daemon/oprofiled.c: fix help text
+
+ * daemon/liblegacy/init.c:
+ * daemon/liblegacy/opd_proc.h:
+ * daemon/liblegacy/opd_proc.c: clean up headers
+ a bit
+
+2003-10-27 Philippe Elie <phil.el@wanadoo.fr>
+
+ * gui/oprof_start.cpp: check we can get kernel interface
+
+2003-10-27 John Levon <levon@movementarian.org>
+
+ * daemon/liblegacy/Makefile.am: remove unneeded
+ -I for abi
+
+2003-10-27 John Levon <levon@movementarian.org>
+
+ * daemon/init.c:
+ * daemon/opd_perfmon.c: move timer interrupt checks
+ into perfmon
+
+2003-10-27 John Levon <levon@movementarian.org>
+
+ * daemon/oprofiled.c: use op_get_interface()
+
+ * libop/op_get_interface.c: simplify
+
+2003-10-26 Philippe Elie <phil.el@wanadoo.fr>
+
+ * gui/ui/oprof_start.base.ui:
+ * gui/oprof_start.cpp:
+ * gui/oprof_start.h: check separate_lib checkbox when
+ separate_kernel_cb is checked
+
+2003-10-26 Philippe Elie <phil.el@wanadoo.fr>
+
+ * utils/opcontrol: allow to reset --image through empty --image=
+ or --image
+
+2003-10-26 John Levon <levon@movementarian.org>
+
+ * daemon/opd_cookie.c: reduce the hash table size somewhat
+
+ * various: fixes for doxygen
+
+2003-10-26 John Levon <levon@movementarian.org>
+
+ * HACKING:
+ * configure.in:
+ * Makefile.am:
+ * dae/: move all of 2.4 daemon code to ...
+
+ * daemon/liblegacy/: here
+
+ * daemon/Makefile.am:
+ * daemon/opd_util.h:
+ * daemon/opd_util.c: move to ...
+
+ * daemon/oprofiled.h:
+ * daemon/oprofiled.c: here, and call the right operations
+ depending upon oprofile kernel version.
+
+ * daemon/init.c:
+ * daemon/liblegacy/init.c: init and running for each version
+
+2003-10-26 John Levon <levon@movementarian.org>
+
+ * daemon/opd_cookie.c: make sure to create the
+ cookie for the ignore value if it's not found
+
+ * daemon/opd_sfile.c: simplify ignored logic
+
+2003-10-26 John Levon <levon@movementarian.org>
+
+ * doc/internals.xml:
+ * doc/buffers.png: add a diagram
+
+2003-10-26 Philippe Elie <phil.el@wanadoo.fr>
+
+ implement image filtering:
+
+ * dae/opd_image.h: add a field filtered
+ * dae/opd_image.c: set it at image creation
+ * dae/opd_proc.c: don't record sample when !image->filtered
+
+ * daemon/opd_cookie.h: add a field filtered
+ * daemon/opd_cookie.c: set it a cookie_entry creation.
+ * daemon/opd_sfile.h: add a field filtered
+ * daemon/opd_file.c: set it a opd_sfile struct creation
+ * daemon/opd_trans.c: record sample if filtered
+
+ * daemon/opd_util.h: export opd_hash_name(), is_image_filtered()
+ * daemon/opd_util.c: implement --image=xxx
+
+ * oprofiled.c: #include "config.h" not <>
+
+ * utils/opcontrol: handle --image
+
+2003-10-26 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml: remove some outdated stuff
+
+2003-10-25 John Levon <levon@movementarian.org>
+
+ * doc/internals.xml: more docs
+
+2003-10-25 John Levon <levon@movementarian.org>
+
+ * daemon/opd_perfmon.c: cleanups
+
+2003-10-24 John Levon <levon@movementarian.org>
+
+ * doc/internals.xml: write some more
+
+2003-10-23 John Levon <levon@movementarian.org>
+
+ * configure.in: bump to 0.7.1cvs
+
+2003-10-22 John Levon <levon@movementarian.org>
+
+ * libop/tests/Makefile.am:
+ * libop/tests/load_events_files_tests.c:
+ * libop/tests/alloc_counter_tests.c: fix
+ make distcheck
+
+ * configure.in: bump to 0.7
+
+2003-10-22 John Levon <levon@movementarian.org>
+
+ * daemon/Makefile.am:
+ * daemon/opd_perfmon.h:
+ * daemon/opd_perfmon.c: re-enable. Wait for children.
+ More safety checking.
+
+ * daemon/oprofiled.c: only use perfmon if !timer
+
+2003-10-20 Philippe Elie <phil.el@wanadoo.fr>
+
+ * doc/oprofile.xml:
+ * doc/oprofile.1.in: s/physical CPU/CPU/
+
+2003-10-20 John Levon <levon@movementarian.org>
+
+ * daemon/Makefile.am:
+ * daemon/opd_perfmon.h: disable perfmon nicely
+
+ * gui/oprof_start.cpp:
+ * gui/oprof_start_config.h:
+ * gui/oprof_start_config.cpp:
+ * gui/ui/oprof_start.base.ui: Fix reading of separate
+ parameters. Add CPU and thread separation
+
+2003-10-20 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/profile_spec.cpp: relative path are relative to current dir
+ not filename.
+
+2003-10-20 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml:
+ * doc/opreport.1.in: fix --merge docs and profile specs
+
+2003-10-20 John Levon <levon@movementarian.org>
+
+ * dae/opd_sample_files.c:
+ * daemon/opd_mangling.c:
+ * libabi/abi.cpp:
+ * libabi/abi_test.cpp:
+ * libabi/op_import.cpp:
+ * libop/op_config.h:
+ * libop/op_sample_file.h:
+ * libpp/op_header.cpp: remove ctr and separate_* from
+ header. Re-arrange it a little, and make it 64 bytes
+ on ILP32. Bump the version.
+
+2003-10-20 John Levon <levon@movementarian.org>
+
+ * libpp/arrange_profiles.cpp: rework the clashing-axes
+ error message to be nicer to the user
+
+2003-10-20 John Levon <levon@movementarian.org>
+
+ * libpp/arrange_profiles.cpp: if tid == tgid for
+ every profile class, allow axes of both TID and TGID
+ - there is no actual difference, only theoretical
+
+2003-10-20 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/oprofiled.c: correct an error message
+ * libop/op_alloc_counter.h: remove bogus FIXME
+ * libutil++/child_reader.cpp: avoid quadratic behaviour if child does a
+ lot of output in stderr
+ * libpp/opgprof.cpp: fix comment
+
+2003-10-19 Philippe Elie <phil.el@wanadoo.fr>
+
+ * gui/oprof_start.cpp: redundant return
+
+2003-10-19 John Levon <levon@movementarian.org>
+
+ * libop/op_events.c: move to a fixed value for the default
+ event count value
+
+2003-10-19 Philippe Elie <phil.el@wanadoo.fr>
+
+ remove some FIXME:
+ * libpp/format_output.h: remove first_output bool member
+ * libpp/format_output.cpp: call output_header from the right place
+ * libpp/op_header.h: remove bogus FIXME
+
+ * libregex/tests/Makefile.am: fix dependencies on mangled-name file,
+ fix make dist
+ * libregex/tests/mangled-name.in: simplify a bit and remove a bogus
+ FIXME
+ * libregex/tests/regex_test.cpp: fix comment
+
+ * module/ia64/op_syscalls.c:
+ * module/x86/hammer_op_syscalls.c:
+ * module/x86/op_syscalls.c: remove some FIXME
+
+2003-10-17 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/arrange_profiles.cpp: clarify suggestion.
+ * pp/opreport_options.cpp: update options help string for --merge.
+
+ * libpp/profile_container.cpp:
+ * libpp/profile_spec.cpp:
+ * pp/common_option.cpp:
+ * pp/populate.cpp: ';' are not necessary to end namespace
+
+2003-10-17 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/arrange_profiles.cpp: use a set<profile_classes> instead
+ of a vector<...> to replace a O(N*M) by a O(N*log(M)) behavior.
+ (N number of samples files, M number of class).
+
+2003-10-17 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/op_bfd.cpp: show filename when warning about no debug
+ information available. get_linenr(): s/filename/source_filename/
+
+2003-10-16 Philippe Elie <phil.el@wanadoo.fr>
+
+ * events/ia64/itanium/events: counter 0,1 not 2,3 for IA64_INST_RETIRED
+
+ * daemon/opd_util.c: opd_parse_events() fix use after free.
+
+2003-10-16 John Levon <levon@movementarian.org>
+
+ * daemon/opd_perfmon.c: disable the code
+
+2003-10-15 John Levon <levon@movementarian.org>
+
+ * daemon/opd_perfmon.c: fflushes to improve
+ order of debug log
+
+2003-10-15 John Levon <levon@movementarian.org>
+
+ * daemon/opd_perfmon.c: fix dumb allocation typo;
+ handle signals correctly; wait for children to
+ come up before returning
+
+2003-10-15 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/opd_sample_files.c:
+ * daemon/opd_mangling.c:
+ * daemon/opd_perfmon.c:
+ * daemon/opd_util.c: check we not overflow op_nr_counters
+
+2003-10-15 Philippe Elie <phil.el@wanadoo.fr>
+
+ * events/ia64/itanium/events: correct counter available according
+ to intel doc.
+
+2003-10-15 John Levon <levon@movementarian.org>
+
+ * dae/opd_image.c:
+ * dae/opd_kernel.c:
+ * dae/opd_proc.c:
+ * dae/opd_sample_files.c:
+ * dae/oprofiled.c:
+ * daemon/opd_kernel.c:
+ * daemon/opd_mangling.c:
+ * daemon/opd_sfile.c:
+ * daemon/opd_trans.c:
+ * daemon/opd_util.c:
+ * daemon/opd_util.h:
+ * daemon/oprofiled.c: merge the options handling
+ for dae and daemon
+
+2003-10-15 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/opd_perfmon.c:
+ * module/ia64/op_pmu.c: bit mask for event select field is 8 bits not 7
+
+2003-10-14 John Levon <levon@movementarian.org>
+
+ * configure.in:
+ * m4/findkernel.m4:
+ * utils/opcontrol: 2.5 refs -> 2.6
+
+2003-10-14 John Levon <levon@movementarian.org>
+
+ * utils/opcontrol: merge some 2.4/6 code
+
+2003-10-14 John Levon <levon@movementarian.org>
+
+ * dae/opd_image.c:
+ * dae/opd_sample_files.c:
+ * dae/oprofiled.c:
+ * utils/opcontrol: use --events for 2.4 daemon
+ too
+
+ * daemon/opd_perfmon.c:
+ * daemon/opd_mangling.c: fix counter numbering
+ on !perfmon
+
+2003-10-14 John Levon <levon@movementarian.org>
+
+ * configure.in: xmemdup not xmemdump
+
+2003-10-14 John Levon <levon@movementarian.org>
+
+ * daemon/opd_perfmon.c: propagate a SIGTERM
+ up to the parent.
+
+2003-10-14 John Levon <levon@movementarian.org>
+
+ * m4/perfmon.m4:
+ * configure.in: remove pfmlib checks
+
+ * daemon/opd_util.h:
+ * daemon/opd_util.c:
+ * daemon/opd_mangling.c:
+ * daemon/oprofiled.c: parse more detailed events
+ passed on command line
+
+ * daemon/opd_perfmon.h:
+ * daemon/opd_perfmon.c: don't use libpfm at all,
+ do it ourselves.
+
+ * utils/opcontrol: pass more of the events info to
+ the daemon
+
+2003-10-14 John Levon <levon@movementarian.org>
+
+ * m4/perfmon.m4:
+ * configure.in: look for pfmlib 3
+
+ * daemon/Makefile.am:
+ * daemon/opd_perfmon.h:
+ * daemon/opd_perfmon.c: interface to perfmon on 2.6 IA64
+
+ * daemon/opd_mangling.c:
+ * daemon/oprofiled.c: read event descriptions from command
+ line not oprofilefs
+
+ * daemon/opd_util.h:
+ * daemon/opd_util.c: receive SIGUSR1/2 for perfmon
+
+ * utils/opcontrol: handle multiple oprofileds. Send SIGUSR1/2
+ on start/stop. Pass in events list to oprofiled on 2.6. Don't
+ attempt to fill in oprofilefs with event info if using perfmon.
+
+2003-10-14 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/opd_mangling.c:
+ * daemon/opd_sfile.c:
+ * daemon/opd_sfile.h: protect the sfile we are acting on to be freed
+ by sfile_lru_clear()
+
+ * libdb/db_manage.c:
+ * libdb/odb_hash.h: Do not put hash->descr in an inconsistent state
+ when a failure occur.
+
+2003-10-13 Philippe Elie <phil.el@wanadoo.fr>
+
+ * module/oprofile.c: don't restore syscall and stop counter twice
+
+2003-10-13 Will Cohen <wcohen@redhat.com>
+
+ * libop/op_parse_event.c(parse_events): Correct fprintf.
+
+2003-10-13 Philippe Elie <phil.el@wanadoo.fr>
+
+ * module/x86/hammer_op_syscalls.c: pass tgid to daemon. Not tested!
+
+2003-10-12 John Levon <levon@movementarian.org>
+
+ * utils/opcontrol: share --separate-cpu/thread code now
+
+2003-10-12 Philippe Elie <phil.el@wanadoo.fr>
+
+ * configure.in: add libregex/tests/mangled-name.in
+ * libregex/tests/mangled-name.txt: move ...
+ * libregex/tests/mangled-name.in: here, tune to support different arch
+ * libregex/tests/Makefile.am: s/mangled-name.txt/mangled-name.in
+ * libregex/stl.pat.in: fix iterator<... ptrdiff_t>
+ * libregex/tests/Makefile.am: update according to filename change
+
+ * libregex/tests/regex_test.cpp: really fails on exception.
+
+2003-10-12 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/oprofiled.c: don't set cpu_number when !--separate=cpu
+
+ * libop/tests/alloc_counter_tests.c: printf format for 64 bits arch
+ * libop/tests/cpu_type_tests.c: #include <string.h>
+ * libop/tests/parse_event_tests.c: #include <string.h>
+
+2003-10-11 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libop/op_interface.h: struct op_sample: remove packed attribute
+
+2003-10-11 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/opd_image.c:
+ * dae/opd_image.h: reference count opd_image. Remove modification time
+ checking. Remove hash field. Tidy
+ * dae/opd_kernel.c: pass tid, tgid to op_get_kernel_image()
+ * dae/opd_mapping.c:
+ * dae/opd_mapping.h: use module hash code for image name to index
+ a cache of name, this hash code is no longer used elsewhere. When
+ killing map delete associated image, reference count of image
+ will check for a real delete.
+ * dae/opd_parse_proc.c: get tgid from /proc/pid/status
+ * dae/opd_proc.c: create an opd_proc by process when
+ separate_thread == true. Tidy by adding an opd_for_each_proc()
+ * dae/opd_proc.h: add tid/tgid to opd_proc struct
+ * dae/opd_sample_files.c:
+ * dae/opd_sample_files.h: lru all samples files, allowing to cleanup
+ a part of the lru if we go out of resource. Remove
+ opd_handle_old_sample_files() since we no longer check for image
+ modification time.
+ * dae/opd_stats.c:
+ * dae/opd_stats.h: statistics for opd_image struct depth search
+ * dae/oprofiled.c: add --separate-cpu and --separate-thread
+ * libop/op_interface.h: add tgid to samples struct passed from module
+ to daemon.
+ * module/compat22.h:
+ * module/compat24.h: op_get_tgid() return tgid, fall back to return
+ tid on 2.2 kernel.
+ * module/oprofile.c:
+ * module/ia64/op_syscalls.c: pass tgid to daemon. NOT TESTED but I
+ think it's ok. Note than even if it's broken ia64 should work w/o
+ --separate=thread
+ * module/x86/op_syscalls.c: pass tgid to daemon.
+ * utils/opcontrol: enable 2.4 thread/cpu separation
+
+ * libdb/tests/db_test.c: verbose on when we provide filename of db file
+ to test on command line.
+
+2003-10-11 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libop/op_cpu_type.h:
+ * libop/op_cpu_type.c: constification
+ * utils/op_help.c: check only if CPU_NO_GOOD not range
+
+ * libutil/tests/Makefile.am:
+ * libregex/tests/Makefile.am:
+ * libdb/tests/Makefile.am: s/TEST = (.*)/TESTS = ${check_PROGRAMS}/
+
+ * libop/tests/alloc_counter_tests.c: comment fix
+
+ * libop/tests/Makefile.am:
+ * libop/tests/cpu_type_tests.c: new file, test libop/op_cpu_type.c
+
+2003-10-10 Will Cohen <wcohen@redhat.com>
+
+ * libop/op_cpu_type.h (op_get_cpu_number): Clarify comment.
+ * libop/op_cpu_type.c (op_get_cpu_number): Check number.
+ * utils/op_help.c (main): Make check with CPU_NO_GOOD.
+
+2003-10-10 Will Cohen <wcohen@redhat.com>
+
+ * libop/op_cpu_type.h (op_get_cpu_number): Declare.
+ * libop/op_cpu_type.c (op_get_cpu_number): New.
+ (op_get_cpu_type): Use op_get_cpu_number.
+ * utils/op_help.c (main): Use op_get_cpu_number.
+
+2003-10-10 John Levon <levon@movementarian.org>
+
+ * libop/op_parse_event.c: fix compile for IA64
+
+2003-10-09 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml: document "no results" and
+ how to fix it
+
+2003-10-08 John Levon <levon@movementarian.org>
+
+ * utils/op_help.c: standardise name
+
+ * gui/oprof_start.cpp: Qt 2.3.1 compile fix
+ (bug 819943)
+
+2003-10-07 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/opd_kernel.c: memory leak
+
+ * dae/opd_mapping.c:
+ * dae/opd_mapping.h:
+ * dae/opd_parse_proc.c:
+ * dae/opd_proc.c:
+ * dae/opd_proc.h: use a list of struct opd_map instead of an array,
+ remove last_map optimization.
+
+ * dae/oprofiled.c: memory leak
+
+ * libutil/op_cpufreq.c: memory leak, FILE* leak
+ * libutil/op_list.h: fix @author
+
+2003-10-06 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/oprofiled.c:
+ * dae/opd_proc.h:
+ * dae/opd_proc.c: use struct list_head to chain opd_proc struct in hash
+ table
+
+ * utils/op_help.c: comment fix
+
+2003-10-06 John Levon <levon@movementarian.org>
+
+ * utils/opcontrol: work around 2.6 daemon's signal
+ handling race that could cause it to hang during
+ a --shutdown
+
+2003-10-05 Philippe Elie <phil.el@wanadoo.fr>
+
+ * events/i386/p4/events:
+ * events/i386/p4-ht/events: put GLOBAL_POWER_EVENTS on top
+
+ * events/i386/pii/unit_masks:
+ * events/i386/piii/unit_masks: typo in help string
+
+ * utils/op_help.c: show "counter: all" instead an enumeration of all
+ counter
+
+2003-10-02 Philippe Elie <phil.el@wanadoo.fr>
+
+ * events/*.events *.unit_masks: move these files to subdir named
+ arch/processor_name/events and arch/processor_name/unit_masks
+ * events/Makefile.am: update according
+
+ * libop/op_events.c: now it's safe to allow loading events file from a
+ directory provided through environment var OPROFILE_EVENTS_FILE_DIR
+ * libop/tests/alloc_counter_tests.c: use it
+ * libop/tests/load_events_files_tests.c: use it
+
+2003-10-02 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libop/op_events.c: revert last commit (allowed to find events files
+ description directory in alternate directory)
+
+ * libop/tests/Makefile.am:
+ * libop/tests/load_events_files_tests.c: new files. Validate events
+ description file by loading them.
+
+ * libutil/op_cpufreq.c: comment why we don't have any code handling
+ s390
+
+2003-10-01 Philippe Elie <phil.el@wanadoo.fr>
+
+ * configure.in:
+ * libop/Makefile.am: new subdir
+ * libop/op_events.c: allow to retrieve events file dir through
+ environment variable
+ * utils/op_help.c: move parse_events() and parsed_event struct to ...
+ * libop/op_parse_event.h:
+ * libop/op_parse_event.c: these new files
+
+ * libop/tests/Makefile.am: new tests subdir
+ * libop/tests/alloc_counter_tests.c: events mapping to counter nr tests
+ * libop/tests/parse_event_tests.c: event parsing tests
+
+2003-10-01 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libop/op_alloc_counter.c: add forward declaration
+ * libop/op_alloc_counter.c: alloc counter in increasing number order,
+ it's less surprising.
+
+2003-10-01 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libdb/tests/db_test.c: if previous tests fails a corrupted samples
+ file can exist in test dir and will be re-used, remove() it.
+
+2003-10-01 John Levon <levon@movementarian.org>
+
+ * daemon/opd_sfile.c:
+ * libabi/op_import.cpp:
+ * libop/op_interface.h:
+ * libpp/locate_images.h: small cleanups
+
+ * pp/opreport_options.cpp: don't complain about
+ "-x -m all"
+
+2003-09-28 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil/op_file.c:
+ * libutil/tests/file_tests.c: honor posix "//" filename namespace
+
+2003-09-28 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libop/op_alloc_counter.h:
+ * libop/op_alloc_counter.c: change allocator by a backtracking
+ algorithm walking only through possible solution.
+
+2003-09-26 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libdb/tests/db_test.c: success must be silent
+ * dae/oprofiled.c:
+ * daemon/oprofiled.c:
+ * libutil/op_deviceio.c:
+ * libutil/op_deviceio.h: op_open_device(): remove unused parameter
+ fatal
+
+2003-09-26 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil/tests/file_tests.c: Fix some test: in some case the pathname
+ component must be valid since we lstat() them. Fix a segfault due
+ to missing ','
+
+2003-09-26 John Levon <levon@movementarian.org>
+
+ * libdb/tests/Makefile.am:
+ * libregex/tests/Makefile.am:
+ * libutil/tests/Makefile.am: don't build tests
+ unless "make check"
+
+2003-09-26 John Levon <levon@movementarian.org>
+
+ * libutil/op_file.c: don't test for NULL path
+ passed in, we want to crash here instead of
+ in xstrdup
+
+ * configure.in:
+ * libutil/Makefile.am:
+ * libutil/tests/Makefile.am:
+ * libutil/tests/file_tests.c:
+ * libutil/tests/string_tests.c: add some unit tests
+ for libutil string and path handling
+
+2003-09-26 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libdb/db_debug.c: remove useless display interface
+ * libdb/db_db_travel.c: remove callback interface
+ * libdb/odb_hash.h: remove display/callback interface
+ * libdb/db_test.cpp: move to tests subdir
+ * libdb/Makefile.am: update according
+ * libdb/tests: new dir
+ * libdb/tests/.cvsignore:
+ * libdb/tests/Makefile.am: new files
+ * libdb/tests/db_test.cpp: shorter tests
+
+ * libregex/mangled-name.txt:
+ * libregex/regex_testc.cpp: move to ...
+ * libregex/tests: new directory
+ * libdb/Makefile.am: update according
+ * libregex/tests/.cvsignore:
+ * libregex/tests/Makefile.am: new files
+
+2003-09-26 John Levon <levon@movementarian.org>
+
+ * libabi/abi_test.cpp:
+ * libabi/op_import.cpp: small cleanups
+
+2003-09-25 John Levon <levon@movementarian.org>
+
+ * daemon/opd_cookie.c:
+ * daemon/opd_kernel.c:
+ * daemon/opd_sfile.c:
+ * daemon/opd_trans.c:
+ * daemon/oprofiled.c: trivial cleanups
+
+2003-09-25 Marc Herbert <marc.herbert@ens-lyon.fr>
+
+ * configure.in: fix prefix stuff to allow stow
+ to work
+
+2003-09-25 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pch-c++.h: remove
+ * Makefile.am: update according
+ * configure.in: no longer need for conditional enable_pch
+ * m4/precompiledheader.m4: don't use -Winvalid-pch
+
+2003-09-25 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/opd_sfile.c: sfile_lru_clear() return 0 if lru is empty
+ * daemon/opd_mangling.c: abort() if lru was empty (not tested)
+ * daemon/oprofiled.c: likewise; opd_alarm(): don't sfile_lru_clear()
+
+ * utils/op_help.c:
+ * daemon/opd_sfile.h:
+ * daemon/opd_cookie.h: s/()/(void)/ in some function prototype and
+ definition
+
+ * daemon/opd_cookie.c: s/"not looked up"/"not hashed"/
+
+2003-09-25 John Levon <levon@movementarian.org>
+
+ * daemon/oprofiled.c: push rlimit down back to 2048.
+ This gives a running RSS of about 10Mb when thread
+ profiling on my box, which seems reasonable (at 8192
+ it was hitting 40Mb)
+
+2003-09-25 Philippe Elie <phil.el@wanadoo.fr>
+
+ * doc/oprofile.xml: clarify what means a configured kernel.
+
+2003-09-25 John Levon <levon@movementarian.org>
+
+ * daemon/opd_sfile.c: bump LRU_AMOUNT to 1000
+
+2003-09-24 John Levon <levon@movementarian.org>
+
+ * doc/opcontrol.1.in:
+ * doc/oprofile.xml: document thread and cpu
+ profiling a bit
+
+ * daemon/opd_mangling.c:
+ * daemon/opd_sfile.c:
+ * daemon/oprofiled.c:
+ * utils/opcontrol: implement per-CPU profiling,
+ not tested yet
+
+2003-09-24 John Levon <levon@movementarian.org>
+
+ * dae/opd_proc.c:
+ * dae/opd_sample_files.c:
+ * daemon/opd_mangling.c:
+ * daemon/opd_sfile.c:
+ * libabi/abi_test.cpp:
+ * libabi/op_import.cpp:
+ * libdb/db_insert.c:
+ * libdb/db_manage.c:
+ * libdb/db_test.c:
+ * libdb/odb_hash.h:
+ * libpp/op_header.cpp:
+ * libpp/profile.cpp: remove samples_odb_t.err_msg
+ entirely - prefer UNIX-style errno returns. Modify
+ error messages to match
+
+2003-09-24 John Levon <levon@movementarian.org>
+
+ * dae/opd_sample_files.c:
+ * daemon/opd_sample_files.c:
+ * libpp/op_header.cpp:
+ * libpp/profile.cpp:
+ * libabi/abi_test.cpp:
+ * libabi/op_import.cpp:
+ * libdb/db_test.c:
+ * libdb/odb_hash.h:
+ * libdb/odb_manage.c: make odb_open return errno
+ instead of EXIT_FAILURE/SUCCESS to allow EMFILE
+ handling. Also do not leak fd's on failure.
+
+ * libutil/op_types.h: cookie_t moved into daemon/
+
+ * daemon/: major rewrite: move to a hash on all
+ parameters of struct transient. Lots of readability
+ cleanups, plus resistance to cookie lookup failures,
+ and hitting open file limits. Additionally thread
+ profiling for kernel threads is enabled now.
+
+2003-09-24 John Levon <levon@movementarian.org>
+
+ * daemon/opd_image.c: remove support for missing
+ CTX_TGID
+
+2003-09-24 John Levon <levon@movementarian.org>
+
+ * daemon/oprofiled.c: remove /proc/kcore support
+
+2003-09-22 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/opd_parse_proc.c: both op_file.h and op_fileio.h are needed
+
+2003-09-22 John Levon <levon@movementarian.org>
+
+ * doc/CodingStyle: document doxygen placing rule
+
+ * libop/op_alloc_counter.h:
+ * libop/op_get_interface.c:
+ * libutil++/file_manip.cpp:
+ * libutil++/file_manip.h:
+ * libutil++/op_bfd.cpp:
+ * libutil++/op_bfd.h:
+ * libutil/op_deviceio.c:
+ * libutil/op_deviceio.h:
+ * libutil/op_get_time.c:
+ * libutil/op_get_time.h:
+ * libutil/op_libiberty.c:
+ * libutil/op_libiberty.h:
+ * libutil/op_lockfile.c:
+ * libutil/op_lockfile.h:
+ * libutil/op_popt.c:
+ * libutil/op_popt.h: follow the above
+
+ * libutil/op_file.c:
+ * libutil/op_file.h:
+ * libutil/op_fileio.c:
+ * libutil/op_fileio.h:
+ * dae/opd_parse_proc.c:
+ * libutil++/string_manip.cpp: move op_get_link to
+ op_file
+
+2003-09-22 John Levon <levon@movementarian.org>
+
+ * libutil/op_fileio.h:
+ * libutil/op_fileio.c: warn about op_get_link()
+ restrictions
+
+ * libutil++/file_manip.h:
+ * libutil++/file_manip.cpp: s/op_read_link/op_follow_link,
+ and behaviour change to match
+
+ * libpp/profile_spec.cpp:
+ * gui/oprof_start_util.cpp: use op_follow_link
+
+2003-09-22 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/makefile.am: missing AM_CFLAGS setting
+
+ * dae/oprofiled.c:
+ * daemon/oprofiled.c: handle signal in read loop
+ * daemon/opd_util.h:
+ * daemon/opd_util.c: move opd_setup_signal() from dae/ daemon/
+
+2003-09-22 John Levon <levon@movementarian.org>
+
+ * dae/oprofiled.c:
+ * daemon/oprofiled.c: mask SIGTERM too to prevent
+ the possibility of empty sample files
+
+2003-09-21 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/format_output.h:
+ * libpp/format_output.cpp:
+ * pp/opreport.cpp: format_output::show_header no hide_header
+
+2003-09-21 Philippe Elie <phil.el@wanadoo.fr>
+
+ * doc/opreport.1.in:
+ * doc/oprofile.xml:
+ * libpp/format_output.h:
+ * libpp/format_output.cpp:
+ * pp/opreport.cpp: --global_percent must be effective for detailed
+ output too
+
+2003-09-21 John Levon <levon@movementarian.org>
+
+ * pp/opreport_options.cpp: prevent --global-percent
+ when appropriate
+
+2003-09-21 John Levon <levon@movementarian.org>
+
+ * Makefile.am: back out broken make clean change
+
+2003-09-21 John Levon <levon@movementarian.org>
+
+ * Makefile.am: make clean now removes *.html
+
+ * internals.xml: add some outline sections
+
+2003-09-21 John Levon <levon@movementarian.org>
+
+ * doc/internals.xml: provide a short overview
+ and start a glossary
+
+ * libpp/count_array.h:
+ * libpp/format_output.cpp:
+ * libpp/format_output.h:
+ * libpp/profile.cpp:
+ * libpp/profile.h:
+ * libpp/profile_container.cpp:
+ * libpp/profile_container.h:
+ * pp/opreport.cpp: replace residual references to
+ count groups with profile class concept
+
+2003-09-21 John Levon <levon@movementarian.org>
+
+ * doc/Makefile.am:
+ * doc/internals.xml: start an internals manual ...
+
+2003-09-19 John Levon <levon@movementarian.org>
+
+ * pp/image_errors.cpp: missing include
+
+2003-09-19 John Levon <levon@movementarian.org>
+
+ * libopt++/popt_options.h:
+ * libopt++/popt_options.cpp: remove additional_help
+ stuff, unused for some time
+
+2003-09-18 John Levon <levon@movementarian.org>
+
+ * libutil++/Makefile.am:
+ * libutil++/image_flags.h: move to ...
+
+ * libpp/Makefile.am:
+ * libpp/image_error.h: ... here, and rename
+
+ * libutil++/op_bfd.h:
+ * libutil++/op_bfd.cpp: take an in-out bool
+ instead of image_flags
+
+ * libpp/arrange_profiles.cpp:
+ * libpp/arrange_profiles.h:
+ * libpp/locate_images.cpp:
+ * libpp/locate_images.h:
+ * libpp/profile_spec.cpp:
+ * pp/image_errors.cpp:
+ * pp/opgprof.cpp:
+ * pp/populate.cpp: changes from above
+
+2003-09-18 John Levon <levon@movementarian.org>
+
+ * libutil++/Makefile.am:
+ * libutil++/image_flags.h: flags for image read failure
+
+ * libpp/profile_spec.cpp:
+ * libpp/locate_images.h:
+ * libpp/locate_images.cpp:
+ * libpp/arrange_profiles.h:
+ * libpp/arrange_profiles.cpp: use image_flags
+
+ * libutil++/op_bfd.h:
+ * libutil++/op_bfd.cpp: use image_flags, no longer error
+ out on format failure
+
+ * pp/Makefile.am:
+ * pp/image_errors.cpp:
+ * pp/image_errors.h: errors previously reported in locate_images
+ are now reported here by the client
+
+ * pp/opannotate.cpp:
+ * pp/opgprof.cpp:
+ * pp/opgprof_options.cpp:
+ * pp/opreport.cpp:
+ * pp/populate.h:
+ * pp/populate.cpp: use the above
+
+2003-09-18 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/format_output.cpp: use 9 not 12 for % field width
+ * libutil++/string_manip.cpp: shrink 100.0000 to 100.000
+ * pp/opreport.cpp: s/" "/' '
+
+2003-09-18 John Levon <levon@movementarian.org>
+
+ * pp/opannotate_options.cpp:
+ * pp/opreport_options.cpp: clean up error messages
+
+ * pp/opgprof_options.h:
+ * pp/opgprof_options.cpp:
+ * pp/opgprof.cpp: use inverted_profile API
+
+2003-09-18 Philippe Elie <phil.el@wanadoo.fr>
+
+ * utils/opcontrol: overwrite all current settings with --separate,
+ this change behavior of --separate=kernel,library now we really setup
+ both in this case.
+
+2003-09-18 John Levon <levon@movementarian.org>
+
+ * libpp/locate_images.cpp: rewrite a little
+
+ * libutil++/op_bfd.cpp: set fsize to default to -1,
+ for fake artificial symbol
+
+2003-09-18 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/locate_images.h:
+ * libpp/locate_images.cpp: find_module_path() extra bool parameter
+ to know if we fail to retrieve the image.
+ * libpp/arrange_profiles.h:
+ * libpp/arrange_profiles.cpp: use it and save this bool in
+ inverted_profile struct
+ * libpp/profile_spec.cpp: update caller according
+
+ * libutil++/op_bfd.h:
+ * libutil++/op_bfd.cpp: use the above change to create fake op_bfd
+
+ * pp/opgprof_options.cpp:
+ * pp/opgprof.cpp: update caller but never allow fake op_bfd
+
+ * pp/populate.cpp: allow to create fake op_bfd
+
+
+2003-09-18 John Levon <levon@movementarian.org>
+
+ * dae/opd_image.c:
+ * dae/opd_proc.c:
+ * dae/opd_sample_files.c:
+ * dae/oprofiled.c:
+ * daemon/opd_image.c:
+ * daemon/opd_image.h:
+ * daemon/opd_kernel.c:
+ * daemon/opd_sample_files.c:
+ * daemon/oprofiled.c:
+ * gui/oprof_start.cpp:
+ * gui/oprof_start_config.cpp:
+ * gui/oprof_start_config.h:
+ * gui/ui/oprof_start.base.ui:
+ * libabi/abi.cpp:
+ * libabi/abi_test.cpp:
+ * libabi/op_import.cpp:
+ * libop/op_sample_file.h:
+ * libpp/op_header.cpp:
+ * utils/opcontrol: renamings of separate stuff
+
+2003-09-17 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/opd_kernel.c: thinko in opd_get_module_info(): we must take
+ care to re-use a previously created module not to create a new
+
+2003-09-17 John Levon <levon@movementarian.org>
+
+ * daemon/opd_kernel.c: logging improvements
+
+2003-09-17 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/opd_kernel.c:
+ * daemon/opd_kernel.c: fix use after free of module
+
+2003-09-17 John Levon <levon@movementarian.org>
+
+ * daemon/opd_image.c: fix thread profiling when
+ --separate-library=0
+
+2003-09-17 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/opd_kernel.c: add module to list of module ...
+ * daemon/opd_kernel.c: s/print/verbprintf
+
+2003-09-17 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libop/op_config.h: remove OPD_MAX_MODULEs
+ * dae/opd_kernel.c:
+ * daemon/opd_kernel.c: remove fixed array of modules replaced by
+ a list. Unify the way we create opd_module
+ * utils/opcontrol: don't use --thread-profiling for 2.4
+
+2003-09-17 Ka Fai Lu <kafai0928@yahoo.com>
+
+ I adapted slightly this patch Phil.
+ * daemon/opd_image.c:
+ * daemon/opd_image.h:
+ * daemon/opd_kernel.c:
+ * daemon/opd_sample_files.c:
+ * daemon/oprofiled.c:
+ * utils/opcontrol: implement per thread profiling
+
+2003-09-16 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libopt++/popt_options.h:
+ * libpp/locate_images.cpp: minor tidy
+
+2003-09-16 John Levon <levon@movementarian.org>
+
+ * utils/opcontrol: don't pass pid/pgrp filter
+ to 2.6 daemon
+
+ * dae/oprofiled.c:
+ * daemon/oprofiled.c: setrlimit to 8192 (lame
+ workaround for now), minor cleanups
+
+2003-09-15 John Levon <levon@movementarian.org>
+
+ * common_option.cpp: rename the array to
+ avoid a link error in GCC 3.4
+
+2003-09-15 John Levon <levon@movementarian.org>
+
+ * libop/Makefile.am:
+ * libop/op_interface_25.h: move to ...
+
+ * daemon/Makefile.am:
+ * daemon/opd_interface.h: ... here
+
+ * daemon/opd_image.c:
+ * daemon/oprofiled.c: use above. Remove pointless
+ command line options.
+
+ * libop/op_config_25.h: remove.
+
+ * libop/op_hw_config.h: move DCOOKIE_SHIFT to
+ opd_interface.h
+
+2003-09-15 John Levon <levon@movementarian.org>
+
+ * configure.in: use -Wdeclaration-after-statement
+ if available
+
+ * README:
+ * daemon/opd_util.c:
+ * daemon/opd_util.h:
+ * doc/opannotate.1.in:
+ * doc/opgprof.1.in:
+ * doc/opreport.1.in:
+ * doc/oprofile.1.in:
+ * doc/oprofile.xml:
+ * gui/oprof_start.cpp:
+ * gui/oprof_start_util.cpp:
+ * libop/op_cpu_type.c:
+ * libop/op_cpu_type.h:
+ * libop/op_get_interface.c:
+ * libpp/locate_images.cpp: remove references to
+ 2.5, replaced with 2.6
+
+2003-09-15 John Levon <levon@movementarian.org>
+
+ * doc/opreport.1.in: document --show-address
+
+2003-09-15 John Levon <levon@movementarian.org>
+
+ * libpp/arrange_profiles.cpp:
+ * libpp/arrange_profiles.h:
+ * pp/populate.cpp: more commentary
+
+2003-09-14 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opreport.cpp: handle 2.95 right io manipulator and the lack
+ of a proper setw(w) << std::string
+
+2003-09-14 John Levon <levon@movementarian.org>
+
+ * pp/opreport.cpp: re-add header for image summary
+
+2003-09-14 John Levon <levon@movementarian.org>
+
+ * libpp/arrange_profiles.cpp: throw an exception
+ if there are two many unmerged profiles, with details
+ of how to fix it
+
+ * pp/opgprof_options.cpp:
+ * pp/common_option.cpp: clean up error messages
+
+2003-09-14 John Levon <levon@movementarian.org>
+
+ * libpp/arrange_profiles.h:
+ * libpp/arrange_profiles.cpp: add location of
+ images when inverting profiles
+
+ * libpp/locate_images.cpp: return empty string
+ if file isn't readable
+
+ * pp/opannotate.cpp: use the above
+
+ * pp/opreport.cpp: use the above; place warnings
+ before any other output
+
+2003-09-14 John Levon <levon@movementarian.org>
+
+ * pp/opgprof_options.cpp: use locate_image_path
+
+2003-09-14 John Levon <levon@movementarian.org>
+
+ * Makefile.am:
+ * populate.h:
+ * populate.cpp: shared code for populating from
+ inverted profiles
+
+ * opreport.cpp:
+ * opannotate.cpp: use above
+
+2003-09-14 John Levon <levon@movementarian.org>
+
+ * libpp/arrange_profiles.h:
+ * libpp/arrange_profiles.cpp: add invert_profiles
+
+ * pp/opreport.cpp: use it
+
+2003-09-14 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml:
+ * pp/opreport.cpp:
+ * pp/opreport_options.cpp:
+ * pp/opreport_options.h: Turn off VMA report by
+ default, add --show-address
+
+2003-09-14 John Levon <levon@movementarian.org>
+
+ * pp/opreport.cpp: nice formatting of image report
+ column headers, respect --no-header
+
+2003-09-14 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/arrange_profiles.cpp: use string::erase() not string::clear()
+ for 2.95
+
+ * libutil++/generic_spec.h: allow to ignore "all" match
+ * libutil++/comma_list.h: use it
+
+2003-09-14 John Levon <levon@movementarian.org>
+
+ * pp/opreport.cpp: output column headers for
+ image report
+
+2003-09-14 John Levon <levon@movementarian.org>
+
+ * libpp/op_header.h:
+ * libpp/op_header.cpp: output header info to
+ a string not a stream
+
+ * libpp/arrange_profiles.h:
+ * libpp/arrange_profiles.cpp: give classes a long
+ name, and fill in global event/cpu info
+
+ * pp/opannotate.cpp:
+ * pp/opannotate_options.cpp:
+ * pp/opannotate_options.h:
+ * pp/opgprof_options.cpp:
+ * pp/opreport.cpp:
+ * pp/opreport_options.cpp:
+ * pp/opreport_options.h: use the class long names
+ and info
+
+2003-09-14 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/profile_spec.cpp: handle symlink
+
+2003-09-14 John Levon <levon@movementarian.org>
+
+ * arrange_profiles.h:
+ * arrange_profiles.cpp: Add code to give short names
+ to each class, unused yet
+
+2003-09-14 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/arrange_profiles.cpp: missing include<> with gcc 2.95
+
+2003-09-14 John Levon <levon@movementarian.org>
+
+ * libpp/Makefile.am:
+ * libpp/split_sample_filename.cpp:
+ * libpp/split_sample_filename.h: rename as ...
+
+ * libpp/parse_filename.cpp:
+ * libpp/parse_filename.h: ... this
+
+ * libpp/filename_spec.cpp:
+ * libpp/arrange_profiles.cpp:
+ * libpp/arrange_profiles.h: sort classes for niceness,
+ changes from above
+
+ * pp/opreport.cpp: remove needless double check of
+ exclude_dependent
+
+ * libutil++/string_manip.cpp: touint should init to 0
+ in case of parse failure
+
+2003-09-14 Philippe Elie <phil.el@wanadoo.fr>
+
+ * configure.in: fix maximum template depth to 50
+ * libutil/op_fileio.c: op_get_link() don't truncate silently results
+ * m4/sstream.m4: use OP_CXXFLAGS not CXXFLAGS
+
+2003-09-14 John Levon <levon@movementarian.org>
+
+ * pp/partition_files.h:
+ * pp/partition_files.cpp: remove, now unused
+
+2003-09-14 John Levon <levon@movementarian.org>
+
+ * pp/opannotate.cpp:
+ * pp/opannotate_options.cpp:
+ * pp/opannotate_options.h: use arrange_profiles API
+
+2003-09-14 John Levon <levon@movementarian.org>
+
+ * pp/opgprof_options.h:
+ * pp/opgprof_options.cpp:
+ * pp/opgprof.cpp: use arrange_profiles API
+
+2003-09-14 John Levon <levon@movementarian.org>
+
+ * libpp/Makefile.am:
+ * libpp/arrange_profiles.cpp:
+ * libpp/arrange_profiles.h: introduce new
+ code for partitioning profiles and handling
+ merging
+
+ * libpp/partition_files.h:
+ * pp/opreport_options.cpp:
+ * pp/opreport_options.h:
+ * pp/opreport.cpp: use the above code
+
+ * libpp/format_flags.h:
+ * libpp/profile_container.cpp: remove unneeded
+ multiple apps hint
+
+ * libpp/count_array.cpp:
+ * libpp/count_array.h: remove unnecessary code
+
+2003-09-14 John Levon <levon@movementarian.org>
+
+ * configure.in: back to 0.7cvs
+
+2003-09-14 John Levon <levon@movementarian.org>
+
+ * pp/opannotate.cpp: gcc 2.91 workaround
+ (in 0.6.1 release)
+
+2003-09-14 John Levon <levon@movementarian.org>
+
+ * configure.in: bump to 0.6.1
+
+2003-09-13 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml: document "incorrect source attribution"
+ a bit
+
+2003-09-12 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/op_header.cpp: typo in comment
+
+2003-09-11 John Levon <levon@movementarian.org>
+
+ * configure.in: check for -lintl, tweak -ldl check
+
+2003-09-11 John Levon <levon@movementarian.org>
+
+ * dae/oprofiled.c:
+ * daemon/oprofiled.c:
+ * libdb/db_manage.c:
+ * libdb/db_test.c: correct headers
+
+2003-09-11 John Levon <levon@movementarian.org>
+
+ * op_lockfile.c: use correct headers
+
+2003-09-07 Philippe Elie <phil.el@wanadoo.fr>
+
+ * utils/op_help.c: check than all events are distincts
+
+2003-09-06 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pch-c++.h:
+ * m4/precompiledheader.m4: new file to handle precompiled header
+ * m4/Makefile.am:
+ * configure.in:
+ * Makefile.am: handle precompiled header
+
+2003-09-05 John Levon <levon@movementarian.org>
+
+ * opd_image.c: cleanup of ctx_switch_set_image()
+
+2003-09-05 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/opd_image.c: After a context switch ensure we update correctly
+ the current image.
+
+2003-09-04 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opreport.cpp:
+ * pp/opannotate.cpp: catch op_bfd exception and recover gracefully
+
+2003-09-04 Philippe Elie <phil.el@wanadoo.fr>
+
+ * utils/opcontrol: tweak "signaling daemon " message as suggested
+ by Carlo Wood
+
+2003-09-04 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml: mention --reset in
+ "Getting Started"
+
+2003-09-03 John Levon <levon@movementarian.org>
+
+ * libop/op_events.c:
+ * libpp/op_header.cpp:
+ * dae/opd_sample_files.c:
+ * daemon/opd_sample_files.c: propagate event
+ error back up to caller
+
+ * libdb/odb_hash.h: fix comment
+
+2003-09-02 John Levon <levon@movementarian.org>
+
+ * dae/opd_image.c:
+ * dae/opd_proc.c:
+ * dae/oprofiled.c:
+ * daemon/opd_image.c: use abort() not exit()
+ on "can't happen" errors
+
+2003-09-02 John Levon <levon@movementarian.org>
+
+ * dae/opd_proc.c:
+ * daemon/opd_image.c: fix error message
+
+2003-08-28 Philippe Elie <phil.el@wanadoo.fr>
+
+ * events/alpha.ev6.events: fix duplicate um tag
+
+2003-08-28 John Levon <levon@movementarian.org>
+
+ * events/i386.athlon.events: fix duplicate minimum tag
+
+ * daemon/opd_image.c:
+ * libop/op_events.c: check for duplicate tags
+
+2003-08-28 John Levon <levon@movementarian.org>
+
+
+2003-08-27 Will Cohen <wcohen@redhat.com>
+
+ * utils/op_help.c (resolve_events): Typecast printf argument.
+
+2003-08-25 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opannotate_options.cpp:
+ * pp/opannotate_options.h:
+ * pp/opannotate.cpp: enable multiple events
+
+ * pp/opreport_options.cpp: remove #if 0 .... #endif
+
+2003-08-25 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/count_array.cpp: avoid to access invalid memory
+
+2003-08-25 Philippe Elie <phil.el@wanadoo.fr>
+
+ * configure.in:
+ * m4/builtinexpect.m4:
+ * m4/configmodule.m4:
+ * module/Makefile.in:
+ * module/ia64/Makefile.in:
+ * module/x86/makefile.in: always use EXTRA_CFLAGS_MODULE not
+ EXTRA_CFLAGS for module build flags
+
+2003-08-23 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libregex/op_regex.h:
+ * libregex/op_regex.cpp: tidy
+
+ * libutil++/op_bfd.cpp: remove obsolete comment
+
+2003-08-23 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/file_manip.h:
+ * libutil++/file_manip.cpp: is_directory(dirname): return true if
+ dirname exists
+ * pp/common_option.cpp: validate --image-path parameters
+
+2003-08-22 Philippe Elie <phil.el@wanadoo.fr>
+
+ * events/i386.p4.events: clarify than 128BIT_MMX_UOP count only integer
+ SSE2 ops
+ * pp/opreport.cpp: minor spacing change in output
+
+2003-08-22 John Levon <levon@movementarian.org>
+
+ * daemon/oprofiled.c: report the kernel pointer size
+
+2003-08-22 John Levon <levon@movementarian.org>
+
+ * daemon/oprofiled.c: read new /dev/oprofile/pointer_size
+ in preference to kcore. kcore code will eventually go.
+
+2003-08-21 John Levon <levon@movementarian.org>
+
+ * libutil++/op_bfd.cpp: update gcc2_compiled. comment
+ to reflect reality
+
+2003-08-19 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opreport.cpp: really merge when --merge=lib and image name are
+ specified.
+
+2003-08-16 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opannotate.cpp: output threshold percent when necessary.
+
+2003-08-16 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/op_bfd.cpp: remove ELF-based symbol size code
+
+2003-08-15 William Cohen <wcohen@redhat.com>
+
+ * doc/opcontrol.1.in:
+ * doc/oprofile.1.in:
+ * doc/oprofile.xml: Correct path to /root/.oprofile/daemonrc.
+
+2003-08-15 Thomas Spatzier <TSPAT@de.ibm.com>
+
+ * daemon/opd_cookie.h: fix s390 syscall
+
+2003-08-14 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/string_manip.cpp: erase_to_last_of() is not a ltrim()
+
+2003-08-14 Philippe Elie <phil.el@wanadoo.fr>
+
+ Dave Jones suggested this change.
+
+ * module/x86/op_model_p4.c: remove superflous ';' at end of some macro
+
+2003-08-14 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/string_manip.h: remove erase_from_last_of()
+ * libutil++/string_manip.cpp: and tidy erase_to_last_of(), rtrim() and
+ ltrim()
+
+2003-08-13 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/op_bfd.h:
+ * libpp/profile_container.cpp: remove nil_symbol_index
+
+2003-08-13 John Levon <levon@movementarian.org>
+
+ * libpp/profile_container.cpp:
+ * libpp/profile_container.h: remove "base_vma" parameter
+ to add_samples(), we can just re-grab it straight from
+ the abfd
+
+2003-08-13 John Levon <levon@movementarian.org>
+
+ * libpp/profile_container.cpp:
+ * libpp/profile_container.h: remove unused "zero samples"
+ optimization hint: it's always false
+
+ * pp/opannotate.cpp:
+ * pp/opgprof.cpp:
+ * pp/opreport.cpp: from above
+
+2003-08-12 John Levon <levon@movementarian.org>
+
+ * pp/opreport.cpp: small trivialities
+
+2003-08-12 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libregex/stl.pat.in: minor fix/improvements
+ * libregex/mangled-name.txt: add tests
+
+2003-08-12 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opreport.cpp: fix thinko when --merge=lib
+
+2003-08-12 John Levon <levon@movementarian.org>
+
+ * pp/opreport.cpp: s/count_groups_summary/summary_container/g
+
+2003-08-12 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml: document opreport's side-by-side a little
+ bit
+
+2003-08-12 John Levon <levon@movementarian.org>
+
+ * pp/opreport.cpp: s/group_summary/app_summary/, and
+ a lot of other renamings to clarify the count groups
+ usage.
+
+2003-08-12 John Levon <levon@movementarian.org>
+
+ * utils/op_help.c: add --unit-mask
+
+ * utils/opcontrol: use --unit-mask
+
+2003-08-12 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opreport.cpp: re write using count_array_t
+
+2003-08-11 John Levon <levon@movementarian.org>
+
+ * libpp/count_array.cpp:
+ * libpp/count_array.h: auto-resize the number of groups
+ based on how we index.
+
+ * libpp/profile_container.cpp: remove check
+
+ * pp/opannotate.cpp: count_array.zero() not .empty()
+
+2003-08-11 John Levon <levon@movementarian.org>
+
+ * libpp/filename_spec.h:
+ * libpp/profile_spec.cpp:
+ * libpp/profile_spec.h: add comments, allow comma lists
+ for event, count, and unit mask
+
+ * libutil++/comma_list.h: implement missing method
+
+2003-08-11 John Levon <levon@movementarian.org>
+
+ * libpp/format_output.cpp:
+ * libpp/format_output.h: add set_nr_groups(), remove
+ pp_nr_counters.
+
+ * libpp/profile_container.cpp:
+ * libpp/profile_container.h:
+ * pp/opannotate.cpp:
+ * pp/opgprof.cpp:
+ * pp/opreport.cpp: count_group not counter
+
+2003-08-11 John Levon <levon@movementarian.org>
+
+ * libpp/Makefile.am:
+ * libpp/counter_array.cpp:
+ * libpp/counter_array.h: rename to ...
+
+ * libpp/count_array.h:
+ * libpp/count_array.cpp: ... this ...
+
+ * libpp/format_output.cpp:
+ * libpp/format_output.h:
+ * libpp/profile.cpp:
+ * libpp/profile.h:
+ * libpp/profile_container.cpp:
+ * libpp/profile_container.h:
+ * libpp/sample_container.cpp:
+ * libpp/sample_container.h:
+ * libpp/symbol.h:
+ * pp/opannotate.cpp:
+ * pp/opgprof.cpp:
+ * pp/opreport.cpp: ... and several renamings to starting
+ change the notion from "counters" to the more general notion
+ of "count groups"
+
+2003-08-10 Philippe Elie <phil.el@wanadoo.fr>
+
+ Multiple counter support for pp tools.
+
+ * libpp/counter_array.h:
+ * libpp/counter_array.cpp: resurrected from pp-interface-branch, for
+ now memory use is inefficient.
+ * libpp/Makefile.am: add counter_array.cpp .h
+ * libpp/format_out.h:
+ * libpp/format_out.cpp: handle multiple counter + a general tidy
+ * libpp/format_flags.h: remove ff_immutable_mask and some nasty
+ requisite on flags value
+ * libpp/profile_container.h:
+ * libpp/profile_container.cpp:
+ * libpp/sample_container.h:
+ * libpp/sample_container.cpp:
+ * libpp/symbol.h:
+ * libpp/symbol_container.cpp:
+ * libpp/symbol_sort.cpp:
+ * pp/opreport.cpp: handle multiple counter
+ * pp/opannotate.cpp: partial handling of multiple counter
+ * pp/opgprof.cpp:
+ * pp/opreport.cpp: minor bits
+
+2003-08-08 Will Cohen <wcohen@redhat.com>
+
+ * dae/Makefile.am:
+ * daemon/Makefile.am: Correct library linking order.
+ * daemon/opd_util.c: Add needed include files.
+
+2003-08-08 Philippe Elie <phil.el@wanadoo.fr>
+
+ * utils/opcontrol: move_and_remove() do nothing if source doesn't exist
+
+2003-08-08 Philippe Elie <phil.el@wanadoo.fr>
+
+ revert the previous patch
+ * dae/Makefile.am:
+ * dae/opd_sample_files.h:
+ * dae/opd_sample_files.c:
+ * daemon/Makefile.am:
+ * daemon/opd_sample_files.c: un-share opd_sample_files
+ code
+
+2003-08-08 John Levon <levon@movementarian.org>
+
+ * dae/Makefile.am:
+ * dae/opd_sample_files.h:
+ * dae/opd_sample_files.c:
+ * daemon/Makefile.am:
+ * daemon/opd_sample_files.c: share opd_sample_files
+ code
+
+2003-08-08 John Levon <levon@movementarian.org>
+
+ * dae/oprofiled.c:
+ * daemon/oprofiled.c:
+ * daemon/opd_util.h:
+ * daemon/opd_util.c: share opd_write_abi()
+
+2003-08-08 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libop/op_alloc_counter.c:
+ * libop/op_events.h: minor doxygen fix
+
+2003-08-08 John Levon <levon@movementarian.org>
+
+ * dae/Makefile.am:
+ * dae/oprofiled.c:
+ * daemon/Makefile.am:
+ * daemon/oprofiled.c:
+ * daemon/opd_util.h:
+ * daemon/opd_util.c: share some small bits of code
+ between the daemons
+
+2003-08-08 John Levon <levon@movementarian.org>
+
+ * dae/oprofiled.c:
+ * daemon/oprofiled.c: remove mypid, unused
+
+2003-08-08 John Levon <levon@movementarian.org>
+
+ * dae/Makefile.am:
+ * dae/opd_printf.h: remove duplicate header
+ and use daemon/opd_printf.h
+
+2003-08-08 John Levon <levon@movementarian.org>
+
+ * dae/opd_image.c:
+ * dae/opd_sample_files.h:
+ * dae/opd_sample_files.c:
+ * daemon/opd_image.c:
+ * daemon/opd_sample_files.h:
+ * daemon/opd_sample_files.c: remove "create" bool
+ from opd_mangle_filename(): only one callsite needs
+ that functionality, open code the create instead
+
+ * dae/opd_proc.c:
+ * dae/opd_sample_files.h:
+ * dae/opd_sample_files.c:
+ * daemon/opd_sample_files.h:
+ * daemon/opd_sample_files.c: return error from
+ opd_open_sample_filename(). Do not fail when odb_open
+ fails due to --reset races.
+
+ * dae/oprofiled.c:
+ * daemon/oprofiled.c: a little more verbosity.
+
+ * libutil/op_file.h:
+ * libutil/op_file.c: fix create_dir/path() comments,
+ don't use access()
+
+ * utils/opcontrol: reduce chance of --reset races
+
+2003-08-06 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/symbol_sort.h:
+ * libpp/symbol_sort.cpp: add app_name sort order, force sort order
+ for criteria unspecified by user.
+ * pp/opreport_options.cpp: update --sort option help string.
+
+2003-08-04 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml:
+ * doc/opannotate.1.in:
+ * pp/opannotate.cpp:
+ * pp/opannotate_options.h:
+ * pp/opannotate_options.cpp: add --base-dirs
+
+2003-08-04 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml:
+ * doc/opannotate.1.in:
+ * pp/opannotate.cpp:
+ * pp/opannotate_options.h:
+ * pp/opannotate_options.cpp: add --search-dirs
+
+2003-08-04 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml:
+ * doc/opannotate.1.in:
+ * pp/opannotate.cpp:
+ * pp/opannotate_options.h:
+ * pp/opannotate_options.cpp: remove --source-dir and --base-dir,
+ they're confusing and not useful in the current form
+
+2003-08-03 John Levon <levon@movementarian.org>
+
+ * utils/opcontrol: avoid using ps, it's very slow with kallsyms
+
+2003-08-03 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/op_bfd.cpp: c++ static function doesn't get a mangled name
+ in debug info (see gcc #11774). Try to recover through a not
+ completely reliable mechanism but better than ignoring the problem
+
+2003-08-02 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opreport.cpp: minor: more consistency about function ordering
+
+2003-08-02 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/profile.h:
+ * libpp/profile.cpp: profile::sample_count() new to allow raw access
+ to samples count
+ * pp/opreport.cpp: use above function to implement opreport (w/o -l
+ or --details options). opreport is roughly twice faster.
+
+2003-08-02 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opreport.cpp: clarify multiple counter support
+
+2003-08-01 John Levon <levon@movementarian.org>
+
+ * libregex/stl.pat.in: fix _List_iterator regex
+ (from Phil)
+
+2003-07-31 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opannotate.cpp: output cpu type and cpu speed.
+
+2003-07-30 John Levon <levon@movementarian.org>
+
+ * libpp/partition_files.cpp: remove some apparently
+ dead code
+
+2003-07-30 John Levon <levon@movementarian.org>
+
+ * events/i386.p4.unit_masks: make flame_uops value
+ mandatory, Yuan.Lu@rrze.uni-erlangen.de does not
+ see any events without setting the unit mask
+
+2003-07-30 John Levon <levon@movementarian.org>
+
+ * libutil++/op_bfd.h:
+ * libutil++/op_bfd.cpp: bfd_openr() keeps a copy of
+ the passed in char * around, sickenly enough. Ensure lifetimes
+ will always be correct by adding a filename data member to
+ op_bfd
+
+2003-07-29 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/op_header.h:
+ * libpp/op_header.cpp: separate output of cpu_type, cpu_speed
+ and counter setup
+
+ * libpp/partition_files.h:
+ * libpp/partition_files.cpp: unmergeable_profile() split profile
+ by the unmergeable.
+
+ * pp/opreport_options.h:
+ * pp/opreport_options.cpp:
+ * pp/opreport.cpp: initial multiple counter output, multiple counter
+ with -l is not yet available.
+
+2003-07-29 John Levon <levon@movementarian.org>
+
+ * doc/opcontrol.1.in: update for --event
+
+2003-07-29 John Levon <levon@movementarian.org>
+
+ * configure.in:
+ * doc/srcdoc/Doxyfile.in:
+ * oprof_report/: remove badly out of date oprof_report
+
+2003-07-28 John Levon <levon@movementarian.org>
+
+ * configure.in: bump to 0.7cvs
+
+2003-07-26 John Levon <levon@movementarian.org>
+
+ * configure.in: bump to 0.6
+
+2003-07-26 John Levon <levon@movementarian.org>
+
+ * utils/opcontrol: fix call of op_help
+
+2003-07-26 John Levon <levon@movementarian.org>
+
+ * gui/oprof_start.cpp: replace folder icons with clearer
+ red/green circles
+
+2003-07-26 John Levon <levon@movementarian.org>
+
+ * gui/oprof_start.cpp: actually select and show the default
+ event
+
+2003-07-26 John Levon <levon@movementarian.org>
+
+ * gui/oprof_start.cpp: small string tweak, show "conflicts"
+ message consistently
+
+2003-07-26 John Levon <levon@movementarian.org>
+
+ * gui/oprof_start.cpp: don't use invalidated iterator
+
+2003-07-26 Philippe Elie <phil.el@wanadoo.fr>
+
+ * gui/oprof_start.cpp: fix for 2.91.66
+
+ * libpp/profile.cpp: typo invoking an undefined behavior revealed
+ by gcc stl debug mode
+ * libpp/profile.h: ensure we provide the right typedef to std::
+ for profile::const_iterator revealed by gcc stl debug mode at compile
+ time. The implementation is a bit tricky to work with old compiler
+ * libpp/symbol_sort.cpp: compare must define a weak ordered relation
+ order, revealed by gcc stl debug mode.
+
+2003-07-26 Philippe Elie <phil.el@wanadoo.fr>
+
+ * gui/ui/oprof_start.base.ui:
+ * gui/oprof_start.h:
+ * gui/oprof_start.cpp: change UI to use the new counter allocation
+ API
+
+ * libop/op_alloc_counter.h:
+ * libop/op_alloc_counter.c:
+ * utils/op_help.c: minor const-ness api change
+
+2003-07-25 Will Cohen <wcohen@redhat.com>
+
+ * utils/opcontrol: Restrict the search path.
+
+2003-07-25 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libop/op_alloc_counter.c: use tabulation
+
+ * libop/op_events.c:
+ * libop/op_events.h: find_event_by_name() new
+ * utils/op_help.c: use find_event_by_name()
+
+2003-07-24 Philippe Elie <phil.el@wanadoo.fr>
+
+ * utils/op_help.c: make valgrind happy + minor cleanup
+
+2003-07-24 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libop/op_alloc_counter.h:
+ * libop/op_alloc_counter.c: new file providing mapping from an event
+ list to hardware counter number
+ * utils/op_help.c: use the above api
+
+2003-07-24 Philippe Elie <phil.el@wanadoo.fr>
+
+ * utils/op_help.c: fix hardware counter allocation order
+
+2003-07-23 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml: comment out --base-dir mention
+
+2003-07-23 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml: remove mention of oprof_start_event
+
+2003-07-23 John Levon <levon@movementarian.org>
+
+ * dae/oprofiled.c:
+ * daemon/oprofiled.c: don't uselessly try to unlink
+ non-existent lockfile
+
+ * daemon/opd_image.c:
+ * daemon/oprofiled.c: clean up buffer read messages
+
+2003-07-23 John Levon <levon@movementarian.org>
+
+ * utils/opcontrol: error out at --setup time if vmlinux is not
+ valid. Cleanup the error message if so
+
+ * daemon/opd_kernel.c: fix potential null deref
+
+2003-07-21 John Levon <levon@movementarian.org>
+
+ * gui/oprof_start.cpp: select "No event" when switching counter
+ if needed
+
+2003-07-21 John Levon <levon@movementarian.org>
+
+ * gui/oprof_start.cpp: fix default event choosing when
+ daemonrc exists
+
+2003-07-21 Philippe Elie <phil.el@wanadoo.fr>
+
+ * gui/oprof_start.cpp: thinko in has_unique_event(), don't warn for
+ no counter with CPU_TIMER_INT
+
+2003-07-21 Philippe Elie <phil.el@wanadoo.fr>
+
+ * gui/oprof_start.cpp: allow to de-select a counter
+
+2003-07-21 John Levon <levon@movementarian.org>
+
+ * gui/oprof_start.cpp:
+ * gui/oprof_start_util.h:
+ * gui/oprof_start_util.cpp: remove uptime pretty printing.
+ It's broken for 2.5 and ugly code
+
+2003-07-21 John Levon <levon@movementarian.org>
+
+ * gui/oprof_start.h:
+ * gui/oprof_start.cpp: use a default event if no
+ events are set yet
+
+2003-07-20 Philippe Elie <phil.el@wanadoo.fr>
+
+ * m4/compileroption.m4: fix for autoconf 2.13
+
+2003-07-19 Philippe Elie <phil.el@wanadoo.fr>
+
+ * gui/oprof_start.cpp:
+ * libpp/format_output.cpp:
+ * libpp/format_output.h:
+ * pp/opannotate.cpp:
+ * pp/opreport_options.cpp: minor tidy
+
+2003-07-19 Philippe Elie <phil.el@wanadoo.fr>
+
+ * gui/oprof_start.cpp: RTC mode was not working
+
+2003-07-16 Philippe Elie <phil.el@wanadoo.fr>
+
+ * gui/oprof_start_config.h:
+ * gui/oprof_start_config.cpp: remove dead code, fix kernel_only read
+
+2003-07-16 John Levon <levon@movementarian.org>
+
+ * utils/opcontrol: fix typo that was partly breaking
+ CPU_TIMER_INT
+
+2003-07-16 John Levon <levon@movementarian.org>
+
+ * gui/oprof_start.h:
+ * gui/oprof_start.cpp: fixes for CPU_TIMER_INT
+
+2003-07-16 John Levon <levon@movementarian.org>
+
+ * gui/ui/oprof_start.base.ui: remove add/remove event buttons,
+ fix resize weirdness
+
+ * gui/oprof_start.h:
+ * gui/oprof_start.cpp: remove add/remove event buttons, allow
+ short-form event descriptions
+
+2003-07-15 Philippe Elie <phil.el@wanadoo.fr>
+
+ * gui/persistent_config.h: remove
+ * gui/oprof_start.h:
+ * gui/oprof_start.cpp: debug, remove dead code, works better now, see
+ TODO
+
+2003-07-15 Philippe Elie <phil.el@wanadoo.fr>
+
+ * gui/oprof_start.h:
+ * gui/oprof_start.cpp:
+ * gui/oprof_start_util.cpp: re-enable partially the gui, sorta of
+ working if cautioulsy used
+
+2003-07-15 John Levon <levon@movementarian.org>
+
+ * gui/ui/oprof_start_base.ui:
+ * gui/oprof_start.h:
+ * gui/oprof_start.cpp: some steps towards fixing gui for
+ the new events stuff
+
+2003-07-15 John Levon <levon@movementarian.org>
+
+ * libop/op_events.h:
+ * libop/op_events.c: add op_default_event
+
+ * utils/op_help.c: move default event stuff to libop,
+ fix -c option
+
+2003-07-15 John Levon <levon@movementarian.org>
+
+ * utils/op_help.c: fix default RTC event to be
+ "RTC_INTERRUPTS"
+
+2003-07-15 Philippe Elie <phil.el@wanadoo.fr>
+
+ * utils/opcontrol
+ * events/rtc..events: use RTC_INTERRUPTS as event name
+
+2003-07-15 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/opd_sample_files.c: C89 compile fix
+
+2003-07-15 John Levon <levon@movementarian.org>
+
+ * utils/opcontrol:
+ * utils/op_help.c: move the default event strings into
+ op_help.c instead of in opcontrol
+
+2003-07-15 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml: document event name for timer interrupt
+
+ * daemon/opd_sample_files.c: handle CPU_TIMER_INT
+
+ * utils/op_help.c: fix a core dump
+
+2003-07-13 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/opd_image.c: verbprintf() when starting reading buffer not
+ printf
+
+2003-07-12 Philippe Elie <phil.el@wanadoo.fr>
+
+ * from BRANCH_CALLGRAPH:
+ * daemon/opd_image.c: printf -> verbprintf, fix comment
+ * daemon/opd_kernel.c: kernel/module samples statistics was wrong
+
+ * daemon/opd_image.c:
+ * daemon/opd_image.h:
+ * daemon/opd_kernel.c:
+ * daemon/opd_kernel.h: import cleanup from branch, mainly don't handle
+ samples in opd_kernel.c but return (creating if necessary) an
+ opd_image struct where the sample must go and let opd_image caller
+ in opd_image.c do sample insertion
+
+2003-07-11 Philippe Elie <phil.el@wanadoo.fr>
+
+ * utils/opcontrol: shows basename $0 with --version
+ * libpp/op_header.cpp: formating
+
+2003-07-11 Philippe Elie <phil.el@wanadoo.fr>
+
+ * utils/opcontrol: don't try to save current if the directory doesn't
+ exist
+
+2003-07-11 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/stream_util.h:
+ * libutil++/stream_util.cpp: new file, io_state() save object
+ * libutil++/Makefile.am: handle new file
+ * libutil++/op_bfd.cpp:
+ * pp/opreport.cpp:
+ * libpp/op_header.cpp: use io_state
+
+2003-07-09 Philippe Elie <phil.el@wanadoo.fr>
+
+ * module/x86/op_model_p4.c: reflect intel documentation fix.
+
+2003-07-08 Will Cohen <wcohen@redhat.com>
+
+ * daemon/opd_kernel.c: Handle /proc/modules format.
+
+2003-07-08 Will Cohen <wcohen@redhat.com>
+
+ * doc/oprofile.xml:
+ * configure.in: --enable-gcov option and documentation.
+
+2003-07-08 Will Cohen <wcohen@redhat.com>
+
+ * utils/opcontrol: Correct P4 default event.
+
+2003-06-03 John Levon <levon@movementarian.org>
+
+ * from BRANCH_CALLGRAPH
+ * libdb/odb_hash.h:
+ * libdb/db_manage.c:
+ * libdb/db_insert.c: namespace safety
+
+ * libpp/partition_files.cpp:
+ * libpp/profile.cpp: spacing, add a FIXME
+
+2003-07-07 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opannotate.cpp:
+ * pp/opgprof.cpp:
+ * pp/opreport.cpp: cleanup walking through multimap with a
+ pair<iterator, iterator>
+
+2003-07-05 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/opd_image.c:
+ * libdb/db_insert.c: 64 bits arch compile fix, thanks to Falk Hueffner
+ <falk@debian.org>
+
+2003-07-02 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opreport.cpp: honor options::show_header
+
+2003-06-30 Graydon Hoare <graydon@redhat.com>
+
+ * libpp/op_header.cpp: Handle printing multiple bitmask values.
+
+2003-06-19 John Levon <levon@movementarian.org>
+
+ * doc/Makefile.am: fix make distcheck
+
+2003-06-18 John Levon <levon@movementarian.org>
+
+ * pp/opannotate_options.c: hide the unhandled
+ --base-dir option
+
+2003-06-18 John Levon <levon@movementarian.org>
+
+ * pp/Makefile.am: don't build opdiff
+
+2003-06-17 Will Cohen <wcohen@redhat.com>
+
+ * daemon/opd_cookie.h: Add s390 syscall value.
+
+2003-06-17 John Levon <levon@movementarian.org>
+
+ * utils/opcontrol: don't accept "-r" - it's too easy to typo
+
+2003-06-17 John Levon <levon@movementarian.org>
+
+ * doc/srcdoc/Doxyfile: removed
+
+ * doc/srcdoc/Doxyfile.in:
+ * configure.in: generate doxygen version nr. automatically
+
+2003-06-17 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libdb/db_insert.cpp: missing initialization of error message on
+ error path
+
+2003-06-17 John Levon <levon@movementarian.org>
+
+ * utils/opcontrol: accept some short forms for common
+ operations
+
+2003-06-17 John Levon <levon@movementarian.org>
+
+ * utils/opcontrol: accept --foo blah as well as
+ --foo=blah
+
+2003-06-16 John Levon <levon@movementarian.org>
+
+ * utils/opcontrol: "opcontrol" will show usage
+ instead of doing nothing
+
+2003-06-16 Will Cohen <wcohen@nc.rr.com>
+
+ * libabi/abi.cpp:
+ * libabi/op_import.cpp: Add required include for cassert.
+
+2003-06-16 John Levon <levon@movementarian.org>
+
+ * events/x86-64.hammer.unit_masks: remove some
+ bogus FIXMEs
+
+2003-06-15 John Levon <levon@movementarian.org>
+
+ * README: fix autogen.sh line
+
+2003-06-15 John Levon <levon@movementarian.org>
+
+ * daemon/opd_image.c: 64 bit fixes
+
+2003-06-15 John Levon <levon@movementarian.org>
+
+ * utils/op_help.c: c89 fix
+
+2003-06-15 John Levon <levon@movementarian.org>
+
+ * daemon/opd_image.c: c89 fix
+
+2003-06-15 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml: document --event
+
+ * utils/opcontrol:
+ * utils/op_help.c: allow unit mask, kernel, user to be
+ optional. Verify not too many events are passed.
+
+2003-06-15 John Levon <levon@movementarian.org>
+
+ * libop/op_cpu_type.c: fix nr_counters cpu type check
+
+ * utils/op_help: implement --check_events, event validation
+ and counter allocation
+
+ * utils/opcontrol: use the above, implement --event=default
+
+2003-06-14 John Levon <levon@movementarian.org>
+
+ * daemon/opd_image.c: fix a stupid error in my previous TGID patch
+
+2003-06-12 Graydon Hoare <graydon@redhat.com>
+
+ * libop/op_events.c (op_check_events): Check bitmasks as well as
+ exclusive values, for unit masks.
+
+2003-06-12 John Levon <levon@movementarian.org>
+
+ * daemon/opd_image.c: we were not handling a truncated
+ TGID entry properly
+
+2003-06-12 John Levon <levon@movementarian.org>
+
+ * libutil++/unique_storage.h: missing typename
+
+2003-06-11 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opannotate_options.cpp: typo in option name
+
+2003-06-11 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/op_bfd.cpp: boring_symbol() new to get a better choice
+ when eliminating symbol at identical vma
+
+2003-06-11 Philippe Elie <phil.el@wanadoo.fr>
+
+ * utils/opcontrol: fix rtc option checking, bug added after 0.5.3,
+ no big deal
+
+2003-06-11 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libregex/op_regex.cpp:
+ * libpp/profile.cpp: compile fix, tree was broken by my previous patch
+
+2003-06-11 Jason Yeh <jason.yeh@amd.com>
+
+ * events/i386.athlon.events: add CPU_CLK_UNHALTED
+
+ * utils/opcontrol: use the above by default
+
+ * events/x86-64.hammer.events:
+ * events/x86-64.hammer.unit_masks: various fixes
+
+2003-06-11 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/op_header.cpp:
+ * libpp/profile.cpp:
+ * libpp/profile_spec.cpp:
+ * libpp/symbol_sort.cpp:
+ * libregex/op_regex.cpp:
+ * libutil++/op_bfd.cpp: use exception rather exit(EXIT_FAILURE) in
+ library code
+
+2003-06-11 John Levon <levon@movementarian.org>
+
+ * daemon/opd_image.c: future-proof the code handlers
+
+2003-06-11 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opannotate.cpp: output_asm() avoid output when the set of selected
+ symbols doesn't contain any samples
+
+2003-06-11 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/unique_storage.h: we don't need to check if key is present
+ before trying to insert it
+
+2003-06-10 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/name_storage.h: minor tidy
+ * libutil++/unique_storage.h: small efficiency improvement
+
+2003-06-09 John Levon <levon@movementarian.org>
+
+ * pp/Makefile.am:
+ * libutil/Makefile.am: fix make distcheck
+
+2003-06-09 John Levon <levon@movementarian.org>
+
+ * libpp/opp_symbol.h: rename to ...
+
+ * libpp/symbol.h: ... this
+
+ * libpp/Makefile.am:
+ * libpp/format_output.h:
+ * libpp/format_output.cpp:
+ * libpp/profile_container.h:
+ * libpp/profile_container.cpp:
+ * libpp/sample_container.h:
+ * libpp/sample_container.cpp:
+ * libpp/symbol_functors.h:
+ * libpp/symbol_sort.cpp: fix up from above and some header
+ cleanups
+
+2003-06-09 John Levon <levon@movementarian.org>
+
+ * libpp/profile.h: std::pair not pair
+
+2003-06-08 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/profile.cpp: don't underflow start offset when the vma range
+ is unknown
+ * pp/opreport.cpp: use samples_range() not samples_range(0, ~0)
+
+2003-06-08 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/profile.h:
+ * libpp/profile.cpp: replace accumulate_samples() API by an iterator
+ interface
+ * libpp/profile_container.h:
+ * libpp/profilecontainer.cpp:
+ * pp/opreport.cpp: use new API
+
+2003-06-08 Philippe Elie <phil.el@wanadoo.fr>
+
+ * include/sstream: replace old version by the once shipped with
+ 2.95.3, seekg() in the old was not working
+
+2003-06-08 John Levon <levon@movementarian.org>
+
+ * libpp/name_storage.h: don't need to define the tag structs
+
+ * libutil++/unique_storage.h: fix the comments,
+ make get() public
+
+2003-06-08 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/profile_container.cpp:
+ * libutil++/string_manip.cpp: gcc 2.91.66 fix
+
+2003-06-08 John Levon <levon@movementarian.org>
+
+ * libpp/name_storage.h:
+ * libpp/name_storage.cpp:
+ * libpp/opp_symbol.h:
+ * libpp/profile_container.cpp:
+ * libpp/symbol_functors.cpp:
+ * libutil++/unique_storage.h: don't derive from I()
+ at all for id_value, it's not needed. Hide .id and
+ provide operator<(), operator==(), operator!=(), and
+ set()
+
+2003-06-08 John Levon <levon@movementarian.org>
+
+ * libutil++/unique_storage.h: make some of
+ id_value only visible to unique_storage.
+
+2003-06-08 John Levon <levon@movementarian.org>
+
+ * libpp/name_storage.h:
+ * libutil++/unique_storage.h: move the ID class
+ into unique_storage, and make it derive from the
+ template parameter, to give simpler type safe support
+
+2003-06-08 John Levon <levon@movementarian.org>
+
+ * libutil++/Makefile.am:
+ * libutil++/unique_storage.h: add new template for
+ unique storage of values
+
+ * libpp/name_storage.h:
+ * libpp/name_storage.cpp: use it
+
+2003-06-07 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/profile_container.cpp: fix order of file output with opannotate
+ --source to be consistent with other tools
+
+2003-06-07 John Levon <levon@movementarian.org>
+
+ * libpp/profile_container.cpp: fix operator<
+
+2003-06-07 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/profile.h:
+ * libpp/profile.cpp: change API to walk through vma with non zero
+ samples count rather looking for all vma. This is not very clean, an
+ iterator interface will be perhaps a better idea. Measures shows it's
+ to do it so for now I apply it.
+ * libpp/profile_container.cpp: update according to above change.
+
+2003-06-07 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/profile_container.h:
+ * libpp/profile_container.cpp:
+ * libpp/symbol_container.h:
+ * libpp/symbol_container.cpp: remove dead api
+ find_symbol(string symbol_name)
+
+2003-06-07 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/name_storage.h:
+ * libpp/name_storage.cpp:
+ * libpp/profile_container.cpp:
+ * libpp/profile_container.h:
+ * libpp/sample_container.h:
+ * libpp/sample_container.cpp:
+ * libpp/symbol_container.h:
+ * libpp/symbol_container.cpp:
+ * pp/opannotate.cpp: replace some use of string filename by
+ debug_name_id
+
+2003-06-05 John Levon <levon@movementarian.org>
+
+ * daemon/Makefile.am:
+ * daemon/opd_kernel.c:
+ * daemon/p_module.h: remove p_module.h, unused
+
+ * daemon/opd_cookie.h: use __NR_lookup_dcookie and
+ use our definitions only if it's not defined
+
+ * daemon/opd_image.c:
+ * daemon/opd_kernel.c:
+ * daemon/opd_sample_files.c:
+ * daemon/oprofiled.c: pedantry
+
+ * libabi/op_import.cpp:
+ * libabi/abi_test.cpp: fix build from odb change
+
+ * libop/op_config.h: move NR_CPUS to ...
+
+ * libop/op_config_24.h: ... here
+
+ * libop/op_hw_config.h: remove unused OP_COUNT_MAX
+
+2003-06-03 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/op_header.cpp:
+ * libpp/profile.cpp:
+ * dae/opd_proc.c:
+ * dae/opd_sample_files.c:
+ * daemon/opd_image.c:
+ * daemon/opd_sample_files.c:
+ * libdb/odb_hash.h:
+ * libdb/db_insert.c:
+ * libdb/db_manage.c:
+ * libdb/db_test.c: error message is now a field of a samples_odb_t
+
+2003-06-03 John Levon <levon@movementarian.org>
+
+ * libutil++/child_reader.cpp:
+ * libabi/abi.cpp:
+ * libabi/abi.h:
+ * libabi/abi_test.cpp:
+ * libabi/op_api.h:
+ * libabi/op_abi.cpp:
+ * libabi/op_import.cpp: pedantry, remove unused code
+
+2003-06-01 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/oprofiled.c:
+ * libop/oprofiled.c:
+ * libop/op_cpu_type.c:
+ * module/oprofile.c:
+ * module/oprofile.h:
+ * pp/opdiff.cpp: more static data and function
+
+2003-05-31 Philippe Elie <phil.el@wanadoo.fr>
+
+ * gui/oprof_start_util.h:
+ * libdb/db_stat.c:
+ * libdb/odb_hash.h:
+ * libpp/format_output.h:
+ * libpp/locate_image.h:
+ * libpp/name_storage.h:
+ * libpp/partition_files.h:
+ * libpp/profile.h:
+ * libutil++/op_bfd.h:
+ * libutil++/op_bfd.cpp: improve doxygen comment
+
+2003-05-31 Philippe Elie <phil.el@wanadoo.fr>
+
+ * configure.in: use AC_DEFINE_UNQUOTED() to define version string
+ in config.h not in version-1.h
+ * Makefile.am: distclean-local: is no longer used
+ * version-1.h.in: delete
+ * libutil/op_version.h:
+ * libutil/op_version.c: new file: package version output
+ * libutil/Makefile.am:
+ * dae/oprofiled.c:
+ * daemon/oprofiled.c:
+ * gui/oprof_start.h:
+ * libop/op_events.c:
+ * libopt++/popt_options.cpp:
+ * libregex/demangle_sybol.cpp:
+ * module/oprofile.c:
+ * utils/op_help.c: tweak # include according
+
+2003-05-30 Dan Zink <Dan.Zink@hp.com>
+
+ * module/x86/op_apic.c: really disable the apic if it was disabled
+
+2003-05-29 John Levon <levon@movementarian.org>
+
+ * utils/opcontrol: don't allow --rtc-value if not RTC mode
+
+2003-05-27 John Levon <levon@movementarian.org>
+
+ * libutil++/string_manip.h: add <stdexcept>
+
+ * pp/opannotate.cpp: use '\n' not endl
+
+ * pp/opreport.cpp: untie cout
+
+2003-05-29 Philippe Elie <phil.el@wanadoo.fr>
+
+ * merge with pp-interface-branch: following ChangeLog was unmerged
+ to branch
+
+ 2003-05-27 John Levon <levon@movementarian.org>
+
+ * configure.in: oprofile 0.5.3 is released, back to
+ 0.6cvs
+
+ 2003-05-26 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml: update docs for --no-vmlinux
+
+ 2003-05-26 John Levon <levon@movementarian.org>
+
+ * libop/op_interface_25.h:
+ * daemon/opd_image.c: handle tgid for future
+ compatibility, fix compile on older gccs
+
+ 2003-05-26 John Levon <levon@movementarian.org>
+
+ * libop/op_interface_25.h: add LAST_CODE
+
+ * daemon/opd_stats.h:
+ * daemon/opd_stats.c: count short reads of
+ buffer and unplaceable samples
+
+ * daemon/opd_image.c: rewrite buffer parsing
+ code, handle window where we can't place a
+ sample
+
+ 2003-05-26 John Levon <levon@movementarian.org>
+
+ * libutil++/utility.h: fix typo
+
+ * utils/opcontrol: fix typo
+
+ 2003-05-16 John Levon <levon@movementarian.org>
+
+ * pp/counter_profile.cpp: remove bogus cpu speed
+ consistency check
+
+ 2003-05-09 John Levon <levon@movementarian.org>
+
+ * m4/Makefile.am:
+ * m4/compileroption.m4: add a generalised compiler option
+ tester
+
+ * configure.in: use it, add -fno-common
+
+ 2003-05-09 John Levon <levon@movementarian.org>
+
+ * daemon/oprofiled.c:
+ * dae/oprofiled.c: remove duplicate declaration found
+ via -fno-common
+
+ 2003-05-04 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml: fix validation errors from xmllint --valid
+
+
+2003-05-28 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/profile_spec.cpp: make image:/path/to:image working
+
+2003-05-28 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/string_manip.h:
+ * libutil++/string_manip.cpp: specialize
+ lexical_cast_no_ws<unsigned int> to accept hexadecimal input
+
+ * pp/common_option.cpp: missing << endl
+
+2003-05-27 Philippe Elie <phil.el@wanadoo.fr>
+
+ * doc/oprofile.xml: update example in "Interpreting profiling results"
+ section
+
+2003-05-26 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml: add new pp tools options
+
+2003-05-26 John Levon <levon@movementarian.org>
+
+ * doc/opreport.1.in:
+ * doc/opgprof.1.in:
+ * doc/opannotate.1.in:
+ * doc/op_help.1.in: complete
+
+2003-05-26 John Levon <levon@movementarian.org>
+
+ * configure.in:
+ * doc/Makefile.am:
+ * doc/oprofile.1.in:
+ * doc/op_help.1.in:
+ * doc/opcontrol.1.in:
+ * doc/opreport.1.in:
+ * doc/opannotate.1.in:
+ * doc/opgprof.1.in: re-organise and add manpages
+
+2003-05-26 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml: start to document the pp interface
+
+2003-05-26 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opreport.cpp: remove automatic switch to --symbols mode
+
+2003-05-26 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/symbol_sort.h:
+ * pp/opannotate_options.cpp:
+ * pp/opgprof_options.cpp:
+ * pp/opreport_options.cpp: handle meaningless options combinations
+
+2003-05-26 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opgprof_options.cpp: no need to use unmergeable_profile here
+
+2003-05-25 Philippe Elie <phil.el@wanadoo.fr>
+
+ * events/i386.piii.unit_masks: tweak comment, change default unit mask
+ for kni instruction to 0 and type to exclusive
+
+2003-05-25 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/profile_container.cpp: thinko
+ * pp/opreport.cpp: typo
+
+2003-05-25 John Levon <levon@movementarian.org>
+
+ * libopt++/popt_options.h:
+ * libopt++/popt_options.cpp: obvious cleanup,
+ remove some dead code
+
+2003-05-25 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/format_flags: cf_image_name new column_flags flag
+ * libpp/profile_container.cpp: use above flag. Don't compare app_name
+ by string but id
+ * pp/opreport.cpp: hide image_name when un-necessary
+
+2003-05-24 Philippe Elie <phil.el@wanadoo.fr>
+
+ * doc/srcdoc/Doxyfile:
+ * libpp/profile.h:
+ * libpp/profile_container.h:
+ * libutil++/utility.h: remove gcc 2.91 noncopyable as empty base class
+ work-around
+
+2003-05-23 Philippe Elie <phil.el@wanadoo.fr>
+
+ * configure.in: do early check of libiberty
+
+ * libpp/symbol_sort.cpp: 2.91 compile fix
+
+2003-05-22 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/child_reader.h: minor #include fix
+
+2003-05-22 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/name_storage.cpp: debug_name_storage::name()
+ return an empty string when for zero id to avoid exception
+
+2003-05-21 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/profile.cpp:
+ * libpp/op_header.h:
+ * libpp/op_header.cpp: when sample file differ output the sample
+ filename
+
+ * pp/opannotate.cpp: remove spurious output
+
+ * */Makefile.am:
+ * configure.in: handle our own OP_CFLAGS, OP_CXXFLAGS to let user
+ free to use make CFLAGS=
+
+2003-05-20 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/profile_spec.h:
+ * libpp/profile_spec.cpp: remove lib_image_exclude, use image_exclude
+ instead. match() Handle image exclusion.
+
+ * libregex/stl.pat.in: FIXME
+
+ * libutil++/string_manip.h: compile fix
+
+2003-05-19 John Levon <levon@movementarian.org>
+
+ * libutil++/comma_list.h:
+ * libpp/filename_spec.cpp:
+ * libutil++/string_manip.h:
+ * libutil++/generic_spec.h: rename strict_convert<>
+ to lexical_cast_no_ws<>
+
+2003-05-19 John Levon <levon@movementarian.org>
+
+ * libutil++/generic_spec.h: move strict_convert<> to...
+
+ * libutil++/string_manip.h: ...here
+
+2003-05-19 John Levon <levon@movementarian.org>
+
+ * libutil++/generic_spec.h: comma_list isn't a friend
+ any more
+
+ * libutil++/comma_list.h: use generic_spec<>::match()
+ directly
+
+2003-05-19 John Levon <levon@movementarian.org>
+
+ * libpp/name_storage.h: s/name_map/stored_names/, it's not
+ a map any more.
+
+2003-05-19 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libregex/mangled-name.txt:
+ * libregex/stl.pat.in: partial handling of _Identity<> and
+ _Select1st<>, pattern fail if type are too complex
+
+2003-05-19 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/format_output.cpp: small cleanup
+
+ * libpp/name_storage.h:
+ * libpp/name_storage.cpp: ensure type safety by providing distinct
+ type identifier for each name_storage based container
+
+ * libpp/profile_container.cpp:
+ * libpp/sample_container.cpp:
+ * libpp/symbol_functors.cpp:
+ * libpp/symbol_sort.cpp:
+ * libpp/opp_symbol.h: use the name identifier api
+
+ * libpp/op_header.cpp:
+ * libpp/partition_files.cpp: use a set<string> not a name_storage
+
+ * libpp/format_output.cpp: small cleanup
+
+
+2003-05-18 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/partition_files.cpp: merge partition entry when necessary
+ fixing a corner case when a binary can be a dependent or a primary
+ image and was not merged
+
+2003-05-18 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opreport_options.cpp:
+ * pp/opannotate_options.cpp: remove conflicting options shortcut
+
+2003-05-18 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libregex/stl.pat.in: add list<T>::{const_}+iterator
+
+2003-05-17 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/name_storage.cpp: basename() return an empty string for nil id
+
+2003-05-17 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/op_bfd.cpp: get_linenr() init linenr to zero
+
+ * libpp/name_storage.cpp: don't use id zero
+ * libpp/opp_symbol.h: now we use id and not string we must provide
+ default ctor to initialize the id
+ * libpp/profile_container.cpp: init debug info entry only if
+ get_linenr() succeed
+
+2003-05-17 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libdb/db_manage.c: better handling of zero sample file size when
+ opening in read only mode
+
+ * module/x86/op_nmi.c: printk format fix
+
+2003-05-17 John Levon <levon@movementarian.org>
+
+ * pp/opannotate_option.cpp:
+ * pp/opreport_options.cpp: command line changes
+
+2003-05-17 John Levon <levon@movementarian.org>
+
+ * libpp/name_storage.h:
+ * libpp/name_storage.cpp: add present()
+
+ * libpp/op_header.cpp:
+ * libpp/partition_files.cpp: use a name store
+ to track what we've warned about, and clean up
+ the warnings a bit
+
+2003-05-16 John Levon <levon@movementarian.org>
+
+ * libutil++/op_bfd.h:
+ * libutil++/op_bfd.cpp: expose anonymous symbols
+ to the world as "??sectionname". Useful for .plt
+ and .fini, which are quite common.
+
+ * libpp/name_storage.cpp: demangle anonymous symbols
+ nicely.
+
+2003-05-16 John Levon <levon@movementarian.org>
+
+ * libpp/symbol_sort.cpp: fix image-sorting
+
+2003-05-16 John Levon <levon@movementarian.org>
+
+ * libpp/name_storage.h:
+ * libpp/name_storage.cpp: make ID be per-container
+
+2003-05-16 John Levon <levon@movementarian.org>
+
+ * libpp/name_storage.h:
+ * libpp/name_storage.cpp: merge processed names
+ into one string, remove the boolean
+
+2003-05-16 John Levon <levon@movementarian.org>
+
+ * libpp/name_storage.h:
+ * libpp/name_storage.cpp: whoops, use string
+ not stored_name for the ID map
+
+2003-05-16 John Levon <levon@movementarian.org>
+
+ * libpp/name_storage.h:
+ * libpp/name_storage.cpp: split into three
+ stores for debug filenames, symbols, and images
+
+ * libpp/format_output.cpp:
+ * libpp/profile_container.cpp:
+ * libpp/sample_container.cpp:
+ * libpp/symbol_container.cpp:
+ * libpp/symbol_sort.cpp:
+ * pp/opannotate.cpp: changes from above
+
+2003-05-16 John Levon <levon@movementarian.org>
+
+ * libpp/Makefile.am:
+ * libpp/name_storage.h:
+ * libpp/name_storage.cpp: add shared storage
+ and caching of symbol and file names
+
+ * libpp/opp_symbol.h:
+ * libpp/format_output.cpp:
+ * libpp/profile_container.cpp:
+ * libpp/sample_container.cpp:
+ * libpp/symbol_container.cpp:
+ * libpp/symbol_container.h:
+ * libpp/symbol_sort.cpp:
+ * libpp/symbol_sort.h:
+ * pp/opannotate.cpp:
+ * pp/opreport.cpp: use it
+
+ * pp/opgprof_options.cpp: add unused demangle
+ options to hack-fix the build
+
+2003-05-16 John Levon <levon@movementarian.org>
+
+ * libpp/symbol_sort.cpp: fix --sort debug
+
+2003-05-16 John Levon <levon@movementarian.org>
+
+ * libutil++/op_bfd.h:
+ * libutil++/op_bfd.cpp: remove have_debug_info()
+
+2003-05-16 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/op_header.cpp: remove cpu_speed checking
+
+ * libutil++/op_bfd.h:
+ * libutil++/op_bfd.cpp: bail out in get_linenr() if binary doesn't
+ contain any debug info. Speed up my test case opreport --debug-info
+ -l by 25
+
+2003-05-16 John Levon <levon@movementarian.org>
+
+ * libutil++/op_bfd.cpp: clean up interesting_symbol
+ a bit
+
+2003-05-16 John Levon <levon@movementarian.org>
+
+ * libutil++/op_bfd.cpp: make sure linenr is
+ always set to something
+
+ * libpp/opp_symbol.h: linenr should be unsigned
+
+ * libpp/profile_container.cpp: remove some unneeded
+ copies
+
+2003-05-16 John Levon <levon@movementarian.org>
+
+ * pp/opannotate.cpp: small renaming
+
+2003-05-15 John Levon <levon@movementarian.org>
+
+ * libpp/symbol_container.h:
+ * libpp/symbol_container.cpp: add begin(), end(),
+ remove symbols_by_count()
+
+ * libpp/profile_container.cpp: use symbol container
+ iterator directly in select_symbols()
+
+2003-05-15 John Levon <levon@movementarian.org>
+
+ * libpp/format_output.h:
+ * libpp/format_output.cpp:
+ * libpp/profile_container.h:
+ * libpp/profile_container.cpp:
+ * libpp/symbol_container.h:
+ * libpp/symbol_container.cpp:
+ * libpp/symbol_sort.h:
+ * libpp/symbol_sort.cpp:
+ * pp/opannotate.cpp:
+ * pp/opreport.cpp:
+ * pp/opgprof.cpp: move symbol_collection typedef
+ into global namespace, and use consistently
+
+2003-05-15 John Levon <levon@movementarian.org>
+
+ * libpp/format_output.h:
+ * libpp/format_output.cpp: add vma_format_64bit(),
+ remove bool parameter from output()
+
+ * pp/opreport.cpp: change from above, refactor flags
+ code into get_format_flags() helper
+
+2003-05-12 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/format_output.h:
+ * libpp/format_output.cpp:
+ * libpp/symbol_sort.h:
+ * libpp/symbol_sort.cpp: handle reverse sort in sorting not in output
+ * pp/opannotate.cpp:
+ * pp/opreport.cpp: update according
+
+2003-05-12 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/symbol_sort.h:
+ * libpp/symbol_sort.cpp: handle sort order as specified on command line
+
+ * pp/opgprof.cpp: sort symbol is not necessary for gprof
+ * pp/opreport.cpp:
+ * pp/opreport_options.cpp:
+ * pp/opannotate.cpp: use new sort API
+
+2003-05-12 John Levon <levon@movementarian.org>
+
+ * libpp/symbol_sort.h:
+ * libpp/symbol_sort.cpp: partial implementation
+ of other sort options
+
+2003-05-12 John Levon <levon@movementarian.org>
+
+ * libpp/Makefile.am:
+ * libpp/symbol_sort.h:
+ * libpp/symbol_sort.cpp: add sorting code
+
+ * symbol_functors.h: move some less() into
+ symbol_sort.cpp
+
+ * libpp/profile_container.h:
+ * libpp/profile_container.cpp: don't pass in
+ sort option to select_symbols(), do it in caller
+
+ * pp/opannotate.cpp:
+ * pp/opgprof.cpp:
+ * pp/opreport.cpp:
+ * pp/opreport_options.h:
+ * pp/opreport_options.cpp: from the above
+
+2003-05-12 John Levon <levon@movementarian.org>
+
+ * format_flags.h: remove vma64_p. Add column_flags
+
+ * libpp/profile_container.h:
+ * libpp/profile_container.cpp: pass in a struct
+ to select_symbols. Generate hints for 64-bit VMA
+ and multiple apps in the profile.
+
+ * pp/opannotate.cpp:
+ * pp/opgprof.cpp:
+ * pp/opreport.cpp: use the above
+
+2003-05-12 John Levon <levon@movementarian.org>
+
+ * libpp/format_output.cpp:
+ * libpp/format_flags.h:
+ * pp/opreport.cpp: trivial renaming of flags
+
+2003-05-11 John Levon <levon@movementarian.org>
+
+ * libpp/format_output.cpp:
+ * libpp/format_flags.h: better output for
+ the default of short filenames
+
+2003-05-11 John Levon <levon@movementarian.org>
+
+ * pp/opreport.cpp: improve the app/image name column
+ showing a bit
+
+2003-05-11 John Levon <levon@movementarian.org>
+
+ * pp/opreport.cpp: default to -l if we were just
+ going to show one image summary.
+
+2003-05-11 John Levon <levon@movementarian.org>
+
+ * pp/opreport.cpp: move some code around that
+ outputs the image summaries
+
+2003-05-11 John Levon <levon@movementarian.org>
+
+ * libpp/format_output.h:
+ * libpp/format_output.cpp:
+ * pp/opreport.cpp:
+ * pp/opreport_options.h:
+ * pp/opreport_options.cpp: s/--short-filename/--long-filenames/
+
+2003-05-11 John Levon <levon@movementarian.org>
+
+ * libpp/profile_spec.h:
+ * libpp/profile_spec.cpp: take exclude_dependent not
+ include_dependent
+
+ * pp/opannotate_options.c:
+ * pp/opgprof_options.c:
+ * pp/opreport_options.h:
+ * pp/opreport_options.c: change to use exclude_dependent,
+ remove --hide-dependent
+
+2003-05-11 John Levon <levon@movementarian.org>
+
+ * locate_images.h:
+ * locate_images.cpp: extra_images can now use
+ relative paths for its search dirs. Move most of
+ the warnings out of find_image_path, and make it
+ also handle relative paths. Return the file
+ even if it wasn't readable.
+
+ * libpp/partition_files.cpp: give warnings when
+ necessary.
+
+ * libpp/profile_spec.h:
+ * libpp/profile_spec.cpp: handle relative paths
+ inside image specs, as stated in pp_interface; also
+ use the extra images search path for resolution.
+
+ * pp/opannotate_options.cpp:
+ * pp/opreport_options.cpp:
+ * pp/opgprof_options.cpp: changes from above
+
+2003-05-11 John Levon <levon@movementarian.org>
+
+ * libpp/format_flags.h: source doc improvements
+
+2003-05-11 John Levon <levon@movementarian.org>
+
+ * libpp/opp_symbol.h: move vma64_p to ...
+
+ * libpp/format_flags.h: ... here
+
+2003-05-11 John Levon <levon@movementarian.org>
+
+ * libpp/Makefile.am:
+ * libpp/outsymbflags.h:
+ * libpp/format_flags.h:
+ * libpp/profile_container.h:
+ * libpp/format_output.h:
+ * libpp/format_output.cpp:
+ * pp/opreport.cpp: rename outsymbflags to format_flags
+
+2003-05-11 John Levon <levon@movementarian.org>
+
+ * profile_container.h:
+ * profile_container.cpp:
+ * opannotate.cpp: clean up select_filename() in a
+ similar fashion
+
+2003-05-11 John Levon <levon@movementarian.org>
+
+ * libpp/profile_container.h:
+ * libpp/profile_container.cpp:
+ * pp/opreport.cpp:
+ * pp/opannotate.cpp:
+ * pp/opgprof.cpp: another select_symbols() API cleanup
+
+2003-05-11 John Levon <levon@movementarian.org>
+
+ * pp/opgprof.cpp: use select_symbols so we can
+ handle --threshold
+
+2003-05-11 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opannotate.cpp: use threshold for source output
+
+2003-05-11 John Levon <levon@movementarian.org>
+
+ * pp/common_option.h:
+ * pp/common_option.cpp:
+ * pp/opannotate_options.cpp:
+ * pp/opreport_options.cpp: make --threshold
+ be a common option.
+
+2003-05-11 John Levon <levon@movementarian.org>
+
+ * pp/profile_container.h:
+ * pp/profile_container.cpp:
+ * pp/opannotate.cpp:
+ * pp/opreport.cpp: clean up select_symbols
+ interface
+
+2003-05-11 John Levon <levon@movementarian.org>
+
+ * pp/opreport.cpp: make --threshold work for
+ image summaries too
+
+2003-05-11 John Levon <levon@movementarian.org>
+
+ * pp/opreport_options.cpp: fix --threshold
+ description to match reality
+
+2003-05-11 John Levon <levon@movementarian.org>
+
+ * libpp/partition_files.h:
+ * libpp/partition_files.cpp:
+ * pp/opannotate_options.cpp:
+ * pp/opgprof_options.cpp:
+ * pp/opreport.cpp:
+ * pp/opreport_options.cpp: rename merge_by members
+
+2003-05-11 John Levon <levon@movementarian.org>
+
+ * pp/opreport.cpp: add some logic to not output
+ duplicate lines for dep images when we've already
+ shown all the possible details in the main image summary
+
+2003-05-11 John Levon <levon@movementarian.org>
+
+ * pp/common_option.h: use std::
+
+2003-05-11 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opreport_options.cpp: move handle_threshold()
+ * pp/common_option.h:
+ * pp/common_option.cpp: here
+ * pp/opannotate_options.h:
+ * pp/opannotate_options.cpp:
+ * pp/opannotate.cpp: handle --threshold
+
+2003-05-10 John Levon <levon@movementarian.org>
+
+ * libop/op_mangle.h:
+ * libop/op_mangle.c: use a temp struct for
+ passing the mangle parameters with a set of
+ flags.
+
+ * dae/opd_sample_files.c:
+ * daemon/opd_sample_files.c: use it
+
+2003-05-10 John Levon <levon@movementarian.org>
+
+ * Makefile.am:
+ * HACKING:
+ * libop++/:
+ * pp/Makefile.am:
+ * libpp/Makefile.am:
+ * libpp/op_header.h:
+ * libpp/op_header.cpp: remove libop++ after
+ moving op_header into libpp
+
+2003-05-10 John Levon <levon@movementarian.org>
+
+ * libop++/op_header.cpp: make CPU info take up
+ one line not two
+
+2003-05-10 John Levon <levon@movementarian.org>
+
+ * libop++/Makefile.am:
+ * libop++/op_header.cpp:
+ * libop++/op_print_event.h:
+ * libop++/op_print_event.cpp: remove op_print_event
+ files, making it a function local to op_header.cpp
+
+2003-05-10 John Levon <levon@movementarian.org>
+
+ * libop++/op_header.h:
+ * libop++/op_header.cpp: make output_header() be
+ an operator<<
+
+ * pp/opannotate.cpp:
+ * pp/opreport.cpp: changes from the above
+
+ * libpp/profile.h: small cleanup
+
+2003-05-10 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/string_manip.h:
+ * libutil++/string_manip.cpp: replace format_percent() by
+ format_double()
+
+ * libpp/format_output.cpp:
+ * pp/opannotate.cpp:
+ * pp/opreport.cpp: use format_double()
+
+2003-05-09 John Levon <levon@movementarian.org>
+
+ * libpp/opp_symbol.h: app name, image name should
+ be in symbol not in file_location
+
+ * libpp/format_output.cpp:
+ * libpp/profile_container.h:
+ * libpp/profile_container.cpp:
+ * libpp/symbol_container.cpp:
+ * libpp/symbol_functors.cpp: changes from above
+
+2003-05-09 John Levon <levon@movementarian.org>
+
+ * libpp/format_output.h:
+ * libpp/format_output.cpp: vma_64 doesn't need
+ to be in field_datum. make one output() private
+
+2003-05-09 John Levon <levon@movementarian.org>
+
+ * libpp/format_output.h:
+ * libpp/format_output.cpp: pass a symbol ref
+ not name down into the formatters
+
+2003-05-09 John Levon <levon@movementarian.org>
+
+ * libutil++/string_manip.h:
+ * libutil++/string_manip.cpp: sample_filename() is unused
+
+2003-05-09 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libop++/op_header.h:
+ * libop++/op_header.cpp: read_header() new
+ * libop++/Makefile.in: we depend on libdb
+
+ * pp/opannotate.cpp:
+ * pp/opreport.cpp: better way to get sample file header
+
+2003-05-09 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/format_output.cpp: remove redundant map formater
+ * pp/opannotate.cpp: spurious cout
+
+2003-05-08 John Levon <levon@movementarian.org>
+
+ * pp/opreport.cpp:
+ * pp/opreport_options.cpp:
+ * pp/opreport_options.h: clean up cout stuff as
+ suggested by Phil
+
+2003-05-08 John Levon <levon@movementarian.org>
+
+ * libpp/profile_spec.h:
+ * libpp/profile_spec.c: rename the set_p variables,
+ remove pointless is_empty() function
+
+ * pp/opreport.cpp: split collation and output into
+ two separate functions. Rename the temporary structures
+ so it's hopefully a bit more obvious what's happening.
+ Add sourcedocs.
+
+2003-05-08 John Levon <levon@movementarian.org>
+
+ * pp/opreport_options.h:
+ * pp/opreport_options.cpp: add options::cout,
+ --output-file option
+
+ * pp/opreport.cpp: use options::cout
+
+2003-05-08 John Levon <levon@movementarian.org>
+
+ * pp/format_output.cpp: fix cumulative column widths
+
+2003-05-08 John Levon <levon@movementarian.org>
+
+ * opreport_options.h: add accumulated
+
+ * opreport.cpp: handle --accumulated
+
+2003-05-08 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/symbol_container.cpp: minor tidy
+
+ * libpp/profile.h:
+ * libpp/profile.cpp: allow to cumulate sample file
+ * libpp/profile_container.h:
+ * libpp/profile_container.cpp: remove free function add_samples()
+
+ * pp/annotate.cpp:
+ * pp/opgprof.cpp:
+ * pp/opreport.cpp: when possible cumulate samples into a profile_t
+ first before cumulating them in a profile_container
+
+2003-05-07 John Levon <levon@movementarian.org>
+
+ * pp/opannotate.cpp: small cleanup
+
+2003-05-07 John Levon <levon@movementarian.org>
+
+ * pp/opreport_options.cpp: remove unneeded include
+
+2003-05-07 John Levon <levon@movementarian.org>
+
+ * libpp/Makefile.am:
+ * libpp/parse_cmdline.h:
+ * libpp/parse_cmdline.cpp: rename to ...
+
+ * libpp/profile_spec.h:
+ * libpp/profile_spec.cpp: this. Make handle_nonoptions()
+ be a static factory create() method instead. Make
+ select_sample_filenames() be a member generate_file_list()
+ instead. Concomitant cleanups.
+
+ * libpp/filename_spec.h:
+ * pp/opannotate_options.cpp:
+ * pp/opgprof_options.cpp:
+ * pp/opreport_options.cpp: changes from above
+
+2003-05-07 John Levon <levon@movementarian.org>
+
+ * libpp/profile.cpp: fix stupid error in last commit
+
+2003-05-07 John Levon <levon@movementarian.org>
+
+ * libpp/profile.h:
+ * libpp/profile.cpp: remove sample_filename member,
+ bogus old spurious check, set_start_offset().
+
+ * libpp/profile_container.cpp:
+ * pp/opannotate.cpp:
+ * pp/opreport.cpp: changes from above
+
+2003-05-07 John Levon <levon@movementarian.org>
+
+ * libpp/derive_files.h:
+ * libpp/derive_files.cpp: rename files as ...
+
+ * libpp/locate_images.h:
+ * libpp/locate_images.cpp: this.
+
+ * libpp/Makefile.am:
+ * libpp/partition_files.h:
+ * pp/common_option.h:
+ * pp/opgprof.cpp:
+ * pp/opgprof_options.h:
+ * pp/opreport_options.h: changes from above
+
+2003-05-07 John Levon <levon@movementarian.org>
+
+ * libpp/derive_files.h:
+ * libpp/derive_files.cpp: rework into extra_images
+ class
+
+ * libpp/partition_files.h:
+ * libpp/partition_files.cpp:
+ * pp/common_option.h:
+ * pp/common_option.cpp:
+ * pp/opannotate.cpp:
+ * pp/opgprof.cpp:
+ * pp/opreport.cpp: use the above
+
+2003-05-07 John Levon <levon@movementarian.org>
+
+ * libpp/Makefile.am:
+ * session.h:
+ * session.cpp: remove session.{h,cpp}
+
+2003-05-07 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/oprofpp.cpp pp/oprofpp_options.cpp pp/oprofpp_options.h:
+ * pp/op_time.cpp pp/op_time_options.cpp pp/op_time_options.h:
+ * pp/op_to_source.cpp pp/op_to_source_options.cpp:
+ * pp/op_to_source_options.h pp/op_merge.cpp: removed files
+
+ * pp/Makefile.am: update
+
+2003-05-06 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opgprof.cpp: infamous typo
+
+ * pp/opannotate.cpp: output sample file header
+
+
+2003-05-06 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpop++/op_mangling.h:
+ * libpop++/op_mangling.cpp: removed file
+ * libop++/op_header.h:
+ * libop++/op_header.cpp: new file, misc function acting on sample
+ file header stolen from libpp/profile.(cpp|h)
+ * libop++/op_print_event.h: typo
+ * libop++/op_print_event.cpp: save/restore ostream state
+ * libop++/Makefile.am: update
+
+ * libop/op_sample_file.h: remove dead #define OPD_MANGLE_CHAR
+
+ * libpp/profile.h:
+ * libpp/profile.cpp: move some member function to free function in
+ libop++/op_header.(cpp|h)
+ * libpp/profile_container.cpp: minor call change
+
+ * libpp/Makefile.am: op_merge can't be compiled currently inhibit build
+
+ * libpp/opreport.cpp: output sample file header
+
+2003-05-06 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/path_filter.h: default param to empty string not "*"
+
+ * libpp/symbol_functors.h: remove dead code
+
+ * pp/opgprof.cpp: off by one in histsize calculation
+
+2003-05-04 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil/op_file.h:
+ * libutil/op_file.c: sanitize create_path()
+
+ * libutil++/path_filter.h: default ctor match all
+
+ * libpp/profile_container.h:
+ * libpp/profile_container.cpp:
+ * libpp/sample_container.h:
+ * libpp/sample_container.cpp:
+ * libpp/symbol_container.h:
+ * libpp/symbol_container.cpp: extend api to allow selecting symbol
+ restricted to one application, ditto for retrieving samples
+
+ * pp/opannotate_options.h:
+ * pp/opannotate_options.cpp:
+ * pp/opannotate.cpp: implement
+
+ * pp/opgprof_options.h:
+ * pp/opgprof_options.cpp:
+ * pp/opreport_options.h:
+ * pp/opreport_options.cpp: comment fix
+
+ * pp/opreport.cpp: update to match new profile_container api
+
+2003-05-03 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opreport.cpp: don't show dependent file if !--include-dependent
+
+2003-05-02 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/partition_files.h:
+ * libpp/partition_files.cpp: sort_by_image_name() new return a list
+ of sample filename sorted by bfd image name.
+ * libpp/profile_container.cpp: add_samples() don't build op_bfd object
+ used here but pass it as parameters
+
+ * pp/opgprof.cpp:
+ * pp/opreport.cpp: use the above change to avoid opening multiple time
+ a bfd object.
+
+ * pp/opannotate_options.cpp: add --(include|exclude)-symbols
+
+ * libpp/parse_cmdline.cpp:
+ * pp/opgprof_options.cpp:
+ * pp/opreport.cpp: make a distinction in error message between no
+ sample available and sample file available but no one was selected
+
+2003-05-01 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opannotate_options.h:
+ * pp/opannotate_options.cpp:
+ * pp/opdiff.cpp:
+ * pp/opdiff_options.h:
+ * pp/opdiff_options.cpp:
+ * pp/opgprof.cpp:
+ * pp/opgprof_options.h:
+ * pp/opgprof_options.cpp:
+ * pp/opreport.cpp:
+ * pp/opreport_options.h:
+ * pp/opreport_options.cpp: move common options handling ...
+ * pp/common_option.h:
+ * pp/common_option.cpp: here
+
+ * pp/opannotate.cpp: add options
+
+ * libpp/parse_cmdline.cpp: #include <iterator> ...
+
+2003-05-01 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/counter_util.h:
+ * libpp/counter_util.cpp: remove these files from cvs
+
+ * libpp/derive_files.h:
+ * libpp/derive_files.cpp: remove dead code derive_files() + typo
+
+ * libpp/parse_cmdline.cpp: select_sample_filename() throw if empty
+ session after filtering
+
+ * pp/common_option.cpp: catch invalid_argument, return failure on
+ catched exception
+
+2003-05-01 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/op_bfd.cpp: remove _init from excluded symbol
+ * libpp/profile_container.cpp: tidy
+
+ * pp/opgprof.cpp: fix capping samples
+
+2003-04-30 John Levon <levon@movementarian.org>
+
+ * pp/opgprof.cpp:
+ * pp/opgprof_options.cpp:
+ * libpp/profile.cpp: tiny cleanups, fix compile
+
+2003-04-30 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libdb/db_stat.c: minor improvement to stat, useful to track missed
+ sample by our tools.
+
+ * pp/op_report.cpp: move matching_sample_filename() to ...
+ * libpp/parse_cmdline.h:
+ * libpp/parse_cmdline.cpp: here renamed select_sample_filename()
+
+ * libpp/profile_container.h:
+ * libpp/profile_container.cpp: expose begin() / end() from
+ sample_container
+
+ * pp/common_option.h:
+ * pp/common_option.cpp: move option which was not really common to ..
+ * pp/opreport_options.h:
+ * pp/opreport_options.cpp: here
+ * pp/opannotate_options.h:
+ * pp/opannotate_options.cpp: and here
+
+ * pp/operport.cpp:
+ * pp/opannotate.cpp: better to return a value from main() ...
+
+ * pp/opgprof_options.h:
+ * pp/opgprof_options.cpp:
+ * pp/opgprof.cpp: implement opgprof
+
+2003-04-29 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/parse_cmdline.h:
+ * libpp/parse_cmdline.cpp: handle opreport /lib/libc-2.2.5.so, now
+ non tag, non option argument match either an image name or lib name
+
+2003-04-29 John Levon <levon@movementarian.org>
+
+ * libutil++/op_bfd.cpp: remove "static " inside anon namespace
+
+2003-04-28 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/format_output.h:
+ * libpp/format_output.cpp: need header tweaking
+
+ * pp/opannotate.cpp:
+ * pp/opgprof.cpp: minor tidy
+
+ * pp/opreport_options.h:
+ * pp/opreport_options.cpp:
+ * pp/opreport.cpp: handle -no-header and --image-path
+
+2003-04-28 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/glob_filter.cpp:
+ * libutil++/path_filter.cpp:
+ * libutil++/string_filter.cpp: #include <algorithm>
+
+2003-04-28 John Levon <levon@movementarian.org>
+
+ * libutil++/string_filter.cpp:
+ * libutil++/string_filter.h:
+ * libutil++/glob_filter.h:
+ * libutil++/glob_filter.cpp:
+ * libutil++/path_filter.h:
+ * libutil++/path_filter.cpp: use std::find[_if],
+ share some code
+
+2003-04-28 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/op_bfd.cpp: replace a loop by a std::copy()
+
+2003-04-28 John Levon <levon@movementarian.org>
+
+ * libutil++/op_bfd.h:
+ * libutil++/op_bfd.cpp: cleanup of last fix
+
+2003-04-28 John Levon <levon@movementarian.org>
+
+ * libutil++/op_bfd.h:
+ * libutil++/op_bfd.cpp: make symbol filtering
+ happen *after* adding of artificial symbol
+
+2003-04-28 John Levon <levon@movementarian.org>
+
+ * libutil++/string_filter.cpp:
+ * libutil++/glob_filter.cpp:
+ * libutil++/path_filter.cpp: match as true if
+ include_list is empty and not excluded
+
+ * libutil++/op_bfd.h:
+ * libutil++/op_bfd.cpp: use string_filter to
+ filter symbols
+
+ * libpp/profile_container.h:
+ * libpp/profile_container.cpp:
+ * pp/opreport_options.h:
+ * pp/opreport_options.cpp:
+ * pp/opreport.cpp: changes from using string_filter
+
+2003-04-28 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opreport.cpp: finish to remove use of split_sample_filename
+
+2003-04-28 John Levon <levon@movementarian.org>
+
+ * libutil++/filename_match.h:
+ * libutil++/filename_match.cpp: replace with ...
+
+ * libutil++/Makefile.am:
+ * libutil++/string_filter.h:
+ * libutil++/string_filter.cpp:
+ * libutil++/glob_filter.h:
+ * libutil++/glob_filter.cpp:
+ * libutil++/path_filter.h:
+ * libutil++/path_filter.cpp: .. split up variants
+ of the filters
+
+ * libpp/parse_cmdline.cpp: use glob_filter
+
+ * pp/op_to_source.cpp: use path_filter
+
+2003-04-28 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/partition_files.h:
+ * libpp/partition_files.cpp:
+ * libpp/split_sample_filename.h:
+ * libpp/split_sample_filename.cpp:
+ * pp/opreport.cpp: replace some use of std::string sample_filename
+ by a split_sample_filename struct
+
+2003-04-28 John Levon <levon@movementarian.org>
+
+ * libutil++/filename_match.h:
+ * libutil++/filename_match.cpp: use file-scope
+ not private static member function
+
+2003-04-27 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/format_output.h:
+ * libpp/format_output.cpp: remove all string based output format flag
+
+ * libpp/format_output.cpp: move options::demangle handling ...
+ * libregx/demangle_symbol.cpp: here
+
+ * libpp/profile_container.h:
+ * libpp/profile_container.cpp:
+ * pp/opreport_options.h:
+ * pp/opreport_options.cpp:
+ * pp/opreport.cpp: handle --include-symbols
+
+2003-04-27 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opreport_options.h:
+ * pp/opreport_options.cpp:
+ * pp/opreport.cpp: handle --threshold, remove --ignore-symbols
+
+2003-04-27 John Levon <levon@movementarian.org>
+
+ * libpp/<various>: minor spacing etc.
+
+2003-04-27 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/outsymbflag.h: remove osf_short_xxx variant
+ * libpp/format_output.h:
+ * libpp/format_output.cpp: replace osf_short_xxx by a boolean
+ * libpp/profile_container.cpp: update according
+
+ * pp/opreport_options.h: export short_filename option
+ * pp/opreport.cpp: use short_filename
+
+2003-04-27 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/symbol_functors.h: add less_symbol predicate
+ * libpp/symbol_functors.cpp: new file, less_symbol implementation
+ * libpp/Makefile.am: symbol_functors.cpp
+
+ * libpp/symbol_container.h:
+ * libpp/symbol_container.cpp: use a node based container for symbols
+ ensuring validity of symbol pointer over a symbol_container life time
+ * libpp/sample_container.h:
+ * libpp/sample_container.cpp: ditto as above for samples
+ * libpp/profile_container.h:
+ * libpp/profile_container.cpp: use this new api to merge symbols
+ and sample.
+
+ * libpp/format_output.h:
+ * libpp/format_output.cpp: use new api to iterate over sample by symbol
+
+ * pp/opreport.cpp: detailed output
+
+
+2003-04-27 John Levon <levon@movementarian.org>
+
+ * pp/opreport.cpp: make opreport -l put largest results
+ at the top like opreport does
+
+2003-04-26 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/profile_container.h: comment
+
+ * pp/opreport_options.h: more options export
+ * pp/opreport.cpp: implement -l. Doesn't works correctly: --merge=lib
+
+2003-04-25 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opreport_options.h: export global_percent
+ * pp/opreport.cpp: finish to implement op_time like behavior. Remains
+ to implement op_time -l
+
+2003-04-25 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/partition_files.cpp: fix a crash when profile spec is empty
+
+ * pp/opreport_options.cpp: bail out if no samples files are found
+
+2003-04-25 John Levon <levon@movementarian.org>
+
+ * pp/opreport_options.cpp: --hide-dependent should have 'h' as
+ short form. Add a FIXME for a crash
+
+2003-04-25 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/partition_files.cpp: thinko in sample filename partition
+
+ * pp/opreport_options.h: export more options
+ * pp/opreport_options.cpp: add --hide-dependent, change --merge to not
+ default to all
+ * pp/opreport.cpp: handle --hide-dependent --include-dependent and
+ --merge=lib. Code is ugly, tidy incoming
+
+2003-04-25 John Levon <levon@movementarian.org>
+
+ * libpp/format_output.cpp:
+ * libpp/format_output.h:
+ * libpp/outsymbflag.h: "immutable" not "imutable"
+
+ * libpp/partition_files.cpp: include <iterator> to compile
+
+2003-04-24 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/partition_files.h: typo
+ * libpp/profile.cpp: difficult to get right result with a random value
+ in profile::start_offset
+
+ * pp/opreport_options.h: export options::reverse_sort
+ * pp/opreport_options.cpp: bail out if we get multiple counter
+
+ * pp/opreport.cpp: raw output result for application (not symbol)
+ output.
+
+2003-04-24 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/filename_spec.h:
+ * libpp/filename_spec.cpp:
+ * libpp/parse_cmdline.h:
+ * libpp/parse_cmdline.cpp:
+ * libpp/split_sample_filename.h:
+ * libpp/split_sample_filename.cpp: s/unit_mask/unitmask
+
+ * libpp/merge_spec.cpp:
+ * libpp/merge_spec.h: rename to
+ * libpp/partition_files.h:
+ * libpp/partition_files.cpp: here. Add and merge_option.
+ partition_files is now a class.
+ * pp/opreport_options.h:
+ * pp/opreport_options.cpp:
+ * pp/opreport.cpp: update according to the above. Add a roughly support
+ to count samples for plain op_time opreport like
+
+2003-04-24 John Levon <levon@movementarian.org>
+
+ * libpp/profile_container.h:
+ * libpp/profile_container.cpp: chop off the _t of the class name
+
+ * libpp/format_output.cpp:
+ * libpp/format_output.h:
+ * libpp/symbol_container.cpp:
+ * libpp/symbol_container.h:
+ * pp/op_time.cpp:
+ * pp/op_to_source.cpp:
+ * pp/oprofpp.cpp: changes from the above
+
+2003-04-24 John Levon <levon@movementarian.org>
+
+ * libpp/profile_container.h:
+ * libpp/profile_container.cpp: pedantry for sample_container
+ indices.
+
+ * libpp/sample_container.h:
+ * libpp/sample_container.cpp: various cleanups and docs. Add
+ and use size_type.
+
+ * libpp/symbol_container.h:
+ * libpp/symbol_container.cpp: renamings. Add and use size_type.
+
+2003-04-24 John Levon <levon@movementarian.org>
+
+ * libpp/symbol_container.h:
+ * libpp/symbol_container.cpp: remove unused operator[].
+ Add some docs. Some small cleanups
+
+2003-04-24 John Levon <levon@movementarian.org>
+
+ * libpp/symbol_container_imp.h:
+ * libpp/symbol_container_imp.cpp:
+ * libpp/sample_container_imp.h:
+ * libpp/sample_container_imp.cpp: These classes weren't using
+ the pimpl idiom, so the _imp was spurious. Remove that as well
+ as removing the _t from the names, and rename to ...
+
+ * libpp/symbol_container.h:
+ * libpp/symbol_container.cpp:
+ * libpp/sample_container.h:
+ * libpp/sample_container.cpp: ...files moved from the above with
+ new names.
+
+2003-04-23 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/generic_spec.h: minor formating tweak
+
+ * libpp/parse_cmdline.h:
+ * libpp/parse_cmdline.cpp: handle_non_options(): return parse_cmdline
+ by value
+
+ * libpp/merge_spec.h:
+ * libpp/merge_spec.cpp: new files: partition list of samples filename
+ according to merge options.
+ * libpp/Makefile.am: update
+
+ * pp/opreport_options.cpp: more options handling, use partition_files()
+
+2003-04-22 John Levon <levon@movementarian.org>
+
+ * pp/opreport_options.cpp: compile fix
+
+2003-04-21 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/filename_match.h:
+ * libutil++/filename_match.cpp: add strict_match()
+
+ * libutil++/generic_spec.cpp: generic_spec<string>::set() was not
+ setting is_all member leading to bad matching
+
+ * libpp/filename_spec.cpp: minor tidy
+
+ * libpp/parse_cmdline.h:
+ * libpp/parse_cmdline.cpp: fix match()
+
+ * libpp/split_sample_filename.h:
+ * libpp/split_sample_filename.cpp: handle sample file base directory
+
+ * libop++/op_print_event.h:
+ * libop++/op_print_event.cpp:
+ * libpp/format_output.h:
+ * libpp/format_output.cpp:
+ * libpp/opp_symbol.h:
+ * libpp/profile.h:
+ * libpp/profile.cpp:
+ * libpp/profile_container.h:
+ * libpp/profile_container.cpp:
+ * libpp/sample_container_imp.h:
+ * libpp/sample_container_imp.cpp:
+ * libpp/symbol_container_imp.h:
+ * libpp/symbol_container_imp.cpp:
+ * libpp/symbol_functors.h: remove all use of counter number
+
+ * libpp/counter_array.h:
+ * libpp/counter_array.cpp:
+ * libpp/counter_profile.h:
+ * libpp/counter_profile.cpp: no longer used, move some bits to
+ libpp/profile.(h|cpp) and remove these files.
+ * libpp/Makefile.am: update according
+
+ * pp/op_merge.cpp: use profile_t not counter_profile_t
+ * pp/makefile.am: correct lib for op_merge
+
+ * pp/opreport_options.cpp: more options handling
+
+2003-04-19 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libopt++/popt_options.cpp: don't show help_str with --usage
+ * libpp/format_output.cpp: typo
+ * libutil/op_file.c: create dir with 755 not 700
+ * pp/common_option.cpp: source formating
+
+ * libpp/parse_cmdline.h:
+ * libpp/parse_cmdline.cpp: handle_non_options() new
+ * pp/opreport_options.cpp: handle more options
+
+ * pp/opsummary.cpp:
+ * pp/opsummary_options.h:
+ * pp/opsummary_options.cpp: remove, opreport should do its job.
+ * pp/Makefile.am: update
+
+2003-04-18 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libopt++/popt_options.cpp: allow "no-" prefix to long option name
+ implicitly specify the value must be negated
+ * libopt++/popt_options.cpp: update doxygen documentation
+
+ * libpp/format_output.h: missing #include
+ * libpp/format_output.cpp: space + minor change
+
+ * pp/opannotate_options.h:
+ * pp/opannotate_options.cpp:
+ * pp/opdiff_options.h:
+ * pp/opdiff_options.cpp:
+ * pp/opgprof_options.h:
+ * pp/opgprof_options.cpp:
+ * pp/opreport_options.h:
+ * pp/opreport_options.cpp:
+ * pp/opsummary_options.h:
+ * pp/opsummary_options.cpp: new skeleton file
+
+ * pp/opannotate.cpp:
+ * pp/opdiff.cpp:
+ * pp/opgprof.cpp:
+ * pp/opreport.cpp:
+ * pp/opsummary.cpp: update to handle options
+
+ * pp/common_option.cpp: follow more closely pp_interface
+
+ * pp/opsummary_options.cpp: start to handle opsummary option
+
+ * pp/Makefile.am: update
+
+2003-04-17 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/format_output.h:
+ * libpp/format_output.cpp:
+ * libpp/outsymbflag.h:
+ * libpp/profile_container.h:
+ * libpp/profile_container.cpp: osf_header/osf_details are no longer
+ flags but separate boolean.
+
+2003-04-17 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/opd_kernel.c:
+ * daemon/opd_kernel.c: remove leading '/' on module name fixing 2.5
+ module not under {kern} and similar case for "no-vmlinux" with 2.4/2.5
+
+ * libutil/op_file.c: tiny tidy
+
+2003-04-17 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libop/op_mangle.c: app_name and image was reversed, {dep} was missing
+
+2003-04-17 John Levon <levon@movementarian.org>
+
+ * libpp/filename_spec.h:
+ * libutil++/comma_list.h: compile fixes
+
+2003-04-17 Philippe Elie <phil.el@wanadoo.fr>
+
+ * utils/opcontrol: better --reset handling
+
+2003-04-16 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae works, daemon compiles but not tested.
+
+ * libop/op_config.h:
+ * libpp/op_session.h:
+ * libpp/session.cpp:
+ * pp/op_merge: handle new path to samples files.
+
+ * libutil++/file_manip.h:
+ * libutil++/file_manip.cpp: move create_dir(), create_path() ...
+ * libutil/op_file.h:
+ * libutil/op_file.c: here. Remove op_move_regular_file()
+
+ * daemon/opd_image.c:
+ * daemon/opd_sample_files.h:
+ * daemon/opd_sample_files.c:
+ * dae/opd_image.c:
+ * dae/opd_sample_files.h:
+ * dae/opd_sample_files.c: use new filename scheme
+
+ * daemon/oprofiled.c:
+ * dae/oprofiled.c: remove samples files backup stuff
+
+ * libop/op_mangle.h:
+ * libop/op_mangle.c: ugly modification to handle new samples filename
+
+ * utils/opcontrol: handle new samples files path, --save and --reset
+ are working too.
+
+ * gui/oprof_start_util.cpp: use new create_path() API
+
+2003-04-16 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/common_option.cpp:
+ * pp/common_option.h:
+ * libregex/demangle_symbol.cpp: rename demangle_and_shrink to
+ smart_demangle
+
+2003-04-16 Philippe Elie <phil.el@wanadoo.fr>
+
+ * starting branch pp-interface-branch
+
+ * Makefile.am:
+ * configure.in: handle new sub dir libpp
+
+ * libutil++/comma_list.h: new file handling of comma separated list of
+ items.
+ * libutil++/generic_spec.cpp:
+ * libutil++/generic_spec.h: new file
+ * libutil++/Makefile.am: handle new file
+
+ * pp/counter_array.*:
+ * pp/counter_profile.*:
+ * pp/counter_util.*:
+ * pp/derive_files.*:
+ * pp/format_output.*:
+ * pp/opp_symbol.h:
+ * pp/outsymbflag.h:
+ * pp/profile.*:
+ * pp/profile_container.*:
+ * pp/sample_container_imp.*:
+ * pp/session.*:
+ * pp/symbol_container_imp.*:
+ * pp/symbol_functors.*: move to
+
+ * libpp/*: here
+ * libpp/filename_spec.cpp:
+ * libpp/filename_spec.h: new file handling of pp sample filename
+ * libpp/parse_cmdline.cpp:
+ * libpp/parse_cmdline.h: new file, handling of command line tag:value
+ * libpp/Makefile.am: new file build libpp.a
+
+ * pp/common_option.h:
+ * pp/common_option.cpp: common option to pp tools. Implement common
+ entry point to pp tools.
+ * pp/opannotate.cpp:
+ * pp/opdiff.cpp:
+ * pp/opgprof.cpp:
+ * pp/opreport.cpp:
+ * pp/opsummary.cpp: skeleton file for all pp tools.
+ * pp/Makefile.am: remove old pp tools, add the news.
+
+2003-04-28 Alex Tsariounov <alext@fc.hp.com>
+
+ * module/ia64/op_pmu.c: fix compile
+
+2003-04-24 Philippe Elie <phil.el@wanadoo.fr>
+
+ * module/compat22.h: add cpuid_edx when linux version < 2.2.21
+
+2003-04-24 Dave Jones <davej@codemonkey.org.uk>
+
+ * events/x86-64.hammer.events:
+ * events/x86-64.hammer.unit_masks: typo fixes from AMD.
+ * module/x86/cpu_type.c: Check for APIC on Athlon before enabling it.
+
+2003-04-15 Philippe Elie <phil.el@wanadoo.fr>
+
+ * events/i386-ht.events: all events allow only one counter, remove
+ three events due to ESCR restriction.
+ * events/i386.events: add some comments.
+
+ * module/x86/op_model_p4.c: synch with linux 2.5 mainline
+ - except events CTR_BPU_0 all virtual counter was not working.
+ - Prevents a segfault when using incorrect counter number.
+ - ESCR event select is 6 bits length not 5.
+ - Don't fail silently in p4_setup_ctrs().
+ * module/x86/op_msr.h: match name used in linux.
+
+2003-04-15 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.1.in:
+ * doc/oprofile.xml: small english fixes
+
+2003-04-14 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/opd_kernel.c:
+ * dae/opd_proc.c:
+ * dae/oprofiled.c:
+ * utils/opcontrol:
+ * doc/oprofile.1.in:
+ * doc/oprofile.xml: handle --no-vmlinux
+
+ * daemon/opd_kernel.c: use no-vmlinux not /no-vmlinux when user
+ specify --no-vmlinux
+
+2003-04-08 John Levon <levon@movementarian.org>
+
+ * HACKING: describe what happens with oprofile-www
+
+2003-04-08 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/op_bfd.cpp: check for #717720 and direct user to
+ FAQ if detected. Note than we don't detect all symptom of this bug.
+
+2003-04-08 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/op_exception.h: op_runtime_error is no longer abstract
+
+ * libregex/op_regex.h: comment and tidy
+ * libregex/op_regex.cpp: tidy
+
+2003-04-07 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/op_to_source.cpp: make each line be prefixed with the samples
+ counts. It was too hard to find samples inside previous format.
+
+2003-04-07 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/string_manip.cpp: work around for gcc 2.95
+ * p/op_to_source.cpp: minor cleanup
+
+2003-04-07 John Levon <levon@movementarian.org>
+
+ * pp/op_to_source.cpp: cheat a bit to get
+ better indentation on the default setup, by
+ widening counter width to 7.
+
+2003-04-07 John Levon <levon@movementarian.org>
+
+ * pp/op_to_source.cpp: append symbol summary
+ annotations separate from the prolog samples on
+ the same line.
+
+2003-04-07 John Levon <levon@movementarian.org>
+
+ * pp/op_to_source.cpp: only output line 0 annotation
+ if samples found there.
+
+2003-04-07 John Levon <levon@movementarian.org>
+
+ * utils/opcontrol: make sure --ctrX-event=none gets noticed
+
+2003-04-06 John Levon <levon@movementarian.org>
+
+ * libutil++/string_manip.h:
+ * libutil++/string_manip.cpp: remove ws_prefix(). Add
+ format_percent().
+
+ * pp/op_to_source.cpp: make each line be prefixed with
+ the sample counts, instead of on a line above, to preserve
+ line numbering.
+
+2003-04-06 John Levon <levon@movementarian.org>
+
+ * pp/op_to_source.cpp: some renamings for clarity
+
+2003-04-06 John Levon <levon@movementarian.org>
+
+ * pp/op_to_source.cpp: move extract_blank_at_begin() to ...
+
+ * libutil++/string_manip.cpp: ... here, and rename as
+ ws_prefix().
+
+2003-04-06 John Levon <levon@movementarian.org>
+
+ * pp/op_to_source.cpp: prefix comment lines.
+ Output the general footer on each separate file.
+ Output the info at the bottom when outputting
+ separate files (towards maintaining line numbering).
+
+2003-04-06 John Levon <levon@movementarian.org>
+
+ * pp/op_to_source.cpp: construct a file-scope
+ cmdline string, instead of passing it around.
+
+2003-04-06 John Levon <levon@movementarian.org>
+
+ * libregex/op_regexp.cpp: re-arrange a bit
+
+2003-04-06 John Levon <levon@movementarian.org>
+
+ * configure.in:
+ * all Makefile.am: don't blindly set $LIBS, use
+ explicit mention of which libs are needed.
+
+ * dae/Makefile.am:
+ * daemon/Makefile.am: only link with C++ if needed.
+
+2003-04-05 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libop/op_config_24.h:
+ * module/oprofile.c:
+ * module/oprofile.c: make watermark size proportional to buffer size.
+
+2003-04-05 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libop/op_events.h:
+ * libop/op_events.c: re-add op_min_count();
+
+ * dae/oprofiled.c:
+ * daemon/oprofiled.c: use op_min_count() fixing #715923
+
+2003-04-01 John Levon <levon@movementarian.org>
+
+ * libdb/Makefile.am: fix make dist
+
+ * daemon/opd_cookie.h: add SPARC syscall number.
+ The system call function is OK for sparc/sparc64
+
+2003-03-31 Will Cohen <wcohen@redhat.com>
+
+ * libdb/odb_hash.h: Renamed db_hash.h.
+
+ * dae/Makefile.am:
+ * dae/opd_image.c:
+ * dae/opd_image.h:
+ * dae/opd_proc.c:
+ * dae/opd_sample_files.c:
+ * daemon/Makefile.am:
+ * daemon/opd_image.c:
+ * daemon/opd_image.h:
+ * daemon/opd_sample_files.c:
+ * libabi/Makefile.am:
+ * libabi/abi.cpp:
+ * libabi/abi_test.cpp:
+ * libabi/op_import.cpp:
+ * libdb/Makefile.am:
+ * libdb/db_debug.c:
+ * libdb/db_hash.h:
+ * libdb/db_insert.c:
+ * libdb/db_manage.c:
+ * libdb/db_stat.c:
+ * libdb/db_test.c:
+ * libdb/db_travel.c:
+ * pp/Makefile.am:
+ * pp/counter_profile.cpp:
+ * pp/counter_profile.h:
+ * pp/op_merge.cpp: Change names to avoid libdb.a name conflicts.
+
+2003-03-30 John Levon <levon@movementarian.org>
+
+ * configure.in: bump to 0.6cvs
+
+ * doc/oprofile.xml: fix id. Add java etc. mention
+
+ * utils/Makefile.am:
+ * utils/op_start:
+ * utils/op_start_25:
+ * utils/op_stop:
+ * utils/op_stop_25:
+ * utils/op_dump:
+ * utils/op_dump_25:
+ * utils/op_session: finally remove the back compat crap
+
+ * HACKING: add release-notes policy
+
+2003-03-30 John Levon <levon@movementarian.org>
+
+ * configure.in: bump to 0.5.2
+
+2003-03-30 John Levon <levon@movementarian.org>
+
+ * Makefile.am: remove op_arch.h for ia64
+
+2003-03-27 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml: several more examples and fixes
+
+2003-03-26 John Levon <levon@movementarian.org>
+
+ From a patch by Bryan Rittmeyer.
+
+ * module/oprofile.c:
+ * module/oprofile.h: push "irq_enabled" test
+ into arch code, don't pass struct pt_regs.
+
+ * module/x86/op_arch.h: cleanups
+
+ * module/x86/op_model_athlon.c:
+ * module/x86/op_model_ppro.c:
+ * module/x86/op_model_p4.c:
+ * module/x86/op_rtc.c: changes from above
+
+ * module/ia64/op_arch.h: remove
+ * module/ia64/op_pmu.c: change from above
+
+2003-03-24 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml: document prologues, and inline functions
+
+2003-03-24 Will Cohen <wcohen@redhat.com>
+
+ * libutil/op_fileio.c (op_get_line): Use lower cost getc().
+
+2003-03-24 John Levon <levon@movementarian.org>
+
+ * m4/configmodule.m4: fix quoting problem for awk
+
+2003-03-23 John Levon <levon@movementarian.org>
+
+ * configure.in:
+ * m4/: move lots of stuff into separate .m4 files
+
+ * m4/typedef.m4: improve configure message
+
+2003-03-23 John Levon <levon@movementarian.org>
+
+ * configure.in:
+ * m4/Makefile.am:
+ * m4/copyifchange.m4:
+ * m4/docbook.m4:
+ * m4/kerneloption.m4:
+ * m4/kernelversion.m4:
+ * m4/resultyn.m4: move configure.in macros to m4/
+
+2003-03-23 John Levon <levon@movementarian.org>
+
+ * m4/ChangeLog: add comment
+
+ * m4/typedef.m4: can't use AC_LANG_PUSH/POP
+
+2003-03-23 Philippe Elie <phil.el@wanadoo.fr>
+
+ * TODO: update
+
+ * m4/Makefile.am:
+ * m4/typedef.m4: new file to get underlined type for a typedef.
+
+ * configure.in: get at configure time the real underlined type
+ for size_t and ptrdiff_t
+
+ * libregex/stl.pat: move to ...
+ * libregex/stl.pat.in: here. Use @SIZE_T_TYPE@ and @PTRDIFF_T_TYPE@
+ * libregex/Makefile.am: update according
+ * libregex/.cvsignore: ignore stl.pat
+
+2003-03-22 Philippe Elie <phil.el@wanadoo.fr>
+
+ * utils/opcontrol: use $OP_HELP not op_help
+ * utils/op_help.c: remove short option for --get-cpu-frequency
+
+2003-03-22 Philippe Elie <phil.el@wanadoo.fr>
+
+ * TODO: update
+
+ * m4: new directory
+ * m4/.cvsignore: new
+
+ * acinclude.m4: move to
+ * m4/qt.m4: here
+ * m4/Makefile.am: new for EXTRA_DIST = all our .m4
+ * Makefile.am:
+ * configure.in:
+ * autogen.sh: handle m4 subdir, add -I m4 to aclocal flags
+
+2003-03-22 Philippe Elie <phil.el@wanadoo.fr>
+
+ Suggested by John
+
+ * libutil/op_cpufreq.c: typo in comment
+
+ * utils/op_help.c: add --get-cpu-frequency, intentionnaly not
+ documented.
+ * utils/opcontrol: use op_help --get-cpu-frequency and remove
+ ugly shell script doing the same thing.
+
+2003-03-22 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil/op_cpufreq.h:
+ * libutil/op_cpufreq.c: new file exporting op_cpu_frequency()
+ * libutil/Makefile.am: update according
+
+ * utils/opcontrol: handle other arch
+
+ * gui/oprof_start_util.h:
+ * gui/oprof_start_util.cpp: remove get_cpu_speed()
+ * gui/oprof_start.h:
+ * gui/oprof_start.cpp: and use instead op_cpu_frequency()
+
+ * daemon/oprofiled.c:
+ * dae/oprofiled.c: replace --cpu-speed option by a call to
+ op_cpu_frequencey()
+
+2003-03-20 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml: doc some 2.5 module stuff
+
+2003-03-20 John Levon <levon@movementarian.org>
+
+ * utils/opcontrol: fix opcontrol --dump to do something
+
+ * daemon/opd_image.c: give a printf when reading the buffer.
+
+2003-03-19 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/op_bfd.cpp: correct get_vma_range()
+
+ * pp/oprofpp.cpp: do_dump_gprof() this time it's right!
+
+2003-03-18 John Levon <levon@movementarian.org>
+
+ * pp/profile.cpp: improve mtime warning for 2.5 modules
+
+2003-03-18 John Levon <levon@movementarian.org>
+
+ * pp/derive_files.cpp: some more 2.5 modules derivation fixes
+
+2003-03-18 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/derive_files.cpp: fix handling of 2.5 module name
+
+2003-03-18 John Levon <levon@movementarian.org>
+
+ * daemon/opd_image.c:
+ * libop/op_interface_25.h: rename to MODULE_LOADED_CODE
+
+2003-03-18 Philippe Elie <phil.el@wanadoo.fr>
+
+ * TODO: update
+
+ * pp/derive_files.cpp: special to retrieve 2.5 module
+
+2003-03-18 Philippe Elie <phil.el@wanadoo.fr>
+
+ * TODO: update
+
+ * pp/symbol_container_imp.h:
+ * pp/symbol_container_imp.cpp:
+ * pp/profile_container.h:
+ * pp/profile_container.cpp: find(string symbol_name) return a vector
+ of symbol rather a a single symbol
+ * pp/oprofpp.cpp: use above change so oprofpp -s will show all
+ symbol with the same name.
+
+ * pp/symbol_functors.h: remove unused functors equal_symbol_by_name
+
+2003-03-17 Philippe Elie <phil.el@wanadoo.fr>
+
+ * TODO: update
+
+ * libutil/op_fileio.h:
+ * libutil/op_fileio.c: op_write_u64() new
+ * libutil/op_types.h: continue our silly typedef: add u64
+
+ * libutil++/op_bfd.h:
+ * libutil++/op_bfd.cpp: op_bfd::arch_bits_per_address() new allowing
+ to get, on a per-binary basis, the vma size.
+
+ * pp/oprofpp.cpp: fix 64 bits arch gprof output. Fix multiplier and
+ get the multiplier of gprof file at runtime. Fix a very old bug
+ where we credit the samples to previous gprof bin having the effect
+ than sample at start of function was credited to the previous
+ function
+
+2003-03-17 John Levon <levon@movementarian.org>
+
+ * daemon/opd_kernel.c:
+ * daemon/opd_kernel.h:
+ * daemon/opd_image.c:
+ * daemon/oprofiled.c: don't try to reread the module
+ list on a failed EIP match. We must have the module load
+ notification instead.
+
+2003-03-17 John Levon <levon@movementarian.org>
+
+ * daemon/opd_kernel.c: fix module accounting. Remove
+ quick-drop code that can't work.
+
+ * doc/oprofile.1.in:
+ * doc/oprofile.xml: english tweaks
+
+2003-03-17 Philippe Elie <phil.el@wanadoo.fr>
+
+ * TODO: update
+
+ * doc/oprofile.1.in:
+ * doc/oprofile.xml: remove documentation about -P, update doc about -p
+
+ * pp/derive_files.h:
+ * pp/derive_files.cpp: check_image_name(), add_to_alternate_filename()
+ functions moved from op_time.cpp
+
+ * pp/op_time_options.h:
+ * pp/op_time_options.cpp:
+ * pp/op_time.cpp: remove -P option, minor cleanup
+
+ * pp/oprofpp_options.h:
+ * pp/oprofpp_options.cpp:
+ * pp/oprofpp.cpp: add -p option, minor cleanup
+
+ * pp/op_to_source.cpp: minor cleanup
+
+2003-03-16 Philippe Elie <phil.el@wanadoo.fr>
+
+ * utils/opcontrol: check return code for --ctr??-event=none
+
+2003-03-16 Philippe Elie <phil.el@wanadoo.fr>
+
+ * gui/oprof_start.cpp: check for --separate=xxxx in the right order.
+ Old code do: if user set separate=library and separate=kernel only
+ separate=library was taken by opcontrol
+
+2003-03-16 Philippe Elie <phil.el@wanadoo.fr>
+
+ * configure.in: typo
+
+2003-03-16 John Levon <levon@movementarian.org>
+
+ * configure.in: more docbook macro fixes
+
+2003-03-15 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil/op_libiberty.h: cut&paste typo breaking compilation on box
+ w/o libiberty.h
+
+ * daemon/opd_image.c: remove bogus fprintf. compilation was broken
+ on alpha.
+
+ * configure.in: xsltproc checking fix, was always accepted even
+ on box where xsltproc is not installed
+
+2003-03-15 Philippe Elie <phil.el@wanadoo.fr>
+
+ * TODO: update
+
+ * Makefile.am: add ChangeLog-2002 in dist files
+ * all Makefile.am: put one item by line for most xxxx = blah
+ * doc/CodingStyle: rationale for the above change
+
+2003-03-15 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libop/op_events.c: minor cleanup
+
+2003-03-15 Dave Jones <davej@codemonkey.org.uk>
+
+ * module/x86/op_nmi.c: Remove stale debug code from yesterdays commit.
+
+2003-03-15 Philippe Elie <phil.el@wanadoo.fr>
+
+ * configure.in: add checking for existence of xmemdup()
+
+ * libutil/Makefile.am:
+ * libutil/op_string.h:
+ * libutil/op_string.c: new, a few C string handling function
+
+ * libutil/op_libiberty.h:
+ * libutil/op_libiberty.c: xmemdup() new.
+
+ * libop/op_events.h:
+ * libop/op_events.c: tidy parser. Add op_free_events(). Fix minor
+ buglet.
+
+ * dae/oprofiled.c:
+ * daemon/oprofiled.c: fix memleak from parsing events files
+
+ * gui/Makefile.am:
+ * pp/Makefile.am: fix lib ordering, now libop depend on libutil
+
+ * utils/op_help.c: error message if invalid cpu type. Fix op_help
+ when using timer interrupt.
+
+2003-03-14 Andi Kleen <ak@suse.de>
+
+ * module/x86/op_nmi.c: Fix another possible race condition.
+
+2003-03-14 Philippe Elie <phil.el@wanadoo.fr>
+
+ * TODO: update
+
+ * libregex/stl.pat: support for rb tree, set/map, anonymous namespace.
+ Fix incorrect pattern for gcc 3.2. Handle 2.95 vector/string
+ iterator and a few stl free function handling. add all C++ base type.
+ * libregex/mangled-name.txt: test for the above change
+
+2003-03-14 Philippe Elie <phil.el@wanadoo.fr>
+
+ * gui/oprof_start.cpp: gcc 2.91 warning work around
+
+2003-03-14 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libop/op_events.c: fix a daemon segfault depending on the used
+ libc version, added 2003-03-04 (0.5.1 is ok)
+
+2003-03-13 Dave Jones <davej@codmeonkey.org.uk>
+
+ * events/x86-64.hammer.events: Remove duplicate minimum tag
+ from RETIRED_INSNS counter.
+
+2003-03-11 John Levon <levon@movementarian.org>
+
+ * module/ia64/op_pmu.c: include op_arch.h not arch.h
+
+2003-03-10 Philippe Elie <phil.el@wanadoo.fr>
+
+ * configure.in: remove unsupported --warnnet, fix docbook root dir test
+ * doc/oprofile.xml: typo
+
+2003-03-10 John Levon <levon@movementarian.org>
+
+ * doc/Makefile.am:
+ * configure.in:
+ * doc/xsl/catalog-1.xml.in: more docbook changes
+
+2003-03-10 John Levon <levon@movementarian.org>
+
+ * configure.in:
+ * doc/Makefile.am:
+ * doc/xsl/xhtml.xsl:
+ * doc/xsl/xhtml-chunk.xsl:
+ * doc/xsl/catalog-1.xml.in: Use a catalog for finding
+ the XSL, so we only have one .in file now.
+
+2003-03-08 Will Cohen <wcohen@redhat.com>
+
+ * doc/Makefile.am: Correct path for htmldir.
+
+2003-03-08 John Levon <levon@movementarian.org>
+
+ * libop/op_cpu_type.c: improve error message
+
+ * utils/op_help.c: show CPU name in events list. Show CPU
+ pretty name in op_help --get-cpu-type.
+
+2003-03-08 John Levon <levon@movementarian.org>
+
+ * configure.in: specify distcheck ./configure flags.
+ Add version.h to distclean.
+
+ * doc/Makefile.am:
+ * doc/xsl/xhtml-1.in:
+ * doc/xsl/xhtml-chunk-1.in: fix make distcheck
+
+2003-03-08 Philippe Elie <phil.el@wanadoo.fr>
+
+ * doc/xsl/.cvsignore: update
+
+ * module/x86/cpu_type.c: <smpboot.h> is not necessary
+
+2003-03-07 John Levon <levon@movementarian.org>
+
+ * README: document autogen.sh
+
+2003-03-07 Philippe Elie <phil.el@wanadoo.fr>
+
+ * TODO: update
+
+ * doc/xsl/xhtml.xsl.in: move to
+ * doc/xsl/xhtml-1.xsl.in: here
+ * doc/xsl/xhtml-chunk.xsl.in: move to
+ * doc/xsl/xhtml-chunk-1.xsl.in: here
+ * doc/Makefile.am; update according
+ * configure.in: avoid to touch doc/xsl generated files
+
+2003-03-07 Philippe Elie <phil.el@wanadoo.fr>
+
+ * TODO: update
+
+ * daemon/opd_image.c:
+ * daemon/op_stats.c:
+ * daemon/opd_stats.h: add statistics for nil image whilst receiving
+ user space samples.
+
+2003-03-06 Philippe Elie <phil.el@wanadoo.fr>
+
+ * TODO: update
+
+ * libdb/db_hash.h:
+ * libdb/db_insert.c: get error message from db_insert()
+
+ * libdb/db_test.c:
+ * dae/opd_proc.c:
+ * daemon/opd_image.c:
+ * libabi/abi_test.cpp:
+ * libabi/op_import.cpp:
+ * pp/op_merge.cpp: update according to the new api
+
+2003-03-06 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml: pedantry
+
+2003-03-06 Philippe Elie <phil.el@wanadoo.fr>
+
+ * TODO: update
+
+ * doc/oprofile.1.in:
+ * doc/oprofile.xml: document --smart-demangle
+
+2003-03-06 Philippe Elie <phil.el@wanadoo.fr>
+
+ * module/ia64/op_pmu.c:
+ * module/x86/op_nmi.c: remove #include <op_events.h>
+
+2003-03-06 John Levon <levon@movementarian.org>
+
+ * utils/opcontrol: sh != C. This is the last opcontrol
+ bug, honest ! OK, maybe not.
+
+2003-03-06 Philippe Elie <phil.el@wanadoo.fr>
+
+ * TODO: update
+
+ * gui/oprof_start.cpp: save_config() gcc 2.95.3 warning work-around
+
+2003-03-05 John Levon <levon@movementarian.org>
+
+ * utils/opcontrol: Make --setup optional (e.g.
+ opcontrol --no-vmlinux). Fix a bug in the --setup
+ exclusive arg testing.
+
+ * doc/oprofile.xml: reflect the above
+
+2003-03-05 John Levon <levon@movementarian.org>
+
+ * libutil++/string_manip.h:
+ * libutil++/string_manip.cpp: cleanup, use s.find
+ because older gcc's don't have the right s.compare
+
+2003-03-04 John Levon <levon@movementarian.org>
+
+ * utils/opcontrol: only sleep 2 after dump on 2.4
+
+2003-03-04 John Levon <levon@movementarian.org>
+
+ * configure.in: tweak the xsltproc test
+
+2003-03-04 John Levon <levon@movementarian.org>
+
+ * configure.in:
+ * doc/Makefile.am: don't try to build the docs
+ if it will fail.
+
+2003-03-04 John Levon <levon@movementarian.org>
+
+ * utils/opcontrol:
+ * daemon/opd_kernel.h:
+ * daemon/opd_image.c:
+ * daemon/opd_kernel.c:
+ * daemon/oprofiled.c: implement --no-vmlinux.
+ Remove back compat for is_kernel.
+
+ * gui/uioprof_start.base.ui:
+ * gui/oprof_start.cpp:
+ * gui/oprof_start_config.h:
+ * gui/oprof_start_config.cpp: support the above
+
+ * doc/oprofile.1.in:
+ * doc/oprofile.xml: doc the above
+
+2003-03-04 John Levon <levon@movementarian.org>
+
+ * utils/opcontrol: allow --version, --help early on
+
+2003-03-04 John Levon <levon@movementarian.org>
+
+ * libop/op_events.c: alter the parser to give file/linenr on
+ error, and handle more whitespace.
+
+2003-03-04 John Levon <levon@movementarian.org>
+
+ * gui/oprof_start.cpp:
+ * gui/oprof_start.h:
+ * gui/oprof_start_config.cpp:
+ * gui/oprof_start_config.h:
+
+ * libutil++/string_manip.h:
+ * libutil++/string_manip.cpp: add is_prefix(),
+ make the trimmers take an argument
+
+2003-03-04 John Levon <levon@movementarian.org>
+
+ * gui/oprof_start.cpp:
+ * gui/oprof_start.h:
+ * gui/oprof_start_config.cpp:
+ * gui/oprof_start_config.h:
+ * gui/persistent_config.h:
+
+ * libutil++/string_manip.h:
+ * libutil++/string_manip.cpp: add split(), tobool(), touint()
+
+ * utils/opcontrol: don't write BUF_SIZE twice. Write
+ RTC_VALUE properly. Write KERNEL_ONLY
+
+2003-03-03 John Levon <levon@movementarian.org>
+
+ * gui/oprof_start.cpp: use --ctrX-event=none,
+ --separate=none. --pid/pgrp-filter=0 was already
+ being done.
+
+2003-03-03 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.1.in:
+ * doc/oprofile.xml:
+ * doc/opcontrol: add --ctrX-event=none
+
+2003-03-03 Will Cohen <wcohen@redhat.com>
+
+ * gui/oprof_start.cpp (oprof_start::on_start_profiler): Limit
+ check to only utm_bitmask.
+
+2003-03-03 Will Cohen <wcohen@redhat.com>
+
+ * events/ia64.itanium2.events:
+ * events/ia64.itanium2.unit_masks: Add Itanium 2 events.
+
+2003-03-03 Will Cohen <wcohen@redhat.com>
+
+ * libop/op_events.h:
+ * libop/op_events.c: Correct checking for the number of unit
+ masks.
+
+2003-03-03 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.1.in:
+ * doc/oprofile.xml: another round of cleanups
+
+ * pp/op_merge.cpp: --counter not --use-counter,
+ for consistency
+
+2003-03-03 John Levon <levon@movementarian.org>
+
+ Patch from Chris Moller, modified.
+
+ * dae/opd_proc.c:
+ * dae/opd_sample_files.c:
+ * daemon/opd_image.c:
+ * daemon/opd_sample_files.c:
+ * libabi/abi_test.cpp:
+ * libabi/op_import.cpp:
+ * libdb/db_hash.h:
+ * libdb/db_insert.c:
+ * libdb/db_manage.c:
+ * libdb/db_test.c:
+ * pp/counter_profile.cpp:
+ * pp/op_merge.cpp: push asserts in libdb down into
+ the clients.
+
+2003-03-03 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml:
+ * doc/oprofile.1.in:
+ * utils/opcontrol: add --separate=none, --pid/pgrp-filter=non
+
+2003-03-03 John Levon <levon@movementarian.org>
+
+ * configure.in:
+ * doc/Makefile.am:
+ * doc/oprofile.xml:
+ * doc/xsl/xhtml-chunk.xsl.in:
+ * doc/xsl/xhtml.xsl.in:
+ * doc/xsl/xhtml-common.xsl: Add version to the
+ docs. Some doc cleanups
+
+2003-03-02 John Levon <levon@movementarian.org>
+
+ * utils/opcontrol: --separate=library should turn kernel off
+
+2003-03-02 John Levon <levon@movementarian.org>
+
+ * events/Makefile.am: fix uninstall
+
+2003-03-02 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml: more re-workings prodded by aeb
+
+2003-03-02 John Levon <levon@movementarian.org>
+
+ * daemon/opd_kernel.c: remove /proc/ksyms reading
+
+2003-03-02 John Levon <levon@movementarian.org>
+
+ * libutil/op_fileio.c: change op_get_line to return
+ NULL on EOF. Also bump up the default allocation some.
+
+ * dae/opd_kernel.c:
+ * dae/opd_parse_proc.c:
+ * daemon/opd_kernel.c:
+ * libop/op_events.c: changes from the above
+
+2003-03-02 John Levon <levon@movementarian.org>
+
+ * configure.in:
+ * Makefile.am:
+ * events/: add text files describing the CPU counters
+ and unit masks. Install them.
+
+ * libop/op_events.h:
+ * libop/op_events.c: remove the bletcherous hard coded
+ descriptions.
+
+ * module/ia64/op_pmu.c:
+ * module/x86/op_nmi.c: remove another big of validation
+
+ * libutil/op_list.h: make C++ friendly
+
+ * libop/op_cpu_type.h:
+ * libop/op_cpu_type.c: add op_get_cpu_name()
+
+ * libop/Makefile:
+ * libop/op_events_desc.h:
+ * libop/op_events_desc.cpp: removed
+
+ * libop++/op_print_event.cpp:
+ * utils/Makefile.am:
+ * utils/op_help.c:
+ * gui/oprof_start.h:
+ * gui/oprof_start.cpp: changes from above
+
+2003-03-01 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml: tweaks
+
+ * utils/opcontrol: scale the default event count. Please
+ test ...
+
+2003-03-01 John Levon <levon@movementarian.org>
+
+ * utils/opcontrol: setup default events. Allow part-setting
+ using --setup. Fix a help text.
+
+ * doc/oprofile.xml: changes from the above
+
+2003-03-01 John Levon <levon@movementarian.org>
+
+ * libop/op_cpu_type.c: fix alpha/ev4 mis-detection
+
+2003-03-01 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml: expand intro a little, small fixes
+
+2003-03-01 John Levon <levon@movementarian.org>
+
+ * pp/format_output.cpp: use "%" not "%-age"
+
+2003-02-28 John Levon <levon@movementarian.org>
+
+ * utils/opcontrol: fix IS_TIMER setting, noticed by
+ Duncan Sands
+
+2003-02-28 John Levon <levon@movementarian.org>
+
+ * configure.in: bump to 0.6cvs
+
+2003-02-28 John Levon <levon@movementarian.org>
+
+ * doc/Makefile.am: tweak
+
+ * libregex/Makefile.am: fix make dist
+
+2003-02-27 John Levon <levon@movementarian.org>
+
+ * configure.in: bump to 0.5.1
+
+2003-02-27 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml: clarify --separate=kernel
+
+2003-02-25 John Levon <levon@movementarian.org>
+
+ * configure.in: clarify --with-kernel-support
+
+ * libop/op_events.c:
+ * module/x86/op_nmi.c:
+ * module/ia64/op_nmi.c: remove sanity checking - it's
+ the wrong place to have such code, is a barrier to op_events
+ cleanup, and makes life harder for NDAers.
+
+2003-02-25 Will Cohen <wcohen@redhat.com>
+
+ * utils/opcontrol (do_deinit): Correct search for /dev/oprofile.
+
+2003-02-24 Dave Jones <davej@codemonkey.org.uk>
+
+ * module/x86/op_apic.[c|h]: move NMI gate setup to architecture
+ specific SET_NMI_GATE macro. x86=no change.
+ Make x86-64 use the kernels _set_gate instead of its own open
+ coded variant.
+
+2003-02-23 John Levon <levon@movementarian.org>
+
+ * version-1.h.in: another rename
+
+2003-02-23 John Levon <levon@movementarian.org>
+
+ * configure.in: set up OP_DATADIR and OP_BINDIR
+
+ * gui/oprof_start.cpp:
+ * libregex/demangle_symbol.cpp: use the above
+
+ * version_tpl.h.in: move to ...
+
+ * version.h.in.in: ... here
+
+2003-02-23 Philippe Elie <phil.el@wanadoo.fr>
+
+ * TODO: update
+
+ * configure.in: add AX_COPY_IF_CHANGE() use it to generate version.h
+ * .cvsignore: update
+
+ * gui/Makefile.am:
+ * gui/oprof_start.cpp:
+ * libregex/Makefile.am:
+ * libregex/demangle_symbol.cpp: don't use -DBINDIR, rather include
+ version.h to get install path
+
+2003-02-23 John Levon <levon@movementarian.org>
+
+ * README: quick start build insns
+
+2003-02-23 Philippe Elie <phil.el@wanadoo.fr>
+
+ * TODO: update
+
+ * libregex/Makefile.am: install stl.pat in $prefix/share/oprofile
+ * libregex/demangle_symbol.cpp: use DATADIR not BINDIR
+ * libregex/magle-name.txt: add test for pointer
+ * libregex/stl.pat: partial support for pointer
+
+2003-02-23 John Levon <levon@movementarian.org>
+
+ * autogen.sh: error out if options passed
+
+2003-02-23 John Levon <levon@movementarian.org>
+
+ * libregex/op_regex.h:
+ * libregex/regex_test.cpp: fix std::
+
+2003-02-23 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/demangle_symbol.cpp:
+ * libutil++/demangle_symbol.h: move to
+ * libregex/demangle_symbol.cpp:
+ * libregex/demangle_symbol.h: here to avoid circular reference between
+ libutil++ and libregex
+ * libregex/Makefile.am:
+ * libutil++/Makefile.am: update according to file move
+
+ * pp/Makefile.am:
+ * pp/op_time.cpp:
+ * pp/op_time_options.cpp:
+ * pp/op_to_source.cpp:
+ * pp/op_to_source_options.cpp:
+ * pp/oprofpp.cpp:
+ * pp/oprofpp_options.cpp: add -D --Demangle options enabling C++
+ demangled name filtering.
+
+2003-02-23 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/string_manip.h:
+ * libutil++/string_manip.cpp: trim(), ltrim(), rtrim() new functions
+
+ * Makefile.am: handle libregex directory
+ * configure.in: handle libregex/Makefile
+
+ * libregex/.cvsignore:
+ * libregex/Makefile.am :
+ * libregex/mangled-name.txt:
+ * libregex/op_regex.cpp:
+ * libregex/op_regex.h:
+ * libregex/regex_test.cpp:
+ * libregex/stl.pat: new file implementing a match and replace regular
+ expression around glibc regex. Not used for now, next commit will
+ use this for pp tools C++ name demangling.
+
+2003-02-22 John Levon <levon@movementarian.org>
+
+ * configure.in: fix X, non-Qt build case
+
+2003-02-22 John Levon <levon@movementarian.org>
+
+ * libutil++/Makefile.am: fix make dist
+
+2003-02-21 Dave Jones <davej@codemonkey.org.uk>
+
+ * configure.in: Enable building on hammer again.
+
+2003-02-21 John Levon <levon@movementarian.org>
+
+ * utils/opcontrol: "Params used" was lying
+
+2003-02-20 John Levon <levon@movementarian.org>
+
+ * daemon/opd_image.c: Fixed a bitch of a bug with separate-kernel,
+ now attribution of kernel samples should be more accurate
+
+2003-02-20 John Levon <levon@movementarian.org>
+
+ * utils/opcontrol: set LIB_SAMPLES if KERNEL_SAMPLES in .daemonrc
+
+2003-02-20 John Levon <levon@movementarian.org>
+
+ * dae/opd_stats.h:
+ * dae/opd_stats.c:
+ * daemon/opd_stats.h:
+ * daemon/opd_stats.c:
+ * dae/opd_proc.c:
+ * daemon/opd_image.c: remove unused OPD_SAMPLE_COUNTS. Actually
+ count samples for 2.5
+
+2003-02-20 John Levon <levon@movementarian.org>
+
+ * libop/op_interface_25.h:
+ * daemon/opd_kernel.c: implement module dropping
+
+ * daemon/opd_image.c:
+ * daemon/opd_kernel.c: attempt to make verbose logs
+ less confusing
+
+2003-02-22 Dave Jones <davej@codemonkey.org.uk>
+
+ * libop/op_events.c: segregload is utm_mask not utm_exclusive
+
+2003-02-20 Philippe Elie <phil.el@wanadoo.fr>
+
+ * TODO: update
+
+ * pp/output_format.h:
+ * pp/output_format.cpp:
+ * pp/op_time.cpp:
+ * pp/oprofpp.cpp:
+ * pp/opp_symbol.h: better handling of 64/32 bits bfd_vma
+ in output
+
+2003-02-20 John Levon <levon@movementarian.org>
+
+ * libutil++/op_exception.h:
+ * libutil++/op_exception.cpp: throw() where needed
+
+2003-02-19 Philippe Elie <phil.el@wanadoo.fr>
+
+ * TODO: update
+
+ * daemon/opd_image.h:
+ * daemon/opd_image.cpp:
+ * daemon/opd_kernel.cpp: fix thinko with --separate=kernel resulting
+ in duplicate opening of the same samples file.
+
+2003-02-19 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/op_exception.h:
+ * libutil++/op_exception.cpp: new files, base class for exception.
+ Not used for now.
+
+2003-02-19 John Levon <levon@movementarian.org>
+
+ * acinclude.m4: update from upstream
+
+ * gui/ui/oprof_start.base.ui:
+ * gui/oprof_start.cpp: separate --setup,--start.
+ Hide non-2.5 stuff in 2.5.
+
+2003-02-18 Philippe Elie <phil.el@wanadoo.fr>
+
+ * TODO: update
+
+ * dae/opd_sample_files.c:
+ * daemon/opd_sample_files.c: opd_handle_old_sample_file() don't
+ try to delete old samples files if they don't exist.
+
+2003-02-18 Will Cohen <wcohen@redhat.com>
+
+ * utils/opcontrol (do_options): Better option error checking.
+
+2003-02-17 Will Cohen <wcohen@redhat.com>
+
+ * pp/format_output.h (show_help): namespace std.
+
+2003-02-17 Will Cohen <wcohen@redhat.com>
+
+ * TODO: update.
+
+2003-02-17 Philippe Elie <phil.el@wanadoo.fr>
+
+ From Anton Blanchard :
+
+ * daemon/opd_image.c: cookie_t fix for 64 bits
+
+2003-02-17 Philippe Elie <phil.el@wanadoo.fr>
+
+ * TODO: update
+
+ * libopt++/popt_options.cpp:
+ * libopt++/popt_options.h: handle an user specific additional
+ help string
+
+ * pp/output_format.h:
+ * pp/output_format.cpp:
+ * pp/op_time_options.cpp:
+ * pp/oprofpp_options.cpp: use it to show in --output_format
+ options details.
+
+2003-02-14 Philippe Elie <phil.el@wanadoo.fr>
+
+ * doc/oprofile.1.in:
+ * doc/oprofile.xml:
+ * pp/oprofpp_options.cpp: allow --show-shared-libs with -s
+
+2003-02-13 Philippe Elie <phil.el@wanadoo.fr>
+
+ * TODO: update
+
+ * pp/output_format.h:
+ * pp/output_format.cpp: fix #686272, crash when using
+ oprofpp -s symb_name.
+
+2003-02-13 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/opd_kernel.h:
+ * dae/opd_image.h:
+ * dae/opd_image.c: don't use hash entry zero for kernel image
+ fix #686175
+
+2003-02-13 Will Cohen <wcohen@redhat.com>
+
+ * daemon/opd_cookie.h(opd_nr_lookup_dcookie): Correct number.
+
+2003-02-13 Will Cohen <wcohen@redhat.com>
+
+ * daemon/opd_cookie.h(opd_nr_lookup_dcookie): Add x86_64.
+
+2003-02-13 John Levon <levon@movementarian.org>
+
+ * dae/opd_image.c: little cleanup and fix error message
+ to not lie
+
+2003-02-12 Philippe Elie <phil.el@wanadoo.fr>
+
+ * doc/oprofile.1.in:
+ * doc/oprofile.xml: enhance doc about --separate=kernel
+
+ * utils/opcontrol: handle gracefully opcontrol --deinit if profiler
+ was already shutdown. Avoid wrong warning when umount /dev/oprofile
+
+2003-02-12 Will Cohen <wcohen@redhat.com>
+
+ * gui/oprof_start.cpp (oprof_start::oprof_start,
+ oprof_start::on_flush_profiler_data,
+ oprof_start::on_start_profiler,
+ oprof_start::on_stop_profiler): Use opcontrol.
+ * gui/oprof_start_util.cpp (daemon_status::daemon_status):
+ Allow reading interrupt info from new kernel interface.
+ * libop/op_get_interface.c: New.
+ * libop/Makefile.am: Add libop/op_get_interface.c.
+ * libop/op_cpu_type.h: Add enum op_interface.
+
+ I Added some bits. Phil
+ * gui/oprof_start.cpp: correct --separate= handling
+ * gui/oprof_start_util.cpp: read only the real number of interrupts
+
+2003-02-12 Philippe Elie <phil.el@wanadoo.fr>
+
+ * utils/opcontrol: handle --note-table-size --kernel-only (2.4 kernel)
+
+2003-02-12 Philippe Elie <phil.el@wanadoo.fr>
+
+ * utils/op_start: map --separate-samples to daemon option
+ --separate-lib-samples.
+
+2003-02-11 Philippe Elie <phil.el@wanadoo.fr>
+
+ * dae/opd_image.c:
+ * dae/opd_kernel.c:
+ * dae/opd_kernel.h:
+ * dae/opd_parse_proc.c:
+ * dae/opd_proc.c:
+ * dae/opd_proc.h:
+ * dae/opd_sample_files.c:
+ * dae/oprofiled.c:
+ * daemon/opd_image.c:
+ * daemon/opd_image.h:
+ * daemon/opd_kernel.c:
+ * daemon/opd_kernel.h:
+ * daemon/opd_sample_files.c:
+ * daemon/oprofiled.c: per application kernel samples files
+
+ * doc/oprofile.1.in:
+ * doc/oprofile.xml: document opcontrol --separate=kernel
+
+ * gui/oprof_start.cpp:
+ * gui/oprof_start_config.cpp:
+ * gui/oprof_start_config.h:
+ * gui/ui/oprof_start.base.ui: remove ignore_daemon checkbox, handle
+ --separate=[library|kernel]
+
+ * libop/op_sample_file.h: add separate_kernel_samples field, file
+ format is backward compatible
+
+ * libabi/abi.cpp:
+ * libabi/abi_test.cpp:
+ * libabi/op_import.cpp: handle new samples file header field
+
+ * pp/counter_profile.cpp: dump new sample files header field.
+
+ * utils/opcontrol: handle --separate=kernel
+
+2003-02-09 Will Cohen <wcohen@redhat.com>
+
+ * utils/opcontrol: Add rtc-value option.
+
+2003-02-09 John Levon <levon@movementarian.org>
+
+ * utils/opcontrol: stale lock file detection
+
+2003-02-06 Will Cohen <wcohen@redhat.com>
+
+ * utils/opcontrol (do_dump): Do not exit if no daemon.
+
+2003-02-06 Will cohen <wcohen@redhat.com>
+
+ * doc/oprofile.1.in: Update man page information.
+
+2003-02-03 John Levon <levon@movementarian.org>
+
+ * configure.in: 0.6cvs
+
+2003-02-02 John Levon <levon@movementarian.org>
+
+ * configure.in: bump to 0.5
+
+2003-02-02 John Levon <levon@movementarian.org>
+
+ * configure.in: disable x86_64
+
+2003-02-02 John Levon <levon@movementarian.org>
+
+ * pp/format_output.cpp: revert previous patch, Phil's
+ x86 binutils is built with 64-bit bfd_vma
+
+2003-02-01 John Levon <levon@movementarian.org>
+
+ * utils/opcontrol: rename --separate-samples to --separate=library
+ for future proofing.
+
+ * pp/format_output.cpp: output vma at a suitable width
+
+2003-01-31 Will Cohen <wcohen@redhat.com>
+
+ * utils/opcontrol(get_kernel_range): Match only .text segment.
+
+2003-01-31 Graydon Hoare <graydon@redhat.com>
+
+ * libabi/abi.cpp
+ * libabi/abi_test.cpp
+ * libabi/op_import.cpp: Treat endianness as a property of the datum
+ being imported, rather than the memory architecture.
+
+2003-01-31 Dave Jones <davej@codemonkey.org.uk>
+
+ * module/x86/op_model_athlon.c: Don't poke reserved bits in the counter.
+ Only rdmsr/wrmsr counters that we've enabled in the NMI handler.
+ ulong->uint conversion.
+
+2003-01-30 Philippe Elie <phil.el@wanadoo.fr>
+
+ From Randolph Chung :
+
+ * daemon/opd_cookie.h: add parisc support
+
+2003-01-30 John Levon <levon@movementarian.org>
+
+ From Anton Blanchard :
+
+ * daemon/opd_cookie.h: add ppc32/64
+
+ * utils/op_start_25: fix start of kernel for ppc
+
+2003-01-30 Will Cohen <wcohen@redhat.com>
+
+ * utils/opcontrol(get_kernel_range): Avoid using perl arithmetic.
+
+2003-01-29 Dave Jones <davej@codemonkey.org.uk>
+
+ * utils/opcontrol: Trying to use the options --pid-filter=pid and
+ --pgmr-filter=pgmr, opcontrol returned "command not found.
+ This was due to 2 missing 'test' statements.
+
+2003-01-29 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/op_to_source.cpp: read vma with strtoull not strtoul fixing
+ 32/64 failure to read output of objdump
+
+2003-01-29 Dave Jones <davej@codemonkey.org.uk>
+
+ * libop/op_cpu_type.c: Clue the user in on why the cpu type isn't
+ recognised, by suggesting the module wasn't loaded.
+ * libop/op_events.c: Doh, unit masks use bit numbers, not values.
+
+2003-01-28 Philippe Elie <phil.el@wanadoo.fr>
+
+ * utils/op_help.c: get cpu type only if not forced on command line.
+ Avoid wrong warning about unsupported cpu type.
+
+2003-01-27 Will Cohen <wcohen@redhat.com>
+
+ * daemon/opd_cookie.h(opd_nr_lookup_dcookie): Add ia64 version.
+
+2003-01-27 Dave Jones <davej@codemonkey.org.uk>
+
+ * libop/op_events.c: K8 HT events are utm_exclusive, not utm_bitmask
+ * libop/op_events.c: Add additional K8 unit masks.
+
+2003-01-23 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libop/op_interface_25.h:
+ * daemon/opd_image.c: prepare drop modules support. exit() when
+ receiving unknown escape code.
+
+2003-01-23 Randolph Chung <tausq@debian.org>
+
+ Added minor change: backward compatibility, u_int to uint, fix
+ 32/64 bits escape code marker comparison. Phil
+
+ * libop/op_interface_25.h:
+ * daemon/opd_kernel.c:
+ * daemon/opd_image.c: new scheme to recognize kernel or user space
+ eip, now kernel module pass the relevent information through
+ escape sequence.
+
+2003-01-21 Dave Jones <davej@codemonkey.org.uk>
+
+ * libop/op_events.c: Add unit mask for Hypertransport events.
+
+2003-01-21 Dave Jones <davej@codemonkey.org.uk>
+
+ * libop/op_events.c: Add x86-64 specific events.
+
+2003-01-21 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/opd_kernel.c: use sscanf to parse /proc/modules
+
+2003-01-20 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/opd_kernel.c: more robust /proc/modules parsing.
+
+2003-01-20 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/opd_kernel.c: 2.5 modules support, for now I keep
+ the code for /proc/ksyms parsing in daemon. Let's it living a few
+ weeks please.
+
+2003-01-18 Falk Hueffner <falk@debian.org>
+
+ I added to the original patch all %L to %ll, Phil
+
+ * daemon/opd_image.c:
+ * daemon/opd_kernel.c:
+ * libutil/op_types.h: 64 bits printf/scanf safety.
+
+2003-01-18 Falk Hueffner <falk@debian.org>
+
+ * libop/op_cpu_type.h:
+ * libop/op_cpu_type.c: add Alpha CPU families.
+ * libop/op_events.h: make op_event.cpu_mask u32, since we now have
+ more than 16 CPU types
+ * libop/op_hw_config.h: bump OP_MAX_COUNTERS to 20 for Alpha
+ * libop/op_events.c: add Alpha events
+ * daemon/opd_cookie.h: add dcookie syscall number for Alpha
+ * utils/op_help.c (main): add help string for Alpha
+
+2003-01-18 John Levon <levon@movementarian.org>
+
+ * module/Makefile.in:
+ * module/x86/Makefile.in:
+ * module/ia64/Makefile.in: kernel headers are too fubar
+ for -Werror. So I'm taking my ball home.
+
+2003-01-17 John Levon <levon@movementarian.org>
+
+ * HACKING:
+ * doc/CodingStyle: add
+
+2003-01-17 John Levon <levon@movementarian.org>
+
+ * TODO: some updates
+
+2003-01-15 Philippe Elie <phil.el@wanadoo.fr>
+
+ * module/x86/op_model_p4.c: pmc_setup_one_p4_counter() show clearly
+ than event == 0 is an error
+
+2003-01-15 John Levon <levon@movementarian.org>
+
+ * utils/opcontrol: prefer oprofiled/op_help binaries in the same
+ dir as opcontrol
+
+2003-01-12 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libop/op_events.c: rename OP_P4_HT2 to OP_P4_ALL
+
+2003-01-12 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libop++/op_print_event.cpp: no event,nor unit mask for CPU_TIMER_INT,
+ problem reported by Ka Fai Lu.
+
+2003-01-12 John Levon <levon@movementarian.org>
+
+ From Graydon Hoare
+
+ * libop/op_cpu_type.h:
+ * libop/op_cpu_type.c: add P4 HT
+
+ * libop/op_events.c: tag P4 HT events
+
+2003-01-11 Randolph Chung <tausq@debian.org>
+
+ * daemon/oprofiled.c: fix ELF sniff
+
+2003-01-11 John Levon <levon@movementarian.org>
+
+ * daemon/opd_image.c: bail out immediately on dcookie
+ lookup failure.
+
+2003-01-10 John Levon <levon@movementarian.org>
+
+ * daemon/opd_cookie.h: insulate against missing arch support
+ for sys_lookup_dcookie
+
+ * daemon/opd_image.c: use the above
+
+2003-01-10 John Levon <levon@movementarian.org>
+
+ * daemon/opd_image.c:
+ * daemon/oprofiled.c: move complete_dump to a better place
+
+2003-01-10 John Levon <levon@movementarian.org>
+
+ * libutil/op_types.h: add cookie_t and vma_t
+
+ * daemon/opd_image.c:
+ * daemon/opd_image.h:
+ * daemon/opd_kernel.c:
+ * daemon/opd_kernel.h: use above types, and kernel_pointer_size
+
+ * daemon/oprofiled.c: sniff /proc/kcore for kernel_pointer_size
+
+2003-01-10 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libopt++/popt_options.cpp:
+ * libopt++/popt_options.h: work-around to support both gcc new parser
+ and gcc 2.95
+
+2003-01-08 John Levon <levon@movementarian.org>
+
+ * libop/op_type.cpp: support for ascii-string cpu types
+
+2003-01-08 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/op_bfd.cpp:
+ * libutil++/op_bfd.h:
+ * pp/oprofpp.cpp: more use of bfd_vma
+
+2003-01-08 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libdb/Makefile.am: fix include dir
+ * libdb/db_test.c: don't assume than sizeof(struct opd_header) == 128
+
+2003-01-06 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/op_bfd.h: fix for 64 bits.
+
+2003-01-06 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libabi/abi.cpp:
+ * libabi/op_import.cpp: broken by my last change in libdb.
+
+2003-01-06 Philippe Elie <phil.el@wanadoo.fr>
+
+ * db/db_hash.h: do_hash() use db_key_t as parameter
+
+2003-01-04 John Levon <levon@movementarian.org>
+
+ * pp/op_time.cpp: suggest opcontrol --dump instead
+
+ * utils/opcontrol: implement --start-daemon. Fix a number
+ of bugs
+
+ * doc/oprofile.xml:
+ * doc/oprofile.1.in: document --start-daemon
+
+2003-01-03 Will Cohen <wcohen@redhat.com>
+
+ * daemon/oprofiled.c (opd_do_samples): Typecast to match
+ arguments.
+
+See ChangeLog-2002 for earlier changelogs.
diff --git a/ChangeLog-2004 b/ChangeLog-2004
new file mode 100644
index 0000000..e04b10b
--- /dev/null
+++ b/ChangeLog-2004
@@ -0,0 +1,1034 @@
+2004-12-25 Will Cohen <wcohen@redhat.com>
+
+ * events/Makefile.am: Corrected type for events_files.
+
+2004-12-12 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml: expand list of supported CPU types.
+
+2004-12-12 Ralf Baechle <ralf@linux-mips.org>
+
+ * daemon/opd_cookie.c: Define __NR_lookup_dcookie for all three
+ supported MIPS ABIs.
+
+ * events/mips/r10000/events:
+ * events/mips/r10000/unit_masks:
+ * events/mips/r12000/events:
+ * events/mips/r12000/unit_masks:
+ * events/mips/r5432/events:
+ * events/mips/r5432/unit_masks:
+ * events/mips/r5500/events:
+ * events/mips/r5500/unit_masks:
+ * events/mips/rm7000/events:
+ * events/mips/rm7000/unit_masks:
+ * events/mips/rm9000/events:
+ * events/mips/rm9000/unit_masks:
+ * events/mips/sb1/events:
+ * events/mips/sb1/unit_masks:
+ * events/Makefile.am:
+ * libop/op_events.c:
+ * utils/op_help.c:
+ * libop/op_cpu_type.h:
+ * libop/op_cpu_type.c: Add support for the MIPS R10000 and R12000,
+ QED RM7000 and PMC-Sierra RM9000, NEC VR5432 and VR5500 and Sibyte SB1
+ processors.
+
+ * README: List myself as the caretaker of the MIPS bits.
+
+2004-11-25 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libop/op_events.c: simplify a bit get_mapping()
+
+2004-11-20 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/opd_stats.c: some statistics are useless, don't print them
+ if we can't read the oprofilefs files.
+
+2004-11-20 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/opd_sfile.c: sfile_clear_kenel() : clear also callgraph
+ file depending on module.
+
+2004-11-19 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/opd_sfile.h:
+ * daemon/opd_sfile.c: fix #971487, daemon was unable to retrieve
+ correctly callgraph sample file for kernel space samples. Fixed by
+ adding relevant information to cg_hash_entry.
+
+ * libpp/callgraph_container.cpp: more verbosity
+
+2004-11-19 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml: Fix AMD link (noticed by Emmanuel Araman).
+
+2004-11-18 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opgprof.cpp: ensure we load all callgraph file
+
+2004-11-18 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/locate_images.cpp: ensure error is always set,
+ callgraph_container was using an uninitialized value.
+
+2004-11-17 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/op_bfd.cpp: improve a bit the symbol chosen when
+ multiple symbol live at same vma
+
+2004-11-17 Philippe Elie <phil.el@wanadoo.fr>
+
+ * doc/oprofile.xml: some words about UP kernel > 2.6.9 and the need of
+ lapic at boot.
+
+2004-11-17 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/common_option.h:
+ * pp/common_option.cpp: move threshold option from here ...
+ * pp/opannotate_options.cpp:
+ * pp/opgprof_options.cpp:
+ * pp/opreport_options.cpp:
+ * pp/opstack_options.cpp: to each of these file using it. Side effect
+ is to remove this option from oparchive which didn't handle it.
+
+ * doc/oparchive.1.in:
+ * doc/oprofile.xml: there isn't any --threshold option to oparchive
+
+2004-11-07 Kristis Makris <kristis.makris@asu.edu>
+
+ * doc/internals.xml: fix typo
+
+2004-11-01 Maynard Johnson <maynardj@us.ibm.com>
+
+ * events/ppc64/970/events: Make min count 10000 for all PM_INST_CMPL;
+ and remove redundant event in group 2
+ * events/ppc64/power4/event_mappings: Set LSB of MMCRA so kernel kludge
+ can be removed at some later date
+ * events/ppc64/power4/events: Make min counts consistent with ppc970
+ * events/ppc64/power5/events: Make min counts consistent with ppc970
+
+2004-11-01 Greg Banks <gnb@melbourne.sgi.com>
+
+ * libop/op_events.c: Make the default sample rate for
+ IA64 sensible (i.e. 10 times smaller).
+
+2004-10-15 Will Cohen <wcohen@redhat.com>
+
+ * events/ppc64/power4/events: Corrected group 4 counter assignments.
+
+2004-10-15 Maynard Johnson <maynardj@us.ibm.com>
+
+ * events/Makefile.am:
+ * events/ppc64/970/event_mappings:
+ * events/ppc64/970/events:
+ * events/ppc64/970/unit_masks:
+ * libop/op_cpu_type.c:
+ * libop/op_cpu_type.h:
+ * libop/op_events.c:
+ * utils/op_help.c:
+ * utils/opcontrol: Added ppc64/970 support.
+
+2004-10-14 Greg Banks <gnb@melbourne.sgi.com>
+
+ * configure.in:
+ * daemon/opd_perfmon.c: autoconf for sched_setaffinity
+ and perfmonctl, fix sched_setaffinity call for early
+ 2.6 kernels
+
+2004-10-07 Will Cohen <wcohen@redhat.com>
+
+ * utils/opcontrol: Correct ppc64 check that events are in same group.
+
+2004-09-21 Will Cohen <wcohen@redhat.com>
+
+ * libutil++/op_bfd.h:
+ * libutil++/op_bfd.cpp: Add logic to use the preferred symbol name.
+
+2004-09-17 John Levon <levon@movementarian.org>
+
+ * utils/op_help.c: don't deref a NULL pointer
+ on failure to read /dev/oprofile/cpu_type
+
+2004-09-17 Anton Blanchard <anton@samba.org>
+
+ * libop/op_events.c: fix compile warnings
+
+2004-09-16 John Levon <levon@movementarian.org>
+
+ * m4/configmodule.m4: disable x86-64 on 2.4
+
+2004-09-15 Maynard P. Johnson <maynardj@us.ibm.com>
+
+ * events/Makefile.am:
+ * libop/op_cpu_type.h:
+ * libop/op_events.h:
+ * libop/op_events.c:
+ * utils/op_help.c:
+ * utils/opcontrol: PPC64 support
+
+2004-09-13 John Levon <levon@movementarian.org>
+
+ * configure.in: bump to 0.8.2cvs
+
+2004-09-11 John Levon <levon@movementarian.org>
+
+ * configure.in: bump to 0.8.1
+
+2004-09-11 John Levon <levon@movementarian.org>
+
+ * libpp/locate_images.h: doxygen for archive_path
+
+2004-08-18 Will Cohen <wcohen@redhat.com>
+
+ * doc/oprofile.xml: List default events in documentation.
+
+2004-08-12 John Levon <levon@movementarian.org>
+
+ * libutil++/op_bfd.cpp: we need to verify
+ functionname is non-NULL in *both* places
+
+2004-08-12 John Levon <levon@movementarian.org>
+
+ * libutil++/op_bfd.cpp: add a hack to support
+ Objective C
+
+2004-07-21 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libdb/db_manage.c: thinko in #931871 bug fix.
+
+2004-07-21 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/arrange_profiles.cpp: fix opreport -m lib, broken in 0.8
+ when using opcontrol --separate=kernel with message
+ "add_to_profile_sample_files(): sample file parsed twice"
+
+2004-07-18 John Levon <levon@movementarian.org>
+
+ * libop/op_mangling.c: dep image always used
+ '{root}' token
+
+2004-07-15 John Levon <levon@movementarian.org>
+
+ * doc/internals.xml: document some more
+
+2004-07-09 John Levon <levon@movementarian.org>
+
+ * libpp/populate.cpp: quash timestamp warnings
+ when using archive: profile specifier
+
+2004-07-09 John Levon <levon@movementarian.org>
+
+ * pp/opstack_options.cpp: include call-graph
+ files in archive.
+
+2004-07-06 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.1.in:
+ * doc/oprofile.xml:
+ * libpp/profile_spec.h:
+ * libpp/profile_spec.cpp: remove sample-file
+ and binary profile specifiers
+
+ * doc/opcontrol.1.in:
+ * doc/oprofile.xml:
+ * pp/common_option.cpp:
+ * utils/opcontrol: allow either "lib" or "library"
+ for merge/separate option. Document "lib"
+
+2004-07-06 Will Cohen <wcohen@redhat.com>
+
+ * doc/oprofile.xml:
+ * doc/Makefile.am:
+ * doc/oparchive.1.in:
+ * doc/oprofile.1.in:
+ * libpp/profile_spec.cpp:
+ * libpp/profile_spec.h:
+ * libpp/populate.h:
+ * libpp/populate.cpp:
+ * libpp/callgraph_container.cpp:
+ * libpp/callgraph_container.h:
+ * libpp/arrange_profiles.cpp:
+ * libpp/arrange_profiles.h:
+ * libpp/locate_images.cpp:
+ * libpp/locate_images.h:
+ * libutil++/op_bfd.h:
+ * libutil++/op_bfd.cpp:
+ * libutil++/file_manip.cpp:
+ * libutil++/file_manip.h:
+ * pp/Makefile.am:
+ * pp/oparchive.cpp:
+ * pp/oparchive_options.cpp:
+ * pp/oparchive_options.h:
+ * pp/opreport.cpp:
+ * pp/opreport_options.h:
+ * pp/opreport_options.cpp:
+ * pp/opstack.cpp:
+ * pp/opstack_options.h:
+ * pp/opstack_options.cpp:
+ * pp/opannotate_options.cpp:
+ * pp/opannotate_options.h:
+ * pp/opgprof.cpp:
+ * pp/opgprof_options.cpp:
+ * pp/opgprof_options.h:
+ * pp/opannotate.cpp:
+ * configure.in: Support for oparchive.
+
+2004-07-05 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.1.in: add opstack(1) to SEE ALSO
+
+2004-06-21 John Levon <levon@movementarian.org>
+
+ * events/i386/p4/events:
+ * events/i386/p4-ht/events:
+ * module/x86/op_model_athlon.c:
+ * module/x86/op_model_p4.c:
+ * module/x86/op_model_ppro.c:
+ * module/ia64/op_pmu.c: fix bug 964097 (event
+ code of 0x00 doesn't work) by relying consistently
+ on "enabled" not "event"
+
+2004-05-29 John Levon <levon@movementarian.org>
+
+ * libdb/tests/Makefile.am: fix build
+
+ * daemon/opd_mangling.c:
+ * daemon/opd_mangling.h:
+ * daemon/opd_sfile.c:
+ * daemon/opd_sfile.h:
+ * daemon/liblegacy/opd_sample_files.h:
+ * libabi/abi.cpp:
+ * libabi/abi_test.cpp:
+ * libabi/op_import.cpp:
+ * libdb/Makefile.am:
+ * libdb/db_debug.c:
+ * libdb/db_insert.c:
+ * libdb/db_manage.c:
+ * libdb/db_stat.c:
+ * libdb/db_travel.c:
+ * libdb/odb.h:
+ * libdb/odb_hash.h:
+ * libdb/tests/db_test.c:
+ * libpp/op_header.cpp:
+ * libpp/profile.cpp:
+ * libpp/profile.h: s/samples_odb_t/odb_t/, move
+ odb_hash.h to odb.h
+
+2004-05-28 John Levon <levon@movementarian.org>
+
+ * daemon/opd_mangling.cpp:
+ * daemon/opd_sfile.cpp:
+ * daemon/liblegacy/opd_proc.c:
+ * daemon/liblegacy/opd_sample_files.c:
+ * libabi/abi_test.cpp:
+ * libabi/op_import.cpp:
+ * libdb/db_manage.cpp:
+ * libdb/odb_hash.h:
+ * libpp/profile.cpp: introduce and use odb_get_data(),
+ odb_open_count()
+
+2004-05-28 John Levon <levon@movementarian.org>
+
+ * libpp/callgraph_container.cpp:
+ * libpp/arrange_profiles.cpp: trivialities
+
+2004-05-28 Bin Ren <bin.ren@cl.cam.ac.uk>
+
+ * daemon/opd_mangling.c:
+ * daemon/opd_sfile.c:
+ * daemon/oprofiled.c:
+ * daemon/liblegacy/opd_image.c:
+ * daemon/liblegacy/opd_proc.c:
+ * daemon/liblegacy/opd_sample_files.c:
+ * libdb/db_debug.c:
+ * libdb/db_insert.c:
+ * libdb/db_manage.c:
+ * libdb/db_stat.c:
+ * libdb/odb_hash.h:
+ * libdb/db_travel.c:
+ * libpp/op_header.cpp:
+ * libpp/profile.cpp:
+ * libutil/op_string.c:
+ * libutil/op_string.h: fix dcookie alias bug by
+ introducing one level of indirection and hash
+ sample files by path names (bug #931871)
+
+2004-05-11 John Levon <levon@movementarian.org>
+
+ * libutil++/file_manip.h: clarify behaviour of
+ op_realpath()
+
+ * libpp/opannotate.cpp: add some checks to avoid
+ creating files outside of the output directory
+
+2004-05-11 Andi Kleen <ak@suse.de>
+
+ * libpp/callgraph_container.cpp:
+ * libpp/profile_container.cpp:
+ * libutil++/op_bfd.h:
+ * libutil++/op_bfd.cpp: use unsigned long in various
+ places - u32 was breaking 64-bit usage
+
+2004-05-11 John Levon <levon@movementarian.org>
+
+ * configure.in: bump to 0.8.1cvs
+
+2004-05-07 John Levon <levon@movementarian.org>
+
+ * configure.in: bump to 0.8
+
+2004-05-07 John Levon <levon@movementarian.org>
+
+ * libpp/filename_spec.h:
+ * libpp/filename_spec.cpp:
+ * libpp/profile_spec.cpp: "dependant" not "dependent"
+
+2004-04-19 Will Cohen <wcohen@redhat.com>
+
+ * events/i386/p4/unit_masks:
+ * events/i386/p4-ht/unit_masks: Correct machine_clear unit mask.
+
+2004-04-04 Will Cohen <wcohen@redhat.com>
+
+ * m4/builtinexpect.m4:
+ * m4/compileroption.m4:
+ * m4/configmodule.m4:
+ * m4/copyifchange.m4:
+ * m4/docbook.m4:
+ * m4/extradirs.m4:
+ * m4/findkernel.m4:
+ * m4/kerneloption.m4:
+ * m4/kernelversion.m4:
+ * m4/mallocattribute.m4:
+ * m4/poptconst.m4:
+ * m4/precompiledheader.m4:
+ * m4/qt.m4:
+ * m4/resultyn.m4:
+ * m4/sstream.m4:
+ * m4/typedef.m4: Add quotes as required for automake 1.8.
+
+2004-04-04 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml: improvements to the call-graph
+ * documentation.
+
+2004-03-28 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/op_bfd.cpp: remove spurious cerr <<; fix a potential memory
+ leak
+
+2004-03-28 John Levon <levon@movementarian.org>
+
+ * libutil++/op_bfd.cpp: fix a BFD leak on format failure. Fix a
+ small race when the binary changes, and we error fatally
+ instead of recovering.
+
+2004-03-22 Philippe Elie <phil.el@wanadoo.fr>
+
+ * module/x86/hammer_op_syscalls.c: use the first map with VM_EXECUTABLE
+ bit to do the exec notification, this fix a 32 bits application
+ profiling regression. We dunno exactly what is this second mmap ...
+ but we must ignore one of these. Fix #921243
+
+2004-03-22 Philippe Elie <phil.el@wanadoo.fr>
+
+ * module/ia64/op_pmu.c: the way to set pfm_syst_wide and
+ pfm_dcr_pp changed between 2.4.19 and 2.4.20
+
+2004-03-22 Will Cohen <wcohen@redhat.com>
+
+ * utils/opcontrol: Correct order of do_init_daemon_vars and
+ decide_orofile_devices.
+
+2004-03-22 Will Cohen <wcohen@redhat.com>
+
+ * utils/opcontrol: Tweak error messages and factor out common code.
+
+2004-03-19 Anton Blanchard <anton@samba.org>
+
+ * daemon/opd_sfile.c: Add function name to some error messages
+
+2004-03-04 Philippe Elie <phil.el@wanadoo.fr>
+
+ * utils/opcontrol: tweak a bit error message.
+
+2004-03-03 Will Cohen <wcohen@redhat.com>
+
+ * utils/opcontrol: Support --dump for normal users.
+
+2004-02-29 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/callgraph_container.cpp: make g++ -D_GLIBCXX_DEBUG happy, see
+ http://gcc.gnu.org/PR14340
+
+ * module/op_dcache.h:
+ * module/op_dname.c: some gcc version are confused by extern
+ declaration followed by later static.
+
+2004-02-28 Zwane Mwaikambo <zwane@linuxpower.ca>
+
+ * libutil++/op_bfd.cpp:
+ * utils/opcontrol: This patch fixes the listing of symbols within the
+ kernel image on ARM i was having. The problem was due to the fact
+ that ARM/Linux kernel text starts with a section called .init unlike
+ all the currently supported Linux architectures. So the solution is
+ to start at section 0
+
+2004-02-28 Philippe Elie <phil.el@wanadoo.fr>
+
+ * module/x86/op_syscalls.c: warning fix
+
+2004-02-23 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/Makefile.am:
+ * daemon/liblegacy/Makefile.am: force daemon build with frame pointer.
+ If daemon is built w/o frame pointer we get random arc, some of them
+ go in the vma used by an existing mmaped sample file, so cookie
+ lookup return a sample filename which is used as a from or to
+ component, this break pptools by creating invalid filename. Note
+ this doesn't protect agaisnt a make CFLAGS=-fomit-frame-pointer.
+
+ * libpp/callgraph_container.cpp: use the right {cg_}image_name for
+ verbose output.
+
+2004-02-21 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/format_flags.h:
+ * libpp/format_output.cpp:
+ * libpp/format_output.h:
+ * pp/opstack.cpp: alternate output format.
+
+2004-02-20 Philippe Elie <phil.el@wanadoo.fr>
+
+ * doc/srcdoc/Doxyfile.in: Fix for doxygen 1.3.6
+ * libpp/profile_spec.h:
+ * libutil++/op_bfd.h: minor Doxygen comments fix
+
+2004-02-20 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/tests/string_manip_tests.cpp: fix a $ make check failure
+ from the last format_percent() change
+
+2004-02-18 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/format_output.cpp: change output spacing.
+
+2004-02-17 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opstack_options.h:
+ * pp/opstack.cpp: pass mege_options::lib to callgraph_container
+ * libpp/callgraph_container.cpp:
+ * libpp/callgraph_container.h: handle merge_options::lib
+
+2004-02-17 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/format_output.cpp: use "self/child" for header
+ * libutil++/string_manip.cpp: format_percent() return "0" if
+ value == 0.0
+ * libpp/callgraph_container.cpp: remove some dead code.
+
+2004-02-16 Philippe Elie <phil.el@wanadoo.fr>
+
+ * module/compat24.h:
+ * module/x86/cpu_type.c:
+ * module/x86/op_apic.c:
+ * module/x86/op_model_p4.c:
+ * module/x86/op_nmi.c:
+ * module/x86/op_x86_model.h: backport P4 HyperThreading support from
+ 2.6 to 2.4.
+
+2004-02-16 Philippe Elie <phil.el@wanadoo.fr>
+
+ * events/i386/p4/events:
+ * events/i386/p4/unit_masks:
+ * events/i386/p4-ht/events:
+ * events/i386/p4-ht/unit_masks: fix MEMORY_COMPLETE unit mask
+
+2004-02-15 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/profile.cpp: samples_range() throw if start > end
+
+2004-02-15 Philippe Elie <phil.el@wanadoo.fr>
+
+ * events/ia64/itanium2/unit_masks: comments
+ * utils/op_help.c: add --callgraph to sanitize min events count
+ * utils/opcontrol: pass --callgraph to op_help
+
+2004-02-15 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/oprofiled.c: send alarm() after fork not before, behavior
+ changed between 2.4 and 2.6 and according to posix 2.6 is right.
+
+2004-02-15 Philippe Elie <phil.el@wanadoo.fr>
+
+ * utils/op_help.c: output the default unit mask. when querying the
+ default mask output it in decimal not hexadecimal
+ * libpp/op_header.cpp: event number must be output as integer not as
+ unsigned char type
+ * libop/op_parse_event.c: clarify error message
+
+ * libop/op_events.c: better validation of unit mask
+ * events/ia64/itanium2/unit_masks:
+ * events/x86-64/hammer/unit_masks: fix so make check pass, done through
+ documentation reading.
+
+
+2004-02-13 Philippe Elie <phil.el@wanadoo.fr>
+
+ * events/i386/p4-ht/events: multiply all minimum count by two
+
+2004-02-12 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/opd_stats.c: handle new statistics added in callgraph patch
+
+2004-02-11 Will Cohen <wcohen@redhat.com>
+
+ * utils/opcontrol: fix normalise_events for default event.
+
+2004-02-10 Will Cohen <wcohen@redhat.com>
+
+ * events/i386/p6_mobile/events:
+ * events/i386/p6_mobile/unit_masks:
+ * events/Makefile.am:
+ * libop/op_cpu_type.c:
+ * libop/op_cpu_type.h:
+ * libop/op_events.c:
+ * utils/op_help.c: Add support for Pentium M (Centrino).
+
+2004-02-10 Philippe Elie <phil.el@wanadoo.fr>
+
+ * events/i386/p4/events: s/instructions/uops/ when appropriate
+ * events/i386/p4/unit_masks: change many bitmask to mandatory,
+ fix invalid default value, remove mask only used with HyperThreading
+ * events/i386/p4-ht/unit_masks: s/bitmask/mandatory. Remove unused
+ unit mask
+
+ * libop/op_events.h:
+ * libop/op_events.c: warn if an unit mask is not used (this add a
+ warning for Itanium2, added in TODO)
+
+ * libop/op_parse_event.c: don't silently accept invalid value as zero
+ (e.g FOO:3000:0xx21 was accepted as FOO:3000:0x0)
+
+ * utils/opcontrol: mandatory default value was rejected because we
+ checked the events before getting the default unit mask.
+
+2004-02-08 Zwane Mwaikambo <zwane@arm.linux.org.uk>
+
+ * daemon/opd_cookie.c: Fix syscall base number.
+
+2004-02-08 Zwane Mwaikambo <zwane@arm.linux.org.uk>
+
+ * daemon/opd_cookie.c: arm support for timer interrupt
+
+2004-02-08 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/liblegacy/opd_sample_files.c: op_mangle_filename() presume
+ mangle_values::dep_name is never NULL, this fix a daemon segfault
+ with 2.4 kernel
+
+2004-02-07 Philippe Elie <phil.el@wanadoo.fr>
+
+ * events/i386/p4/unit_masks:
+ * events/i386/p4-ht/unit_masks: global_power_events need mandatory
+ unit mask
+
+2004-02-07 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/arrange_profiles.cpp: re-order function to fix a build problem
+ with gcc 3.3.1
+
+2004-02-05 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/callgraph_container.cpp: tweak computation of callee_counts
+
+2004-02-05 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/callgraph_container.cpp: Big Thinko (tm), callee samples offset
+ are unordered
+
+2004-02-04 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/callgraph_container.cpp:
+ * libpp/format_output.cpp: arc_recorder::get_caller()/get_callee() name
+ was reversed (caught by Will Cohen)
+
+2004-02-02 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/callgraph_container.cpp:
+ * libpp/callgraph_container.h:
+ * pp/opreport_options.h:
+ * pp/opstack.cpp: implement --threshold
+
+2004-02-02 Will Cohen <wcohen@redhat.com>
+
+ * libpp/callgraph_container.h:
+ * libpp/format_output.h: missing std:: in header.
+
+2004-02-01 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/callgraph_container.h:
+ * libpp/callgraph_container.cpp: rewrite populate() and ehance
+ caller_callee_recorder to support multiple profile classes.
+ * pp/opstack_options.cpp: accept multiple profile class
+
+2004-02-01 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/callgraph_container.cpp: get correct source filenname liner
+ * libpp/format_output.cpp: re-factorize a bit by moving anon
+ namespace from format_output:: to ::
+
+2004-02-01 Philippe Elie <phil.el@wanadoo.fr>
+
+ * doc/oprofile.xml:
+ * doc/opstack.1.in: document new options
+
+ * libpp/callgraph_container.h:
+ * libpp/callgraph_container.cpp: improve readability, add linenr
+ debug information recording partially, see TODO
+
+ * libpp/format_output.h: s/formatter/opreport_formatter, define
+ cg_formatter
+ * libpp/format_output.cpp: implement cg_formatter, factorize some code
+ in formatter base class
+
+ * pp/opreport.cpp: s/formatter/opreport_formatter
+ * pp/opstack_options.h:
+ * pp/opstack_options.cpp: implement output selection/formatting options
+ * pp/opstack.cpp: use cg_formatter for output.
+
+2004-01-30 Philippe Elie <phil.el@wanadoo.fr>
+
+ commit not itended but tree is stable so add a ChangeLog ...
+ * libpp/Makefile.am:
+ * libpp/symbol.cpp: new file for output_hint()
+ * libpp/profile_container.cpp: use output_hint()
+ * libpp/callgraph_container.cpp:
+ * libpp/callgraph_container.h:
+ * libpp/symbol.h:
+ * pp/opstack.cpp: get output hint from the callgraph container.
+
+2004-01-29 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/init.c:
+ * daemon/opd_events.c:
+ * daemon/opd_kernel.c:
+ * daemon/opd_mangling.c:
+ * daemon/opd_printf.h:
+ * daemon/opd_sfile.c:
+ * daemon/opd_trans.c:
+ * daemon/oprofiled.c:
+ * daemon/oprofiled.h:
+ * daemon/liblegacy/init.c:
+ * daemon/liblegacy/opd_image.c:
+ * daemon/liblegacy/opd_kernel.c:
+ * daemon/liblegacy/opd_mapping.c:
+ * daemon/liblegacy/opd_parse_proc.c:
+ * daemon/liblegacy/opd_proc.c:
+ * daemon/liblegacy/opd_sample_files.c:
+ * utils/opcontrol: split daemon --verbose, w/o argument it's synonymous
+ to --verbose=all. Better splitting is welcome
+
+ * daemon/opd_sfile.c: Fix thinko, opcontrol --reset coredump'ed
+
+2004-01-29 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libop/op_events.c:
+ * utils/op_help.c: don't use default in switch (cpu_type) to ensure
+ adding a cpu type will issue a warning where we forget to handle it.
+
+2004-01-28 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/opd_sfile.c: invert from/to start offset for kernel samples
+
+ * pp/opstack.cpp:
+ * libpp/callgraph_container.h:
+ * libpp/callgraph_container.cpp: if we can't bfd_open a binary and
+ the sample file show it's a kernel sample file we must ignore
+ completely the it. (Added to TODO, there is something fragile here)
+
+2004-01-28 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/image_errors.cpp: typo, warn at first error not from second
+
+2004-01-28 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/tests/utility_tests.cpp:
+ * libopt++/popt_options.cpp: s/template <class/template <typename/
+
+2004-01-28 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/init.c: show buffer read only when --verbose
+
+ * libpp/image_errors.cpp:
+ * libpp/image_errors.h: add needed API for callgraph image error
+ * libpp/callgraph_container.cpp: use it.
+ * pp/opstack.cpp: report_image_errors()
+
+2004-01-27 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/op_bfd.cpp: Fix bfd_find_nearest_line() and separate
+ debug info, please test it.
+
+2004-01-27 Philippe Elie <phil.el@wanadoo.fr>
+
+ * doc/opcontrol.1.in:
+ * doc/oprofile.xml:
+ * utils/opcontrol: add --cpu-buffer-size and document it.
+
+2004-01-27 Will Cohen <wcohen@redhat.com>
+
+ * events/i386/p4/unit_masks:
+ * events/i386/p4-ht/unit_masks: correct branch_type unit mask.
+
+2004-01-25 John Levon <levon@movementarian.org>
+
+ * doc/Makefile.am: fix make chunk
+
+ * doc/buffers.dia: add editable source
+
+ * doc/buffers.png: fix stupid typos
+
+ * doc/internals.xml: add some more text
+
+2004-01-25 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/parse_filename.h:
+ * libpp/parse_filename.cpp: profile_spec_equal() new predicate
+ * libpp/arrange_profiles.cpp: use it to ensure we create a new
+ profile_samples_file when needed.
+
+2004-01-24 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.1.in:
+ * doc/opstack.1.in: some cleanups
+
+ * libop/tests/load_events_files_tests.c:
+ * libop/tests/alloc_counter_tests.c:
+ * libop/op_events.c: rename env var to OPROFILE_EVENTS_DIR
+
+2004-01-20 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/opd_sfile.c: (getfile()) avoid out of bound sf->files[] access
+
+2004-01-20 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/callgraph_container.cpp: tweak comparator to sort arcs.
+ * pp/common_option.cpp: typo.
+
+2004-01-20 Philippe Elie <phil.el@wanadoo.fr>
+
+ * doc/opannotate.1.in:
+ * doc/opgprof.1.in:
+ * doc/opreport.1.in:
+ * doc/oprofile.xml:
+ * doc/opstack.1.in: document --verbose options a bit
+ * libutil++/cverb.cpp:
+ * libutil++/cverb.h:
+ * pp/common_option.cpp: remove vlevel2 verbose object
+
+2004-01-20 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/cverb.h:
+ * libutil++/cverb.cpp: new cverb handling. most interresting are
+ --verbose=sfile,bfd,level1 resp. sample filename handling bfd
+ handling and more verbosity (only for bfd actually)
+
+ * pp/opgprof.cpp: controlled by --verbose==bfd, add level1 to get
+ verbose symbols.
+ * libpp/callgraph_container.cpp:
+ * libutil++/op_bfd.cpp:
+ * pp/common_option.cpp:
+ * pp/opannotate_options.cpp:
+ * pp/opgprof_options.cpp:
+ * pp/opreport_options.cpp:
+ * pp/opstack_options.cpp: use it
+
+2004-01-19 John Levon <levon@movementarian.org>
+
+ * libpp/callgraph_container.h:
+ * libpp/callgraph_container.cpp: rename caller_callee_recorder
+ to arc_recorder.
+
+ * doc/CodingStyle: mention trailing comments
+
+ * utils/opcontrol: fix formatting. Error if --note-table-size
+ is passed on 2.6 kernels.
+
+2004-01-18 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libdb/db_debug.c: fix build on alpha
+ * libpp/callgraph_container.cpp: missing std:: in header
+
+2004-01-18 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/callgraph_container.cpp: Obviously not2(weak_ordering_function)
+ is not a weak_ordering function leading to mysterious segfault
+ during sort.
+
+2004-01-18 Philippe Elie <phil.el@wanadoo.fr>
+
+ * doc/opstack.1.in: new file, describe opstack usage
+ * doc/oprofile.xml: describe opstack
+
+2004-01-18 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/op_bfd.cpp: Don't fix symbol offset for symbol definition
+ coming from the original file. A corner case remain broken: symbols
+ definition coming from debug file and belonging to another section
+ than .text are incorrecttly offseted.
+
+2004-01-18 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libop/op_sample_file.h: with cg file we need two field is_kernel.
+ * daemon/opd_events.c:
+ * daemon/opd_events.h:
+ * daemon/opd_mangling.c:
+ * daemon/liblegacy/opd_sample_files.c: handle cg_to_is_kernel
+
+ * pp/populate.cpp:
+ * pp/populate.h:
+ * pp/image_errors.cpp:
+ * pp/image_errors.h: move this four files to libpp
+
+ * libpp/populate.cpp: we can get empty filename now, ignore them.
+ * libpp/image_error.h: remove this file by moving its contents ...
+ * libpp/image_errors.h here (this two filenames was confusing)
+
+ * libpp/Makefile.am: update according to files move.
+
+ * libpp/arrange_profiles.h:
+ * libpp/arrange_profiles.cpp: Fix find_profile_sample_files(), I was
+ creating to many profile_sample_files. Add a bunch of operator<<.
+
+ * libpp/callgraph_container.h:
+ * libpp/callgraph_container.cpp:
+
+ * libpp/filename_spec.h: add cg_filename member
+ * libpp/filename_spec.cpp: handle cg_filename, Fix an error in
+ is_dependant(), I'm a bit nervous about this predicate...
+
+ * libpp/locate_images.h:
+ * libpp/locate_images.cpp: #include fix
+
+ * libpp/parse_filename.cpp: Fix cg filename handling to not trigger
+ some invalid_filename error with cg filename.
+
+ * libpp/profile.h:
+ * libpp/profile.cpp: we can no longer assume we use u32, so use
+ odb_key_t in public interface. Add operator== acting on iterator
+
+ * libpp/symbol_container.cpp:
+ * libpp/symbol_container.h: add find(symbol const &);
+ * libpp/profile_container.h:
+ * libpp/profile_container.cpp: add a public interface to iterate over
+ all smybols and to find a specific symbol
+
+ * libpp/symbol.h: typo, missing include
+
+ * pp/Makefile.am: handle opstack various new files and files move to
+ libpp.
+
+ * pp/opreport.cpp:
+ * pp/opannotate.cpp: pass symbol_filter as params to populate()
+
+ * pp/opannotate_options.cpp: add verbose output of profile_classes
+ * pp/opgprof_options.cpp:
+ * pp/opreport_options.cpp:
+
+ * pp/opstack.cpp:
+ * pp/opstack_options.cpp:
+ * pp/opstack_options.h: new callgraph utility far to be complete but
+ enough to start to play with callgraph.
+
+2004-01-04 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil/op_fileio.c: op_write_file(): allow to write zero byte.
+ * libutil/op_fileio.h: add fatal error for opd_read_int_from_file()
+ * daemon/init.c: add fatal error for opd_read_fs_int
+ * daemon/oprofiled.c:
+ * daemon/oprofiled.h:
+ * daemon/liblegacy/init.c:
+ * daemon/liblegacy/opd_24_stats.c: use this new fatal parameter
+ * daemon/opd_stats.c: dump /dev/oprofile/stats/*
+
+ * daemon/opd_sfile.c:
+ * daemon/opd_sfile.h: augment opd_sfile with an hash table of related
+ call graph file
+
+ * daemon/opd_mangling.c:
+ * daemon/opd_mangling.h:
+ * daemon/liblegacy/opd_sample_files.c:
+ * libop/op_mangle.c:
+ * libop/op_mangle.h: use new mangling name scheme, in short word:
+ {dep} part is no longer optionnal, a {cg}/binary_name can optionnally
+ follow the {dep} part
+ * libop/tests/mangle_tests.c: update test according to sample filename
+ change
+
+ * libpp/filename_spec.cpp:
+ * libpp/filename_spec.h: filename_spec::is_dependant() new function
+ * libpp/parse_filename.h: add a cg_image member
+ * libpp/parse_filename.cpp: handle callgraph filename
+
+ * libpp/arrange_profiles.cpp:
+ * libpp/arrange_profiles.h: rather to use string for sample files, use
+ a { string sample_filename, list<string> cg_files }, if {dep} part
+ != {cg} part it's a cross-call binary.
+ Note the sample_filename string can be empty (callgraph file w/o any
+ samples into a binary)
+
+ * libpp/profile_spec.h:
+ * libpp/profile_spec.cpp: fix filtering of callgraph filename (this fix
+ Carlo problem where opreport die with an invalid_filename error)
+
+ * pp/opgprof.cpp: use the new arrange_profiles.h API to acquire
+ callgraph filename associated with a binary
+ * pp/opgprof_options.cpp: don't filter callgraph filename
+
+ * pp/opreport.cpp:
+ * pp/populate.cpp: update according arrange_profile API change
+
+ * utils/opcontrol: add --callgraph=#depth parameter
+ * doc/opcontrol.1.in:
+ * doc/oprofile.xml: document opcontrol --callgraph=#depth
+
+2004-01-16 Will Cohen <wcohen@redhat.com>
+
+ * libutil++/op_bfd.cpp: Always use filepos of original file.
+
+2004-01-16 Will Cohen <wcohen@redhat.com>
+
+ * libop/op_config.h (DEBUGDIR): New.
+ * libutil/op_fileio.h:
+ * libutil/op_fileio.c: New function calc_crc32
+ * libutil++/Makefile.am: Add libop to include directory.
+ * libutil++/op_bfd.h:
+ * libutil++/op_bfd.cpp: New functions separate_debug_file_exists,
+ get_debug_link_info, find_separate_debug_file, open_bfd, and
+ get_symbols_from_file to support separate debug files.
+
+2004-01-02 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opgprof_options.cpp: use the proper type for options::demangle
+
+2004-01-01 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libregex/op_regex.cpp:
+ * libregex/op_regex.h: tidy a bit private interface
+
+2004-01-01 Philippe Elie <phil.el@wanadoo.fr>
+
+ * gui/oprof_start_config.h:
+ * gui/oprof_start_util.h:
+ * libpp/symbol.h:
+ * libutil++/cverb.cpp:
+ * libutil++/cverb.h:
+ * pp/opannotate_options.cpp:
+ * pp/opgprof_options.cpp: move some #include <> from .h to .cpp
+
+2004-01-01 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libregex/op_regex.cpp: don't assume int('a') > int('0')
+
+See ChangeLog-2004 for earlier changelogs.
diff --git a/ChangeLog-2005 b/ChangeLog-2005
new file mode 100644
index 0000000..b2e76ee
--- /dev/null
+++ b/ChangeLog-2005
@@ -0,0 +1,963 @@
+2005-12-30 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/bfd_support.cpp: bfd_find_nearest_line() can return NULL
+ in the sixth parameters, check the returned value. Problem reported
+ by Nicolas Savoire <nicos@maunakeatech.com>
+
+2005-12-07 Maynard Johnson <maynardj@us.ibm.com>
+
+ * events/ppc64/power5/events: Change counter for CYCLES
+ in order to use PM_CYC vs PM_RUN_CYC. This makes a
+ difference now with kernels > 2.6.14 since the PowerPC
+ runlatch is now honored and PM_RUN_CYC counts CYCLES
+ only when not in idle loop.
+
+2005-12-05 Will Cohen <wcohen@redhat.com>
+
+ * libpp/arrange_profiles.cpp: Correct anon namespace for gcc 4.1.
+
+2005-11-30 Junichi Uekawa <dancer@netfort.gr.jp>
+
+ * doc/oprofile.1.in: $prefix is unprocessed, use
+ @prefix@ instead.
+
+2005-11-17 Sean Lee <joy.lists@gmail.com>
+
+ * utils/opcontrol: Fix a typo. Cleanup load_module_26()
+
+2005-10-19 John Levon <levon@movementarian.org>
+
+ * daemon/opd_cookie.c: use __MIPSEB__ not _MIPSEB
+
+2005-10-18 Maynard Johnson <maynardj@us.ibm.com>
+
+ * events/ppc64/power4/event_mappings:
+ * events/ppc64/970/event_mappings:
+ * events/ppc64/power5/events:
+ * events/ppc64/power5/event_mappings: Ensure SAMPLE_ENABLE bit
+ is set correctly, in preparation for coming change in
+ PPC64 driver. Also, based on user input, add new event
+ CYCLES_RND_SMPL for Power5.
+
+2005-10-18 David Daney <ddaney@avtrex.com>
+
+ * daemon/opd_cookie.c: Handle MIPS o32 for both big and little endian.
+
+2005-10-18 Andy Fleming <afleming@freescale.com>
+
+ * events/Makefile.am:
+ * events/ppc/e500v2/events:
+ * events/ppc/e500v2/unit_masks:
+ * libop/op_cpu_type.c:
+ * libop/op_cpu_type.h:
+ * libop/op_events.c:
+ * utils/ophelp.c: add support for latest e500 processor
+
+2005-09-08 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libop/op_events.c:
+ * libop/op_events.h:
+ * libpp/op_header.cpp: use 32 bits unsigned int for unit mask, u16
+ use was an historical artefact coming from the p6 implementation.
+ This allow to pass more information and will be used by P4 driver.
+
+2005-09-01 Philippe Elie <phil.el@wanadoo.fr>
+
+ * gui/oprof_start.cpp: the last unit mask checkbox is no longer a
+ "validate all unit mask" so don't treat it specially. It avoid to
+ lost the last bit in the unit mask each time oprof_start is used.
+
+2005-08-31 Philippe Elie <phil.el@wanadoo.fr>
+
+ * doc/oprofile.1.in: quote .BR strings
+
+2005-08-31 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.1.in: document archive: specifier
+
+2005-08-30 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/oparchive_options.cpp: fix #1276058, oparchive must force merging
+ to avoid trigerring some sanity check in arrange_profiles(). Allowing
+ merging is not a problem as merging doesn't occur in oparchive.
+
+2005-08-25 Philippe Elie <phil.el@wanadoo.fr>
+
+ * events/x86-64/hammer/unit_masks:
+ * events/x86-64/hammer/events: new events to count data cache
+ access/miss by lock'ed insn.
+
+2005-08-24 Maynard Johnson <maynardj@us.ibm.com>
+
+ * events/ppc64/power4/events:
+ * events/ppc64/power4/event_mappings:
+ * events/ppc64/power5/events:
+ * events/ppc64/power5/event_mappings:
+ * events/ppc64/970/events:
+ * events/ppc64/970/event_mappings: Add all supported events and groups.
+ This change some events name.
+
+2005-08-24 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/op_bfd.cpp: minor tidy
+ * daemon/opd_trans.c: more static function
+ * events/ppc/e500/events: typo
+
+2005-08-19 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libdb/db_stat.c: use 64 bits to cumulate samples count.
+
+2005-08-18 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/file_manip.cpp: Change the last modification time after
+ copying it.
+
+2005-08-17 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libdb/odb.h:
+ * libdb/db_manage.c:
+ * libdb/db_insert.c: split the api in two part, one to update a node
+ (or create it) by incrementing by one its associated value and
+ one to create a new node with a given value. This optimize the
+ fast path used by the daemon. Sanity check inside the fast path has
+ been removed too.
+
+ * daemon/opd_sfile.c:
+ * daemon/liblegacy/opd_proc.c:
+ * libabi/opimport.cpp:
+ * libabi/tests/abi_test.cpp:
+ * libdb/tests/db_test.c: update according
+
+2005-08-17 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/bfd_support.h:
+ * libutil++/op_bfd.cpp: comment how and why we can use the debuginfo
+ bfd object.
+
+
+2005-08-16 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/file_manip.cpp: fix compilation on GCC 2.95.x
+
+2005-08-15 Philippe Elie <phil.el@wanadoo.fr>
+
+ Fix #1256978: sum of samples count overflow
+
+ * libutil/op_types.h: typedef a unsigned 64 bits count_type
+ * libpp/callgraph_container.cpp:
+ * libpp/format_output.cpp:
+ * libpp/profile.cpp:
+ * libpp/profile.h:
+ * libpp/profile_container.cpp:
+ * libpp/symbol.h:
+ * libutil/op_types.h:
+ * libutil++/growable_vector.h:
+ * pp/opreport.cpp: use it all over place where we need to sum up
+ samples count
+ * pp/opgprof.cpp: check for samples count capping for callgraph
+ output
+
+2005-08-15 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libdb/tests/db_test.c: add a better speed test
+
+2005-08-13 Maynard Johnson <maynardj@us.ibm.com>
+
+ * gui/oprof_start.h:
+ * libop/op_events.c:
+ * libop/op_events.h:
+ * libpp/op_header.cpp: change op_event.val field from u8 to u32 to
+ allow event numbers higher than 0X100.
+
+2005-08-13 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libdb/odb.h:
+ * libdb/db_insert.c:
+ * libdb/db_manage.c: use a two step node allocation to ensure adding
+ a node will be sort of atomically visible in another process
+
+2005-08-13 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libdb/odb.h: clarify the way odb_get_iterator work
+ * libpp/profile.cpp: use odb_get_iterator properly to ensure we account
+ zero relative offset. This fix a corner case when kernel module get
+ a sample at the first byte of their .text section.
+
+2005-08-11 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/file_manip.cpp: fix a race when changing the mode and owner
+ of copied file.
+ * pp/oparchive.cpp: warn if a file can't be copied, avoid to copy
+ inexisting image for anon mammping
+
+2005-08-11 Philippe Elie <phil.el@wanadoo.fr>
+
+ * gui/oprof_start.cpp:
+ * gui/oprof_start_config.cpp:
+ * gui/oprof_start_config.h:
+ * gui/ui/oprof_start.base.ui:
+ * libop/op_config.h: add --cpu-buffer-size for 2.6
+
+2005-08-10 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/file_manip.h:
+ * libutil++/file_manip.cpp: preserve as many of file attributes and
+ owner we can when copying a file. This affected running oparchive
+ with root right allowing non root user to read all archived binaries.
+ Problem started in cvs the 2005-08-07
+
+2005-08-09 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/opd_anon.c:
+ * daemon/opd_kernel.c: fix two scanf potential buffer overflow
+
+2005-08-09 Philippe Elie <phil.el@wanadoo.fr>
+
+ * module/x86/cpu_type.c: fix #1254390, problem and solution
+ by Thomas Kho <tkho@users.sourceforge.net>
+
+ * module/oprofile.c:
+ * module/oprofile.h: #1266604 fix a compilation problem with
+ gcc <= 3.3. It's not worth to try to continue to use fastcall
+ for op_do_profile.
+
+ * module/x86/op_model_p4.c: backport some change from the 2.6 driver:
+ on some P4 model 3 IQ_ESCR0/1 doesn't exist and acessing them fault.
+
+2005-08-08 Philippe Elie <phil.el@wanadoo.fr>
+
+ * doc/opcontrol.1.in:
+ * doc/oprofile.xml: document opcontrol --buffer-watershed
+
+ * gui/oprof_start.cpp:
+ * gui/oprof_start_config.cpp:
+ * gui/oprof_start_config.h:
+ * gui/ui/oprof_start.base.ui:
+ * utils/opcontrol: implement 2.6 buffer_watershed
+
+2005-08-07 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/file_manip.h:
+ * libutil++/file_manip.cpp: use iostream to copy file
+ * libpp/populate.cpp: check_mtime() even when using archive: spec
+ * pp/oparchive.cpp: fix comment
+
+2005-08-07 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opreport.cpp: don't throw a std::string but an op_runtime_error
+
+2005-08-07 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/oprofiled.c:
+ * daemon/liblegacy/init.c:
+ * daemon/liblegacy/opd_image.c:
+ * daemon/liblegacy/opd_parse_proc.c:
+ * gui/oprof_start.cpp:
+ * gui/oprof_start_util.cpp:
+ * libdb/db_debug.c:
+ * libdb/db_insert.c:
+ * libdb/db_manage.c:
+ * libdb/tests/db_test.c:
+ * libop/op_events.c:
+ * libop/tests/alloc_counter_tests.c:
+ * libop/tests/parse_event_tests.c:
+ * libopt++/popt_options.cpp:
+ * libpp/arrange_profiles.cpp:
+ * libpp/callgraph_container.cpp:
+ * libpp/filename_spec.cpp:
+ * libpp/image_errors.cpp:
+ * libpp/name_storage.cpp:
+ * libpp/profile_container.cpp:
+ * libpp/profile_spec.cpp:
+ * libregex/op_regex.cpp:
+ * libregex/tests/regex_test.cpp:
+ * libutil++/string_manip.cpp:
+ * pp/opannotate.cpp:
+ * pp/opgprof_options.cpp:
+ * pp/opreport.cpp:
+ * pp/opreport_options.cpp:
+ * utils/ophelp.c: coding style
+
+2005-08-06 Philippe Elie <phil.el@wanadoo.fr>
+
+ * doc/oprofile.xml: more documentation about annotated source and
+ inlined functions.
+ * libpp/profile_container.cpp:
+ * libpp/profile_container.h:
+ * libpp/symbol_container.cpp:
+ * libpp/symbol_container.h: new public interface to select all symbols
+ defined in a given source file.
+ * pp/opannotate.cpp: when no source file is available we can at least
+ output all symbols name/samples count belonging to this source.
+
+2005-08-06 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/profile_container.cpp:
+ * libpp/profile_container.h:
+ * libpp/symbol_container.cpp:
+ * libpp/symbol_container.h: find symbol by source filename, linenr :
+ change public interface to return multiple symbols
+ * pp/opannotate.cpp: Fix #1252754
+
+2005-08-04 Philippe Elie <phil.el@wanadoo.fr>
+
+ * doc/opimport.1.in:
+ * doc/oprofile.xml: improve documentation about opimport
+
+2005-08-04 Philippe Elie <phil.el@wanadoo.fr>
+
+ * gui/ui/oprof_start.base.ui: handle ui events help string when using
+ keyboard to navigate through event list
+
+2005-08-04 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libabi/Makefile.am:
+ * libabi/abi.cpp:
+ * libabi/abi.h:
+ * libabi/op_abi.h:
+ * libabi/tests/Makefile.am:
+ * libabi/op_abi.cpp: removed
+ * libabi/op_abi.c: new file, abi file writing in plain C
+
+ * configure.in:
+ * daemon/Makefile.am:
+ * daemon/oprofiled.c:
+ * daemon/liblegacy/Makefile.am:
+ * doc/Makefile.am:
+ * doc/oprofile.xml: build unconditionnaly libabi
+
+ * doc/opimport.1.in: new file, man page for opimport, need some
+ tweaking probably
+
+2005-08-03 Philippe Elie <phil.el@wanadoo.fr>
+
+ * gui/oprof_start.cpp:
+ * gui/oprof_start.h:
+ * gui/oprof_start_config.cpp:
+ * gui/oprof_start_config.h:
+ * gui/ui/oprof_start.base.ui: add a button to reset the profiling
+ session and an edit field to setup the callgraph depth
+
+2005-08-03 Philippe Elie <phil.el@wanadoo.fr>
+
+ * gui/oprof_start_util.h:
+ * gui/oprof_start_util.cpp:
+ * gui/oprof_start.cpp: hardcode config directory to /root,
+ rename get_user_filename() to get_config_filename()
+
+2005-08-03 Philippe Elie <phil.el@wanadoo.fr>
+
+ * gui/oprof_start_util.cpp: fix detection of stopped daemon. Fix a
+ miscounted interrupt nr after a start/stop/start
+
+2005-08-03 Philippe Elie <phil.el@wanadoo.fr>
+
+ * doc/oprofile.xml: improve documentation about RTC mode.
+
+2005-08-03 Philippe Elie <phil.el@wanadoo.fr>
+
+ * gui/oprof_start.cpp: fix events parsing according to the way
+ we store them in setupfile changed by the last patch.
+
+2005-08-02 Richard Purdie <rpurdie@openedhand.com>
+
+ * HACKING: Add note about bashisms being bad
+ * doc/oprofile.xml: Remove bash dependency
+ * utils/opcontrol: remove bashisms from the script
+
+2005-08-02 Richard Purdie <rpurdie@openedhand.com>
+
+ * utils/opcontrol: remove some bashism, not yet enough to remove
+ bash dependency
+
+2005-07-21 John Levon <levon@movementarian.org>
+
+ * configure.in: bump to 0.9.2cvs
+
+2005-07-18 John Levon <levon@movementarian.org>
+
+ * libutil++/tests/Makefile.am: canonicalize
+ SRCDIR to fix make check
+
+2005-07-18 John Levon <levon@movementarian.org>
+
+ * configure.in: bump to 0.9.1
+
+2005-07-11 John Levon <levon@movementarian.org>
+
+ * module/oprofile.c: fix for GCC 3.4, spotted by
+ Jason Lunz <lunz@falooley.org>
+
+2005-01-06 Ralf Baechle <ralf@linux-mips.org>
+
+ * events/Makefile.am:
+ * events/mips/24K/events:
+ * events/mips/24K/unit_masks:
+ * libop/op_events.c:
+ * libop/op_cpu_type.h:
+ * libop/op_cpu_type.c:
+ * utils/ophelp.c: Add MIPS 24K support
+
+2005-06-16 Richard Purdie <rpurdie@o-hand.com>
+
+ * utils/opcontrol: fix ARM kernels again after 2005-05-04
+ change to op_bfd.cpp broke it again. Only look for .text
+ section for our kernel range.
+
+2005-06-13 Richard Purdie <rpurdie@o-hand.com>
+
+ * libpp/callgraph_container.cpp:
+ * libpp/profile.cpp: ignore any symbols before .text
+ for start_offset profiles
+
+2005-06-02 Jason Lunz <lunz@falooley.org>
+
+ * libpp/diff_container.cpp:
+ * libpp/format_output.cpp:
+ * libutil++/bfd_support.cpp:
+ * libutil++/op_bfd.cpp: fix compilation on GCC 2.95.x,
+ older glibc
+
+2005-06-01 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opannotate_options.cpp: error out if --assembly and --output-dir
+ are used together
+ * doc/opannotate.1.in:
+ * doc/oprofile.xml: update docucmentation according.
+
+2005-05-31 John Levon <levon@movementarian.org>
+
+ * configure.in: bump to 0.9.1cvs
+
+2005-05-27 John Levon <levon@movementarian.org>
+
+ * libpp/diff_container.cpp: convert the diffs into
+ an actual percentage!
+
+ * configure.in: bump to 0.9
+
+2005-05-26 John Levon <levon@movementarian.org>
+
+ * daemon/opd_cookie.c:
+ * daemon/opd_sfile.c:
+ * daemon/opd_trans.c: fixes for image filtering
+
+2005-05-09 Will Cohen <wcohen@redhat.com>
+
+ * daemon/opd_sfile.c: Fix variable declaration to compile on gcc 3.4.
+
+2005-05-04 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/common_option.cpp: split argument "{}" in two separate argument
+
+2005-05-04 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml: fix typos
+
+2005-05-04 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/cverb.cpp:
+ * libutil++/cverb.h: fix comment, remove unecessary friend declaration.
+
+2005-05-04 John Levon <levon@movementarian.org>
+
+ * daemon/liblegacy/opd_kernel.c: fix previous workaround
+ so it only triggers on x86
+
+2005-05-04 John Levon <levon@movementarian.org>
+
+ * libutil++/op_bfd.h:
+ * libutil++/op_bfd.cpp: don't assume .text is the first SEC_CODE
+ section. Keep a map of section file offsets to fix up dbfd
+ symbols. Remove broken sanity checks.
+
+2005-05-02 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml: small change
+
+2005-05-02 John Levon <levon@movementarian.org>
+
+ * daemon/Makefile.am:
+ * daemon/opd_anon.h:
+ * daemon/opd_anon.c:
+ * daemon/init.c:
+ * daemon/opd_cookie.c:
+ * daemon/opd_events.h:
+ * daemon/opd_events.c:
+ * daemon/opd_mangling.c:
+ * daemon/opd_sfile.h:
+ * daemon/opd_sfile.c:
+ * daemon/opd_trans.h:
+ * daemon/opd_trans.c:
+ * daemon/liblegacy/opd_sample_files.c:
+ * doc/oprofile.xml:
+ * libabi/abi.cpp:
+ * libabi/opimport.cpp:
+ * libabi/tests/abi_test.cpp:
+ * libop/op_mangle.h:
+ * libop/op_mangle.c:
+ * libop/op_sample_file.h:
+ * libpp/callgraph_container.cpp:
+ * libpp/image_errors.cpp:
+ * libpp/op_header.cpp:
+ * libpp/parse_filename.cpp:
+ * libpp/populate.cpp:
+ * libpp/profile.h:
+ * libpp/profile.cpp:
+ * libpp/profile_spec.cpp:
+ * libutil++/op_bfd.h:
+ * libutil++/op_bfd.cpp:
+ * pp/opannotate.cpp:
+ * pp/opgprof.cpp: add basic anon mapping support
+
+2005-04-28 John Levon <levon@movementarian.org>
+
+ * utils/opcontrol:
+ * doc/opcontrol.1.in:
+ * doc/oprofile.xml: add opcontrol --status
+
+2005-04-28 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/opd_sfile.c: clear only 256 entry in the sfile lru list
+
+2005-04-28 John Levon <levon@movementarian.org>
+
+ * libabi/abi.cpp:
+ * libabi/op_import.cpp: add cg_to_is_kernel to abi
+
+ * configure.in:
+ * libabi/tests/Makefile.am:
+ * libabi/tests/abi_test.cpp: move test to subdir
+
+2005-04-28 Philippe Elie <phil.el@wanadoo.fr>
+
+ * module/ia64/op_pmu.c: compile fix, pfm_syst_info has been added
+ between 2.4.20 and 2.4.21
+
+2005-04-27 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil/op_file.h: op_file_readable() accept only regular file
+ * libutil/op_file.c:
+ * libutil++/tests/file_manip_tests.cpp:
+
+2005-04-27 John Levon <levon@movementarian.org>
+
+ * daemon/opd_sfile.h:
+ * daemon/opd_sfile.c: rewrite. Fix --no-vmlinux taking up
+ CPU when using call graph profiling
+
+2005-04-27 John Levon <levon@movementarian.org>
+
+ * daemon/oprofiled.h: remove dead prototype
+
+2005-04-25 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/opd_mangling.c: protect last against sfile lru deletion
+ * daemon/opd_sfile.c: allow null sfile to sfile_get(), sfile_put()
+
+2005-04-24 John Levon <levon@movementarian.org>
+
+ * daemon/opd_cookie.h:
+ * daemon/opd_cookie.c:
+ * daemon/opd_trans.c:
+ * daemon/opd_sfile.c:
+ * daemon/opd_stats.h:
+ * daemon/opd_stats.c: handle NO_COOKIE (drop on the floor)
+
+ * m4/qt.m4: allow gcc 4.0 compile with Qt headers
+ by using -isystem
+
+2005-04-23 John Levon <levon@movementarian.org>
+
+ * configure.in: add --with-gcc, --with-binutils (for
+ development use only, undocumented)
+
+2005-04-22 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/locate_images.h: add a virtual dtor to extra_images::matcher
+
+2005-04-22 John Levon <levon@movementarian.org>
+
+ * doc/internals.xml: some paragraphs on call graphs
+
+ * libop/op_events.h:
+ * libop/op_events.c:
+ * libutil/op_deviceio.h:
+ * libutil/op_deviceio.c:
+ * libutil/op_fileio.h:
+ * libutil/op_fileio.c: remove dead code
+
+ * libutil/op_lock_file.h:
+ * libutil/op_lock_file.c: make a function static
+
+ * libutil++/Makefile.am:
+ * libutil++/op_bfd.h:
+ * libutil++/op_bfd.cpp:
+ * libutil++/bfd_support.h:
+ * libutil++/bfd_support.cpp: move lots of BFD gunk into
+ a separate file. Fix synth symbols support, with lots of
+ testing by Maynard.
+
+ * libutil++/comma_list.h: remove unused set_p
+
+ * pp/opannotate.cpp: complain less verbosely if the input file
+ couldn't be found
+
+2005-04-14 John Levon <levon@movementarian.org>
+
+ * libutil++/growable_vector.h:
+ * libpp/diff_container.cpp: fix fill()
+
+ * pp/opreport.cpp: fix multiple apps for diff output
+
+2005-04-14 John Levon <levon@movementarian.org>
+
+ * daemon/opd_interface.h:
+ * daemon/opd_trans.c: remove legacy TRACE_END
+
+ * daemon/liblegacy/opd_kernel.c:
+ * daemon/liblegacy/opd_proc.c: avoid attributing "no mapping"
+ samples to vmlinux when using --no-vmlinux via a sick hack
+
+2005-04-13 John Levon <levon@movementarian.org>
+
+ * libutil++/growable_vector.h: add fill()
+
+ * libutil++/diff_container.cpp: use it
+
+ * libpp/symbol_sort.cpp: code clean up
+
+2005-04-13 John Levon <levon@movementarian.org>
+
+ * libpp/diff_container.h:
+ * libpp/diff_container.cpp: syms doesn't need to be a member
+
+2005-04-13 Nathan Tallent <eraxxon@cs.rice.edu>
+
+ * utils/opcontrol: fix unquoted variable references in 'test'
+ expressions
+
+2005-04-13 Maynard Johnson <maynardj@us.ibm.com>
+
+ * libutil++/op_bfd.cpp: skip null-name section symbols
+
+2005-04-12 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/string_manip.cpp: fix double formating when value are
+ negative
+
+2005-04-12 John Levon <levon@movementarian.org>
+
+ * libpp/arrange_profiles.h:
+ * libpp/arrange_profiles.cpp:
+ * pp/opreport_options.cpp:
+ * pp/common_option.cpp: verify diff profile classes match
+
+2005-04-12 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml:
+ * doc/oprofile.1.in: document diff profiles
+
+2005-04-12 John Levon <levon@movementarian.org>
+
+ * libpp/diff_container.cpp: fix duplicate syms in output
+
+ * pp/opreport.cpp:
+ * libpp/diff_container.h:
+ * libpp/diff_container.cpp: implement thresholding etc.
+
+2005-04-12 John Levon <levon@movementarian.org>
+
+ * libpp/Makefile.am:
+ * libpp/count_array.cpp:
+ * libpp/count_array.h:
+ * libpp/diff_container.cpp:
+ * libpp/diff_container.h:
+ * libpp/format_flags.h:
+ * libpp/format_output.cpp:
+ * libpp/format_output.h:
+ * libpp/profile_spec.cpp:
+ * libpp/profile_spec.h:
+ * libpp/symbol.h:
+ * libpp/symbol_functors.cpp:
+ * libpp/symbol_sort.cpp:
+ * libpp/symbol_sort.h:
+ * libutil++/Makefile.am:
+ * libutil++/growable_vector.h:
+ * libutil++/string_manip.cpp:
+ * libutil++/string_manip.h:
+ * pp/common_option.cpp:
+ * pp/common_option.h:
+ * pp/opannotate.cpp:
+ * pp/opannotate_options.cpp:
+ * pp/opannotate_options.h:
+ * pp/oparchive.cpp:
+ * pp/oparchive_options.cpp:
+ * pp/oparchive_options.h:
+ * pp/opdiff.cpp:
+ * pp/opdiff_options.cpp:
+ * pp/opdiff_options.h:
+ * pp/opgprof.cpp:
+ * pp/opgprof_options.cpp:
+ * pp/opgprof_options.h:
+ * pp/opreport.cpp:
+ * pp/opreport_options.cpp:
+ * pp/opreport_options.h: implement an initial version of diff
+ profiling
+
+2005-04-11 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml:
+ * doc/opreport.1.in:
+ * doc/opannotate.1.in:
+ * pp/opreport_options.cpp:
+ * pp/opannotate_options.cpp: add -D and -%
+
+2005-04-11 John Levon <levon@movementarian.org>
+
+ * pp/opannotate.cpp: fix opannotate matching several binaries
+
+2005-04-09 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/op_bfd.cpp: fix a segfault if a binary file can't be
+ accessed (opreport -gl; opannotate) problem and solution pointed
+ by Maynard P. Johnson <maynardj@us.ibm.com>.
+ * libutil++/op_bfd.h: op_bfd member function must check for a NULL
+ ibfd before using it.
+
+2005-04-07 John Levon <levon@movementarian.org>
+
+ * libutil/tests/Makefile.am:
+ * libutil++/tests/Makefile.am:
+ * libdb/tests/Makefile.am:
+ * libop/tests/Makefile.am: fix tests build
+
+2005-04-07 John Levon <levon@movementarian.org>
+
+ * m4/Makefile.am:
+ * m4/binutils.m4:
+ * configure.in: move binutils stuff into a macro
+
+ * doc/oprofile.xml: fixes and improvements
+
+2005-04-07 John Levon <levon@movementarian.org>
+
+ * libpp/callgraph_container.cpp: hoist image/app name lookup
+ outside of the loop
+
+2005-04-07 John Levon <levon@movementarian.org>
+
+ * libutil++/op_bfd.cpp: performance improvements with handling
+ symbols
+
+2005-04-06 John Levon <levon@movementarian.org>
+
+ * libpp/populate.h:
+ * libpp/populate.cpp:
+ * libpp/callgraph_container.cpp:
+ * libutil++/cached_value.h:
+ * libutil++/op_bfd.h:
+ * libutil++/op_bfd.cpp:
+ * pp/opannotate.cpp:
+ * pp/opreport.cpp:
+ * libutil++/tests/Makefile.am:
+ * libutil++/tests/cached_value_tests.cpp: tweak CRC buffer.
+ Do delayed debug info searching (makes no actual difference).
+
+2005-04-05 John Levon <levon@movementarian.org>
+
+ * libpp/format_output.cpp: add separator at first function
+ for opreport -c
+
+2005-04-05 John Levon <levon@movementarian.org>
+
+ * libpp/callgraph_container.h:
+ * libpp/callgraph_container.cpp:
+ * pp/opreport.cpp:
+ * pp/opreport_options.cpp: implement -i / -e for
+ opreport -c
+
+2005-04-05 John Levon <levon@movementarian.org>
+
+ * libpp/format_output.h:
+ * libpp/format_output.cpp:
+ * pp/opreport.cpp:
+ * pp/opreport_options.cpp: implement --global-percent
+ for opreport -c
+
+2005-04-04 John Levon <levon@movementarian.org>
+
+ * configure.in:
+ * doc/Makefile.am:
+ * doc/oprofile.xml:
+ * doc/opstack.1.in:
+ * doc/opreport.1.in:
+ * doc/oprofile.1.in:
+ * pp/.cvsignore:
+ * pp/Makefile.am:
+ * pp/opreport.cpp:
+ * pp/opreport_options.cpp:
+ * pp/opreport_options.h:
+ * pp/opstack.cpp:
+ * pp/opstack_options.cpp:
+ * pp/opstack_options.h: remove opstack in favour of opreport -c
+
+ * libpp/callgraph_container.cpp: fix for new call-graph code
+
+ * doc/oprofile.xml:
+ * doc/oparchive.1.in: document -x, re-organise manual
+
+2005-04-04 Maynard Johnson <maynardj@us.ibm.com>
+
+ * configure.in: further check for bfd synthesised
+ symbols support
+
+2005-04-04 John Levon <levon@movementarian.org>
+
+ * libpp/callgraph_container.cpp:
+ * libpp/callgraph_container.h:
+ * libpp/format_flags.h:
+ * libpp/format_output.cpp:
+ * libpp/format_output.h:
+ * libpp/symbol.cpp:
+ * libpp/symbol.h:
+ * libpp/symbol_sort.cpp:
+ * libpp/symbol_sort.h:
+ * libutil++/op_bfd.cpp:
+ * pp/common_option.cpp:
+ * pp/common_option.h:
+ * pp/opstack.cpp:
+ * pp/opstack_options.cpp:
+ * pp/opstack_options.h: re-whack call-graph collection
+ and output format
+
+2005-04-03 Maynard Johnson <maynardj@us.ibm.com>
+
+ * configure.in:
+ * libutil++/op_bfd.h:
+ * libutil++/op_bfd.cpp: synthesis dotted symbols
+ if necessary
+
+2005-03-31 John Levon <levon@movementarian.org>
+
+ * HACKING:
+ * TODO:
+ * configure.in:
+ * doc/Makefile.am:
+ * doc/op_help.1.in:
+ * doc/ophelp.1.in:
+ * doc/oprofile.xml:
+ * libabi/.cvsignore:
+ * libabi/Makefile.am:
+ * libabi/opimport.cpp:
+ * utils/.cvsignore:
+ * utils/Makefile.am:
+ * utils/opcontrol:
+ * utils/ophelp.c: rename op_import->opimport,
+ op_help->ophelp. Allow normal user to use
+ opcontrol --list-events
+
+2005-03-31 John Levon <levon@movementarian.org>
+
+ * doc/internals.xml: more internals docs
+
+2005-03-29 John Levon <levon@movementarian.org>
+
+ * libpp/callgraph_container.h:
+ * libpp/callgraph_container.cpp:
+ * libpp/format_output.h:
+ * libpp/format_output.cpp:
+ * libpp/profile_container.h:
+ * libpp/symbol.h:
+ * libpp/symbol_sort.h:
+ * libpp/symbol_sort.cpp:
+ * libpp/symbol_container.h:
+ * libpp/symbol_container.cpp:
+ * pp/opreport_options.h: header file cleanup
+
+2005-03-26 John Levon <levon@movementarian.org>
+
+ * Makefile.am:
+ * doc/oprofile.xml:
+ * m4/configmodule.m4:
+ * module/x86/Makefile.in:
+ * module/x86/hammer_entry.S:
+ * module/x86/hammer_ia32entry.S:
+ * module/x86/hammer_op_syscalls.c:
+ * module/x86/hammer_oprofile_nmi.S:
+ * module/x86/op_apic.h:
+ * module/x86/op_arch.h:
+ * module/x86/op_nmi.c: remove x86-64 support for 2.4
+ kernels, as it's non-functional
+
+2005-03-26 John Levon <levon@movementarian.org>
+
+ * daemon/oprofiled.c: honour oprofiled -v first, complain
+ if --events option is missing instead of core dumping
+
+ * doc/oprofiled.xml: explain opreport -d behaviour for
+ no-symbol binaries
+
+2005-03-14 Maynard Johnson <maynardj@us.ibm.com>
+
+ * utils/op_help.c:
+ * doc/oprofile.xml:
+ Update PPC64-related documentation to include URL links to
+ IBM publications.
+
+2005-03-22 John Levon <levon@movementarian.org>
+
+ * configure.in: bump to 0.9cvs
+
+2005-03-19 Philippe Elie <phil.el@wanadoo.fr>
+
+ * configure.in: bump to 0.8.2
+
+2005-03-18 Philippe Elie <phil.el@wanadoo.fr>
+
+ * events/i386/p4/events:
+ * events/i386/p4/unit_masks:
+ * events/i386/p4-ht/events:
+ * events/i386/p4-ht/unit_masks: remove FRONT_END_EVENT, EXECUTION_EVENT
+ and REPLAY_EVENT.
+
+ * libop/tests/alloc_counter_tests.c: update test according events
+ removal
+
+2005-03-18 Philippe Elie <phil.el@wanadoo.fr>
+
+ * utils/opcontrol: revert last patch, bash can't do integer
+ arithmetic on hexadecimal.
+
+2005-02-21 John Levon <levon@movementarian.org>
+
+ * utils/opcontrol: further validation of the kernel range to
+ prevent an unrelocated vmlinux being used
+
+2005-02-07 John Levon <levon@movementarian.org>
+
+ * events/arm/xscale1/unit_masks: fix 'zero' unit mask
+
+2005-01-25 Maynard Johnson <maynardj@us.ibm.com>
+
+ * doc/oprofile.xml: Add PowerPC 64-bit processor support information
+
+2005-01-24 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/op_bfd.cpp: always initialize op_bfd_symbol:symb_hidden
+ and symb_weak, not a bug fix but a cleanup.
+
+2005-01-04 Andy Fleming <afleming@freescale.com>
+
+ * events/Makefile.am:
+ * events/ppc/e500/events:
+ * events/ppc/e500/unit_masks:
+ * libop/op_events.c:
+ * libop/op_cpu_type.h:
+ * libop/op_cpu_type.c:
+ * utils/op_help.c: Add PPC e500 support
+
+2005-01-02 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opannotate.cpp: fix #1093162 by simplifying the code, this was
+ likely to be a compiler problem but the new code is simpler.
diff --git a/ChangeLog-2006 b/ChangeLog-2006
new file mode 100644
index 0000000..9451bb3
--- /dev/null
+++ b/ChangeLog-2006
@@ -0,0 +1,296 @@
+2006-12-14 Maynard Johnson <maynardj@us.ibm.com>
+
+ * doc/oprofile.xml:
+ * events/Makefile.am:
+ * events/ppc64/cell-be/events:
+ * events/ppc64/cell-be/unit_masks:
+ * libop/op_cpu_type.c:
+ * libop/op_cpu_type.h:
+ * libop/op_events.c:
+ * utils/opcontrol:
+ * utils/ophelp.c Add support for Cell Broadband Engine
+
+2006-12-14 Dave Nomura <dcnltc@us.ibm.com>
+
+ * daemon/init.c: move open_opd_files call to initialization phase
+
+2006-12-11 Maynard Johnson <maynardj@us.ibm.com>
+
+ * m4/kerneloption.m4:
+ * m4/kernelversion.m4: eliminate/replace usage of obsolete kernel
+ header linux/config.h
+
+
+2006-12-06 Daniel Jacobowitz <dan@debian.org>
+
+ * libopt++/popt_options.cpp: complete fix for static
+ initialisation ordering bug on ARM
+
+2006-11-24 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml:
+ * doc/oprofile.1.in: warn about braces parsing in differential
+ mode.
+
+ * doc/opreport.1.in:
+ * doc/oparchive.1.in:
+ * doc/opannotate.1.in:
+ * doc/opgprof.1.in: point explicitly to oprofile(1)
+
+ * pp/opreport_options.cpp: --xml is incompatible with
+ differential profiles.
+
+2006-11-22 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libop/op_alloc_counter.c: reapply 2006-8-03 Jeremiah Lott patch
+ which was accidentally reverted, as a sideeffect this patch change
+ counter allocation order. It can't hurt since our storage don't
+ take care about counter number.
+ * libop/tests/alloc_counter_tests.c: add a test case for this patch.
+ Take care about counter allocation order change.
+
+2006-11-19 Maynard Johnson <maynardj@us.ibm.com>
+
+ * doc/oprofile.xml: Document platforms where callgraph is supported
+
+2006-11-17 Dave Nomura <dcnltc@us.ibm.com>
+
+ * doc/Makefile.am:
+ * doc/opreport.1.in:
+ * doc/opreport.xsd:
+ * doc/oprofile.xml:
+ * libop/op_alloc_counter.c:
+ * libpp/Makefile.am:
+ * libpp/arrange_profiles.cpp:
+ * libpp/format_output.cpp:
+ * libpp/format_output.h:
+ * libpp/op_header.cpp:
+ * libpp/profile_container.cpp:
+ * libpp/symbol.cpp:
+ * libpp/symbol.h:
+ * libpp/xml_utils.cpp:
+ * libpp/xml_utils.h:
+ * libutil++/Makefile.am:
+ * libutil++/bfd_support.cpp:
+ * libutil++/cverb.cpp:
+ * libutil++/cverb.h:
+ * libutil++/op_bfd.cpp:
+ * libutil++/op_bfd.h:
+ * libutil++/xml_output.cpp:
+ * libutil++/xml_output.h:
+ * pp/common_option.cpp:
+ * pp/common_option.h:
+ * pp/oparchive_options.cpp:
+ * pp/opgprof_options.cpp:
+ * pp/opreport.cpp:
+ * pp/opreport_options.cpp:
+ * pp/opreport_options.h: XML output support.
+
+2006-8-03 Jeremiah Lott <jeremiah.lott@timesys.com>
+
+ * libop/op_alloc_counter.c: allocate_counter(...) was returning
+ prior to considering all possible allocation strategies.
+
+2006-11-15 Adam Bordelon <me@cs.rice.edu>
+
+ * doc/internals.xml:
+ * doc/opannotate.1.in:
+ * doc/oparchive.1.in:
+ * doc/opcontrol.1.in:
+ * doc/opgprof.1.in:
+ * doc/opreport.1.in:
+ * doc/oprofile.xml: Documented --session-dir option.
+
+ * daemon/init.c:
+ * daemon/liblegacy/init.c:
+ * daemon/oprofiled.c:
+ * libop/Makefile.am:
+ * libop/op_config.c:
+ * libop/op_config.h:
+ * libop/op_config_24.h:
+ * libop/op_mangle.c:
+ * libpp/profile_spec.c:
+ * pp/common_option.cpp:
+ * utils/opcontrol: Added --session-dir option, to place sample database in dir instead of default location (/var/lib/oprofile), and program can be run as normal user.
+
+2006-11-15 John Levon <levon@movementarian.org>
+
+ * events/x86-64/hammer/events: fix event names with '/' in them
+ (bug 1597054)
+
+ * libop/op_events.c: check for '/' and fail if so
+
+2006-11-09 Philippe Elie <phil.el@wanadoo.fr>
+
+ * doc/opreport.1.in:
+ * doc/oprofile.xml: --long-filenames : -f is the short opt, not -l
+
+2006-10-16 Richard Purdie <rpurdie@openedhand.com>
+
+ * libutil++/bfd_support.cpp: Ignore uninteresting arm mapping symbols
+
+2006-10-16 Richard Purdie <rpurdie@openedhand.com>
+
+ * utils/opcontrol: Remove a bashism in validate_separate_args()
+
+2006-10-13 Maynard Johnson <maynardj@us.ibm.com>
+
+ * doc/opcontrol.1.in: Document callgraph support for PowerPC
+
+2006-09-25 Jon Callan <Jon.Callan@arm.com>
+
+ * libopt++/popt_options.cpp: fix static init order problem, seen
+ on ARM.
+
+2006-09-21 Dean Gaudet <dgaudet@users.sourceforge.net>
+
+ * events/i386/core_2/events: rename some events
+ * events/i386/core_2/unit_masks: various fixes for
+ double-counting events
+
+2006-09-21 Mark A. Greer <mgreer@mvista.com>
+
+ * events/ppc/7450/events:
+ * events/ppc/7450/unit_masks:
+ * utils/ophelp.c: ppc 745x event improvements.
+
+2006-09-15 Will Cohen <wcohen@redhat.com>
+
+ * Makefile.am: Add ChangeLog-2004 and ChangeLog-2005 to distro.
+
+2006-09-15 Will Cohen <wcohen@redhat.com>
+
+ * configure.in: Bump to 0.9.3cvs.
+
+2006-09-15 Will Cohen <wcohen@redhat.com>
+
+ * configure.in: Bump to 0.9.2.
+
+2006-09-11 Will Cohen <wcohen@redhat.com>
+
+ * configure.in: Bump to 0.9.2.1rc1.
+
+2006-09-11 Will Cohen <wcohen@redhat.com>
+
+ * events/i386/core_2/unit_masks:
+ * events/i386/core_2/events: Correct names and masks.
+
+2006-09-07 Benjamin LaHaise <bcrl@kvack.org>
+
+ * events/i386/core_2/events: Correct some event names.
+
+2006-09-05 Will Cohen <wcohen@redhat.com>
+
+ * configure.in: bump to 0.9.2
+
+2006-09-05 Will Cohen <wcohen@redhat.com>
+
+ * libpp/symbol_container.cpp: Explicit casting.
+
+2006-08-27 Ray Bryant <raybry@amd.com>
+
+ * events/x86-64/hammer/events:
+ * events/x86-64/hammer/unit_masks:
+ * libop/op_events.h: make names match the BKDG names from AMD
+
+2006-08-22 Benjamin LaHaise <bcrl@kvack.org>
+
+ * events/Makefile.am:
+ * events/i386/core_2/events:
+ * events/i386/core_2/unit_masks:
+ * libop/op_cpu_type.h:
+ * libop/op_cpu_type.c:
+ * libop/op_events.c:
+ * utils/ophelp.c: support Intel Core 2 events
+
+2006-07-15 Luca Barbato <lu_zero@gentoo.org>
+
+ * events/Makefile.am:
+ * events/ppc/7450/events:
+ * events/ppc/7450/unit_masks:
+ * libop/op_cpu_type.h:
+ * libop/op_cpu_type.c:
+ * libop/op_events.c:
+ * utils/ophelp.c: support PowerPC G4 events
+
+2006-06-21 Ralf Baechle <ralf@linux-mips.org>
+
+ * libop/op_cpu_type.h:
+ * utils/ophelp.c:
+ * libop/op_cpu_type.c:
+ * libop/op_events.c:
+ * events/Makefile.am:
+ * events/mips/5K:
+ * events/mips/20K:
+ * events/mips/25K:
+ * events/mips/34K: add new MIPS support.
+
+2006-05-13 Benjamin LaHaise <bcrl@kvack.org>
+
+ * events/Makefile.am:
+ * events/i386/core/events:
+ * events/i386/core/unit_masks:
+ * libop/op_cpu_type.h:
+ * libop/op_cpu_type.c:
+ * libop/op_events.c:
+ * module/x86/cpu_type.c:
+ * utils/ophelp.c: support Intel Core Duo events
+
+2006-03-01 Andreas Krebbel <krebbel1@de.ibm.com>
+
+ * utils/opcontrol: (do_save_setup): Save KERNEL_RANGE and XEN_RANGE
+ values into setup file.
+ (do_load_setup): Print KERNEL_RANGE, XENIMAGE and XEN_RANGE values in
+ verbose mode.
+
+2006-03-19 John Levon <levon@movementarian.org>
+
+ * daemon/opd_anon.c: bump LRU size to avoid significant maps
+ parsing overhead.
+
+2006-03-19 John Levon <levon@movementarian.org>
+
+ * daemon/opd_anon.c:
+ * daemon/opd_sfile.h:
+ * daemon/opd_sfile.c: make sure we protect trans->last
+ if it's an anon sf, and we need to do cleanup. Speed
+ cleanup somewhat.
+
+2006-02-17 Maynard Johnson <maynardj@us.ibm.com>
+
+ * doc/oprofile.xml:
+ * events/ppc64/power5+/events:
+ * events/ppc64/power5+/event_mappings:
+ * events/ppc64/unit_masks:
+ * events/Makefile.am:
+ * libop/op_events.c:
+ * libop/op_cpu_type.c:
+ * libop/op_cpu_type.h:
+ * utils/opcontrol:
+ * utils/ophelp.c: Add support for Power5+
+
+2006-02-10 Will Cohen <wcohen@redhat.com>
+
+ * utils/opcontrol: Use full paths for which and dirname.
+
+2006-01-22 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml: mention 2.4 + power management
+
+2006-01-16 Mike Carlson <corfe83dev@gmail.com>
+
+ * doc/opcontrol.1.in: fix typo
+
+2006-01-16 Jose Renato Santos <jsantos@hpl.hp.com>
+
+ * daemon/init.c:
+ * daemon/opd_interface.h:
+ * daemon/opd_kernel.h:
+ * daemon/opd_kernel.c:
+ * daemon/opd_trans.c:
+ * daemon/oprofiled.h:
+ * daemon/oprofiled.c:
+ * doc/opcontrol.1.in:
+ * utils/opcontrol: Added support for Xen
+
+See ChangeLog-2005 for earlier changelogs.
diff --git a/ChangeLog-2007 b/ChangeLog-2007
new file mode 100644
index 0000000..c377825
--- /dev/null
+++ b/ChangeLog-2007
@@ -0,0 +1,757 @@
+2007-12-11 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/op_bfd.h: remove sym_offset(), we can get what did
+ sym_offset() in a simpler way at call site
+ * libutil++/op_bfd.cpp:
+ * libpp/callgraph_container.cpp:
+ * libpp/profile_container.cpp:
+ * libpp/profile_container.h:
+
+2007-11-25 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/opd_stats.c: dump invalid pc count, added to oprofile stats
+ fs 2.6.24-rc
+
+2007-11-15 Dave Nomura <dcnltc@us.ibm.com>
+
+ * fixed a some typos in manually patched event files
+
+2007-11-15 Dave Nomura <dcnltc@us.ibm.com>
+
+ * libpp/format_output.cpp: output XML SYMBOL_DATA for callers/callees
+ * libpp/format.h:
+
+2007-11-15 Dave Nomura <dcnltc@us.ibm.com>
+
+ * events/ppc64/power6/event_mappings: updated Power6 event files
+ * events/ppc64/power6/events:
+
+2007-11-15 Philippe Elie <phil.el@wanadoo.fr>
+
+ handle --root which act as a replacement (a prefix) for the / fs
+ * libpp/locate_images.cpp: root path search taking care if a
+ root path is given we never search through "/"
+ * libpp/locate_images.h:
+ * libpp/populate.cpp:
+ * libpp/populate_for_spu.cpp: use the right path to check last
+ modification time, this is yet again a change in behavior, module
+ was never found a this point, even if we found them later, and we
+ didn't try to check_mtime(), so opreport is again a bit more verbose
+ * libutil++/op_bfd.cpp: be more cautious when checking if we can try to
+ open the bfd file, don't open it in the '/' fs if a --root is given
+ * libpp/profile_spec.cpp: convey the root_path all over the code.
+ * libpp/profile_spec.h:
+ * pp/common_option.cpp:
+ * pp/common_option.h:
+ * pp/opannotate_options.cpp:
+ * pp/oparchive.cpp:
+ * pp/oparchive_options.cpp:
+ * pp/opgprof_options.cpp:
+ * pp/opreport_options.cpp:
+ * doc/opannotate.1.in: document --root
+ * doc/oparchive.1.in:
+ * doc/opgprof.1.in:
+ * doc/opreport.1.in:
+ * doc/oprofile.xml:
+
+2007-11-10 Dave Nomura <dcnltc@us.ibm.com>
+
+ * libutil++/bfd_support.cpp: is_correct_function() is itended to deal
+ with missing debug information, if linenr != 0, don't call it since
+ we know we have valid debug info
+
+2007-11-08 Haavard Skinnemoen <hskinnemoen@atmel.com>
+
+ * utils/opcontrol: Busybox's implementation of "kill" doesn't
+ understand the "-s SIG" option. Use "-SIG" instead.
+
+2007-11-07 Philippe Elie <phil.el@wanadoo.fr>
+
+ Compile fix for gcc 2.95.3
+ * libpp/format_output.cpp: unused local var, then unused params
+ * libpp/format_output.h:
+ * libpp/op_header.cpp: missing include
+ * libutil++/bfd_spu_support.cpp: gcc 2.95.3 do not like struct bfd,
+ 2.95 get it wrong probably but anyway all these struct are useless.
+
+2007-11-06 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opannotate.cpp: for module we didn't use the right image name,
+ this bug appeared after 0.9.3 release
+
+2007-11-05 Richard Purdie <rpurdie@openedhand.com>
+
+ * events/arm/armv6/events: Fix armv6 events to match mainline kernels
+
+2007-11-04 Philippe Elie <phil.el@wanadoo.fr>
+
+ * utils/opcontrol: nmi watchdog is now cleanly handled in the kernel
+ but it can be on by default even if CONFIG_WATCHDOG=n, a sysctl
+ exists to put it off. We need to check this in opcontrol since we
+ returned success if a counter is missing and starting oprofile with
+ oprof_start silently failed.
+
+2007-11-03 Richard Purdie <rpurdie@openedhand.com>
+
+ * pp/oparchive.cpp: Check list_files option before calling
+ create_dir() for debug files.
+
+2007-11-03 Philippe Elie <phil.el@wanadoo.fr>
+
+ with --xml and --details, bfd open/close was done one time per
+ symbols, not one time per application. Solved by moving open/close
+ in the caller and cache bfd object, this work because --xml imply
+ symbols are sorted by app name then lib name. This is not perfect as
+ we can open/close multiple time bfd object with --separate=library
+ but still a real win. Quick test showed an improvement by over 40
+ times. Improvement grows as number of symbols per binary.
+ * libpp/xml_utils.cpp: move bfd open ...
+ * libpp/xml_utils.h:
+ * libpp/format_output.cpp: ... here
+ * libpp/format_output.h:
+ * pp/opreport.cpp:
+
+2007-11-02 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/opreport_options.cpp: --xml is not compatible with --sort since
+ xml output need some predefined sort options, we warned against
+ the use of --sort but didn't reset the sort options to default.
+
+2007-11-01 Philippe Elie <phil.el@wanadoo.fr>
+
+ * pp/oparchive_options.cpp: oparchive need to be run as root if you
+ want to get save all binaries, generally I don't like to restrict
+ user to do silly things but --output-directory / is an easy typo
+ to do and will completely screw up the box.
+
+2007-10-30 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/format_output.cpp: Fix #931882, xml output not changed at
+ the moment.
+
+2007-10-30 Philippe Elie <phil.el@wanadoo.fr>
+
+ Prepare #931882 fix, continue to move down real filename
+ retrieval by extending image_name_storage which can hold now the
+ real image name and the image as derived from the sample filename.
+ Use the new api in a compatible way with the old behavior, no output
+ change intended.
+ * libpp/format_output.cpp:
+ * libpp/format_output.h:
+ * libpp/locate_images.cpp:
+ * libpp/locate_images.h:
+ * libpp/name_storage.cpp:
+ * libpp/name_storage.h:
+ * libpp/symbol.cpp:
+ * libpp/symbol.h:
+ * libpp/xml_utils.cpp:
+ * libpp/xml_utils.h:
+ * pp/opreport.cpp:
+
+2007-10-29 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/image_errors.cpp: Pass to image_errors the archive_path through
+ an extra_images to ensure no duplicate error message occur nor we
+ miss error, this fix two bugs, one with differential profile
+ an error message was missing when two binary are missing, another
+ with opreport where the same error message was duplicate because in
+ on case we passed the real binary name (prefixed with archive_path)
+ while latter we passed the short form of the binary name.
+ * libpp/image_errors.h:
+ * libpp/callgraph_container.cpp:
+ * libpp/populate.cpp:
+ * libpp/populate_for_spu.cpp:
+ * libpp/xml_utils.cpp:
+ * libutil++/op_bfd.h:
+
+ * pp/opannotate.cpp: global var archive_path is no longer used
+ * pp/opannotate_options.cpp:
+ * pp/opannotate_options.h:
+ * pp/oparchive.cpp:
+ * pp/opgprof.cpp:
+ * pp/opgprof_options.h:
+ * pp/opreport.cpp:
+ * pp/opreport_options.cpp:
+ * pp/opreport_options.h:
+
+2007-10-29 Philippe Elie <phil.el@wanadoo.fr>
+
+ Cleanup the way per spec archive_path is handled, as extra_images
+ is built using an archive_path it make no sense to pass archive_path
+ as parameter all over the place, rather make it a member of
+ extra_images and use it, anyway it was required the archive_path
+ passed to find_image_path() was the same as used to build the
+ extra_images.
+
+ As a side effect it fix a corner case: oparchive archive:tmp1 -o tmp2
+ was not working for module, archiving from an archive should work now.
+ * libpp/arrange_profiles.cpp:
+ * libpp/arrange_profiles.h:
+ * libpp/callgraph_container.cpp:
+ * libpp/callgraph_container.h:
+ * libpp/locate_images.cpp:
+ * libpp/locate_images.h:
+ * libpp/populate.cpp:
+ * libpp/populate.h:
+ * libpp/populate_for_spu.cpp:
+ * libpp/populate_for_spu.h:
+ * libpp/profile_spec.cpp:
+ * libpp/xml_utils.cpp:
+ * libpp/xml_utils.h:
+ * libutil++/op_bfd.cpp:
+ * libutil++/op_bfd.h:
+ * libutil++/op_spu_bfd.cpp:
+ * pp/opannotate.cpp:
+ * pp/oparchive.cpp:
+ * pp/oparchive_options.cpp:
+ * pp/oparchive_options.h:
+ * pp/opgprof.cpp:
+ * pp/opgprof_options.cpp:
+ * pp/opreport.cpp:
+
+2007-10-29 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/file_manip.cpp: do not create the output file if the input
+ file can not be read. It change oparchive behavior which created
+ empty file with input file like -rws--x--x 1 root root
+
+2007-10-28 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/format_output.cpp: minor overkill
+
+2007-10-27 Philippe Elie <phil.el@wanadoo.fr>
+
+ Fix #1819350, it turned out this implied another fix for differential
+ profile, extra_images must be built per profile specification not
+ globally so most of this patch pass an extra_images down to op_bfd.
+ The way image name resolution has changed. We fixup an image name
+ only when really needed, when opening a bfd file, when checking a
+ binary exists and when we try matching an image name with a profile
+ specification, this robustify differential profile. This patch also
+ allow a profile_spec ala image:*oprofile.ko which was broken too.
+ It's now mandatory to use the same -p option used with oparchive when
+ using an archive with other pp tools, it was already the case but was
+ broken, this patch does not clarify the documentation about this
+ point because I suspect oparchive should be modified to save at the
+ top level directory the contents of -p option, pp tools will use that
+ automatically and --image_path will be obsoleted when used with an
+ archive.
+
+ This patch except clarifying than --image-path with archive: is a bit
+ special does not add any user level visible change.
+ * libpp/arrange_profiles.cpp:
+ * libpp/arrange_profiles.h:
+ * libpp/callgraph_container.cpp:
+ * libpp/callgraph_container.h:
+ * libpp/locate_images.cpp:
+ * libpp/locate_images.h:
+ * libpp/populate.cpp:
+ * libpp/populate_for_spu.cpp:
+ * libpp/profile_container.cpp:
+ * libpp/profile_container.h:
+ * libpp/profile_spec.cpp:
+ * libpp/profile_spec.h:
+ * libpp/xml_utils.cpp:
+ * libpp/xml_utils.h:
+ * libutil++/Makefile.am:
+ * libutil++/op_bfd.cpp:
+ * libutil++/op_bfd.h:
+ * libutil++/op_spu_bfd.cpp:
+ * pp/common_option.cpp:
+ * pp/common_option.h:
+ * pp/opannotate.cpp:
+ * pp/opannotate_options.cpp:
+ * pp/oparchive.cpp:
+ * pp/oparchive_options.cpp:
+ * pp/opgprof.cpp:
+ * pp/opgprof_options.cpp:
+ * pp/opreport.cpp:
+ * pp/opreport_options.cpp:
+
+2007-10-27 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libpp/profile_spec.cpp: look like an obvious typo, we must fixup
+ the string we are parsing not a previously seen or empty string
+
+2007-10-25 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libutil++/sparse_array.h: size() return the max index while we
+ want the max index + 1, the only user is diff_container,
+ differential container is broken in 0.9.3. This fix bug #1820202
+
+2007-10-25 Philippe Elie <phil.el@wanadoo.fr>
+
+ * utils/opcontrol: fix the previous opcontrol --reset patch, it was
+ broken if the daemon is running because --reset imply --dump so
+ we can use this --reset shortcut only if the daemon is not running.
+
+2007-10-25 Philippe Elie <phil.el@wanadoo.fr>
+
+ * utils/opcontrol: if objdump is missing the error message is
+ obscure, this fix bug #1564920 by checking if objdump exists
+ and is an executable before using it
+
+2007-10-25 Philippe Elie <phil.el@wanadoo.fr>
+
+ * utils/opcontrol: --reset doesn't need to load the module, it was
+ counter-intuitive than the sequence opcontrol --deinit;
+ opcontrol --reset must be followed by another opcontrol --deinit
+
+2007-10-25 Philippe Elie <phil.el@wanadoo.fr>
+
+ * utils/opcontrol: error out earlier if the module is not loaded
+ even for --list-events or --dump to avoid obscure error message
+
+2007-10-24 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libop/op_config.h: bump sample filename format, should have been
+ done before 0.9.3
+ * libpp/op_header.cpp: do not use odb_open() to read the sample file
+ header, if it fails it can return EINVAL if sanity checking fails
+ so we can't know if the failure came from a sample file format
+ change or some other failure. This explain some "sample_filename:
+ Invalid argument" we got in bug report when user didn't cleanup
+ the sample file directory.
+ * libpp/profile.cpp: use read_header() first to check the sample file
+ format to get better error message.
+
+2007-10-19 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libop/op_events.c: force the use of hexa notation in event file for
+ the field intended to be in hexacidemal so make check will catch
+ attempt to use decimal notation for them.
+
+ * events/mips/20K/events: all event number were in decimal but parsed
+ as hexadecimal, this fix bug #1717298
+ * events/mips/24K/events:
+ * events/mips/25K/events:
+ * events/mips/5K/events:
+ * events/mips/r12000/events:
+ * events/mips/sb1/events:
+ * events/mips/vr5432/events:
+ * events/mips/vr5500/events:
+ * events/mips/34K/events: comment a bunch of overlapping event.
+ * events/ppc64/cell-be/unit_masks: well, 0 == 0x0 but it's easier
+ to catch real error by forcing hexa notation for default unit mask.
+
+ * libop/tests/alloc_counter_tests.c: fix mips/34K test, the used event
+ has been remoded
+
+2007-10-17 Philippe Elie <phil.el@wanadoo.fr>
+
+ * doc/oprofile.xml: fix dead url
+ * utils/ophelp.c:
+
+2007-10-17 Jason Yeh <jason.yeh@amd.com>
+
+ * events/x86-64/family10/events: This patch updates the events and
+ unit_masks files to match the BIOS and Kernel Developer's Guide
+ For AMD Family 10h Processors Rev 3.00 released on September 07,
+ 2007. The notable changes are L3 cache events and updates to
+ corresponding unit masks.
+ * events/x86-64/family10/unit_masks:
+
+2007-10-17 Philippe Elie <phil.el@wanadoo.fr>
+
+ * utils/opcontrol: newer shell accept if -z ... but older need
+ if test -z. This broke opcontrol --dump with bash 2.x and probably
+ other shell. With bash the error when running opcontrol as non root
+ was:
+ /usr/local/bin/opcontrol: line 1670: -z: command not found
+
+2007-10-12 Philippe Elie <phil.el@wanadoo.fr>
+
+ * libop/op_events.c: check for '.' inside event name, they can't work
+ * events/i386/core_2/events: change '.' by '_' in events name
+ * events/ppc64/cell-be/events:
+
+2007-10-11 Maynard Johnson <maynardj@us.ibm.com>
+
+ * events/ppc64/970MP/event_mappings: Turn off profiling in
+ hypervisor on 970MP to prevent lost interrupts
+
+2007-10-10 Maynard Johnson <maynardj@us.ibm.com>
+
+ * events/ppc64/970MP/events:
+ * events/ppc64/970MP/event_mappings: Fix MMCR values
+ and counter-to-event mappings on a few 970MP groups
+
+2007-10-09 Melchior Franz <mfranz@aon.at>
+
+ * libregex/op_regex.cpp: Fix broken string concatenation
+
+2007-10-05 Will Cohen <wcohen@redhat.com>
+
+ * utils/opcontrol: Modify opcontrol to allow short form -l and -d for
+ normal users.
+
+2007-09-25 Brian Twichell <tbrian@us.ibm.com>
+
+ * utils/opcontrol: Modify opcontrol to use a more inclusive
+ kernel range
+
+2007-08-23 Maynard Johnson <maynardj@us.ibm.com>
+
+ * daemon/opd_anon.c: Make anonymous sample recording
+ work with 32-bit OProfile and 64-bit anonymous code
+
+2007-08-14 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml:
+ * doc/opcontrol.1.in: clarify behaviour of opcontrol -e
+
+2007-08-02 Jens Wilke <jens.wilke@de.ibm.com>
+
+ * ChangeLog: Correct the date from previous patch (maynardj)
+
+ * libutil++/op_bfd.cpp: Fix sym_offset calculation.
+ Bug triggers on 64 bit systems with code mapped
+ with an address >4G.
+
+2007-08-02 Jens Wilke <jens.wilke@de.ibm.com>
+
+ * libpp/profile_container.cpp: Remove unnecessary offset
+ calculation.
+
+2007-07-18 Maynard Johnson <maynardj@us.ibm.com>
+
+ * doc/Makefile.am: Include buffers diagram in dist
+
+ * doc/oprofile.xml: Correct filename reference to opreport.xsd
+
+2007-07-16 Maynard Johnson <maynardj@us.ibm.com>
+
+ * configure.in: Bump to 0.9.4cvs.
+
+2007-07-16 Maynard Johnson <maynardj@us.ibm.com>
+
+ * configure.in:
+ * Makefile.am: Bump release to 0.9.3 and add a line to
+ EXTRA_DIST to distribute ChangeLog-2006.
+
+2007-07-09 Maynard Johnson <maynardj@us.ibm.com>
+
+ * doc/opreport.xsd:
+ * libpp/xml_utils.cpp: Correct schema version bump
+
+2007-07-02 Maynard Johnson <maynardj@us.ibm.com>
+
+ * libpp/populate_for_spu.cpp: Fix logic in is_spu_profile()
+ to handle '--separate=thread' option.
+
+2007-06-27 Maynard Johnson <maynardj@us.ibm.com>
+
+ * ChangeLog: ChangeLog cleanup
+
+2007-06-15 Maynard Johnson <maynardj@us.ibm.com>
+
+ * doc/opreport.xsd:
+ * libpp/xml_utils.cpp: Bump schema version to 2.0 to coincide with
+ callgraph elements added recently to the schema
+
+2007-06-13 Maynard Johnson <maynardj@us.ibm.com>
+
+ * doc/oprofile.xml:
+ * events/Makefile.am:
+ * events/ppc64/power5++/event_mappings:
+ * events/ppc64/power5++/events:
+ * events/ppc64/power5++/unit_masks:
+ * libop/op_cpu_type.c:
+ * libop/op_cpu_type.h:
+ * libop/op_events.c:
+ * utils/opcontrol:
+ * utils/ophelp.c: Add support for POWER5++ (i.e., POWER5+ with PMU
+ set to POWER6 mode)
+
+2007-06-12 dean gaudet <dean@arctic.org>
+
+ * events/i386/core_2/events:
+ * events/i386/core_2/unit_masks: updates to match
+ 253669-022US ISA vol 3B from Intel. (Including fix
+ for #1580064 from Arun Sharma.)
+
+2007-06-08 dean gaudet <dean@arctic.org>
+
+ * events/x86-64/hammer/events:
+ * events/x86-64/hammer/unit_masks: updates from December 2006
+ AMD update
+
+2007-05-31 Maynard Johnson <maynardj@us.ibm.com>
+
+ * libpp/symbol.h:
+ * libutil++/bfd_support.h:
+ * m4/cellspubfdsupport.m4: Fixups for compile failures on older Linux
+ distributions
+
+2007-05-29 Dave Nomura <dcnltc@us.ibm.com>
+
+ * libregex/demangle_symbol.cpp: Strip off leading '.' generated for elf6r-powerpc targets in mangled symbol names.
+
+2007-05-24 Richard Purdie <rpurdie@openedhand.com>
+
+ * events/arm/xscale1/events:
+ * events/arm/xscale2/events: Add extra Xscale PMU event definitions
+
+2007-05-24 Richard Purdie <rpurdie@openedhand.com>
+
+ * events/arm/armv6/events:
+ * events/arm/armv6/unit_masks:
+ * libop/op_cpu_type.c:
+ * libop/op_cpu_type.h:
+ * libop/op_events.c:
+ * utils/ophelp.c: Name ARM11 support to be consistent with the kernel,
+ remove some duplicate code and add some extra events
+
+2007-05-24 Richard Purdie <rpurdie@openedhand.com>
+
+ * oprofile/pp/oparchive.cpp: If the debug files have the same name
+ as the original binary, the binary gets overwritten. Add in a .debug
+ directory to avoid this.
+
+2007-05-23 Joerg Wagner <wagner@ccrl-nece.de>
+
+ * events/Makefile.am:
+ * events/arm/mpcore/events:
+ * events/arm/mpcore/unit_masks:
+ * libop/op_cpu_type.c:
+ * libop/op_cpu_type.h:
+ * libop/op_events.c:
+ * utils/ophelp.c: ARM MPCore support
+
+2007-05-23 Riku Voipio <riku.voipio@iki.fi>
+
+ * events/Makefile.am:
+ * events/arm/armv6/events:
+ * events/arm/armv6/unit_masks:
+ * libop/op_cpu_type.c:
+ * libop/op_cpu_type.h:
+ * libop/op_events.c:
+ * utils/ophelp.c: ARM11 support
+
+2007-05-21 Richard Purdie <rpurdie@openedhand.com>
+
+ * doc/opreport.xsd:
+ * libpp/format_output.cpp:
+ * libpp/format_output.h:
+ * libpp/xml_utils.cpp:
+ * libutil++/xml_output.cpp:
+ * libutil++/xml_output.h:
+ * pp/opreport.cpp:
+ * pp/opreport_options.cpp: Add callgraph XML output
+
+2007-05-20 Dean Gaudet <dgaudet@users.sourceforge.net>
+
+ * events/i386/core_2/events: ITLB_MISS_RETIRED,MEM_LOAD_RETIRED
+ only work with counter 0
+
+2007-05-20 Richard Purdie <rpurdie@openedhand.com>
+
+ * libpp/callgraph_container.cpp:
+ * libpp/callgraph_container.h:
+ * libpp/format_output.cpp:
+ * libpp/format_output.h:
+ * libpp/symbol.h:
+ * libpp/symbol_sort.cpp:
+ * libpp/symbol_sort.h:
+ * pp/opreport.cpp: Convert cg_collection to symbol_collection and use
+ dynamic casting allowing more code reuse for callgraphs
+
+2007-05-19 Richard Purdie <rpurdie@openedhand.com>
+
+ * doc/oparchive.1.in:
+ * doc/oprofile.xml:
+ * pp/oparchive.cpp:
+ * pp/oparchive_options.cpp:
+ * pp/oparchive_options.h: Add --list-files option to list all files
+ that would be handled by oparchive.
+
+2007-05-19 Olof Johansson <olof@lixom.net>
+
+ * events/Makefile.in:
+ * events/ppc64/pa6t/event_mappings:
+ * events/ppc64/pa6t/events:
+ * events/ppc64/pa6t/unit_masks:
+ * libop/op_cpu_type.c:
+ * libop/op_cpu_type.h:
+ * libop/op_events.c:
+ * utils/opcontrol:
+ * utils/ophelp.c: PA Semi 6T support
+
+2007-05-09 Richard Purdie <rpurdie@openedhand.com>
+
+ * oprofile/daemon/opd_cookie.c: Fix syscall for ARM EABI
+
+2007-05-10 Maynard Johnson <maynardj@us.ibm.com>
+
+ * libpp/Makefile.am:
+ * libpp/populate.cpp:
+ * libpp/populate_for_spu.cpp:
+ * libpp/populate_for_spu.h:
+ * libpp/profile.h:
+ * libpp/profile.cpp:
+ * libutil++/Makefile.am:
+ * libutil++/bfd_spu_support.cpp:
+ * libutil++/bfd_support.h:
+ * libutil++/op_bfd.h:
+ * libutil++/op_spu_bfd.cpp:
+ * libpp/xml_utils.cpp:
+ * libpp/profile_container.cpp:
+ * libpp/symbol.h: Patch 3 of 3 for adding support for profiling
+ Cell Broadband Engine SPU
+
+2007-05-10 Maynard Johnson <maynardj@us.ibm.com>
+
+ * daemon/liblegacy/opd_sample_files.c:
+ * daemon/opd_events.c:
+ * daemon/opd_events.h:
+ * daemon/opd_interface.h:
+ * daemon/Makefile.am:
+ * daemon/opd_mangling.c:
+ * daemon/opd_sfile.c:
+ * daemon/opd_sfile.h:
+ * daemon/opd_spu.c:
+ * daemon/opd_trans.c:
+ * daemon/opd_trans.h:
+ * libop/op_sample_file.h: Patch 2 of 3 for adding support for profiling
+ Cell Broadband Engine SPU
+
+2007-05-10 Maynard Johnson <maynardj@us.ibm.com>
+
+ * configure.in:
+ * doc/oprofile.xml:
+ * events/ppc64/cell-be/events:
+ * m4/Makefile.am:
+ * m4/cellspubfdsupport.m4:
+ * utils/opcontrol: Patch 1 of 3 for adding support for profiling
+ Cell Broadband Engine SPU
+
+2007-04-25 Manoj Ekbote <manoj.ekbote@broadcom.com>
+
+ * events/mips/sb1/events: fix SB1 events
+
+2007-04-19 Dave Nomura <dcnltc@us.ibm.com>
+
+ * events/ppc64/power6/events: counter 3 should have been used
+ in the specification of the default CYCLES event, not counter 1
+
+2007-04-13 Will Cohen <wcohen@redhat.com>
+
+ * libop/op_cpu_type.c:
+ * libop/op_cpu_type.h: Move new entries to end of list
+ to improve backward compatibility with enum values.
+
+2007-04-11 John Levon <levon@movementarian.org>
+
+ * doc/oprofile.xml: IRC channel is on OFTC
+
+2007-04-10 Philippe Elie <phil.el@wanadoo.fr>
+
+ * utils/ophelp.c: if userspace doesn't recognize the cpu type
+ warn the user it can use timer mode or upgrade oprofile.
+
+2007-04-04 Maynard johnson <maynardj@us.ibm.com>
+
+ * libutil++/file_manip.cpp: catch result from chown() to avoid
+ compilation warning (treated as error)
+
+2007-03-23 Jason Yeh <jason.yeh@amd.com>
+
+ * events/Makefile.am:
+ * events/x86-64/family10/events:
+ * events/x86-64/family10/unit_masks:
+ * libop/op_cpu_type.c:
+ * libop/op_cpu_type.h:
+ * libop/op_events.c:
+ * utils/ophelp.c: Add AMD Family 10 support.
+
+2007-02-28 Rob Bradford <rob@o-hand.com>
+
+ * pp/oparchive.cpp: return from main
+
+2007-02-21 Rob Bradford <rob@o-hand.com>
+
+ Reverted previous patches.
+ * pp/oparchive.cpp: Save debuginfo files in .debug sub directory.
+
+ * pp/oparchive.cpp:
+ * pp/oparchive_options.h:
+ * pp/oparchive_options.cpp: List files option.
+
+2007-02-21 Rob Bradford <rob@o-hand.com>
+
+ * pp/oparchive.cpp: Save debuginfo files in .debug sub directory.
+
+ * pp/oparchive.cpp:
+ * pp/oparchive_options.h:
+ * pp/oparchive_options.cpp: List files option.
+
+2007-02-16 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/opd_mangling.c: missing initialisation when mangling an
+ anon and callgraph filename. Fix given by Amitabha Roy.
+
+2007-02-06 Dave Nomura <dcnltc@us.ibm.com>
+
+ * libpp/symbol.h:
+ * libutil++/Makefile.am:
+ * libutil++/sparse_array.h: represent count_array_t as a sparse
+ array type based on std::map rather than growable_vector which is
+ based on std::vector to reduce the excessive heap usage on large
+ profiles.
+
+2007-02-02 Amitabha Roy <amitabha.roy@gmail.com>
+
+ * daemon/opd_anon.c:
+ * daemon/opd_anon.h:
+ * daemon/opd_mangling.c:
+ * libop/op_mangle.c:
+ * libop/op_mangle.h:
+ * libpp/parse_filename.cpp: save and report name of anonymous
+ mapping if there is one (as self-contradictory as that
+ sounds).
+
+2007-02-02 Dave Nomura <dcnltc@us.ibm.com>
+
+ * events/Makefile.am:
+ * events/ppc64/970MP/event_mappings:
+ * events/ppc64/970MP/events:
+ * events/ppc64/970MP/unit_masks:
+ * libop/op_cpu_type.c:
+ * libop/op_cpu_type.h:
+ * libop/op_events.c:
+ * utils/ophelp.c: PPC970MP has different hardware counters than the rest
+ of the PPC family and must be treated as a different architecture
+ by oprofile.
+
+2007-01-31 Dave Nomura <dcnltc@us.ibm.com>
+
+ * libpp/xml_utils.cpp: opreport -X was still getting some incorrect
+ symbols attributed to the <binary> when processing a --separate=lib
+ profile.
+
+2007-01-29 Philippe Elie <phil.el@wanadoo.fr>
+
+ * daemon/oprofiled.c: no need for 0755 for the log file mode, use 0644
+ * utils/opcontrol: don't create the log in opcontrol
+
+2007-01-26 Dave Nomura <dcnltc@us.ibm.com>
+
+ * libpp/format_output.cpp:
+ * libpp/xml_utils.cpp: opreport -X was mixing the symbols associated with
+ an application with those of a library when processing a --separate=lib
+ profile.
+
+2007-01-02 Dave Nomura <dcnltc@us.ibm.com>
+
+ * events/Makefile.am:
+ * events/ppc64/power6/event_mappings:
+ * events/ppc64/power6/events:
+ * events/ppc64/power6/unit_masks:
+ * libop/op_cpu_type.c:
+ * libop/op_cpu_type.h:
+ * libop/op_events.c:
+ * utils/opcontrol:
+ * utils/ophelp.c: Add support for Power6
+
+
+See ChangeLog-2006 for earlier changelogs.
diff --git a/ChangeLog-2008 b/ChangeLog-2008
new file mode 100644
index 0000000..4543889
--- /dev/null
+++ b/ChangeLog-2008
@@ -0,0 +1,451 @@
+2008-12-23 Maynard Johnson <maynardj@us.ibm.com>
+
+ * utils/opcontrol: reverse the logic in
+ is_non_cell_ppc64_variant to avoid the need
+ for maintenance as new ppc64 variants are addded
+
+2008-12-12 Maynard Johnson <maynardj@us.ibm.com>
+
+ * libop/Makefile.am: Add Andi Kleen's new op_hw_specific.h
+ file to to Makefile.am
+
+2008-11-24 Robert Richter <robert.richter@amd.com>
+
+ * utils/opcontrol: Correct spelling error
+
+2008-11-24 Robert Richter <robert.richter@amd.com>
+
+ * daemon/opd_events.c:
+ * daemon/opd_events.h:
+ * daemon/opd_mangling.c:
+ * daemon/opd_mangling.h:
+ * daemon/opd_sfile.c:
+ * daemon/opd_trans.c:
+ * events/x86-64/family10/events:
+ * utils/opcontrol: fix whitespaces
+
+2008-11-12 Andi Kleen <andi@firstfloor.org>
+
+ * libop/op_events.c
+ * libop/op_events.h
+ * libpp/op_header.cpp: Fix regression in arch perfmon code
+ (see bug #2161762)
+
+2008-11-12 Andi Kleen <andi@firstfloor.org>
+
+ * events/i386/arch_perfmon/events: Fix event name to avoid
+ parsing error
+
+2008-11-05 Maynard Johnson <maynardj@us.ibm.com>
+
+ * libutil++/file_manip.cpp: Add mode arg to open
+
+2008-10-30 William Cohen <wcohen@redhat.com>
+
+ * m4/binutils.m4: Defeat compiler optimization in configure
+ check for bfd_get_synthetic_symtab
+
+2008-10-27 Maynard Johnson <maynardj@us.ibm.com>
+
+ * libutil++/op_spu_bfd.cpp: Initialize anon_obj to false for op_bfd
+ objects for Cell SPE embedded binaries
+
+2008-10-23 Dave Nomura <dcnltc@us.ibm.com>
+
+ * libutil++/xml_output.cpp:
+ * libutil/xml_out.c:
+ * libutil/xml_out.h:
+ * libutil/xml_events.c:
+ * libutil/xml_events.h:
+ * libutil/Makefile.am:
+ * libop/op_xml_out.c:
+ * libop/op_xml_out.h:
+ * libop/op_xml_events.c:
+ * libop/op_xml_events.h:
+ * libop/Makefile.am: moved xml util routines to libop and fixed some
+ other problems in the previous patch
+
+2008-10-15 Dave Nomura <dcnltc@us.ibm.com>
+
+ * utils/ophelp.c:
+ * libutil++/xml_output.cpp:
+ * libutil++/xml_output.h:
+ * libutil/xml_out.c:
+ * libutil/xml_out.h:
+ * libutil/xml_events.c:
+ * libutil/xml_events.h:
+ * libutil/Makefile.am: added -X option to ophelp to generate XML
+
+2008-10-06 Maynard Johnson <maynardj@us.ibm.com>
+
+ * configure.in:
+ * m4/binutils.m4:
+ * m4/cellspubfdsupport.m4: Handle BFD's new dependency on libz
+
+2008-08-28 Maynard Johnson <maynardj@us.ibm.com>
+
+ * configure.in: Add configure option for non-standard binutils lib
+
+2008-08-28 Andi Kleen <andi@firstfloor.org>
+
+ * events/i386/arch_perfmon/events:
+ * events/i386/arch_perfmon/unit_masks:
+ * events/Makefile.am:
+ * libop/op_cpu_type.c:
+ * libop/op_cpu_type.h:
+ * libop/op_events.c:
+ * libop/op_events.h:
+ * libop/op_hw_specific.h:
+ * libpp/op_header.cpp:
+ * utils/ophelp.c: support for Intel arch perfmon
+
+2008-08-28 Maynard Johnson <maynardj@us.ibm.com>
+
+ * configure.in: Change AM_INIT_AUTOMAKE to 0.9.5cvs; enables -werror
+ gcc option to stop build on warnings
+
+2008-08-27 Jatin Nansi <jnansi@redhat.com>
+
+ * utils/opcontrol: vecho parameters after "--verbose" option processed
+
+2008-08-08 Daniel Hansel <daniel.hansel@linux.vnet.ibm.com>
+
+ * daemon/init.c: Fixed call of execvp() to execute opjitconv if
+ it is installed in a custom directory
+
+2008-08-07 Maynard Johnson <maynardj@us.ibm.com>
+
+ * libutil++/bfd_support.cpp:
+ * libutil++/op_bfd.cpp:
+ * libutil++/op_bfd.h: Fix a couple problems relating
+ to overlay symbols for Cell SPE applications
+
+2008-07-31 Maynard Johnson <maynardj@us.ibm.com>
+
+ * configure.in: Fix to allow libtool to recognize
+ alternate binutils dir passed via --with-binutils
+
+2008-07-24 Jean Pihet <jpihet@mvista.com>
+
+ * events/arm/armv7/events:
+ * events/arm/armv7/unit_masks:
+ * libop/op_cpu_type.c:
+ * libop/op_cpu_type.h:
+ * libop/op_events.c:
+ * utils/ophelp.c: Added ARMv7 support to be consistent with the
+ kernel, added ARMv7 specific events.
+ Tested on OMAP3430 and OMAP3530 chipsets.
+
+2008-07-17 Maynard Johnson <maynardj@us.ibm.com>
+
+ * configure.in: bump version in AM_INIT_AUTOMAKE to 0.9.4
+
+2008-07-17 Will Cohen <wcohen@redhat.com>
+
+ * libop/op_alloc_counter.c: Assume perfmon managing PMU hw
+ when no counters
+
+2008-07-07 Maynard Johnson <maynardj@us.ibm.com>
+
+ * HACKING: Ask contributors to include Signed-off-by
+ line with their patches
+
+2008-07-03 Richard Purdie <rpurdie@openedhand.com>
+
+ * libutil++/bfd_support.cpp:
+ * libutil++/bfd_support.h:
+ * libutil++/op_bfd.cpp:
+ * libutil++/op_bfd.h:
+ * libutil++/op_spu_bfd.cpp:
+ * pp/oparchive.cpp: Switch separate_debug_file_exists()
+ and hence find_separate_debug_file() to use
+ extra_images::find_image_path() so debug files in --root
+ directories are correctly found
+
+2008-07-03 Maynard Johnson <maynardj@us.ibm.com>
+
+ * ChangeLog: Correct date of previous entry
+ * README_PACKAGERS: Add more advice to packagers
+ regarding the new JIT support libraries
+
+2008-07-03 Maynard Johnson <maynardj@us.ibm.com>
+
+ * libopagent/Makefile.am:
+ * libopagent/opagent.c:
+ * remove libopagent/bfddefines.c: Move code from bfddefines
+ to libopagent to fix cross-compile error
+
+2008-06-30 Shunichi Fuji <palglowr@gmail.com>
+
+ * libpp/callgraph_container.cpp: Fix compile warning
+ using gcc 4.3.1 for uninitialized variable
+
+2008-06-23 Maynard Johnson <maynardj@us.ibm.com>
+
+ * daemon/opd_stats.c: Do not force printing of sample_invalid_eip
+ since this is not available from pre-2.6.24 kernels
+
+2008-06-23 Maynard Johnson <maynardj@us.ibm.com>
+
+ * opjitconv/opjitconv.c: Switch to special user account
+ after determining whether or not we have JIT dump files
+ to process in order to avoid unnecessary error messages
+ in oprofiled.log
+
+2008-06-11 Maynard Johnson <maynardj@us.ibm.com>
+
+ * configure.in:
+ * Makefile.am:
+ * agents/Makefile.am:
+ * doc/oprofile.xml: Change make install error to warning
+ if special user account does not exist
+
+2008-06-11 Maynard Johnson <maynardj@us.ibm.com>
+
+ * Makefile.am: Add README_PACKAGERS to EXTRA_DIST
+
+2008-06-03 Will Cohen <wcohen@redhat.com>
+
+ * libop/op_alloc_counter.c: Use counters actually available.
+
+2008-05-21 George McCollister <georgem@novatech-llc.com>
+
+ * daemon/opd_cookie.c: Fix ARM big-endian syscall
+
+2008-05-20 Jason Yeh <jason.yeh@amd.com>
+
+ * events/x86_64/hammer/events:
+ * events/x86_64/hammer/unit_masks:
+ * events/x86_64/family10/events:
+ * events/x86_64/family10/unit_masks: update for recent BKDG
+ revisions
+
+2008-05-19 Maynard Johnson <maynardj@us.ibm.com>
+
+ * libpp/profile_spec.cpp: Fix bug in differential profile
+ when using archive spec and an image spec
+
+2008-05-19 Maynard Johnson <maynardj@us.ibm.com>
+
+ * libpp/format_output.cpp:
+ * libpp/xml_utils.cpp:
+ * libutil++/op_bfd.cpp:
+ * libutil++/op_bfd.h: Do not to try to get symbol contents
+ for artificial symbols and other cases where no symbol contents
+ exist. Also change to use scoped array for symbol contents
+ instead of automatic allocation from the stack to avoid allocation
+ attempt exceeding max stack size.
+
+2008-05-09 Maynard Johnson <maynardj@us.ibm.com>
+
+ * configure.in:
+ * Makefile.am: Improve error messages for special user account checks
+
+2008-05-08 Maynard Johnson <maynardj@us.ibm.com>
+
+ * libpp/callgraph_container.cpp:
+ * libpp/profile_container.cpp:
+ * libutil++/op_bfd.h:
+ * libutil++/op_bfd.cpp: Fix to allow 32-bit opreport to
+ properly process samples from 64-bit JIT profile agent
+
+2008-04-29 René Rebe <rene@exactcode.de>
+
+ * libabi/opimport.cpp:
+ * libpp/op_header.cpp:
+ * libpp/profile.cpp:
+ * libutil++/bfd_support.cpp:
+ * libutil++/cverb.cpp:
+ * libutil++/op_bfd.cpp:
+ * libutil++/op_spu_bfd.cpp:
+ * pp/common_option.cpp:
+ * pp/opannotate_options.cpp:
+ * pp/oparchive.cpp:
+ * pp/opgprof_options.cpp: added explicit includes for C functions
+ as required for compilation with GCC-4.3
+
+2008-04-28 Daniel Hansel <daniel.hansel@linux.vnet.ibm.com>
+
+ * oprofile/agents/jvmpi/jvmpi_oprofile.cpp:
+ * oprofile/agents/jvmpi/Makefile.am:
+ * oprofile/agents/jvmti/libjvmti_oprofile.c:
+ * oprofile/agents/jvmti/Makefile.am:
+ * oprofile/agents/Makefile.am:
+ * oprofile/autogen.sh:
+ * oprofile/configure.in:
+ * oprofile/daemon/init.c:
+ * oprofile/daemon/Makefile.am:
+ * oprofile/daemon/opd_anon.c:
+ * oprofile/daemon/opd_pipe.c:
+ * oprofile/daemon/opd_pipe.h:
+ * oprofile/daemon/oprofiled.c:
+ * oprofile/daemon/oprofiled.h:
+ * oprofile/doc/Makefile.am:
+ * oprofile/doc/op-jit-devel.xml:
+ * oprofile/doc/oprofile.xml:
+ * oprofile/libop/op_config.c:
+ * oprofile/libop/op_config.h:
+ * oprofile/libopagent/bfddefines.c:
+ * oprofile/libopagent/jitdump.h:
+ * oprofile/libopagent/Makefile.am:
+ * oprofile/libopagent/opagent.c:
+ * oprofile/libopagent/opagent.h:
+ * oprofile/libopagent/opagent_symbols.ver:
+ * oprofile/libpp/arrange_profiles.cpp:
+ * oprofile/libpp/callgraph_container.cpp:
+ * oprofile/libpp/filename_spec.cpp:
+ * oprofile/libpp/filename_spec.h:
+ * oprofile/libpp/op_header.cpp:
+ * oprofile/libpp/op_header.h:
+ * oprofile/libpp/parse_filename.cpp:
+ * oprofile/libpp/parse_filename.h:
+ * oprofile/libpp/profile_container.cpp:
+ * oprofile/libpp/profile.cpp:
+ * oprofile/libpp/profile.h:
+ * oprofile/libpp/profile_spec.cpp:
+ * oprofile/libregex/demangle_java_symbol.cpp:
+ * oprofile/libregex/demangle_java_symbol.h:
+ * oprofile/libregex/demangle_symbol.cpp:
+ * oprofile/libregex/Makefile.am:
+ * oprofile/libregex/tests/java_test.cpp:
+ * oprofile/libregex/tests/Makefile.am:
+ * oprofile/libutil/Makefile.am:
+ * oprofile/libutil/op_file.c:
+ * oprofile/libutil/op_file.h:
+ * oprofile/libutil/op_growable_buffer.c:
+ * oprofile/libutil/op_growable_buffer.h:
+ * oprofile/libutil/op_list.h:
+ * oprofile/libutil++/bfd_support.cpp:
+ * oprofile/libutil++/bfd_support.h:
+ * oprofile/libutil++/file_manip.cpp:
+ * oprofile/libutil++/op_bfd.cpp:
+ * oprofile/libutil++/op_bfd.h:
+ * oprofile/Makefile.am:
+ * oprofile/opjitconv/conversion.c:
+ * oprofile/opjitconv/create_bfd.c:
+ * oprofile/opjitconv/debug_line.c:
+ * oprofile/opjitconv/jitsymbol.c:
+ * oprofile/opjitconv/Makefile.am:
+ * oprofile/opjitconv/opjitconv.c:
+ * oprofile/opjitconv/opjitconv.h:
+ * oprofile/opjitconv/parse_dump.c:
+ * oprofile/pp/opgprof.cpp:
+ * oprofile/README_PACKAGERS:
+ * oprofile/TODO:
+ * oprofile/utils/opcontrol: JIT support
+
+2008-04-18 Maynard Johnson <maynardj@us.ibm.com>
+
+ * m4/binutils.m4: A correct fix for the --with-binutils problem
+
+2008-04-17 Maynard Johnson <maynardj@us.ibm.com>
+
+ * m4/binutils.m4: Revert previous patch as it was buggy
+
+2008-04-16 Maynard Johnson <maynardj@us.ibm.com>
+
+ * m4/binutils.m4: Fix the bfd_get_synthetic_symtab check
+ in this m4 macro to work correctly with '--with-binutils'
+ configure option
+
+2008-04-10 Chris J Arges <arges@linux.vnet.ibm.com>
+
+ * utils/opcontrol:
+ For ppc64 architectures, need to check if all user/kernel flags
+ per counter match. Then use this value to set user/kernel domain
+ profiling.
+
+2008-03-13 Dave Nomura <dcnltc@us.ibm.com>
+
+ * libutil++/op_bfd.cpp:
+ * libutil++/op_bfd.h:
+ * pp/opreport.cpp:
+ gcc 4.3 gives warnings on const function return types
+
+2008-03-03 John Levon <levon@movementarian.org>
+
+ * daemon/oprofiled.c: fix error message typo
+
+2008-02-22 Haavard Skinnemoen <hskinnemoen@atmel.com>
+
+ * events/Makefile.am:
+ * events/avr32/events:
+ * events/avr32/unit_masks:
+ * libop/op_cpu_type.c:
+ * libop/op_cpu_type.h:
+ * libop/op_events.c:
+ * utils/ophelp.c: Add AVR32 support
+
+2008-02-22 Richard Purdie <rpurdie@openedhand.com>
+
+ * libutil++/file_manip.cpp:
+ * pp/oparchive.cpp:
+ Check files actually exist before copying or listing the file as part of
+ oparchive --list-files.
+
+ The copy_file function breaks if passed a directory as a file to copy
+ since it will create a file at the destination causing subtle bugs.
+
+2008-02-22 Andy Fleming <afleming@freescale.com>
+
+ * events/Makefile.am:
+ * events/ppc/e300/events:
+ * events/ppc/e300/unit_masks:
+ * libop/op_cpu_type.c:
+ * libop/op_cpu_type.h:
+ * libop/op_events.c:
+ * utils/ophelp.c: Add e300 support
+
+2008-02-22 Bob Nelson <rrnelson@us.ibm.com>
+
+ * utils/opcontrol: Fix loop in dump code when using
+ --session-dir on a network drive. (clock issues)
+
+2008-02-15 Will Cohen <wcohen@redhat.com>
+
+ * gui/oprof_start_util.cpp
+ * libutil++/file_manip.cpp
+ * libutil++/bfd_support.cpp
+ * libutil++/bfd_spu_support.cpp
+ * libutil++/op_spu_bfd.cpp
+ * libutil++/cverb.cpp
+ * libutil++/child_reader.cpp
+ * pp/opgprof_options.cpp
+ * pp/opannotate_options.cpp
+ * pp/oparchive.cpp
+ * pp/common_option.cpp
+ * libpp/sample_container.cpp
+ * libpp/op_header.cpp
+ * libpp/profile.cpp
+ * libabi/opimport.cpp
+ * libregex/demangle_symbol.cpp: Add includes for gcc 4.3 compatibility.
+
+2008-02-07 Bob Nelson <rrnelson@us.ibm.com>
+
+ * libutil++/op_bfd.h: add bool symb_artificial to op_bfd_symbol
+ * libutil++/op_bfd.cpp: ctor changes, use symb_artificial
+ * libutil++/op_spu_bfd.cpp: profile SPU 'stack' code
+
+2008-02-04 Bob Nelson <rrnelson@us.ibm.com>
+
+ * daemon/opd_spu.c: Fix number of records to check for
+ in an SPU context switch
+
+2008-01-21 Daniel Hansel <daniel.hansel@linux.vnet.ibm.com>
+
+ * various: style cleanups
+
+2008-01-15 Isaku Yamahata <yamahata@valinux.co.jp>
+
+ * daemon/opd_trans.c: fix previous SPU patch
+
+2008-01-11 Isaku Yamahata <yamahata@valinux.co.jp>
+
+ * daemon/opd_perfmon.c: Xen support for IA64
+
+2008-01-11 Markus Armbruster <armbru@redhat.com>
+
+ * daemon/opd_interface.h:
+ * daemon/opd_trans.c: work around SPU/Xen code numbering problem
+
+See ChangeLog-2007 for earlier changelogs.
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..996fddf
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,107 @@
+#### ATTENTION ####
+# The agents directory must be kept as the last subdir
+SUBDIRS = \
+ . \
+ m4 \
+ libutil \
+ libop \
+ libopagent \
+ libdb \
+ libutil++ \
+ libopt++ \
+ libabi \
+ daemon \
+ utils \
+ libregex \
+ libpp \
+ opjitconv \
+ pp \
+ events \
+ doc \
+ gui \
+ agents
+#### ATTENTION ####
+# The agents directory must be kept as the last subdir
+
+
+
+ACLOCAL_AMFLAGS = -I m4
+
+# The module will not build under distcheck
+DISTCHECK_CONFIGURE_FLAGS = --with-kernel-support
+
+if !kernel_support
+
+.PHONY: module
+
+all-local: module
+
+# This must use a fully-qualified SUBDIRS path, so we can't use ${top_srcdir}
+module:
+ make -C libutil
+ make -C libop
+ (cd $(KSRC) && $(MAKE) SUBDIRS=$(OPROFILE_DIR)/module/@OPROFILE_MODULE_ARCH@ modules) || exit 1 ;
+ (cd $(KSRC) && $(MAKE) SUBDIRS=$(OPROFILE_DIR)/module modules) || exit 1 ;
+
+install-exec-local:
+ -mkdir -p $(MODINSTALLDIR)/oprofile
+ cp module/oprofile-module.o $(MODINSTALLDIR)/oprofile/oprofile.o
+ if test $(KVERS) = "`uname -r`"; then depmod -a ; fi
+
+clean-local:
+ rm -f module/*.o module/@OPROFILE_MODULE_ARCH@/*.o \
+ module/.*.o.cmd module/.*.o.flags \
+ module/@OPROFILE_MODULE_ARCH@/.*.o.cmd module/@OPROFILE_MODULE_ARCH@/.*.o.flags
+
+endif
+
+EXTRA_DIST = \
+ ChangeLog-2001 \
+ ChangeLog-2002 \
+ ChangeLog-2003 \
+ ChangeLog-2004 \
+ ChangeLog-2005 \
+ ChangeLog-2006 \
+ ChangeLog-2007 \
+ ChangeLog-2008 \
+ autogen.sh \
+ README_PACKAGERS \
+ include/sstream \
+ module/Makefile.in \
+ module/compat.c \
+ module/op_dname.c \
+ module/op_init.c \
+ module/oprofile.c \
+ module/op_util.c \
+ module/compat22.h \
+ module/compat24.h \
+ module/compat.h \
+ module/op_cache.h \
+ module/op_dcache.h \
+ module/oprofile.h \
+ module/op_util.h \
+ module/ia64/Makefile.in \
+ module/ia64/oprofile_stubs.S \
+ module/ia64/cpu_type.c \
+ module/ia64/op_pmu.c \
+ module/ia64/op_syscalls.c \
+ module/ia64/IA64entry.h \
+ module/ia64/IA64minstate.h \
+ module/ia64/IA64syscallstub.h \
+ module/ia64/op_ia64_model.h \
+ module/x86/Makefile.in \
+ module/x86/oprofile_nmi.S \
+ module/x86/apic_compat.h \
+ module/x86/op_apic.h \
+ module/x86/op_arch.h \
+ module/x86/op_x86_model.h \
+ module/x86/op_msr.h \
+ module/x86/cpu_type.c \
+ module/x86/op_apic.c \
+ module/x86/op_fixmap.c \
+ module/x86/op_model_athlon.c \
+ module/x86/op_model_p4.c \
+ module/x86/op_model_ppro.c \
+ module/x86/op_nmi.c \
+ module/x86/op_rtc.c \
+ module/x86/op_syscalls.c
diff --git a/Makefile.in b/Makefile.in
new file mode 100644
index 0000000..d91a691
--- /dev/null
+++ b/Makefile.in
@@ -0,0 +1,787 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = .
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in $(srcdir)/config.h.in \
+ $(top_srcdir)/configure $(top_srcdir)/doc/srcdoc/Doxyfile.in \
+ $(top_srcdir)/doc/xsl/catalog-1.xml.in \
+ $(top_srcdir)/module/Makefile.in \
+ $(top_srcdir)/module/ia64/Makefile.in \
+ $(top_srcdir)/module/x86/Makefile.in COPYING ChangeLog TODO \
+ compile config.guess config.sub depcomp install-sh ltmain.sh \
+ missing
+subdir = .
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/binutils.m4 \
+ $(top_srcdir)/m4/builtinexpect.m4 \
+ $(top_srcdir)/m4/cellspubfdsupport.m4 \
+ $(top_srcdir)/m4/compileroption.m4 \
+ $(top_srcdir)/m4/configmodule.m4 \
+ $(top_srcdir)/m4/copyifchange.m4 $(top_srcdir)/m4/docbook.m4 \
+ $(top_srcdir)/m4/extradirs.m4 $(top_srcdir)/m4/findkernel.m4 \
+ $(top_srcdir)/m4/kerneloption.m4 \
+ $(top_srcdir)/m4/kernelversion.m4 \
+ $(top_srcdir)/m4/mallocattribute.m4 \
+ $(top_srcdir)/m4/poptconst.m4 \
+ $(top_srcdir)/m4/precompiledheader.m4 $(top_srcdir)/m4/qt.m4 \
+ $(top_srcdir)/m4/resultyn.m4 $(top_srcdir)/m4/sstream.m4 \
+ $(top_srcdir)/m4/typedef.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno configure.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES = doc/xsl/catalog-1.xml doc/srcdoc/Doxyfile \
+ module/Makefile module/x86/Makefile module/ia64/Makefile
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-exec-recursive install-info-recursive \
+ install-recursive installcheck-recursive installdirs-recursive \
+ pdf-recursive ps-recursive uninstall-info-recursive \
+ uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+ { test ! -d $(distdir) \
+ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -fr $(distdir); }; }
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFD_LIBS = @BFD_LIBS@
+BUILD_JVMPI_AGENT_FALSE = @BUILD_JVMPI_AGENT_FALSE@
+BUILD_JVMPI_AGENT_TRUE = @BUILD_JVMPI_AGENT_TRUE@
+BUILD_JVMTI_AGENT_FALSE = @BUILD_JVMTI_AGENT_FALSE@
+BUILD_JVMTI_AGENT_TRUE = @BUILD_JVMTI_AGENT_TRUE@
+CAT_ENTRY_END = @CAT_ENTRY_END@
+CAT_ENTRY_START = @CAT_ENTRY_START@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOCBOOK_ROOT = @DOCBOOK_ROOT@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+EXTRA_CFLAGS_MODULE = @EXTRA_CFLAGS_MODULE@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAVA_HOMEDIR = @JAVA_HOMEDIR@
+KINC = @KINC@
+KSRC = @KSRC@
+KVERS = @KVERS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBERTY_LIBS = @LIBERTY_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MOC = @MOC@
+MODINSTALLDIR = @MODINSTALLDIR@
+OBJEXT = @OBJEXT@
+OPROFILE_DIR = @OPROFILE_DIR@
+OPROFILE_MODULE_ARCH = @OPROFILE_MODULE_ARCH@
+OP_CFLAGS = @OP_CFLAGS@
+OP_CXXFLAGS = @OP_CXXFLAGS@
+OP_DOCDIR = @OP_DOCDIR@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POPT_LIBS = @POPT_LIBS@
+PTRDIFF_T_TYPE = @PTRDIFF_T_TYPE@
+QT_INCLUDES = @QT_INCLUDES@
+QT_LDFLAGS = @QT_LDFLAGS@
+QT_LIB = @QT_LIB@
+QT_VERSION = @QT_VERSION@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIZE_T_TYPE = @SIZE_T_TYPE@
+STRIP = @STRIP@
+UIC = @UIC@
+VERSION = @VERSION@
+XML_CATALOG = @XML_CATALOG@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+have_qt_FALSE = @have_qt_FALSE@
+have_qt_TRUE = @have_qt_TRUE@
+have_xsltproc_FALSE = @have_xsltproc_FALSE@
+have_xsltproc_TRUE = @have_xsltproc_TRUE@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+kernel_support_FALSE = @kernel_support_FALSE@
+kernel_support_TRUE = @kernel_support_TRUE@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+topdir = @topdir@
+
+#### ATTENTION ####
+# The agents directory must be kept as the last subdir
+SUBDIRS = \
+ . \
+ m4 \
+ libutil \
+ libop \
+ libopagent \
+ libdb \
+ libutil++ \
+ libopt++ \
+ libabi \
+ daemon \
+ utils \
+ libregex \
+ libpp \
+ opjitconv \
+ pp \
+ events \
+ doc \
+ gui \
+ agents
+
+#### ATTENTION ####
+# The agents directory must be kept as the last subdir
+ACLOCAL_AMFLAGS = -I m4
+
+# The module will not build under distcheck
+DISTCHECK_CONFIGURE_FLAGS = --with-kernel-support
+EXTRA_DIST = \
+ ChangeLog-2001 \
+ ChangeLog-2002 \
+ ChangeLog-2003 \
+ ChangeLog-2004 \
+ ChangeLog-2005 \
+ ChangeLog-2006 \
+ ChangeLog-2007 \
+ ChangeLog-2008 \
+ autogen.sh \
+ README_PACKAGERS \
+ include/sstream \
+ module/Makefile.in \
+ module/compat.c \
+ module/op_dname.c \
+ module/op_init.c \
+ module/oprofile.c \
+ module/op_util.c \
+ module/compat22.h \
+ module/compat24.h \
+ module/compat.h \
+ module/op_cache.h \
+ module/op_dcache.h \
+ module/oprofile.h \
+ module/op_util.h \
+ module/ia64/Makefile.in \
+ module/ia64/oprofile_stubs.S \
+ module/ia64/cpu_type.c \
+ module/ia64/op_pmu.c \
+ module/ia64/op_syscalls.c \
+ module/ia64/IA64entry.h \
+ module/ia64/IA64minstate.h \
+ module/ia64/IA64syscallstub.h \
+ module/ia64/op_ia64_model.h \
+ module/x86/Makefile.in \
+ module/x86/oprofile_nmi.S \
+ module/x86/apic_compat.h \
+ module/x86/op_apic.h \
+ module/x86/op_arch.h \
+ module/x86/op_x86_model.h \
+ module/x86/op_msr.h \
+ module/x86/cpu_type.c \
+ module/x86/op_apic.c \
+ module/x86/op_fixmap.c \
+ module/x86/op_model_athlon.c \
+ module/x86/op_model_p4.c \
+ module/x86/op_model_ppro.c \
+ module/x86/op_nmi.c \
+ module/x86/op_rtc.c \
+ module/x86/op_syscalls.c
+
+all: config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+am--refresh:
+ @:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
+ cd $(srcdir) && $(AUTOMAKE) --foreign \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ echo ' $(SHELL) ./config.status'; \
+ $(SHELL) ./config.status;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+
+config.h: stamp-h1
+ @if test ! -f $@; then \
+ rm -f stamp-h1; \
+ $(MAKE) stamp-h1; \
+ else :; fi
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+ @rm -f stamp-h1
+ cd $(top_builddir) && $(SHELL) ./config.status config.h
+$(srcdir)/config.h.in: $(am__configure_deps)
+ cd $(top_srcdir) && $(AUTOHEADER)
+ rm -f stamp-h1
+ touch $@
+
+distclean-hdr:
+ -rm -f config.h stamp-h1
+doc/xsl/catalog-1.xml: $(top_builddir)/config.status $(top_srcdir)/doc/xsl/catalog-1.xml.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
+doc/srcdoc/Doxyfile: $(top_builddir)/config.status $(top_srcdir)/doc/srcdoc/Doxyfile.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
+module/Makefile: $(top_builddir)/config.status $(top_srcdir)/module/Makefile.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
+module/x86/Makefile: $(top_builddir)/config.status $(top_srcdir)/module/x86/Makefile.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
+module/ia64/Makefile: $(top_builddir)/config.status $(top_srcdir)/module/ia64/Makefile.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ $(am__remove_distdir)
+ mkdir $(distdir)
+ $(mkdir_p) $(distdir)/doc $(distdir)/doc/srcdoc $(distdir)/doc/xsl $(distdir)/include $(distdir)/libregex $(distdir)/libregex/tests $(distdir)/m4 $(distdir)/module $(distdir)/module/ia64 $(distdir)/module/x86
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(mkdir_p) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+ -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+ ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
+ || chmod -R a+r $(distdir)
+dist-gzip: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+dist-bzip2: distdir
+ tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
+ $(am__remove_distdir)
+
+dist-tarZ: distdir
+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+ $(am__remove_distdir)
+
+dist-shar: distdir
+ shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+ $(am__remove_distdir)
+
+dist-zip: distdir
+ -rm -f $(distdir).zip
+ zip -rq $(distdir).zip $(distdir)
+ $(am__remove_distdir)
+
+dist dist-all: distdir
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ case '$(DIST_ARCHIVES)' in \
+ *.tar.gz*) \
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
+ *.tar.bz2*) \
+ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
+ *.tar.Z*) \
+ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+ *.shar.gz*) \
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
+ *.zip*) \
+ unzip $(distdir).zip ;;\
+ esac
+ chmod -R a-w $(distdir); chmod a+w $(distdir)
+ mkdir $(distdir)/_build
+ mkdir $(distdir)/_inst
+ chmod a-w $(distdir)
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && cd $(distdir)/_build \
+ && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+ distuninstallcheck \
+ && chmod -R a-w "$$dc_install_base" \
+ && ({ \
+ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+ } || { rm -rf "$$dc_destdir"; exit 1; }) \
+ && rm -rf "$$dc_destdir" \
+ && $(MAKE) $(AM_MAKEFLAGS) dist \
+ && rm -rf $(DIST_ARCHIVES) \
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
+ $(am__remove_distdir)
+ @(echo "$(distdir) archives ready for distribution: "; \
+ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+ sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
+distuninstallcheck:
+ @cd $(distuninstallcheck_dir) \
+ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+ || { echo "ERROR: files left after uninstall:" ; \
+ if test -n "$(DESTDIR)"; then \
+ echo " (check DESTDIR support)"; \
+ fi ; \
+ $(distuninstallcheck_listfiles) ; \
+ exit 1; } >&2
+distcleancheck: distclean
+ @if test '$(srcdir)' = . ; then \
+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+ exit 1 ; \
+ fi
+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left in build directory after distclean:" ; \
+ $(distcleancheck_listfiles) ; \
+ exit 1; } >&2
+check-am: all-am
+check: check-recursive
+@kernel_support_TRUE@all-local:
+all-am: Makefile config.h all-local
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+@kernel_support_TRUE@install-exec-local:
+@kernel_support_TRUE@clean-local:
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool clean-local mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-hdr \
+ distclean-libtool distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-exec-local
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(top_srcdir)/autom4te.cache
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am all-local \
+ am--refresh check check-am clean clean-generic clean-libtool \
+ clean-local clean-recursive ctags ctags-recursive dist \
+ dist-all dist-bzip2 dist-gzip dist-shar dist-tarZ dist-zip \
+ distcheck distclean distclean-generic distclean-hdr \
+ distclean-libtool distclean-recursive distclean-tags \
+ distcleancheck distdir distuninstallcheck dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-exec install-exec-am \
+ install-exec-local install-info install-info-am install-man \
+ install-strip installcheck installcheck-am installdirs \
+ installdirs-am maintainer-clean maintainer-clean-generic \
+ maintainer-clean-recursive mostlyclean mostlyclean-generic \
+ mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \
+ tags tags-recursive uninstall uninstall-am uninstall-info-am
+
+
+@kernel_support_FALSE@.PHONY: module
+
+@kernel_support_FALSE@all-local: module
+
+# This must use a fully-qualified SUBDIRS path, so we can't use ${top_srcdir}
+@kernel_support_FALSE@module:
+@kernel_support_FALSE@ make -C libutil
+@kernel_support_FALSE@ make -C libop
+@kernel_support_FALSE@ (cd $(KSRC) && $(MAKE) SUBDIRS=$(OPROFILE_DIR)/module/@OPROFILE_MODULE_ARCH@ modules) || exit 1 ;
+@kernel_support_FALSE@ (cd $(KSRC) && $(MAKE) SUBDIRS=$(OPROFILE_DIR)/module modules) || exit 1 ;
+
+@kernel_support_FALSE@install-exec-local:
+@kernel_support_FALSE@ -mkdir -p $(MODINSTALLDIR)/oprofile
+@kernel_support_FALSE@ cp module/oprofile-module.o $(MODINSTALLDIR)/oprofile/oprofile.o
+@kernel_support_FALSE@ if test $(KVERS) = "`uname -r`"; then depmod -a ; fi
+
+@kernel_support_FALSE@clean-local:
+@kernel_support_FALSE@ rm -f module/*.o module/@OPROFILE_MODULE_ARCH@/*.o \
+@kernel_support_FALSE@ module/.*.o.cmd module/.*.o.flags \
+@kernel_support_FALSE@ module/@OPROFILE_MODULE_ARCH@/.*.o.cmd module/@OPROFILE_MODULE_ARCH@/.*.o.flags
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/README b/README
new file mode 100644
index 0000000..250107e
--- /dev/null
+++ b/README
@@ -0,0 +1,46 @@
+This is an alpha release version of oprofile, a transparent
+low-overhead system-wide profiler.
+
+You can find some documentation in the doc/ directory.
+
+Please visit the oprofile website at : http://oprofile.sf.net/
+
+oprofile was written by John Levon <levon@movementarian.org>
+and Philippe Elie <phil.el@wanadoo.fr>.
+
+Maynard Johnson <maynardj@us.ibm.com> is the current maintainer.
+
+Dave Jones <davej@suse.de> provided bug fixes and support for
+the AMD Athlon, and AMD Hammer families of CPUs.
+
+Bob Montgomery <bobm@fc.hp.com> provided bug fixes, the initial RTC
+driver and the initial ia64 driver.
+
+Will Cohen <wcohen@redhat.com> integrated the ia64 driver into the
+oprofile release, and contributed bug fixes and several cleanups.
+
+Graydon Hoare <graydon@redhat.com> provided P4 port, bug fixes and cleanups.
+
+Ralf Baechle <ralf@linux-mips.org> provided the MIPS port.
+
+Other contributors are listed in the ChangeLog.
+
+Building
+--------
+
+Please read the installation instructions in doc/oprofile.html or
+http://oprofile.sourceforge.net/doc/install.html.
+
+Quick start :
+
+(If using CVS: ./autogen.sh first. You need automake 1.5 or higher. You
+can specify a different version, e.g.
+ACLOCAL=aclocal-1.5 AUTOMAKE=automake-1.5 AUTOCONF=autoconf-2.13 AUTOHEADER=autoheader-2.13 ./autogen.sh)
+
+2.4 kernels
+
+ ./configure --with-linux=/path/to/kernel/source
+
+2.6 kernels
+
+ ./configure --with-kernel-support
diff --git a/README_PACKAGERS b/README_PACKAGERS
new file mode 100644
index 0000000..cfdf43f
--- /dev/null
+++ b/README_PACKAGERS
@@ -0,0 +1,79 @@
+Building an RPM for OProfile
+==================================
+
+When building an RPM for OProfile, please follow the RPM packaging guidelines
+described in:
+ http://www.rpm.org/RPM-HOWTO/build.html
+
+
+New file to install as of release 0.9.3
+---------------------------------------
+
+As of release 0.9.3, opreport is capable of generating XML output.
+Tool developers who wish to use the xml output will need to have
+access to the doc/opreport.xsd file, which describes the schema.
+RPM packagers may install this file in the same package as the other
+standard OProfile components or in a separate devel package if desired.
+
+
+New files to install as of release 0.9.4
+---------------------------------------
+
+As of release 0.9.4, OProfile includes a JIT support library called libopagent.
+This library is needed at runtime when profiling JITed code from supported
+virtual machines. The install location for this library is:
+ <oprof-install-dir>/<libdir>/oprofile
+
+And there's a new binary file to install that's used for JIT profiling called
+opjitconv. As with the other oprofile executables, this file is installed in
+the <oprof-install-dir>/bin directory.
+
+OProfile also includes support for profiling Java applications. This support
+must be configured by way of the '--with-java=<path_to_jdk>' configure
+option. If your JDK is older than version 1.5, only a JVMPI agent library
+is built. If your JDK is version 1.5, both JVMPI and JVMTI agent
+libraries are built. If your JDK is 1.6 or newer, only the JVMTI agent
+library is built. As with libopagent described above, the install location
+for these is '<libdir>/oprofile'.
+
+RPM packagers can install the <libdir>/oprofile libraries in the same package
+as the other standard OProfile components or in a separate package if desired.
+It is recommended to run ldconfig in %post and %postun to add/remove the
+<libdir>/oprofile path from the standard library search paths.
+
+On bi-arch platforms that support more than one "bitness" of userspace software
+(e.g., 32-bit and 64-bit programs), it is recommended that the libopagent and
+Java agent libraries be packaged in a separate RPM. You could then build
+OProfile twice -- once for each bitness type. You would then distribute both
+versions of the RPMs containing the libraries, but only one RPM containing the
+"base" OProfile (i.e., executables, scripts, etc.).
+
+The new JIT support also provides the ability for third parties to develop
+JIT agents for other virtual machines. The development files provided for this
+purpose are:
+ doc/op-jit-devel.html
+ include/opagent.h
+
+Again, the RPM packager may package these files in the default package
+or in a separate devel package.
+
+
+Requirement for building a binary RPM package
+----------------------------------------
+
+OProfile requires the special user account "oprofile" to exist for purposes
+of processing samples from JIT'ed code (e.g., Java applications).
+
+When defining the spec file for the OProfile RPM, you should add the automatic
+creation of the special "oprofile" user account. Please refer to the URL
+below for an example of how this can be done:
+ http://fedoraproject.org/wiki/Packaging/UsersAndGroups
+
+For example, the following commands would add the necessary user account:
+
+ %pre
+ getent group oprofile >/dev/null || groupadd -r oprofile
+ getent passwd oprofile >/dev/null || \
+ useradd -r -g oprofile -d /home/oprofile -s /sbin/nologin \
+ -c "Special user account to be used by OProfile" oprofile
+ exit 0
diff --git a/TODO b/TODO
new file mode 100644
index 0000000..fcae2bd
--- /dev/null
+++ b/TODO
@@ -0,0 +1,268 @@
+This is an (incomplete) list of some of the stuff we want to look at doing.
+
+If you're interested in hacking on any of these, please contact the list first
+for some pointers and/or read HACKING and doc/CodingStyle.
+
+1.0 release
+-----------
+
+(this is a minimal selection of stuff I think we need)
+
+ o default to a vmlinux location: need agreement from kernel developers
+ o default to --separate=library (with anon, =none, makes not much sense)
+ o prettify image name for .jo files and allow lib-image: to specify it
+ o gisle's fixes
+ o opreport tgid:<tgid> doesn't work even if .jo files with that pid
+ o Fix:
+
+warning: [vdso] (tgid:9236 range:0x7fff98ffd000-0x7fff98fff000) could not be found.
+warning: /no-vmlinux could not be found.
+warning: /usr/lib64/libpanel-applet-2.so.0.2.27.#prelink#.sXCUK1 (deleted) could not be found.
+
+ o amd64 32 bit build needs a sys32_lookup_dcookie() translator in the
+ kernel
+ o decide on -m tgid semantics for anon regions
+ o if ev67 is not fixed, back it out
+ o lapic : module should says "didn't find apic" if needed, FAQ and doc should
+ speak a bit about lapic kernel option on x86 and recent kernel
+ o see the big comment in db_insert.c, it's possible to allow unlimited
+ amount of samples with a very minor change in libdb.
+ o if oprofile doesn't recognize the processor selected by the kernel
+ opcontrol could setup the module in timer mode (remove/reload prolly), and
+ warn the user it must upgrade oprofile to get all the feature from its
+ hardware.
+
+Later
+-----
+
+ o remove 2.95/2.2 support so we can use boost multi index container in
+ symbol/sample container
+ o consider if we can improve anon mapping growing support
+
+<movement> [moz@lambent pp]$ ./opreport -lf lib-image:/lib/tls/libc-2.3.2.so /bin/bash | grep vfprintf
+<movement> 14 0.1301 6 0.0102 /lib/tls/libc-2.3.2.so vfprintf
+<movement> [moz@lambent pp]$ ./opreport -lf lib-image:/lib/tls/libc-2.3.2.so /usr/bin/vim | grep vfprintf
+<movement> 176 2.0927 349 1.2552 /lib/tls/libc-2.3.2.so vfprintf
+<movement> [moz@lambent pp]$ ./opreport -lf lib-image:/lib/tls/libc-2.3.2.so { image:/bin/bash } { image:/usr/bin/vim } | grep vfprintf
+<movement> 176 10.9657 +++ 349 7.8888 +++ vfprintf
+<movement> 14 --- --- 6 --- --- vfprintf
+<movement> it seems them as two separate symbols
+<movement> but can we remove the app_name from rough_less and still be able to walk the two lists?
+<movement> even if we could, it would still go wrong when we're profiling multiple apps
+
+ o Java stuff??
+ o with opreport -c I can get "warning: /no-vmlinux could not be found.".
+ Should be smarter ?
+ o opreport -c gives weird output for an image with no symbols:
+
+ samples % symbol name
+ 15965 100.000 (no symbols)
+253 100.000 (no symbols)
+ 15965 98.4400 (no symbols)
+ 253 1.5600 (no symbols) [self]
+
+ o consider tagging opreport -c entries with a number like gprof
+ o --details for opreport -c, or diff??
+ o should [self] entries be ommitted if 0 ??
+ o stress test opreport -c: compile a Big Application w/o frame pointer and look
+ how driver and opreport -c react.
+ o oparchive could fix up {kern} paths with -p (what about diff between
+ archive and current though?)
+ o can say more in opcontrol --status
+ o consider a sort option for diff %
+ o opannotate is silent about symbols missing debug info
+ o oprofiled.log now contains various statistics about lost sample etc. from
+ the driver. Post profile tools must parse that and warn eventually, warning
+ must include a proposed work around. User need this: if nothing seems wrong
+ people are unlikely to get a look in oprofiled.log (I ran oprofile on 2.6.1
+ 2 weeks before noticing at 30000 I lost a lot of samples, the profile seemed
+ ok du to the randomization of lost samples). As developper we need that too,
+ actually we have no clear idea of the behavior on different arch, NUMA etc.
+ Not perfect because if the profiler is running the oprofiled.log will show
+ those warning only after the first alarm signal, I think we must dump the
+ statistics information after each opcontrol --dump to avoid that.
+ o odb_insert() can fail on ftruncate or mremap() in db_manage.c but we don't
+ try to recover gracefully.
+ o output column shortname headers for opreport -l
+ o is relative_to_absolute_path guaranteeing a trailing '/' documented ?
+ o move oprofiled.log to OP_SAMPLE_DIR/current ?
+ o pp tools must handle samples count overflow (marked as (unsigned)-1)
+ o the way we show kernel modules in 2.5 is not very obvious - "/oprofile"
+ o oparchive will be more usefull with a --root= options to allow profiling
+ on a small box, nfs mount / to another box and transfer sample file and
+ binary on a bigger box for analysis. There is also a problem in oparchive
+ you can use session: to get the right path to samples files but oprofiled.log
+ and abi files path are hardcoded to /var/lib/oprofile.
+ o callgraph patch: better way to skip ignored backtrace ?
+ o lib-image: and image: behavior depend on --separate=, if --separate=library
+ opreport "lib-image:*libc*" --merge=lib works but not
+ opreport "image:*libc*" --merge=lib whilst the behavior is reversed if
+ --separate==none. Must we take care ?
+ o dependencies between profile_container.h symbol_container.h and
+ sample_container.h become more and more ugly, I needed to include them
+ in a specific order in some source (still true??)
+ o add event aliases for common things like icache misses, we must start to
+ think about metrics including simple like event alias mapped to two or more
+ events and intepreted specially by user space tools like using the ratio
+ of samples; more tricky will be to select an event used as call count (no
+ cg on it) and used to emulate the call count field in gprof. I think this is
+ a after 1.0 thing but event aliases must be specified in a way allowing such
+ extension
+ o do we need an opreport like opreport -c (showing caller/callee at binary
+ boundary not symbols) ?
+ o we should notice an opcontrol config change (--separate etc.) and
+ auto-restart the daemon if necessary (Run)
+ o we can add lots more unit tests yet
+ o Itanium event constraints are not implemented
+ o GUI still has a physical-counter interface, should have a general one
+ like opcontrol --event
+ o I think we should have the ability to have *fixed* width headers, e.g. :
+
+vma samples cum. samples % cum. % symbol name image name app name
+0804c350 64582 64582 35.0757 35.0757 odb_insert /usr/loc...in/oprofiled /usr/local/oprofile-pp/bin/oprofiled
+
+ Note the ellipsis
+ o should we make the sighup handler re-read counter config and re-start profiling too ?
+ o improve --smart-demangle
+ o allow user to add it's own pattern in user.pat, document it.
+ o hard code ${typename} regular definition to remove all current limitations (difficult, perhaps after 1.0 ?).
+ o oprof_start dialog size is too small initially
+ o i18n. We need a good formatter, and also remember format_percent()
+ o opannotate --source --output-dir=~moz/op/ /usr/bin/oprofiled
+ will fail because the ~ is not expanded (no space around it) (popt bug I say)
+ o cpu names instead of numbers in 2.4 module/ ?
+ o remove 1 and 2 magic numbers for oprof_ready
+ o adapt Anton's patch for handling non-symbolled libraries ? (nowaday C++
+ anon namespace symbol are static, 3.4 iirc, so with recent distro we are
+ more likely to get problems with a "fallback to dynamic symbols" approch)
+ o use standard C integer type <stdint.h> int32_t int16_t etc.
+ o event multiplexing for real
+ o randomizing of reset value
+ o XML output
+ o profile the NMI handler code
+ o opannotate : I added this to the doc about difference between nr samples
+ credited to a source function and total number of samples for this function:
+ "The missing samples are not lost, they will be credited to another source
+ location where the inlined function is defined. The inlined function will
+ be credited from multiple call site and merged in one place in the
+ annotated source file so there is no way to see from what call site are
+ coming the samples for an inlined function."
+ I think we can work around this: output multiple instances of inlined
+ function like :
+ inline foo() { foo: total 1500 30.00 ...
+ ... annotated source from all call site
+ inline foo() { foo (call site bar()): total 500 10.00
+ .. annotated source from call site bar() etc.
+ what about template..., can we do/must we do something like that
+ template <class T> eat_cpu() and do a similar things, merging and annotating
+ all instantation then annotating for each distinct instantation, this will
+ break our "keep the source line number in annotated source file identical to
+ the original source"
+ o events/mips/34k/events, some events does not make sense, they get identical
+ event number, um and counter nr so they overlap, currently commented
+ o can we find a more efficient implementation for sparse_array ?
+ o libpp/profile.cpp:is_spu_sample_file() can be simplified by using
+ read_header()
+ o while fixing #1819350 I needed to make extra_images per profile session
+ rather than a global var so I think we need to revisit find_image_path(),
+ extra_found_images, --image-path (-p).
+ Actually we can't do something ala:
+ opreport { archive:tmp1 search_path=/lib/modules/2.6.20 } { archive:tmp2 search_path=/.../2.6.20.9 }
+ because search_path is specified through -p which is not a part of the
+ profile spec. Fixing #1819350 covered all case except this one but w/o any
+ user visible change. Another way will be to save the -p option used with
+ oparchive in a file at the toplevel of the archive, use it with all tools
+ when an archive: is specified on the command line and deprecate the use of
+ -p in such case.
+ o consider to make extra_images a ref counted object, it's copied by value
+ a few time but can contain a lot of string. There is also some ugly public
+ member extra_images to fix.
+ o daemon bss size can be improved, grep for MAX_PATH to see where dynamic
+ allocation can be used, try $ nm oprofiled --size-sort too.
+
+Documentation
+-------------
+
+ o the docs should mention the default event for each arch somewhere
+ o more discussion of problematic code needs to go in the "interpreting" section.
+ o document gcc 2.95 and linenr info problems especially for inline functions
+ o finish the internals manual
+
+JIT support
+-----------
+
+ o We need a more dynamic structure to handle entries_address_ascending and
+ entries_symbols_ascending, actually many scaling problem occur because they
+ are array, this was perfect to get a first implementation focusing on
+ handling overlap and all but the need to qsort/copy arrays at each iteration
+ is a performance killer. Some sort of AVL tree will do the job.
+ o Related to the previous, it's possible to do all processing in opjitconv.c
+ in a single left to right walk of the jitentry list.
+ o see the FIXME at parse_dump.c:parse_code_unload()
+ o Increment JITHEADER_VERSION in jitdump.h to be sure that the new code only
+ accepts dump file created by the new code.
+ o opjitconv.c:replacement_name() should be enough clever to avoid name
+ collision so we can remove the recursive call to disambiguate_symbol_names(),
+ need a hash table or some sort of associative array to check quickly if a
+ name exists, we will need some sort of avl tree so it's probably better
+ to do not implement a hash table only for this purpose.
+ o op_write_native_code() must accept one more parameter, the real code size
+ which can be zero or equal to code_size, this will allow to create elf
+ file w/o any code contents, only a symbol table and .text sections w/o
+ contents (yes ELF format allow that). For dynamic binary translation it'll
+ avoid to dump tons of code for little use, opannotate --assembly will not
+ work on such elf file but it can be a real win. It'll need to add to
+ jitrecord0 a real_size field, and some trickery when building the elf file,
+ taking care about the case we mix zero code size with non zero code size.
+ Perhaps we can use it too for java, filtering native method etc. Actually
+ we allow a simplified form of this feature by allowing to disable/enable
+ code dumping but at the whole dump level not on a symbol basis, quite
+ possible sufficient. [mpj: We're backing away from the idea of dumping
+ JIT records without code. Since BFD asymbol type does not include symbol size,
+ the op_bfd technique for determining symbol size relies on knowing the true
+ file size; and if code is not included in the .jo file, we don't have true size.]
+ o The pipe used for triggering JIT dump conversion should be used for normal
+ dumping too.
+ o See FIXME in agents/jvmti/libjvmti_oprofile.c:
+ If enablement to get line number info would be configurable through command line,
+ what should be the default on/off?
+ o See FIXME in opjitconv/debug_line.c
+ o The way to use the pipe should be made more secure to avoid denial of service
+ attacks. We have to think about it.
+ o Callgraph does not work properly for the .jo files the JIT support creates.
+ See section Chapter 4, sect 2.3.2 "Callgraph and JIT support". Try to figure
+ out a way to correlate an anonymous sample callgraph entry with
+ the .jo file that may exist for the anonymous code.
+ o see mail from Gisle Dankel:
+ "JIT_SUPPORT: Adding support for file-backed non-ELF JIT code"
+ -> should be changed (if useful) before next release
+ o See FIXME in op_header.cpp:
+ The check for header.mtime of JIT sample files is not correct because currently
+ this mtime value is set to zero due to missing cookie setting for JIT sample files.
+ Some additional check/setting to header.mtime should be made for JIT sample files.
+ o Mono JIT support:
+
+ 2007-11-08: with callgraph massi got
+ <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_
+
+ Massi added Mono JIT support, code on the stack is never unloaded and there is
+ no byte code, code is always compiled to native machine code, this mean than
+ for mono at least we can do callgraph if we can fix this samples filename
+ problem.
+
+General checks to make
+----------------------
+
+ o rgrep FIXME
+ o valgrind (--show-reachable=yes --leak-check=yes)
+ o audit to track unnecessary include <>
+ o gcc 3.0/3.x compile
+ o Qt2/3 check, no Qt check
+ o verify builds (modversions, kernel versions, athlon etc.). I have the
+ necessary stuff to check kernel versions/configurations on PIII core (Phil)
+ o use nm and a little script to track unused function
+ o test it to hell and back
+ o compile all C++ programs with STL_port and test them (gcc 3.4 contain a
+ debug mode too but std::string iterator are not checked)
+ o There is probably place of post profile tools where looking at errno will give better error messages.
+
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644
index 0000000..be778b3
--- /dev/null
+++ b/aclocal.m4
@@ -0,0 +1,7257 @@
+# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+
+# serial 48 AC_PROG_LIBTOOL
+
+
+# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
+# -----------------------------------------------------------
+# If this macro is not defined by Autoconf, define it here.
+m4_ifdef([AC_PROVIDE_IFELSE],
+ [],
+ [m4_define([AC_PROVIDE_IFELSE],
+ [m4_ifdef([AC_PROVIDE_$1],
+ [$2], [$3])])])
+
+
+# AC_PROG_LIBTOOL
+# ---------------
+AC_DEFUN([AC_PROG_LIBTOOL],
+[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
+dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
+dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
+ AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [AC_LIBTOOL_CXX],
+ [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
+ ])])
+dnl And a similar setup for Fortran 77 support
+ AC_PROVIDE_IFELSE([AC_PROG_F77],
+ [AC_LIBTOOL_F77],
+ [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
+])])
+
+dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
+dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
+dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
+ AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+ [AC_LIBTOOL_GCJ],
+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+ [AC_LIBTOOL_GCJ],
+ [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
+ [AC_LIBTOOL_GCJ],
+ [ifdef([AC_PROG_GCJ],
+ [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
+ ifdef([A][M_PROG_GCJ],
+ [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
+ ifdef([LT_AC_PROG_GCJ],
+ [define([LT_AC_PROG_GCJ],
+ defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
+])])# AC_PROG_LIBTOOL
+
+
+# _AC_PROG_LIBTOOL
+# ----------------
+AC_DEFUN([_AC_PROG_LIBTOOL],
+[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+# Prevent multiple expansion
+define([AC_PROG_LIBTOOL], [])
+])# _AC_PROG_LIBTOOL
+
+
+# AC_LIBTOOL_SETUP
+# ----------------
+AC_DEFUN([AC_LIBTOOL_SETUP],
+[AC_PREREQ(2.50)dnl
+AC_REQUIRE([AC_ENABLE_SHARED])dnl
+AC_REQUIRE([AC_ENABLE_STATIC])dnl
+AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_LD])dnl
+AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
+AC_REQUIRE([AC_PROG_NM])dnl
+
+AC_REQUIRE([AC_PROG_LN_S])dnl
+AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+AC_REQUIRE([AC_OBJEXT])dnl
+AC_REQUIRE([AC_EXEEXT])dnl
+dnl
+
+AC_LIBTOOL_SYS_MAX_CMD_LEN
+AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+AC_LIBTOOL_OBJDIR
+
+AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+_LT_AC_PROG_ECHO_BACKSLASH
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e 1s/^X//'
+[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
+
+# Same as above, but do not quote variable references.
+[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Constants:
+rm="rm -f"
+
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+AC_CHECK_TOOL(AR, ar, false)
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+AC_CHECK_TOOL(STRIP, strip, :)
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$SED" && SED=sed
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
+test -z "$ac_objext" && ac_objext=o
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ AC_PATH_MAGIC
+ fi
+ ;;
+esac
+
+AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+enable_win32_dll=yes, enable_win32_dll=no)
+
+AC_ARG_ENABLE([libtool-lock],
+ [AC_HELP_STRING([--disable-libtool-lock],
+ [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+AC_ARG_WITH([pic],
+ [AC_HELP_STRING([--with-pic],
+ [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+ [pic_mode="$withval"],
+ [pic_mode=default])
+test -z "$pic_mode" && pic_mode=default
+
+# Use C for the default configuration in the libtool script
+tagname=
+AC_LIBTOOL_LANG_C_CONFIG
+_LT_AC_TAGCONFIG
+])# AC_LIBTOOL_SETUP
+
+
+# _LT_AC_SYS_COMPILER
+# -------------------
+AC_DEFUN([_LT_AC_SYS_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_AC_SYS_COMPILER
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
+AC_DEFUN([_LT_CC_BASENAME],
+[for cc_temp in $1""; do
+ case $cc_temp in
+ compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+ distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+])
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+AC_DEFUN([_LT_COMPILER_BOILERPLATE],
+[ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+])# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+AC_DEFUN([_LT_LINKER_BOILERPLATE],
+[ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+])# _LT_LINKER_BOILERPLATE
+
+
+# _LT_AC_SYS_LIBPATH_AIX
+# ----------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
+[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi],[])
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+])# _LT_AC_SYS_LIBPATH_AIX
+
+
+# _LT_AC_SHELL_INIT(ARG)
+# ----------------------
+AC_DEFUN([_LT_AC_SHELL_INIT],
+[ifdef([AC_DIVERSION_NOTICE],
+ [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
+ [AC_DIVERT_PUSH(NOTICE)])
+$1
+AC_DIVERT_POP
+])# _LT_AC_SHELL_INIT
+
+
+# _LT_AC_PROG_ECHO_BACKSLASH
+# --------------------------
+# Add some code to the start of the generated configure script which
+# will find an echo command which doesn't interpret backslashes.
+AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
+[_LT_AC_SHELL_INIT([
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$ECHO in
+X*--fallback-echo)
+ # Remove one level of quotation (which was required for Make).
+ ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
+ ;;
+esac
+
+echo=${ECHO-echo}
+if test "X[$]1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+elif test "X[$]1" = X--fallback-echo; then
+ # Avoid inline document here, it may be left over
+ :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
+ # Yippee, $echo works!
+ :
+else
+ # Restart under the correct shell.
+ exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
+fi
+
+if test "X[$]1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<EOF
+[$]*
+EOF
+ exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test -z "$ECHO"; then
+if test "X${echo_test_string+set}" != Xset; then
+# find a string as large as possible, as long as the shell can cope with it
+ for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
+ # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+ if (echo_test_string=`eval $cmd`) 2>/dev/null &&
+ echo_test_string=`eval $cmd` &&
+ (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
+ then
+ break
+ fi
+ done
+fi
+
+if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ :
+else
+ # The Solaris, AIX, and Digital Unix default echo programs unquote
+ # backslashes. This makes it impossible to quote backslashes using
+ # echo "$something" | sed 's/\\/\\\\/g'
+ #
+ # So, first we look for a working echo in the user's PATH.
+
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for dir in $PATH /usr/ucb; do
+ IFS="$lt_save_ifs"
+ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ echo="$dir/echo"
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+
+ if test "X$echo" = Xecho; then
+ # We didn't find a better echo, so look for alternatives.
+ if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # This shell has a builtin print -r that does the trick.
+ echo='print -r'
+ elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
+ test "X$CONFIG_SHELL" != X/bin/ksh; then
+ # If we have ksh, try running configure again with it.
+ ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+ export ORIGINAL_CONFIG_SHELL
+ CONFIG_SHELL=/bin/ksh
+ export CONFIG_SHELL
+ exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
+ else
+ # Try using printf.
+ echo='printf %s\n'
+ if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # Cool, printf works
+ :
+ elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+ export CONFIG_SHELL
+ SHELL="$CONFIG_SHELL"
+ export SHELL
+ echo="$CONFIG_SHELL [$]0 --fallback-echo"
+ elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ echo="$CONFIG_SHELL [$]0 --fallback-echo"
+ else
+ # maybe with a smaller string...
+ prev=:
+
+ for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
+ if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
+ then
+ break
+ fi
+ prev="$cmd"
+ done
+
+ if test "$prev" != 'sed 50q "[$]0"'; then
+ echo_test_string=`eval $prev`
+ export echo_test_string
+ exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
+ else
+ # Oops. We lost completely, so just stick with echo.
+ echo=echo
+ fi
+ fi
+ fi
+ fi
+fi
+fi
+
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
+ ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
+fi
+
+AC_SUBST(ECHO)
+])])# _LT_AC_PROG_ECHO_BACKSLASH
+
+
+# _LT_AC_LOCK
+# -----------
+AC_DEFUN([_LT_AC_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+ [AC_HELP_STRING([--disable-libtool-lock],
+ [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.o` in
+ *32-bit*)
+ case $host in
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+ [AC_LANG_PUSH(C)
+ AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+ AC_LANG_POP])
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+sparc*-*solaris*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*) LD="${LD-ld} -m elf64_sparc" ;;
+ *) LD="${LD-ld} -64" ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
+ AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+ AC_CHECK_TOOL(AS, as, false)
+ AC_CHECK_TOOL(OBJDUMP, objdump, false)
+ ;;
+ ])
+esac
+
+need_locks="$enable_libtool_lock"
+
+])# _LT_AC_LOCK
+
+
+# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
+[AC_REQUIRE([LT_AC_PROG_SED])
+AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$3"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ fi
+ $rm conftest*
+])
+
+if test x"[$]$2" = xyes; then
+ ifelse([$5], , :, [$5])
+else
+ ifelse([$6], , :, [$6])
+fi
+])# AC_LIBTOOL_COMPILER_OPTION
+
+
+# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [ACTION-SUCCESS], [ACTION-FAILURE])
+# ------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
+[AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $3"
+ printf "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&AS_MESSAGE_LOG_FD
+ $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ $2=yes
+ fi
+ else
+ $2=yes
+ fi
+ fi
+ $rm conftest*
+ LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+ ifelse([$4], , :, [$4])
+else
+ ifelse([$5], , :, [$5])
+fi
+])# AC_LIBTOOL_LINKER_OPTION
+
+
+# AC_LIBTOOL_SYS_MAX_CMD_LEN
+# --------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
+[# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+ i=0
+ teststring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+
+ interix*)
+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
+ lt_cv_sys_max_cmd_len=196608
+ ;;
+
+ osf*)
+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+ # nice to cause kernel panics so lets avoid the loop below.
+ # First set a reasonable default.
+ lt_cv_sys_max_cmd_len=16384
+ #
+ if test -x /sbin/sysconfig; then
+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
+ esac
+ fi
+ ;;
+ sco3.2v5*)
+ lt_cv_sys_max_cmd_len=102400
+ ;;
+ sysv5* | sco5v6* | sysv4.2uw2*)
+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+ if test -n "$kargmax"; then
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'`
+ else
+ lt_cv_sys_max_cmd_len=32768
+ fi
+ ;;
+ *)
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
+ = "XX$teststring") >/dev/null 2>&1 &&
+ new_result=`expr "X$teststring" : ".*" 2>&1` &&
+ lt_cv_sys_max_cmd_len=$new_result &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on massive
+ # amounts of additional arguments before passing them to the linker.
+ # It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ ;;
+ esac
+])
+if test -n $lt_cv_sys_max_cmd_len ; then
+ AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+ AC_MSG_RESULT(none)
+fi
+])# AC_LIBTOOL_SYS_MAX_CMD_LEN
+
+
+# _LT_AC_CHECK_DLFCN
+# ------------------
+AC_DEFUN([_LT_AC_CHECK_DLFCN],
+[AC_CHECK_HEADERS(dlfcn.h)dnl
+])# _LT_AC_CHECK_DLFCN
+
+
+# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ---------------------------------------------------------------------
+AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
+[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
+if test "$cross_compiling" = yes; then :
+ [$4]
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<EOF
+[#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ exit (status);
+}]
+EOF
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) $1 ;;
+ x$lt_dlneed_uscore) $2 ;;
+ x$lt_dlunknown|x*) $3 ;;
+ esac
+ else :
+ # compilation failed
+ $3
+ fi
+fi
+rm -fr conftest*
+])# _LT_AC_TRY_DLOPEN_SELF
+
+
+# AC_LIBTOOL_DLOPEN_SELF
+# ----------------------
+AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
+[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
+if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ])
+ ;;
+
+ *)
+ AC_CHECK_FUNC([shl_load],
+ [lt_cv_dlopen="shl_load"],
+ [AC_CHECK_LIB([dld], [shl_load],
+ [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
+ [AC_CHECK_FUNC([dlopen],
+ [lt_cv_dlopen="dlopen"],
+ [AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+ [AC_CHECK_LIB([svld], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+ [AC_CHECK_LIB([dld], [dld_link],
+ [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
+ ])
+ ])
+ ])
+ ])
+ ])
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ AC_CACHE_CHECK([whether a program can dlopen itself],
+ lt_cv_dlopen_self, [dnl
+ _LT_AC_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+ lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+ ])
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+ AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+ lt_cv_dlopen_self_static, [dnl
+ _LT_AC_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+ lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
+ ])
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+])# AC_LIBTOOL_DLOPEN_SELF
+
+
+# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
+# ---------------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler
+AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
+[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+ [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+ [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+ $rm -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+ fi
+ fi
+ chmod u+w . 2>&AS_MESSAGE_LOG_FD
+ $rm conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
+ $rm out/* && rmdir out
+ cd ..
+ rmdir conftest
+ $rm conftest*
+])
+])# AC_LIBTOOL_PROG_CC_C_O
+
+
+# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
+# -----------------------------------------
+# Check to see if we can do hard links to lock some files if needed
+AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
+[AC_REQUIRE([_LT_AC_LOCK])dnl
+
+hard_links="nottested"
+if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ AC_MSG_CHECKING([if we can lock with hard links])
+ hard_links=yes
+ $rm conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ AC_MSG_RESULT([$hard_links])
+ if test "$hard_links" = no; then
+ AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
+
+
+# AC_LIBTOOL_OBJDIR
+# -----------------
+AC_DEFUN([AC_LIBTOOL_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+])# AC_LIBTOOL_OBJDIR
+
+
+# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
+# ----------------------------------------------
+# Check hardcoding attributes.
+AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_AC_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
+ test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
+ test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+
+ # We can hardcode non-existant directories.
+ if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+ test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
+ # Linking always hardcodes the temporary library directory.
+ _LT_AC_TAGVAR(hardcode_action, $1)=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ _LT_AC_TAGVAR(hardcode_action, $1)=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
+
+
+# AC_LIBTOOL_SYS_LIB_STRIP
+# ------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
+[striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+fi
+ ;;
+ *)
+ AC_MSG_RESULT([no])
+ ;;
+ esac
+fi
+])# AC_LIBTOOL_SYS_LIB_STRIP
+
+
+# AC_LIBTOOL_SYS_DYNAMIC_LINKER
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
+[AC_MSG_CHECKING([dynamic linker characteristics])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix4* | aix5*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[[01]] | aix4.[[01]].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[[45]]*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$host_os in
+ yes,cygwin* | yes,mingw* | yes,pw32*)
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $rm \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+ ;;
+ mingw*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ ;;
+
+ *)
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+ # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+ if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+ else
+ sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+ fi
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+kfreebsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='GNU ld.so'
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[[123]]*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[[01]]* | freebsdelf3.[[01]]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
+ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ freebsd*) # from 4.6 on
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+interix3*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+knetbsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='GNU ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+nto-qnx*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[[89]] | openbsd2.[[89]].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ shlibpath_overrides_runpath=no
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ shlibpath_overrides_runpath=yes
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
+
+
+# _LT_AC_TAGCONFIG
+# ----------------
+AC_DEFUN([_LT_AC_TAGCONFIG],
+[AC_ARG_WITH([tags],
+ [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
+ [include additional configurations @<:@automatic@:>@])],
+ [tagnames="$withval"])
+
+if test -f "$ltmain" && test -n "$tagnames"; then
+ if test ! -f "${ofile}"; then
+ AC_MSG_WARN([output file `$ofile' does not exist])
+ fi
+
+ if test -z "$LTCC"; then
+ eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
+ if test -z "$LTCC"; then
+ AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
+ else
+ AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
+ fi
+ fi
+ if test -z "$LTCFLAGS"; then
+ eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
+ fi
+
+ # Extract list of available tagged configurations in $ofile.
+ # Note that this assumes the entire list is on one line.
+ available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
+
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for tagname in $tagnames; do
+ IFS="$lt_save_ifs"
+ # Check whether tagname contains only valid characters
+ case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
+ "") ;;
+ *) AC_MSG_ERROR([invalid tag name: $tagname])
+ ;;
+ esac
+
+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
+ then
+ AC_MSG_ERROR([tag name \"$tagname\" already exists])
+ fi
+
+ # Update the list of available tags.
+ if test -n "$tagname"; then
+ echo appending configuration tag \"$tagname\" to $ofile
+
+ case $tagname in
+ CXX)
+ if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+ (test "X$CXX" != "Xg++"))) ; then
+ AC_LIBTOOL_LANG_CXX_CONFIG
+ else
+ tagname=""
+ fi
+ ;;
+
+ F77)
+ if test -n "$F77" && test "X$F77" != "Xno"; then
+ AC_LIBTOOL_LANG_F77_CONFIG
+ else
+ tagname=""
+ fi
+ ;;
+
+ GCJ)
+ if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
+ AC_LIBTOOL_LANG_GCJ_CONFIG
+ else
+ tagname=""
+ fi
+ ;;
+
+ RC)
+ AC_LIBTOOL_LANG_RC_CONFIG
+ ;;
+
+ *)
+ AC_MSG_ERROR([Unsupported tag name: $tagname])
+ ;;
+ esac
+
+ # Append the new tag name to the list of available tags.
+ if test -n "$tagname" ; then
+ available_tags="$available_tags $tagname"
+ fi
+ fi
+ done
+ IFS="$lt_save_ifs"
+
+ # Now substitute the updated list of available tags.
+ if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
+ mv "${ofile}T" "$ofile"
+ chmod +x "$ofile"
+ else
+ rm -f "${ofile}T"
+ AC_MSG_ERROR([unable to update list of available tagged configurations.])
+ fi
+fi
+])# _LT_AC_TAGCONFIG
+
+
+# AC_LIBTOOL_DLOPEN
+# -----------------
+# enable checks for dlopen support
+AC_DEFUN([AC_LIBTOOL_DLOPEN],
+ [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
+])# AC_LIBTOOL_DLOPEN
+
+
+# AC_LIBTOOL_WIN32_DLL
+# --------------------
+# declare package support for building win32 DLLs
+AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
+])# AC_LIBTOOL_WIN32_DLL
+
+
+# AC_ENABLE_SHARED([DEFAULT])
+# ---------------------------
+# implement the --enable-shared flag
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_SHARED],
+[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([shared],
+ [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+ [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
+])# AC_ENABLE_SHARED
+
+
+# AC_DISABLE_SHARED
+# -----------------
+# set the default shared flag to --disable-shared
+AC_DEFUN([AC_DISABLE_SHARED],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_SHARED(no)
+])# AC_DISABLE_SHARED
+
+
+# AC_ENABLE_STATIC([DEFAULT])
+# ---------------------------
+# implement the --enable-static flag
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_STATIC],
+[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([static],
+ [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+ [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_static=]AC_ENABLE_STATIC_DEFAULT)
+])# AC_ENABLE_STATIC
+
+
+# AC_DISABLE_STATIC
+# -----------------
+# set the default static flag to --disable-static
+AC_DEFUN([AC_DISABLE_STATIC],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_STATIC(no)
+])# AC_DISABLE_STATIC
+
+
+# AC_ENABLE_FAST_INSTALL([DEFAULT])
+# ---------------------------------
+# implement the --enable-fast-install flag
+# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_FAST_INSTALL],
+[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([fast-install],
+ [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+ [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+ [p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
+])# AC_ENABLE_FAST_INSTALL
+
+
+# AC_DISABLE_FAST_INSTALL
+# -----------------------
+# set the default to --disable-fast-install
+AC_DEFUN([AC_DISABLE_FAST_INSTALL],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_FAST_INSTALL(no)
+])# AC_DISABLE_FAST_INSTALL
+
+
+# AC_LIBTOOL_PICMODE([MODE])
+# --------------------------
+# implement the --with-pic flag
+# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
+AC_DEFUN([AC_LIBTOOL_PICMODE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+pic_mode=ifelse($#,1,$1,default)
+])# AC_LIBTOOL_PICMODE
+
+
+# AC_PROG_EGREP
+# -------------
+# This is predefined starting with Autoconf 2.54, so this conditional
+# definition can be removed once we require Autoconf 2.54 or later.
+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
+[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
+ [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+ then ac_cv_prog_egrep='grep -E'
+ else ac_cv_prog_egrep='egrep'
+ fi])
+ EGREP=$ac_cv_prog_egrep
+ AC_SUBST([EGREP])
+])])
+
+
+# AC_PATH_TOOL_PREFIX
+# -------------------
+# find a file program which can recognise shared library
+AC_DEFUN([AC_PATH_TOOL_PREFIX],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] | ?:[\\/]*])
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word. This closes a longstanding sh security hole.
+ ac_dummy="ifelse([$2], , $PATH, [$2])"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$1; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ AC_MSG_RESULT($MAGIC_CMD)
+else
+ AC_MSG_RESULT(no)
+fi
+])# AC_PATH_TOOL_PREFIX
+
+
+# AC_PATH_MAGIC
+# -------------
+# find a file program which can recognise a shared library
+AC_DEFUN([AC_PATH_MAGIC],
+[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+ else
+ MAGIC_CMD=:
+ fi
+fi
+])# AC_PATH_MAGIC
+
+
+# AC_PROG_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([AC_PROG_LD],
+[AC_ARG_WITH([gnu-ld],
+ [AC_HELP_STRING([--with-gnu-ld],
+ [assume the C compiler uses GNU ld @<:@default=no@:>@])],
+ [test "$withval" = no || with_gnu_ld=yes],
+ [with_gnu_ld=no])
+AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ AC_MSG_CHECKING([for ld used by $CC])
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [[\\/]]* | ?:[[\\/]]*)
+ re_direlt='/[[^/]][[^/]]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ AC_MSG_CHECKING([for GNU ld])
+else
+ AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ AC_MSG_RESULT($LD)
+else
+ AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_PROG_LD_GNU
+])# AC_PROG_LD
+
+
+# AC_PROG_LD_GNU
+# --------------
+AC_DEFUN([AC_PROG_LD_GNU],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# AC_PROG_LD_GNU
+
+
+# AC_PROG_LD_RELOAD_FLAG
+# ----------------------
+# find reload flag for linker
+# -- PORTME Some linkers may need a different reload flag.
+AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+ lt_cv_ld_reload_flag,
+ [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+])# AC_PROG_LD_RELOAD_FLAG
+
+
+# AC_DEPLIBS_CHECK_METHOD
+# -----------------------
+# how to check for library dependencies
+# -- PORTME fill in with the dynamic library characteristics
+AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
+[AC_CACHE_CHECK([how to recognise dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix4* | aix5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi[[45]]*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # func_win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # func_win32_libid shell function, so use a weaker test based on 'objdump'.
+ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | kfreebsd*-gnu | dragonfly*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case $host_cpu in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+interix3*)
+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be Linux ELF.
+linux*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+nto-qnx*)
+ lt_cv_deplibs_check_method=unknown
+ ;;
+
+openbsd*)
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.3*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ pc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+])
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+])# AC_DEPLIBS_CHECK_METHOD
+
+
+# AC_PROG_NM
+# ----------
+# find the pathname to a BSD-compatible name lister
+AC_DEFUN([AC_PROG_NM],
+[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
+[if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ lt_nm_to_check="${ac_tool_prefix}nm"
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ lt_nm_to_check="$lt_nm_to_check nm"
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm="$ac_dir/$lt_tmp_nm"
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+ done
+ test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi])
+NM="$lt_cv_path_NM"
+])# AC_PROG_NM
+
+
+# AC_CHECK_LIBM
+# -------------
+# check for math library
+AC_DEFUN([AC_CHECK_LIBM],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
+ # These system don't have libm, or don't need it
+ ;;
+*-ncr-sysv4.3*)
+ AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+ AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+ ;;
+*)
+ AC_CHECK_LIB(m, cos, LIBM="-lm")
+ ;;
+esac
+])# AC_CHECK_LIBM
+
+
+# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
+# -----------------------------------
+# sets LIBLTDL to the link flags for the libltdl convenience library and
+# LTDLINCL to the include flags for the libltdl header and adds
+# --enable-ltdl-convenience to the configure arguments. Note that
+# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided,
+# it is assumed to be `libltdl'. LIBLTDL will be prefixed with
+# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
+# (note the single quotes!). If your package is not flat and you're not
+# using automake, define top_builddir and top_srcdir appropriately in
+# the Makefiles.
+AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+ case $enable_ltdl_convenience in
+ no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
+ "") enable_ltdl_convenience=yes
+ ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
+ esac
+ LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
+ LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+ # For backwards non-gettext consistent compatibility...
+ INCLTDL="$LTDLINCL"
+])# AC_LIBLTDL_CONVENIENCE
+
+
+# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
+# -----------------------------------
+# sets LIBLTDL to the link flags for the libltdl installable library and
+# LTDLINCL to the include flags for the libltdl header and adds
+# --enable-ltdl-install to the configure arguments. Note that
+# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided,
+# and an installed libltdl is not found, it is assumed to be `libltdl'.
+# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
+# '${top_srcdir}/' (note the single quotes!). If your package is not
+# flat and you're not using automake, define top_builddir and top_srcdir
+# appropriately in the Makefiles.
+# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
+AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+ AC_CHECK_LIB(ltdl, lt_dlinit,
+ [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
+ [if test x"$enable_ltdl_install" = xno; then
+ AC_MSG_WARN([libltdl not installed, but installation disabled])
+ else
+ enable_ltdl_install=yes
+ fi
+ ])
+ if test x"$enable_ltdl_install" = x"yes"; then
+ ac_configure_args="$ac_configure_args --enable-ltdl-install"
+ LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
+ LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+ else
+ ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
+ LIBLTDL="-lltdl"
+ LTDLINCL=
+ fi
+ # For backwards non-gettext consistent compatibility...
+ INCLTDL="$LTDLINCL"
+])# AC_LIBLTDL_INSTALLABLE
+
+
+# AC_LIBTOOL_CXX
+# --------------
+# enable support for C++ libraries
+AC_DEFUN([AC_LIBTOOL_CXX],
+[AC_REQUIRE([_LT_AC_LANG_CXX])
+])# AC_LIBTOOL_CXX
+
+
+# _LT_AC_LANG_CXX
+# ---------------
+AC_DEFUN([_LT_AC_LANG_CXX],
+[AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([_LT_AC_PROG_CXXCPP])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
+])# _LT_AC_LANG_CXX
+
+# _LT_AC_PROG_CXXCPP
+# ------------------
+AC_DEFUN([_LT_AC_PROG_CXXCPP],
+[
+AC_REQUIRE([AC_PROG_CXX])
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+ (test "X$CXX" != "Xg++"))) ; then
+ AC_PROG_CXXCPP
+fi
+])# _LT_AC_PROG_CXXCPP
+
+# AC_LIBTOOL_F77
+# --------------
+# enable support for Fortran 77 libraries
+AC_DEFUN([AC_LIBTOOL_F77],
+[AC_REQUIRE([_LT_AC_LANG_F77])
+])# AC_LIBTOOL_F77
+
+
+# _LT_AC_LANG_F77
+# ---------------
+AC_DEFUN([_LT_AC_LANG_F77],
+[AC_REQUIRE([AC_PROG_F77])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
+])# _LT_AC_LANG_F77
+
+
+# AC_LIBTOOL_GCJ
+# --------------
+# enable support for GCJ libraries
+AC_DEFUN([AC_LIBTOOL_GCJ],
+[AC_REQUIRE([_LT_AC_LANG_GCJ])
+])# AC_LIBTOOL_GCJ
+
+
+# _LT_AC_LANG_GCJ
+# ---------------
+AC_DEFUN([_LT_AC_LANG_GCJ],
+[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
+ [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
+ [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
+ [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
+ [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
+])# _LT_AC_LANG_GCJ
+
+
+# AC_LIBTOOL_RC
+# -------------
+# enable support for Windows resource files
+AC_DEFUN([AC_LIBTOOL_RC],
+[AC_REQUIRE([LT_AC_PROG_RC])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
+])# AC_LIBTOOL_RC
+
+
+# AC_LIBTOOL_LANG_C_CONFIG
+# ------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
+AC_DEFUN([_LT_AC_LANG_C_CONFIG],
+[lt_save_CC="$CC"
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}\n'
+
+_LT_AC_SYS_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF
+
+# Report which library types will actually be built
+AC_MSG_CHECKING([if libtool supports shared libraries])
+AC_MSG_RESULT([$can_build_shared])
+
+AC_MSG_CHECKING([whether to build shared libraries])
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case $host_os in
+aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+aix4* | aix5*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+esac
+AC_MSG_RESULT([$enable_shared])
+
+AC_MSG_CHECKING([whether to build static libraries])
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+AC_MSG_RESULT([$enable_static])
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_C_CONFIG
+
+
+# AC_LIBTOOL_LANG_CXX_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
+AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
+[AC_LANG_PUSH(C++)
+AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([_LT_AC_PROG_CXXCPP])
+
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
+_LT_AC_TAGVAR(module_cmds, $1)=
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Dependencies to place before and after the object being linked:
+_LT_AC_TAGVAR(predep_objects, $1)=
+_LT_AC_TAGVAR(postdep_objects, $1)=
+_LT_AC_TAGVAR(predeps, $1)=
+_LT_AC_TAGVAR(postdeps, $1)=
+_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_LD=$LD
+lt_save_GCC=$GCC
+GCC=$GXX
+lt_save_with_gnu_ld=$with_gnu_ld
+lt_save_path_LD=$lt_cv_path_LD
+if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+else
+ $as_unset lt_cv_prog_gnu_ld
+fi
+if test -n "${lt_cv_path_LDCXX+set}"; then
+ lt_cv_path_LD=$lt_cv_path_LDCXX
+else
+ $as_unset lt_cv_path_LD
+fi
+test -z "${LDCXX+set}" || LD=$LDCXX
+CC=${CXX-"c++"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+
+# We don't want -fno-exception wen compiling C++ code, so set the
+# no_builtin_flag separately
+if test "$GXX" = yes; then
+ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+else
+ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+fi
+
+if test "$GXX" = yes; then
+ # Set up default GNU C++ configuration
+
+ AC_PROG_LD
+
+ # Check if GNU C++ uses GNU ld as the underlying linker, since the
+ # archiving commands below assume that GNU ld is being used.
+ if test "$with_gnu_ld" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+ # investigate it a little bit more. (MM)
+ wlarc='${wl}'
+
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
+ grep 'no-whole-archive' > /dev/null; then
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ with_gnu_ld=no
+ wlarc=
+
+ # A generic and very simple default shared library creation
+ # command for GNU C++ for the case where it uses the native
+ # linker, instead of GNU ld. If possible, this setting should
+ # overridden to take advantage of the native linker features on
+ # the platform it is being used on.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ fi
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+else
+ GXX=no
+ with_gnu_ld=no
+ wlarc=
+fi
+
+# PORTME: fill in a description of your system's C++ link characteristics
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+_LT_AC_TAGVAR(ld_shlibs, $1)=yes
+case $host_os in
+ aix3*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aix4* | aix5*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
+ for ld_flag in $LDFLAGS; do
+ case $ld_flag in
+ *-brtl*)
+ aix_use_runtimelinking=yes
+ break
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_AC_TAGVAR(archive_cmds, $1)=''
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+ if test "$GXX" = yes; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ else
+ # We have old collect2
+ _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an empty executable.
+ _LT_AC_SYS_LIBPATH_AIX
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an empty executable.
+ _LT_AC_SYS_LIBPATH_AIX
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ chorus*)
+ case $cc_basename in
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_AC_TAGVAR(always_export_symbols, $1)=no
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ darwin* | rhapsody*)
+ case $host_os in
+ rhapsody* | darwin1.[[012]])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
+ ;;
+ *) # Darwin 1.3 on
+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+ else
+ case ${MACOSX_DEPLOYMENT_TARGET} in
+ 10.[[012]])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+ ;;
+ 10.*)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+ if test "$GXX" = yes ; then
+ lt_int_apple_cc_single_mod=no
+ output_verbose_link_cmd='echo'
+ if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
+ lt_int_apple_cc_single_mod=yes
+ fi
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ fi
+ _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ else
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ else
+ case $cc_basename in
+ xlc*)
+ output_verbose_link_cmd='echo'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+ _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ ;;
+ *)
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ fi
+ ;;
+
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+ freebsd[[12]]*)
+ # C++ shared libraries reported to be fairly broken before switch to ELF
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ freebsd-elf*)
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ ;;
+ freebsd* | kfreebsd*-gnu | dragonfly*)
+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+ # conventions
+ _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+ gnu*)
+ ;;
+ hpux9*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ hpux10*|hpux11*)
+ if test $with_gnu_ld = no; then
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+ ;;
+ *)
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+ esac
+ fi
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ esac
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC*)
+ case $host_cpu in
+ hppa*64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test $with_gnu_ld = no; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ fi
+ else
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ interix3*)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+ irix5* | irix6*)
+ case $cc_basename in
+ CC*)
+ # SGI C++
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+
+ # Archives containing C++ object files must be created using
+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+ fi
+ fi
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+ esac
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+ linux*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
+ icpc*)
+ # Intel C++
+ with_gnu_ld=yes
+ # version 8.0 and above of icpc choke on multiply defined symbols
+ # if we add $predep_objects and $postdep_objects, however 7.1 and
+ # earlier do not add the objects themselves.
+ case `$CC -V 2>&1` in
+ *"Version 7."*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ *) # Version 8.0 or newer
+ tmp_idyn=
+ case $host_cpu in
+ ia64*) tmp_idyn=' -i_dynamic';;
+ esac
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ esac
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ ;;
+ pgCC*)
+ # Portland Group C++ compiler
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ ;;
+ cxx*)
+ # Compaq C++
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+ runpath_var=LD_RUN_PATH
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ esac
+ ;;
+ lynxos*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ m88k*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ fi
+ # Workaround some broken pre-1.5 toolchains
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+ ;;
+ openbsd2*)
+ # C++ shared libraries are fairly broken
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ openbsd*)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ fi
+ output_verbose_link_cmd='echo'
+ ;;
+ osf3*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ cxx*)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Archives containing C++ object files must be created using
+ # the KAI C++ compiler.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ cxx*)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+ echo "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~
+ $rm $lib.exp'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ psos*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ lcc*)
+ # Lucid
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The C++ compiler is used as linker so we must use $wl
+ # flag to pass the commands to the underlying system
+ # linker. We must also pass each convience library through
+ # to the system linker between allextract/defaultextract.
+ # The C++ compiler will combine linker options so we
+ # cannot just pass the convience library names through
+ # without $wl.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+ output_verbose_link_cmd='echo'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+ # The C++ compiler must be used to create the archive.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+ ;;
+ *)
+ # GNU C++ compiler with Solaris linker
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+ if $CC --version | grep -v '^2\.7' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+ else
+ # g++ 2.7 appears to require `-G' NOT `-shared' on this
+ # platform.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+ fi
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+ fi
+ ;;
+ esac
+ ;;
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+ _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ # So that behaviour is only enabled if SCOABSPATH is set to a
+ # non-empty value in the environment. Most likely only useful for
+ # creating official distributions of packages.
+ # This is a hack until libtool officially supports absolute path
+ # names for shared libraries.
+ _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+ vxworks*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+esac
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_AC_TAGVAR(GCC, $1)="$GXX"
+_LT_AC_TAGVAR(LD, $1)="$LD"
+
+AC_LIBTOOL_POSTDEP_PREDEP($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+with_gnu_ld=$lt_save_with_gnu_ld
+lt_cv_path_LDCXX=$lt_cv_path_LD
+lt_cv_path_LD=$lt_save_path_LD
+lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+])# AC_LIBTOOL_LANG_CXX_CONFIG
+
+# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
+# ------------------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library. It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
+int a;
+void foo (void) { a = 0; }
+EOF
+],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
+class Foo
+{
+public:
+ Foo (void) { a = 0; }
+private:
+ int a;
+};
+EOF
+],[$1],[F77],[cat > conftest.$ac_ext <<EOF
+ subroutine foo
+ implicit none
+ integer*4 a
+ a=0
+ return
+ end
+EOF
+],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
+public class foo {
+ private int a;
+ public void bar (void) {
+ a = 0;
+ }
+};
+EOF
+])
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ # The `*' in the case matches for architectures that use `case' in
+ # $output_verbose_cmd can trigger glob expansion during the loop
+ # eval without this substitution.
+ output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
+
+ for p in `eval $output_verbose_link_cmd`; do
+ case $p in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test $p = "-L" \
+ || test $p = "-R"; then
+ prev=$p
+ continue
+ else
+ prev=
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ case $p in
+ -L* | -R*)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
+ _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+ else
+ _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
+ _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
+ else
+ _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
+ fi
+ fi
+ ;;
+
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
+ _LT_AC_TAGVAR(predep_objects, $1)="$p"
+ else
+ _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
+ fi
+ else
+ if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
+ _LT_AC_TAGVAR(postdep_objects, $1)="$p"
+ else
+ _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
+ fi
+ fi
+ ;;
+
+ *) ;; # Ignore the rest.
+
+ esac
+ done
+
+ # Clean up.
+ rm -f a.out a.exe
+else
+ echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$rm -f confest.$objext
+
+# PORTME: override above test on systems where it is broken
+ifelse([$1],[CXX],
+[case $host_os in
+interix3*)
+ # Interix 3.5 installs completely hosed .la files for C++, so rather than
+ # hack all around it, let's just trust "g++" to DTRT.
+ _LT_AC_TAGVAR(predep_objects,$1)=
+ _LT_AC_TAGVAR(postdep_objects,$1)=
+ _LT_AC_TAGVAR(postdeps,$1)=
+ ;;
+
+solaris*)
+ case $cc_basename in
+ CC*)
+ # Adding this requires a known-good setup of shared libraries for
+ # Sun compiler versions before 5.6, else PIC objects from an old
+ # archive will be linked into the output, leading to subtle bugs.
+ _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun'
+ ;;
+ esac
+ ;;
+esac
+])
+
+case " $_LT_AC_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+])# AC_LIBTOOL_POSTDEP_PREDEP
+
+# AC_LIBTOOL_LANG_F77_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
+AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
+[AC_REQUIRE([AC_PROG_F77])
+AC_LANG_PUSH(Fortran 77)
+
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
+_LT_AC_TAGVAR(module_cmds, $1)=
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code=" subroutine t\n return\n end\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code=" program t\n end\n"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${F77-"f77"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+
+AC_MSG_CHECKING([if libtool supports shared libraries])
+AC_MSG_RESULT([$can_build_shared])
+
+AC_MSG_CHECKING([whether to build shared libraries])
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case $host_os in
+aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+aix4* | aix5*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+esac
+AC_MSG_RESULT([$enable_shared])
+
+AC_MSG_CHECKING([whether to build static libraries])
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+AC_MSG_RESULT([$enable_static])
+
+_LT_AC_TAGVAR(GCC, $1)="$G77"
+_LT_AC_TAGVAR(LD, $1)="$LD"
+
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_F77_CONFIG
+
+
+# AC_LIBTOOL_LANG_GCJ_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
+AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
+[AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${GCJ-"gcj"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_GCJ_CONFIG
+
+
+# AC_LIBTOOL_LANG_RC_CONFIG
+# -------------------------
+# Ensure that the configuration vars for the Windows resource compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
+AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
+[AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${RC-"windres"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_RC_CONFIG
+
+
+# AC_LIBTOOL_CONFIG([TAGNAME])
+# ----------------------------
+# If TAGNAME is not passed, then create an initial libtool script
+# with a default configuration from the untagged config vars. Otherwise
+# add code to config.status for appending the configuration named by
+# TAGNAME from the matching tagged config vars.
+AC_DEFUN([AC_LIBTOOL_CONFIG],
+[# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+ # See if we are running on zsh, and set the options which allow our commands through
+ # without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+ # Now quote all the things that may contain metacharacters while being
+ # careful not to overquote the AC_SUBSTed values. We take copies of the
+ # variables and quote the copies for generation of the libtool script.
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
+ SED SHELL STRIP \
+ libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+ old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+ deplibs_check_method reload_flag reload_cmds need_locks \
+ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+ old_postinstall_cmds old_postuninstall_cmds \
+ _LT_AC_TAGVAR(compiler, $1) \
+ _LT_AC_TAGVAR(CC, $1) \
+ _LT_AC_TAGVAR(LD, $1) \
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
+ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
+ _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
+ _LT_AC_TAGVAR(old_archive_cmds, $1) \
+ _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
+ _LT_AC_TAGVAR(predep_objects, $1) \
+ _LT_AC_TAGVAR(postdep_objects, $1) \
+ _LT_AC_TAGVAR(predeps, $1) \
+ _LT_AC_TAGVAR(postdeps, $1) \
+ _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
+ _LT_AC_TAGVAR(archive_cmds, $1) \
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
+ _LT_AC_TAGVAR(postinstall_cmds, $1) \
+ _LT_AC_TAGVAR(postuninstall_cmds, $1) \
+ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
+ _LT_AC_TAGVAR(allow_undefined_flag, $1) \
+ _LT_AC_TAGVAR(no_undefined_flag, $1) \
+ _LT_AC_TAGVAR(export_symbols_cmds, $1) \
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
+ _LT_AC_TAGVAR(hardcode_automatic, $1) \
+ _LT_AC_TAGVAR(module_cmds, $1) \
+ _LT_AC_TAGVAR(module_expsym_cmds, $1) \
+ _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
+ _LT_AC_TAGVAR(exclude_expsyms, $1) \
+ _LT_AC_TAGVAR(include_expsyms, $1); do
+
+ case $var in
+ _LT_AC_TAGVAR(old_archive_cmds, $1) | \
+ _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
+ _LT_AC_TAGVAR(archive_cmds, $1) | \
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
+ _LT_AC_TAGVAR(module_cmds, $1) | \
+ _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
+ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
+ _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
+ extract_expsyms_cmds | reload_cmds | finish_cmds | \
+ postinstall_cmds | postuninstall_cmds | \
+ old_postinstall_cmds | old_postuninstall_cmds | \
+ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+ # Double-quote double-evaled strings.
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+ ;;
+ *)
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+ ;;
+ esac
+ done
+
+ case $lt_echo in
+ *'\[$]0 --fallback-echo"')
+ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
+ ;;
+ esac
+
+ifelse([$1], [],
+ [cfgfile="${ofile}T"
+ trap "$rm \"$cfgfile\"; exit 1" 1 2 15
+ $rm -f "$cfgfile"
+ AC_MSG_NOTICE([creating $ofile])],
+ [cfgfile="$ofile"])
+
+ cat <<__EOF__ >> "$cfgfile"
+ifelse([$1], [],
+[#! $SHELL
+
+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool:
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="$SED -e 1s/^X//"
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# The names of the tagged configurations supported by this script.
+available_tags=
+
+# ### BEGIN LIBTOOL CONFIG],
+[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
+# A language-specific compiler.
+CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
+
+# Is the compiler the GNU C compiler?
+with_gcc=$_LT_AC_TAGVAR(GCC, $1)
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
+archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
+module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
+
+# Symbols that must always be exported.
+include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
+
+ifelse([$1],[],
+[# ### END LIBTOOL CONFIG],
+[# ### END LIBTOOL TAG CONFIG: $tagname])
+
+__EOF__
+
+ifelse([$1],[], [
+ case $host_os in
+ aix3*)
+ cat <<\EOF >> "$cfgfile"
+
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+EOF
+ ;;
+ esac
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
+
+ mv -f "$cfgfile" "$ofile" || \
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+])
+else
+ # If there is no Makefile yet, we rely on a make rule to execute
+ # `config.status --recheck' to rerun these tests and create the
+ # libtool script then.
+ ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+ if test -f "$ltmain_in"; then
+ test -f Makefile && make "$ltmain"
+ fi
+fi
+])# AC_LIBTOOL_CONFIG
+
+
+# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------------------
+AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
+[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+
+_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+
+ AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+ lt_cv_prog_compiler_rtti_exceptions,
+ [-fno-rtti -fno-exceptions], [],
+ [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
+
+
+# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+# ---------------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
+[AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([AC_PROG_NM])
+AC_REQUIRE([AC_OBJEXT])
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Transform an extracted symbol line into a proper C declaration
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[[BCDT]]'
+ ;;
+cygwin* | mingw* | pw32*)
+ symcode='[[ABCDGISTW]]'
+ ;;
+hpux*) # Its linker distinguishes data from code symbols
+ if test "$host_cpu" = ia64; then
+ symcode='[[ABCDEGRST]]'
+ fi
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
+ ;;
+linux*)
+ if test "$host_cpu" = ia64; then
+ symcode='[[ABCDGIRSTW]]'
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
+ fi
+ ;;
+irix* | nonstopux*)
+ symcode='[[BCDEGRST]]'
+ ;;
+osf*)
+ symcode='[[BCDEGQRST]]'
+ ;;
+solaris*)
+ symcode='[[BDRT]]'
+ ;;
+sco3.2v5*)
+ symcode='[[DT]]'
+ ;;
+sysv4.2uw2*)
+ symcode='[[DT]]'
+ ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+ symcode='[[ABDT]]'
+ ;;
+sysv4)
+ symcode='[[DFNSTU]]'
+ ;;
+esac
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+ symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+ # Write the raw and C identifiers.
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+EOF
+
+ if AC_TRY_EVAL(ac_compile); then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if grep ' nm_test_var$' "$nlist" >/dev/null; then
+ if grep ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
+
+ cat <<EOF >> conftest.$ac_ext
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+ const char *name;
+ lt_ptr_t address;
+}
+lt_preloaded_symbols[[]] =
+{
+EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
+ cat <<\EOF >> conftest.$ac_ext
+ {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_save_LIBS="$LIBS"
+ lt_save_CFLAGS="$CFLAGS"
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+ LIBS="$lt_save_LIBS"
+ CFLAGS="$lt_save_CFLAGS"
+ else
+ echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+ fi
+ else
+ echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+ cat conftest.$ac_ext >&5
+ fi
+ rm -f conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ AC_MSG_RESULT(failed)
+else
+ AC_MSG_RESULT(ok)
+fi
+]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+
+
+# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
+# ---------------------------------------
+AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
+[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
+
+AC_MSG_CHECKING([for $compiler option to produce PIC])
+ ifelse([$1],[CXX],[
+ # C++ specific cases for pic, static, wl, etc.
+ if test "$GXX" = yes; then
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+ amigaos*)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | os2* | pw32*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ interix3*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ else
+ case $host_os in
+ aix4* | aix5*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ cxch68*)
+ # Green Hills C++ Compiler
+ # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+ ;;
+ esac
+ ;;
+ darwin*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ case $cc_basename in
+ xlc*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ ;;
+ esac
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd* | kfreebsd*-gnu | dragonfly*)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ if test "$host_cpu" != ia64; then
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ fi
+ ;;
+ aCC*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ interix*)
+ # This is c89, which is MS Visual C++ (no shared libs)
+ # Anyone wants to do a port?
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case $cc_basename in
+ CC*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux*)
+ case $cc_basename in
+ KCC*)
+ # KAI C++ Compiler
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ icpc* | ecpc*)
+ # Intel C++
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ pgCC*)
+ # Portland Group C++ compiler.
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ cxx*)
+ # Compaq C++
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd*)
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ cxx*)
+ # Digital/Compaq C++
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ psos*)
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ lcc*)
+ # Lucid
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ case $cc_basename in
+ CC*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ esac
+ ;;
+ vxworks*)
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+],
+[
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+
+ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+
+ interix3*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ enable_shared=no
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+
+ hpux*)
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ darwin*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ case $cc_basename in
+ xlc*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ ;;
+ esac
+ ;;
+
+ mingw* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC (with -KPIC) is the default.
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ newsos6)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ linux*)
+ case $cc_basename in
+ icc* | ecc*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ ccc*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All Alpha code is PIC.
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ esac
+ ;;
+
+ osf3* | osf4* | osf5*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All OSF/1 code is PIC.
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ solaris*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ unicos*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+
+ uts4*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+])
+AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
+ AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
+ _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
+ [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
+ [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
+ "" | " "*) ;;
+ *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+ esac],
+ [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
+ ;;
+esac
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\"
+AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+ _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
+ $lt_tmp_static_flag,
+ [],
+ [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
+])
+
+
+# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
+# ------------------------------------
+# See if the linker supports building shared libraries.
+AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
+[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ifelse([$1],[CXX],[
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ case $host_os in
+ aix4* | aix5*)
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+ fi
+ ;;
+ pw32*)
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+ ;;
+ cygwin* | mingw*)
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ *)
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ esac
+],[
+ runpath_var=
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+ _LT_AC_TAGVAR(archive_cmds, $1)=
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+ _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
+ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+ _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+ _LT_AC_TAGVAR(hardcode_automatic, $1)=no
+ _LT_AC_TAGVAR(module_cmds, $1)=
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)=
+ _LT_AC_TAGVAR(always_export_symbols, $1)=no
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ _LT_AC_TAGVAR(include_expsyms, $1)=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ extract_expsyms_cmds=
+ # Just being paranoid about ensuring that cc_basename is set.
+ _LT_CC_BASENAME([$compiler])
+ case $host_os in
+ cygwin* | mingw* | pw32*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+ if test "$with_gnu_ld" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>/dev/null` in
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix3* | aix4* | aix5*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+ fi
+ ;;
+
+ amigaos*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+
+ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+ # that the semantics of dynamic libraries on AmigaOS, at least up
+ # to version 4, is to share data among multiple programs linked
+ # with the same dynamic library. Since this doesn't match the
+ # behavior of shared libraries on other platforms, we can't use
+ # them.
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_AC_TAGVAR(always_export_symbols, $1)=no
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ interix3*)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ linux*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ tmp_addflag=
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ esac
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test $supports_anon_versioning = yes; then
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ $echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+
+ if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
+ runpath_var=
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+ fi
+ ;;
+
+ aix4* | aix5*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ _LT_AC_TAGVAR(archive_cmds, $1)=''
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[[012]]|aix4.[[012]].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ else
+ # We have old collect2
+ _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an empty executable.
+ _LT_AC_SYS_LIBPATH_AIX
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an empty executable.
+ _LT_AC_SYS_LIBPATH_AIX
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ # see comment about different semantics on the GNU ld section
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ bsdi[[45]]*)
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
+ # FIXME: Should let the user specify the lib program.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
+ _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+
+ darwin* | rhapsody*)
+ case $host_os in
+ rhapsody* | darwin1.[[012]])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
+ ;;
+ *) # Darwin 1.3 on
+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+ else
+ case ${MACOSX_DEPLOYMENT_TARGET} in
+ 10.[[012]])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+ ;;
+ 10.*)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ if test "$GCC" = yes ; then
+ output_verbose_link_cmd='echo'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ else
+ case $cc_basename in
+ xlc*)
+ output_verbose_link_cmd='echo'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+ _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ ;;
+ *)
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ fi
+ ;;
+
+ dgux*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ freebsd1*)
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | kfreebsd*-gnu | dragonfly*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+
+ hpux10*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ case $host_cpu in
+ hppa*64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ *)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ newsos6)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ openbsd*)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ else
+ case $host_os in
+ openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ ;;
+
+ os2*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ else
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ solaris*)
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+ else
+ wlarc=''
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *)
+ # The compiler driver will combine linker options so we
+ # cannot just pass the convience library names through
+ # without $wl, iff we do not link with $LD.
+ # Luckily, gcc supports the same syntax we need for Sun Studio.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ case $wlarc in
+ '')
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
+ *)
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+ esac ;;
+ esac
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ ;;
+ motorola)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4.3*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*)
+ _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ fi
+])
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+ # Assume -lc should be added
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $_LT_AC_TAGVAR(archive_cmds, $1) in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ AC_MSG_CHECKING([whether -lc should be explicitly linked in])
+ $rm conftest*
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
+ pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=
+ if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
+ then
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ else
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+ fi
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $rm conftest*
+ AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
+ ;;
+ esac
+ fi
+ ;;
+esac
+])# AC_LIBTOOL_PROG_LD_SHLIBS
+
+
+# _LT_AC_FILE_LTDLL_C
+# -------------------
+# Be careful that the start marker always follows a newline.
+AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
+# /* ltdll.c starts here */
+# #define WIN32_LEAN_AND_MEAN
+# #include <windows.h>
+# #undef WIN32_LEAN_AND_MEAN
+# #include <stdio.h>
+#
+# #ifndef __CYGWIN__
+# # ifdef __CYGWIN32__
+# # define __CYGWIN__ __CYGWIN32__
+# # endif
+# #endif
+#
+# #ifdef __cplusplus
+# extern "C" {
+# #endif
+# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
+# #ifdef __cplusplus
+# }
+# #endif
+#
+# #ifdef __CYGWIN__
+# #include <cygwin/cygwin_dll.h>
+# DECLARE_CYGWIN_DLL( DllMain );
+# #endif
+# HINSTANCE __hDllInstance_base;
+#
+# BOOL APIENTRY
+# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
+# {
+# __hDllInstance_base = hInst;
+# return TRUE;
+# }
+# /* ltdll.c ends here */
+])# _LT_AC_FILE_LTDLL_C
+
+
+# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
+# ---------------------------------
+AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
+
+
+# old names
+AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL])
+AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+AC_DEFUN([AM_PROG_LD], [AC_PROG_LD])
+AC_DEFUN([AM_PROG_NM], [AC_PROG_NM])
+
+# This is just to silence aclocal about the macro not being used
+ifelse([AC_DISABLE_FAST_INSTALL])
+
+AC_DEFUN([LT_AC_PROG_GCJ],
+[AC_CHECK_TOOL(GCJ, gcj, no)
+ test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+ AC_SUBST(GCJFLAGS)
+])
+
+AC_DEFUN([LT_AC_PROG_RC],
+[AC_CHECK_TOOL(RC, windres, no)
+])
+
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_SED. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+# LT_AC_PROG_SED
+# --------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible. Prefer GNU sed if found.
+AC_DEFUN([LT_AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for lt_ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+ lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+ fi
+ done
+ done
+done
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+ test ! -f $lt_ac_sed && continue
+ cat /dev/null > conftest.in
+ lt_ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+ # Check for GNU sed and select it if it is found.
+ if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+ lt_cv_path_SED=$lt_ac_sed
+ break
+ fi
+ while true; do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo >>conftest.nl
+ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+ cmp -s conftest.out conftest.nl || break
+ # 10000 chars as input seems more than enough
+ test $lt_ac_count -gt 10 && break
+ lt_ac_count=`expr $lt_ac_count + 1`
+ if test $lt_ac_count -gt $lt_ac_max; then
+ lt_ac_max=$lt_ac_count
+ lt_cv_path_SED=$lt_ac_sed
+ fi
+ done
+done
+])
+SED=$lt_cv_path_SED
+AC_MSG_RESULT([$SED])
+])
+
+# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION so it can be traced.
+# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+ [AM_AUTOMAKE_VERSION([1.9.6])])
+
+# AM_AUX_DIR_EXPAND -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 7
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])
+AC_SUBST([$1_FALSE])
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
+ [$1], CXX, [depcc="$CXX" am_compiler_list=],
+ [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+ [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_$1_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])
+])
+
+# Generate code to set up dependency tracking. -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 3
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[for mf in $CONFIG_FILES; do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # So let's grep whole file.
+ if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+ dirpart=`AS_DIRNAME("$mf")`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`AS_DIRNAME(["$file"])`
+ AS_MKDIR_P([$dirpart/$fdir])
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled. FIXME. This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
+AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
+
+# Do all the work for Automake. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 12
+
+# This macro actually does too much. Some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.58])dnl
+dnl Autoconf wants to disallow AM_ names. We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+ test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_PROG_INSTALL_SH
+AM_PROG_INSTALL_STRIP
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES(CC)],
+ [define([AC_PROG_CC],
+ defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES(CXX)],
+ [define([AC_PROG_CXX],
+ defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+])
+])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $1 | $1:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+AC_SUBST(install_sh)])
+
+# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot. For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Check to see how 'make' treats includes. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+ am__include=include
+ am__quote=
+ _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ fi
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
+#
+# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
+# created by `make install' are always world readable, even if the
+# installer happens to have an overly restrictive umask (e.g. 077).
+# This was a mistake. There are at least two reasons why we must not
+# use `-m 0755':
+# - it causes special bits like SGID to be ignored,
+# - it may be too restrictive (some setups expect 775 directories).
+#
+# Do not use -m 0755 and let people choose whatever they expect by
+# setting umask.
+#
+# We cannot accept any implementation of `mkdir' that recognizes `-p'.
+# Some implementations (such as Solaris 8's) are not thread-safe: if a
+# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
+# concurrently, both version can detect that a/ is missing, but only
+# one can create it and the other will error out. Consequently we
+# restrict ourselves to GNU make (using the --version option ensures
+# this.)
+AC_DEFUN([AM_PROG_MKDIR_P],
+[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+ # We used to keeping the `.' as first argument, in order to
+ # allow $(mkdir_p) to be used without argument. As in
+ # $(mkdir_p) $(somedir)
+ # where $(somedir) is conditionally defined. However this is wrong
+ # for two reasons:
+ # 1. if the package is installed by a user who cannot write `.'
+ # make install will fail,
+ # 2. the above comment should most certainly read
+ # $(mkdir_p) $(DESTDIR)$(somedir)
+ # so it does not work when $(somedir) is undefined and
+ # $(DESTDIR) is not.
+ # To support the latter case, we have to write
+ # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
+ # so the `.' trick is pointless.
+ mkdir_p='mkdir -p --'
+else
+ # On NextStep and OpenStep, the `mkdir' command does not
+ # recognize any option. It will interpret all options as
+ # directories to create, and then abort because `.' already
+ # exists.
+ for d in ./-p ./--version;
+ do
+ test -d $d && rmdir $d
+ done
+ # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+ if test -f "$ac_aux_dir/mkinstalldirs"; then
+ mkdir_p='$(mkinstalldirs)'
+ else
+ mkdir_p='$(install_sh) -d'
+ fi
+fi
+AC_SUBST([mkdir_p])])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Check to make sure that the build environment is sane. -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+alias in your environment])
+ fi
+
+ test "$[2]" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Check how to create a tarball. -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+# tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+# $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+ [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+ [m4_case([$1], [ustar],, [pax],,
+ [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar;
+ do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
+m4_include([m4/binutils.m4])
+m4_include([m4/builtinexpect.m4])
+m4_include([m4/cellspubfdsupport.m4])
+m4_include([m4/compileroption.m4])
+m4_include([m4/configmodule.m4])
+m4_include([m4/copyifchange.m4])
+m4_include([m4/docbook.m4])
+m4_include([m4/extradirs.m4])
+m4_include([m4/findkernel.m4])
+m4_include([m4/kerneloption.m4])
+m4_include([m4/kernelversion.m4])
+m4_include([m4/mallocattribute.m4])
+m4_include([m4/poptconst.m4])
+m4_include([m4/precompiledheader.m4])
+m4_include([m4/qt.m4])
+m4_include([m4/resultyn.m4])
+m4_include([m4/sstream.m4])
+m4_include([m4/typedef.m4])
diff --git a/agents/Makefile.am b/agents/Makefile.am
new file mode 100644
index 0000000..10325a1
--- /dev/null
+++ b/agents/Makefile.am
@@ -0,0 +1,30 @@
+
+SUBDIRS =
+
+if BUILD_JVMTI_AGENT
+SUBDIRS += jvmti
+endif
+
+if BUILD_JVMPI_AGENT
+SUBDIRS += jvmpi
+endif
+
+install-exec-hook:
+ @getent passwd oprofile >/dev/null || ( \
+ echo "****************************************************************" ; \
+ echo "* WARNING:" ; \
+ echo "* Create the 'oprofile' user account to enable profiling of JITed code." ; \
+ echo "****************************************************************") ;
+ @getent group oprofile >/dev/null || ( \
+ echo "****************************************************************" ; \
+ echo "* WARNING:" ; \
+ echo "* Create the 'oprofile' group to enable profiling of JITed code." ; \
+ echo "****************************************************************") ;
+ @test -z `id -gn oprofile 2>/dev/null` || \
+ test `id -gn oprofile 2>/dev/null` = "oprofile" || ( \
+ echo "****************************************************************" ; \
+ echo "* WARNING:" ; \
+ echo "* The special user 'oprofile' must have the default group set to 'oprofile'." ; \
+ echo "****************************************************************") ;
+
+
diff --git a/agents/Makefile.in b/agents/Makefile.in
new file mode 100644
index 0000000..b4ccde6
--- /dev/null
+++ b/agents/Makefile.in
@@ -0,0 +1,546 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+@BUILD_JVMTI_AGENT_TRUE@am__append_1 = jvmti
+@BUILD_JVMPI_AGENT_TRUE@am__append_2 = jvmpi
+subdir = agents
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/binutils.m4 \
+ $(top_srcdir)/m4/builtinexpect.m4 \
+ $(top_srcdir)/m4/cellspubfdsupport.m4 \
+ $(top_srcdir)/m4/compileroption.m4 \
+ $(top_srcdir)/m4/configmodule.m4 \
+ $(top_srcdir)/m4/copyifchange.m4 $(top_srcdir)/m4/docbook.m4 \
+ $(top_srcdir)/m4/extradirs.m4 $(top_srcdir)/m4/findkernel.m4 \
+ $(top_srcdir)/m4/kerneloption.m4 \
+ $(top_srcdir)/m4/kernelversion.m4 \
+ $(top_srcdir)/m4/mallocattribute.m4 \
+ $(top_srcdir)/m4/poptconst.m4 \
+ $(top_srcdir)/m4/precompiledheader.m4 $(top_srcdir)/m4/qt.m4 \
+ $(top_srcdir)/m4/resultyn.m4 $(top_srcdir)/m4/sstream.m4 \
+ $(top_srcdir)/m4/typedef.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-exec-recursive install-info-recursive \
+ install-recursive installcheck-recursive installdirs-recursive \
+ pdf-recursive ps-recursive uninstall-info-recursive \
+ uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = jvmti jvmpi
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFD_LIBS = @BFD_LIBS@
+BUILD_JVMPI_AGENT_FALSE = @BUILD_JVMPI_AGENT_FALSE@
+BUILD_JVMPI_AGENT_TRUE = @BUILD_JVMPI_AGENT_TRUE@
+BUILD_JVMTI_AGENT_FALSE = @BUILD_JVMTI_AGENT_FALSE@
+BUILD_JVMTI_AGENT_TRUE = @BUILD_JVMTI_AGENT_TRUE@
+CAT_ENTRY_END = @CAT_ENTRY_END@
+CAT_ENTRY_START = @CAT_ENTRY_START@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOCBOOK_ROOT = @DOCBOOK_ROOT@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+EXTRA_CFLAGS_MODULE = @EXTRA_CFLAGS_MODULE@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAVA_HOMEDIR = @JAVA_HOMEDIR@
+KINC = @KINC@
+KSRC = @KSRC@
+KVERS = @KVERS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBERTY_LIBS = @LIBERTY_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MOC = @MOC@
+MODINSTALLDIR = @MODINSTALLDIR@
+OBJEXT = @OBJEXT@
+OPROFILE_DIR = @OPROFILE_DIR@
+OPROFILE_MODULE_ARCH = @OPROFILE_MODULE_ARCH@
+OP_CFLAGS = @OP_CFLAGS@
+OP_CXXFLAGS = @OP_CXXFLAGS@
+OP_DOCDIR = @OP_DOCDIR@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POPT_LIBS = @POPT_LIBS@
+PTRDIFF_T_TYPE = @PTRDIFF_T_TYPE@
+QT_INCLUDES = @QT_INCLUDES@
+QT_LDFLAGS = @QT_LDFLAGS@
+QT_LIB = @QT_LIB@
+QT_VERSION = @QT_VERSION@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIZE_T_TYPE = @SIZE_T_TYPE@
+STRIP = @STRIP@
+UIC = @UIC@
+VERSION = @VERSION@
+XML_CATALOG = @XML_CATALOG@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+have_qt_FALSE = @have_qt_FALSE@
+have_qt_TRUE = @have_qt_TRUE@
+have_xsltproc_FALSE = @have_xsltproc_FALSE@
+have_xsltproc_TRUE = @have_xsltproc_TRUE@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+kernel_support_FALSE = @kernel_support_FALSE@
+kernel_support_TRUE = @kernel_support_TRUE@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+topdir = @topdir@
+SUBDIRS = $(am__append_1) $(am__append_2)
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign agents/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign agents/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(mkdir_p) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+ distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+ @$(NORMAL_INSTALL)
+ $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+ clean clean-generic clean-libtool clean-recursive ctags \
+ ctags-recursive distclean distclean-generic distclean-libtool \
+ distclean-recursive distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-exec install-exec-am install-exec-hook \
+ install-info install-info-am install-man install-strip \
+ installcheck installcheck-am installdirs installdirs-am \
+ maintainer-clean maintainer-clean-generic \
+ maintainer-clean-recursive mostlyclean mostlyclean-generic \
+ mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \
+ tags tags-recursive uninstall uninstall-am uninstall-info-am
+
+
+install-exec-hook:
+ @getent passwd oprofile >/dev/null || ( \
+ echo "****************************************************************" ; \
+ echo "* WARNING:" ; \
+ echo "* Create the 'oprofile' user account to enable profiling of JITed code." ; \
+ echo "****************************************************************") ;
+ @getent group oprofile >/dev/null || ( \
+ echo "****************************************************************" ; \
+ echo "* WARNING:" ; \
+ echo "* Create the 'oprofile' group to enable profiling of JITed code." ; \
+ echo "****************************************************************") ;
+ @test -z `id -gn oprofile 2>/dev/null` || \
+ test `id -gn oprofile 2>/dev/null` = "oprofile" || ( \
+ echo "****************************************************************" ; \
+ echo "* WARNING:" ; \
+ echo "* The special user 'oprofile' must have the default group set to 'oprofile'." ; \
+ echo "****************************************************************") ;
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/agents/jvmpi/Makefile.am b/agents/jvmpi/Makefile.am
new file mode 100644
index 0000000..8e6bb6e
--- /dev/null
+++ b/agents/jvmpi/Makefile.am
@@ -0,0 +1,12 @@
+pkglib_LTLIBRARIES = libjvmpi_oprofile.la
+
+libjvmpi_oprofile_la_CXXFLAGS = -W -Wall -fPIC
+
+libjvmpi_oprofile_la_SOURCES = jvmpi_oprofile.cpp
+
+libjvmpi_oprofile_la_LIBADD = ../../libopagent/libopagent.la
+
+AM_CPPFLAGS = \
+ -I ${top_srcdir}/libopagent \
+ -I @JAVA_HOMEDIR@/include \
+ -I @JAVA_HOMEDIR@/include/linux
diff --git a/agents/jvmpi/Makefile.in b/agents/jvmpi/Makefile.in
new file mode 100644
index 0000000..4d3a766
--- /dev/null
+++ b/agents/jvmpi/Makefile.in
@@ -0,0 +1,521 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = agents/jvmpi
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/binutils.m4 \
+ $(top_srcdir)/m4/builtinexpect.m4 \
+ $(top_srcdir)/m4/cellspubfdsupport.m4 \
+ $(top_srcdir)/m4/compileroption.m4 \
+ $(top_srcdir)/m4/configmodule.m4 \
+ $(top_srcdir)/m4/copyifchange.m4 $(top_srcdir)/m4/docbook.m4 \
+ $(top_srcdir)/m4/extradirs.m4 $(top_srcdir)/m4/findkernel.m4 \
+ $(top_srcdir)/m4/kerneloption.m4 \
+ $(top_srcdir)/m4/kernelversion.m4 \
+ $(top_srcdir)/m4/mallocattribute.m4 \
+ $(top_srcdir)/m4/poptconst.m4 \
+ $(top_srcdir)/m4/precompiledheader.m4 $(top_srcdir)/m4/qt.m4 \
+ $(top_srcdir)/m4/resultyn.m4 $(top_srcdir)/m4/sstream.m4 \
+ $(top_srcdir)/m4/typedef.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+pkglibLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libjvmpi_oprofile_la_DEPENDENCIES = ../../libopagent/libopagent.la
+am_libjvmpi_oprofile_la_OBJECTS = \
+ libjvmpi_oprofile_la-jvmpi_oprofile.lo
+libjvmpi_oprofile_la_OBJECTS = $(am_libjvmpi_oprofile_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libjvmpi_oprofile_la_SOURCES)
+DIST_SOURCES = $(libjvmpi_oprofile_la_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFD_LIBS = @BFD_LIBS@
+BUILD_JVMPI_AGENT_FALSE = @BUILD_JVMPI_AGENT_FALSE@
+BUILD_JVMPI_AGENT_TRUE = @BUILD_JVMPI_AGENT_TRUE@
+BUILD_JVMTI_AGENT_FALSE = @BUILD_JVMTI_AGENT_FALSE@
+BUILD_JVMTI_AGENT_TRUE = @BUILD_JVMTI_AGENT_TRUE@
+CAT_ENTRY_END = @CAT_ENTRY_END@
+CAT_ENTRY_START = @CAT_ENTRY_START@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOCBOOK_ROOT = @DOCBOOK_ROOT@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+EXTRA_CFLAGS_MODULE = @EXTRA_CFLAGS_MODULE@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAVA_HOMEDIR = @JAVA_HOMEDIR@
+KINC = @KINC@
+KSRC = @KSRC@
+KVERS = @KVERS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBERTY_LIBS = @LIBERTY_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MOC = @MOC@
+MODINSTALLDIR = @MODINSTALLDIR@
+OBJEXT = @OBJEXT@
+OPROFILE_DIR = @OPROFILE_DIR@
+OPROFILE_MODULE_ARCH = @OPROFILE_MODULE_ARCH@
+OP_CFLAGS = @OP_CFLAGS@
+OP_CXXFLAGS = @OP_CXXFLAGS@
+OP_DOCDIR = @OP_DOCDIR@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POPT_LIBS = @POPT_LIBS@
+PTRDIFF_T_TYPE = @PTRDIFF_T_TYPE@
+QT_INCLUDES = @QT_INCLUDES@
+QT_LDFLAGS = @QT_LDFLAGS@
+QT_LIB = @QT_LIB@
+QT_VERSION = @QT_VERSION@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIZE_T_TYPE = @SIZE_T_TYPE@
+STRIP = @STRIP@
+UIC = @UIC@
+VERSION = @VERSION@
+XML_CATALOG = @XML_CATALOG@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+have_qt_FALSE = @have_qt_FALSE@
+have_qt_TRUE = @have_qt_TRUE@
+have_xsltproc_FALSE = @have_xsltproc_FALSE@
+have_xsltproc_TRUE = @have_xsltproc_TRUE@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+kernel_support_FALSE = @kernel_support_FALSE@
+kernel_support_TRUE = @kernel_support_TRUE@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+topdir = @topdir@
+pkglib_LTLIBRARIES = libjvmpi_oprofile.la
+libjvmpi_oprofile_la_CXXFLAGS = -W -Wall -fPIC
+libjvmpi_oprofile_la_SOURCES = jvmpi_oprofile.cpp
+libjvmpi_oprofile_la_LIBADD = ../../libopagent/libopagent.la
+AM_CPPFLAGS = \
+ -I ${top_srcdir}/libopagent \
+ -I @JAVA_HOMEDIR@/include \
+ -I @JAVA_HOMEDIR@/include/linux
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign agents/jvmpi/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign agents/jvmpi/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ test -z "$(pkglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkglibdir)"
+ @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+ if test -f $$p; then \
+ f=$(am__strip_dir) \
+ echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \
+ $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \
+ else :; fi; \
+ done
+
+uninstall-pkglibLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @set -x; list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+ p=$(am__strip_dir) \
+ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \
+ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \
+ done
+
+clean-pkglibLTLIBRARIES:
+ -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+ @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libjvmpi_oprofile.la: $(libjvmpi_oprofile_la_OBJECTS) $(libjvmpi_oprofile_la_DEPENDENCIES)
+ $(CXXLINK) -rpath $(pkglibdir) $(libjvmpi_oprofile_la_LDFLAGS) $(libjvmpi_oprofile_la_OBJECTS) $(libjvmpi_oprofile_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjvmpi_oprofile_la-jvmpi_oprofile.Plo@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+
+libjvmpi_oprofile_la-jvmpi_oprofile.lo: jvmpi_oprofile.cpp
+@am__fastdepCXX_TRUE@ if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjvmpi_oprofile_la_CXXFLAGS) $(CXXFLAGS) -MT libjvmpi_oprofile_la-jvmpi_oprofile.lo -MD -MP -MF "$(DEPDIR)/libjvmpi_oprofile_la-jvmpi_oprofile.Tpo" -c -o libjvmpi_oprofile_la-jvmpi_oprofile.lo `test -f 'jvmpi_oprofile.cpp' || echo '$(srcdir)/'`jvmpi_oprofile.cpp; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/libjvmpi_oprofile_la-jvmpi_oprofile.Tpo" "$(DEPDIR)/libjvmpi_oprofile_la-jvmpi_oprofile.Plo"; else rm -f "$(DEPDIR)/libjvmpi_oprofile_la-jvmpi_oprofile.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='jvmpi_oprofile.cpp' object='libjvmpi_oprofile_la-jvmpi_oprofile.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjvmpi_oprofile_la_CXXFLAGS) $(CXXFLAGS) -c -o libjvmpi_oprofile_la-jvmpi_oprofile.lo `test -f 'jvmpi_oprofile.cpp' || echo '$(srcdir)/'`jvmpi_oprofile.cpp
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+ for dir in "$(DESTDIR)$(pkglibdir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-pkglibLTLIBRARIES
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-exec \
+ install-exec-am install-info install-info-am install-man \
+ install-pkglibLTLIBRARIES install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-info-am \
+ uninstall-pkglibLTLIBRARIES
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/agents/jvmpi/jvmpi_oprofile.cpp b/agents/jvmpi/jvmpi_oprofile.cpp
new file mode 100644
index 0000000..800667f
--- /dev/null
+++ b/agents/jvmpi/jvmpi_oprofile.cpp
@@ -0,0 +1,239 @@
+/**
+ * @file jvmpi_oprofile.cpp
+ * JVMPI agent implementation to report jitted JVM code to OProfile
+ *
+ * @remark Copyright 2007 OProfile authors
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @author Maynard Johnson
+ *
+ * Copyright IBM Corporation 2007
+ *
+ */
+
+#include <iostream>
+#include <map>
+#include <string>
+#include <cstring>
+#include <stdexcept>
+#include <cerrno>
+
+extern "C" {
+#include <stdint.h>
+#include <jvmpi.h>
+#include <opagent.h>
+}
+
+using namespace std;
+
+static bool debug = false;
+static op_agent_t agent_hdl;
+
+class class_details {
+public:
+ string name;
+ map<jmethodID, string> method_names;
+ map<jmethodID, string> method_signatures;
+};
+
+
+static pthread_mutex_t class_map_mutex = PTHREAD_MUTEX_INITIALIZER;
+static map <jobjectID, class_details> loaded_classes;
+
+void class_load(JVMPI_Event * event)
+{
+ class_details cls;
+ cls.name = event->u.class_load.class_name;
+ JVMPI_Method * passed_methods = event->u.class_load.methods;
+ for (int i = 0; i < event->u.class_load.num_methods;
+ i++, passed_methods++) {
+ cls.method_names[passed_methods->method_id] =
+ passed_methods->method_name;
+ cls.method_signatures[passed_methods->method_id] =
+ passed_methods->method_signature;
+ }
+
+ pthread_mutex_lock(&class_map_mutex);
+ loaded_classes[event->u.class_load.class_id] = cls;
+ pthread_mutex_unlock(&class_map_mutex);
+}
+
+void class_unload(JVMPI_Event * event)
+{
+ pthread_mutex_lock(&class_map_mutex);
+ loaded_classes.erase(event->u.class_load.class_id);
+ pthread_mutex_unlock(&class_map_mutex);
+}
+
+JVMPI_Interface * jvmpi;
+
+void compiled_method_load(JVMPI_Event * event)
+{
+ jmethodID method = event->u.compiled_method_load.method_id;
+ void * code_addr = event->u.compiled_method_load.code_addr;
+ jint code_size = event->u.compiled_method_load.code_size;
+
+ jvmpi->DisableGC();
+ /* Get the class of the method */
+ jobjectID classID = jvmpi->GetMethodClass(method);
+ jvmpi->EnableGC();
+
+ pthread_mutex_lock(&class_map_mutex);
+ map<jobjectID, class_details>::iterator iter =
+ loaded_classes.find(classID);
+ if (iter == loaded_classes.end()) {
+ throw runtime_error("Error: Cannot find class for compiled"
+ " method\n");
+ }
+
+ class_details cls_info = ((class_details)iter->second);
+ map<jmethodID, string>::iterator method_it =
+ cls_info.method_names.find(method);
+ if (method_it == cls_info.method_names.end()) {
+ throw runtime_error("Error: Cannot find method name for "
+ "compiled method\n");
+ }
+ char const * method_name = ((string)method_it->second).c_str();
+ method_it = cls_info.method_signatures.find(method);
+ if (method_it == cls_info.method_signatures.end()) {
+ throw runtime_error("Error: Cannot find method signature "
+ "for compiled method\n");
+ }
+ char const * method_signature = ((string)method_it->second).c_str();
+
+ string const class_signature = "L" + cls_info.name + ";";
+ pthread_mutex_unlock(&class_map_mutex);
+
+ if (debug) {
+ cerr << "load: class=" << class_signature << ", method ="
+ << method_name << ", method signature = "
+ << method_signature
+ << ", addr=" << code_addr << ", size="
+ << code_size << endl;
+ }
+
+ // produce a symbol name out of class name and method name
+ int cnt = strlen(method_name) + strlen(class_signature.c_str()) +
+ strlen(method_signature) + 2;
+ char buf[cnt];
+ strncpy(buf, class_signature.c_str(), cnt - 1);
+ strncat(buf, method_name, cnt - strlen(buf) - 1);
+ strncat(buf, method_signature, cnt - strlen(buf) - 1);
+ if (op_write_native_code(agent_hdl, buf, (uint64_t) code_addr,
+ code_addr, code_size))
+ perror("Error: op_write_native_code()");
+}
+
+void compiled_method_unload(JVMPI_Event * event)
+{
+ void * code_addr = event->u.compiled_method_load.code_addr;
+ if (debug) {
+ cerr << "unload: addr="
+ << (unsigned long long) (uintptr_t) code_addr
+ << endl;
+ }
+ if (op_unload_native_code(agent_hdl, (uint64_t)code_addr))
+ perror("Error: op_unload_native_code()");
+}
+
+void jvm_shutdown(JVMPI_Event * event)
+{
+ /* Checking event here is not really necessary; added only to silence
+ * the 'unused parameter' compiler warning.
+ */
+ if (event)
+ if (op_close_agent(agent_hdl))
+ perror("Error: op_close_agent()");
+}
+
+
+void jvm_notify_event(JVMPI_Event * event)
+{
+ switch (event->event_type) {
+ case JVMPI_EVENT_COMPILED_METHOD_LOAD:
+ compiled_method_load(event);
+ break;
+ case JVMPI_EVENT_COMPILED_METHOD_UNLOAD:
+ compiled_method_unload(event);
+ break;
+ case JVMPI_EVENT_JVM_SHUT_DOWN:
+ jvm_shutdown(event);
+ break;
+ case JVMPI_EVENT_CLASS_LOAD:
+ class_load(event);
+ break;
+ case JVMPI_EVENT_CLASS_UNLOAD:
+ class_unload(event);
+ break;
+ default:
+ break;
+ }
+}
+
+extern "C" {
+JNIEXPORT jint JNICALL JVM_OnLoad(JavaVM * jvm, char * options,
+ void * reserved)
+{
+ int err;
+
+ if (options && strstr(options, "version")) {
+ cerr << "jvmpi_oprofile: current libopagent version "
+ << op_major_version() << "." << op_minor_version()
+ << endl;
+ throw runtime_error("Exiting");
+ }
+
+ if (options && strstr(options, "debug=yes")) {
+ debug = true;
+ /* Add something braindead to silence the 'unused parameter'
+ * compiler warning.
+ */
+ if (reserved)
+ debug = true;
+ }
+
+ if (debug)
+ cerr << "jvmpi_oprofile: agent activated" << endl;
+
+ agent_hdl = op_open_agent();
+ if (!agent_hdl) {
+ perror("Error: op_open_agent()");
+ throw runtime_error("Exiting");
+ }
+
+ /* The union below is used to avoid the 'dereferencing type-punned
+ * pointer will break strict-aliasing rules' compiler warning on the
+ * GetEnv call.
+ */
+ union {
+ JVMPI_Interface * jvmpi_ifc;
+ void * jvmpi_ifc_ptr;
+ } jvmpi_GetEnv_arg;
+ err = jvm->GetEnv(&jvmpi_GetEnv_arg.jvmpi_ifc_ptr, JVMPI_VERSION_1);
+ if (err < 0) {
+ cerr << "GetEnv failed with rc=" << err << endl;
+ throw runtime_error("Exiting");
+ }
+ jvmpi = jvmpi_GetEnv_arg.jvmpi_ifc;
+ jvmpi->EnableEvent(JVMPI_EVENT_COMPILED_METHOD_LOAD, NULL);
+ jvmpi->EnableEvent(JVMPI_EVENT_COMPILED_METHOD_UNLOAD, NULL);
+ jvmpi->EnableEvent(JVMPI_EVENT_JVM_SHUT_DOWN, NULL);
+ jvmpi->EnableEvent(JVMPI_EVENT_CLASS_LOAD, NULL);
+
+ jvmpi->NotifyEvent = jvm_notify_event;
+ return JNI_OK;
+}
+}
diff --git a/agents/jvmti/Makefile.am b/agents/jvmti/Makefile.am
new file mode 100644
index 0000000..a9a90a4
--- /dev/null
+++ b/agents/jvmti/Makefile.am
@@ -0,0 +1,14 @@
+AM_CFLAGS = @OP_CFLAGS@
+
+pkglib_LTLIBRARIES = libjvmti_oprofile.la
+
+libjvmti_oprofile_la_CFLAGS = $(AM_CFLAGS) -fPIC
+
+libjvmti_oprofile_la_LIBADD = ../../libopagent/libopagent.la
+
+libjvmti_oprofile_la_SOURCES = libjvmti_oprofile.c
+
+AM_CPPFLAGS = \
+ -I ${top_srcdir}/libopagent \
+ -I @JAVA_HOMEDIR@/include \
+ -I @JAVA_HOMEDIR@/include/linux
diff --git a/agents/jvmti/Makefile.in b/agents/jvmti/Makefile.in
new file mode 100644
index 0000000..991d4e6
--- /dev/null
+++ b/agents/jvmti/Makefile.in
@@ -0,0 +1,522 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = agents/jvmti
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/binutils.m4 \
+ $(top_srcdir)/m4/builtinexpect.m4 \
+ $(top_srcdir)/m4/cellspubfdsupport.m4 \
+ $(top_srcdir)/m4/compileroption.m4 \
+ $(top_srcdir)/m4/configmodule.m4 \
+ $(top_srcdir)/m4/copyifchange.m4 $(top_srcdir)/m4/docbook.m4 \
+ $(top_srcdir)/m4/extradirs.m4 $(top_srcdir)/m4/findkernel.m4 \
+ $(top_srcdir)/m4/kerneloption.m4 \
+ $(top_srcdir)/m4/kernelversion.m4 \
+ $(top_srcdir)/m4/mallocattribute.m4 \
+ $(top_srcdir)/m4/poptconst.m4 \
+ $(top_srcdir)/m4/precompiledheader.m4 $(top_srcdir)/m4/qt.m4 \
+ $(top_srcdir)/m4/resultyn.m4 $(top_srcdir)/m4/sstream.m4 \
+ $(top_srcdir)/m4/typedef.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(pkglibdir)"
+pkglibLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+libjvmti_oprofile_la_DEPENDENCIES = ../../libopagent/libopagent.la
+am_libjvmti_oprofile_la_OBJECTS = \
+ libjvmti_oprofile_la-libjvmti_oprofile.lo
+libjvmti_oprofile_la_OBJECTS = $(am_libjvmti_oprofile_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libjvmti_oprofile_la_SOURCES)
+DIST_SOURCES = $(libjvmti_oprofile_la_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFD_LIBS = @BFD_LIBS@
+BUILD_JVMPI_AGENT_FALSE = @BUILD_JVMPI_AGENT_FALSE@
+BUILD_JVMPI_AGENT_TRUE = @BUILD_JVMPI_AGENT_TRUE@
+BUILD_JVMTI_AGENT_FALSE = @BUILD_JVMTI_AGENT_FALSE@
+BUILD_JVMTI_AGENT_TRUE = @BUILD_JVMTI_AGENT_TRUE@
+CAT_ENTRY_END = @CAT_ENTRY_END@
+CAT_ENTRY_START = @CAT_ENTRY_START@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOCBOOK_ROOT = @DOCBOOK_ROOT@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+EXTRA_CFLAGS_MODULE = @EXTRA_CFLAGS_MODULE@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAVA_HOMEDIR = @JAVA_HOMEDIR@
+KINC = @KINC@
+KSRC = @KSRC@
+KVERS = @KVERS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBERTY_LIBS = @LIBERTY_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MOC = @MOC@
+MODINSTALLDIR = @MODINSTALLDIR@
+OBJEXT = @OBJEXT@
+OPROFILE_DIR = @OPROFILE_DIR@
+OPROFILE_MODULE_ARCH = @OPROFILE_MODULE_ARCH@
+OP_CFLAGS = @OP_CFLAGS@
+OP_CXXFLAGS = @OP_CXXFLAGS@
+OP_DOCDIR = @OP_DOCDIR@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POPT_LIBS = @POPT_LIBS@
+PTRDIFF_T_TYPE = @PTRDIFF_T_TYPE@
+QT_INCLUDES = @QT_INCLUDES@
+QT_LDFLAGS = @QT_LDFLAGS@
+QT_LIB = @QT_LIB@
+QT_VERSION = @QT_VERSION@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIZE_T_TYPE = @SIZE_T_TYPE@
+STRIP = @STRIP@
+UIC = @UIC@
+VERSION = @VERSION@
+XML_CATALOG = @XML_CATALOG@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+have_qt_FALSE = @have_qt_FALSE@
+have_qt_TRUE = @have_qt_TRUE@
+have_xsltproc_FALSE = @have_xsltproc_FALSE@
+have_xsltproc_TRUE = @have_xsltproc_TRUE@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+kernel_support_FALSE = @kernel_support_FALSE@
+kernel_support_TRUE = @kernel_support_TRUE@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+topdir = @topdir@
+AM_CFLAGS = @OP_CFLAGS@
+pkglib_LTLIBRARIES = libjvmti_oprofile.la
+libjvmti_oprofile_la_CFLAGS = $(AM_CFLAGS) -fPIC
+libjvmti_oprofile_la_LIBADD = ../../libopagent/libopagent.la
+libjvmti_oprofile_la_SOURCES = libjvmti_oprofile.c
+AM_CPPFLAGS = \
+ -I ${top_srcdir}/libopagent \
+ -I @JAVA_HOMEDIR@/include \
+ -I @JAVA_HOMEDIR@/include/linux
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign agents/jvmti/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign agents/jvmti/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ test -z "$(pkglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkglibdir)"
+ @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+ if test -f $$p; then \
+ f=$(am__strip_dir) \
+ echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \
+ $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \
+ else :; fi; \
+ done
+
+uninstall-pkglibLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @set -x; list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+ p=$(am__strip_dir) \
+ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \
+ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \
+ done
+
+clean-pkglibLTLIBRARIES:
+ -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+ @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libjvmti_oprofile.la: $(libjvmti_oprofile_la_OBJECTS) $(libjvmti_oprofile_la_DEPENDENCIES)
+ $(LINK) -rpath $(pkglibdir) $(libjvmti_oprofile_la_LDFLAGS) $(libjvmti_oprofile_la_OBJECTS) $(libjvmti_oprofile_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libjvmti_oprofile_la-libjvmti_oprofile.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+libjvmti_oprofile_la-libjvmti_oprofile.lo: libjvmti_oprofile.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjvmti_oprofile_la_CFLAGS) $(CFLAGS) -MT libjvmti_oprofile_la-libjvmti_oprofile.lo -MD -MP -MF "$(DEPDIR)/libjvmti_oprofile_la-libjvmti_oprofile.Tpo" -c -o libjvmti_oprofile_la-libjvmti_oprofile.lo `test -f 'libjvmti_oprofile.c' || echo '$(srcdir)/'`libjvmti_oprofile.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libjvmti_oprofile_la-libjvmti_oprofile.Tpo" "$(DEPDIR)/libjvmti_oprofile_la-libjvmti_oprofile.Plo"; else rm -f "$(DEPDIR)/libjvmti_oprofile_la-libjvmti_oprofile.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='libjvmti_oprofile.c' object='libjvmti_oprofile_la-libjvmti_oprofile.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libjvmti_oprofile_la_CFLAGS) $(CFLAGS) -c -o libjvmti_oprofile_la-libjvmti_oprofile.lo `test -f 'libjvmti_oprofile.c' || echo '$(srcdir)/'`libjvmti_oprofile.c
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+ for dir in "$(DESTDIR)$(pkglibdir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-pkglibLTLIBRARIES
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-exec \
+ install-exec-am install-info install-info-am install-man \
+ install-pkglibLTLIBRARIES install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-info-am \
+ uninstall-pkglibLTLIBRARIES
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/agents/jvmti/libjvmti_oprofile.c b/agents/jvmti/libjvmti_oprofile.c
new file mode 100644
index 0000000..7157d44
--- /dev/null
+++ b/agents/jvmti/libjvmti_oprofile.c
@@ -0,0 +1,326 @@
+/**
+ * @file jvmti_oprofile.c
+ * JVMTI agent implementation to report jitted JVM code to Oprofile
+ *
+ * @remark Copyright 2007 OProfile authors
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @author Jens Wilke
+ * @Modifications Daniel Hansel
+ *
+ * Copyright IBM Corporation 2007
+ *
+ */
+
+#include <stdio.h>
+#include <jvmti.h>
+#include <string.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <errno.h>
+
+#include "opagent.h"
+
+static int debug = 0;
+static int can_get_line_numbers = 0;
+static op_agent_t agent_hdl;
+
+/**
+ * Handle an error or a warning, return 0 if the checked error is
+ * JVMTI_ERROR_NONE, i.e. success
+ */
+static int handle_error(jvmtiError err, char const * msg, int severe)
+{
+ if (err != JVMTI_ERROR_NONE) {
+ fprintf(stderr, "%s: %s, err code %i\n",
+ severe ? "Error" : "Warning", msg, err);
+ }
+ return err != JVMTI_ERROR_NONE;
+}
+
+
+/**
+ * returned array is map_length length, params map and map_length != 0
+ * format of lineno information is JVMTI_JLOCATION_JVMBCI, map is an array
+ * of { address, code byte index }, table_ptr an array of { byte code index,
+ * lineno }
+ */
+static struct debug_line_info *
+create_debug_line_info(jint map_length, jvmtiAddrLocationMap const * map,
+ jint entry_count, jvmtiLineNumberEntry* table_ptr,
+ char const * source_filename)
+{
+ struct debug_line_info * debug_line;
+ int i, j;
+ if (debug) {
+ fprintf(stderr, "Source %s\n", source_filename);
+ for (i = 0; i < map_length; ++i) {
+ fprintf(stderr, "%p %lld\t",
+ map[i].start_address,
+ (long long)map[i].location);
+ }
+ fprintf(stderr, "\n");
+ for (i = 0; i < entry_count; ++i) {
+ fprintf(stderr, "%lld %d\t",
+ (long long)table_ptr[i].start_location,
+ table_ptr[i].line_number);
+ }
+ fprintf(stderr, "\n");
+ }
+
+ debug_line = calloc(map_length, sizeof(struct debug_line_info));
+ if (!debug_line)
+ return 0;
+
+ for (i = 0; i < map_length; ++i) {
+ /* FIXME: likely to need a lower_bound on the array, but
+ * documentation is a bit obscure about the contents of these
+ * arrray
+ **/
+ for (j = 0; j < entry_count - 1; ++j) {
+ if (table_ptr[j].start_location > map[i].location)
+ break;
+ }
+ debug_line[i].vma = (unsigned long)map[i].start_address;
+ debug_line[i].lineno = table_ptr[j].line_number;
+ debug_line[i].filename = source_filename;
+ }
+
+ if (debug) {
+ for (i = 0; i < map_length; ++i) {
+ fprintf(stderr, "%lx %d\t", debug_line[i].vma,
+ debug_line[i].lineno);
+ }
+ fprintf(stderr, "\n");
+ }
+
+ return debug_line;
+}
+
+
+static void JNICALL cb_compiled_method_load(jvmtiEnv * jvmti,
+ jmethodID method, jint code_size, void const * code_addr,
+ jint map_length, jvmtiAddrLocationMap const * map,
+ void const * compile_info)
+{
+ jclass declaring_class;
+ char * class_signature = NULL;
+ char * method_name = NULL;
+ char * method_signature = NULL;
+ jvmtiLineNumberEntry* table_ptr = NULL;
+ char * source_filename = NULL;
+ struct debug_line_info * debug_line = NULL;
+ jvmtiError err;
+
+ /* shut up compiler warning */
+ compile_info = compile_info;
+
+ err = (*jvmti)->GetMethodDeclaringClass(jvmti, method,
+ &declaring_class);
+ if (handle_error(err, "GetMethodDeclaringClass()", 1))
+ goto cleanup2;
+
+ if (can_get_line_numbers && map_length && map) {
+ jint entry_count;
+
+ err = (*jvmti)->GetLineNumberTable(jvmti, method,
+ &entry_count, &table_ptr);
+ if (err == JVMTI_ERROR_NONE) {
+ err = (*jvmti)->GetSourceFileName(jvmti,
+ declaring_class, &source_filename);
+ if (err == JVMTI_ERROR_NONE) {
+ debug_line =
+ create_debug_line_info(map_length, map,
+ entry_count, table_ptr,
+ source_filename);
+ } else if (err != JVMTI_ERROR_ABSENT_INFORMATION) {
+ handle_error(err, "GetSourceFileName()", 1);
+ }
+ } else if (err != JVMTI_ERROR_NATIVE_METHOD &&
+ err != JVMTI_ERROR_ABSENT_INFORMATION) {
+ handle_error(err, "GetLineNumberTable()", 1);
+ }
+ }
+
+ err = (*jvmti)->GetClassSignature(jvmti, declaring_class,
+ &class_signature, NULL);
+ if (handle_error(err, "GetClassSignature()", 1))
+ goto cleanup1;
+
+ err = (*jvmti)->GetMethodName(jvmti, method, &method_name,
+ &method_signature, NULL);
+ if (handle_error(err, "GetMethodName()", 1))
+ goto cleanup;
+
+ if (debug) {
+ fprintf(stderr, "load: declaring_class=%p, class=%s, "
+ "method=%s, signature=%s, addr=%p, size=%i \n",
+ declaring_class, class_signature, method_name,
+ method_signature, code_addr, code_size);
+ }
+
+ {
+ int cnt = strlen(method_name) + strlen(class_signature) +
+ strlen(method_signature) + 2;
+ char buf[cnt];
+ strncpy(buf, class_signature, cnt - 1);
+ strncat(buf, method_name, cnt - strlen(buf) - 1);
+ strncat(buf, method_signature, cnt - strlen(buf) - 1);
+ if (op_write_native_code(agent_hdl, buf,
+ (uint64_t)(uintptr_t) code_addr,
+ code_addr, code_size)) {
+ perror("Error: op_write_native_code()");
+ goto cleanup;
+ }
+ }
+
+ if (debug_line)
+ if (op_write_debug_line_info(agent_hdl, code_addr, map_length,
+ debug_line))
+ perror("Error: op_write_debug_line_info()");
+
+cleanup:
+ (*jvmti)->Deallocate(jvmti, (unsigned char *)method_name);
+ (*jvmti)->Deallocate(jvmti, (unsigned char *)method_signature);
+cleanup1:
+ (*jvmti)->Deallocate(jvmti, (unsigned char *)class_signature);
+ (*jvmti)->Deallocate(jvmti, (unsigned char *)table_ptr);
+ (*jvmti)->Deallocate(jvmti, (unsigned char *)source_filename);
+cleanup2:
+ free(debug_line);
+}
+
+
+static void JNICALL cb_compiled_method_unload(jvmtiEnv * jvmti_env,
+ jmethodID method, void const * code_addr)
+{
+ /* shut up compiler warning */
+ jvmti_env = jvmti_env;
+ method = method;
+
+ if (debug)
+ fprintf(stderr, "unload: addr=%p\n", code_addr);
+ if (op_unload_native_code(agent_hdl, (uint64_t)(uintptr_t) code_addr))
+ perror("Error: op_unload_native_code()");
+}
+
+
+static void JNICALL cb_dynamic_code_generated(jvmtiEnv * jvmti_env,
+ char const * name, void const * code_addr, jint code_size)
+{
+ /* shut up compiler warning */
+ jvmti_env = jvmti_env;
+ if (debug) {
+ fprintf(stderr, "dyncode: name=%s, addr=%p, size=%i \n",
+ name, code_addr, code_size);
+ }
+ if (op_write_native_code(agent_hdl, name,
+ (uint64_t)(uintptr_t) code_addr,
+ code_addr, code_size))
+ perror("Error: op_write_native_code()");
+}
+
+
+JNIEXPORT jint JNICALL
+Agent_OnLoad(JavaVM * jvm, char * options, void * reserved)
+{
+ jint rc;
+ jvmtiEnv * jvmti = NULL;
+ jvmtiEventCallbacks callbacks;
+ jvmtiCapabilities caps;
+ jvmtiJlocationFormat format;
+ jvmtiError error;
+
+ /* shut up compiler warning */
+ reserved = reserved;
+
+ if (options && !strcmp("version", options)) {
+ fprintf(stderr, "jvmti_oprofile: current libopagent version %i.%i.\n",
+ op_major_version(), op_minor_version());
+ return -1;
+ }
+
+ if (options && !strcmp("debug", options))
+ debug = 1;
+
+ if (debug)
+ fprintf(stderr, "jvmti_oprofile: agent activated\n");
+
+ agent_hdl = op_open_agent();
+ if (!agent_hdl) {
+ perror("Error: op_open_agent()");
+ return -1;
+ }
+
+ rc = (*jvm)->GetEnv(jvm, (void *)&jvmti, JVMTI_VERSION_1);
+ if (rc != JNI_OK) {
+ fprintf(stderr, "Error: GetEnv(), rc=%i\n", rc);
+ return -1;
+ }
+
+ memset(&caps, '\0', sizeof(caps));
+ caps.can_generate_compiled_method_load_events = 1;
+ error = (*jvmti)->AddCapabilities(jvmti, &caps);
+ if (handle_error(error, "AddCapabilities()", 1))
+ return -1;
+
+ /* FIXME: settable through command line, default on/off? */
+ error = (*jvmti)->GetJLocationFormat(jvmti, &format);
+ if (!handle_error(error, "GetJLocationFormat", 1) &&
+ format == JVMTI_JLOCATION_JVMBCI) {
+ memset(&caps, '\0', sizeof(caps));
+ caps.can_get_line_numbers = 1;
+ caps.can_get_source_file_name = 1;
+ error = (*jvmti)->AddCapabilities(jvmti, &caps);
+ if (!handle_error(error, "AddCapabilities()", 1))
+ can_get_line_numbers = 1;
+ }
+
+ memset(&callbacks, 0, sizeof(callbacks));
+ callbacks.CompiledMethodLoad = cb_compiled_method_load;
+ callbacks.CompiledMethodUnload = cb_compiled_method_unload;
+ callbacks.DynamicCodeGenerated = cb_dynamic_code_generated;
+ error = (*jvmti)->SetEventCallbacks(jvmti, &callbacks,
+ sizeof(callbacks));
+ if (handle_error(error, "SetEventCallbacks()", 1))
+ return -1;
+
+ error = (*jvmti)->SetEventNotificationMode(jvmti, JVMTI_ENABLE,
+ JVMTI_EVENT_COMPILED_METHOD_LOAD, NULL);
+ if (handle_error(error, "SetEventNotificationMode() "
+ "JVMTI_EVENT_COMPILED_METHOD_LOAD", 1))
+ return -1;
+ error = (*jvmti)->SetEventNotificationMode(jvmti, JVMTI_ENABLE,
+ JVMTI_EVENT_COMPILED_METHOD_UNLOAD, NULL);
+ if (handle_error(error, "SetEventNotificationMode() "
+ "JVMTI_EVENT_COMPILED_METHOD_UNLOAD", 1))
+ return -1;
+ error = (*jvmti)->SetEventNotificationMode(jvmti, JVMTI_ENABLE,
+ JVMTI_EVENT_DYNAMIC_CODE_GENERATED, NULL);
+ if (handle_error(error, "SetEventNotificationMode() "
+ "JVMTI_EVENT_DYNAMIC_CODE_GENERATED", 1))
+ return -1;
+ return 0;
+}
+
+
+JNIEXPORT void JNICALL Agent_OnUnload(JavaVM * jvm)
+{
+ /* shut up compiler warning */
+ jvm = jvm;
+ if (op_close_agent(agent_hdl))
+ perror("Error: op_close_agent()");
+}
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 0000000..708afa3
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+# run to generate needed files not in CVS
+
+# NB: if you run this file with AUTOMAKE, AUTOCONF, etc. environment
+# variables set, you *must* run "configure" with the same variables
+# set. this is because "configure" will embed the values of these variables
+# into the generated Makefiles, as @AUTOMAKE@, @AUTOCONF@ etc. and it will
+# trigger regeneration of configuration state using those programs when any
+# of Makefile.am etc. change.
+
+run() {
+ echo "Running $1 ..."
+ $1
+}
+
+set -e
+
+ACLOCAL=${ACLOCAL:-aclocal}
+AUTOHEADER=${AUTOHEADER:-autoheader}
+AUTOMAKE=${AUTOMAKE:-automake}
+AUTOCONF=${AUTOCONF:-autoconf}
+
+if $AUTOMAKE --version | grep -q 1.4
+ then
+ echo ""
+ echo "Automake 1.4 not supported. please set \$AUTOMAKE"
+ echo "to point to a newer automake, or upgrade."
+ echo ""
+ exit 1
+fi
+
+if test -n "$1"; then
+ echo "autogen.sh doesn't take any options" >&2
+ exit 1
+fi
+
+libtoolize --automake -c
+run "$ACLOCAL -I m4"
+run $AUTOHEADER
+run "$AUTOMAKE --foreign --add-missing --copy"
+run $AUTOCONF
diff --git a/compile b/compile
new file mode 100755
index 0000000..1b1d232
--- /dev/null
+++ b/compile
@@ -0,0 +1,142 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand `-c -o'.
+
+scriptversion=2005-05-14.22
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
+# Written by Tom Tromey <tromey@cygnus.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake@gnu.org> or send patches to
+# <automake-patches@gnu.org>.
+
+case $1 in
+ '')
+ echo "$0: No command. Try \`$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand `-c -o'.
+Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file `INSTALL'.
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "compile $scriptversion"
+ exit $?
+ ;;
+esac
+
+ofile=
+cfile=
+eat=
+
+for arg
+do
+ if test -n "$eat"; then
+ eat=
+ else
+ case $1 in
+ -o)
+ # configure might choose to run compile as `compile cc -o foo foo.c'.
+ # So we strip `-o arg' only if arg is an object.
+ eat=1
+ case $2 in
+ *.o | *.obj)
+ ofile=$2
+ ;;
+ *)
+ set x "$@" -o "$2"
+ shift
+ ;;
+ esac
+ ;;
+ *.c)
+ cfile=$1
+ set x "$@" "$1"
+ shift
+ ;;
+ *)
+ set x "$@" "$1"
+ shift
+ ;;
+ esac
+ fi
+ shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+ # If no `-o' option was seen then we might have been invoked from a
+ # pattern rule where we don't need one. That is ok -- this is a
+ # normal compilation that the losing compiler can handle. If no
+ # `.c' file was seen then we are probably linking. That is also
+ # ok.
+ exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use `[/.-]' here to ensure that we don't use the same name
+# that we are using for the .o file. Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d
+while true; do
+ if mkdir "$lockdir" >/dev/null 2>&1; then
+ break
+ fi
+ sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+ mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+ mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/config.guess b/config.guess
new file mode 100755
index 0000000..f32079a
--- /dev/null
+++ b/config.guess
@@ -0,0 +1,1526 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+# Free Software Foundation, Inc.
+
+timestamp='2008-01-23'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Originally written by Per Bothner <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>. Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub. If it succeeds, it prints the system name on stdout, and
+# exits with 0. Otherwise, it exits with 1.
+#
+# The plan is that this can be called by configure scripts if you
+# don't specify an explicit build system type.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help" >&2
+ exit 1 ;;
+ * )
+ break ;;
+ esac
+done
+
+if test $# != 0; then
+ echo "$me: too many arguments$help" >&2
+ exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,) echo "int x;" > $dummy.c ;
+ for c in cc gcc c89 c99 ; do
+ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+ CC_FOR_BUILD="$c"; break ;
+ fi ;
+ done ;
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found ;
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+esac ; set_cc_for_build= ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ *:NetBSD:*:*)
+ # NetBSD (nbsd) targets should (where applicable) match one or
+ # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+ # compatibility and a consistent mechanism for selecting the
+ # object file format.
+ #
+ # Note: NetBSD doesn't particularly care about the vendor
+ # portion of the name. We always set it to "unknown".
+ sysctl="sysctl -n hw.machine_arch"
+ UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+ /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+ case "${UNAME_MACHINE_ARCH}" in
+ armeb) machine=armeb-unknown ;;
+ arm*) machine=arm-unknown ;;
+ sh3el) machine=shl-unknown ;;
+ sh3eb) machine=sh-unknown ;;
+ sh5el) machine=sh5le-unknown ;;
+ *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ esac
+ # The Operating System including object format, if it has switched
+ # to ELF recently, or will in the future.
+ case "${UNAME_MACHINE_ARCH}" in
+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+ eval $set_cc_for_build
+ if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep __ELF__ >/dev/null
+ then
+ # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+ # Return netbsd for either. FIX?
+ os=netbsd
+ else
+ os=netbsdelf
+ fi
+ ;;
+ *)
+ os=netbsd
+ ;;
+ esac
+ # The OS release
+ # Debian GNU/NetBSD machines have a different userland, and
+ # thus, need a distinct triplet. However, they do not need
+ # kernel version information, so it can be replaced with a
+ # suitable tag, in the style of linux-gnu.
+ case "${UNAME_VERSION}" in
+ Debian*)
+ release='-gnu'
+ ;;
+ *)
+ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ ;;
+ esac
+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+ # contains redundant information, the shorter form:
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "${machine}-${os}${release}"
+ exit ;;
+ *:OpenBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+ exit ;;
+ *:ekkoBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+ exit ;;
+ *:SolidBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+ exit ;;
+ macppc:MirBSD:*:*)
+ echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ *:MirBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ alpha:OSF1:*:*)
+ case $UNAME_RELEASE in
+ *4.0)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ ;;
+ *5.*)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ ;;
+ esac
+ # According to Compaq, /usr/sbin/psrinfo has been available on
+ # OSF/1 and Tru64 systems produced since 1995. I hope that
+ # covers most systems running today. This code pipes the CPU
+ # types through head -n 1, so we only detect the type of CPU 0.
+ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+ case "$ALPHA_CPU_TYPE" in
+ "EV4 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "EV4.5 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "LCA4 (21066/21068)")
+ UNAME_MACHINE="alpha" ;;
+ "EV5 (21164)")
+ UNAME_MACHINE="alphaev5" ;;
+ "EV5.6 (21164A)")
+ UNAME_MACHINE="alphaev56" ;;
+ "EV5.6 (21164PC)")
+ UNAME_MACHINE="alphapca56" ;;
+ "EV5.7 (21164PC)")
+ UNAME_MACHINE="alphapca57" ;;
+ "EV6 (21264)")
+ UNAME_MACHINE="alphaev6" ;;
+ "EV6.7 (21264A)")
+ UNAME_MACHINE="alphaev67" ;;
+ "EV6.8CB (21264C)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8AL (21264B)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8CX (21264D)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.9A (21264/EV69A)")
+ UNAME_MACHINE="alphaev69" ;;
+ "EV7 (21364)")
+ UNAME_MACHINE="alphaev7" ;;
+ "EV7.9 (21364A)")
+ UNAME_MACHINE="alphaev79" ;;
+ esac
+ # A Pn.n version is a patched version.
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ exit ;;
+ Alpha\ *:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # Should we change UNAME_MACHINE based on the output of uname instead
+ # of the specific Alpha model?
+ echo alpha-pc-interix
+ exit ;;
+ 21064:Windows_NT:50:3)
+ echo alpha-dec-winnt3.5
+ exit ;;
+ Amiga*:UNIX_System_V:4.0:*)
+ echo m68k-unknown-sysv4
+ exit ;;
+ *:[Aa]miga[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-amigaos
+ exit ;;
+ *:[Mm]orph[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-morphos
+ exit ;;
+ *:OS/390:*:*)
+ echo i370-ibm-openedition
+ exit ;;
+ *:z/VM:*:*)
+ echo s390-ibm-zvmoe
+ exit ;;
+ *:OS400:*:*)
+ echo powerpc-ibm-os400
+ exit ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+ exit ;;
+ arm:riscos:*:*|arm:RISCOS:*:*)
+ echo arm-unknown-riscos
+ exit ;;
+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+ echo hppa1.1-hitachi-hiuxmpp
+ exit ;;
+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+ # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
+ echo pyramid-pyramid-sysv3
+ else
+ echo pyramid-pyramid-bsd
+ fi
+ exit ;;
+ NILE*:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit ;;
+ DRS?6000:unix:4.0:6*)
+ echo sparc-icl-nx6
+ exit ;;
+ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+ case `/usr/bin/uname -p` in
+ sparc) echo sparc-icl-nx7; exit ;;
+ esac ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+ echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:6*:*)
+ # According to config.sub, this is the proper way to canonicalize
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
+ # it's likely to be more like Solaris than SunOS4.
+ echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ sun4*:SunOS:*:*)
+ case "`/usr/bin/arch -k`" in
+ Series*|S4*)
+ UNAME_RELEASE=`uname -v`
+ ;;
+ esac
+ # Japanese Language versions have a version number like `4.1.3-JL'.
+ echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ exit ;;
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ exit ;;
+ sun*:*:4.2BSD:*)
+ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ ;;
+ sun4)
+ echo sparc-sun-sunos${UNAME_RELEASE}
+ ;;
+ esac
+ exit ;;
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos${UNAME_RELEASE}
+ exit ;;
+ # The situation for MiNT is a little confusing. The machine name
+ # can be virtually everything (everything which is not
+ # "atarist" or "atariste" at least should have a processor
+ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
+ # to the lowercase version "mint" (or "freemint"). Finally
+ # the system name "TOS" denotes a system which is actually not
+ # MiNT. But MiNT is downward compatible to TOS, so this should
+ # be no problem.
+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit ;;
+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit ;;
+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit ;;
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit ;;
+ m68k:machten:*:*)
+ echo m68k-apple-machten${UNAME_RELEASE}
+ exit ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten${UNAME_RELEASE}
+ exit ;;
+ RISC*:Mach:*:*)
+ echo mips-dec-mach_bsd4.3
+ exit ;;
+ RISC*:ULTRIX:*:*)
+ echo mips-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix${UNAME_RELEASE}
+ exit ;;
+ 2020:CLIX:*:* | 2430:CLIX:*:*)
+ echo clipper-intergraph-clix${UNAME_RELEASE}
+ exit ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h> /* for printf() prototype */
+ int main (int argc, char *argv[]) {
+#else
+ int main (argc, argv) int argc; char *argv[]; {
+#endif
+ #if defined (host_mips) && defined (MIPSEB)
+ #if defined (SYSTYPE_SYSV)
+ printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_SVR4)
+ printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+ printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+ #endif
+ #endif
+ exit (-1);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c &&
+ dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+ SYSTEM_NAME=`$dummy $dummyarg` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo mips-mips-riscos${UNAME_RELEASE}
+ exit ;;
+ Motorola:PowerMAX_OS:*:*)
+ echo powerpc-motorola-powermax
+ exit ;;
+ Motorola:*:4.3:PL8-*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+ echo powerpc-harris-powermax
+ exit ;;
+ Night_Hawk:Power_UNIX:*:*)
+ echo powerpc-harris-powerunix
+ exit ;;
+ m88k:CX/UX:7*:*)
+ echo m88k-harris-cxux7
+ exit ;;
+ m88k:*:4*:R4*)
+ echo m88k-motorola-sysv4
+ exit ;;
+ m88k:*:3*:R3*)
+ echo m88k-motorola-sysv3
+ exit ;;
+ AViiON:dgux:*:*)
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ then
+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+ [ ${TARGET_BINARY_INTERFACE}x = x ]
+ then
+ echo m88k-dg-dgux${UNAME_RELEASE}
+ else
+ echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ fi
+ else
+ echo i586-dg-dgux${UNAME_RELEASE}
+ fi
+ exit ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+ exit ;;
+ M88*:*:R3*:*)
+ # Delta 88k system running SVR3
+ echo m88k-motorola-sysv3
+ exit ;;
+ XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+ echo m88k-tektronix-sysv3
+ exit ;;
+ Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+ echo m68k-tektronix-bsd
+ exit ;;
+ *:IRIX*:*:*)
+ echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+ exit ;;
+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ i*86:AIX:*:*)
+ echo i386-ibm-aix
+ exit ;;
+ ia64:AIX:*:*)
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+ exit ;;
+ *:AIX:2:3)
+ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <sys/systemcfg.h>
+
+ main()
+ {
+ if (!__power_pc())
+ exit(1);
+ puts("powerpc-ibm-aix3.2.5");
+ exit(0);
+ }
+EOF
+ if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+ then
+ echo "$SYSTEM_NAME"
+ else
+ echo rs6000-ibm-aix3.2.5
+ fi
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+ else
+ echo rs6000-ibm-aix3.2
+ fi
+ exit ;;
+ *:AIX:*:[456])
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+ IBM_ARCH=powerpc
+ fi
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ exit ;;
+ *:AIX:*:*)
+ echo rs6000-ibm-aix
+ exit ;;
+ ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ echo romp-ibm-bsd4.4
+ exit ;;
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
+ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ exit ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+ echo rs6000-bull-bosx
+ exit ;;
+ DPX/2?00:B.O.S.:*:*)
+ echo m68k-bull-sysv3
+ exit ;;
+ 9000/[34]??:4.3bsd:1.*:*)
+ echo m68k-hp-bsd
+ exit ;;
+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+ echo m68k-hp-bsd4.4
+ exit ;;
+ 9000/[34678]??:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ case "${UNAME_MACHINE}" in
+ 9000/31? ) HP_ARCH=m68000 ;;
+ 9000/[34]?? ) HP_ARCH=m68k ;;
+ 9000/[678][0-9][0-9])
+ if [ -x /usr/bin/getconf ]; then
+ sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+ sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+ case "${sc_cpu_version}" in
+ 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ 532) # CPU_PA_RISC2_0
+ case "${sc_kernel_bits}" in
+ 32) HP_ARCH="hppa2.0n" ;;
+ 64) HP_ARCH="hppa2.0w" ;;
+ '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+ esac ;;
+ esac
+ fi
+ if [ "${HP_ARCH}" = "" ]; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+
+ #define _HPUX_SOURCE
+ #include <stdlib.h>
+ #include <unistd.h>
+
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
+
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
+EOF
+ (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ test -z "$HP_ARCH" && HP_ARCH=hppa
+ fi ;;
+ esac
+ if [ ${HP_ARCH} = "hppa2.0w" ]
+ then
+ eval $set_cc_for_build
+
+ # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+ # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
+ # generating 64-bit code. GNU and HP use different nomenclature:
+ #
+ # $ CC_FOR_BUILD=cc ./config.guess
+ # => hppa2.0w-hp-hpux11.23
+ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+ # => hppa64-hp-hpux11.23
+
+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+ grep __LP64__ >/dev/null
+ then
+ HP_ARCH="hppa2.0w"
+ else
+ HP_ARCH="hppa64"
+ fi
+ fi
+ echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ exit ;;
+ ia64:HP-UX:*:*)
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ echo ia64-hp-hpux${HPUX_REV}
+ exit ;;
+ 3050*:HI-UX:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <unistd.h>
+ int
+ main ()
+ {
+ long cpu = sysconf (_SC_CPU_VERSION);
+ /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+ true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
+ results, however. */
+ if (CPU_IS_PA_RISC (cpu))
+ {
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+ default: puts ("hppa-hitachi-hiuxwe2"); break;
+ }
+ }
+ else if (CPU_IS_HP_MC68K (cpu))
+ puts ("m68k-hitachi-hiuxwe2");
+ else puts ("unknown-hitachi-hiuxwe2");
+ exit (0);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
+ echo unknown-hitachi-hiuxwe2
+ exit ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+ echo hppa1.1-hp-bsd
+ exit ;;
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+ exit ;;
+ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+ echo hppa1.0-hp-mpeix
+ exit ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+ echo hppa1.1-hp-osf
+ exit ;;
+ hp8??:OSF1:*:*)
+ echo hppa1.0-hp-osf
+ exit ;;
+ i*86:OSF1:*:*)
+ if [ -x /usr/sbin/sysversion ] ; then
+ echo ${UNAME_MACHINE}-unknown-osf1mk
+ else
+ echo ${UNAME_MACHINE}-unknown-osf1
+ fi
+ exit ;;
+ parisc*:Lites*:*:*)
+ echo hppa1.1-hp-lites
+ exit ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+ exit ;;
+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+ echo c34-convex-bsd
+ exit ;;
+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+ echo c38-convex-bsd
+ exit ;;
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+ exit ;;
+ CRAY*Y-MP:*:*:*)
+ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*[A-Z]90:*:*:*)
+ echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+ -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*TS:*:*:*)
+ echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*T3E:*:*:*)
+ echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ CRAY*SV1:*:*:*)
+ echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ *:UNICOS/mp:*:*)
+ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
+ F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+ FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+ echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ 5000:UNIX_System_V:4.*:*)
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ exit ;;
+ sparc*:BSD/OS:*:*)
+ echo sparc-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:BSD/OS:*:*)
+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ exit ;;
+ *:FreeBSD:*:*)
+ case ${UNAME_MACHINE} in
+ pc98)
+ echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ amd64)
+ echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ *)
+ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ esac
+ exit ;;
+ i*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin
+ exit ;;
+ *:MINGW*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
+ exit ;;
+ i*:windows32*:*)
+ # uname -m includes "-pc" on this system.
+ echo ${UNAME_MACHINE}-mingw32
+ exit ;;
+ i*:PW*:*)
+ echo ${UNAME_MACHINE}-pc-pw32
+ exit ;;
+ *:Interix*:[3456]*)
+ case ${UNAME_MACHINE} in
+ x86)
+ echo i586-pc-interix${UNAME_RELEASE}
+ exit ;;
+ EM64T | authenticamd)
+ echo x86_64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ IA64)
+ echo ia64-unknown-interix${UNAME_RELEASE}
+ exit ;;
+ esac ;;
+ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+ echo i${UNAME_MACHINE}-pc-mks
+ exit ;;
+ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+ # UNAME_MACHINE based on the output of uname instead of i386?
+ echo i586-pc-interix
+ exit ;;
+ i*:UWIN*:*)
+ echo ${UNAME_MACHINE}-pc-uwin
+ exit ;;
+ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+ echo x86_64-unknown-cygwin
+ exit ;;
+ p*:CYGWIN*:*)
+ echo powerpcle-unknown-cygwin
+ exit ;;
+ prep*:SunOS:5.*:*)
+ echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit ;;
+ *:GNU:*:*)
+ # the GNU system
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ exit ;;
+ *:GNU/*:*:*)
+ # other systems with GNU libc and userland
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+ exit ;;
+ i*86:Minix:*:*)
+ echo ${UNAME_MACHINE}-pc-minix
+ exit ;;
+ arm*:Linux:*:*)
+ eval $set_cc_for_build
+ if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_EABI__
+ then
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ else
+ echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+ fi
+ exit ;;
+ avr32*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ cris:Linux:*:*)
+ echo cris-axis-linux-gnu
+ exit ;;
+ crisv32:Linux:*:*)
+ echo crisv32-axis-linux-gnu
+ exit ;;
+ frv:Linux:*:*)
+ echo frv-unknown-linux-gnu
+ exit ;;
+ ia64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ m32r*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ m68*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ mips:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef mips
+ #undef mipsel
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=mipsel
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=mips
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+ /^CPU/{
+ s: ::g
+ p
+ }'`"
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+ ;;
+ mips64:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef mips64
+ #undef mips64el
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=mips64el
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=mips64
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+ /^CPU/{
+ s: ::g
+ p
+ }'`"
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+ ;;
+ or32:Linux:*:*)
+ echo or32-unknown-linux-gnu
+ exit ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-gnu
+ exit ;;
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-gnu
+ exit ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+ exit ;;
+ parisc:Linux:*:* | hppa:Linux:*:*)
+ # Look for CPU level
+ case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+ PA7*) echo hppa1.1-unknown-linux-gnu ;;
+ PA8*) echo hppa2.0-unknown-linux-gnu ;;
+ *) echo hppa-unknown-linux-gnu ;;
+ esac
+ exit ;;
+ parisc64:Linux:*:* | hppa64:Linux:*:*)
+ echo hppa64-unknown-linux-gnu
+ exit ;;
+ s390:Linux:*:* | s390x:Linux:*:*)
+ echo ${UNAME_MACHINE}-ibm-linux
+ exit ;;
+ sh64*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ sh*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ sparc:Linux:*:* | sparc64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ vax:Linux:*:*)
+ echo ${UNAME_MACHINE}-dec-linux-gnu
+ exit ;;
+ x86_64:Linux:*:*)
+ echo x86_64-unknown-linux-gnu
+ exit ;;
+ xtensa*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
+ i*86:Linux:*:*)
+ # The BFD linker knows what the default object file format is, so
+ # first see if it will tell us. cd to the root directory to prevent
+ # problems with other programs or directories called `ld' in the path.
+ # Set LC_ALL=C to ensure ld outputs messages in English.
+ ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \
+ | sed -ne '/supported targets:/!d
+ s/[ ][ ]*/ /g
+ s/.*supported targets: *//
+ s/ .*//
+ p'`
+ case "$ld_supported_targets" in
+ elf32-i386)
+ TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
+ ;;
+ a.out-i386-linux)
+ echo "${UNAME_MACHINE}-pc-linux-gnuaout"
+ exit ;;
+ coff-i386)
+ echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+ exit ;;
+ "")
+ # Either a pre-BFD a.out linker (linux-gnuoldld) or
+ # one that does not give us useful --help.
+ echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
+ exit ;;
+ esac
+ # Determine whether the default compiler is a.out or elf
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <features.h>
+ #ifdef __ELF__
+ # ifdef __GLIBC__
+ # if __GLIBC__ >= 2
+ LIBC=gnu
+ # else
+ LIBC=gnulibc1
+ # endif
+ # else
+ LIBC=gnulibc1
+ # endif
+ #else
+ #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+ LIBC=gnu
+ #else
+ LIBC=gnuaout
+ #endif
+ #endif
+ #ifdef __dietlibc__
+ LIBC=dietlibc
+ #endif
+EOF
+ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+ /^LIBC/{
+ s: ::g
+ p
+ }'`"
+ test x"${LIBC}" != x && {
+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+ exit
+ }
+ test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
+ ;;
+ i*86:DYNIX/ptx:4*:*)
+ # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+ # earlier versions are messed up and put the nodename in both
+ # sysname and nodename.
+ echo i386-sequent-sysv4
+ exit ;;
+ i*86:UNIX_SV:4.2MP:2.*)
+ # Unixware is an offshoot of SVR4, but it has its own version
+ # number series starting with 2...
+ # I am not positive that other SVR4 systems won't match this,
+ # I just have to hope. -- rms.
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ exit ;;
+ i*86:OS/2:*:*)
+ # If we were able to find `uname', then EMX Unix compatibility
+ # is probably installed.
+ echo ${UNAME_MACHINE}-pc-os2-emx
+ exit ;;
+ i*86:XTS-300:*:STOP)
+ echo ${UNAME_MACHINE}-unknown-stop
+ exit ;;
+ i*86:atheos:*:*)
+ echo ${UNAME_MACHINE}-unknown-atheos
+ exit ;;
+ i*86:syllable:*:*)
+ echo ${UNAME_MACHINE}-pc-syllable
+ exit ;;
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+ echo i386-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ i*86:*DOS:*:*)
+ echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ exit ;;
+ i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+ UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+ echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+ else
+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ fi
+ exit ;;
+ i*86:*:5:[678]*)
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
+ case `/bin/uname -X | grep "^Machine"` in
+ *486*) UNAME_MACHINE=i486 ;;
+ *Pentium) UNAME_MACHINE=i586 ;;
+ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+ esac
+ echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ exit ;;
+ i*86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+ echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
+ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+ && UNAME_MACHINE=i686
+ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+ && UNAME_MACHINE=i686
+ echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ else
+ echo ${UNAME_MACHINE}-pc-sysv32
+ fi
+ exit ;;
+ pc:*:*:*)
+ # Left here for compatibility:
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i386.
+ echo i386-pc-msdosdjgpp
+ exit ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+ exit ;;
+ paragon:*:*:*)
+ echo i860-intel-osf1
+ exit ;;
+ i860:*:4.*:*) # i860-SVR4
+ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+ echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ else # Add other i860-SVR4 vendors below as they are discovered.
+ echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ fi
+ exit ;;
+ mini*:CTIX:SYS*5:*)
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit ;;
+ mc68k:UNIX:SYSTEM5:3.51m)
+ echo m68k-convergent-sysv
+ exit ;;
+ M680?0:D-NIX:5.3:*)
+ echo m68k-diab-dnix
+ exit ;;
+ M68*:*:R3V[5678]*:*)
+ test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && { echo i486-ncr-sysv4; exit; } ;;
+ m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+ echo m68k-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ rs6000:LynxOS:2.*:*)
+ echo rs6000-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+ echo powerpc-unknown-lynxos${UNAME_RELEASE}
+ exit ;;
+ SM[BE]S:UNIX_SV:*:*)
+ echo mips-dde-sysv${UNAME_RELEASE}
+ exit ;;
+ RM*:ReliantUNIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ RM*:SINIX-*:*:*)
+ echo mips-sni-sysv4
+ exit ;;
+ *:SINIX-*:*:*)
+ if uname -p 2>/dev/null >/dev/null ; then
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ echo ${UNAME_MACHINE}-sni-sysv4
+ else
+ echo ns32k-sni-sysv
+ fi
+ exit ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes@openmarket.com>.
+ # How about differentiating between stratus architectures? -djm
+ echo hppa1.1-stratus-sysv4
+ exit ;;
+ *:*:*:FTX*)
+ # From seanf@swdc.stratus.com.
+ echo i860-stratus-sysv4
+ exit ;;
+ i*86:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo ${UNAME_MACHINE}-stratus-vos
+ exit ;;
+ *:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo hppa1.1-stratus-vos
+ exit ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux${UNAME_RELEASE}
+ exit ;;
+ news*:NEWS-OS:6*:*)
+ echo mips-sony-newsos6
+ exit ;;
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+ if [ -d /usr/nec ]; then
+ echo mips-nec-sysv${UNAME_RELEASE}
+ else
+ echo mips-unknown-sysv${UNAME_RELEASE}
+ fi
+ exit ;;
+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
+ echo powerpc-be-beos
+ exit ;;
+ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
+ echo powerpc-apple-beos
+ exit ;;
+ BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
+ echo i586-pc-beos
+ exit ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-5:SUPER-UX:*:*)
+ echo sx5-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-6:SUPER-UX:*:*)
+ echo sx6-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-7:SUPER-UX:*:*)
+ echo sx7-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8:SUPER-UX:*:*)
+ echo sx8-nec-superux${UNAME_RELEASE}
+ exit ;;
+ SX-8R:SUPER-UX:*:*)
+ echo sx8r-nec-superux${UNAME_RELEASE}
+ exit ;;
+ Power*:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Rhapsody:*:*)
+ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ exit ;;
+ *:Darwin:*:*)
+ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+ case $UNAME_PROCESSOR in
+ unknown) UNAME_PROCESSOR=powerpc ;;
+ esac
+ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+ exit ;;
+ *:procnto*:*:* | *:QNX:[0123456789]*:*)
+ UNAME_PROCESSOR=`uname -p`
+ if test "$UNAME_PROCESSOR" = "x86"; then
+ UNAME_PROCESSOR=i386
+ UNAME_MACHINE=pc
+ fi
+ echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+ exit ;;
+ *:QNX:*:4*)
+ echo i386-pc-qnx
+ exit ;;
+ NSE-?:NONSTOP_KERNEL:*:*)
+ echo nse-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ NSR-?:NONSTOP_KERNEL:*:*)
+ echo nsr-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ *:NonStop-UX:*:*)
+ echo mips-compaq-nonstopux
+ exit ;;
+ BS2000:POSIX*:*:*)
+ echo bs2000-siemens-sysv
+ exit ;;
+ DS/*:UNIX_System_V:*:*)
+ echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+ exit ;;
+ *:Plan9:*:*)
+ # "uname -m" is not consistent, so use $cputype instead. 386
+ # is converted to i386 for consistency with other x86
+ # operating systems.
+ if test "$cputype" = "386"; then
+ UNAME_MACHINE=i386
+ else
+ UNAME_MACHINE="$cputype"
+ fi
+ echo ${UNAME_MACHINE}-unknown-plan9
+ exit ;;
+ *:TOPS-10:*:*)
+ echo pdp10-unknown-tops10
+ exit ;;
+ *:TENEX:*:*)
+ echo pdp10-unknown-tenex
+ exit ;;
+ KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+ echo pdp10-dec-tops20
+ exit ;;
+ XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+ echo pdp10-xkl-tops20
+ exit ;;
+ *:TOPS-20:*:*)
+ echo pdp10-unknown-tops20
+ exit ;;
+ *:ITS:*:*)
+ echo pdp10-unknown-its
+ exit ;;
+ SEI:*:*:SEIUX)
+ echo mips-sei-seiux${UNAME_RELEASE}
+ exit ;;
+ *:DragonFly:*:*)
+ echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit ;;
+ *:*VMS:*:*)
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ case "${UNAME_MACHINE}" in
+ A*) echo alpha-dec-vms ; exit ;;
+ I*) echo ia64-dec-vms ; exit ;;
+ V*) echo vax-dec-vms ; exit ;;
+ esac ;;
+ *:XENIX:*:SysV)
+ echo i386-pc-xenix
+ exit ;;
+ i*86:skyos:*:*)
+ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+ exit ;;
+ i*86:rdos:*:*)
+ echo ${UNAME_MACHINE}-pc-rdos
+ exit ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+ /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
+ I don't know.... */
+ printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+ printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+ "4"
+#else
+ ""
+#endif
+ ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+ printf ("arm-acorn-riscix\n"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+ printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+ int version;
+ version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+ if (version < 4)
+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+ else
+ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+ exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+ printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+ printf ("ns32k-encore-mach\n"); exit (0);
+#else
+ printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+ printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+ printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+ printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+ struct utsname un;
+
+ uname(&un);
+
+ if (strncmp(un.version, "V2", 2) == 0) {
+ printf ("i386-sequent-ptx2\n"); exit (0);
+ }
+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+ printf ("i386-sequent-ptx1\n"); exit (0);
+ }
+ printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+# include <sys/param.h>
+# if defined (BSD)
+# if BSD == 43
+ printf ("vax-dec-bsd4.3\n"); exit (0);
+# else
+# if BSD == 199006
+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# endif
+# else
+ printf ("vax-dec-bsd\n"); exit (0);
+# endif
+# else
+ printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+ printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+ exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+ case `getsysinfo -f cpu_type` in
+ c1*)
+ echo c1-convex-bsd
+ exit ;;
+ c2*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit ;;
+ c34*)
+ echo c34-convex-bsd
+ exit ;;
+ c38*)
+ echo c38-convex-bsd
+ exit ;;
+ c4*)
+ echo c4-convex-bsd
+ exit ;;
+ esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo = `(hostinfo) 2>/dev/null`
+/bin/universe = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/config.h.in b/config.h.in
new file mode 100644
index 0000000..4dfde51
--- /dev/null
+++ b/config.h.in
@@ -0,0 +1,104 @@
+/* config.h.in. Generated from configure.in by autoheader. */
+
+/* whether popt prototype takes a const char ** */
+#undef CONST_POPT
+
+/* Defined if you have the version of bfd_openr_iovec with 7 parameters */
+#undef HAVE_BFD_OPENR_IOVEC_WITH_7PARMS
+
+/* Define to 1 if you have the declaration of `basename', and to 0 if you
+ don't. */
+#undef HAVE_DECL_BASENAME
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the `iberty' library (-liberty). */
+#undef HAVE_LIBIBERTY
+
+/* Define to 1 if you have the <libiberty.h> header file. */
+#undef HAVE_LIBIBERTY_H
+
+/* Define to 1 if you have the `popt' library (-lpopt). */
+#undef HAVE_LIBPOPT
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the `perfmonctl' function. */
+#undef HAVE_PERFMONCTL
+
+/* Define to 1 if you have the `sched_setaffinity' function. */
+#undef HAVE_SCHED_SETAFFINITY
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the `xcalloc' function. */
+#undef HAVE_XCALLOC
+
+/* Define to 1 if you have the `xmemdup' function. */
+#undef HAVE_XMEMDUP
+
+/* whether malloc attribute is understood */
+#undef MALLOC_ATTRIBUTE_OK
+
+/* package binary directory */
+#undef OP_BINDIR
+
+/* package data directory */
+#undef OP_DATADIR
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Synthesize special symbols when needed */
+#undef SYNTHESIZE_SYMBOLS
+
+/* whether bfd.h defines bool values */
+#undef TRUE_FALSE_ALREADY_DEFINED
+
+/* Version number of package */
+#undef VERSION
+
+/* Define to 1 if the X Window System is missing or not being used. */
+#undef X_DISPLAY_MISSING
diff --git a/config.sub b/config.sub
new file mode 100755
index 0000000..6759825
--- /dev/null
+++ b/config.sub
@@ -0,0 +1,1658 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+# Free Software Foundation, Inc.
+
+timestamp='2008-01-16'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine. It does not imply ALL GNU software can.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Please send patches to <config-patches@gnu.org>. Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support. The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+ $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+ -h, --help print this help, then exit
+ -t, --time-stamp print date of last modification, then exit
+ -v, --version print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+ case $1 in
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit ;;
+ --version | -v )
+ echo "$version" ; exit ;;
+ --help | --h* | -h )
+ echo "$usage"; exit ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help"
+ exit 1 ;;
+
+ *local*)
+ # First pass through any local machine types.
+ echo $1
+ exit ;;
+
+ * )
+ break ;;
+ esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+ exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+ exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+ nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+ *)
+ basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+ if [ $basic_machine != $1 ]
+ then os=`echo $1 | sed 's/.*-/-/'`
+ else os=; fi
+ ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work. We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+ -sun*os*)
+ # Prevent following clause from handling this invalid input.
+ ;;
+ -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+ -apple | -axis | -knuth | -cray)
+ os=
+ basic_machine=$1
+ ;;
+ -sim | -cisco | -oki | -wec | -winbond)
+ os=
+ basic_machine=$1
+ ;;
+ -scout)
+ ;;
+ -wrs)
+ os=-vxworks
+ basic_machine=$1
+ ;;
+ -chorusos*)
+ os=-chorusos
+ basic_machine=$1
+ ;;
+ -chorusrdb)
+ os=-chorusrdb
+ basic_machine=$1
+ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+ -sco6)
+ os=-sco5v6
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5)
+ os=-sco3.2v5
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco4)
+ os=-sco3.2v4
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2.[4-9]*)
+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2v[4-9]*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco5v6*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco*)
+ os=-sco3.2v2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -udk*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -isc)
+ os=-isc2.2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -clix*)
+ basic_machine=clipper-intergraph
+ ;;
+ -isc*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -lynx*)
+ os=-lynxos
+ ;;
+ -ptx*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ ;;
+ -windowsnt*)
+ os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ ;;
+ -psos*)
+ os=-psos
+ ;;
+ -mint | -mint[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+ 1750a | 580 \
+ | a29k \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+ | am33_2.0 \
+ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+ | bfin \
+ | c4x | clipper \
+ | d10v | d30v | dlx | dsp16xx \
+ | fido | fr30 | frv \
+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | i370 | i860 | i960 | ia64 \
+ | ip2k | iq2000 \
+ | m32c | m32r | m32rle | m68000 | m68k | m88k \
+ | maxq | mb | microblaze | mcore | mep \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64el \
+ | mips64vr | mips64vrel \
+ | mips64orion | mips64orionel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mips64vr5900 | mips64vr5900el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipstx39 | mipstx39el \
+ | mn10200 | mn10300 \
+ | mt \
+ | msp430 \
+ | nios | nios2 \
+ | ns16k | ns32k \
+ | or32 \
+ | pdp10 | pdp11 | pj | pjl \
+ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+ | pyramid \
+ | score \
+ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+ | sh64 | sh64le \
+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+ | spu | strongarm \
+ | tahoe | thumb | tic4x | tic80 | tron \
+ | v850 | v850e \
+ | we32k \
+ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+ | z8k)
+ basic_machine=$basic_machine-unknown
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12)
+ # Motorola 68HC11/12.
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+ ;;
+ ms1)
+ basic_machine=mt-unknown
+ ;;
+
+ # We use `pc' rather than `unknown'
+ # because (1) that's what they normally are, and
+ # (2) the word "unknown" tends to confuse beginning users.
+ i*86 | x86_64)
+ basic_machine=$basic_machine-pc
+ ;;
+ # Object if more than one company name word.
+ *-*-*)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+ 580-* \
+ | a29k-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
+ | avr-* | avr32-* \
+ | bfin-* | bs2000-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+ | clipper-* | craynv-* | cydra-* \
+ | d10v-* | d30v-* | dlx-* \
+ | elxsi-* \
+ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+ | h8300-* | h8500-* \
+ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | i*86-* | i860-* | i960-* | ia64-* \
+ | ip2k-* | iq2000-* \
+ | m32c-* | m32r-* | m32rle-* \
+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* \
+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+ | mips16-* \
+ | mips64-* | mips64el-* \
+ | mips64vr-* | mips64vrel-* \
+ | mips64orion-* | mips64orionel-* \
+ | mips64vr4100-* | mips64vr4100el-* \
+ | mips64vr4300-* | mips64vr4300el-* \
+ | mips64vr5000-* | mips64vr5000el-* \
+ | mips64vr5900-* | mips64vr5900el-* \
+ | mipsisa32-* | mipsisa32el-* \
+ | mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa64-* | mipsisa64el-* \
+ | mipsisa64r2-* | mipsisa64r2el-* \
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipstx39-* | mipstx39el-* \
+ | mmix-* \
+ | mt-* \
+ | msp430-* \
+ | nios-* | nios2-* \
+ | none-* | np1-* | ns16k-* | ns32k-* \
+ | orion-* \
+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+ | pyramid-* \
+ | romp-* | rs6000-* \
+ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+ | sparclite-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+ | tahoe-* | thumb-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+ | tron-* \
+ | v850-* | v850e-* | vax-* \
+ | we32k-* \
+ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+ | xstormy16-* | xtensa*-* \
+ | ymp-* \
+ | z8k-*)
+ ;;
+ # Recognize the basic CPU types without company name, with glob match.
+ xtensa*)
+ basic_machine=$basic_machine-unknown
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+ 386bsd)
+ basic_machine=i386-unknown
+ os=-bsd
+ ;;
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ basic_machine=m68000-att
+ ;;
+ 3b*)
+ basic_machine=we32k-att
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ abacus)
+ basic_machine=abacus-unknown
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ os=-scout
+ ;;
+ alliant | fx80)
+ basic_machine=fx80-alliant
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
+ amd64)
+ basic_machine=x86_64-pc
+ ;;
+ amd64-*)
+ basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+ basic_machine=m68k-unknown
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ os=-amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ os=-sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=-sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ os=-bsd
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ os=-aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
+ blackfin)
+ basic_machine=bfin-unknown
+ os=-linux
+ ;;
+ blackfin-*)
+ basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ c90)
+ basic_machine=c90-cray
+ os=-unicos
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ os=-bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ os=-bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ os=-bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+ cray | j90)
+ basic_machine=j90-cray
+ os=-unicos
+ ;;
+ craynv)
+ basic_machine=craynv-cray
+ os=-unicosmp
+ ;;
+ cr16)
+ basic_machine=cr16-unknown
+ os=-elf
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
+ crisv32 | crisv32-* | etraxfs*)
+ basic_machine=crisv32-axis
+ ;;
+ cris | cris-* | etrax*)
+ basic_machine=cris-axis
+ ;;
+ crx)
+ basic_machine=crx-unknown
+ os=-elf
+ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
+ decsystem10* | dec10*)
+ basic_machine=pdp10-dec
+ os=-tops10
+ ;;
+ decsystem20* | dec20*)
+ basic_machine=pdp10-dec
+ os=-tops20
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ os=-sysv3
+ ;;
+ djgpp)
+ basic_machine=i586-pc
+ os=-msdosdjgpp
+ ;;
+ dpx20 | dpx20-*)
+ basic_machine=rs6000-bull
+ os=-bosx
+ ;;
+ dpx2* | dpx2*-bull)
+ basic_machine=m68k-bull
+ os=-sysv3
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ os=-ebmon
+ ;;
+ elxsi)
+ basic_machine=elxsi-elxsi
+ os=-bsd
+ ;;
+ encore | umax | mmax)
+ basic_machine=ns32k-encore
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ os=-ose
+ ;;
+ fx2800)
+ basic_machine=i860-alliant
+ ;;
+ genix)
+ basic_machine=ns32k-ns
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ os=-go32
+ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ os=-hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ os=-xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ os=-hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=-sysv3
+ ;;
+ hp300-*)
+ basic_machine=m68k-hp
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ os=-bsd
+ ;;
+ hp300hpux)
+ basic_machine=m68k-hp
+ os=-hpux
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ basic_machine=m68000-hp
+ ;;
+ hp9k3[2-9][0-9])
+ basic_machine=m68k-hp
+ ;;
+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k78[0-9] | hp78[0-9])
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][13679] | hp8[0-9][13679])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hppa-next)
+ os=-nextstep3
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ os=-osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ os=-proelf
+ ;;
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+ ;;
+# I'm not sure what "Sysv32" means. Should this be sysv3.2?
+ i*86v32)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv32
+ ;;
+ i*86v4*)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv4
+ ;;
+ i*86v)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv
+ ;;
+ i*86sol2)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-solaris2
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ os=-mach
+ ;;
+ i386-vsta | vsta)
+ basic_machine=i386-unknown
+ os=-vsta
+ ;;
+ iris | iris4d)
+ basic_machine=mips-sgi
+ case $os in
+ -irix*)
+ ;;
+ *)
+ os=-irix4
+ ;;
+ esac
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ os=-sysv
+ ;;
+ m68knommu)
+ basic_machine=m68k-unknown
+ os=-linux
+ ;;
+ m68knommu-*)
+ basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ m88k-omron*)
+ basic_machine=m88k-omron
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ os=-sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
+ mingw32)
+ basic_machine=i386-pc
+ os=-mingw32
+ ;;
+ mingw32ce)
+ basic_machine=arm-unknown
+ os=-mingw32ce
+ ;;
+ miniframe)
+ basic_machine=m68000-convergent
+ ;;
+ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
+ mips3*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+ os=-morphos
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ os=-msdos
+ ;;
+ ms1-*)
+ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ os=-mvs
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=-sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-unknown
+ os=-netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ os=-linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ os=-newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ os=-newsos
+ ;;
+ news-3600 | risc-news)
+ basic_machine=mips-sony
+ os=-newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ os=-sysv
+ ;;
+ next | m*-next )
+ basic_machine=m68k-next
+ case $os in
+ -nextstep* )
+ ;;
+ -ns2*)
+ os=-nextstep2
+ ;;
+ *)
+ os=-nextstep3
+ ;;
+ esac
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ os=-cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ os=-cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ os=-nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ os=-mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ os=-nonstopux
+ ;;
+ np1)
+ basic_machine=np1-gould
+ ;;
+ nsr-tandem)
+ basic_machine=nsr-tandem
+ ;;
+ op50n-* | op60c-*)
+ basic_machine=hppa1.1-oki
+ os=-proelf
+ ;;
+ openrisc | openrisc-*)
+ basic_machine=or32-unknown
+ ;;
+ os400)
+ basic_machine=powerpc-ibm
+ os=-os400
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ os=-ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ os=-os68k
+ ;;
+ pa-hitachi)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ os=-osf
+ ;;
+ parisc)
+ basic_machine=hppa-unknown
+ os=-linux
+ ;;
+ parisc-*)
+ basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=-linux
+ ;;
+ pbd)
+ basic_machine=sparc-tti
+ ;;
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+ pc98)
+ basic_machine=i386-pc
+ ;;
+ pc98-*)
+ basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium | p5 | k5 | k6 | nexgen | viac3)
+ basic_machine=i586-pc
+ ;;
+ pentiumpro | p6 | 6x86 | athlon | athlon_*)
+ basic_machine=i686-pc
+ ;;
+ pentiumii | pentium2 | pentiumiii | pentium3)
+ basic_machine=i686-pc
+ ;;
+ pentium4)
+ basic_machine=i786-pc
+ ;;
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumpro-* | p6-* | 6x86-* | athlon-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium4-*)
+ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+ power) basic_machine=power-ibm
+ ;;
+ ppc) basic_machine=powerpc-unknown
+ ;;
+ ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle | ppc-le | powerpc-little)
+ basic_machine=powerpcle-unknown
+ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ basic_machine=powerpc64le-unknown
+ ;;
+ ppc64le-* | powerpc64little-*)
+ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ os=-pw32
+ ;;
+ rdos)
+ basic_machine=i386-pc
+ os=-rdos
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ rm[46]00)
+ basic_machine=mips-siemens
+ ;;
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
+ s390 | s390-*)
+ basic_machine=s390-ibm
+ ;;
+ s390x | s390x-*)
+ basic_machine=s390x-ibm
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ sb1)
+ basic_machine=mipsisa64sb1-unknown
+ ;;
+ sb1el)
+ basic_machine=mipsisa64sb1el-unknown
+ ;;
+ sde)
+ basic_machine=mipsisa32-sde
+ os=-elf
+ ;;
+ sei)
+ basic_machine=mips-sei
+ os=-seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+ sh)
+ basic_machine=sh-hitachi
+ os=-hms
+ ;;
+ sh5el)
+ basic_machine=sh5le-unknown
+ ;;
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
+ sparclite-wrs | simso-wrs)
+ basic_machine=sparclite-wrs
+ os=-vxworks
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ os=-sysv2
+ ;;
+ spur)
+ basic_machine=spur-unknown
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ os=-sysv4
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ os=-sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ os=-sunos4
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ os=-sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ os=-sunos4
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ os=-sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ os=-sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ os=-solaris2
+ ;;
+ sun3 | sun3-*)
+ basic_machine=m68k-sun
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ os=-unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=-dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ os=-unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ os=-unicos
+ ;;
+ tic54x | c54x*)
+ basic_machine=tic54x-unknown
+ os=-coff
+ ;;
+ tic55x | c55x*)
+ basic_machine=tic55x-unknown
+ os=-coff
+ ;;
+ tic6x | c6x*)
+ basic_machine=tic6x-unknown
+ os=-coff
+ ;;
+ tile*)
+ basic_machine=tile-unknown
+ os=-linux-gnu
+ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ os=-tops20
+ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
+ tpf)
+ basic_machine=s390x-ibm
+ os=-tpf
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ os=-sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ os=-none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=-sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ os=-vms
+ ;;
+ vpp*|vx|vx-*)
+ basic_machine=f301-fujitsu
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ os=-vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ os=-vxworks
+ ;;
+ w65*)
+ basic_machine=w65-wdc
+ os=-none
+ ;;
+ w89k-*)
+ basic_machine=hppa1.1-winbond
+ os=-proelf
+ ;;
+ xbox)
+ basic_machine=i686-pc
+ os=-mingw32
+ ;;
+ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ os=-unicos
+ ;;
+ z8k-*-coff)
+ basic_machine=z8k-unknown
+ os=-sim
+ ;;
+ none)
+ basic_machine=none-none
+ os=-none
+ ;;
+
+# Here we handle the default manufacturer of certain CPU types. It is in
+# some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ basic_machine=hppa1.1-winbond
+ ;;
+ op50n)
+ basic_machine=hppa1.1-oki
+ ;;
+ op60c)
+ basic_machine=hppa1.1-oki
+ ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
+ mmix)
+ basic_machine=mmix-knuth
+ ;;
+ rs6000)
+ basic_machine=rs6000-ibm
+ ;;
+ vax)
+ basic_machine=vax-dec
+ ;;
+ pdp10)
+ # there are many clones, so DEC is not a safe bet
+ basic_machine=pdp10-unknown
+ ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+ sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
+ basic_machine=sh-unknown
+ ;;
+ sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+ basic_machine=sparc-sun
+ ;;
+ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+ basic_machine=orion-highlevel
+ ;;
+ orion105)
+ basic_machine=clipper-highlevel
+ ;;
+ mac | mpw | mac-mpw)
+ basic_machine=m68k-apple
+ ;;
+ pmac | pmac-mpw)
+ basic_machine=powerpc-apple
+ ;;
+ *-unknown)
+ # Make sure to match an already-canonicalized machine name.
+ ;;
+ *)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+ *-digital*)
+ basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+ ;;
+ *-commodore*)
+ basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ ;;
+ *)
+ ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+ # First match some system type aliases
+ # that might get confused with valid system types.
+ # -solaris* is a basic system type, with this one exception.
+ -solaris1 | -solaris1.*)
+ os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ ;;
+ -solaris)
+ os=-solaris2
+ ;;
+ -svr4*)
+ os=-sysv4
+ ;;
+ -unixware*)
+ os=-sysv4.2uw
+ ;;
+ -gnu/linux*)
+ os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+ ;;
+ # First accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST END IN A *, to match a version number.
+ # -sysv* is not here because it comes later, after sysvr4.
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+ | -aos* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+ | -openbsd* | -solidbsd* \
+ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -qnx*)
+ case $basic_machine in
+ x86-* | i*86-*)
+ ;;
+ *)
+ os=-nto$os
+ ;;
+ esac
+ ;;
+ -nto-qnx*)
+ ;;
+ -nto*)
+ os=`echo $os | sed -e 's|nto|nto-qnx|'`
+ ;;
+ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ ;;
+ -mac*)
+ os=`echo $os | sed -e 's|mac|macos|'`
+ ;;
+ -linux-dietlibc)
+ os=-linux-dietlibc
+ ;;
+ -linux*)
+ os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ ;;
+ -sunos5*)
+ os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ ;;
+ -sunos6*)
+ os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ ;;
+ -opened*)
+ os=-openedition
+ ;;
+ -os400*)
+ os=-os400
+ ;;
+ -wince*)
+ os=-wince
+ ;;
+ -osfrose*)
+ os=-osfrose
+ ;;
+ -osf*)
+ os=-osf
+ ;;
+ -utek*)
+ os=-bsd
+ ;;
+ -dynix*)
+ os=-bsd
+ ;;
+ -acis*)
+ os=-aos
+ ;;
+ -atheos*)
+ os=-atheos
+ ;;
+ -syllable*)
+ os=-syllable
+ ;;
+ -386bsd)
+ os=-bsd
+ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
+ -nova*)
+ os=-rtmk-nova
+ ;;
+ -ns2 )
+ os=-nextstep2
+ ;;
+ -nsk*)
+ os=-nsk
+ ;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+ os=`echo $os | sed -e 's|sinix|sysv|'`
+ ;;
+ -sinix*)
+ os=-sysv4
+ ;;
+ -tpf*)
+ os=-tpf
+ ;;
+ -triton*)
+ os=-sysv3
+ ;;
+ -oss*)
+ os=-sysv3
+ ;;
+ -svr4)
+ os=-sysv4
+ ;;
+ -svr3)
+ os=-sysv3
+ ;;
+ -sysvr4)
+ os=-sysv4
+ ;;
+ # This must come after -sysvr4.
+ -sysv*)
+ ;;
+ -ose*)
+ os=-ose
+ ;;
+ -es1800*)
+ os=-ose
+ ;;
+ -xenix)
+ os=-xenix
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ os=-mint
+ ;;
+ -aros*)
+ os=-aros
+ ;;
+ -kaos*)
+ os=-kaos
+ ;;
+ -zvmoe)
+ os=-zvmoe
+ ;;
+ -none)
+ ;;
+ *)
+ # Get rid of the `-' at the beginning of $os.
+ os=`echo $os | sed 's/[^-]*-//'`
+ echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system. Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+ score-*)
+ os=-elf
+ ;;
+ spu-*)
+ os=-elf
+ ;;
+ *-acorn)
+ os=-riscix1.2
+ ;;
+ arm*-rebel)
+ os=-linux
+ ;;
+ arm*-semi)
+ os=-aout
+ ;;
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
+ # This must come before the *-dec entry.
+ pdp10-*)
+ os=-tops20
+ ;;
+ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+ os=-ultrix4.2
+ ;;
+ m68*-apollo)
+ os=-domain
+ ;;
+ i386-sun)
+ os=-sunos4.0.2
+ ;;
+ m68000-sun)
+ os=-sunos3
+ # This also exists in the configure program, but was not the
+ # default.
+ # os=-sunos4
+ ;;
+ m68*-cisco)
+ os=-aout
+ ;;
+ mep-*)
+ os=-elf
+ ;;
+ mips*-cisco)
+ os=-elf
+ ;;
+ mips*-*)
+ os=-elf
+ ;;
+ or32-*)
+ os=-coff
+ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+ sparc-* | *-sun)
+ os=-sunos4.1.1
+ ;;
+ *-be)
+ os=-beos
+ ;;
+ *-haiku)
+ os=-haiku
+ ;;
+ *-ibm)
+ os=-aix
+ ;;
+ *-knuth)
+ os=-mmixware
+ ;;
+ *-wec)
+ os=-proelf
+ ;;
+ *-winbond)
+ os=-proelf
+ ;;
+ *-oki)
+ os=-proelf
+ ;;
+ *-hp)
+ os=-hpux
+ ;;
+ *-hitachi)
+ os=-hiux
+ ;;
+ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+ os=-sysv
+ ;;
+ *-cbm)
+ os=-amigaos
+ ;;
+ *-dg)
+ os=-dgux
+ ;;
+ *-dolphin)
+ os=-sysv3
+ ;;
+ m68k-ccur)
+ os=-rtu
+ ;;
+ m88k-omron*)
+ os=-luna
+ ;;
+ *-next )
+ os=-nextstep
+ ;;
+ *-sequent)
+ os=-ptx
+ ;;
+ *-crds)
+ os=-unos
+ ;;
+ *-ns)
+ os=-genix
+ ;;
+ i370-*)
+ os=-mvs
+ ;;
+ *-next)
+ os=-nextstep3
+ ;;
+ *-gould)
+ os=-sysv
+ ;;
+ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+ *-sgi)
+ os=-irix
+ ;;
+ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+ os=-rtu
+ ;;
+ f30[01]-fujitsu | f700-fujitsu)
+ os=-uxpv
+ ;;
+ *-rom68k)
+ os=-coff
+ ;;
+ *-*bug)
+ os=-coff
+ ;;
+ *-apple)
+ os=-macos
+ ;;
+ *-atari*)
+ os=-mint
+ ;;
+ *)
+ os=-none
+ ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer. We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+ *-unknown)
+ case $os in
+ -riscix*)
+ vendor=acorn
+ ;;
+ -sunos*)
+ vendor=sun
+ ;;
+ -aix*)
+ vendor=ibm
+ ;;
+ -beos*)
+ vendor=be
+ ;;
+ -hpux*)
+ vendor=hp
+ ;;
+ -mpeix*)
+ vendor=hp
+ ;;
+ -hiux*)
+ vendor=hitachi
+ ;;
+ -unos*)
+ vendor=crds
+ ;;
+ -dgux*)
+ vendor=dg
+ ;;
+ -luna*)
+ vendor=omron
+ ;;
+ -genix*)
+ vendor=ns
+ ;;
+ -mvs* | -opened*)
+ vendor=ibm
+ ;;
+ -os400*)
+ vendor=ibm
+ ;;
+ -ptx*)
+ vendor=sequent
+ ;;
+ -tpf*)
+ vendor=ibm
+ ;;
+ -vxsim* | -vxworks* | -windiss*)
+ vendor=wrs
+ ;;
+ -aux*)
+ vendor=apple
+ ;;
+ -hms*)
+ vendor=hitachi
+ ;;
+ -mpw* | -macos*)
+ vendor=apple
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ vendor=atari
+ ;;
+ -vos*)
+ vendor=stratus
+ ;;
+ esac
+ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+esac
+
+echo $basic_machine$os
+exit
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/configure b/configure
new file mode 100755
index 0000000..82c8309
--- /dev/null
+++ b/configure
@@ -0,0 +1,27289 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.59.
+#
+# Copyright (C) 2003 Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+do
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
+ fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
+ else
+ as_ln_s='ln -s'
+ fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$ECHO in
+X*--fallback-echo)
+ # Remove one level of quotation (which was required for Make).
+ ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
+ ;;
+esac
+
+echo=${ECHO-echo}
+if test "X$1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+elif test "X$1" = X--fallback-echo; then
+ # Avoid inline document here, it may be left over
+ :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
+ # Yippee, $echo works!
+ :
+else
+ # Restart under the correct shell.
+ exec $SHELL "$0" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<EOF
+$*
+EOF
+ exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test -z "$ECHO"; then
+if test "X${echo_test_string+set}" != Xset; then
+# find a string as large as possible, as long as the shell can cope with it
+ for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
+ # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+ if (echo_test_string=`eval $cmd`) 2>/dev/null &&
+ echo_test_string=`eval $cmd` &&
+ (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
+ then
+ break
+ fi
+ done
+fi
+
+if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ :
+else
+ # The Solaris, AIX, and Digital Unix default echo programs unquote
+ # backslashes. This makes it impossible to quote backslashes using
+ # echo "$something" | sed 's/\\/\\\\/g'
+ #
+ # So, first we look for a working echo in the user's PATH.
+
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for dir in $PATH /usr/ucb; do
+ IFS="$lt_save_ifs"
+ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ echo="$dir/echo"
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+
+ if test "X$echo" = Xecho; then
+ # We didn't find a better echo, so look for alternatives.
+ if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # This shell has a builtin print -r that does the trick.
+ echo='print -r'
+ elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
+ test "X$CONFIG_SHELL" != X/bin/ksh; then
+ # If we have ksh, try running configure again with it.
+ ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+ export ORIGINAL_CONFIG_SHELL
+ CONFIG_SHELL=/bin/ksh
+ export CONFIG_SHELL
+ exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
+ else
+ # Try using printf.
+ echo='printf %s\n'
+ if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # Cool, printf works
+ :
+ elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+ export CONFIG_SHELL
+ SHELL="$CONFIG_SHELL"
+ export SHELL
+ echo="$CONFIG_SHELL $0 --fallback-echo"
+ elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ echo="$CONFIG_SHELL $0 --fallback-echo"
+ else
+ # maybe with a smaller string...
+ prev=:
+
+ for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
+ if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
+ then
+ break
+ fi
+ prev="$cmd"
+ done
+
+ if test "$prev" != 'sed 50q "$0"'; then
+ echo_test_string=`eval $prev`
+ export echo_test_string
+ exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
+ else
+ # Oops. We lost completely, so just stick with echo.
+ echo=echo
+ fi
+ fi
+ fi
+ fi
+fi
+fi
+
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
+ ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
+fi
+
+
+
+
+tagnames=${tagnames+${tagnames},}CXX
+
+tagnames=${tagnames+${tagnames},}F77
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+exec 6>&1
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_config_libobj_dir=.
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete. It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
+
+# Identity of this package.
+PACKAGE_NAME=
+PACKAGE_TARNAME=
+PACKAGE_VERSION=
+PACKAGE_STRING=
+PACKAGE_BUGREPORT=
+
+ac_unique_file="libop/op_config.h"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+# include <stdint.h>
+# endif
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE RANLIB ac_ct_RANLIB build build_cpu build_vendor build_os host host_cpu host_vendor host_os EGREP LN_S ECHO AR ac_ct_AR CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL DATE OPROFILE_DIR LD KSRC KINC kernel_support_TRUE kernel_support_FALSE KVERS OPROFILE_MODULE_ARCH MODINSTALLDIR JAVA_HOMEDIR BUILD_JVMTI_AGENT_TRUE BUILD_JVMTI_AGENT_FALSE BUILD_JVMPI_AGENT_TRUE BUILD_JVMPI_AGENT_FALSE EXTRA_CFLAGS_MODULE topdir SIZE_T_TYPE PTRDIFF_T_TYPE X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS QT_INCLUDES QT_LDFLAGS MOC UIC QT_LIB QT_VERSION XSLTPROC have_xsltproc_TRUE have_xsltproc_FALSE XML_CATALOG XSLTPROC_FLAGS DOCBOOK_ROOT CAT_ENTRY_START CAT_ENTRY_END LIBERTY_LIBS BFD_LIBS POPT_LIBS have_qt_TRUE have_qt_FALSE OP_CFLAGS OP_CXXFLAGS OP_DOCDIR LIBOBJS LTLIBOBJS'
+ac_subst_files=''
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+ac_prev=
+for ac_option
+do
+ # If the previous option needs an argument, assign it.
+ if test -n "$ac_prev"; then
+ eval "$ac_prev=\$ac_option"
+ ac_prev=
+ continue
+ fi
+
+ ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+
+ # Accept the important Cygnus configure options, so we can diagnose typos.
+
+ case $ac_option in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
+
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
+
+ -cache-file | --cache-file | --cache-fil | --cache-fi \
+ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+ ac_prev=cache_file ;;
+ -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir=$ac_optarg ;;
+
+ -disable-* | --disable-*)
+ ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ eval "enable_$ac_feature=no" ;;
+
+ -enable-* | --enable-*)
+ ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "enable_$ac_feature='$ac_optarg'" ;;
+
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+ | --exec | --exe | --ex)
+ ac_prev=exec_prefix ;;
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+ | --exec=* | --exe=* | --ex=*)
+ exec_prefix=$ac_optarg ;;
+
+ -gas | --gas | --ga | --g)
+ # Obsolete; use --with-gas.
+ with_gas=yes ;;
+
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
+
+ -host | --host | --hos | --ho)
+ ac_prev=host_alias ;;
+ -host=* | --host=* | --hos=* | --ho=*)
+ host_alias=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
+
+ -nfp | --nfp | --nf)
+ # Obsolete; use --without-fp.
+ with_fp=no ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+ | --no-cr | --no-c | -n)
+ no_create=yes ;;
+
+ -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+ no_recursion=yes ;;
+
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ ac_prev=prefix ;;
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=$ac_optarg ;;
+
+ -program-prefix | --program-prefix | --program-prefi | --program-pref \
+ | --program-pre | --program-pr | --program-p)
+ ac_prev=program_prefix ;;
+ -program-prefix=* | --program-prefix=* | --program-prefi=* \
+ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+ program_prefix=$ac_optarg ;;
+
+ -program-suffix | --program-suffix | --program-suffi | --program-suff \
+ | --program-suf | --program-su | --program-s)
+ ac_prev=program_suffix ;;
+ -program-suffix=* | --program-suffix=* | --program-suffi=* \
+ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+ program_suffix=$ac_optarg ;;
+
+ -program-transform-name | --program-transform-name \
+ | --program-transform-nam | --program-transform-na \
+ | --program-transform-n | --program-transform- \
+ | --program-transform | --program-transfor \
+ | --program-transfo | --program-transf \
+ | --program-trans | --program-tran \
+ | --progr-tra | --program-tr | --program-t)
+ ac_prev=program_transform_name ;;
+ -program-transform-name=* | --program-transform-name=* \
+ | --program-transform-nam=* | --program-transform-na=* \
+ | --program-transform-n=* | --program-transform-=* \
+ | --program-transform=* | --program-transfor=* \
+ | --program-transfo=* | --program-transf=* \
+ | --program-trans=* | --program-tran=* \
+ | --progr-tra=* | --program-tr=* | --program-t=*)
+ program_transform_name=$ac_optarg ;;
+
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ silent=yes ;;
+
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
+ -site | --site | --sit)
+ ac_prev=site ;;
+ -site=* | --site=* | --sit=*)
+ site=$ac_optarg ;;
+
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+ ac_prev=srcdir ;;
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
+
+ -target | --target | --targe | --targ | --tar | --ta | --t)
+ ac_prev=target_alias ;;
+ -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+ target_alias=$ac_optarg ;;
+
+ -v | -verbose | --verbose | --verbos | --verbo | --verb)
+ verbose=yes ;;
+
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
+
+ -with-* | --with-*)
+ ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package| sed 's/-/_/g'`
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) ac_optarg=yes ;;
+ esac
+ eval "with_$ac_package='$ac_optarg'" ;;
+
+ -without-* | --without-*)
+ ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package | sed 's/-/_/g'`
+ eval "with_$ac_package=no" ;;
+
+ --x)
+ # Obsolete; use --with-x.
+ with_x=yes ;;
+
+ -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+ | --x-incl | --x-inc | --x-in | --x-i)
+ ac_prev=x_includes ;;
+ -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+ x_includes=$ac_optarg ;;
+
+ -x-libraries | --x-libraries | --x-librarie | --x-librari \
+ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+ ac_prev=x_libraries ;;
+ -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+ x_libraries=$ac_optarg ;;
+
+ -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; }
+ ;;
+
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+ { (exit 1); exit 1; }; }
+ ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+ eval "$ac_envvar='$ac_optarg'"
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+ ;;
+
+ esac
+done
+
+if test -n "$ac_prev"; then
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ { echo "$as_me: error: missing argument to $ac_option" >&2
+ { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+ localstatedir libdir includedir oldincludedir infodir mandir
+do
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used." >&2
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ ac_srcdir_defaulted=yes
+ # Try the directory containing this script, then its parent.
+ ac_confdir=`(dirname "$0") 2>/dev/null ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$0" : 'X\(//\)[^/]' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$0" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ srcdir=$ac_confdir
+ if test ! -r $srcdir/$ac_unique_file; then
+ srcdir=..
+ fi
+else
+ ac_srcdir_defaulted=no
+fi
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+ { (exit 1); exit 1; }; }
+ else
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+ { (exit 1); exit 1; }; }
+ fi
+fi
+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+ { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+ { (exit 1); exit 1; }; }
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+ac_env_CC_set=${CC+set}
+ac_env_CC_value=$CC
+ac_cv_env_CC_set=${CC+set}
+ac_cv_env_CC_value=$CC
+ac_env_CFLAGS_set=${CFLAGS+set}
+ac_env_CFLAGS_value=$CFLAGS
+ac_cv_env_CFLAGS_set=${CFLAGS+set}
+ac_cv_env_CFLAGS_value=$CFLAGS
+ac_env_LDFLAGS_set=${LDFLAGS+set}
+ac_env_LDFLAGS_value=$LDFLAGS
+ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
+ac_cv_env_LDFLAGS_value=$LDFLAGS
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+ac_env_CPP_set=${CPP+set}
+ac_env_CPP_value=$CPP
+ac_cv_env_CPP_set=${CPP+set}
+ac_cv_env_CPP_value=$CPP
+ac_env_CXX_set=${CXX+set}
+ac_env_CXX_value=$CXX
+ac_cv_env_CXX_set=${CXX+set}
+ac_cv_env_CXX_value=$CXX
+ac_env_CXXFLAGS_set=${CXXFLAGS+set}
+ac_env_CXXFLAGS_value=$CXXFLAGS
+ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set}
+ac_cv_env_CXXFLAGS_value=$CXXFLAGS
+ac_env_CXXCPP_set=${CXXCPP+set}
+ac_env_CXXCPP_value=$CXXCPP
+ac_cv_env_CXXCPP_set=${CXXCPP+set}
+ac_cv_env_CXXCPP_value=$CXXCPP
+ac_env_F77_set=${F77+set}
+ac_env_F77_value=$F77
+ac_cv_env_F77_set=${F77+set}
+ac_cv_env_F77_value=$F77
+ac_env_FFLAGS_set=${FFLAGS+set}
+ac_env_FFLAGS_value=$FFLAGS
+ac_cv_env_FFLAGS_set=${FFLAGS+set}
+ac_cv_env_FFLAGS_value=$FFLAGS
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures this package to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+_ACEOF
+
+ cat <<_ACEOF
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --infodir=DIR info documentation [PREFIX/info]
+ --mandir=DIR man documentation [PREFIX/man]
+_ACEOF
+
+ cat <<\_ACEOF
+
+Program names:
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+
+X features:
+ --x-includes=DIR X include files are in DIR
+ --x-libraries=DIR X library files are in DIR
+
+System types:
+ --build=BUILD configure for building on BUILD [guessed]
+ --host=HOST cross-compile to build programs to run on HOST [BUILD]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors
+ --enable-shared[=PKGS]
+ build shared libraries [default=yes]
+ --enable-static[=PKGS]
+ build static libraries [default=yes]
+ --enable-fast-install[=PKGS]
+ optimize for fast installation [default=yes]
+ --disable-libtool-lock avoid locking (might break parallel builds)
+ --enable-pch enable precompiled header (default is disabled)
+ --enable-gcov enable option for gcov coverage testing (default is disabled)
+ --disable-werror disable -Werror flag (default is enabled for non-release)
+ --disable-optimization disable optimization flags (default is enabled)
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-tags[=TAGS]
+ include additional configurations [automatic]
+ --with-binutils=dir Path to binutils installation to use
+ --with-binutils-libname Lib dir name under binutils installation; [lib]]
+ --with-gcc=dir Path to GCC installation to use
+ --with-kernel-support Use 2.6 kernel (no kernel source tree required)
+ --with-linux=dir Path to Linux source tree
+ --with-module-dir=dir Path to module installation directory
+ --with-java=java-home Path to Java home directory
+ --with-extra-includes=DIR add extra include paths
+ --with-extra-libs=DIR add extra library paths
+ --with-target=cell-be Check BFD support for Cell Broadband Engine SPU profiling
+ --with-x use the X Window System
+ --with-qt-dir where the root of Qt is installed
+ --with-qt-includes where the Qt includes are.
+ --with-qt-libraries where the Qt library is installed.
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
+ headers in a nonstandard directory <include dir>
+ CPP C preprocessor
+ CXX C++ compiler command
+ CXXFLAGS C++ compiler flags
+ CXXCPP C++ preprocessor
+ F77 Fortran 77 compiler command
+ FFLAGS Fortran 77 compiler flags
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+_ACEOF
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ ac_popdir=`pwd`
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d $ac_dir || continue
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
+
+ cd $ac_dir
+ # Check for guested configure; otherwise get Cygnus style configure.
+ if test -f $ac_srcdir/configure.gnu; then
+ echo
+ $SHELL $ac_srcdir/configure.gnu --help=recursive
+ elif test -f $ac_srcdir/configure; then
+ echo
+ $SHELL $ac_srcdir/configure --help=recursive
+ elif test -f $ac_srcdir/configure.ac ||
+ test -f $ac_srcdir/configure.in; then
+ echo
+ $ac_configure --help
+ else
+ echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi
+ cd $ac_popdir
+ done
+fi
+
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+ cat <<\_ACEOF
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit 0
+fi
+exec 5>config.log
+cat >&5 <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by $as_me, which was
+generated by GNU Autoconf 2.59. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ echo "PATH: $as_dir"
+done
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_sep=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+ 2)
+ ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+ # Get rid of the leading space.
+ ac_sep=" "
+ ;;
+ esac
+ done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Be sure not to use single quotes in there, as some shells,
+# such as our DU 5.0 friend, will then `close' the trap.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+{
+ (set) 2>&1 |
+ case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ sed -n \
+ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+ ;;
+ *)
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+}
+ echo
+
+ cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ cat <<\_ASBOX
+## ------------- ##
+## Output files. ##
+## ------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+ echo
+ sed "/^$/d" confdefs.h | sort
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ echo "$as_me: caught signal $ac_signal"
+ echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core &&
+ rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+ ' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+ if test "x$prefix" != xNONE; then
+ CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+ else
+ CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+ fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+ if test -r "$ac_site_file"; then
+ { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
+ . "$ac_site_file"
+ fi
+done
+
+if test -r "$cache_file"; then
+ # Some versions of bash will fail to source /dev/null (special
+ # files actually), so we avoid doing that.
+ if test -f "$cache_file"; then
+ { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . $cache_file;;
+ *) . ./$cache_file;;
+ esac
+ fi
+else
+ { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in `(set) 2>&1 |
+ sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+ eval ac_new_val="\$ac_env_${ac_var}_value"
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
+echo "$as_me: former value: $ac_old_val" >&2;}
+ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
+echo "$as_me: current value: $ac_new_val" >&2;}
+ ac_cache_corrupted=:
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+am__api_version="1.9"
+ac_aux_dir=
+for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
+ if test -f $ac_dir/install-sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install-sh -c"
+ break
+ elif test -f $ac_dir/install.sh; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/install.sh -c"
+ break
+ elif test -f $ac_dir/shtool; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
+ fi
+done
+if test -z "$ac_aux_dir"; then
+ { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
+echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
+
+# Find a good install program. We prefer a C program (faster),
+# so one script is as good as another. But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+if test -z "$INSTALL"; then
+if test "${ac_cv_path_install+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+ /usr/ucb/* ) ;;
+ *)
+ # OSF1 and SCO ODT 3.0 have their own names for install.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
+ done
+ done
+ ;;
+esac
+done
+
+
+fi
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL=$ac_install_sh
+ fi
+fi
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments. Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t $srcdir/configure conftest.file`
+ fi
+ rm -f conftest.file
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&5
+echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+ test "$2" = conftest.file
+ )
+then
+ # Ok.
+ :
+else
+ { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+test "$program_prefix" != NONE &&
+ program_transform_name="s,^,$program_prefix,;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+ program_transform_name="s,\$,$program_suffix,;$program_transform_name"
+# Double any \ or $. echo might interpret backslashes.
+# By default was `s,x,x', remove it if useless.
+cat <<\_ACEOF >conftest.sed
+s/[\\$]/&&/g;s/;s,x,x,$//
+_ACEOF
+program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
+rm conftest.sed
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+ # We used to keeping the `.' as first argument, in order to
+ # allow $(mkdir_p) to be used without argument. As in
+ # $(mkdir_p) $(somedir)
+ # where $(somedir) is conditionally defined. However this is wrong
+ # for two reasons:
+ # 1. if the package is installed by a user who cannot write `.'
+ # make install will fail,
+ # 2. the above comment should most certainly read
+ # $(mkdir_p) $(DESTDIR)$(somedir)
+ # so it does not work when $(somedir) is undefined and
+ # $(DESTDIR) is not.
+ # To support the latter case, we have to write
+ # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
+ # so the `.' trick is pointless.
+ mkdir_p='mkdir -p --'
+else
+ # On NextStep and OpenStep, the `mkdir' command does not
+ # recognize any option. It will interpret all options as
+ # directories to create, and then abort because `.' already
+ # exists.
+ for d in ./-p ./--version;
+ do
+ test -d $d && rmdir $d
+ done
+ # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
+ if test -f "$ac_aux_dir/mkinstalldirs"; then
+ mkdir_p='$(mkinstalldirs)'
+ else
+ mkdir_p='$(install_sh) -d'
+ fi
+fi
+
+for ac_prog in gawk mawk nawk awk
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AWK+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AWK="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$AWK" && break
+done
+
+echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.make <<\_ACEOF
+all:
+ @echo 'ac_maketemp="$(MAKE)"'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+ eval ac_cv_prog_make_${ac_make}_set=yes
+else
+ eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftest.make
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ SET_MAKE=
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+ test -f $srcdir/config.status; then
+ { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE=oprofile
+ VERSION=0.9.6
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ STRIP=$ac_ct_STRIP
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
+
+
+
+ ac_config_headers="$ac_config_headers config.h"
+
+
+DEPDIR="${am__leading_dot}deps"
+
+ ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+ am__include=include
+ am__quote=
+ _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ fi
+fi
+
+
+echo "$as_me:$LINENO: result: $_am_result" >&5
+echo "${ECHO_T}$_am_result" >&6
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+ enableval="$enable_dependency_tracking"
+
+fi;
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+
+
+if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
+else
+ AMDEP_TRUE='#'
+ AMDEP_FALSE=
+fi
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$ac_ct_CC" && break
+done
+
+ CC=$ac_ct_CC
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+ "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+ (eval $ac_compiler --version </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+ (eval $ac_compiler -v </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+ (eval $ac_compiler -V </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+ (eval $ac_link_default) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Find the output, starting from the most likely. This scheme is
+# not robust to junk in `.', hence go to wildcards (a.*) only as a last
+# resort.
+
+# Be careful to initialize this variable, since it used to be cached.
+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
+ac_cv_exeext=
+# b.out is created by i960 compilers.
+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+ ;;
+ conftest.$ac_ext )
+ # This is the source file.
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ # FIXME: I believe we export ac_cv_exeext for Libtool,
+ # but it would be cool to find out if it's true. Does anybody
+ # maintain Libtool? --akim.
+ export ac_cv_exeext
+ break;;
+ * )
+ break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
+
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ fi
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ export ac_cv_exeext
+ break;;
+ * ) break;;
+ esac
+done
+else
+ { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+if test "${ac_cv_objext+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_compiler_gnu=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cc_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std1 is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std1. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX -qlanglvl=ansi
+# Ultrix and OSF/1 -std1
+# HP-UX 10.20 and later -Ae
+# HP-UX older versions -Aa -D_HPUX_SOURCE
+# SVR4 -Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+ x|xno)
+ echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+ *)
+ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+ CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+# Some people use a C++ compiler to compile C. Since we use `exit',
+# in C++ we need to declare it. In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+ choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ for ac_declaration in \
+ '' \
+ 'extern "C" void std::exit (int) throw (); using std::exit;' \
+ 'extern "C" void std::exit (int); using std::exit;' \
+ 'extern "C" void exit (int) throw ();' \
+ 'extern "C" void exit (int);' \
+ 'void exit (int);'
+do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+#include <stdlib.h>
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+ echo '#ifdef __cplusplus' >>confdefs.h
+ echo $ac_declaration >>confdefs.h
+ echo '#endif' >>confdefs.h
+fi
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CC" am_compiler_list=
+
+echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+
+
+if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+fi
+
+
+
+echo "$as_me:$LINENO: checking whether basename is declared" >&5
+echo $ECHO_N "checking whether basename is declared... $ECHO_C" >&6
+if test "${ac_cv_have_decl_basename+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <libgen.h>
+
+int
+main ()
+{
+#ifndef basename
+ char *p = (char *) basename;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_have_decl_basename=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_have_decl_basename=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_basename" >&5
+echo "${ECHO_T}$ac_cv_have_decl_basename" >&6
+if test $ac_cv_have_decl_basename = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_BASENAME 1
+_ACEOF
+
+
+else
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_BASENAME 0
+_ACEOF
+
+
+fi
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ RANLIB=$ac_ct_RANLIB
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+# Check whether --enable-shared or --disable-shared was given.
+if test "${enable_shared+set}" = set; then
+ enableval="$enable_shared"
+ p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_shared=yes
+fi;
+
+# Check whether --enable-static or --disable-static was given.
+if test "${enable_static+set}" = set; then
+ enableval="$enable_static"
+ p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_static=yes
+fi;
+
+# Check whether --enable-fast-install or --disable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then
+ enableval="$enable_fast_install"
+ p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_fast_install=yes
+fi;
+
+# Make sure we can run config.sub.
+$ac_config_sub sun4 >/dev/null 2>&1 ||
+ { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
+echo "$as_me: error: cannot run $ac_config_sub" >&2;}
+ { (exit 1); exit 1; }; }
+
+echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6
+if test "${ac_cv_build+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_build_alias=$build_alias
+test -z "$ac_cv_build_alias" &&
+ ac_cv_build_alias=`$ac_config_guess`
+test -z "$ac_cv_build_alias" &&
+ { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+ { (exit 1); exit 1; }; }
+ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
+ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6
+build=$ac_cv_build
+build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6
+if test "${ac_cv_host+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_host_alias=$host_alias
+test -z "$ac_cv_host_alias" &&
+ ac_cv_host_alias=$ac_cv_build_alias
+ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
+ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6
+host=$ac_cv_host
+host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
+echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6
+if test "${lt_cv_path_SED+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for lt_ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+ lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+ fi
+ done
+ done
+done
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+ test ! -f $lt_ac_sed && continue
+ cat /dev/null > conftest.in
+ lt_ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+ # Check for GNU sed and select it if it is found.
+ if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+ lt_cv_path_SED=$lt_ac_sed
+ break
+ fi
+ while true; do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo >>conftest.nl
+ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+ cmp -s conftest.out conftest.nl || break
+ # 10000 chars as input seems more than enough
+ test $lt_ac_count -gt 10 && break
+ lt_ac_count=`expr $lt_ac_count + 1`
+ if test $lt_ac_count -gt $lt_ac_max; then
+ lt_ac_max=$lt_ac_count
+ lt_cv_path_SED=$lt_ac_sed
+ fi
+ done
+done
+
+fi
+
+SED=$lt_cv_path_SED
+echo "$as_me:$LINENO: result: $SED" >&5
+echo "${ECHO_T}$SED" >&6
+
+echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+ then ac_cv_prog_egrep='grep -E'
+ else ac_cv_prog_egrep='egrep'
+ fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
+
+
+
+# Check whether --with-gnu-ld or --without-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+ withval="$with_gnu_ld"
+ test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi;
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [\\/]* | ?:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
+else
+ echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+ { (exit 1); exit 1; }; }
+echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
+echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6
+if test "${lt_cv_ld_reload_flag+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_ld_reload_flag='-r'
+fi
+echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
+echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+ darwin*)
+ if test "$GCC" = yes; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
+esac
+
+echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
+echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6
+if test "${lt_cv_path_NM+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$NM"; then
+ # Let the user override the test.
+ lt_cv_path_NM="$NM"
+else
+ lt_nm_to_check="${ac_tool_prefix}nm"
+ if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+ lt_nm_to_check="$lt_nm_to_check nm"
+ fi
+ for lt_tmp_nm in $lt_nm_to_check; do
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ tmp_nm="$ac_dir/$lt_tmp_nm"
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ # Check to see if the nm accepts a BSD-compat flag.
+ # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # nm: unknown option "B" ignored
+ # Tru64's nm complains that /dev/null is an invalid object file
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
+ break
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ continue # so that we can try to find one that supports BSD flags
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+ done
+ test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi
+fi
+echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
+echo "${ECHO_T}$lt_cv_path_NM" >&6
+NM="$lt_cv_path_NM"
+
+echo "$as_me:$LINENO: checking whether ln -s works" >&5
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+ echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+echo "${ECHO_T}no, using $LN_S" >&6
+fi
+
+echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5
+echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6
+if test "${lt_cv_deplibs_check_method+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix4* | aix5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+beos*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+bsdi[45]*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+ lt_cv_file_magic_cmd='/usr/bin/file -L'
+ lt_cv_file_magic_test_file=/shlib/libc.so
+ ;;
+
+cygwin*)
+ # func_win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='func_win32_libid'
+ ;;
+
+mingw* | pw32*)
+ # Base MSYS/MinGW do not provide the 'file' command needed by
+ # func_win32_libid shell function, so use a weaker test based on 'objdump'.
+ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+ lt_cv_file_magic_cmd='$OBJDUMP -f'
+ ;;
+
+darwin* | rhapsody*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+freebsd* | kfreebsd*-gnu | dragonfly*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ case $host_cpu in
+ i*86 )
+ # Not sure whether the presence of OpenBSD here was a mistake.
+ # Let's accept both of them until this is cleared up.
+ lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ ;;
+ esac
+ else
+ lt_cv_deplibs_check_method=pass_all
+ fi
+ ;;
+
+gnu*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+hpux10.20* | hpux11*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ case $host_cpu in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
+ lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ ;;
+ esac
+ ;;
+
+interix3*)
+ # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $LD in
+ *-32|*"-32 ") libmagic=32-bit;;
+ *-n32|*"-n32 ") libmagic=N32;;
+ *-64|*"-64 ") libmagic=64-bit;;
+ *) libmagic=never-match;;
+ esac
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+# This must be Linux ELF.
+linux*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=/usr/lib/libnls.so
+ ;;
+
+nto-qnx*)
+ lt_cv_deplibs_check_method=unknown
+ ;;
+
+openbsd*)
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
+ else
+ lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+ fi
+ ;;
+
+osf3* | osf4* | osf5*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+solaris*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
+sysv4 | sysv4.3*)
+ case $host_vendor in
+ motorola)
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+ ;;
+ ncr)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ pc)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+ esac
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+esac
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
+echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+ enableval="$enable_libtool_lock"
+
+fi;
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '#line 3836 "configure"' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -32"
+ ;;
+ *N32*)
+ LD="${LD-ld} -n32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -64"
+ ;;
+ esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case `/usr/bin/file conftest.o` in
+ *32-bit*)
+ case $host in
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*|powerpc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+*-*-sco3.2v5*)
+ # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+ SAVE_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -belf"
+ echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
+echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6
+if test "${lt_cv_cc_needs_belf+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ lt_cv_cc_needs_belf=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+lt_cv_cc_needs_belf=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
+echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6
+ if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+ CFLAGS="$SAVE_CFLAGS"
+ fi
+ ;;
+sparc*-*solaris*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case `/usr/bin/file conftest.o` in
+ *64-bit*)
+ case $lt_cv_prog_gnu_ld in
+ yes*) LD="${LD-ld} -m elf64_sparc" ;;
+ *) LD="${LD-ld} -64" ;;
+ esac
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+
+
+esac
+
+need_locks="$enable_libtool_lock"
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if test "${ac_cv_prog_CPP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ :
+else
+ { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_header_stdc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then
+ :
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ exit(2);
+ exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+for ac_header in dlfcn.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists. ##
+## ------------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CXX+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CXX"; then
+ ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+ echo "$as_me:$LINENO: result: $CXX" >&5
+echo "${ECHO_T}$CXX" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$CXX" && break
+ done
+fi
+if test -z "$CXX"; then
+ ac_ct_CXX=$CXX
+ for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CXX"; then
+ ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CXX="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
+echo "${ECHO_T}$ac_ct_CXX" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$ac_ct_CXX" && break
+done
+test -n "$ac_ct_CXX" || ac_ct_CXX="g++"
+
+ CXX=$ac_ct_CXX
+fi
+
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+ "checking for C++ compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+ (eval $ac_compiler --version </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+ (eval $ac_compiler -v </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+ (eval $ac_compiler -V </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6
+if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_compiler_gnu=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6
+GXX=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+CXXFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
+echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cxx_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cxx_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cxx_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6
+if test "$ac_test_CXXFLAGS" = set; then
+ CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+ if test "$GXX" = yes; then
+ CXXFLAGS="-g -O2"
+ else
+ CXXFLAGS="-g"
+ fi
+else
+ if test "$GXX" = yes; then
+ CXXFLAGS="-O2"
+ else
+ CXXFLAGS=
+ fi
+fi
+for ac_declaration in \
+ '' \
+ 'extern "C" void std::exit (int) throw (); using std::exit;' \
+ 'extern "C" void std::exit (int); using std::exit;' \
+ 'extern "C" void exit (int) throw ();' \
+ 'extern "C" void exit (int);' \
+ 'void exit (int);'
+do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+#include <stdlib.h>
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+ echo '#ifdef __cplusplus' >>confdefs.h
+ echo $ac_declaration >>confdefs.h
+ echo '#endif' >>confdefs.h
+fi
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+depcc="$CXX" am_compiler_list=
+
+echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CXX_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CXX_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CXX_dependencies_compiler_type=none
+fi
+
+fi
+echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+
+
+
+if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+ am__fastdepCXX_TRUE=
+ am__fastdepCXX_FALSE='#'
+else
+ am__fastdepCXX_TRUE='#'
+ am__fastdepCXX_FALSE=
+fi
+
+
+
+
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+ (test "X$CXX" != "Xg++"))) ; then
+ ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
+echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6
+if test -z "$CXXCPP"; then
+ if test "${ac_cv_prog_CXXCPP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # Double quotes because CXXCPP needs to be expanded
+ for CXXCPP in "$CXX -E" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_cxx_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_cxx_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ break
+fi
+
+ done
+ ac_cv_prog_CXXCPP=$CXXCPP
+
+fi
+ CXXCPP=$ac_cv_prog_CXXCPP
+else
+ ac_cv_prog_CXXCPP=$CXXCPP
+fi
+echo "$as_me:$LINENO: result: $CXXCPP" >&5
+echo "${ECHO_T}$CXXCPP" >&6
+ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_cxx_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_cxx_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ :
+else
+ { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+fi
+
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_F77+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$F77"; then
+ ac_cv_prog_F77="$F77" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+F77=$ac_cv_prog_F77
+if test -n "$F77"; then
+ echo "$as_me:$LINENO: result: $F77" >&5
+echo "${ECHO_T}$F77" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$F77" && break
+ done
+fi
+if test -z "$F77"; then
+ ac_ct_F77=$F77
+ for ac_prog in g77 f77 xlf frt pgf77 fort77 fl32 af77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 ifc efc pgf95 lf95 gfortran
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_F77"; then
+ ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_F77="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_F77=$ac_cv_prog_ac_ct_F77
+if test -n "$ac_ct_F77"; then
+ echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
+echo "${ECHO_T}$ac_ct_F77" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$ac_ct_F77" && break
+done
+
+ F77=$ac_ct_F77
+fi
+
+
+# Provide some information about the compiler.
+echo "$as_me:5435:" \
+ "checking for Fortran 77 compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+ (eval $ac_compiler --version </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+ (eval $ac_compiler -v </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+ (eval $ac_compiler -V </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+rm -f a.out
+
+# If we don't use `.F' as extension, the preprocessor is not run on the
+# input file. (Note that this only needs to work for GNU compilers.)
+ac_save_ext=$ac_ext
+ac_ext=F
+echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6
+if test "${ac_cv_f77_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+ program main
+#ifndef __GNUC__
+ choke me
+#endif
+
+ end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_f77_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_compiler_gnu=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_f77_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6
+ac_ext=$ac_save_ext
+ac_test_FFLAGS=${FFLAGS+set}
+ac_save_FFLAGS=$FFLAGS
+FFLAGS=
+echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
+echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_f77_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ FFLAGS=-g
+cat >conftest.$ac_ext <<_ACEOF
+ program main
+
+ end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_f77_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_f77_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_f77_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
+echo "${ECHO_T}$ac_cv_prog_f77_g" >&6
+if test "$ac_test_FFLAGS" = set; then
+ FFLAGS=$ac_save_FFLAGS
+elif test $ac_cv_prog_f77_g = yes; then
+ if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+ FFLAGS="-g -O2"
+ else
+ FFLAGS="-g"
+ fi
+else
+ if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+ FFLAGS="-O2"
+ else
+ FFLAGS=
+ fi
+fi
+
+G77=`test $ac_compiler_gnu = yes && echo yes`
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+
+# find the maximum length of command line arguments
+echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
+echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6
+if test "${lt_cv_sys_max_cmd_len+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ i=0
+ teststring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ amigaos*)
+ # On AmigaOS with pdksh, this test takes hours, literally.
+ # So we just punt and use a minimum line length of 8192.
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ # This has been around since 386BSD, at least. Likely further.
+ if test -x /sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+ elif test -x /usr/sbin/sysctl; then
+ lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+ else
+ lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs
+ fi
+ # And add a safety zone
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+ ;;
+
+ interix*)
+ # We know the value 262144 and hardcode it with a safety zone (like BSD)
+ lt_cv_sys_max_cmd_len=196608
+ ;;
+
+ osf*)
+ # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+ # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+ # nice to cause kernel panics so lets avoid the loop below.
+ # First set a reasonable default.
+ lt_cv_sys_max_cmd_len=16384
+ #
+ if test -x /sbin/sysconfig; then
+ case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+ *1*) lt_cv_sys_max_cmd_len=-1 ;;
+ esac
+ fi
+ ;;
+ sco3.2v5*)
+ lt_cv_sys_max_cmd_len=102400
+ ;;
+ sysv5* | sco5v6* | sysv4.2uw2*)
+ kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+ if test -n "$kargmax"; then
+ lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'`
+ else
+ lt_cv_sys_max_cmd_len=32768
+ fi
+ ;;
+ *)
+ # If test is not a shell built-in, we'll probably end up computing a
+ # maximum length that is only half of the actual maximum length, but
+ # we can't tell.
+ SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+ while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \
+ = "XX$teststring") >/dev/null 2>&1 &&
+ new_result=`expr "X$teststring" : ".*" 2>&1` &&
+ lt_cv_sys_max_cmd_len=$new_result &&
+ test $i != 17 # 1/2 MB should be enough
+ do
+ i=`expr $i + 1`
+ teststring=$teststring$teststring
+ done
+ teststring=
+ # Add a significant safety factor because C++ compilers can tack on massive
+ # amounts of additional arguments before passing them to the linker.
+ # It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ ;;
+ esac
+
+fi
+
+if test -n $lt_cv_sys_max_cmd_len ; then
+ echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
+echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6
+else
+ echo "$as_me:$LINENO: result: none" >&5
+echo "${ECHO_T}none" >&6
+fi
+
+
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
+echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6
+if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix. What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Transform an extracted symbol line into a proper C declaration
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[BCDT]'
+ ;;
+cygwin* | mingw* | pw32*)
+ symcode='[ABCDGISTW]'
+ ;;
+hpux*) # Its linker distinguishes data from code symbols
+ if test "$host_cpu" = ia64; then
+ symcode='[ABCDEGRST]'
+ fi
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
+ ;;
+linux*)
+ if test "$host_cpu" = ia64; then
+ symcode='[ABCDGIRSTW]'
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
+ fi
+ ;;
+irix* | nonstopux*)
+ symcode='[BCDEGRST]'
+ ;;
+osf*)
+ symcode='[BCDEGQRST]'
+ ;;
+solaris*)
+ symcode='[BDRT]'
+ ;;
+sco3.2v5*)
+ symcode='[DT]'
+ ;;
+sysv4.2uw2*)
+ symcode='[DT]'
+ ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+ symcode='[ABDT]'
+ ;;
+sysv4)
+ symcode='[DFNSTU]'
+ ;;
+esac
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[ABCDGIRSTW]' ;;
+esac
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+ symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+ # Write the raw and C identifiers.
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+
+ # Check to see that the pipe works correctly.
+ pipe_works=no
+
+ rm -f conftest*
+ cat > conftest.$ac_ext <<EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+EOF
+
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5
+ (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if grep ' nm_test_var$' "$nlist" >/dev/null; then
+ if grep ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
+
+ cat <<EOF >> conftest.$ac_ext
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+ const char *name;
+ lt_ptr_t address;
+}
+lt_preloaded_symbols[] =
+{
+EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
+ cat <<\EOF >> conftest.$ac_ext
+ {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_save_LIBS="$LIBS"
+ lt_save_CFLAGS="$CFLAGS"
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+ LIBS="$lt_save_LIBS"
+ CFLAGS="$lt_save_CFLAGS"
+ else
+ echo "cannot find nm_test_func in $nlist" >&5
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&5
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+ fi
+ else
+ echo "$progname: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ fi
+ rm -f conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+
+fi
+
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ echo "$as_me:$LINENO: result: failed" >&5
+echo "${ECHO_T}failed" >&6
+else
+ echo "$as_me:$LINENO: result: ok" >&5
+echo "${ECHO_T}ok" >&6
+fi
+
+echo "$as_me:$LINENO: checking for objdir" >&5
+echo $ECHO_N "checking for objdir... $ECHO_C" >&6
+if test "${lt_cv_objdir+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+fi
+echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
+echo "${ECHO_T}$lt_cv_objdir" >&6
+objdir=$lt_cv_objdir
+
+
+
+
+
+case $host_os in
+aix3*)
+ # AIX sometimes has problems with the GCC collect2 program. For some
+ # reason, if we set the COLLECT_NAMES environment variable, the problems
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e 1s/^X//'
+sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Constants:
+rm="rm -f"
+
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AR+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$AR"; then
+ ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AR="${ac_tool_prefix}ar"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+ echo "$as_me:$LINENO: result: $AR" >&5
+echo "${ECHO_T}$AR" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+ ac_ct_AR=$AR
+ # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_AR"; then
+ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_AR="ar"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false"
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+ echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
+echo "${ECHO_T}$ac_ct_AR" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ AR=$ac_ct_AR
+else
+ AR="$ac_cv_prog_AR"
+fi
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ RANLIB=$ac_ct_RANLIB
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ STRIP=$ac_ct_STRIP
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$SED" && SED=sed
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
+test -z "$ac_objext" && ac_objext=o
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+ ;;
+ *)
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+ echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
+echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case $MAGIC_CMD in
+[\\/*] | ?:[\\/]*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/${ac_tool_prefix}file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+ if test -n "$ac_tool_prefix"; then
+ echo "$as_me:$LINENO: checking for file" >&5
+echo $ECHO_N "checking for file... $ECHO_C" >&6
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case $MAGIC_CMD in
+[\\/*] | ?:[\\/]*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+ for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/file; then
+ lt_cv_path_MAGIC_CMD="$ac_dir/file"
+ if test -n "$file_magic_test_file"; then
+ case $deplibs_check_method in
+ "file_magic "*)
+ file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+ MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+ $EGREP "$file_magic_regex" > /dev/null; then
+ :
+ else
+ cat <<EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such. This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem. Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+EOF
+ fi ;;
+ esac
+ fi
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
+ ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ else
+ MAGIC_CMD=:
+ fi
+fi
+
+ fi
+ ;;
+esac
+
+enable_dlopen=no
+enable_win32_dll=no
+
+# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+ enableval="$enable_libtool_lock"
+
+fi;
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+
+# Check whether --with-pic or --without-pic was given.
+if test "${with_pic+set}" = set; then
+ withval="$with_pic"
+ pic_mode="$withval"
+else
+ pic_mode=default
+fi;
+test -z "$pic_mode" && pic_mode=default
+
+# Use C for the default configuration in the libtool script
+tagname=
+lt_save_CC="$CC"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}\n'
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+
+lt_prog_compiler_no_builtin_flag=
+
+if test "$GCC" = yes; then
+ lt_prog_compiler_no_builtin_flag=' -fno-builtin'
+
+
+echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_prog_compiler_rtti_exceptions=no
+ ac_outfile=conftest.$ac_objext
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="-fno-rtti -fno-exceptions"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:6498: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:6502: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_rtti_exceptions=yes
+ fi
+ fi
+ $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+ lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+ :
+fi
+
+fi
+
+lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+
+ if test "$GCC" = yes; then
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_static='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+ ;;
+
+ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic='-fno-common'
+ ;;
+
+ interix3*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ lt_prog_compiler_can_build_shared=no
+ enable_shared=no
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic=-Kconform_pic
+ fi
+ ;;
+
+ hpux*)
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+ ;;
+
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ lt_prog_compiler_wl='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ else
+ lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ darwin*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ case $cc_basename in
+ xlc*)
+ lt_prog_compiler_pic='-qnocommon'
+ lt_prog_compiler_wl='-Wl,'
+ ;;
+ esac
+ ;;
+
+ mingw* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ lt_prog_compiler_static='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC (with -KPIC) is the default.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ newsos6)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ linux*)
+ case $cc_basename in
+ icc* | ecc*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fpic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ ccc*)
+ lt_prog_compiler_wl='-Wl,'
+ # All Alpha code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+ esac
+ ;;
+
+ osf3* | osf4* | osf5*)
+ lt_prog_compiler_wl='-Wl,'
+ # All OSF/1 code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ solaris*)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95*)
+ lt_prog_compiler_wl='-Qoption ld ';;
+ *)
+ lt_prog_compiler_wl='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ lt_prog_compiler_wl='-Qoption ld '
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ lt_prog_compiler_pic='-Kconform_pic'
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ unicos*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_can_build_shared=no
+ ;;
+
+ uts4*)
+ lt_prog_compiler_pic='-pic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *)
+ lt_prog_compiler_can_build_shared=no
+ ;;
+ esac
+ fi
+
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic" >&6
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+
+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_prog_compiler_pic_works=no
+ ac_outfile=conftest.$ac_objext
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:6766: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:6770: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_prog_compiler_pic_works=yes
+ fi
+ fi
+ $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6
+
+if test x"$lt_prog_compiler_pic_works" = xyes; then
+ case $lt_prog_compiler_pic in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+ esac
+else
+ lt_prog_compiler_pic=
+ lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic=
+ ;;
+ *)
+ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+ ;;
+esac
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
+echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6
+if test "${lt_prog_compiler_static_works+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_prog_compiler_static_works=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ printf "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_prog_compiler_static_works=yes
+ fi
+ else
+ lt_prog_compiler_static_works=yes
+ fi
+ fi
+ $rm conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5
+echo "${ECHO_T}$lt_prog_compiler_static_works" >&6
+
+if test x"$lt_prog_compiler_static_works" = xyes; then
+ :
+else
+ lt_prog_compiler_static=
+fi
+
+
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_prog_compiler_c_o=no
+ $rm -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:6870: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:6874: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $rm conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
+ $rm out/* && rmdir out
+ cd ..
+ rmdir conftest
+ $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+ hard_links=yes
+ $rm conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+ if test "$hard_links" = no; then
+ { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+ runpath_var=
+ allow_undefined_flag=
+ enable_shared_with_static_runtimes=no
+ archive_cmds=
+ archive_expsym_cmds=
+ old_archive_From_new_cmds=
+ old_archive_from_expsyms_cmds=
+ export_dynamic_flag_spec=
+ whole_archive_flag_spec=
+ thread_safe_flag_spec=
+ hardcode_libdir_flag_spec=
+ hardcode_libdir_flag_spec_ld=
+ hardcode_libdir_separator=
+ hardcode_direct=no
+ hardcode_minus_L=no
+ hardcode_shlibpath_var=unsupported
+ link_all_deplibs=unknown
+ hardcode_automatic=no
+ module_cmds=
+ module_expsym_cmds=
+ always_export_symbols=no
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ include_expsyms=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ extract_expsyms_cmds=
+ # Just being paranoid about ensuring that cc_basename is set.
+ for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+ case $host_os in
+ cygwin* | mingw* | pw32*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ ld_shlibs=yes
+ if test "$with_gnu_ld" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
+ export_dynamic_flag_spec='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>/dev/null` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix3* | aix4* | aix5*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs=no
+ cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+ fi
+ ;;
+
+ amigaos*)
+ archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+
+ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+ # that the semantics of dynamic libraries on AmigaOS, at least up
+ # to version 4, is to share data among multiple programs linked
+ # with the same dynamic library. Since this doesn't match the
+ # behavior of shared libraries on other platforms, we can't use
+ # them.
+ ld_shlibs=no
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec='-L$libdir'
+ allow_undefined_flag=unsupported
+ always_export_symbols=no
+ enable_shared_with_static_runtimes=yes
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ interix3*)
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ linux*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ tmp_addflag=
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
+ whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ esac
+ archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test $supports_anon_versioning = yes; then
+ archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ $echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ ld_shlibs=no
+ cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+ esac
+
+ if test "$ld_shlibs" = no; then
+ runpath_var=
+ hardcode_libdir_flag_spec=
+ export_dynamic_flag_spec=
+ whole_archive_flag_spec=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+ archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L=yes
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct=unsupported
+ fi
+ ;;
+
+ aix4* | aix5*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+ export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ archive_cmds=''
+ hardcode_direct=yes
+ hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ hardcode_direct=yes
+ else
+ # We have old collect2
+ hardcode_direct=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L=yes
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_libdir_separator=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ always_export_symbols=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag='-berok'
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag="-z nodefs"
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag=' ${wl}-bernotok'
+ allow_undefined_flag=' ${wl}-berok'
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec='$convenience'
+ archive_cmds_need_lc=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ # see comment about different semantics on the GNU ld section
+ ld_shlibs=no
+ ;;
+
+ bsdi[45]*)
+ export_dynamic_flag_spec=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ old_archive_From_new_cmds='true'
+ # FIXME: Should let the user specify the lib program.
+ old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs'
+ fix_srcfile_path='`cygpath -w "$srcfile"`'
+ enable_shared_with_static_runtimes=yes
+ ;;
+
+ darwin* | rhapsody*)
+ case $host_os in
+ rhapsody* | darwin1.[012])
+ allow_undefined_flag='${wl}-undefined ${wl}suppress'
+ ;;
+ *) # Darwin 1.3 on
+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+ allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+ else
+ case ${MACOSX_DEPLOYMENT_TARGET} in
+ 10.[012])
+ allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+ ;;
+ 10.*)
+ allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ archive_cmds_need_lc=no
+ hardcode_direct=no
+ hardcode_automatic=yes
+ hardcode_shlibpath_var=unsupported
+ whole_archive_flag_spec=''
+ link_all_deplibs=yes
+ if test "$GCC" = yes ; then
+ output_verbose_link_cmd='echo'
+ archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+ archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ else
+ case $cc_basename in
+ xlc*)
+ output_verbose_link_cmd='echo'
+ archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+ module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+ archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ ;;
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+ fi
+ ;;
+
+ dgux*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ freebsd1*)
+ ld_shlibs=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | kfreebsd*-gnu | dragonfly*)
+ archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ export_dynamic_flag_spec='${wl}-E'
+ ;;
+
+ hpux10*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+
+ hardcode_direct=yes
+ export_dynamic_flag_spec='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_libdir_flag_spec_ld='+b $libdir'
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+ ;;
+ *)
+ hardcode_direct=yes
+ export_dynamic_flag_spec='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec_ld='-rpath $libdir'
+ fi
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ link_all_deplibs=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ newsos6)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_shlibpath_var=no
+ ;;
+
+ openbsd*)
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec='${wl}-E'
+ else
+ case $host_os in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ *)
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ ;;
+
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ allow_undefined_flag=unsupported
+ archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+ hardcode_libdir_separator=:
+ ;;
+
+ solaris*)
+ no_undefined_flag=' -z text'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+ else
+ wlarc=''
+ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+ fi
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_shlibpath_var=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The compiler driver will combine linker options so we
+ # cannot just pass the convience library names through
+ # without $wl, iff we do not link with $LD.
+ # Luckily, gcc supports the same syntax we need for Sun Studio.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ case $wlarc in
+ '')
+ whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;;
+ *)
+ whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+ esac ;;
+ esac
+ link_all_deplibs=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ reload_cmds='$CC -r -o $output$reload_objs'
+ hardcode_direct=no
+ ;;
+ motorola)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4.3*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ export_dynamic_flag_spec='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ld_shlibs=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
+ no_undefined_flag='${wl}-z,text'
+ archive_cmds_need_lc=no
+ hardcode_shlibpath_var=no
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ no_undefined_flag='${wl}-z,text'
+ allow_undefined_flag='${wl}-z,nodefs'
+ archive_cmds_need_lc=no
+ hardcode_shlibpath_var=no
+ hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+ hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+ export_dynamic_flag_spec='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+ fi
+
+echo "$as_me:$LINENO: result: $ld_shlibs" >&5
+echo "${ECHO_T}$ld_shlibs" >&6
+test "$ld_shlibs" = no && can_build_shared=no
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+ $rm conftest*
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl
+ pic_flag=$lt_prog_compiler_pic
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag
+ allow_undefined_flag=
+ if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+ (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ then
+ archive_cmds_need_lc=no
+ else
+ archive_cmds_need_lc=yes
+ fi
+ allow_undefined_flag=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $rm conftest*
+ echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
+echo "${ECHO_T}$archive_cmds_need_lc" >&6
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix4* | aix5*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[45]*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$host_os in
+ yes,cygwin* | yes,mingw* | yes,pw32*)
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $rm \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+ ;;
+ mingw*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ ;;
+
+ *)
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+ # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+ if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+ else
+ sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+ fi
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+kfreebsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='GNU ld.so'
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[123]*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ freebsd*) # from 4.6 on
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+interix3*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+knetbsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='GNU ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+nto-qnx*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ shlibpath_overrides_runpath=no
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ shlibpath_overrides_runpath=yes
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" || \
+ test -n "$runpath_var" || \
+ test "X$hardcode_automatic" = "Xyes" ; then
+
+ # We can hardcode non-existant directories.
+ if test "$hardcode_direct" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no &&
+ test "$hardcode_minus_L" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action=unsupported
+fi
+echo "$as_me:$LINENO: result: $hardcode_action" >&5
+echo "${ECHO_T}$hardcode_action" >&6
+
+if test "$hardcode_action" = relink; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+striplib=
+old_striplib=
+echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+ ;;
+ *)
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ ;;
+ esac
+fi
+
+if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dl_dlopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+
+fi
+
+ ;;
+
+ *)
+ echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
+if test "${ac_cv_func_shl_load+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define shl_load to an innocuous variant, in case <limits.h> declares shl_load.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define shl_load innocuous_shl_load
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char shl_load (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shl_load
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char shl_load ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_shl_load) || defined (__stub___shl_load)
+choke me
+#else
+char (*f) () = shl_load;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != shl_load;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_shl_load=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6
+if test $ac_cv_func_shl_load = yes; then
+ lt_cv_dlopen="shl_load"
+else
+ echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char shl_load ();
+int
+main ()
+{
+shl_load ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dld_shl_load=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_shl_load=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
+if test $ac_cv_lib_dld_shl_load = yes; then
+ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+ echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
+if test "${ac_cv_func_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define dlopen innocuous_dlopen
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char dlopen (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef dlopen
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_dlopen) || defined (__stub___dlopen)
+choke me
+#else
+char (*f) () = dlopen;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != dlopen;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_dlopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6
+if test $ac_cv_func_dlopen = yes; then
+ lt_cv_dlopen="dlopen"
+else
+ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dl_dlopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+ echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_svld_dlopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_svld_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
+if test $ac_cv_lib_svld_dlopen = yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+ echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dld_link ();
+int
+main ()
+{
+dld_link ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dld_dld_link=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_dld_link=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
+if test $ac_cv_lib_dld_dld_link = yes; then
+ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<EOF
+#line 9215 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ exit (status);
+}
+EOF
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&5 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+ echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self_static=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<EOF
+#line 9315 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+ else
+ puts (dlerror ());
+
+ exit (status);
+}
+EOF
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) >&5 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self_static=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ case $lt_cv_dlopen_self in
+ yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+ *) enable_dlopen_self=unknown ;;
+ esac
+
+ case $lt_cv_dlopen_self_static in
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+
+
+# Report which library types will actually be built
+echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $can_build_shared" >&5
+echo "${ECHO_T}$can_build_shared" >&6
+
+echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case $host_os in
+aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+aix4* | aix5*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+esac
+echo "$as_me:$LINENO: result: $enable_shared" >&5
+echo "${ECHO_T}$enable_shared" >&6
+
+echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+echo "$as_me:$LINENO: result: $enable_static" >&5
+echo "${ECHO_T}$enable_static" >&6
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+ # See if we are running on zsh, and set the options which allow our commands through
+ # without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+ # Now quote all the things that may contain metacharacters while being
+ # careful not to overquote the AC_SUBSTed values. We take copies of the
+ # variables and quote the copies for generation of the libtool script.
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
+ SED SHELL STRIP \
+ libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+ old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+ deplibs_check_method reload_flag reload_cmds need_locks \
+ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+ old_postinstall_cmds old_postuninstall_cmds \
+ compiler \
+ CC \
+ LD \
+ lt_prog_compiler_wl \
+ lt_prog_compiler_pic \
+ lt_prog_compiler_static \
+ lt_prog_compiler_no_builtin_flag \
+ export_dynamic_flag_spec \
+ thread_safe_flag_spec \
+ whole_archive_flag_spec \
+ enable_shared_with_static_runtimes \
+ old_archive_cmds \
+ old_archive_from_new_cmds \
+ predep_objects \
+ postdep_objects \
+ predeps \
+ postdeps \
+ compiler_lib_search_path \
+ archive_cmds \
+ archive_expsym_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ old_archive_from_expsyms_cmds \
+ allow_undefined_flag \
+ no_undefined_flag \
+ export_symbols_cmds \
+ hardcode_libdir_flag_spec \
+ hardcode_libdir_flag_spec_ld \
+ hardcode_libdir_separator \
+ hardcode_automatic \
+ module_cmds \
+ module_expsym_cmds \
+ lt_cv_prog_compiler_c_o \
+ exclude_expsyms \
+ include_expsyms; do
+
+ case $var in
+ old_archive_cmds | \
+ old_archive_from_new_cmds | \
+ archive_cmds | \
+ archive_expsym_cmds | \
+ module_cmds | \
+ module_expsym_cmds | \
+ old_archive_from_expsyms_cmds | \
+ export_symbols_cmds | \
+ extract_expsyms_cmds | reload_cmds | finish_cmds | \
+ postinstall_cmds | postuninstall_cmds | \
+ old_postinstall_cmds | old_postuninstall_cmds | \
+ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+ # Double-quote double-evaled strings.
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+ ;;
+ *)
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+ ;;
+ esac
+ done
+
+ case $lt_echo in
+ *'\$0 --fallback-echo"')
+ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+ ;;
+ esac
+
+cfgfile="${ofile}T"
+ trap "$rm \"$cfgfile\"; exit 1" 1 2 15
+ $rm -f "$cfgfile"
+ { echo "$as_me:$LINENO: creating $ofile" >&5
+echo "$as_me: creating $ofile" >&6;}
+
+ cat <<__EOF__ >> "$cfgfile"
+#! $SHELL
+
+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool:
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="$SED -e 1s/^X//"
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# The names of the tagged configurations supported by this script.
+available_tags=
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
+# A language-specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# ### END LIBTOOL CONFIG
+
+__EOF__
+
+
+ case $host_os in
+ aix3*)
+ cat <<\EOF >> "$cfgfile"
+
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
+EOF
+ ;;
+ esac
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
+
+ mv -f "$cfgfile" "$ofile" || \
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+
+else
+ # If there is no Makefile yet, we rely on a make rule to execute
+ # `config.status --recheck' to rerun these tests and create the
+ # libtool script then.
+ ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+ if test -f "$ltmain_in"; then
+ test -f Makefile && make "$ltmain"
+ fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+
+# Check whether --with-tags or --without-tags was given.
+if test "${with_tags+set}" = set; then
+ withval="$with_tags"
+ tagnames="$withval"
+fi;
+
+if test -f "$ltmain" && test -n "$tagnames"; then
+ if test ! -f "${ofile}"; then
+ { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5
+echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;}
+ fi
+
+ if test -z "$LTCC"; then
+ eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
+ if test -z "$LTCC"; then
+ { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5
+echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;}
+ else
+ { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5
+echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;}
+ fi
+ fi
+ if test -z "$LTCFLAGS"; then
+ eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`"
+ fi
+
+ # Extract list of available tagged configurations in $ofile.
+ # Note that this assumes the entire list is on one line.
+ available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
+
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for tagname in $tagnames; do
+ IFS="$lt_save_ifs"
+ # Check whether tagname contains only valid characters
+ case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in
+ "") ;;
+ *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5
+echo "$as_me: error: invalid tag name: $tagname" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+ esac
+
+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
+ then
+ { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5
+echo "$as_me: error: tag name \"$tagname\" already exists" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+ # Update the list of available tags.
+ if test -n "$tagname"; then
+ echo appending configuration tag \"$tagname\" to $ofile
+
+ case $tagname in
+ CXX)
+ if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+ ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+ (test "X$CXX" != "Xg++"))) ; then
+ ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+
+archive_cmds_need_lc_CXX=no
+allow_undefined_flag_CXX=
+always_export_symbols_CXX=no
+archive_expsym_cmds_CXX=
+export_dynamic_flag_spec_CXX=
+hardcode_direct_CXX=no
+hardcode_libdir_flag_spec_CXX=
+hardcode_libdir_flag_spec_ld_CXX=
+hardcode_libdir_separator_CXX=
+hardcode_minus_L_CXX=no
+hardcode_shlibpath_var_CXX=unsupported
+hardcode_automatic_CXX=no
+module_cmds_CXX=
+module_expsym_cmds_CXX=
+link_all_deplibs_CXX=unknown
+old_archive_cmds_CXX=$old_archive_cmds
+no_undefined_flag_CXX=
+whole_archive_flag_spec_CXX=
+enable_shared_with_static_runtimes_CXX=no
+
+# Dependencies to place before and after the object being linked:
+predep_objects_CXX=
+postdep_objects_CXX=
+predeps_CXX=
+postdeps_CXX=
+compiler_lib_search_path_CXX=
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+objext_CXX=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_LD=$LD
+lt_save_GCC=$GCC
+GCC=$GXX
+lt_save_with_gnu_ld=$with_gnu_ld
+lt_save_path_LD=$lt_cv_path_LD
+if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+else
+ $as_unset lt_cv_prog_gnu_ld
+fi
+if test -n "${lt_cv_path_LDCXX+set}"; then
+ lt_cv_path_LD=$lt_cv_path_LDCXX
+else
+ $as_unset lt_cv_path_LD
+fi
+test -z "${LDCXX+set}" || LD=$LDCXX
+CC=${CXX-"c++"}
+compiler=$CC
+compiler_CXX=$CC
+for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+
+# We don't want -fno-exception wen compiling C++ code, so set the
+# no_builtin_flag separately
+if test "$GXX" = yes; then
+ lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
+else
+ lt_prog_compiler_no_builtin_flag_CXX=
+fi
+
+if test "$GXX" = yes; then
+ # Set up default GNU C++ configuration
+
+
+# Check whether --with-gnu-ld or --without-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+ withval="$with_gnu_ld"
+ test "$withval" = no || with_gnu_ld=yes
+else
+ with_gnu_ld=no
+fi;
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6
+ case $host in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+ *)
+ ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+ esac
+ case $ac_prog in
+ # Accept absolute paths.
+ [\\/]* | ?:[\\/]*)
+ re_direlt='/[^/][^/]*/\.\./'
+ # Canonicalize the pathname of ld
+ ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ test -z "$LD" && LD="$ac_prog"
+ ;;
+ "")
+ # If it fails, then pretend we aren't using GCC.
+ ac_prog=ld
+ ;;
+ *)
+ # If it is relative, then search for the first ld in PATH.
+ with_gnu_ld=unknown
+ ;;
+ esac
+elif test "$with_gnu_ld" = yes; then
+ echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
+else
+ echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+ lt_cv_path_LD="$ac_dir/$ac_prog"
+ # Check to see if the program is GNU ld. I'd rather use --version,
+ # but apparently some variants of GNU ld only accept -v.
+ # Break only if it was the GNU/non-GNU ld that we prefer.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
+ fi
+ done
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+ { (exit 1); exit 1; }; }
+echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+ # Check if GNU C++ uses GNU ld as the underlying linker, since the
+ # archiving commands below assume that GNU ld is being used.
+ if test "$with_gnu_ld" = yes; then
+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+ # investigate it a little bit more. (MM)
+ wlarc='${wl}'
+
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
+ grep 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec_CXX=
+ fi
+ else
+ with_gnu_ld=no
+ wlarc=
+
+ # A generic and very simple default shared library creation
+ # command for GNU C++ for the case where it uses the native
+ # linker, instead of GNU ld. If possible, this setting should
+ # overridden to take advantage of the native linker features on
+ # the platform it is being used on.
+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ fi
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+else
+ GXX=no
+ with_gnu_ld=no
+ wlarc=
+fi
+
+# PORTME: fill in a description of your system's C++ link characteristics
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+ld_shlibs_CXX=yes
+case $host_os in
+ aix3*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ aix4* | aix5*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+ for ld_flag in $LDFLAGS; do
+ case $ld_flag in
+ *-brtl*)
+ aix_use_runtimelinking=yes
+ break
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ archive_cmds_CXX=''
+ hardcode_direct_CXX=yes
+ hardcode_libdir_separator_CXX=':'
+ link_all_deplibs_CXX=yes
+
+ if test "$GXX" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ hardcode_direct_CXX=yes
+ else
+ # We have old collect2
+ hardcode_direct_CXX=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L_CXX=yes
+ hardcode_libdir_flag_spec_CXX='-L$libdir'
+ hardcode_libdir_separator_CXX=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ always_export_symbols_CXX=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag_CXX='-berok'
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+ archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag_CXX="-z nodefs"
+ archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag_CXX=' ${wl}-bernotok'
+ allow_undefined_flag_CXX=' ${wl}-berok'
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec_CXX='$convenience'
+ archive_cmds_need_lc_CXX=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag_CXX=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ ld_shlibs_CXX=no
+ fi
+ ;;
+
+ chorus*)
+ case $cc_basename in
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec_CXX='-L$libdir'
+ allow_undefined_flag_CXX=unsupported
+ always_export_symbols_CXX=no
+ enable_shared_with_static_runtimes_CXX=yes
+
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ darwin* | rhapsody*)
+ case $host_os in
+ rhapsody* | darwin1.[012])
+ allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress'
+ ;;
+ *) # Darwin 1.3 on
+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+ allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+ else
+ case ${MACOSX_DEPLOYMENT_TARGET} in
+ 10.[012])
+ allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+ ;;
+ 10.*)
+ allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ archive_cmds_need_lc_CXX=no
+ hardcode_direct_CXX=no
+ hardcode_automatic_CXX=yes
+ hardcode_shlibpath_var_CXX=unsupported
+ whole_archive_flag_spec_CXX=''
+ link_all_deplibs_CXX=yes
+
+ if test "$GXX" = yes ; then
+ lt_int_apple_cc_single_mod=no
+ output_verbose_link_cmd='echo'
+ if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
+ lt_int_apple_cc_single_mod=yes
+ fi
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ else
+ archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ fi
+ module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ else
+ archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ else
+ case $cc_basename in
+ xlc*)
+ output_verbose_link_cmd='echo'
+ archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+ module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+ archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ ;;
+ *)
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ fi
+ ;;
+
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+ freebsd[12]*)
+ # C++ shared libraries reported to be fairly broken before switch to ELF
+ ld_shlibs_CXX=no
+ ;;
+ freebsd-elf*)
+ archive_cmds_need_lc_CXX=no
+ ;;
+ freebsd* | kfreebsd*-gnu | dragonfly*)
+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+ # conventions
+ ld_shlibs_CXX=yes
+ ;;
+ gnu*)
+ ;;
+ hpux9*)
+ hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ hardcode_direct_CXX=yes
+ hardcode_minus_L_CXX=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ aCC*)
+ archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+ hpux10*|hpux11*)
+ if test $with_gnu_ld = no; then
+ hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_libdir_flag_spec_ld_CXX='+b $libdir'
+ ;;
+ *)
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ ;;
+ esac
+ fi
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_direct_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ ;;
+ *)
+ hardcode_direct_CXX=yes
+ hardcode_minus_L_CXX=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ esac
+
+ case $cc_basename in
+ CC*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ aCC*)
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test $with_gnu_ld = no; then
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ fi
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+ interix3*)
+ hardcode_direct_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+ irix5* | irix6*)
+ case $cc_basename in
+ CC*)
+ # SGI C++
+ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+
+ # Archives containing C++ object files must be created using
+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test "$with_gnu_ld" = no; then
+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+ fi
+ fi
+ link_all_deplibs_CXX=yes
+ ;;
+ esac
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+ ;;
+ linux*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+ archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+ hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
+ icpc*)
+ # Intel C++
+ with_gnu_ld=yes
+ # version 8.0 and above of icpc choke on multiply defined symbols
+ # if we add $predep_objects and $postdep_objects, however 7.1 and
+ # earlier do not add the objects themselves.
+ case `$CC -V 2>&1` in
+ *"Version 7."*)
+ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ *) # Version 8.0 or newer
+ tmp_idyn=
+ case $host_cpu in
+ ia64*) tmp_idyn=' -i_dynamic';;
+ esac
+ archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ ;;
+ esac
+ archive_cmds_need_lc_CXX=no
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+ whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ ;;
+ pgCC*)
+ # Portland Group C++ compiler
+ archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+ whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ ;;
+ cxx*)
+ # Compaq C++
+ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ esac
+ ;;
+ lynxos*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ m88k*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+ hardcode_libdir_flag_spec_CXX='-R$libdir'
+ hardcode_direct_CXX=yes
+ hardcode_shlibpath_var_CXX=no
+ fi
+ # Workaround some broken pre-1.5 toolchains
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+ ;;
+ openbsd2*)
+ # C++ shared libraries are fairly broken
+ ld_shlibs_CXX=no
+ ;;
+ openbsd*)
+ hardcode_direct_CXX=yes
+ hardcode_shlibpath_var_CXX=no
+ archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ fi
+ output_verbose_link_cmd='echo'
+ ;;
+ osf3*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ cxx*)
+ allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+ osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Archives containing C++ object files must be created using
+ # the KAI C++ compiler.
+ old_archive_cmds_CXX='$CC -o $oldlib $oldobjs'
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ cxx*)
+ allow_undefined_flag_CXX=' -expect_unresolved \*'
+ archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+ echo "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~
+ $rm $lib.exp'
+
+ hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # explicitly linking system object files so we need to strip them
+ # from the output so that they don't get included in the library
+ # dependencies.
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+ psos*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ lcc*)
+ # Lucid
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ archive_cmds_need_lc_CXX=yes
+ no_undefined_flag_CXX=' -zdefs'
+ archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+ hardcode_libdir_flag_spec_CXX='-R$libdir'
+ hardcode_shlibpath_var_CXX=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The C++ compiler is used as linker so we must use $wl
+ # flag to pass the commands to the underlying system
+ # linker. We must also pass each convience library through
+ # to the system linker between allextract/defaultextract.
+ # The C++ compiler will combine linker options so we
+ # cannot just pass the convience library names through
+ # without $wl.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
+ link_all_deplibs_CXX=yes
+
+ output_verbose_link_cmd='echo'
+
+ # Archives containing C++ object files must be created using
+ # "CC -xar", where "CC" is the Sun C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+ # The C++ compiler must be used to create the archive.
+ old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+ ;;
+ *)
+ # GNU C++ compiler with Solaris linker
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
+ if $CC --version | grep -v '^2\.7' > /dev/null; then
+ archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+ else
+ # g++ 2.7 appears to require `-G' NOT `-shared' on this
+ # platform.
+ archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+ fi
+
+ hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
+ fi
+ ;;
+ esac
+ ;;
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+ no_undefined_flag_CXX='${wl}-z,text'
+ archive_cmds_need_lc_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ # For security reasons, it is highly recommended that you always
+ # use absolute paths for naming shared libraries, and exclude the
+ # DT_RUNPATH tag from executables and libraries. But doing so
+ # requires that you compile everything twice, which is a pain.
+ # So that behaviour is only enabled if SCOABSPATH is set to a
+ # non-empty value in the environment. Most likely only useful for
+ # creating official distributions of packages.
+ # This is a hack until libtool officially supports absolute path
+ # names for shared libraries.
+ no_undefined_flag_CXX='${wl}-z,text'
+ allow_undefined_flag_CXX='${wl}-z,nodefs'
+ archive_cmds_need_lc_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+ hardcode_libdir_separator_CXX=':'
+ link_all_deplibs_CXX=yes
+ export_dynamic_flag_spec_CXX='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ case $cc_basename in
+ CC*)
+ archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+ vxworks*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+esac
+echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6
+test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+GCC_CXX="$GXX"
+LD_CXX="$LD"
+
+
+cat > conftest.$ac_ext <<EOF
+class Foo
+{
+public:
+ Foo (void) { a = 0; }
+private:
+ int a;
+};
+EOF
+
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ # The `*' in the case matches for architectures that use `case' in
+ # $output_verbose_cmd can trigger glob expansion during the loop
+ # eval without this substitution.
+ output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
+
+ for p in `eval $output_verbose_link_cmd`; do
+ case $p in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test $p = "-L" \
+ || test $p = "-R"; then
+ prev=$p
+ continue
+ else
+ prev=
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ case $p in
+ -L* | -R*)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$compiler_lib_search_path_CXX"; then
+ compiler_lib_search_path_CXX="${prev}${p}"
+ else
+ compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$postdeps_CXX"; then
+ postdeps_CXX="${prev}${p}"
+ else
+ postdeps_CXX="${postdeps_CXX} ${prev}${p}"
+ fi
+ fi
+ ;;
+
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ if test -z "$predep_objects_CXX"; then
+ predep_objects_CXX="$p"
+ else
+ predep_objects_CXX="$predep_objects_CXX $p"
+ fi
+ else
+ if test -z "$postdep_objects_CXX"; then
+ postdep_objects_CXX="$p"
+ else
+ postdep_objects_CXX="$postdep_objects_CXX $p"
+ fi
+ fi
+ ;;
+
+ *) ;; # Ignore the rest.
+
+ esac
+ done
+
+ # Clean up.
+ rm -f a.out a.exe
+else
+ echo "libtool.m4: error: problem compiling CXX test program"
+fi
+
+$rm -f confest.$objext
+
+# PORTME: override above test on systems where it is broken
+case $host_os in
+interix3*)
+ # Interix 3.5 installs completely hosed .la files for C++, so rather than
+ # hack all around it, let's just trust "g++" to DTRT.
+ predep_objects_CXX=
+ postdep_objects_CXX=
+ postdeps_CXX=
+ ;;
+
+solaris*)
+ case $cc_basename in
+ CC*)
+ # Adding this requires a known-good setup of shared libraries for
+ # Sun compiler versions before 5.6, else PIC objects from an old
+ # archive will be linked into the output, leading to subtle bugs.
+ postdeps_CXX='-lCstd -lCrun'
+ ;;
+ esac
+ ;;
+esac
+
+
+case " $postdeps_CXX " in
+*" -lc "*) archive_cmds_need_lc_CXX=no ;;
+esac
+
+lt_prog_compiler_wl_CXX=
+lt_prog_compiler_pic_CXX=
+lt_prog_compiler_static_CXX=
+
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+
+ # C++ specific cases for pic, static, wl, etc.
+ if test "$GXX" = yes; then
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_CXX='-Bstatic'
+ fi
+ ;;
+ amigaos*)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | os2* | pw32*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic_CXX='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ lt_prog_compiler_pic_CXX=
+ ;;
+ interix3*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic_CXX=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ esac
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ esac
+ else
+ case $host_os in
+ aix4* | aix5*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_CXX='-Bstatic'
+ else
+ lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ cxch68*)
+ # Green Hills C++ Compiler
+ # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+ ;;
+ esac
+ ;;
+ darwin*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ case $cc_basename in
+ xlc*)
+ lt_prog_compiler_pic_CXX='-qnocommon'
+ lt_prog_compiler_wl_CXX='-Wl,'
+ ;;
+ esac
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++*)
+ lt_prog_compiler_pic_CXX='-KPIC'
+ ;;
+ ghcx*)
+ # Green Hills C++ Compiler
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd* | kfreebsd*-gnu | dragonfly*)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
+ if test "$host_cpu" != ia64; then
+ lt_prog_compiler_pic_CXX='+Z'
+ fi
+ ;;
+ aCC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX='+Z'
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ interix*)
+ # This is c89, which is MS Visual C++ (no shared libs)
+ # Anyone wants to do a port?
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case $cc_basename in
+ CC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux*)
+ case $cc_basename in
+ KCC*)
+ # KAI C++ Compiler
+ lt_prog_compiler_wl_CXX='--backend -Wl,'
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ icpc* | ecpc*)
+ # Intel C++
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-static'
+ ;;
+ pgCC*)
+ # Portland Group C++ compiler.
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-fpic'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ ;;
+ cxx*)
+ # Compaq C++
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_static_CXX='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx*)
+ lt_prog_compiler_pic_CXX='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd*)
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC*)
+ lt_prog_compiler_wl_CXX='--backend -Wl,'
+ ;;
+ RCC*)
+ # Rational C++ 2.4.1
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ cxx*)
+ # Digital/Compaq C++
+ lt_prog_compiler_wl_CXX='-Wl,'
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_static_CXX='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ psos*)
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ lt_prog_compiler_wl_CXX='-Qoption ld '
+ ;;
+ gcx*)
+ # Green Hills C++ Compiler
+ lt_prog_compiler_pic_CXX='-PIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC*)
+ # Sun C++ 4.x
+ lt_prog_compiler_pic_CXX='-pic'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ ;;
+ lcc*)
+ # Lucid
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC*)
+ # NonStop-UX NCC 3.20
+ lt_prog_compiler_pic_CXX='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ case $cc_basename in
+ CC*)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ ;;
+ esac
+ ;;
+ vxworks*)
+ ;;
+ *)
+ lt_prog_compiler_can_build_shared_CXX=no
+ ;;
+ esac
+ fi
+
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_CXX"; then
+
+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_prog_compiler_pic_works_CXX=no
+ ac_outfile=conftest.$ac_objext
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:11655: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:11659: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_prog_compiler_pic_works_CXX=yes
+ fi
+ fi
+ $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6
+
+if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then
+ case $lt_prog_compiler_pic_CXX in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
+ esac
+else
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_can_build_shared_CXX=no
+fi
+
+fi
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic_CXX=
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
+ ;;
+esac
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
+echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6
+if test "${lt_prog_compiler_static_works_CXX+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_prog_compiler_static_works_CXX=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ printf "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_prog_compiler_static_works_CXX=yes
+ fi
+ else
+ lt_prog_compiler_static_works_CXX=yes
+ fi
+ fi
+ $rm conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6
+
+if test x"$lt_prog_compiler_static_works_CXX" = xyes; then
+ :
+else
+ lt_prog_compiler_static_CXX=
+fi
+
+
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_prog_compiler_c_o_CXX=no
+ $rm -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:11759: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:11763: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o_CXX=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $rm conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
+ $rm out/* && rmdir out
+ cd ..
+ rmdir conftest
+ $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+ hard_links=yes
+ $rm conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+ if test "$hard_links" = no; then
+ { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ case $host_os in
+ aix4* | aix5*)
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+ export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ fi
+ ;;
+ pw32*)
+ export_symbols_cmds_CXX="$ltdll_cmds"
+ ;;
+ cygwin* | mingw*)
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ *)
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ esac
+
+echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6
+test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_CXX" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc_CXX=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds_CXX in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+ $rm conftest*
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl_CXX
+ pic_flag=$lt_prog_compiler_pic_CXX
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
+ allow_undefined_flag_CXX=
+ if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+ (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ then
+ archive_cmds_need_lc_CXX=no
+ else
+ archive_cmds_need_lc_CXX=yes
+ fi
+ allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $rm conftest*
+ echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix4* | aix5*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[45]*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$host_os in
+ yes,cygwin* | yes,mingw* | yes,pw32*)
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $rm \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+ ;;
+ mingw*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ ;;
+
+ *)
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+ # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+ if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+ else
+ sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+ fi
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+kfreebsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='GNU ld.so'
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[123]*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ freebsd*) # from 4.6 on
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+interix3*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+knetbsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='GNU ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+nto-qnx*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ shlibpath_overrides_runpath=no
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ shlibpath_overrides_runpath=yes
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action_CXX=
+if test -n "$hardcode_libdir_flag_spec_CXX" || \
+ test -n "$runpath_var_CXX" || \
+ test "X$hardcode_automatic_CXX" = "Xyes" ; then
+
+ # We can hardcode non-existant directories.
+ if test "$hardcode_direct_CXX" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
+ test "$hardcode_minus_L_CXX" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action_CXX=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action_CXX=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action_CXX=unsupported
+fi
+echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
+echo "${ECHO_T}$hardcode_action_CXX" >&6
+
+if test "$hardcode_action_CXX" = relink; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+ # See if we are running on zsh, and set the options which allow our commands through
+ # without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+ # Now quote all the things that may contain metacharacters while being
+ # careful not to overquote the AC_SUBSTed values. We take copies of the
+ # variables and quote the copies for generation of the libtool script.
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
+ SED SHELL STRIP \
+ libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+ old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+ deplibs_check_method reload_flag reload_cmds need_locks \
+ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+ old_postinstall_cmds old_postuninstall_cmds \
+ compiler_CXX \
+ CC_CXX \
+ LD_CXX \
+ lt_prog_compiler_wl_CXX \
+ lt_prog_compiler_pic_CXX \
+ lt_prog_compiler_static_CXX \
+ lt_prog_compiler_no_builtin_flag_CXX \
+ export_dynamic_flag_spec_CXX \
+ thread_safe_flag_spec_CXX \
+ whole_archive_flag_spec_CXX \
+ enable_shared_with_static_runtimes_CXX \
+ old_archive_cmds_CXX \
+ old_archive_from_new_cmds_CXX \
+ predep_objects_CXX \
+ postdep_objects_CXX \
+ predeps_CXX \
+ postdeps_CXX \
+ compiler_lib_search_path_CXX \
+ archive_cmds_CXX \
+ archive_expsym_cmds_CXX \
+ postinstall_cmds_CXX \
+ postuninstall_cmds_CXX \
+ old_archive_from_expsyms_cmds_CXX \
+ allow_undefined_flag_CXX \
+ no_undefined_flag_CXX \
+ export_symbols_cmds_CXX \
+ hardcode_libdir_flag_spec_CXX \
+ hardcode_libdir_flag_spec_ld_CXX \
+ hardcode_libdir_separator_CXX \
+ hardcode_automatic_CXX \
+ module_cmds_CXX \
+ module_expsym_cmds_CXX \
+ lt_cv_prog_compiler_c_o_CXX \
+ exclude_expsyms_CXX \
+ include_expsyms_CXX; do
+
+ case $var in
+ old_archive_cmds_CXX | \
+ old_archive_from_new_cmds_CXX | \
+ archive_cmds_CXX | \
+ archive_expsym_cmds_CXX | \
+ module_cmds_CXX | \
+ module_expsym_cmds_CXX | \
+ old_archive_from_expsyms_cmds_CXX | \
+ export_symbols_cmds_CXX | \
+ extract_expsyms_cmds | reload_cmds | finish_cmds | \
+ postinstall_cmds | postuninstall_cmds | \
+ old_postinstall_cmds | old_postuninstall_cmds | \
+ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+ # Double-quote double-evaled strings.
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+ ;;
+ *)
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+ ;;
+ esac
+ done
+
+ case $lt_echo in
+ *'\$0 --fallback-echo"')
+ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+ ;;
+ esac
+
+cfgfile="$ofile"
+
+ cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_CXX
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
+# A language-specific compiler.
+CC=$lt_compiler_CXX
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_CXX
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_CXX
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_CXX
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_CXX
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_CXX
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_CXX
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_CXX
+archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_CXX
+module_expsym_cmds=$lt_module_expsym_cmds_CXX
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_CXX
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_CXX
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_CXX
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_CXX
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_CXX
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_CXX
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_CXX
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_CXX
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_CXX
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_CXX
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_CXX
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_CXX"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_CXX
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_CXX
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_CXX
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_CXX
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+ # If there is no Makefile yet, we rely on a make rule to execute
+ # `config.status --recheck' to rerun these tests and create the
+ # libtool script then.
+ ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+ if test -f "$ltmain_in"; then
+ test -f Makefile && make "$ltmain"
+ fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+with_gnu_ld=$lt_save_with_gnu_ld
+lt_cv_path_LDCXX=$lt_cv_path_LD
+lt_cv_path_LD=$lt_save_path_LD
+lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+
+ else
+ tagname=""
+ fi
+ ;;
+
+ F77)
+ if test -n "$F77" && test "X$F77" != "Xno"; then
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+
+
+archive_cmds_need_lc_F77=no
+allow_undefined_flag_F77=
+always_export_symbols_F77=no
+archive_expsym_cmds_F77=
+export_dynamic_flag_spec_F77=
+hardcode_direct_F77=no
+hardcode_libdir_flag_spec_F77=
+hardcode_libdir_flag_spec_ld_F77=
+hardcode_libdir_separator_F77=
+hardcode_minus_L_F77=no
+hardcode_automatic_F77=no
+module_cmds_F77=
+module_expsym_cmds_F77=
+link_all_deplibs_F77=unknown
+old_archive_cmds_F77=$old_archive_cmds
+no_undefined_flag_F77=
+whole_archive_flag_spec_F77=
+enable_shared_with_static_runtimes_F77=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+objext_F77=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code=" subroutine t\n return\n end\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code=" program t\n end\n"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${F77-"f77"}
+compiler=$CC
+compiler_F77=$CC
+for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+
+echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $can_build_shared" >&5
+echo "${ECHO_T}$can_build_shared" >&6
+
+echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case $host_os in
+aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+aix4* | aix5*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+esac
+echo "$as_me:$LINENO: result: $enable_shared" >&5
+echo "${ECHO_T}$enable_shared" >&6
+
+echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+echo "$as_me:$LINENO: result: $enable_static" >&5
+echo "${ECHO_T}$enable_static" >&6
+
+GCC_F77="$G77"
+LD_F77="$LD"
+
+lt_prog_compiler_wl_F77=
+lt_prog_compiler_pic_F77=
+lt_prog_compiler_static_F77=
+
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+
+ if test "$GCC" = yes; then
+ lt_prog_compiler_wl_F77='-Wl,'
+ lt_prog_compiler_static_F77='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_F77='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4'
+ ;;
+
+ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic_F77='-fno-common'
+ ;;
+
+ interix3*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ lt_prog_compiler_can_build_shared_F77=no
+ enable_shared=no
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic_F77=-Kconform_pic
+ fi
+ ;;
+
+ hpux*)
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic_F77='-fPIC'
+ ;;
+ esac
+ ;;
+
+ *)
+ lt_prog_compiler_pic_F77='-fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_F77='-Bstatic'
+ else
+ lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ darwin*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ case $cc_basename in
+ xlc*)
+ lt_prog_compiler_pic_F77='-qnocommon'
+ lt_prog_compiler_wl_F77='-Wl,'
+ ;;
+ esac
+ ;;
+
+ mingw* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic_F77='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ lt_prog_compiler_static_F77='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ # PIC (with -KPIC) is the default.
+ lt_prog_compiler_static_F77='-non_shared'
+ ;;
+
+ newsos6)
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ ;;
+
+ linux*)
+ case $cc_basename in
+ icc* | ecc*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-static'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ lt_prog_compiler_wl_F77='-Wl,'
+ lt_prog_compiler_pic_F77='-fpic'
+ lt_prog_compiler_static_F77='-Bstatic'
+ ;;
+ ccc*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ # All Alpha code is PIC.
+ lt_prog_compiler_static_F77='-non_shared'
+ ;;
+ esac
+ ;;
+
+ osf3* | osf4* | osf5*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ # All OSF/1 code is PIC.
+ lt_prog_compiler_static_F77='-non_shared'
+ ;;
+
+ solaris*)
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95*)
+ lt_prog_compiler_wl_F77='-Qoption ld ';;
+ *)
+ lt_prog_compiler_wl_F77='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ lt_prog_compiler_wl_F77='-Qoption ld '
+ lt_prog_compiler_pic_F77='-PIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ lt_prog_compiler_pic_F77='-Kconform_pic'
+ lt_prog_compiler_static_F77='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ ;;
+
+ unicos*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ lt_prog_compiler_can_build_shared_F77=no
+ ;;
+
+ uts4*)
+ lt_prog_compiler_pic_F77='-pic'
+ lt_prog_compiler_static_F77='-Bstatic'
+ ;;
+
+ *)
+ lt_prog_compiler_can_build_shared_F77=no
+ ;;
+ esac
+ fi
+
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_F77"; then
+
+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works_F77+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_prog_compiler_pic_works_F77=no
+ ac_outfile=conftest.$ac_objext
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic_F77"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:13329: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:13333: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_prog_compiler_pic_works_F77=yes
+ fi
+ fi
+ $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6
+
+if test x"$lt_prog_compiler_pic_works_F77" = xyes; then
+ case $lt_prog_compiler_pic_F77 in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;;
+ esac
+else
+ lt_prog_compiler_pic_F77=
+ lt_prog_compiler_can_build_shared_F77=no
+fi
+
+fi
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic_F77=
+ ;;
+ *)
+ lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77"
+ ;;
+esac
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\"
+echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6
+if test "${lt_prog_compiler_static_works_F77+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_prog_compiler_static_works_F77=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ printf "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_prog_compiler_static_works_F77=yes
+ fi
+ else
+ lt_prog_compiler_static_works_F77=yes
+ fi
+ fi
+ $rm conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5
+echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6
+
+if test x"$lt_prog_compiler_static_works_F77" = xyes; then
+ :
+else
+ lt_prog_compiler_static_F77=
+fi
+
+
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_prog_compiler_c_o_F77=no
+ $rm -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:13433: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:13437: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o_F77=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $rm conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
+ $rm out/* && rmdir out
+ cd ..
+ rmdir conftest
+ $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+ hard_links=yes
+ $rm conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+ if test "$hard_links" = no; then
+ { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+ runpath_var=
+ allow_undefined_flag_F77=
+ enable_shared_with_static_runtimes_F77=no
+ archive_cmds_F77=
+ archive_expsym_cmds_F77=
+ old_archive_From_new_cmds_F77=
+ old_archive_from_expsyms_cmds_F77=
+ export_dynamic_flag_spec_F77=
+ whole_archive_flag_spec_F77=
+ thread_safe_flag_spec_F77=
+ hardcode_libdir_flag_spec_F77=
+ hardcode_libdir_flag_spec_ld_F77=
+ hardcode_libdir_separator_F77=
+ hardcode_direct_F77=no
+ hardcode_minus_L_F77=no
+ hardcode_shlibpath_var_F77=unsupported
+ link_all_deplibs_F77=unknown
+ hardcode_automatic_F77=no
+ module_cmds_F77=
+ module_expsym_cmds_F77=
+ always_export_symbols_F77=no
+ export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ include_expsyms_F77=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_"
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ extract_expsyms_cmds=
+ # Just being paranoid about ensuring that cc_basename is set.
+ for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+ case $host_os in
+ cygwin* | mingw* | pw32*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ ld_shlibs_F77=yes
+ if test "$with_gnu_ld" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir'
+ export_dynamic_flag_spec_F77='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec_F77=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>/dev/null` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix3* | aix4* | aix5*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs_F77=no
+ cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+ fi
+ ;;
+
+ amigaos*)
+ archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_minus_L_F77=yes
+
+ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+ # that the semantics of dynamic libraries on AmigaOS, at least up
+ # to version 4, is to share data among multiple programs linked
+ # with the same dynamic library. Since this doesn't match the
+ # behavior of shared libraries on other platforms, we can't use
+ # them.
+ ld_shlibs_F77=no
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag_F77=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ ld_shlibs_F77=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ allow_undefined_flag_F77=unsupported
+ always_export_symbols_F77=no
+ enable_shared_with_static_runtimes_F77=yes
+ export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ ld_shlibs_F77=no
+ fi
+ ;;
+
+ interix3*)
+ hardcode_direct_F77=no
+ hardcode_shlibpath_var_F77=no
+ hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_F77='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ linux*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ tmp_addflag=
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
+ whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ esac
+ archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test $supports_anon_versioning = yes; then
+ archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ $echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+ else
+ ld_shlibs_F77=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ ld_shlibs_F77=no
+ cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs_F77=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs_F77=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
+ archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
+ else
+ ld_shlibs_F77=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ hardcode_direct_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs_F77=no
+ fi
+ ;;
+ esac
+
+ if test "$ld_shlibs_F77" = no; then
+ runpath_var=
+ hardcode_libdir_flag_spec_F77=
+ export_dynamic_flag_spec_F77=
+ whole_archive_flag_spec_F77=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ allow_undefined_flag_F77=unsupported
+ always_export_symbols_F77=yes
+ archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L_F77=yes
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct_F77=unsupported
+ fi
+ ;;
+
+ aix4* | aix5*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+ export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ archive_cmds_F77=''
+ hardcode_direct_F77=yes
+ hardcode_libdir_separator_F77=':'
+ link_all_deplibs_F77=yes
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ hardcode_direct_F77=yes
+ else
+ # We have old collect2
+ hardcode_direct_F77=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L_F77=yes
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_libdir_separator_F77=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ always_export_symbols_F77=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag_F77='-berok'
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+ program main
+
+ end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_f77_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag_F77="-z nodefs"
+ archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+ program main
+
+ end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_f77_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag_F77=' ${wl}-bernotok'
+ allow_undefined_flag_F77=' ${wl}-berok'
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec_F77='$convenience'
+ archive_cmds_need_lc_F77=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_minus_L_F77=yes
+ # see comment about different semantics on the GNU ld section
+ ld_shlibs_F77=no
+ ;;
+
+ bsdi[45]*)
+ export_dynamic_flag_spec_F77=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec_F77=' '
+ allow_undefined_flag_F77=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ old_archive_From_new_cmds_F77='true'
+ # FIXME: Should let the user specify the lib program.
+ old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs'
+ fix_srcfile_path_F77='`cygpath -w "$srcfile"`'
+ enable_shared_with_static_runtimes_F77=yes
+ ;;
+
+ darwin* | rhapsody*)
+ case $host_os in
+ rhapsody* | darwin1.[012])
+ allow_undefined_flag_F77='${wl}-undefined ${wl}suppress'
+ ;;
+ *) # Darwin 1.3 on
+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+ allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+ else
+ case ${MACOSX_DEPLOYMENT_TARGET} in
+ 10.[012])
+ allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+ ;;
+ 10.*)
+ allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ archive_cmds_need_lc_F77=no
+ hardcode_direct_F77=no
+ hardcode_automatic_F77=yes
+ hardcode_shlibpath_var_F77=unsupported
+ whole_archive_flag_spec_F77=''
+ link_all_deplibs_F77=yes
+ if test "$GCC" = yes ; then
+ output_verbose_link_cmd='echo'
+ archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+ archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ else
+ case $cc_basename in
+ xlc*)
+ output_verbose_link_cmd='echo'
+ archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+ module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+ archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ ;;
+ *)
+ ld_shlibs_F77=no
+ ;;
+ esac
+ fi
+ ;;
+
+ dgux*)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ freebsd1*)
+ ld_shlibs_F77=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ hardcode_libdir_flag_spec_F77='-R$libdir'
+ hardcode_direct_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_F77=yes
+ hardcode_minus_L_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | kfreebsd*-gnu | dragonfly*)
+ archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec_F77='-R$libdir'
+ hardcode_direct_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_F77=:
+ hardcode_direct_F77=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_F77=yes
+ export_dynamic_flag_spec_F77='${wl}-E'
+ ;;
+
+ hpux10*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_F77=:
+
+ hardcode_direct_F77=yes
+ export_dynamic_flag_spec_F77='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_F77=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_F77=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_libdir_flag_spec_ld_F77='+b $libdir'
+ hardcode_direct_F77=no
+ hardcode_shlibpath_var_F77=no
+ ;;
+ *)
+ hardcode_direct_F77=yes
+ export_dynamic_flag_spec_F77='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_F77=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec_ld_F77='-rpath $libdir'
+ fi
+ hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_F77=:
+ link_all_deplibs_F77=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ hardcode_libdir_flag_spec_F77='-R$libdir'
+ hardcode_direct_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ newsos6)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_F77=yes
+ hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_F77=:
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ openbsd*)
+ hardcode_direct_F77=yes
+ hardcode_shlibpath_var_F77=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_F77='${wl}-E'
+ else
+ case $host_os in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec_F77='-R$libdir'
+ ;;
+ *)
+ archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ ;;
+
+ os2*)
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_minus_L_F77=yes
+ allow_undefined_flag_F77=unsupported
+ archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ allow_undefined_flag_F77=' -expect_unresolved \*'
+ archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_F77=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+ else
+ allow_undefined_flag_F77=' -expect_unresolved \*'
+ archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec_F77='-rpath $libdir'
+ fi
+ hardcode_libdir_separator_F77=:
+ ;;
+
+ solaris*)
+ no_undefined_flag_F77=' -z text'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+ else
+ wlarc=''
+ archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+ fi
+ hardcode_libdir_flag_spec_F77='-R$libdir'
+ hardcode_shlibpath_var_F77=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The compiler driver will combine linker options so we
+ # cannot just pass the convience library names through
+ # without $wl, iff we do not link with $LD.
+ # Luckily, gcc supports the same syntax we need for Sun Studio.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ case $wlarc in
+ '')
+ whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;;
+ *)
+ whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+ esac ;;
+ esac
+ link_all_deplibs_F77=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_direct_F77=yes
+ hardcode_minus_L_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_F77=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ reload_cmds_F77='$CC -r -o $output$reload_objs'
+ hardcode_direct_F77=no
+ ;;
+ motorola)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ sysv4.3*)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var_F77=no
+ export_dynamic_flag_spec_F77='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var_F77=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ld_shlibs_F77=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
+ no_undefined_flag_F77='${wl}-z,text'
+ archive_cmds_need_lc_F77=no
+ hardcode_shlibpath_var_F77=no
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ no_undefined_flag_F77='${wl}-z,text'
+ allow_undefined_flag_F77='${wl}-z,nodefs'
+ archive_cmds_need_lc_F77=no
+ hardcode_shlibpath_var_F77=no
+ hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+ hardcode_libdir_separator_F77=':'
+ link_all_deplibs_F77=yes
+ export_dynamic_flag_spec_F77='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ *)
+ ld_shlibs_F77=no
+ ;;
+ esac
+ fi
+
+echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5
+echo "${ECHO_T}$ld_shlibs_F77" >&6
+test "$ld_shlibs_F77" = no && can_build_shared=no
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_F77" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc_F77=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds_F77 in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+ $rm conftest*
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl_F77
+ pic_flag=$lt_prog_compiler_pic_F77
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag_F77
+ allow_undefined_flag_F77=
+ if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+ (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ then
+ archive_cmds_need_lc_F77=no
+ else
+ archive_cmds_need_lc_F77=yes
+ fi
+ allow_undefined_flag_F77=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $rm conftest*
+ echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix4* | aix5*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[45]*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$host_os in
+ yes,cygwin* | yes,mingw* | yes,pw32*)
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $rm \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+ ;;
+ mingw*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ ;;
+
+ *)
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+ # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+ if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+ else
+ sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+ fi
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+kfreebsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='GNU ld.so'
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[123]*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ freebsd*) # from 4.6 on
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+interix3*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+knetbsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='GNU ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+nto-qnx*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ shlibpath_overrides_runpath=no
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ shlibpath_overrides_runpath=yes
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action_F77=
+if test -n "$hardcode_libdir_flag_spec_F77" || \
+ test -n "$runpath_var_F77" || \
+ test "X$hardcode_automatic_F77" = "Xyes" ; then
+
+ # We can hardcode non-existant directories.
+ if test "$hardcode_direct_F77" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no &&
+ test "$hardcode_minus_L_F77" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action_F77=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action_F77=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action_F77=unsupported
+fi
+echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5
+echo "${ECHO_T}$hardcode_action_F77" >&6
+
+if test "$hardcode_action_F77" = relink; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+ # See if we are running on zsh, and set the options which allow our commands through
+ # without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+ # Now quote all the things that may contain metacharacters while being
+ # careful not to overquote the AC_SUBSTed values. We take copies of the
+ # variables and quote the copies for generation of the libtool script.
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
+ SED SHELL STRIP \
+ libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+ old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+ deplibs_check_method reload_flag reload_cmds need_locks \
+ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+ old_postinstall_cmds old_postuninstall_cmds \
+ compiler_F77 \
+ CC_F77 \
+ LD_F77 \
+ lt_prog_compiler_wl_F77 \
+ lt_prog_compiler_pic_F77 \
+ lt_prog_compiler_static_F77 \
+ lt_prog_compiler_no_builtin_flag_F77 \
+ export_dynamic_flag_spec_F77 \
+ thread_safe_flag_spec_F77 \
+ whole_archive_flag_spec_F77 \
+ enable_shared_with_static_runtimes_F77 \
+ old_archive_cmds_F77 \
+ old_archive_from_new_cmds_F77 \
+ predep_objects_F77 \
+ postdep_objects_F77 \
+ predeps_F77 \
+ postdeps_F77 \
+ compiler_lib_search_path_F77 \
+ archive_cmds_F77 \
+ archive_expsym_cmds_F77 \
+ postinstall_cmds_F77 \
+ postuninstall_cmds_F77 \
+ old_archive_from_expsyms_cmds_F77 \
+ allow_undefined_flag_F77 \
+ no_undefined_flag_F77 \
+ export_symbols_cmds_F77 \
+ hardcode_libdir_flag_spec_F77 \
+ hardcode_libdir_flag_spec_ld_F77 \
+ hardcode_libdir_separator_F77 \
+ hardcode_automatic_F77 \
+ module_cmds_F77 \
+ module_expsym_cmds_F77 \
+ lt_cv_prog_compiler_c_o_F77 \
+ exclude_expsyms_F77 \
+ include_expsyms_F77; do
+
+ case $var in
+ old_archive_cmds_F77 | \
+ old_archive_from_new_cmds_F77 | \
+ archive_cmds_F77 | \
+ archive_expsym_cmds_F77 | \
+ module_cmds_F77 | \
+ module_expsym_cmds_F77 | \
+ old_archive_from_expsyms_cmds_F77 | \
+ export_symbols_cmds_F77 | \
+ extract_expsyms_cmds | reload_cmds | finish_cmds | \
+ postinstall_cmds | postuninstall_cmds | \
+ old_postinstall_cmds | old_postuninstall_cmds | \
+ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+ # Double-quote double-evaled strings.
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+ ;;
+ *)
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+ ;;
+ esac
+ done
+
+ case $lt_echo in
+ *'\$0 --fallback-echo"')
+ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+ ;;
+ esac
+
+cfgfile="$ofile"
+
+ cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_F77
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
+# A language-specific compiler.
+CC=$lt_compiler_F77
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_F77
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_F77
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_F77
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_F77
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_F77
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_F77
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_F77
+archive_expsym_cmds=$lt_archive_expsym_cmds_F77
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_F77
+module_expsym_cmds=$lt_module_expsym_cmds_F77
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_F77
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_F77
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_F77
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_F77
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_F77
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_F77
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_F77
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_F77
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_F77
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_F77
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_F77
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_F77
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_F77
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_F77"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_F77
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_F77
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_F77
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_F77
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+ # If there is no Makefile yet, we rely on a make rule to execute
+ # `config.status --recheck' to rerun these tests and create the
+ # libtool script then.
+ ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+ if test -f "$ltmain_in"; then
+ test -f Makefile && make "$ltmain"
+ fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+ else
+ tagname=""
+ fi
+ ;;
+
+ GCJ)
+ if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
+
+
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+objext_GCJ=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${GCJ-"gcj"}
+compiler=$CC
+compiler_GCJ=$CC
+for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+archive_cmds_need_lc_GCJ=no
+
+old_archive_cmds_GCJ=$old_archive_cmds
+
+
+lt_prog_compiler_no_builtin_flag_GCJ=
+
+if test "$GCC" = yes; then
+ lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin'
+
+
+echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_prog_compiler_rtti_exceptions=no
+ ac_outfile=conftest.$ac_objext
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="-fno-rtti -fno-exceptions"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:15636: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:15640: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_rtti_exceptions=yes
+ fi
+ fi
+ $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+ lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions"
+else
+ :
+fi
+
+fi
+
+lt_prog_compiler_wl_GCJ=
+lt_prog_compiler_pic_GCJ=
+lt_prog_compiler_static_GCJ=
+
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+
+ if test "$GCC" = yes; then
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ lt_prog_compiler_static_GCJ='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ fi
+ ;;
+
+ amigaos*)
+ # FIXME: we need at least 68020 code to build shared libraries, but
+ # adding the `-m68020' flag to GCC prevents building anything better,
+ # like `-m68040'.
+ lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4'
+ ;;
+
+ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic_GCJ='-fno-common'
+ ;;
+
+ interix3*)
+ # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+ # Instead, we relocate shared libraries at runtime.
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ lt_prog_compiler_can_build_shared_GCJ=no
+ enable_shared=no
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic_GCJ=-Kconform_pic
+ fi
+ ;;
+
+ hpux*)
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic_GCJ='-fPIC'
+ ;;
+ esac
+ ;;
+
+ *)
+ lt_prog_compiler_pic_GCJ='-fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ else
+ lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ darwin*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ case $cc_basename in
+ xlc*)
+ lt_prog_compiler_pic_GCJ='-qnocommon'
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ ;;
+ esac
+ ;;
+
+ mingw* | pw32* | os2*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case $host_cpu in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic_GCJ='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ # PIC (with -KPIC) is the default.
+ lt_prog_compiler_static_GCJ='-non_shared'
+ ;;
+
+ newsos6)
+ lt_prog_compiler_pic_GCJ='-KPIC'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ ;;
+
+ linux*)
+ case $cc_basename in
+ icc* | ecc*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ lt_prog_compiler_pic_GCJ='-KPIC'
+ lt_prog_compiler_static_GCJ='-static'
+ ;;
+ pgcc* | pgf77* | pgf90* | pgf95*)
+ # Portland Group compilers (*not* the Pentium gcc compiler,
+ # which looks to be a dead project)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ lt_prog_compiler_pic_GCJ='-fpic'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ ;;
+ ccc*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ # All Alpha code is PIC.
+ lt_prog_compiler_static_GCJ='-non_shared'
+ ;;
+ esac
+ ;;
+
+ osf3* | osf4* | osf5*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ # All OSF/1 code is PIC.
+ lt_prog_compiler_static_GCJ='-non_shared'
+ ;;
+
+ solaris*)
+ lt_prog_compiler_pic_GCJ='-KPIC'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ case $cc_basename in
+ f77* | f90* | f95*)
+ lt_prog_compiler_wl_GCJ='-Qoption ld ';;
+ *)
+ lt_prog_compiler_wl_GCJ='-Wl,';;
+ esac
+ ;;
+
+ sunos4*)
+ lt_prog_compiler_wl_GCJ='-Qoption ld '
+ lt_prog_compiler_pic_GCJ='-PIC'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ lt_prog_compiler_pic_GCJ='-KPIC'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ lt_prog_compiler_pic_GCJ='-Kconform_pic'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ fi
+ ;;
+
+ sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ lt_prog_compiler_pic_GCJ='-KPIC'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ ;;
+
+ unicos*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ lt_prog_compiler_can_build_shared_GCJ=no
+ ;;
+
+ uts4*)
+ lt_prog_compiler_pic_GCJ='-pic'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ ;;
+
+ *)
+ lt_prog_compiler_can_build_shared_GCJ=no
+ ;;
+ esac
+ fi
+
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_GCJ"; then
+
+echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_prog_compiler_pic_works_GCJ=no
+ ac_outfile=conftest.$ac_objext
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic_GCJ"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:15904: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:15908: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings other than the usual output.
+ $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+ lt_prog_compiler_pic_works_GCJ=yes
+ fi
+ fi
+ $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6
+
+if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then
+ case $lt_prog_compiler_pic_GCJ in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;;
+ esac
+else
+ lt_prog_compiler_pic_GCJ=
+ lt_prog_compiler_can_build_shared_GCJ=no
+fi
+
+fi
+case $host_os in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic_GCJ=
+ ;;
+ *)
+ lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ"
+ ;;
+esac
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\"
+echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6
+if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_prog_compiler_static_works_GCJ=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+ printf "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The linker can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp
+ $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+ if diff conftest.exp conftest.er2 >/dev/null; then
+ lt_prog_compiler_static_works_GCJ=yes
+ fi
+ else
+ lt_prog_compiler_static_works_GCJ=yes
+ fi
+ fi
+ $rm conftest*
+ LDFLAGS="$save_LDFLAGS"
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5
+echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6
+
+if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then
+ :
+else
+ lt_prog_compiler_static_GCJ=
+fi
+
+
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_prog_compiler_c_o_GCJ=no
+ $rm -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:16008: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:16012: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_objext
+ then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp
+ $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+ if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+ lt_cv_prog_compiler_c_o_GCJ=yes
+ fi
+ fi
+ chmod u+w . 2>&5
+ $rm conftest*
+ # SGI C++ compiler will create directory out/ii_files/ for
+ # template instantiation
+ test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
+ $rm out/* && rmdir out
+ cd ..
+ rmdir conftest
+ $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+ hard_links=yes
+ $rm conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+ if test "$hard_links" = no; then
+ { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+ runpath_var=
+ allow_undefined_flag_GCJ=
+ enable_shared_with_static_runtimes_GCJ=no
+ archive_cmds_GCJ=
+ archive_expsym_cmds_GCJ=
+ old_archive_From_new_cmds_GCJ=
+ old_archive_from_expsyms_cmds_GCJ=
+ export_dynamic_flag_spec_GCJ=
+ whole_archive_flag_spec_GCJ=
+ thread_safe_flag_spec_GCJ=
+ hardcode_libdir_flag_spec_GCJ=
+ hardcode_libdir_flag_spec_ld_GCJ=
+ hardcode_libdir_separator_GCJ=
+ hardcode_direct_GCJ=no
+ hardcode_minus_L_GCJ=no
+ hardcode_shlibpath_var_GCJ=unsupported
+ link_all_deplibs_GCJ=unknown
+ hardcode_automatic_GCJ=no
+ module_cmds_GCJ=
+ module_expsym_cmds_GCJ=
+ always_export_symbols_GCJ=no
+ export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ include_expsyms_GCJ=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_"
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ extract_expsyms_cmds=
+ # Just being paranoid about ensuring that cc_basename is set.
+ for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+ case $host_os in
+ cygwin* | mingw* | pw32*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ interix*)
+ # we just hope/assume this is gcc and not c89 (= MSVC++)
+ with_gnu_ld=yes
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ ld_shlibs_GCJ=yes
+ if test "$with_gnu_ld" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # Set some defaults for GNU ld with shared library support. These
+ # are reset later if shared libraries are not supported. Putting them
+ # here allows them to be overridden if necessary.
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir'
+ export_dynamic_flag_spec_GCJ='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec_GCJ=
+ fi
+ supports_anon_versioning=no
+ case `$LD -v 2>/dev/null` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+ *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+ *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+ *\ 2.11.*) ;; # other 2.11 versions
+ *) supports_anon_versioning=yes ;;
+ esac
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix3* | aix4* | aix5*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs_GCJ=no
+ cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+ fi
+ ;;
+
+ amigaos*)
+ archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ hardcode_minus_L_GCJ=yes
+
+ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+ # that the semantics of dynamic libraries on AmigaOS, at least up
+ # to version 4, is to share data among multiple programs linked
+ # with the same dynamic library. Since this doesn't match the
+ # behavior of shared libraries on other platforms, we can't use
+ # them.
+ ld_shlibs_GCJ=no
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag_GCJ=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ ld_shlibs_GCJ=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ allow_undefined_flag_GCJ=unsupported
+ always_export_symbols_GCJ=no
+ enable_shared_with_static_runtimes_GCJ=yes
+ export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ ld_shlibs_GCJ=no
+ fi
+ ;;
+
+ interix3*)
+ hardcode_direct_GCJ=no
+ hardcode_shlibpath_var_GCJ=no
+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_GCJ='${wl}-E'
+ # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+ # Instead, shared libraries are loaded at an image base (0x10000000 by
+ # default) and relocated if they conflict, which is a slow very memory
+ # consuming and fragmenting process. To avoid this, we pick a random,
+ # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+ # time. Moving up from 0x10000000 also allows more sbrk(2) space.
+ archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ ;;
+
+ linux*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ tmp_addflag=
+ case $cc_basename,$host_cpu in
+ pgcc*) # Portland Group C compiler
+ whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag'
+ ;;
+ pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers
+ whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+ tmp_addflag=' $pic_flag -Mnomain' ;;
+ ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
+ tmp_addflag=' -i_dynamic' ;;
+ efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64
+ tmp_addflag=' -i_dynamic -nofor_main' ;;
+ ifc* | ifort*) # Intel Fortran compiler
+ tmp_addflag=' -nofor_main' ;;
+ esac
+ archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+ if test $supports_anon_versioning = yes; then
+ archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ $echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ fi
+ else
+ ld_shlibs_GCJ=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ ld_shlibs_GCJ=no
+ cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs_GCJ=no
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+ case `$LD -v 2>&1` in
+ *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+ ld_shlibs_GCJ=no
+ cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+ archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib'
+ archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib'
+ else
+ ld_shlibs_GCJ=no
+ fi
+ ;;
+ esac
+ ;;
+
+ sunos4*)
+ archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ hardcode_direct_GCJ=yes
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs_GCJ=no
+ fi
+ ;;
+ esac
+
+ if test "$ld_shlibs_GCJ" = no; then
+ runpath_var=
+ hardcode_libdir_flag_spec_GCJ=
+ export_dynamic_flag_spec_GCJ=
+ whole_archive_flag_spec_GCJ=
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ allow_undefined_flag_GCJ=unsupported
+ always_export_symbols_GCJ=yes
+ archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L_GCJ=yes
+ if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct_GCJ=unsupported
+ fi
+ ;;
+
+ aix4* | aix5*)
+ if test "$host_cpu" = ia64; then
+ # On IA64, the linker does run time linking by default, so we don't
+ # have to do anything special.
+ aix_use_runtimelinking=no
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # If we're using GNU nm, then we don't want the "-C" option.
+ # -C means demangle to AIX nm, but means don't demangle with GNU nm
+ if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+ export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ else
+ export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # Test if we are trying to use run time linking or normal
+ # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+ # need to do runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ ;;
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # When large executables or shared objects are built, AIX ld can
+ # have problems creating the table of contents. If linking a library
+ # or program results in "error TOC overflow" add -mminimal-toc to
+ # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not
+ # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+ archive_cmds_GCJ=''
+ hardcode_direct_GCJ=yes
+ hardcode_libdir_separator_GCJ=':'
+ link_all_deplibs_GCJ=yes
+
+ if test "$GCC" = yes; then
+ case $host_os in aix4.[012]|aix4.[012].*)
+ # We only want to do this on AIX 4.2 and lower, the check
+ # below for broken collect2 doesn't work under 4.3+
+ collect2name=`${CC} -print-prog-name=collect2`
+ if test -f "$collect2name" && \
+ strings "$collect2name" | grep resolve_lib_name >/dev/null
+ then
+ # We have reworked collect2
+ hardcode_direct_GCJ=yes
+ else
+ # We have old collect2
+ hardcode_direct_GCJ=unsupported
+ # It fails to find uninstalled libraries when the uninstalled
+ # path is not listed in the libpath. Setting hardcode_minus_L
+ # to unsupported forces relinking
+ hardcode_minus_L_GCJ=yes
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ hardcode_libdir_separator_GCJ=
+ fi
+ ;;
+ esac
+ shared_flag='-shared'
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag="$shared_flag "'${wl}-G'
+ fi
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ always_export_symbols_GCJ=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag_GCJ='-berok'
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag_GCJ="-z nodefs"
+ archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ else
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag_GCJ=' ${wl}-bernotok'
+ allow_undefined_flag_GCJ=' ${wl}-berok'
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec_GCJ='$convenience'
+ archive_cmds_need_lc_GCJ=yes
+ # This is similar to how AIX traditionally builds its shared libraries.
+ archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ fi
+ fi
+ ;;
+
+ amigaos*)
+ archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ hardcode_minus_L_GCJ=yes
+ # see comment about different semantics on the GNU ld section
+ ld_shlibs_GCJ=no
+ ;;
+
+ bsdi[45]*)
+ export_dynamic_flag_spec_GCJ=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec_GCJ=' '
+ allow_undefined_flag_GCJ=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ old_archive_From_new_cmds_GCJ='true'
+ # FIXME: Should let the user specify the lib program.
+ old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs'
+ fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`'
+ enable_shared_with_static_runtimes_GCJ=yes
+ ;;
+
+ darwin* | rhapsody*)
+ case $host_os in
+ rhapsody* | darwin1.[012])
+ allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress'
+ ;;
+ *) # Darwin 1.3 on
+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+ allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+ else
+ case ${MACOSX_DEPLOYMENT_TARGET} in
+ 10.[012])
+ allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+ ;;
+ 10.*)
+ allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ archive_cmds_need_lc_GCJ=no
+ hardcode_direct_GCJ=no
+ hardcode_automatic_GCJ=yes
+ hardcode_shlibpath_var_GCJ=unsupported
+ whole_archive_flag_spec_GCJ=''
+ link_all_deplibs_GCJ=yes
+ if test "$GCC" = yes ; then
+ output_verbose_link_cmd='echo'
+ archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+ archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ else
+ case $cc_basename in
+ xlc*)
+ output_verbose_link_cmd='echo'
+ archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+ module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+ archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ ;;
+ *)
+ ld_shlibs_GCJ=no
+ ;;
+ esac
+ fi
+ ;;
+
+ dgux*)
+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ freebsd1*)
+ ld_shlibs_GCJ=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ hardcode_libdir_flag_spec_GCJ='-R$libdir'
+ hardcode_direct_GCJ=yes
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_GCJ=yes
+ hardcode_minus_L_GCJ=yes
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd* | kfreebsd*-gnu | dragonfly*)
+ archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec_GCJ='-R$libdir'
+ hardcode_direct_GCJ=yes
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ else
+ archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ fi
+ hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_GCJ=:
+ hardcode_direct_GCJ=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_GCJ=yes
+ export_dynamic_flag_spec_GCJ='${wl}-E'
+ ;;
+
+ hpux10*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_GCJ=:
+
+ hardcode_direct_GCJ=yes
+ export_dynamic_flag_spec_GCJ='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_GCJ=yes
+ fi
+ ;;
+
+ hpux11*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case $host_cpu in
+ hppa*64*)
+ archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ ia64*)
+ archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_GCJ=:
+
+ case $host_cpu in
+ hppa*64*|ia64*)
+ hardcode_libdir_flag_spec_ld_GCJ='+b $libdir'
+ hardcode_direct_GCJ=no
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+ *)
+ hardcode_direct_GCJ=yes
+ export_dynamic_flag_spec_GCJ='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_GCJ=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir'
+ fi
+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_GCJ=:
+ link_all_deplibs_GCJ=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ hardcode_libdir_flag_spec_GCJ='-R$libdir'
+ hardcode_direct_GCJ=yes
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ newsos6)
+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_GCJ=yes
+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_GCJ=:
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ openbsd*)
+ hardcode_direct_GCJ=yes
+ hardcode_shlibpath_var_GCJ=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_GCJ='${wl}-E'
+ else
+ case $host_os in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec_GCJ='-R$libdir'
+ ;;
+ *)
+ archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ ;;
+
+ os2*)
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ hardcode_minus_L_GCJ=yes
+ allow_undefined_flag_GCJ=unsupported
+ archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ allow_undefined_flag_GCJ=' -expect_unresolved \*'
+ archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_GCJ=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+ else
+ allow_undefined_flag_GCJ=' -expect_unresolved \*'
+ archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+
+ # Both c and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec_GCJ='-rpath $libdir'
+ fi
+ hardcode_libdir_separator_GCJ=:
+ ;;
+
+ solaris*)
+ no_undefined_flag_GCJ=' -z text'
+ if test "$GCC" = yes; then
+ wlarc='${wl}'
+ archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+ else
+ wlarc=''
+ archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+ fi
+ hardcode_libdir_flag_spec_GCJ='-R$libdir'
+ hardcode_shlibpath_var_GCJ=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The compiler driver will combine linker options so we
+ # cannot just pass the convience library names through
+ # without $wl, iff we do not link with $LD.
+ # Luckily, gcc supports the same syntax we need for Sun Studio.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ case $wlarc in
+ '')
+ whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;;
+ *)
+ whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+ esac ;;
+ esac
+ link_all_deplibs_GCJ=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ hardcode_direct_GCJ=yes
+ hardcode_minus_L_GCJ=yes
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_GCJ=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ reload_cmds_GCJ='$CC -r -o $output$reload_objs'
+ hardcode_direct_GCJ=no
+ ;;
+ motorola)
+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ sysv4.3*)
+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var_GCJ=no
+ export_dynamic_flag_spec_GCJ='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var_GCJ=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ld_shlibs_GCJ=yes
+ fi
+ ;;
+
+ sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
+ no_undefined_flag_GCJ='${wl}-z,text'
+ archive_cmds_need_lc_GCJ=no
+ hardcode_shlibpath_var_GCJ=no
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ sysv5* | sco3.2v5* | sco5v6*)
+ # Note: We can NOT use -z defs as we might desire, because we do not
+ # link with -lc, and that would cause any symbols used from libc to
+ # always be unresolved, which means just about no library would
+ # ever link correctly. If we're not using GNU ld we use -z text
+ # though, which does catch some bad symbols but isn't as heavy-handed
+ # as -z defs.
+ no_undefined_flag_GCJ='${wl}-z,text'
+ allow_undefined_flag_GCJ='${wl}-z,nodefs'
+ archive_cmds_need_lc_GCJ=no
+ hardcode_shlibpath_var_GCJ=no
+ hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+ hardcode_libdir_separator_GCJ=':'
+ link_all_deplibs_GCJ=yes
+ export_dynamic_flag_spec_GCJ='${wl}-Bexport'
+ runpath_var='LD_RUN_PATH'
+
+ if test "$GCC" = yes; then
+ archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ ;;
+
+ uts4*)
+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ *)
+ ld_shlibs_GCJ=no
+ ;;
+ esac
+ fi
+
+echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5
+echo "${ECHO_T}$ld_shlibs_GCJ" >&6
+test "$ld_shlibs_GCJ" = no && can_build_shared=no
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_GCJ" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc_GCJ=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds_GCJ in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+ $rm conftest*
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl_GCJ
+ pic_flag=$lt_prog_compiler_pic_GCJ
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ
+ allow_undefined_flag_GCJ=
+ if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+ (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ then
+ archive_cmds_need_lc_GCJ=no
+ else
+ archive_cmds_need_lc_GCJ=yes
+ fi
+ allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $rm conftest*
+ echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix4* | aix5*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ else
+ # With GCC up to 2.95.x, collect2 would create an import file
+ # for dependence libraries. The import file would start with
+ # the line `#! .'. This would cause the generated library to
+ # depend on `.', always an invalid library. This was fixed in
+ # development snapshots of GCC prior to 3.0.
+ case $host_os in
+ aix4 | aix4.[01] | aix4.[01].*)
+ if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+ echo ' yes '
+ echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+ :
+ else
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # soname into executable. Probably we can add versioning support to
+ # collect2, so additional links can be useful in future.
+ if test "$aix_use_runtimelinking" = yes; then
+ # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+ # instead of lib<name>.a to let people know that these are not
+ # typical AIX shared libraries.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi[45]*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32*)
+ version_type=windows
+ shrext_cmds=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$host_os in
+ yes,cygwin* | yes,mingw* | yes,pw32*)
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $rm \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+ ;;
+ mingw*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ ;;
+
+ *)
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+ # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+ if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+ else
+ sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
+ fi
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+kfreebsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='GNU ld.so'
+ ;;
+
+freebsd* | dragonfly*)
+ # DragonFly does not have aout. When/if they implement a new
+ # versioning mechanism, adjust this.
+ if test -x /usr/bin/objformat; then
+ objformat=`/usr/bin/objformat`
+ else
+ case $host_os in
+ freebsd[123]*) objformat=aout ;;
+ *) objformat=elf ;;
+ esac
+ fi
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ freebsd*) # from 4.6 on
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case $host_cpu in
+ ia64*)
+ shrext_cmds='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext_cmds='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext_cmds='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+interix3*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # Append ld.so.conf contents to the search path
+ if test -f /etc/ld.so.conf; then
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+ fi
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+knetbsd*-gnu)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ dynamic_linker='GNU ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+nto-qnx*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+openbsd*)
+ version_type=sunos
+ sys_lib_dlsearch_path_spec="/usr/lib"
+ need_lib_prefix=no
+ # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+ case $host_os in
+ openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+ *) need_version=no ;;
+ esac
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext_cmds=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+ version_type=freebsd-elf
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ if test "$with_gnu_ld" = yes; then
+ sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+ shlibpath_overrides_runpath=no
+ else
+ sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+ shlibpath_overrides_runpath=yes
+ case $host_os in
+ sco3.2v5*)
+ sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+ ;;
+ esac
+ fi
+ sys_lib_dlsearch_path_spec='/usr/lib'
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action_GCJ=
+if test -n "$hardcode_libdir_flag_spec_GCJ" || \
+ test -n "$runpath_var_GCJ" || \
+ test "X$hardcode_automatic_GCJ" = "Xyes" ; then
+
+ # We can hardcode non-existant directories.
+ if test "$hardcode_direct_GCJ" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no &&
+ test "$hardcode_minus_L_GCJ" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action_GCJ=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action_GCJ=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action_GCJ=unsupported
+fi
+echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5
+echo "${ECHO_T}$hardcode_action_GCJ" >&6
+
+if test "$hardcode_action_GCJ" = relink; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+ # See if we are running on zsh, and set the options which allow our commands through
+ # without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+ # Now quote all the things that may contain metacharacters while being
+ # careful not to overquote the AC_SUBSTed values. We take copies of the
+ # variables and quote the copies for generation of the libtool script.
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
+ SED SHELL STRIP \
+ libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+ old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+ deplibs_check_method reload_flag reload_cmds need_locks \
+ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+ old_postinstall_cmds old_postuninstall_cmds \
+ compiler_GCJ \
+ CC_GCJ \
+ LD_GCJ \
+ lt_prog_compiler_wl_GCJ \
+ lt_prog_compiler_pic_GCJ \
+ lt_prog_compiler_static_GCJ \
+ lt_prog_compiler_no_builtin_flag_GCJ \
+ export_dynamic_flag_spec_GCJ \
+ thread_safe_flag_spec_GCJ \
+ whole_archive_flag_spec_GCJ \
+ enable_shared_with_static_runtimes_GCJ \
+ old_archive_cmds_GCJ \
+ old_archive_from_new_cmds_GCJ \
+ predep_objects_GCJ \
+ postdep_objects_GCJ \
+ predeps_GCJ \
+ postdeps_GCJ \
+ compiler_lib_search_path_GCJ \
+ archive_cmds_GCJ \
+ archive_expsym_cmds_GCJ \
+ postinstall_cmds_GCJ \
+ postuninstall_cmds_GCJ \
+ old_archive_from_expsyms_cmds_GCJ \
+ allow_undefined_flag_GCJ \
+ no_undefined_flag_GCJ \
+ export_symbols_cmds_GCJ \
+ hardcode_libdir_flag_spec_GCJ \
+ hardcode_libdir_flag_spec_ld_GCJ \
+ hardcode_libdir_separator_GCJ \
+ hardcode_automatic_GCJ \
+ module_cmds_GCJ \
+ module_expsym_cmds_GCJ \
+ lt_cv_prog_compiler_c_o_GCJ \
+ exclude_expsyms_GCJ \
+ include_expsyms_GCJ; do
+
+ case $var in
+ old_archive_cmds_GCJ | \
+ old_archive_from_new_cmds_GCJ | \
+ archive_cmds_GCJ | \
+ archive_expsym_cmds_GCJ | \
+ module_cmds_GCJ | \
+ module_expsym_cmds_GCJ | \
+ old_archive_from_expsyms_cmds_GCJ | \
+ export_symbols_cmds_GCJ | \
+ extract_expsyms_cmds | reload_cmds | finish_cmds | \
+ postinstall_cmds | postuninstall_cmds | \
+ old_postinstall_cmds | old_postuninstall_cmds | \
+ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+ # Double-quote double-evaled strings.
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+ ;;
+ *)
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+ ;;
+ esac
+ done
+
+ case $lt_echo in
+ *'\$0 --fallback-echo"')
+ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+ ;;
+ esac
+
+cfgfile="$ofile"
+
+ cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_GCJ
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
+# A language-specific compiler.
+CC=$lt_compiler_GCJ
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_GCJ
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_GCJ
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_GCJ
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_GCJ
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_GCJ
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_GCJ
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_GCJ
+archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_GCJ
+module_expsym_cmds=$lt_module_expsym_cmds_GCJ
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_GCJ
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_GCJ
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_GCJ
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_GCJ
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_GCJ
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_GCJ
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_GCJ
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_GCJ
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_GCJ
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_GCJ
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_GCJ
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_GCJ"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_GCJ
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_GCJ
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_GCJ
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_GCJ
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+ # If there is no Makefile yet, we rely on a make rule to execute
+ # `config.status --recheck' to rerun these tests and create the
+ # libtool script then.
+ ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+ if test -f "$ltmain_in"; then
+ test -f Makefile && make "$ltmain"
+ fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+ else
+ tagname=""
+ fi
+ ;;
+
+ RC)
+
+
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+objext_RC=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+
+ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${RC-"windres"}
+compiler=$CC
+compiler_RC=$CC
+for cc_temp in $compiler""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+
+lt_cv_prog_compiler_c_o_RC=yes
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+ # See if we are running on zsh, and set the options which allow our commands through
+ # without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+ # Now quote all the things that may contain metacharacters while being
+ # careful not to overquote the AC_SUBSTed values. We take copies of the
+ # variables and quote the copies for generation of the libtool script.
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \
+ SED SHELL STRIP \
+ libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+ old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+ deplibs_check_method reload_flag reload_cmds need_locks \
+ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+ old_postinstall_cmds old_postuninstall_cmds \
+ compiler_RC \
+ CC_RC \
+ LD_RC \
+ lt_prog_compiler_wl_RC \
+ lt_prog_compiler_pic_RC \
+ lt_prog_compiler_static_RC \
+ lt_prog_compiler_no_builtin_flag_RC \
+ export_dynamic_flag_spec_RC \
+ thread_safe_flag_spec_RC \
+ whole_archive_flag_spec_RC \
+ enable_shared_with_static_runtimes_RC \
+ old_archive_cmds_RC \
+ old_archive_from_new_cmds_RC \
+ predep_objects_RC \
+ postdep_objects_RC \
+ predeps_RC \
+ postdeps_RC \
+ compiler_lib_search_path_RC \
+ archive_cmds_RC \
+ archive_expsym_cmds_RC \
+ postinstall_cmds_RC \
+ postuninstall_cmds_RC \
+ old_archive_from_expsyms_cmds_RC \
+ allow_undefined_flag_RC \
+ no_undefined_flag_RC \
+ export_symbols_cmds_RC \
+ hardcode_libdir_flag_spec_RC \
+ hardcode_libdir_flag_spec_ld_RC \
+ hardcode_libdir_separator_RC \
+ hardcode_automatic_RC \
+ module_cmds_RC \
+ module_expsym_cmds_RC \
+ lt_cv_prog_compiler_c_o_RC \
+ exclude_expsyms_RC \
+ include_expsyms_RC; do
+
+ case $var in
+ old_archive_cmds_RC | \
+ old_archive_from_new_cmds_RC | \
+ archive_cmds_RC | \
+ archive_expsym_cmds_RC | \
+ module_cmds_RC | \
+ module_expsym_cmds_RC | \
+ old_archive_from_expsyms_cmds_RC | \
+ export_symbols_cmds_RC | \
+ extract_expsyms_cmds | reload_cmds | finish_cmds | \
+ postinstall_cmds | postuninstall_cmds | \
+ old_postinstall_cmds | old_postuninstall_cmds | \
+ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+ # Double-quote double-evaled strings.
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+ ;;
+ *)
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+ ;;
+ esac
+ done
+
+ case $lt_echo in
+ *'\$0 --fallback-echo"')
+ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+ ;;
+ esac
+
+cfgfile="$ofile"
+
+ cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_RC
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_LTCFLAGS
+
+# A language-specific compiler.
+CC=$lt_compiler_RC
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_RC
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_RC
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$lt_STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_RC
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_RC
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_RC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_RC
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_RC
+archive_expsym_cmds=$lt_archive_expsym_cmds_RC
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_RC
+module_expsym_cmds=$lt_module_expsym_cmds_RC
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_RC
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_RC
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_RC
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_RC
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_RC
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_RC
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_RC
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_RC
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_RC
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_RC
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_RC
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_RC
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_RC
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_RC"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_RC
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_RC
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_RC
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_RC
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+ # If there is no Makefile yet, we rely on a make rule to execute
+ # `config.status --recheck' to rerun these tests and create the
+ # libtool script then.
+ ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'`
+ if test -f "$ltmain_in"; then
+ test -f Makefile && make "$ltmain"
+ fi
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+ ;;
+
+ *)
+ { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5
+echo "$as_me: error: Unsupported tag name: $tagname" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+ esac
+
+ # Append the new tag name to the list of available tags.
+ if test -n "$tagname" ; then
+ available_tags="$available_tags $tagname"
+ fi
+ fi
+ done
+ IFS="$lt_save_ifs"
+
+ # Now substitute the updated list of available tags.
+ if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
+ mv "${ofile}T" "$ofile"
+ chmod +x "$ofile"
+ else
+ rm -f "${ofile}T"
+ { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5
+echo "$as_me: error: unable to update list of available tagged configurations." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+fi
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+# Prevent multiple expansion
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+DATE="`date '+%a %d %B %Y'`"
+
+
+OPROFILE_DIR=`pwd`
+
+
+# this needs to come before --with-gcc so we link with binutil's version
+# of libiberty ... sigh
+
+# Check whether --with-binutils or --without-binutils was given.
+if test "${with_binutils+set}" = set; then
+ withval="$with_binutils"
+ BINUTILSDIR=$withval
+fi;
+
+if test "$BINUTILSDIR" != ""; then
+ LD="$BINUTILSDIR/ld"
+ if test "$CFLAGS" = ""; then
+ CFLAGS="-g -O2"
+ fi
+ if test "$CXXFLAGS" = ""; then
+ CXXFLAGS="-g -O2"
+ fi
+ CFLAGS="$CFLAGS -I$BINUTILSDIR/include"
+ CXXFLAGS="$CXXFLAGS -I$BINUTILSDIR/include"
+
+# Check whether --with-binutils-libname or --without-binutils-libname was given.
+if test "${with_binutils_libname+set}" = set; then
+ withval="$with_binutils_libname"
+ BINUTILSLIB=$withval
+fi;
+ if test "$BINUTILSLIB" = ""; then
+ BINUTILSLIB="lib"
+ fi
+ LDFLAGS="$LDFLAGS -L$BINUTILSDIR/$BINUTILSLIB -Xlinker -R -Xlinker $BINUTILSDIR/$BINUTILSLIB"
+fi
+
+
+# Check whether --with-gcc or --without-gcc was given.
+if test "${with_gcc+set}" = set; then
+ withval="$with_gcc"
+ GCCDIR=$withval
+fi;
+
+if test "$GCCDIR" != ""; then
+ CC="$GCCDIR/bin/gcc"
+ CXX="$GCCDIR/bin/g++"
+ LDFLAGS="$LDFLAGS -L$GCCDIR/lib -Xlinker -R -Xlinker $GCCDIR/lib"
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+fi
+if test -z "$CC"; then
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+ ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$ac_ct_CC" && break
+done
+
+ CC=$ac_ct_CC
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+ "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+ (eval $ac_compiler --version </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+ (eval $ac_compiler -v </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+ (eval $ac_compiler -V </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_compiler_gnu=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cc_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
+ function prototypes and stuff, but not '\xHH' hex character constants.
+ These don't provoke an error unfortunately, instead are silently treated
+ as 'x'. The following induces an error, until -std1 is added to get
+ proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
+ array size at least. It's necessary to write '\x00'==0 to get something
+ that's true only with -std1. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX -qlanglvl=ansi
+# Ultrix and OSF/1 -std1
+# HP-UX 10.20 and later -Ae
+# HP-UX older versions -Aa -D_HPUX_SOURCE
+# SVR4 -Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+ x|xno)
+ echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+ *)
+ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+ CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+# Some people use a C++ compiler to compile C. Since we use `exit',
+# in C++ we need to declare it. In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+ choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ for ac_declaration in \
+ '' \
+ 'extern "C" void std::exit (int) throw (); using std::exit;' \
+ 'extern "C" void std::exit (int); using std::exit;' \
+ 'extern "C" void exit (int) throw ();' \
+ 'extern "C" void exit (int);' \
+ 'void exit (int);'
+do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+#include <stdlib.h>
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+ echo '#ifdef __cplusplus' >>confdefs.h
+ echo $ac_declaration >>confdefs.h
+ echo '#endif' >>confdefs.h
+fi
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CC" am_compiler_list=
+
+echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+
+
+if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if test "${ac_cv_prog_CPP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ :
+else
+ { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CXX+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CXX"; then
+ ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+ echo "$as_me:$LINENO: result: $CXX" >&5
+echo "${ECHO_T}$CXX" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$CXX" && break
+ done
+fi
+if test -z "$CXX"; then
+ ac_ct_CXX=$CXX
+ for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CXX"; then
+ ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CXX="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
+echo "${ECHO_T}$ac_ct_CXX" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$ac_ct_CXX" && break
+done
+test -n "$ac_ct_CXX" || ac_ct_CXX="g++"
+
+ CXX=$ac_ct_CXX
+fi
+
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+ "checking for C++ compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+ (eval $ac_compiler --version </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+ (eval $ac_compiler -v </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+ (eval $ac_compiler -V </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6
+if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_compiler_gnu=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6
+GXX=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+CXXFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
+echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cxx_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cxx_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cxx_g=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6
+if test "$ac_test_CXXFLAGS" = set; then
+ CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+ if test "$GXX" = yes; then
+ CXXFLAGS="-g -O2"
+ else
+ CXXFLAGS="-g"
+ fi
+else
+ if test "$GXX" = yes; then
+ CXXFLAGS="-O2"
+ else
+ CXXFLAGS=
+ fi
+fi
+for ac_declaration in \
+ '' \
+ 'extern "C" void std::exit (int) throw (); using std::exit;' \
+ 'extern "C" void std::exit (int); using std::exit;' \
+ 'extern "C" void exit (int) throw ();' \
+ 'extern "C" void exit (int);' \
+ 'void exit (int);'
+do
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+#include <stdlib.h>
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+ echo '#ifdef __cplusplus' >>confdefs.h
+ echo $ac_declaration >>confdefs.h
+ echo '#endif' >>confdefs.h
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CXX" am_compiler_list=
+
+echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CXX_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+ am_cv_CXX_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CXX_dependencies_compiler_type=none
+fi
+
+fi
+echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+
+
+
+if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+ am__fastdepCXX_TRUE=
+ am__fastdepCXX_FALSE='#'
+else
+ am__fastdepCXX_TRUE='#'
+ am__fastdepCXX_FALSE=
+fi
+
+
+# Extract the first word of "ld", so it can be a program name with args.
+set dummy ld; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_LD+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$LD"; then
+ ac_cv_prog_LD="$LD" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_LD="ld"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+LD=$ac_cv_prog_LD
+if test -n "$LD"; then
+ echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+test "$LD" || { { echo "$as_me:$LINENO: error: ld not found" >&5
+echo "$as_me: error: ld not found" >&2;}
+ { (exit 1); exit 1; }; }
+
+
+echo "$as_me:$LINENO: checking for kernel OProfile support" >&5
+echo $ECHO_N "checking for kernel OProfile support... $ECHO_C" >&6
+
+# Check whether --with-kernel-support or --without-kernel-support was given.
+if test "${with_kernel_support+set}" = set; then
+ withval="$with_kernel_support"
+ if test "$withval" = "yes"; then
+ OPROFILE_26=yes
+fi
+
+fi;
+
+if test "$OPROFILE_26" != "yes"; then
+
+
+ KSRC=/lib/modules/`uname -r`/build
+
+# Check whether --with-linux or --without-linux was given.
+if test "${with_linux+set}" = set; then
+ withval="$with_linux"
+ KSRC=$withval
+fi;
+ KINC=$KSRC/include
+
+
+
+SAVE_CFLAGS=$CFLAGS
+CFLAGS="-I$KINC -O2 -D__KERNEL__"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <linux/autoconf.h>
+int
+main ()
+{
+
+#ifndef CONFIG_OPROFILE
+break_me_hard(\\\);
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ OPROFILE_26=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+OPROFILE_26=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+CFLAGS=$SAVE_CFLAGS
+
+
+SAVE_CFLAGS=$CFLAGS
+CFLAGS="-I$KINC -O2 -D__KERNEL__"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <linux/autoconf.h>
+int
+main ()
+{
+
+#ifndef CONFIG_OPROFILE_MODULE
+break_me_hard(\\\);
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ OPROFILE_26=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+OPROFILE_26=$OPROFILE_26
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+CFLAGS=$SAVE_CFLAGS
+
+fi
+echo "$as_me:$LINENO: result: $OPROFILE_26" >&5
+echo "${ECHO_T}$OPROFILE_26" >&6
+
+
+
+if test "$OPROFILE_26" = yes; then
+ kernel_support_TRUE=
+ kernel_support_FALSE='#'
+else
+ kernel_support_TRUE='#'
+ kernel_support_FALSE=
+fi
+
+
+
+
+if test "$OPROFILE_26" = "no"; then
+
+if test ! -f $KINC/linux/autoconf.h; then
+ { { echo "$as_me:$LINENO: error: no suitably configured kernel include tree found" >&5
+echo "$as_me: error: no suitably configured kernel include tree found" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+
+
+echo "$as_me:$LINENO: checking for kernel version" >&5
+echo $ECHO_N "checking for kernel version... $ECHO_C" >&6
+eval KVERS=`gcc -I$KINC -E -dM $KINC/linux/version.h | grep -w UTS_RELEASE | awk '{print $3}'`
+echo "$as_me:$LINENO: result: $KVERS" >&5
+echo "${ECHO_T}$KVERS" >&6
+case "$KVERS" in
+2.2.*|2.4.*) ;;
+*) { { echo "$as_me:$LINENO: error: Unsupported kernel version" >&5
+echo "$as_me: error: Unsupported kernel version" >&2;}
+ { (exit 1); exit 1; }; }
+esac
+
+echo "$as_me:$LINENO: checking kernel version" >&5
+echo $ECHO_N "checking kernel version... $ECHO_C" >&6
+
+SAVE_CFLAGS=$CFLAGS
+CFLAGS="-I$KINC -D__KERNEL__ -Werror"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+ #include <linux/version.h>
+
+int
+main ()
+{
+
+ #if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 2, 10)
+ break_me_hard(\\\);
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ echo "$as_me:$LINENO: result: ok" >&5
+echo "${ECHO_T}ok" >&6
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: check html documentation install section" >&5
+echo "$as_me: error: check html documentation install section" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+CFLAGS=$SAVE_CFLAGS
+
+
+echo "$as_me:$LINENO: checking for $KINC/linux/spinlock.h" >&5
+echo $ECHO_N "checking for $KINC/linux/spinlock.h... $ECHO_C" >&6
+if test -f $KINC/linux/spinlock.h; then
+ EXTRA_CFLAGS_MODULE="$EXTRA_CFLAGS_MODULE -DHAVE_LINUX_SPINLOCK_HEADER"
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+echo "$as_me:$LINENO: checking for rtc_lock" >&5
+echo $ECHO_N "checking for rtc_lock... $ECHO_C" >&6
+gcc -I$KINC -E $KINC/linux/mc146818rtc.h | grep rtc_lock >/dev/null
+if test "$?" -eq 0; then
+ EXTRA_CFLAGS_MODULE="$EXTRA_CFLAGS_MODULE -DRTC_LOCK"
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+arch="unknown"
+echo "$as_me:$LINENO: checking for x86 architecture" >&5
+echo $ECHO_N "checking for x86 architecture... $ECHO_C" >&6
+
+SAVE_CFLAGS=$CFLAGS
+CFLAGS="-I$KINC -O2 -D__KERNEL__"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <linux/autoconf.h>
+int
+main ()
+{
+
+#ifndef CONFIG_X86
+break_me_hard(\\\);
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ x86=1
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+x86=0
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+CFLAGS=$SAVE_CFLAGS
+
+
+SAVE_CFLAGS=$CFLAGS
+CFLAGS="-I$KINC -O2 -D__KERNEL__"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <linux/autoconf.h>
+int
+main ()
+{
+
+#ifndef CONFIG_X86_WP_WORKS_OK
+break_me_hard(\\\);
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ x86=1
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+x86=$x86
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+CFLAGS=$SAVE_CFLAGS
+
+x=no
+test "x$x86" = "x1" && x=yes
+echo "$as_me:$LINENO: result: $x" >&5
+echo "${ECHO_T}$x" >&6
+test "$x86" = 1 && arch="x86"
+
+if test "$arch" = "unknown"; then
+ echo "$as_me:$LINENO: checking for ia64 architecture" >&5
+echo $ECHO_N "checking for ia64 architecture... $ECHO_C" >&6
+
+SAVE_CFLAGS=$CFLAGS
+CFLAGS="-I$KINC -O2 -D__KERNEL__"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <linux/autoconf.h>
+int
+main ()
+{
+
+#ifndef CONFIG_IA64
+break_me_hard(\\\);
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ia64=1
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ia64=0
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+CFLAGS=$SAVE_CFLAGS
+
+ x=no
+test "x$ia64" = "x1" && x=yes
+echo "$as_me:$LINENO: result: $x" >&5
+echo "${ECHO_T}$x" >&6
+ test "$ia64" = 1 && arch="ia64"
+fi
+
+test "$arch" = "unknown" && { { echo "$as_me:$LINENO: error: Unsupported architecture" >&5
+echo "$as_me: error: Unsupported architecture" >&2;}
+ { (exit 1); exit 1; }; }
+
+echo "$as_me:$LINENO: checking arch/kernel version combination" >&5
+echo $ECHO_N "checking arch/kernel version combination... $ECHO_C" >&6
+case "$arch" in
+ia64)
+
+SAVE_CFLAGS=$CFLAGS
+CFLAGS="-I$KINC -D__KERNEL__ -Werror"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+ #include <linux/version.h>
+
+int
+main ()
+{
+
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 18)
+ break_me_hard(\\\);
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ echo "$as_me:$LINENO: result: ok" >&5
+echo "${ECHO_T}ok" >&6
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: unsupported arch/kernel" >&5
+echo "$as_me: error: unsupported arch/kernel" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+CFLAGS=$SAVE_CFLAGS
+ ;;
+*) echo "$as_me:$LINENO: result: ok" >&5
+echo "${ECHO_T}ok" >&6
+esac
+
+echo "$as_me:$LINENO: checking for preempt patch" >&5
+echo $ECHO_N "checking for preempt patch... $ECHO_C" >&6
+
+SAVE_CFLAGS=$CFLAGS
+CFLAGS="-I$KINC -O2 -D__KERNEL__"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <linux/autoconf.h>
+int
+main ()
+{
+
+#ifndef CONFIG_PREEMPT
+break_me_hard(\\\);
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ preempt=1
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+preempt=0
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+CFLAGS=$SAVE_CFLAGS
+
+x=no
+test "x$preempt" = "x1" && x=yes
+echo "$as_me:$LINENO: result: $x" >&5
+echo "${ECHO_T}$x" >&6
+test "$preempt" = 0 || { { echo "$as_me:$LINENO: error: unsupported kernel configuration : CONFIG_PREEMPT" >&5
+echo "$as_me: error: unsupported kernel configuration : CONFIG_PREEMPT" >&2;}
+ { (exit 1); exit 1; }; }
+
+
+
+MODINSTALLDIR=/lib/modules/$KVERS
+
+OPROFILE_MODULE_ARCH=$arch
+
+
+
+fi
+
+
+# Check whether --with-module-dir or --without-module-dir was given.
+if test "${with_module_dir+set}" = set; then
+ withval="$with_module_dir"
+ MODINSTALLDIR=$withval
+fi;
+
+
+
+# Check whether --with-java or --without-java was given.
+if test "${with_java+set}" = set; then
+ withval="$with_java"
+ JAVA_HOMEDIR=$withval
+fi;
+
+
+if test -n "$JAVA_HOMEDIR"; then
+ as_ac_File=`echo "ac_cv_file_"$JAVA_HOMEDIR/include/jvmti.h"" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for \"$JAVA_HOMEDIR/include/jvmti.h\"" >&5
+echo $ECHO_N "checking for \"$JAVA_HOMEDIR/include/jvmti.h\"... $ECHO_C" >&6
+if eval "test \"\${$as_ac_File+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ test "$cross_compiling" = yes &&
+ { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5
+echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
+ { (exit 1); exit 1; }; }
+if test -r ""$JAVA_HOMEDIR/include/jvmti.h""; then
+ eval "$as_ac_File=yes"
+else
+ eval "$as_ac_File=no"
+fi
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6
+if test `eval echo '${'$as_ac_File'}'` = yes; then
+ JVMTI_H_EXISTS="yes"
+fi
+
+ as_ac_File=`echo "ac_cv_file_"$JAVA_HOMEDIR/include/jvmpi.h"" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for \"$JAVA_HOMEDIR/include/jvmpi.h\"" >&5
+echo $ECHO_N "checking for \"$JAVA_HOMEDIR/include/jvmpi.h\"... $ECHO_C" >&6
+if eval "test \"\${$as_ac_File+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ test "$cross_compiling" = yes &&
+ { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5
+echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
+ { (exit 1); exit 1; }; }
+if test -r ""$JAVA_HOMEDIR/include/jvmpi.h""; then
+ eval "$as_ac_File=yes"
+else
+ eval "$as_ac_File=no"
+fi
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6
+if test `eval echo '${'$as_ac_File'}'` = yes; then
+ JVMPI_H_EXISTS="yes"
+fi
+
+fi
+
+
+
+if test -n "$JVMTI_H_EXISTS"; then
+ BUILD_JVMTI_AGENT_TRUE=
+ BUILD_JVMTI_AGENT_FALSE='#'
+else
+ BUILD_JVMTI_AGENT_TRUE='#'
+ BUILD_JVMTI_AGENT_FALSE=
+fi
+
+
+
+if test -n "$JVMPI_H_EXISTS"; then
+ BUILD_JVMPI_AGENT_TRUE=
+ BUILD_JVMPI_AGENT_FALSE='#'
+else
+ BUILD_JVMPI_AGENT_TRUE='#'
+ BUILD_JVMPI_AGENT_FALSE=
+fi
+
+
+
+echo "$as_me:$LINENO: checking whether malloc attribute is understood" >&5
+echo $ECHO_N "checking whether malloc attribute is understood... $ECHO_C" >&6
+SAVE_CFLAGS=$CFLAGS
+CFLAGS="-Werror $CFLAGS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+void monkey() __attribute__((malloc));
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6;
+cat >>confdefs.h <<\_ACEOF
+#define MALLOC_ATTRIBUTE_OK 1
+_ACEOF
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+CFLAGS=$SAVE_CFLAGS
+
+
+
+echo "$as_me:$LINENO: checking whether __builtin_expect is understood" >&5
+echo $ECHO_N "checking whether __builtin_expect is understood... $ECHO_C" >&6
+SAVE_CFLAGS=$CFLAGS
+CFLAGS="-Werror $CFLAGS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+int i;
+if (__builtin_expect(i, 0)) { }
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; EXTRA_CFLAGS_MODULE="$EXTRA_CFLAGS_MODULE -DEXPECT_OK"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6;
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+CFLAGS=$SAVE_CFLAGS
+
+
+
+
+
+topdir=`pwd`
+
+
+
+
+# Check whether --with-extra-includes or --without-extra-includes was given.
+if test "${with_extra_includes+set}" = set; then
+ withval="$with_extra_includes"
+ use_extra_includes="$withval"
+else
+ use_extra_includes=NO
+
+fi;
+if test -n "$use_extra_includes" && \
+ test "$use_extra_includes" != "NO"; then
+ ac_save_ifs=$IFS
+ IFS=':'
+ for dir in $use_extra_includes; do
+ extra_includes="$extra_includes -I$dir"
+ done
+ IFS=$ac_save_ifs
+ CPPFLAGS="$CPPFLAGS $extra_includes"
+fi
+
+
+# Check whether --with-extra-libs or --without-extra-libs was given.
+if test "${with_extra_libs+set}" = set; then
+ withval="$with_extra_libs"
+ use_extra_libs=$withval
+else
+ use_extra_libs=NO
+
+fi;
+if test -n "$use_extra_libs" && \
+ test "$use_extra_libs" != "NO"; then
+ ac_save_ifs=$IFS
+ IFS=':'
+ for dir in $use_extra_libs; do
+ extra_libraries="$extra_libraries -L$dir"
+ done
+ IFS=$ac_save_ifs
+ LDFLAGS="$LDFLAGS $extra_libraries"
+fi
+
+
+
+ORIG_SAVE_LIBS="$LIBS"
+
+
+
+for ac_func in sched_setaffinity perfmonctl
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+echo "$as_me:$LINENO: checking for poptGetContext in -lpopt" >&5
+echo $ECHO_N "checking for poptGetContext in -lpopt... $ECHO_C" >&6
+if test "${ac_cv_lib_popt_poptGetContext+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpopt $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char poptGetContext ();
+int
+main ()
+{
+poptGetContext ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_popt_poptGetContext=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_popt_poptGetContext=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_popt_poptGetContext" >&5
+echo "${ECHO_T}$ac_cv_lib_popt_poptGetContext" >&6
+if test $ac_cv_lib_popt_poptGetContext = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBPOPT 1
+_ACEOF
+
+ LIBS="-lpopt $LIBS"
+
+else
+ { { echo "$as_me:$LINENO: error: popt library not found" >&5
+echo "$as_me: error: popt library not found" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+
+
+for ac_header in libiberty.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists. ##
+## ------------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+echo "$as_me:$LINENO: checking for cplus_demangle in -liberty" >&5
+echo $ECHO_N "checking for cplus_demangle in -liberty... $ECHO_C" >&6
+if test "${ac_cv_lib_iberty_cplus_demangle+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-liberty $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char cplus_demangle ();
+int
+main ()
+{
+cplus_demangle ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_iberty_cplus_demangle=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_iberty_cplus_demangle=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_iberty_cplus_demangle" >&5
+echo "${ECHO_T}$ac_cv_lib_iberty_cplus_demangle" >&6
+if test $ac_cv_lib_iberty_cplus_demangle = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBIBERTY 1
+_ACEOF
+
+ LIBS="-liberty $LIBS"
+
+else
+ { { echo "$as_me:$LINENO: error: liberty library not found" >&5
+echo "$as_me: error: liberty library not found" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+
+for ac_func in xcalloc
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+for ac_func in xmemdup
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dl_dlopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+ LIBS="$LIBS -ldl"; DL_LIB="-ldl"
+else
+ DL_LIB=""
+fi
+
+echo "$as_me:$LINENO: checking for main in -lintl" >&5
+echo $ECHO_N "checking for main in -lintl... $ECHO_C" >&6
+if test "${ac_cv_lib_intl_main+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lintl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+
+int
+main ()
+{
+main ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_intl_main=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_intl_main=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_intl_main" >&5
+echo "${ECHO_T}$ac_cv_lib_intl_main" >&6
+if test $ac_cv_lib_intl_main = yes; then
+ LIBS="$LIBS -lintl"; INTL_LIB="-lintl"
+else
+ INTL_LIB=""
+fi
+
+
+echo "$as_me:$LINENO: checking for bfd_openr in -lbfd" >&5
+echo $ECHO_N "checking for bfd_openr in -lbfd... $ECHO_C" >&6
+if test "${ac_cv_lib_bfd_bfd_openr+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lbfd $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char bfd_openr ();
+int
+main ()
+{
+bfd_openr ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_bfd_bfd_openr=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_bfd_bfd_openr=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_bfd_bfd_openr" >&5
+echo "${ECHO_T}$ac_cv_lib_bfd_bfd_openr" >&6
+if test $ac_cv_lib_bfd_bfd_openr = yes; then
+ LIBS="-lbfd $LIBS"; Z_LIB=""
+else
+ echo "$as_me:$LINENO: checking for compress in -lz" >&5
+echo $ECHO_N "checking for compress in -lz... $ECHO_C" >&6
+if test "${ac_cv_lib_z_compress+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lz $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char compress ();
+int
+main ()
+{
+compress ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_z_compress=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_z_compress=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_z_compress" >&5
+echo "${ECHO_T}$ac_cv_lib_z_compress" >&6
+if test $ac_cv_lib_z_compress = yes; then
+ echo "$as_me:$LINENO: checking for bfd_fdopenr in -lbfd" >&5
+echo $ECHO_N "checking for bfd_fdopenr in -lbfd... $ECHO_C" >&6
+if test "${ac_cv_lib_bfd_bfd_fdopenr+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lbfd -lz $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char bfd_fdopenr ();
+int
+main ()
+{
+bfd_fdopenr ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_bfd_bfd_fdopenr=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_bfd_bfd_fdopenr=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_bfd_bfd_fdopenr" >&5
+echo "${ECHO_T}$ac_cv_lib_bfd_bfd_fdopenr" >&6
+if test $ac_cv_lib_bfd_bfd_fdopenr = yes; then
+ LIBS="-lbfd -lz $LIBS"; Z_LIB="-lz"
+else
+ { { echo "$as_me:$LINENO: error: bfd library not found" >&5
+echo "$as_me: error: bfd library not found" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+
+else
+ { { echo "$as_me:$LINENO: error: libz library not found; required by libbfd" >&5
+echo "$as_me: error: libz library not found; required by libbfd" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+
+
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+# Determine if bfd_get_synthetic_symtab macro is available
+OS="`uname`"
+if test "$OS" = "Linux"; then
+ echo "$as_me:$LINENO: checking whether bfd_get_synthetic_symtab() exists in BFD library" >&5
+echo $ECHO_N "checking whether bfd_get_synthetic_symtab() exists in BFD library... $ECHO_C" >&6
+ rm -f test-for-synth
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <bfd.h>
+int
+main ()
+{
+asymbol * synthsyms; bfd * ibfd = 0;
+ long synth_count = bfd_get_synthetic_symtab(ibfd, 0, 0, 0, 0, &synthsyms);
+ extern const bfd_target bfd_elf64_powerpc_vec;
+ extern const bfd_target bfd_elf64_powerpcle_vec;
+ char * ppc_name = bfd_elf64_powerpc_vec.name;
+ char * ppcle_name = bfd_elf64_powerpcle_vec.name;
+ printf("%s %s\n", ppc_name, ppcle_name);
+ ;
+ return 0;
+}
+
+_ACEOF
+ $CC conftest.$ac_ext $CFLAGS $LDFLAGS $LIBS -o test-for-synth > /dev/null 2>&1
+ if test -f test-for-synth; then
+ echo "yes"
+ SYNTHESIZE_SYMBOLS='1'
+ else
+ echo "no"
+ SYNTHESIZE_SYMBOLS='0'
+ fi
+
+cat >>confdefs.h <<_ACEOF
+#define SYNTHESIZE_SYMBOLS $SYNTHESIZE_SYMBOLS
+_ACEOF
+
+ rm -f test-for-synth*
+
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+# On Cell BE architecture, OProfile uses bfd_openr_iovec when processing some
+# SPU profiles. To parse embedded SPU ELF on Cell BE, OProfile requires a
+# version of bfd_openr_iovec that supports the elf32-spu target.
+# This version of the function also has a 7th parameter that's been added.
+# First, we check for existence of the base bfd_openr_iovec. If it exists,
+# we then use a temporary test program below that passes 7 arguments to
+# bfd_openr_iovec; if it compiles OK, we assume we have the right BFD
+# library to support Cell BE SPU profiling.
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+echo "$as_me:$LINENO: checking for bfd_openr_iovec in -lbfd" >&5
+echo $ECHO_N "checking for bfd_openr_iovec in -lbfd... $ECHO_C" >&6
+if test "${ac_cv_lib_bfd_bfd_openr_iovec+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lbfd $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char bfd_openr_iovec ();
+int
+main ()
+{
+bfd_openr_iovec ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_bfd_bfd_openr_iovec=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_bfd_bfd_openr_iovec=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_bfd_bfd_openr_iovec" >&5
+echo "${ECHO_T}$ac_cv_lib_bfd_bfd_openr_iovec" >&6
+if test $ac_cv_lib_bfd_bfd_openr_iovec = yes; then
+ bfd_openr_iovec_exists="yes"
+else
+ bfd_openr_iovec_exists="no"
+
+fi
+
+
+if test "$bfd_openr_iovec_exists" = "yes"; then
+ echo "$as_me:$LINENO: checking whether bfd_openr_iovec has seven parameters" >&5
+echo $ECHO_N "checking whether bfd_openr_iovec has seven parameters... $ECHO_C" >&6
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <bfd.h>
+ #include <stdlib.h>
+
+int
+main ()
+{
+struct bfd *nbfd = bfd_openr_iovec("some-file", "elf32-spu",
+ NULL, NULL, NULL, NULL, NULL);
+ return 0;
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_BFD_OPENR_IOVEC_WITH_7PARMS
+_ACEOF
+
+ bfd_open_iovec_7="yes"
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+arch="unknown"
+
+# Check whether --with-target or --without-target was given.
+if test "${with_target+set}" = set; then
+ withval="$with_target"
+ arch=$withval
+fi;
+
+if test "$arch" = "cell-be"; then
+ if test "$bfd_open_iovec_7" = "yes"; then
+ { echo "$as_me:$LINENO: BFD library has support for Cell Broadband Engine SPU profiling" >&5
+echo "$as_me: BFD library has support for Cell Broadband Engine SPU profiling" >&6;}
+ else
+ { { echo "$as_me:$LINENO: error: BFD library does not support elf32-spu target; SPU profiling is unsupported" >&5
+echo "$as_me: error: BFD library does not support elf32-spu target; SPU profiling is unsupported" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+fi
+
+
+
+# C++ tests
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+echo "$as_me:$LINENO: checking popt prototype" >&5
+echo $ECHO_N "checking popt prototype... $ECHO_C" >&6
+SAVE_CXXFLAGS=$CXXFLAGS
+CXXFLAGS="-Werror $CXXFLAGS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <popt.h>
+int
+main ()
+{
+
+int c; char **v;
+poptGetContext(0, c, v, 0, 0);
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ echo "$as_me:$LINENO: result: takes char **" >&5
+echo "${ECHO_T}takes char **" >&6;
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: takes const char **" >&5
+echo "${ECHO_T}takes const char **" >&6;
+cat >>confdefs.h <<\_ACEOF
+#define CONST_POPT 1
+_ACEOF
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+CXXFLAGS="$SAVE_CXXFLAGS"
+
+
+
+echo "$as_me:$LINENO: checking whether to use included sstream" >&5
+echo $ECHO_N "checking whether to use included sstream... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sstream>
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6;
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; OP_CXXFLAGS="$OP_CXXFLAGS -I\${top_srcdir}/include"
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
+
+echo "$as_me:$LINENO: checking whether bfd defines bool" >&5
+echo $ECHO_N "checking whether bfd defines bool... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <bfd.h>
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6;
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6;
+cat >>confdefs.h <<\_ACEOF
+#define TRUE_FALSE_ALREADY_DEFINED 1
+_ACEOF
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
+ echo "$as_me:$LINENO: checking type of size_t" >&5
+echo $ECHO_N "checking type of size_t... $ECHO_C" >&6
+ for f in "unsigned" "unsigned long"; do
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+SAVE_CFLAGS=$CFLAGS
+CFLAGS="-Werror $CFLAGS"
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+ #include <stddef.h>
+
+int
+main ()
+{
+
+ typedef void (*fct1)(size_t);
+ typedef void (*fct2)($f);
+ fct1 f1 = 0;
+ fct2 f2 = 0;
+ if (f1 == f2) {}
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ SIZE_T_TYPE="$f"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+SIZE_T_TYPE=""
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+CFLAGS=$SAVE_CFLAGS
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+ if test -n "${SIZE_T_TYPE}"; then
+ break
+ fi
+ done
+ if test -n "${SIZE_T_TYPE}"; then
+ echo "$as_me:$LINENO: result: ${SIZE_T_TYPE}" >&5
+echo "${ECHO_T}${SIZE_T_TYPE}" >&6
+ else
+ { { echo "$as_me:$LINENO: error: not found" >&5
+echo "$as_me: error: not found" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+
+
+ echo "$as_me:$LINENO: checking type of ptrdiff_t" >&5
+echo $ECHO_N "checking type of ptrdiff_t... $ECHO_C" >&6
+ for f in "int" "long"; do
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+SAVE_CFLAGS=$CFLAGS
+CFLAGS="-Werror $CFLAGS"
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+ #include <stddef.h>
+
+int
+main ()
+{
+
+ typedef void (*fct1)(ptrdiff_t);
+ typedef void (*fct2)($f);
+ fct1 f1 = 0;
+ fct2 f2 = 0;
+ if (f1 == f2) {}
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ PTRDIFF_T_TYPE="$f"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+PTRDIFF_T_TYPE=""
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+CFLAGS=$SAVE_CFLAGS
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+ if test -n "${PTRDIFF_T_TYPE}"; then
+ break
+ fi
+ done
+ if test -n "${PTRDIFF_T_TYPE}"; then
+ echo "$as_me:$LINENO: result: ${PTRDIFF_T_TYPE}" >&5
+echo "${ECHO_T}${PTRDIFF_T_TYPE}" >&6
+ else
+ { { echo "$as_me:$LINENO: error: not found" >&5
+echo "$as_me: error: not found" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+
+
+
+echo "$as_me:$LINENO: checking for X" >&5
+echo $ECHO_N "checking for X... $ECHO_C" >&6
+
+
+# Check whether --with-x or --without-x was given.
+if test "${with_x+set}" = set; then
+ withval="$with_x"
+
+fi;
+# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
+if test "x$with_x" = xno; then
+ # The user explicitly disabled X.
+ have_x=disabled
+else
+ if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
+ # Both variables are already set.
+ have_x=yes
+ else
+ if test "${ac_cv_have_x+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # One or both of the vars are not set, and there is no cached value.
+ac_x_includes=no ac_x_libraries=no
+rm -fr conftest.dir
+if mkdir conftest.dir; then
+ cd conftest.dir
+ # Make sure to not put "make" in the Imakefile rules, since we grep it out.
+ cat >Imakefile <<'_ACEOF'
+acfindx:
+ @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
+_ACEOF
+ if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
+ # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+ eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
+ # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
+ for ac_extension in a so sl; do
+ if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
+ test -f $ac_im_libdir/libX11.$ac_extension; then
+ ac_im_usrlibdir=$ac_im_libdir; break
+ fi
+ done
+ # Screen out bogus values from the imake configuration. They are
+ # bogus both because they are the default anyway, and because
+ # using them would break gcc on systems where it needs fixed includes.
+ case $ac_im_incroot in
+ /usr/include) ;;
+ *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
+ esac
+ case $ac_im_usrlibdir in
+ /usr/lib | /lib) ;;
+ *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
+ esac
+ fi
+ cd ..
+ rm -fr conftest.dir
+fi
+
+# Standard set of common directories for X headers.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+ac_x_header_dirs='
+/usr/X11/include
+/usr/X11R6/include
+/usr/X11R5/include
+/usr/X11R4/include
+
+/usr/include/X11
+/usr/include/X11R6
+/usr/include/X11R5
+/usr/include/X11R4
+
+/usr/local/X11/include
+/usr/local/X11R6/include
+/usr/local/X11R5/include
+/usr/local/X11R4/include
+
+/usr/local/include/X11
+/usr/local/include/X11R6
+/usr/local/include/X11R5
+/usr/local/include/X11R4
+
+/usr/X386/include
+/usr/x386/include
+/usr/XFree86/include/X11
+
+/usr/include
+/usr/local/include
+/usr/unsupported/include
+/usr/athena/include
+/usr/local/x11r5/include
+/usr/lpp/Xamples/include
+
+/usr/openwin/include
+/usr/openwin/share/include'
+
+if test "$ac_x_includes" = no; then
+ # Guess where to find include files, by looking for Intrinsic.h.
+ # First, try using that file with no special directory specified.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <X11/Intrinsic.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_cxx_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # We can compile using X headers with no special include directory.
+ac_x_includes=
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ for ac_dir in $ac_x_header_dirs; do
+ if test -r "$ac_dir/X11/Intrinsic.h"; then
+ ac_x_includes=$ac_dir
+ break
+ fi
+done
+fi
+rm -f conftest.err conftest.$ac_ext
+fi # $ac_x_includes = no
+
+if test "$ac_x_libraries" = no; then
+ # Check for the libraries.
+ # See if we find them without any special options.
+ # Don't add to $LIBS permanently.
+ ac_save_LIBS=$LIBS
+ LIBS="-lXt $LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <X11/Intrinsic.h>
+int
+main ()
+{
+XtMalloc (0)
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ LIBS=$ac_save_LIBS
+# We can link X programs with no special library path.
+ac_x_libraries=
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+LIBS=$ac_save_LIBS
+for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
+do
+ # Don't even attempt the hair of trying to link an X program!
+ for ac_extension in a so sl; do
+ if test -r $ac_dir/libXt.$ac_extension; then
+ ac_x_libraries=$ac_dir
+ break 2
+ fi
+ done
+done
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi # $ac_x_libraries = no
+
+if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
+ # Didn't find X anywhere. Cache the known absence of X.
+ ac_cv_have_x="have_x=no"
+else
+ # Record where we found X for the cache.
+ ac_cv_have_x="have_x=yes \
+ ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
+fi
+fi
+
+ fi
+ eval "$ac_cv_have_x"
+fi # $with_x != no
+
+if test "$have_x" != yes; then
+ echo "$as_me:$LINENO: result: $have_x" >&5
+echo "${ECHO_T}$have_x" >&6
+ no_x=yes
+else
+ # If each of the values was on the command line, it overrides each guess.
+ test "x$x_includes" = xNONE && x_includes=$ac_x_includes
+ test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
+ # Update the cache value to reflect the command line values.
+ ac_cv_have_x="have_x=yes \
+ ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
+ echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5
+echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
+fi
+
+if test "$no_x" = yes; then
+ # Not all programs may use this symbol, but it does not hurt to define it.
+
+cat >>confdefs.h <<\_ACEOF
+#define X_DISPLAY_MISSING 1
+_ACEOF
+
+ X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
+else
+ if test -n "$x_includes"; then
+ X_CFLAGS="$X_CFLAGS -I$x_includes"
+ fi
+
+ # It would also be nice to do this for all -L options, not just this one.
+ if test -n "$x_libraries"; then
+ X_LIBS="$X_LIBS -L$x_libraries"
+ # For Solaris; some versions of Sun CC require a space after -R and
+ # others require no space. Words are not sufficient . . . .
+ case `(uname -sr) 2>/dev/null` in
+ "SunOS 5"*)
+ echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5
+echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
+ ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_R_nospace=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_R_nospace=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test $ac_R_nospace = yes; then
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ X_LIBS="$X_LIBS -R$x_libraries"
+ else
+ LIBS="$ac_xsave_LIBS -R $x_libraries"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_R_space=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_R_space=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ if test $ac_R_space = yes; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ X_LIBS="$X_LIBS -R $x_libraries"
+ else
+ echo "$as_me:$LINENO: result: neither works" >&5
+echo "${ECHO_T}neither works" >&6
+ fi
+ fi
+ LIBS=$ac_xsave_LIBS
+ esac
+ fi
+
+ # Check for system-dependent libraries X programs must link with.
+ # Do this before checking for the system-independent R6 libraries
+ # (-lICE), since we may need -lsocket or whatever for X linking.
+
+ if test "$ISC" = yes; then
+ X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
+ else
+ # Martyn Johnson says this is needed for Ultrix, if the X
+ # libraries were built with DECnet support. And Karl Berry says
+ # the Alpha needs dnet_stub (dnet does not exist).
+ ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char XOpenDisplay ();
+int
+main ()
+{
+XOpenDisplay ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5
+echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
+if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldnet $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dnet_ntoa ();
+int
+main ()
+{
+dnet_ntoa ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dnet_dnet_ntoa=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dnet_dnet_ntoa=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
+echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
+if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
+ X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
+fi
+
+ if test $ac_cv_lib_dnet_dnet_ntoa = no; then
+ echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5
+echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
+if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldnet_stub $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dnet_ntoa ();
+int
+main ()
+{
+dnet_ntoa ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dnet_stub_dnet_ntoa=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dnet_stub_dnet_ntoa=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
+echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
+if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
+ X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
+fi
+
+ fi
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$ac_xsave_LIBS"
+
+ # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
+ # to get the SysV transport functions.
+ # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
+ # needs -lnsl.
+ # The nsl library prevents programs from opening the X display
+ # on Irix 5.2, according to T.E. Dickey.
+ # The functions gethostbyname, getservbyname, and inet_addr are
+ # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
+ echo "$as_me:$LINENO: checking for gethostbyname" >&5
+echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
+if test "${ac_cv_func_gethostbyname+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define gethostbyname to an innocuous variant, in case <limits.h> declares gethostbyname.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define gethostbyname innocuous_gethostbyname
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char gethostbyname (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef gethostbyname
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char gethostbyname ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
+choke me
+#else
+char (*f) () = gethostbyname;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != gethostbyname;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_gethostbyname=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_gethostbyname=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5
+echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
+
+ if test $ac_cv_func_gethostbyname = no; then
+ echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5
+echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
+if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char gethostbyname ();
+int
+main ()
+{
+gethostbyname ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_nsl_gethostbyname=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_nsl_gethostbyname=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5
+echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
+if test $ac_cv_lib_nsl_gethostbyname = yes; then
+ X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
+fi
+
+ if test $ac_cv_lib_nsl_gethostbyname = no; then
+ echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5
+echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
+if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lbsd $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char gethostbyname ();
+int
+main ()
+{
+gethostbyname ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_bsd_gethostbyname=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_bsd_gethostbyname=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5
+echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
+if test $ac_cv_lib_bsd_gethostbyname = yes; then
+ X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
+fi
+
+ fi
+ fi
+
+ # lieder@skyler.mavd.honeywell.com says without -lsocket,
+ # socket/setsockopt and other routines are undefined under SCO ODT
+ # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary
+ # on later versions), says Simon Leinen: it contains gethostby*
+ # variants that don't use the name server (or something). -lsocket
+ # must be given before -lnsl if both are needed. We assume that
+ # if connect needs -lnsl, so does gethostbyname.
+ echo "$as_me:$LINENO: checking for connect" >&5
+echo $ECHO_N "checking for connect... $ECHO_C" >&6
+if test "${ac_cv_func_connect+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define connect to an innocuous variant, in case <limits.h> declares connect.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define connect innocuous_connect
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char connect (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef connect
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char connect ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_connect) || defined (__stub___connect)
+choke me
+#else
+char (*f) () = connect;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != connect;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_connect=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_connect=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5
+echo "${ECHO_T}$ac_cv_func_connect" >&6
+
+ if test $ac_cv_func_connect = no; then
+ echo "$as_me:$LINENO: checking for connect in -lsocket" >&5
+echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
+if test "${ac_cv_lib_socket_connect+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char connect ();
+int
+main ()
+{
+connect ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_socket_connect=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_socket_connect=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5
+echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
+if test $ac_cv_lib_socket_connect = yes; then
+ X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
+fi
+
+ fi
+
+ # Guillermo Gomez says -lposix is necessary on A/UX.
+ echo "$as_me:$LINENO: checking for remove" >&5
+echo $ECHO_N "checking for remove... $ECHO_C" >&6
+if test "${ac_cv_func_remove+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define remove to an innocuous variant, in case <limits.h> declares remove.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define remove innocuous_remove
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char remove (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef remove
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char remove ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_remove) || defined (__stub___remove)
+choke me
+#else
+char (*f) () = remove;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != remove;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_remove=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_remove=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5
+echo "${ECHO_T}$ac_cv_func_remove" >&6
+
+ if test $ac_cv_func_remove = no; then
+ echo "$as_me:$LINENO: checking for remove in -lposix" >&5
+echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
+if test "${ac_cv_lib_posix_remove+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lposix $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char remove ();
+int
+main ()
+{
+remove ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_posix_remove=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_posix_remove=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5
+echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
+if test $ac_cv_lib_posix_remove = yes; then
+ X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
+fi
+
+ fi
+
+ # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
+ echo "$as_me:$LINENO: checking for shmat" >&5
+echo $ECHO_N "checking for shmat... $ECHO_C" >&6
+if test "${ac_cv_func_shmat+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define shmat to an innocuous variant, in case <limits.h> declares shmat.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define shmat innocuous_shmat
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char shmat (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef shmat
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char shmat ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_shmat) || defined (__stub___shmat)
+choke me
+#else
+char (*f) () = shmat;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != shmat;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_shmat=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_shmat=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5
+echo "${ECHO_T}$ac_cv_func_shmat" >&6
+
+ if test $ac_cv_func_shmat = no; then
+ echo "$as_me:$LINENO: checking for shmat in -lipc" >&5
+echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
+if test "${ac_cv_lib_ipc_shmat+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lipc $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char shmat ();
+int
+main ()
+{
+shmat ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_ipc_shmat=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_ipc_shmat=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5
+echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
+if test $ac_cv_lib_ipc_shmat = yes; then
+ X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
+fi
+
+ fi
+ fi
+
+ # Check for libraries that X11R6 Xt/Xaw programs need.
+ ac_save_LDFLAGS=$LDFLAGS
+ test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
+ # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
+ # check for ICE first), but we must link in the order -lSM -lICE or
+ # we get undefined symbols. So assume we have SM if we have ICE.
+ # These have to be linked with before -lX11, unlike the other
+ # libraries we check for below, so use a different variable.
+ # John Interrante, Karl Berry
+ echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5
+echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
+if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lICE $X_EXTRA_LIBS $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char IceConnectionNumber ();
+int
+main ()
+{
+IceConnectionNumber ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_ICE_IceConnectionNumber=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_ICE_IceConnectionNumber=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
+echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
+if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
+ X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
+fi
+
+ LDFLAGS=$ac_save_LDFLAGS
+
+fi
+
+ORIG_X_SAVE_LIBS="$LIBS"
+LIBS="$X_PRE_LIBS $LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
+X_LIBS="$LIBS"
+
+
+ FATAL=0
+
+
+# Check whether --with-qt-dir or --without-qt-dir was given.
+if test "${with_qt_dir+set}" = set; then
+ withval="$with_qt_dir"
+ qt_cv_dir=`eval echo "$withval"/`
+fi;
+
+
+# Check whether --with-qt-includes or --without-qt-includes was given.
+if test "${with_qt_includes+set}" = set; then
+ withval="$with_qt_includes"
+ qt_cv_includes=`eval echo "$withval"`
+fi;
+
+
+# Check whether --with-qt-libraries or --without-qt-libraries was given.
+if test "${with_qt_libraries+set}" = set; then
+ withval="$with_qt_libraries"
+ qt_cv_libraries=`eval echo "$withval"`
+fi;
+
+ if test -z "$qt_cv_dir"; then
+ qt_cv_dir=$QTDIR
+ fi
+
+ if test -n "$qt_cv_dir"; then
+ if test -z "$qt_cv_includes"; then
+ qt_cv_includes=$qt_cv_dir/include
+ fi
+ if test -z "$qt_cv_libraries"; then
+ qt_cv_libraries=$qt_cv_dir/lib
+ fi
+ fi
+
+ QT_INCLUDES=
+ QT_LDFLAGS=
+ if test -n "$qt_cv_includes"; then
+ QT_INCLUDES="-isystem $qt_cv_includes"
+ fi
+ if test -n "$qt_cv_libraries"; then
+ QT_LDFLAGS="-L$qt_cv_libraries"
+ fi
+
+
+
+
+
+ echo "$as_me:$LINENO: checking for moc2" >&5
+echo $ECHO_N "checking for moc2... $ECHO_C" >&6
+ if test "${qt_cv_path_moc2+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ qt_cv_path_moc2="NONE"
+ if test -n "$ac_moc2"; then
+ qt_cv_path_moc2="$ac_moc2";
+ else
+ dirs="$qt_cv_dir/bin"
+ qt_save_IFS=$IFS
+ IFS=':'
+ for dir in $PATH; do
+ dirs="$dirs $dir"
+ done
+ IFS=$qt_save_IFS
+
+ for dir in $dirs; do
+ if test -x "$dir/moc2"; then
+ if test -n ""; then
+ evalstr="$dir/moc2 2>&1 "
+ if eval $evalstr; then
+ qt_cv_path_moc2="$dir/moc2"
+ break
+ fi
+ else
+ qt_cv_path_moc2="$dir/moc2"
+ break
+ fi
+ fi
+ done
+ fi
+
+fi
+
+
+ if test -z "$qt_cv_path_moc2" || test "$qt_cv_path_moc2" = "NONE"; then
+ echo "$as_me:$LINENO: result: not found" >&5
+echo "${ECHO_T}not found" >&6
+
+ else
+ echo "$as_me:$LINENO: result: $qt_cv_path_moc2" >&5
+echo "${ECHO_T}$qt_cv_path_moc2" >&6
+ ac_moc2=$qt_cv_path_moc2
+ fi
+
+
+ echo "$as_me:$LINENO: checking for moc" >&5
+echo $ECHO_N "checking for moc... $ECHO_C" >&6
+ if test "${qt_cv_path_moc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ qt_cv_path_moc="NONE"
+ if test -n "$ac_moc1"; then
+ qt_cv_path_moc="$ac_moc1";
+ else
+ dirs="$qt_cv_dir/bin"
+ qt_save_IFS=$IFS
+ IFS=':'
+ for dir in $PATH; do
+ dirs="$dirs $dir"
+ done
+ IFS=$qt_save_IFS
+
+ for dir in $dirs; do
+ if test -x "$dir/moc"; then
+ if test -n ""; then
+ evalstr="$dir/moc 2>&1 "
+ if eval $evalstr; then
+ qt_cv_path_moc="$dir/moc"
+ break
+ fi
+ else
+ qt_cv_path_moc="$dir/moc"
+ break
+ fi
+ fi
+ done
+ fi
+
+fi
+
+
+ if test -z "$qt_cv_path_moc" || test "$qt_cv_path_moc" = "NONE"; then
+ echo "$as_me:$LINENO: result: not found" >&5
+echo "${ECHO_T}not found" >&6
+
+ else
+ echo "$as_me:$LINENO: result: $qt_cv_path_moc" >&5
+echo "${ECHO_T}$qt_cv_path_moc" >&6
+ ac_moc1=$qt_cv_path_moc
+ fi
+
+
+ if test -n "$ac_moc1" -a -n "$ac_moc2"; then
+ $ac_moc1 -v 2>&1 | grep "Qt 3" >/dev/null
+ if test "$?" = 0; then
+ ac_moc=$ac_moc1;
+ else
+ ac_moc=$ac_moc2;
+ fi
+ else
+ if test -n "$ac_moc1"; then
+ ac_moc=$ac_moc1;
+ else
+ ac_moc=$ac_moc2;
+ fi
+ fi
+
+ if test -z "$ac_moc" -a "$FATAL" = 1; then
+ { { echo "$as_me:$LINENO: error: moc binary not found in \$PATH or $qt_cv_dir/bin !" >&5
+echo "$as_me: error: moc binary not found in \$PATH or $qt_cv_dir/bin !" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+ MOC=$ac_moc
+
+
+
+ echo "$as_me:$LINENO: checking for uic" >&5
+echo $ECHO_N "checking for uic... $ECHO_C" >&6
+ if test "${qt_cv_path_uic+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ qt_cv_path_uic="NONE"
+ if test -n "$ac_uic"; then
+ qt_cv_path_uic="$ac_uic";
+ else
+ dirs="$qt_cv_dir/bin"
+ qt_save_IFS=$IFS
+ IFS=':'
+ for dir in $PATH; do
+ dirs="$dirs $dir"
+ done
+ IFS=$qt_save_IFS
+
+ for dir in $dirs; do
+ if test -x "$dir/uic"; then
+ if test -n ""; then
+ evalstr="$dir/uic 2>&1 "
+ if eval $evalstr; then
+ qt_cv_path_uic="$dir/uic"
+ break
+ fi
+ else
+ qt_cv_path_uic="$dir/uic"
+ break
+ fi
+ fi
+ done
+ fi
+
+fi
+
+
+ if test -z "$qt_cv_path_uic" || test "$qt_cv_path_uic" = "NONE"; then
+ echo "$as_me:$LINENO: result: not found" >&5
+echo "${ECHO_T}not found" >&6
+
+ else
+ echo "$as_me:$LINENO: result: $qt_cv_path_uic" >&5
+echo "${ECHO_T}$qt_cv_path_uic" >&6
+ ac_uic=$qt_cv_path_uic
+ fi
+
+ if test -z "$ac_uic" -a "$FATAL" = 1; then
+ { { echo "$as_me:$LINENO: error: uic binary not found in \$PATH or $qt_cv_dir/bin !" >&5
+echo "$as_me: error: uic binary not found in \$PATH or $qt_cv_dir/bin !" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+ UIC=$ac_uic
+
+
+
+ echo "$as_me:$LINENO: checking for Qt library name" >&5
+echo $ECHO_N "checking for Qt library name... $ECHO_C" >&6
+
+ if test "${qt_cv_libname+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ SAVE_CXXFLAGS=$CXXFLAGS
+ CXXFLAGS="$CXXFLAGS $QT_INCLUDES $QT_LDFLAGS"
+
+ for libname in -lqt-mt -lqt3 -lqt2 -lqt;
+ do
+
+ SAVE_LIBS="$LIBS"
+ LIBS="$LIBS $libname"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+ #include <qglobal.h>
+ #include <qstring.h>
+
+int
+main ()
+{
+
+ QString s("mangle_failure");
+ #if (QT_VERSION < 221)
+ break_me_(\\\);
+ #endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ qt_cv_libname=$libname
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ LIBS="$SAVE_LIBS"
+
+ if test -n "$qt_cv_libname"; then
+ break;
+ fi
+ done
+
+ CXXFLAGS=$SAVE_CXXFLAGS
+
+fi
+
+
+ if test -z "$qt_cv_libname"; then
+ echo "$as_me:$LINENO: result: failed" >&5
+echo "${ECHO_T}failed" >&6
+ if test "$FATAL" = 1 ; then
+ { { echo "$as_me:$LINENO: error: Cannot compile a simple Qt executable. Check you have the right \$QTDIR !" >&5
+echo "$as_me: error: Cannot compile a simple Qt executable. Check you have the right \$QTDIR !" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ else
+ echo "$as_me:$LINENO: result: $qt_cv_libname" >&5
+echo "${ECHO_T}$qt_cv_libname" >&6
+ fi
+
+
+ QT_LIB=$qt_cv_libname;
+
+
+ if test -n "$qt_cv_libname"; then
+
+ echo "$as_me:$LINENO: checking Qt version" >&5
+echo $ECHO_N "checking Qt version... $ECHO_C" >&6
+if test "${lyx_cv_qtversion+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ SAVE_CPPFLAGS=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS $QT_INCLUDES"
+
+ cat > conftest.$ac_ext <<EOF
+#line 24450 "configure"
+#include "confdefs.h"
+#include <qglobal.h>
+"%%%"QT_VERSION_STR"%%%"
+EOF
+ lyx_cv_qtversion=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | \
+ grep '^"%%%"' 2>/dev/null | \
+ sed -e 's/"%%%"//g' -e 's/"//g'`
+ rm -f conftest.$ac_ext
+ CPPFLAGS=$SAVE_CPPFLAGS
+
+fi
+echo "$as_me:$LINENO: result: $lyx_cv_qtversion" >&5
+echo "${ECHO_T}$lyx_cv_qtversion" >&6
+
+ QT_VERSION=$lyx_cv_qtversion
+
+
+ fi
+
+LIBS="$ORIG_X_SAVE_LIBS"
+
+# Check whether --enable-pch or --disable-pch was given.
+if test "${enable_pch+set}" = set; then
+ enableval="$enable_pch"
+ enable_pch=$enableval
+else
+ enable_pch=no
+fi;
+if test "$enable_pch" = yes; then
+
+echo "$as_me:$LINENO: checking whether ${CXX} support precompiled header" >&5
+echo $ECHO_N "checking whether ${CXX} support precompiled header... $ECHO_C" >&6
+
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+SAVE_CXXFLAGS=$CXXFLAGS
+CXXFLAGS=-Winvalid-pch
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; OP_CXXFLAGS="${OP_CXXFLAGS} -include bits/stdc++.h"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+CXXFLAGS=$SAVE_CXXFLAGS
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+fi
+
+
+# It's just rude to go over the net to build
+XSLTPROC_FLAGS=--nonet
+DOCBOOK_ROOT=
+if test ! -f /etc/xml/catalog; then
+ for i in /usr/share/sgml/docbook/stylesheet/xsl/nwalsh /usr/share/sgml/docbook/xsl-stylesheets/;
+ do
+ if test -d "$i"; then
+ DOCBOOK_ROOT=$i
+ fi
+ done
+
+ # Last resort - try net
+ if test -z "$DOCBOOK_ROOT"; then
+ XSLTPROC_FLAGS=
+ fi
+else
+ XML_CATALOG=/etc/xml/catalog
+ CAT_ENTRY_START='<!--'
+ CAT_ENTRY_END='-->'
+fi
+
+# Extract the first word of "xsltproc", so it can be a program name with args.
+set dummy xsltproc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_XSLTPROC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$XSLTPROC"; then
+ ac_cv_prog_XSLTPROC="$XSLTPROC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_XSLTPROC="xsltproc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+XSLTPROC=$ac_cv_prog_XSLTPROC
+if test -n "$XSLTPROC"; then
+ echo "$as_me:$LINENO: result: $XSLTPROC" >&5
+echo "${ECHO_T}$XSLTPROC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+XSLTPROC_WORKS=no
+if test -n "$XSLTPROC"; then
+ echo "$as_me:$LINENO: checking whether xsltproc works" >&5
+echo $ECHO_N "checking whether xsltproc works... $ECHO_C" >&6
+
+ if test -n "$XML_CATALOG"; then
+ DB_FILE="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"
+ else
+ DB_FILE="$DOCBOOK_ROOT/docbook.xsl"
+ fi
+
+ $XSLTPROC $XSLTPROC_FLAGS $DB_FILE >/dev/null 2>&1 << END
+<?xml version="1.0" encoding='ISO-8859-1'?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
+<book id="test">
+</book>
+END
+ if test "$?" = 0; then
+ XSLTPROC_WORKS=yes
+ fi
+ echo "$as_me:$LINENO: result: $XSLTPROC_WORKS" >&5
+echo "${ECHO_T}$XSLTPROC_WORKS" >&6
+fi
+
+
+if test "$XSLTPROC_WORKS" = "yes"; then
+ have_xsltproc_TRUE=
+ have_xsltproc_FALSE='#'
+else
+ have_xsltproc_TRUE='#'
+ have_xsltproc_FALSE=
+fi
+
+
+
+
+
+
+
+
+
+LIBS="$ORIG_SAVE_LIBS"
+LIBERTY_LIBS="-liberty $DL_LIB $INTL_LIB"
+BFD_LIBS="-lbfd -liberty $DL_LIB $INTL_LIB $Z_LIB"
+POPT_LIBS="-lpopt"
+
+
+
+
+# do NOT put tests here, they will fail in the case X is not installed !
+
+
+
+if test -n "$QT_LIB"; then
+ have_qt_TRUE=
+ have_qt_FALSE='#'
+else
+ have_qt_TRUE='#'
+ have_qt_FALSE=
+fi
+
+
+
+echo "$as_me:$LINENO: checking whether ${CC} -W is understood" >&5
+echo $ECHO_N "checking whether ${CC} -W is understood... $ECHO_C" >&6
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+SAVE_CFLAGS=$CFLAGS
+CFLAGS=-W
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; OP_CFLAGS="${OP_CFLAGS} -W"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+CFLAGS=$SAVE_CFLAGS
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+echo "$as_me:$LINENO: checking whether ${CXX} -W is understood" >&5
+echo $ECHO_N "checking whether ${CXX} -W is understood... $ECHO_C" >&6
+
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+SAVE_CXXFLAGS=$CXXFLAGS
+CXXFLAGS=-W
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; OP_CXXFLAGS="${OP_CXXFLAGS} -W"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+CXXFLAGS=$SAVE_CXXFLAGS
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+echo "$as_me:$LINENO: checking whether ${CC} -Wall is understood" >&5
+echo $ECHO_N "checking whether ${CC} -Wall is understood... $ECHO_C" >&6
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+SAVE_CFLAGS=$CFLAGS
+CFLAGS=-Wall
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; OP_CFLAGS="${OP_CFLAGS} -Wall"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+CFLAGS=$SAVE_CFLAGS
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+echo "$as_me:$LINENO: checking whether ${CXX} -Wall is understood" >&5
+echo $ECHO_N "checking whether ${CXX} -Wall is understood... $ECHO_C" >&6
+
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+SAVE_CXXFLAGS=$CXXFLAGS
+CXXFLAGS=-Wall
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; OP_CXXFLAGS="${OP_CXXFLAGS} -Wall"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+CXXFLAGS=$SAVE_CXXFLAGS
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+echo "$as_me:$LINENO: checking whether ${CC} -fno-common is understood" >&5
+echo $ECHO_N "checking whether ${CC} -fno-common is understood... $ECHO_C" >&6
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+SAVE_CFLAGS=$CFLAGS
+CFLAGS=-fno-common
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; OP_CFLAGS="${OP_CFLAGS} -fno-common"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+CFLAGS=$SAVE_CFLAGS
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+echo "$as_me:$LINENO: checking whether ${CXX} -fno-common is understood" >&5
+echo $ECHO_N "checking whether ${CXX} -fno-common is understood... $ECHO_C" >&6
+
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+SAVE_CXXFLAGS=$CXXFLAGS
+CXXFLAGS=-fno-common
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; OP_CXXFLAGS="${OP_CXXFLAGS} -fno-common"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+CXXFLAGS=$SAVE_CXXFLAGS
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+echo "$as_me:$LINENO: checking whether ${CXX} -ftemplate-depth-50 is understood" >&5
+echo $ECHO_N "checking whether ${CXX} -ftemplate-depth-50 is understood... $ECHO_C" >&6
+
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+SAVE_CXXFLAGS=$CXXFLAGS
+CXXFLAGS=-ftemplate-depth-50
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; OP_CXXFLAGS="${OP_CXXFLAGS} -ftemplate-depth-50"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+CXXFLAGS=$SAVE_CXXFLAGS
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+echo "$as_me:$LINENO: checking whether ${CC} -Wdeclaration-after-statement is understood" >&5
+echo $ECHO_N "checking whether ${CC} -Wdeclaration-after-statement is understood... $ECHO_C" >&6
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+SAVE_CFLAGS=$CFLAGS
+CFLAGS=-Wdeclaration-after-statement
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; OP_CFLAGS="${OP_CFLAGS} -Wdeclaration-after-statement"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+CFLAGS=$SAVE_CFLAGS
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+# Check whether --enable-gcov or --disable-gcov was given.
+if test "${enable_gcov+set}" = set; then
+ enableval="$enable_gcov"
+ enable_gcov=$enableval
+else
+ enable_gcov=no
+fi;
+if test "$enable_gcov" = yes; then
+
+echo "$as_me:$LINENO: checking whether ${CC} -fprofile-arcs is understood" >&5
+echo $ECHO_N "checking whether ${CC} -fprofile-arcs is understood... $ECHO_C" >&6
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+SAVE_CFLAGS=$CFLAGS
+CFLAGS=-fprofile-arcs
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; OP_CFLAGS="${OP_CFLAGS} -fprofile-arcs"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+CFLAGS=$SAVE_CFLAGS
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+echo "$as_me:$LINENO: checking whether ${CXX} -fprofile-arcs is understood" >&5
+echo $ECHO_N "checking whether ${CXX} -fprofile-arcs is understood... $ECHO_C" >&6
+
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+SAVE_CXXFLAGS=$CXXFLAGS
+CXXFLAGS=-fprofile-arcs
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; OP_CXXFLAGS="${OP_CXXFLAGS} -fprofile-arcs"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+CXXFLAGS=$SAVE_CXXFLAGS
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+echo "$as_me:$LINENO: checking whether ${CC} -ftest-coverage is understood" >&5
+echo $ECHO_N "checking whether ${CC} -ftest-coverage is understood... $ECHO_C" >&6
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+SAVE_CFLAGS=$CFLAGS
+CFLAGS=-ftest-coverage
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; OP_CFLAGS="${OP_CFLAGS} -ftest-coverage"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+CFLAGS=$SAVE_CFLAGS
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+echo "$as_me:$LINENO: checking whether ${CXX} -ftest-coverage is understood" >&5
+echo $ECHO_N "checking whether ${CXX} -ftest-coverage is understood... $ECHO_C" >&6
+
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+SAVE_CXXFLAGS=$CXXFLAGS
+CXXFLAGS=-ftest-coverage
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; OP_CXXFLAGS="${OP_CXXFLAGS} -ftest-coverage"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+CXXFLAGS=$SAVE_CXXFLAGS
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+fi
+
+# Check whether --enable-werror or --disable-werror was given.
+if test "${enable_werror+set}" = set; then
+ enableval="$enable_werror"
+ enable_werror=$enableval
+else
+ enable_werror=yes
+fi;
+if test "$enable_werror" = yes; then
+ # enable -Werror for non-release versions.
+ if echo "$VERSION" | grep cvs >/dev/null; then
+
+echo "$as_me:$LINENO: checking whether ${CC} -Werror is understood" >&5
+echo $ECHO_N "checking whether ${CC} -Werror is understood... $ECHO_C" >&6
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+SAVE_CFLAGS=$CFLAGS
+CFLAGS=-Werror
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; OP_CFLAGS="${OP_CFLAGS} -Werror"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+CFLAGS=$SAVE_CFLAGS
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+echo "$as_me:$LINENO: checking whether ${CXX} -Werror is understood" >&5
+echo $ECHO_N "checking whether ${CXX} -Werror is understood... $ECHO_C" >&6
+
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+SAVE_CXXFLAGS=$CXXFLAGS
+CXXFLAGS=-Werror
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_cxx_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; OP_CXXFLAGS="${OP_CXXFLAGS} -Werror"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+CXXFLAGS=$SAVE_CXXFLAGS
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+ fi
+fi
+
+# Check whether --enable-optimization or --disable-optimization was given.
+if test "${enable_optimization+set}" = set; then
+ enableval="$enable_optimization"
+ enable_optimization=$enableval
+else
+ enable_optimisation=yes
+fi;
+if test "$enable_optimization" = "no"; then
+ CFLAGS=`echo $CFLAGS | sed 's/-O2//g'`
+ CXXFLAGS=`echo $CXXFLAGS | sed 's/-O2//g'`
+fi
+
+
+
+
+# fixups for config.h
+if test "$prefix" = "NONE"; then
+ my_op_prefix="$ac_default_prefix"
+else
+ my_op_prefix="$prefix"
+fi
+my_op_datadir="$my_op_prefix/share"
+
+if test "$exec_prefix" = "NONE"; then
+ my_op_exec_prefix="$my_op_prefix"
+else
+ my_op_exec_prefix="$exec_prefix"
+fi
+my_op_bindir="$my_op_exec_prefix/bin"
+
+OP_DATADIR=`eval echo "$my_op_datadir/$PACKAGE/"`
+
+cat >>confdefs.h <<_ACEOF
+#define OP_DATADIR "$OP_DATADIR"
+_ACEOF
+
+OP_BINDIR=`eval echo "$my_op_bindir/"`
+
+cat >>confdefs.h <<_ACEOF
+#define OP_BINDIR "$OP_BINDIR"
+_ACEOF
+
+OP_DOCDIR=`eval echo "${my_op_prefix}/share/doc/$PACKAGE/"`
+
+
+ ac_config_files="$ac_config_files Makefile m4/Makefile libutil/Makefile libutil/tests/Makefile libutil++/Makefile libutil++/tests/Makefile libop/Makefile libop/tests/Makefile libopagent/Makefile libopt++/Makefile libdb/Makefile libdb/tests/Makefile libabi/Makefile libabi/tests/Makefile libregex/Makefile libregex/tests/Makefile libregex/stl.pat libregex/tests/mangled-name daemon/Makefile daemon/liblegacy/Makefile events/Makefile utils/Makefile doc/Makefile doc/xsl/catalog-1.xml doc/oprofile.1 doc/opcontrol.1 doc/ophelp.1 doc/opreport.1 doc/opannotate.1 doc/opgprof.1 doc/oparchive.1 doc/opimport.1 doc/srcdoc/Doxyfile libpp/Makefile opjitconv/Makefile pp/Makefile gui/Makefile gui/ui/Makefile module/Makefile module/x86/Makefile module/ia64/Makefile agents/Makefile agents/jvmti/Makefile agents/jvmpi/Makefile"
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+{
+ (set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+} |
+ sed '
+ t clear
+ : clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ : end' >>confcache
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
+ if test -w $cache_file; then
+ test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+ cat confcache >$cache_file
+ else
+ echo "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[ ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[ ]*$//;
+}'
+fi
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_i=`echo "$ac_i" |
+ sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+ # 2. Add them.
+ ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+ ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${kernel_support_TRUE}" && test -z "${kernel_support_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"kernel_support\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"kernel_support\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${BUILD_JVMTI_AGENT_TRUE}" && test -z "${BUILD_JVMTI_AGENT_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"BUILD_JVMTI_AGENT\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"BUILD_JVMTI_AGENT\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${BUILD_JVMPI_AGENT_TRUE}" && test -z "${BUILD_JVMPI_AGENT_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"BUILD_JVMPI_AGENT\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"BUILD_JVMPI_AGENT\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${have_xsltproc_TRUE}" && test -z "${have_xsltproc_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"have_xsltproc\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"have_xsltproc\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${have_qt_TRUE}" && test -z "${have_qt_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"have_qt\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"have_qt\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+do
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
+ fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
+ else
+ as_ln_s='ln -s'
+ fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+exec 6>&1
+
+# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling. Logging --version etc. is OK.
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+} >&5
+cat >&5 <<_CSEOF
+
+This file was extended by $as_me, which was
+generated by GNU Autoconf 2.59. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+_CSEOF
+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+echo >&5
+_ACEOF
+
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+ echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_headers"; then
+ echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_links"; then
+ echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_commands"; then
+ echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf@gnu.org>."
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+config.status
+configured by $0, generated by GNU Autoconf 2.59,
+ with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+srcdir=$srcdir
+INSTALL="$INSTALL"
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value. By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=*)
+ ac_option=`expr "x$1" : 'x\([^=]*\)='`
+ ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ -*)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ *) # This is not an option, so the user has probably given explicit
+ # arguments.
+ ac_option=$1
+ ac_need_defaults=false;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --vers* | -V )
+ echo "$ac_cs_version"; exit 0 ;;
+ --he | --h)
+ # Conflict between --help and --header
+ { { echo "$as_me:$LINENO: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; };;
+ --help | --hel | -h )
+ echo "$ac_cs_usage"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+ ac_need_defaults=false;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; } ;;
+
+ *) ac_config_targets="$ac_config_targets $1" ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+ echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+ exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+#
+# INIT-COMMANDS section.
+#
+
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_config_target in $ac_config_targets
+do
+ case "$ac_config_target" in
+ # Handling of arguments.
+ "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "m4/Makefile" ) CONFIG_FILES="$CONFIG_FILES m4/Makefile" ;;
+ "libutil/Makefile" ) CONFIG_FILES="$CONFIG_FILES libutil/Makefile" ;;
+ "libutil/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES libutil/tests/Makefile" ;;
+ "libutil++/Makefile" ) CONFIG_FILES="$CONFIG_FILES libutil++/Makefile" ;;
+ "libutil++/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES libutil++/tests/Makefile" ;;
+ "libop/Makefile" ) CONFIG_FILES="$CONFIG_FILES libop/Makefile" ;;
+ "libop/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES libop/tests/Makefile" ;;
+ "libopagent/Makefile" ) CONFIG_FILES="$CONFIG_FILES libopagent/Makefile" ;;
+ "libopt++/Makefile" ) CONFIG_FILES="$CONFIG_FILES libopt++/Makefile" ;;
+ "libdb/Makefile" ) CONFIG_FILES="$CONFIG_FILES libdb/Makefile" ;;
+ "libdb/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES libdb/tests/Makefile" ;;
+ "libabi/Makefile" ) CONFIG_FILES="$CONFIG_FILES libabi/Makefile" ;;
+ "libabi/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES libabi/tests/Makefile" ;;
+ "libregex/Makefile" ) CONFIG_FILES="$CONFIG_FILES libregex/Makefile" ;;
+ "libregex/tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES libregex/tests/Makefile" ;;
+ "libregex/stl.pat" ) CONFIG_FILES="$CONFIG_FILES libregex/stl.pat" ;;
+ "libregex/tests/mangled-name" ) CONFIG_FILES="$CONFIG_FILES libregex/tests/mangled-name" ;;
+ "daemon/Makefile" ) CONFIG_FILES="$CONFIG_FILES daemon/Makefile" ;;
+ "daemon/liblegacy/Makefile" ) CONFIG_FILES="$CONFIG_FILES daemon/liblegacy/Makefile" ;;
+ "events/Makefile" ) CONFIG_FILES="$CONFIG_FILES events/Makefile" ;;
+ "utils/Makefile" ) CONFIG_FILES="$CONFIG_FILES utils/Makefile" ;;
+ "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
+ "doc/xsl/catalog-1.xml" ) CONFIG_FILES="$CONFIG_FILES doc/xsl/catalog-1.xml" ;;
+ "doc/oprofile.1" ) CONFIG_FILES="$CONFIG_FILES doc/oprofile.1" ;;
+ "doc/opcontrol.1" ) CONFIG_FILES="$CONFIG_FILES doc/opcontrol.1" ;;
+ "doc/ophelp.1" ) CONFIG_FILES="$CONFIG_FILES doc/ophelp.1" ;;
+ "doc/opreport.1" ) CONFIG_FILES="$CONFIG_FILES doc/opreport.1" ;;
+ "doc/opannotate.1" ) CONFIG_FILES="$CONFIG_FILES doc/opannotate.1" ;;
+ "doc/opgprof.1" ) CONFIG_FILES="$CONFIG_FILES doc/opgprof.1" ;;
+ "doc/oparchive.1" ) CONFIG_FILES="$CONFIG_FILES doc/oparchive.1" ;;
+ "doc/opimport.1" ) CONFIG_FILES="$CONFIG_FILES doc/opimport.1" ;;
+ "doc/srcdoc/Doxyfile" ) CONFIG_FILES="$CONFIG_FILES doc/srcdoc/Doxyfile" ;;
+ "libpp/Makefile" ) CONFIG_FILES="$CONFIG_FILES libpp/Makefile" ;;
+ "opjitconv/Makefile" ) CONFIG_FILES="$CONFIG_FILES opjitconv/Makefile" ;;
+ "pp/Makefile" ) CONFIG_FILES="$CONFIG_FILES pp/Makefile" ;;
+ "gui/Makefile" ) CONFIG_FILES="$CONFIG_FILES gui/Makefile" ;;
+ "gui/ui/Makefile" ) CONFIG_FILES="$CONFIG_FILES gui/ui/Makefile" ;;
+ "module/Makefile" ) CONFIG_FILES="$CONFIG_FILES module/Makefile" ;;
+ "module/x86/Makefile" ) CONFIG_FILES="$CONFIG_FILES module/x86/Makefile" ;;
+ "module/ia64/Makefile" ) CONFIG_FILES="$CONFIG_FILES module/ia64/Makefile" ;;
+ "agents/Makefile" ) CONFIG_FILES="$CONFIG_FILES agents/Makefile" ;;
+ "agents/jvmti/Makefile" ) CONFIG_FILES="$CONFIG_FILES agents/jvmti/Makefile" ;;
+ "agents/jvmpi/Makefile" ) CONFIG_FILES="$CONFIG_FILES agents/jvmpi/Makefile" ;;
+ "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+ *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason to put it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+ trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+ test -n "$tmp" && test -d "$tmp"
+} ||
+{
+ tmp=./confstat$$-$RANDOM
+ (umask 077 && mkdir $tmp)
+} ||
+{
+ echo "$me: cannot create a temporary directory in ." >&2
+ { (exit 1); exit 1; }
+}
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+
+#
+# CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+ # Protect against being on the right side of a sed subst in config.status.
+ sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+ s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s,@SHELL@,$SHELL,;t t
+s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s,@exec_prefix@,$exec_prefix,;t t
+s,@prefix@,$prefix,;t t
+s,@program_transform_name@,$program_transform_name,;t t
+s,@bindir@,$bindir,;t t
+s,@sbindir@,$sbindir,;t t
+s,@libexecdir@,$libexecdir,;t t
+s,@datadir@,$datadir,;t t
+s,@sysconfdir@,$sysconfdir,;t t
+s,@sharedstatedir@,$sharedstatedir,;t t
+s,@localstatedir@,$localstatedir,;t t
+s,@libdir@,$libdir,;t t
+s,@includedir@,$includedir,;t t
+s,@oldincludedir@,$oldincludedir,;t t
+s,@infodir@,$infodir,;t t
+s,@mandir@,$mandir,;t t
+s,@build_alias@,$build_alias,;t t
+s,@host_alias@,$host_alias,;t t
+s,@target_alias@,$target_alias,;t t
+s,@DEFS@,$DEFS,;t t
+s,@ECHO_C@,$ECHO_C,;t t
+s,@ECHO_N@,$ECHO_N,;t t
+s,@ECHO_T@,$ECHO_T,;t t
+s,@LIBS@,$LIBS,;t t
+s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s,@INSTALL_DATA@,$INSTALL_DATA,;t t
+s,@CYGPATH_W@,$CYGPATH_W,;t t
+s,@PACKAGE@,$PACKAGE,;t t
+s,@VERSION@,$VERSION,;t t
+s,@ACLOCAL@,$ACLOCAL,;t t
+s,@AUTOCONF@,$AUTOCONF,;t t
+s,@AUTOMAKE@,$AUTOMAKE,;t t
+s,@AUTOHEADER@,$AUTOHEADER,;t t
+s,@MAKEINFO@,$MAKEINFO,;t t
+s,@install_sh@,$install_sh,;t t
+s,@STRIP@,$STRIP,;t t
+s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
+s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
+s,@mkdir_p@,$mkdir_p,;t t
+s,@AWK@,$AWK,;t t
+s,@SET_MAKE@,$SET_MAKE,;t t
+s,@am__leading_dot@,$am__leading_dot,;t t
+s,@AMTAR@,$AMTAR,;t t
+s,@am__tar@,$am__tar,;t t
+s,@am__untar@,$am__untar,;t t
+s,@CC@,$CC,;t t
+s,@CFLAGS@,$CFLAGS,;t t
+s,@LDFLAGS@,$LDFLAGS,;t t
+s,@CPPFLAGS@,$CPPFLAGS,;t t
+s,@ac_ct_CC@,$ac_ct_CC,;t t
+s,@EXEEXT@,$EXEEXT,;t t
+s,@OBJEXT@,$OBJEXT,;t t
+s,@DEPDIR@,$DEPDIR,;t t
+s,@am__include@,$am__include,;t t
+s,@am__quote@,$am__quote,;t t
+s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t
+s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t
+s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
+s,@CCDEPMODE@,$CCDEPMODE,;t t
+s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
+s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
+s,@RANLIB@,$RANLIB,;t t
+s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
+s,@build@,$build,;t t
+s,@build_cpu@,$build_cpu,;t t
+s,@build_vendor@,$build_vendor,;t t
+s,@build_os@,$build_os,;t t
+s,@host@,$host,;t t
+s,@host_cpu@,$host_cpu,;t t
+s,@host_vendor@,$host_vendor,;t t
+s,@host_os@,$host_os,;t t
+s,@EGREP@,$EGREP,;t t
+s,@LN_S@,$LN_S,;t t
+s,@ECHO@,$ECHO,;t t
+s,@AR@,$AR,;t t
+s,@ac_ct_AR@,$ac_ct_AR,;t t
+s,@CPP@,$CPP,;t t
+s,@CXX@,$CXX,;t t
+s,@CXXFLAGS@,$CXXFLAGS,;t t
+s,@ac_ct_CXX@,$ac_ct_CXX,;t t
+s,@CXXDEPMODE@,$CXXDEPMODE,;t t
+s,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t
+s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t
+s,@CXXCPP@,$CXXCPP,;t t
+s,@F77@,$F77,;t t
+s,@FFLAGS@,$FFLAGS,;t t
+s,@ac_ct_F77@,$ac_ct_F77,;t t
+s,@LIBTOOL@,$LIBTOOL,;t t
+s,@DATE@,$DATE,;t t
+s,@OPROFILE_DIR@,$OPROFILE_DIR,;t t
+s,@LD@,$LD,;t t
+s,@KSRC@,$KSRC,;t t
+s,@KINC@,$KINC,;t t
+s,@kernel_support_TRUE@,$kernel_support_TRUE,;t t
+s,@kernel_support_FALSE@,$kernel_support_FALSE,;t t
+s,@KVERS@,$KVERS,;t t
+s,@OPROFILE_MODULE_ARCH@,$OPROFILE_MODULE_ARCH,;t t
+s,@MODINSTALLDIR@,$MODINSTALLDIR,;t t
+s,@JAVA_HOMEDIR@,$JAVA_HOMEDIR,;t t
+s,@BUILD_JVMTI_AGENT_TRUE@,$BUILD_JVMTI_AGENT_TRUE,;t t
+s,@BUILD_JVMTI_AGENT_FALSE@,$BUILD_JVMTI_AGENT_FALSE,;t t
+s,@BUILD_JVMPI_AGENT_TRUE@,$BUILD_JVMPI_AGENT_TRUE,;t t
+s,@BUILD_JVMPI_AGENT_FALSE@,$BUILD_JVMPI_AGENT_FALSE,;t t
+s,@EXTRA_CFLAGS_MODULE@,$EXTRA_CFLAGS_MODULE,;t t
+s,@topdir@,$topdir,;t t
+s,@SIZE_T_TYPE@,$SIZE_T_TYPE,;t t
+s,@PTRDIFF_T_TYPE@,$PTRDIFF_T_TYPE,;t t
+s,@X_CFLAGS@,$X_CFLAGS,;t t
+s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
+s,@X_LIBS@,$X_LIBS,;t t
+s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
+s,@QT_INCLUDES@,$QT_INCLUDES,;t t
+s,@QT_LDFLAGS@,$QT_LDFLAGS,;t t
+s,@MOC@,$MOC,;t t
+s,@UIC@,$UIC,;t t
+s,@QT_LIB@,$QT_LIB,;t t
+s,@QT_VERSION@,$QT_VERSION,;t t
+s,@XSLTPROC@,$XSLTPROC,;t t
+s,@have_xsltproc_TRUE@,$have_xsltproc_TRUE,;t t
+s,@have_xsltproc_FALSE@,$have_xsltproc_FALSE,;t t
+s,@XML_CATALOG@,$XML_CATALOG,;t t
+s,@XSLTPROC_FLAGS@,$XSLTPROC_FLAGS,;t t
+s,@DOCBOOK_ROOT@,$DOCBOOK_ROOT,;t t
+s,@CAT_ENTRY_START@,$CAT_ENTRY_START,;t t
+s,@CAT_ENTRY_END@,$CAT_ENTRY_END,;t t
+s,@LIBERTY_LIBS@,$LIBERTY_LIBS,;t t
+s,@BFD_LIBS@,$BFD_LIBS,;t t
+s,@POPT_LIBS@,$POPT_LIBS,;t t
+s,@have_qt_TRUE@,$have_qt_TRUE,;t t
+s,@have_qt_FALSE@,$have_qt_FALSE,;t t
+s,@OP_CFLAGS@,$OP_CFLAGS,;t t
+s,@OP_CXXFLAGS@,$OP_CXXFLAGS,;t t
+s,@OP_DOCDIR@,$OP_DOCDIR,;t t
+s,@LIBOBJS@,$LIBOBJS,;t t
+s,@LTLIBOBJS@,$LTLIBOBJS,;t t
+CEOF
+
+_ACEOF
+
+ cat >>$CONFIG_STATUS <<\_ACEOF
+ # Split the substitutions into bite-sized pieces for seds with
+ # small command number limits, like on Digital OSF/1 and HP-UX.
+ ac_max_sed_lines=48
+ ac_sed_frag=1 # Number of current file.
+ ac_beg=1 # First line for current file.
+ ac_end=$ac_max_sed_lines # Line after last line for current file.
+ ac_more_lines=:
+ ac_sed_cmds=
+ while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+ else
+ sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+ fi
+ if test ! -s $tmp/subs.frag; then
+ ac_more_lines=false
+ else
+ # The purpose of the label and of the branching condition is to
+ # speed up the sed processing (if there are no `@' at all, there
+ # is no need to browse any of the substitutions).
+ # These are the two extra sed commands mentioned above.
+ (echo ':t
+ /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+ fi
+ ac_sed_frag=`expr $ac_sed_frag + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_lines`
+ fi
+ done
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
+ fi
+fi # test -n "$CONFIG_FILES"
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
+ esac
+
+ # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
+
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
+ esac
+
+ if test x"$ac_file" != x-; then
+ { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+ rm -f "$ac_file"
+ fi
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ if test x"$ac_file" = x-; then
+ configure_input=
+ else
+ configure_input="$ac_file. "
+ fi
+ configure_input=$configure_input"Generated from `echo $ac_file_in |
+ sed 's,.*/,,'` by configure."
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+ ac_file_inputs=`IFS=:
+ for f in $ac_file_in; do
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ echo "$f";;
+ *) # Relative
+ if test -f "$f"; then
+ # Build tree
+ echo "$f"
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo "$srcdir/$f"
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s,@configure_input@,$configure_input,;t t
+s,@srcdir@,$ac_srcdir,;t t
+s,@abs_srcdir@,$ac_abs_srcdir,;t t
+s,@top_srcdir@,$ac_top_srcdir,;t t
+s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s,@builddir@,$ac_builddir,;t t
+s,@abs_builddir@,$ac_abs_builddir,;t t
+s,@top_builddir@,$ac_top_builddir,;t t
+s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
+s,@INSTALL@,$ac_INSTALL,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+ rm -f $tmp/stdin
+ if test x"$ac_file" != x-; then
+ mv $tmp/out $ac_file
+ else
+ cat $tmp/out
+ rm -f $tmp/out
+ fi
+
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_HEADER section.
+#
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+ac_dB='[ ].*$,\1#\2'
+ac_dC=' '
+ac_dD=',;t'
+# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_uB='$,\1#\2define\3'
+ac_uC=' '
+ac_uD=',;t'
+
+for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
+ esac
+
+ test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+ ac_file_inputs=`IFS=:
+ for f in $ac_file_in; do
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ # Do quote $f, to prevent DOS paths from being IFS'd.
+ echo "$f";;
+ *) # Relative
+ if test -f "$f"; then
+ # Build tree
+ echo "$f"
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo "$srcdir/$f"
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+ # Remove the trailing spaces.
+ sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
+
+_ACEOF
+
+# Transform confdefs.h into two sed scripts, `conftest.defines' and
+# `conftest.undefs', that substitutes the proper values into
+# config.h.in to produce config.h. The first handles `#define'
+# templates, and the second `#undef' templates.
+# And first: Protect against being on the right side of a sed subst in
+# config.status. Protect against being in an unquoted here document
+# in config.status.
+rm -f conftest.defines conftest.undefs
+# Using a here document instead of a string reduces the quoting nightmare.
+# Putting comments in sed scripts is not portable.
+#
+# `end' is used to avoid that the second main sed command (meant for
+# 0-ary CPP macros) applies to n-ary macro definitions.
+# See the Autoconf documentation for `clear'.
+cat >confdef2sed.sed <<\_ACEOF
+s/[\\&,]/\\&/g
+s,[\\$`],\\&,g
+t clear
+: clear
+s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
+t end
+s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
+: end
+_ACEOF
+# If some macros were called several times there might be several times
+# the same #defines, which is useless. Nevertheless, we may not want to
+# sort them, since we want the *last* AC-DEFINE to be honored.
+uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
+sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
+rm -f confdef2sed.sed
+
+# This sed command replaces #undef with comments. This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+cat >>conftest.undefs <<\_ACEOF
+s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
+_ACEOF
+
+# Break up conftest.defines because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
+echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
+echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
+echo ' :' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.defines >/dev/null
+do
+ # Write a limited-size here document to $tmp/defines.sed.
+ echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
+ # Speed up: don't consider the non `#define' lines.
+ echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS
+ # Work around the forget-to-reset-the-flag bug.
+ echo 't clr' >>$CONFIG_STATUS
+ echo ': clr' >>$CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
+ echo 'CEOF
+ sed -f $tmp/defines.sed $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
+ rm -f conftest.defines
+ mv conftest.tail conftest.defines
+done
+rm -f conftest.defines
+echo ' fi # grep' >>$CONFIG_STATUS
+echo >>$CONFIG_STATUS
+
+# Break up conftest.undefs because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo ' # Handle all the #undef templates' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.undefs >/dev/null
+do
+ # Write a limited-size here document to $tmp/undefs.sed.
+ echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
+ # Speed up: don't consider the non `#undef'
+ echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS
+ # Work around the forget-to-reset-the-flag bug.
+ echo 't clr' >>$CONFIG_STATUS
+ echo ': clr' >>$CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
+ echo 'CEOF
+ sed -f $tmp/undefs.sed $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
+ rm -f conftest.undefs
+ mv conftest.tail conftest.undefs
+done
+rm -f conftest.undefs
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ if test x"$ac_file" = x-; then
+ echo "/* Generated by configure. */" >$tmp/config.h
+ else
+ echo "/* $ac_file. Generated by configure. */" >$tmp/config.h
+ fi
+ cat $tmp/in >>$tmp/config.h
+ rm -f $tmp/in
+ if test x"$ac_file" != x-; then
+ if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
+ { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ rm -f $ac_file
+ mv $tmp/config.h $ac_file
+ fi
+ else
+ cat $tmp/config.h
+ rm -f $tmp/config.h
+ fi
+# Compute $ac_file's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $ac_file | $ac_file:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
+$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X$ac_file : 'X\(//\)[^/]' \| \
+ X$ac_file : 'X\(//\)$' \| \
+ X$ac_file : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X$ac_file |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`/stamp-h$_am_stamp_count
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_COMMANDS section.
+#
+for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
+ ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
+ ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
+$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_dest" : 'X\(//\)[^/]' \| \
+ X"$ac_dest" : 'X\(//\)$' \| \
+ X"$ac_dest" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_dest" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
+
+
+ { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
+echo "$as_me: executing $ac_dest commands" >&6;}
+ case $ac_dest in
+ depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # So let's grep whole file.
+ if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+ dirpart=`(dirname "$mf") 2>/dev/null ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$mf" : 'X\(//\)[^/]' \| \
+ X"$mf" : 'X\(//\)$' \| \
+ X"$mf" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ else
+ continue
+ fi
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`(dirname "$file") 2>/dev/null ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+ X"$file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p $dirpart/$fdir
+ else
+ as_dir=$dirpart/$fdir
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
+echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+ ;;
+ esac
+done
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || { (exit 1); exit 1; }
+fi
+
+
+
+if test -r doc/xsl/catalog.xml; then
+ if cmp doc/xsl/catalog-1.xml doc/xsl/catalog.xml > /dev/null; then
+ echo doc/xsl/catalog.xml is unchanged
+ else
+ cp -f doc/xsl/catalog-1.xml doc/xsl/catalog.xml
+ fi
+else
+ cp -f doc/xsl/catalog-1.xml doc/xsl/catalog.xml
+fi
+
+
+if test -z "$QT_LIB"; then
+ echo "Warning: a working Qt not found; no GUI will be built"
+fi
+
+if test "`getent passwd oprofile 2>/dev/null`" == "" || \
+ test "`getent group oprofile 2>/dev/null`" == ""; then
+ if test `id -u` != "0"; then
+ echo "Warning: The user account 'oprofile:oprofile' does not exist on the system."
+ echo " To profile JITed code, this special user account must exist."
+ echo " Please ask your system administrator to add the following user and group:"
+ echo " user name : 'oprofile'"
+ echo " group name: 'oprofile'"
+ echo " The 'oprofile' group must be the default group for the 'oprofile' user."
+ else
+ echo "Warning: The user account 'oprofile:oprofile' does not exist on the system."
+ echo " To profile JITed code, this special user account must exist."
+ echo " Please add the following user and group:"
+ echo " user name : 'oprofile'"
+ echo " group name: 'oprofile'"
+ echo " The 'oprofile' group must be the default group for the 'oprofile' user."
+ fi
+fi
+
diff --git a/configure.in b/configure.in
new file mode 100644
index 0000000..c439122
--- /dev/null
+++ b/configure.in
@@ -0,0 +1,293 @@
+# Autoconf script for oprofile
+#
+# Copyright 1999 Olaf Titz <olaf@bigred.inka.de>
+# Adapted for oprofile
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+
+AC_PREREQ(2.13)
+
+AC_INIT(libop/op_config.h)
+AM_INIT_AUTOMAKE(oprofile, 0.9.6)
+AM_CONFIG_HEADER(config.h)
+
+AC_CHECK_DECLS([basename], [], [], [[#include <libgen.h>]])
+AC_PROG_RANLIB
+AC_PROG_LIBTOOL
+
+dnl for the man page
+DATE="`date '+%a %d %B %Y'`"
+AC_SUBST(DATE)
+
+dnl needed for module build
+OPROFILE_DIR=`pwd`
+AC_SUBST(OPROFILE_DIR)
+
+# this needs to come before --with-gcc so we link with binutil's version
+# of libiberty ... sigh
+AC_ARG_WITH(binutils,
+[ --with-binutils=dir Path to binutils installation to use], BINUTILSDIR=$withval)
+
+if test "$BINUTILSDIR" != ""; then
+ LD="$BINUTILSDIR/ld"
+ if test "$CFLAGS" = ""; then
+ CFLAGS="-g -O2"
+ fi
+ if test "$CXXFLAGS" = ""; then
+ CXXFLAGS="-g -O2"
+ fi
+ CFLAGS="$CFLAGS -I$BINUTILSDIR/include"
+ CXXFLAGS="$CXXFLAGS -I$BINUTILSDIR/include"
+ AC_ARG_WITH(binutils-libname,
+ [ --with-binutils-libname Lib dir name under binutils installation; @<:@lib@:>@]],
+ BINUTILSLIB=$withval)
+ if test "$BINUTILSLIB" = ""; then
+ BINUTILSLIB="lib"
+ fi
+ LDFLAGS="$LDFLAGS -L$BINUTILSDIR/$BINUTILSLIB -Xlinker -R -Xlinker $BINUTILSDIR/$BINUTILSLIB"
+fi
+
+AC_ARG_WITH(gcc,
+[ --with-gcc=dir Path to GCC installation to use], GCCDIR=$withval)
+
+if test "$GCCDIR" != ""; then
+ CC="$GCCDIR/bin/gcc"
+ CXX="$GCCDIR/bin/g++"
+ LDFLAGS="$LDFLAGS -L$GCCDIR/lib -Xlinker -R -Xlinker $GCCDIR/lib"
+fi
+
+AC_PROG_CC
+AC_PROG_CPP
+AC_PROG_CXX
+AC_CHECK_PROG(LD,ld,ld,)
+test "$LD" || AC_ERROR(ld not found)
+
+AX_FIND_KERNEL
+
+if test "$OPROFILE_26" = "no"; then
+ AX_CONFIG_MODULE
+fi
+
+AC_ARG_WITH(module-dir,
+[ --with-module-dir=dir Path to module installation directory], MODINSTALLDIR=$withval)
+AC_SUBST(MODINSTALLDIR)
+
+AC_ARG_WITH(java,
+[ --with-java=java-home Path to Java home directory], JAVA_HOMEDIR=$withval)
+AC_SUBST(JAVA_HOMEDIR)
+
+if test -n "$JAVA_HOMEDIR"; then
+ AC_CHECK_FILE("$JAVA_HOMEDIR/include/jvmti.h",JVMTI_H_EXISTS="yes",)
+ AC_CHECK_FILE("$JAVA_HOMEDIR/include/jvmpi.h",JVMPI_H_EXISTS="yes",)
+fi
+
+AM_CONDITIONAL(BUILD_JVMTI_AGENT, test -n "$JVMTI_H_EXISTS")
+AM_CONDITIONAL(BUILD_JVMPI_AGENT, test -n "$JVMPI_H_EXISTS")
+
+AX_MALLOC_ATTRIBUTE
+AX_BUILTIN_EXPECT
+
+AC_SUBST(EXTRA_CFLAGS_MODULE)
+
+topdir=`pwd`
+AC_SUBST(topdir)
+
+AX_EXTRA_DIRS
+
+ORIG_SAVE_LIBS="$LIBS"
+
+dnl advanced glibc features which we need but may not be present
+AC_CHECK_FUNCS(sched_setaffinity perfmonctl)
+
+AC_CHECK_LIB(popt, poptGetContext,, AC_MSG_ERROR([popt library not found]))
+AX_BINUTILS
+AX_CELL_SPU
+
+# C++ tests
+
+AC_LANG_CPLUSPLUS
+
+AX_POPT_CONST
+AX_CHECK_SSTREAM
+
+dnl bfd.h pre 1998 check only for gnu 2.xx series, so gcc 3.0 can't compile it
+AC_MSG_CHECKING([whether bfd defines bool])
+AC_TRY_COMPILE([#include <bfd.h>], [],
+AC_MSG_RESULT([no]);,
+AC_MSG_RESULT([yes]); AC_DEFINE(TRUE_FALSE_ALREADY_DEFINED, 1, [whether bfd.h defines bool values]))
+
+dnl smart demangler need to know what are the underlined type for some typedef
+AX_TYPEDEFED_NAME(size_t, "unsigned" "unsigned long", SIZE_T_TYPE)
+AC_SUBST(SIZE_T_TYPE)
+AX_TYPEDEFED_NAME(ptrdiff_t, "int" "long", PTRDIFF_T_TYPE)
+AC_SUBST(PTRDIFF_T_TYPE)
+
+AC_PATH_XTRA
+ORIG_X_SAVE_LIBS="$LIBS"
+LIBS="$X_PRE_LIBS $LIBS $X_LIBS -lX11 $X_EXTRA_LIBS"
+X_LIBS="$LIBS"
+AC_SUBST(X_LIBS)
+QT_DO_IT_ALL
+LIBS="$ORIG_X_SAVE_LIBS"
+
+dnl enable pch for c++
+AC_ARG_ENABLE(pch,
+ [ --enable-pch enable precompiled header (default is disabled)],
+ enable_pch=$enableval, enable_pch=no)
+if test "$enable_pch" = yes; then
+ AX_CHECK_PRECOMPILED_HEADER(OP_CXXFLAGS)
+fi
+
+AX_CHECK_DOCBOOK
+
+dnl finally restore the original libs setting
+LIBS="$ORIG_SAVE_LIBS"
+LIBERTY_LIBS="-liberty $DL_LIB $INTL_LIB"
+BFD_LIBS="-lbfd -liberty $DL_LIB $INTL_LIB $Z_LIB"
+POPT_LIBS="-lpopt"
+AC_SUBST(LIBERTY_LIBS)
+AC_SUBST(BFD_LIBS)
+AC_SUBST(POPT_LIBS)
+
+# do NOT put tests here, they will fail in the case X is not installed !
+
+AM_CONDITIONAL(have_qt, test -n "$QT_LIB")
+
+AX_CFLAGS_OPTION(OP_CFLAGS,[-W])
+AX_CXXFLAGS_OPTION(OP_CXXFLAGS,[-W])
+AX_CFLAGS_OPTION(OP_CFLAGS,[-Wall])
+AX_CXXFLAGS_OPTION(OP_CXXFLAGS,[-Wall])
+AX_CFLAGS_OPTION(OP_CFLAGS,[-fno-common])
+AX_CXXFLAGS_OPTION(OP_CXXFLAGS,[-fno-common])
+AX_CXXFLAGS_OPTION(OP_CXXFLAGS,[-ftemplate-depth-50])
+AX_CFLAGS_OPTION(OP_CFLAGS,[-Wdeclaration-after-statement])
+
+dnl enable option to use GCC test coverage
+AC_ARG_ENABLE(gcov,
+ [ --enable-gcov enable option for gcov coverage testing (default is disabled)],
+ enable_gcov=$enableval, enable_gcov=no)
+if test "$enable_gcov" = yes; then
+ AX_CFLAGS_OPTION(OP_CFLAGS,[-fprofile-arcs])
+ AX_CXXFLAGS_OPTION(OP_CXXFLAGS,[-fprofile-arcs])
+ AX_CFLAGS_OPTION(OP_CFLAGS,[-ftest-coverage])
+ AX_CXXFLAGS_OPTION(OP_CXXFLAGS,[-ftest-coverage])
+fi
+
+AC_ARG_ENABLE(werror,
+ [ --disable-werror disable -Werror flag (default is enabled for non-release)],
+ enable_werror=$enableval, enable_werror=yes)
+if test "$enable_werror" = yes; then
+ # enable -Werror for non-release versions.
+ if echo "$VERSION" | grep cvs >/dev/null; then
+ AX_CFLAGS_OPTION(OP_CFLAGS,[-Werror])
+ AX_CXXFLAGS_OPTION(OP_CXXFLAGS,[-Werror])
+ fi
+fi
+
+AC_ARG_ENABLE(optimization,
+ [ --disable-optimization disable optimization flags (default is enabled)],
+ enable_optimization=$enableval, enable_optimisation=yes)
+if test "$enable_optimization" = "no"; then
+ CFLAGS=`echo $CFLAGS | sed 's/-O2//g'`
+ CXXFLAGS=`echo $CXXFLAGS | sed 's/-O2//g'`
+fi
+
+AC_SUBST(OP_CFLAGS)
+AC_SUBST(OP_CXXFLAGS)
+
+# fixups for config.h
+if test "$prefix" = "NONE"; then
+ my_op_prefix="$ac_default_prefix"
+else
+ my_op_prefix="$prefix"
+fi
+my_op_datadir="$my_op_prefix/share"
+
+if test "$exec_prefix" = "NONE"; then
+ my_op_exec_prefix="$my_op_prefix"
+else
+ my_op_exec_prefix="$exec_prefix"
+fi
+my_op_bindir="$my_op_exec_prefix/bin"
+
+OP_DATADIR=`eval echo "$my_op_datadir/$PACKAGE/"`
+AC_DEFINE_UNQUOTED(OP_DATADIR, "$OP_DATADIR", [package data directory])
+OP_BINDIR=`eval echo "$my_op_bindir/"`
+AC_DEFINE_UNQUOTED(OP_BINDIR, "$OP_BINDIR", [package binary directory])
+OP_DOCDIR=`eval echo "${my_op_prefix}/share/doc/$PACKAGE/"`
+AC_SUBST(OP_DOCDIR)
+
+AC_OUTPUT(Makefile \
+ m4/Makefile \
+ libutil/Makefile \
+ libutil/tests/Makefile \
+ libutil++/Makefile \
+ libutil++/tests/Makefile \
+ libop/Makefile \
+ libop/tests/Makefile \
+ libopagent/Makefile \
+ libopt++/Makefile \
+ libdb/Makefile \
+ libdb/tests/Makefile \
+ libabi/Makefile \
+ libabi/tests/Makefile \
+ libregex/Makefile \
+ libregex/tests/Makefile \
+ libregex/stl.pat \
+ libregex/tests/mangled-name \
+ daemon/Makefile \
+ daemon/liblegacy/Makefile \
+ events/Makefile \
+ utils/Makefile \
+ doc/Makefile \
+ doc/xsl/catalog-1.xml \
+ doc/oprofile.1 \
+ doc/opcontrol.1 \
+ doc/ophelp.1 \
+ doc/opreport.1 \
+ doc/opannotate.1 \
+ doc/opgprof.1 \
+ doc/oparchive.1 \
+ doc/opimport.1 \
+ doc/srcdoc/Doxyfile \
+ libpp/Makefile \
+ opjitconv/Makefile \
+ pp/Makefile \
+ gui/Makefile \
+ gui/ui/Makefile \
+ module/Makefile \
+ module/x86/Makefile \
+ module/ia64/Makefile \
+ agents/Makefile \
+ agents/jvmti/Makefile \
+ agents/jvmpi/Makefile)
+
+AX_COPY_IF_CHANGE(doc/xsl/catalog-1.xml, doc/xsl/catalog.xml)
+
+if test -z "$QT_LIB"; then
+ echo "Warning: a working Qt not found; no GUI will be built"
+fi
+
+if test "`getent passwd oprofile 2>/dev/null`" == "" || \
+ test "`getent group oprofile 2>/dev/null`" == ""; then
+ if test `id -u` != "0"; then
+ echo "Warning: The user account 'oprofile:oprofile' does not exist on the system."
+ echo " To profile JITed code, this special user account must exist."
+ echo " Please ask your system administrator to add the following user and group:"
+ echo " user name : 'oprofile'"
+ echo " group name: 'oprofile'"
+ echo " The 'oprofile' group must be the default group for the 'oprofile' user."
+ else
+ echo "Warning: The user account 'oprofile:oprofile' does not exist on the system."
+ echo " To profile JITed code, this special user account must exist."
+ echo " Please add the following user and group:"
+ echo " user name : 'oprofile'"
+ echo " group name: 'oprofile'"
+ echo " The 'oprofile' group must be the default group for the 'oprofile' user."
+ fi
+fi
+
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
new file mode 100644
index 0000000..043cfd6
--- /dev/null
+++ b/daemon/Makefile.am
@@ -0,0 +1,58 @@
+SUBDIRS = liblegacy .
+
+oprofiled_SOURCES = \
+ init.c \
+ oprofiled.c \
+ oprofiled.h \
+ opd_stats.c \
+ opd_pipe.c \
+ opd_pipe.h \
+ opd_sfile.c \
+ opd_sfile.h \
+ opd_kernel.c \
+ opd_kernel.h \
+ opd_trans.c \
+ opd_trans.h \
+ opd_printf.h \
+ opd_stats.h \
+ opd_cookie.c \
+ opd_cookie.h \
+ opd_events.c \
+ opd_events.h \
+ opd_interface.h \
+ opd_mangling.c \
+ opd_mangling.h \
+ opd_perfmon.h \
+ opd_perfmon.c \
+ opd_anon.h \
+ opd_anon.c \
+ opd_spu.c \
+ opd_extended.h \
+ opd_extended.c \
+ opd_ibs.h \
+ opd_ibs.c \
+ opd_ibs_macro.h \
+ opd_ibs_trans.h \
+ opd_ibs_trans.c
+
+LIBS=@POPT_LIBS@ @LIBERTY_LIBS@
+
+AM_CPPFLAGS = \
+ -I ${top_srcdir}/libabi \
+ -I ${top_srcdir}/libutil \
+ -I ${top_srcdir}/libop \
+ -I ${top_srcdir}/libdb
+
+# -fno-omit-frame-pointer needed for daemon build: see ChangeLog-2004 02-23
+AM_CFLAGS = @OP_CFLAGS@ -fno-omit-frame-pointer
+
+bin_PROGRAMS = oprofiled
+
+oprofiled_LDADD = \
+ liblegacy/liblegacy.a \
+ ../libabi/libabi.a \
+ ../libdb/libodb.a \
+ ../libop/libop.a \
+ ../libutil/libutil.a
+
+oprofiled_LINK = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
diff --git a/daemon/Makefile.in b/daemon/Makefile.in
new file mode 100644
index 0000000..2f0f0ef
--- /dev/null
+++ b/daemon/Makefile.in
@@ -0,0 +1,686 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+bin_PROGRAMS = oprofiled$(EXEEXT)
+subdir = daemon
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/binutils.m4 \
+ $(top_srcdir)/m4/builtinexpect.m4 \
+ $(top_srcdir)/m4/cellspubfdsupport.m4 \
+ $(top_srcdir)/m4/compileroption.m4 \
+ $(top_srcdir)/m4/configmodule.m4 \
+ $(top_srcdir)/m4/copyifchange.m4 $(top_srcdir)/m4/docbook.m4 \
+ $(top_srcdir)/m4/extradirs.m4 $(top_srcdir)/m4/findkernel.m4 \
+ $(top_srcdir)/m4/kerneloption.m4 \
+ $(top_srcdir)/m4/kernelversion.m4 \
+ $(top_srcdir)/m4/mallocattribute.m4 \
+ $(top_srcdir)/m4/poptconst.m4 \
+ $(top_srcdir)/m4/precompiledheader.m4 $(top_srcdir)/m4/qt.m4 \
+ $(top_srcdir)/m4/resultyn.m4 $(top_srcdir)/m4/sstream.m4 \
+ $(top_srcdir)/m4/typedef.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am_oprofiled_OBJECTS = init.$(OBJEXT) oprofiled.$(OBJEXT) \
+ opd_stats.$(OBJEXT) opd_pipe.$(OBJEXT) opd_sfile.$(OBJEXT) \
+ opd_kernel.$(OBJEXT) opd_trans.$(OBJEXT) opd_cookie.$(OBJEXT) \
+ opd_events.$(OBJEXT) opd_mangling.$(OBJEXT) \
+ opd_perfmon.$(OBJEXT) opd_anon.$(OBJEXT) opd_spu.$(OBJEXT) \
+ opd_extended.$(OBJEXT) opd_ibs.$(OBJEXT) \
+ opd_ibs_trans.$(OBJEXT)
+oprofiled_OBJECTS = $(am_oprofiled_OBJECTS)
+oprofiled_DEPENDENCIES = liblegacy/liblegacy.a ../libabi/libabi.a \
+ ../libdb/libodb.a ../libop/libop.a ../libutil/libutil.a
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(oprofiled_SOURCES)
+DIST_SOURCES = $(oprofiled_SOURCES)
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-exec-recursive install-info-recursive \
+ install-recursive installcheck-recursive installdirs-recursive \
+ pdf-recursive ps-recursive uninstall-info-recursive \
+ uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFD_LIBS = @BFD_LIBS@
+BUILD_JVMPI_AGENT_FALSE = @BUILD_JVMPI_AGENT_FALSE@
+BUILD_JVMPI_AGENT_TRUE = @BUILD_JVMPI_AGENT_TRUE@
+BUILD_JVMTI_AGENT_FALSE = @BUILD_JVMTI_AGENT_FALSE@
+BUILD_JVMTI_AGENT_TRUE = @BUILD_JVMTI_AGENT_TRUE@
+CAT_ENTRY_END = @CAT_ENTRY_END@
+CAT_ENTRY_START = @CAT_ENTRY_START@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOCBOOK_ROOT = @DOCBOOK_ROOT@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+EXTRA_CFLAGS_MODULE = @EXTRA_CFLAGS_MODULE@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAVA_HOMEDIR = @JAVA_HOMEDIR@
+KINC = @KINC@
+KSRC = @KSRC@
+KVERS = @KVERS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBERTY_LIBS = @LIBERTY_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @POPT_LIBS@ @LIBERTY_LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MOC = @MOC@
+MODINSTALLDIR = @MODINSTALLDIR@
+OBJEXT = @OBJEXT@
+OPROFILE_DIR = @OPROFILE_DIR@
+OPROFILE_MODULE_ARCH = @OPROFILE_MODULE_ARCH@
+OP_CFLAGS = @OP_CFLAGS@
+OP_CXXFLAGS = @OP_CXXFLAGS@
+OP_DOCDIR = @OP_DOCDIR@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POPT_LIBS = @POPT_LIBS@
+PTRDIFF_T_TYPE = @PTRDIFF_T_TYPE@
+QT_INCLUDES = @QT_INCLUDES@
+QT_LDFLAGS = @QT_LDFLAGS@
+QT_LIB = @QT_LIB@
+QT_VERSION = @QT_VERSION@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIZE_T_TYPE = @SIZE_T_TYPE@
+STRIP = @STRIP@
+UIC = @UIC@
+VERSION = @VERSION@
+XML_CATALOG = @XML_CATALOG@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+have_qt_FALSE = @have_qt_FALSE@
+have_qt_TRUE = @have_qt_TRUE@
+have_xsltproc_FALSE = @have_xsltproc_FALSE@
+have_xsltproc_TRUE = @have_xsltproc_TRUE@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+kernel_support_FALSE = @kernel_support_FALSE@
+kernel_support_TRUE = @kernel_support_TRUE@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+topdir = @topdir@
+SUBDIRS = liblegacy .
+oprofiled_SOURCES = \
+ init.c \
+ oprofiled.c \
+ oprofiled.h \
+ opd_stats.c \
+ opd_pipe.c \
+ opd_pipe.h \
+ opd_sfile.c \
+ opd_sfile.h \
+ opd_kernel.c \
+ opd_kernel.h \
+ opd_trans.c \
+ opd_trans.h \
+ opd_printf.h \
+ opd_stats.h \
+ opd_cookie.c \
+ opd_cookie.h \
+ opd_events.c \
+ opd_events.h \
+ opd_interface.h \
+ opd_mangling.c \
+ opd_mangling.h \
+ opd_perfmon.h \
+ opd_perfmon.c \
+ opd_anon.h \
+ opd_anon.c \
+ opd_spu.c \
+ opd_extended.h \
+ opd_extended.c \
+ opd_ibs.h \
+ opd_ibs.c \
+ opd_ibs_macro.h \
+ opd_ibs_trans.h \
+ opd_ibs_trans.c
+
+AM_CPPFLAGS = \
+ -I ${top_srcdir}/libabi \
+ -I ${top_srcdir}/libutil \
+ -I ${top_srcdir}/libop \
+ -I ${top_srcdir}/libdb
+
+
+# -fno-omit-frame-pointer needed for daemon build: see ChangeLog-2004 02-23
+AM_CFLAGS = @OP_CFLAGS@ -fno-omit-frame-pointer
+oprofiled_LDADD = \
+ liblegacy/liblegacy.a \
+ ../libabi/libabi.a \
+ ../libdb/libodb.a \
+ ../libop/libop.a \
+ ../libutil/libutil.a
+
+oprofiled_LINK = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+all: all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign daemon/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign daemon/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ if test -f $$p \
+ || test -f $$p1 \
+ ; then \
+ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+ else :; fi; \
+ done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+ rm -f "$(DESTDIR)$(bindir)/$$f"; \
+ done
+
+clean-binPROGRAMS:
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+oprofiled$(EXEEXT): $(oprofiled_OBJECTS) $(oprofiled_DEPENDENCIES)
+ @rm -f oprofiled$(EXEEXT)
+ $(oprofiled_LINK) $(oprofiled_LDFLAGS) $(oprofiled_OBJECTS) $(oprofiled_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/init.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opd_anon.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opd_cookie.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opd_events.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opd_extended.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opd_ibs.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opd_ibs_trans.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opd_kernel.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opd_mangling.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opd_perfmon.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opd_pipe.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opd_sfile.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opd_spu.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opd_stats.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opd_trans.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oprofiled.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(mkdir_p) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(PROGRAMS)
+installdirs: installdirs-recursive
+installdirs-am:
+ for dir in "$(DESTDIR)$(bindir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+ clean clean-binPROGRAMS clean-generic clean-libtool \
+ clean-recursive ctags ctags-recursive distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-recursive distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-binPROGRAMS \
+ install-data install-data-am install-exec install-exec-am \
+ install-info install-info-am install-man install-strip \
+ installcheck installcheck-am installdirs installdirs-am \
+ maintainer-clean maintainer-clean-generic \
+ maintainer-clean-recursive mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \
+ pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
+ uninstall-binPROGRAMS uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/daemon/liblegacy/Makefile.am b/daemon/liblegacy/Makefile.am
new file mode 100644
index 0000000..51078a6
--- /dev/null
+++ b/daemon/liblegacy/Makefile.am
@@ -0,0 +1,28 @@
+noinst_LIBRARIES = liblegacy.a
+
+# -fno-omit-frame-pointer needed for daemon build: see ChangeLog-2004 02-23
+AM_CFLAGS = @OP_CFLAGS@ -fno-omit-frame-pointer
+
+AM_CPPFLAGS = \
+ -I ${top_srcdir}/libutil \
+ -I ${top_srcdir}/libop \
+ -I ${top_srcdir}/libdb \
+ -I ${top_srcdir}/daemon
+
+liblegacy_a_SOURCES = \
+ opd_24_stats.c \
+ opd_24_stats.h \
+ opd_kernel.c \
+ opd_proc.c \
+ opd_image.c \
+ opd_mapping.c \
+ opd_parse_proc.c \
+ opd_image.h \
+ opd_mapping.h \
+ p_module.h \
+ opd_kernel.h \
+ opd_parse_proc.h \
+ opd_proc.h \
+ opd_sample_files.c \
+ opd_sample_files.h \
+ init.c
diff --git a/daemon/liblegacy/Makefile.in b/daemon/liblegacy/Makefile.in
new file mode 100644
index 0000000..519f855
--- /dev/null
+++ b/daemon/liblegacy/Makefile.in
@@ -0,0 +1,510 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = daemon/liblegacy
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/binutils.m4 \
+ $(top_srcdir)/m4/builtinexpect.m4 \
+ $(top_srcdir)/m4/cellspubfdsupport.m4 \
+ $(top_srcdir)/m4/compileroption.m4 \
+ $(top_srcdir)/m4/configmodule.m4 \
+ $(top_srcdir)/m4/copyifchange.m4 $(top_srcdir)/m4/docbook.m4 \
+ $(top_srcdir)/m4/extradirs.m4 $(top_srcdir)/m4/findkernel.m4 \
+ $(top_srcdir)/m4/kerneloption.m4 \
+ $(top_srcdir)/m4/kernelversion.m4 \
+ $(top_srcdir)/m4/mallocattribute.m4 \
+ $(top_srcdir)/m4/poptconst.m4 \
+ $(top_srcdir)/m4/precompiledheader.m4 $(top_srcdir)/m4/qt.m4 \
+ $(top_srcdir)/m4/resultyn.m4 $(top_srcdir)/m4/sstream.m4 \
+ $(top_srcdir)/m4/typedef.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+ARFLAGS = cru
+liblegacy_a_AR = $(AR) $(ARFLAGS)
+liblegacy_a_LIBADD =
+am_liblegacy_a_OBJECTS = opd_24_stats.$(OBJEXT) opd_kernel.$(OBJEXT) \
+ opd_proc.$(OBJEXT) opd_image.$(OBJEXT) opd_mapping.$(OBJEXT) \
+ opd_parse_proc.$(OBJEXT) opd_sample_files.$(OBJEXT) \
+ init.$(OBJEXT)
+liblegacy_a_OBJECTS = $(am_liblegacy_a_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(liblegacy_a_SOURCES)
+DIST_SOURCES = $(liblegacy_a_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFD_LIBS = @BFD_LIBS@
+BUILD_JVMPI_AGENT_FALSE = @BUILD_JVMPI_AGENT_FALSE@
+BUILD_JVMPI_AGENT_TRUE = @BUILD_JVMPI_AGENT_TRUE@
+BUILD_JVMTI_AGENT_FALSE = @BUILD_JVMTI_AGENT_FALSE@
+BUILD_JVMTI_AGENT_TRUE = @BUILD_JVMTI_AGENT_TRUE@
+CAT_ENTRY_END = @CAT_ENTRY_END@
+CAT_ENTRY_START = @CAT_ENTRY_START@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOCBOOK_ROOT = @DOCBOOK_ROOT@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+EXTRA_CFLAGS_MODULE = @EXTRA_CFLAGS_MODULE@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAVA_HOMEDIR = @JAVA_HOMEDIR@
+KINC = @KINC@
+KSRC = @KSRC@
+KVERS = @KVERS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBERTY_LIBS = @LIBERTY_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MOC = @MOC@
+MODINSTALLDIR = @MODINSTALLDIR@
+OBJEXT = @OBJEXT@
+OPROFILE_DIR = @OPROFILE_DIR@
+OPROFILE_MODULE_ARCH = @OPROFILE_MODULE_ARCH@
+OP_CFLAGS = @OP_CFLAGS@
+OP_CXXFLAGS = @OP_CXXFLAGS@
+OP_DOCDIR = @OP_DOCDIR@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POPT_LIBS = @POPT_LIBS@
+PTRDIFF_T_TYPE = @PTRDIFF_T_TYPE@
+QT_INCLUDES = @QT_INCLUDES@
+QT_LDFLAGS = @QT_LDFLAGS@
+QT_LIB = @QT_LIB@
+QT_VERSION = @QT_VERSION@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIZE_T_TYPE = @SIZE_T_TYPE@
+STRIP = @STRIP@
+UIC = @UIC@
+VERSION = @VERSION@
+XML_CATALOG = @XML_CATALOG@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+have_qt_FALSE = @have_qt_FALSE@
+have_qt_TRUE = @have_qt_TRUE@
+have_xsltproc_FALSE = @have_xsltproc_FALSE@
+have_xsltproc_TRUE = @have_xsltproc_TRUE@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+kernel_support_FALSE = @kernel_support_FALSE@
+kernel_support_TRUE = @kernel_support_TRUE@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+topdir = @topdir@
+noinst_LIBRARIES = liblegacy.a
+
+# -fno-omit-frame-pointer needed for daemon build: see ChangeLog-2004 02-23
+AM_CFLAGS = @OP_CFLAGS@ -fno-omit-frame-pointer
+AM_CPPFLAGS = \
+ -I ${top_srcdir}/libutil \
+ -I ${top_srcdir}/libop \
+ -I ${top_srcdir}/libdb \
+ -I ${top_srcdir}/daemon
+
+liblegacy_a_SOURCES = \
+ opd_24_stats.c \
+ opd_24_stats.h \
+ opd_kernel.c \
+ opd_proc.c \
+ opd_image.c \
+ opd_mapping.c \
+ opd_parse_proc.c \
+ opd_image.h \
+ opd_mapping.h \
+ p_module.h \
+ opd_kernel.h \
+ opd_parse_proc.h \
+ opd_proc.h \
+ opd_sample_files.c \
+ opd_sample_files.h \
+ init.c
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign daemon/liblegacy/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign daemon/liblegacy/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLIBRARIES:
+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+liblegacy.a: $(liblegacy_a_OBJECTS) $(liblegacy_a_DEPENDENCIES)
+ -rm -f liblegacy.a
+ $(liblegacy_a_AR) liblegacy.a $(liblegacy_a_OBJECTS) $(liblegacy_a_LIBADD)
+ $(RANLIB) liblegacy.a
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/init.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opd_24_stats.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opd_image.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opd_kernel.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opd_mapping.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opd_parse_proc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opd_proc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opd_sample_files.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LIBRARIES)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstLIBRARIES ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-exec \
+ install-exec-am install-info install-info-am install-man \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am tags uninstall uninstall-am \
+ uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/daemon/liblegacy/init.c b/daemon/liblegacy/init.c
new file mode 100644
index 0000000..b2cd013
--- /dev/null
+++ b/daemon/liblegacy/init.c
@@ -0,0 +1,387 @@
+/**
+ * @file daemon/liblegacy/init.c
+ * Daemon set up and main loop for 2.4
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include "config.h"
+
+#include "opd_proc.h"
+#include "opd_mapping.h"
+#include "opd_24_stats.h"
+#include "opd_sample_files.h"
+#include "opd_image.h"
+#include "opd_parse_proc.h"
+#include "opd_kernel.h"
+#include "opd_printf.h"
+#include "oprofiled.h"
+
+#include "op_sample_file.h"
+#include "op_config_24.h"
+#include "op_interface.h"
+#include "op_libiberty.h"
+#include "op_deviceio.h"
+#include "op_events.h"
+#include "op_get_time.h"
+#include "op_fileio.h"
+
+#include <stdio.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+fd_t hashmapdevfd;
+
+int cpu_number;
+
+static fd_t devfd;
+static fd_t notedevfd;
+static struct op_buffer_head * sbuf;
+static size_t s_buf_bytesize;
+static struct op_note * nbuf;
+static size_t n_buf_bytesize;
+
+static void opd_sighup(void);
+static void opd_alarm(void);
+static void opd_sigterm(void);
+
+
+/**
+ * op_open_files - open necessary files
+ *
+ * Open the device files and the log file,
+ * and mmap() the hash map.
+ */
+static void op_open_files(void)
+{
+ hashmapdevfd = op_open_device(op_hash_device);
+ if (hashmapdevfd == -1) {
+ perror("Failed to open hash map device");
+ exit(EXIT_FAILURE);
+ }
+
+ notedevfd = op_open_device(op_note_device);
+ if (notedevfd == -1) {
+ if (errno == EINVAL)
+ fprintf(stderr, "Failed to open note device. Possibly you have passed incorrect\n"
+ "parameters. Check /var/log/messages.");
+ else
+ perror("Failed to open note device");
+ exit(EXIT_FAILURE);
+ }
+
+ devfd = op_open_device(op_device);
+ if (devfd == -1) {
+ if (errno == EINVAL)
+ fprintf(stderr, "Failed to open device. Possibly you have passed incorrect\n"
+ "parameters. Check /var/log/messages.");
+ else
+ perror("Failed to open profile device");
+ exit(EXIT_FAILURE);
+ }
+
+ opd_init_hash_map();
+
+ /* give output before re-opening stdout as the logfile */
+ printf("Using log file %s\n", op_log_file);
+
+ /* set up logfile */
+ close(0);
+ close(1);
+
+ if (open("/dev/null", O_RDONLY) == -1) {
+ perror("oprofiled: couldn't re-open stdin as /dev/null: ");
+ exit(EXIT_FAILURE);
+ }
+
+ opd_open_logfile();
+
+ printf("oprofiled started %s", op_get_time());
+ fflush(stdout);
+}
+
+
+static void opd_do_samples(struct op_buffer_head const * buf);
+static void opd_do_notes(struct op_note const * opd_buf, size_t count);
+
+/**
+ * do_shutdown - shutdown cleanly, reading as much remaining data as possible.
+ * @param buf sample buffer area
+ * @param size size of sample buffer
+ * @param nbuf note buffer area
+ * @param nsize size of note buffer
+ */
+static void opd_shutdown(struct op_buffer_head * buf, size_t size, struct op_note * nbuf, size_t nsize)
+{
+ ssize_t count = -1;
+ ssize_t ncount = -1;
+
+ /* the dump may have added no samples, so we must set
+ * non-blocking */
+ if (fcntl(devfd, F_SETFL, fcntl(devfd, F_GETFL) | O_NONBLOCK) < 0) {
+ perror("Failed to set non-blocking read for device: ");
+ exit(EXIT_FAILURE);
+ }
+
+ /* it's always OK to read the note device */
+ while (ncount < 0)
+ ncount = op_read_device(notedevfd, nbuf, nsize);
+
+ if (ncount > 0)
+ opd_do_notes(nbuf, ncount);
+
+ /* read as much as we can until we have exhausted the data
+ * (EAGAIN is returned).
+ *
+ * This will not livelock as the profiler has been partially
+ * shut down by now.
+ */
+ while (1) {
+ count = op_read_device(devfd, buf, size);
+ if (count < 0 && errno == EAGAIN)
+ break;
+ verbprintf(vmisc, "Shutting down, state %d\n", buf->state);
+ opd_do_samples(buf);
+ }
+}
+
+
+/**
+ * opd_do_read - enter processing loop
+ * @param buf buffer to read into
+ * @param size size of buffer
+ * @param nbuf note buffer
+ * @param nsize size of note buffer
+ *
+ * Read some of a buffer from the device and process
+ * the contents.
+ */
+static void opd_do_read(struct op_buffer_head * buf, size_t size, struct op_note * nbuf, size_t nsize)
+{
+ while (1) {
+ ssize_t count = -1;
+ ssize_t ncount = -1;
+
+ /* loop to handle EINTR */
+ while (count < 0)
+ count = op_read_device(devfd, buf, size);
+
+ while (ncount < 0)
+ ncount = op_read_device(notedevfd, nbuf, nsize);
+
+ opd_do_notes(nbuf, ncount);
+ opd_do_samples(buf);
+
+ // we can lost a signal alarm or a signal hup but we don't
+ // take care.
+ if (signal_alarm) {
+ signal_alarm = 0;
+ opd_alarm();
+ }
+
+ if (signal_hup) {
+ signal_hup = 0;
+ opd_sighup();
+ }
+
+ if (signal_term)
+ opd_sigterm();
+
+ /* request to stop arrived */
+ if (buf->state == STOPPING) {
+ verbprintf(vmisc, "Shutting down by request.\n");
+ opd_shutdown(buf, size, nbuf, nsize);
+ return;
+ }
+ }
+}
+
+/**
+ * opd_do_notes - process a notes buffer
+ * @param opd_buf buffer to process
+ * @param count number of bytes in buffer
+ *
+ * Process a buffer of notes.
+ */
+static void opd_do_notes(struct op_note const * opd_buf, size_t count)
+{
+ uint i;
+ struct op_note const * note;
+
+ for (i = 0; i < count/sizeof(struct op_note); i++) {
+ note = &opd_buf[i];
+
+ opd_24_stats[OPD_NOTIFICATIONS]++;
+
+ switch (note->type) {
+ case OP_MAP:
+ case OP_EXEC:
+ if (note->type == OP_EXEC)
+ opd_handle_exec(note->pid, note->tgid);
+ opd_handle_mapping(note);
+ break;
+
+ case OP_FORK:
+ opd_handle_fork(note);
+ break;
+
+ case OP_DROP_MODULES:
+ opd_clear_module_info();
+ break;
+
+ case OP_EXIT:
+ opd_handle_exit(note);
+ break;
+
+ default:
+ fprintf(stderr, "Received unknown notification type %u\n", note->type);
+ abort();
+ break;
+ }
+ }
+}
+
+/**
+ * opd_do_samples - process a sample buffer
+ * @param opd_buf buffer to process
+ *
+ * Process a buffer of samples.
+ * The signals specified by the global variable maskset are
+ * masked.
+ *
+ * If the sample could be processed correctly, it is written
+ * to the relevant sample file. Additionally mapping and
+ * process notifications are handled here.
+ */
+static void opd_do_samples(struct op_buffer_head const * opd_buf)
+{
+ uint i;
+ struct op_sample const * buffer = opd_buf->buffer;
+
+ opd_24_stats[OPD_DUMP_COUNT]++;
+
+ verbprintf(vmisc, "Read buffer of %d entries for cpu %d.\n",
+ (unsigned int)opd_buf->count, opd_buf->cpu_nr);
+
+ if (separate_cpu)
+ cpu_number = opd_buf->cpu_nr;
+ for (i = 0; i < opd_buf->count; i++) {
+ verbprintf(vsamples, "%.6u: EIP: 0x%.8lx pid: %.6d\n",
+ i, buffer[i].eip, buffer[i].pid);
+ opd_put_sample(&buffer[i]);
+ }
+}
+
+
+/**
+ * opd_alarm - clean up old procs, msync, and report stats
+ */
+static void opd_alarm(void)
+{
+ opd_sync_samples_files();
+
+ opd_age_procs();
+
+ opd_print_24_stats();
+
+ alarm(60 * 10);
+}
+
+
+/* re-open logfile for logrotate */
+static void opd_sighup(void)
+{
+ printf("Received SIGHUP.\n");
+ close(1);
+ close(2);
+ opd_open_logfile();
+ /* We just close them, and re-open them lazily as usual. */
+ opd_for_each_image(opd_close_image_samples_files);
+}
+
+
+static void clean_exit(void)
+{
+ opd_cleanup_hash_name();
+ op_free_events();
+ unlink(op_lock_file);
+}
+
+
+static void opd_sigterm(void)
+{
+ opd_print_24_stats();
+ printf("oprofiled stopped %s", op_get_time());
+ exit(EXIT_FAILURE);
+}
+
+
+static void opd_24_init(void)
+{
+ size_t i;
+ int opd_buf_size = OP_DEFAULT_BUF_SIZE;
+ int opd_note_buf_size = OP_DEFAULT_NOTE_SIZE;
+
+ if (!no_vmlinux)
+ opd_parse_kernel_range(kernel_range);
+ opd_buf_size = opd_read_fs_int(OP_MOUNT, "bufsize", 1);
+ opd_note_buf_size = opd_read_fs_int(OP_MOUNT, "notesize", 1);
+
+ s_buf_bytesize = sizeof(struct op_buffer_head) + opd_buf_size * sizeof(struct op_sample);
+
+ sbuf = xmalloc(s_buf_bytesize);
+
+ n_buf_bytesize = opd_note_buf_size * sizeof(struct op_note);
+ nbuf = xmalloc(n_buf_bytesize);
+
+ opd_init_images();
+ opd_init_procs();
+ opd_init_kernel_image();
+
+ for (i = 0; i < OPD_MAX_STATS; i++)
+ opd_24_stats[i] = 0;
+
+ if (atexit(clean_exit)) {
+ perror("oprofiled: couldn't set exit cleanup: ");
+ exit(EXIT_FAILURE);
+ }
+}
+
+
+static void opd_24_start(void)
+{
+ op_open_files();
+
+ /* yes, this is racey. */
+ opd_get_ascii_procs();
+
+ /* simple sleep-then-process loop */
+ opd_do_read(sbuf, s_buf_bytesize, nbuf, n_buf_bytesize);
+}
+
+
+static void opd_24_exit(void)
+{
+ opd_print_24_stats();
+ printf("oprofiled stopped %s", op_get_time());
+
+ free(sbuf);
+ free(nbuf);
+ opd_clear_module_info();
+ opd_proc_cleanup();
+ /* kernel/module image are not owned by a proc, we must cleanup them */
+ opd_for_each_image(opd_delete_image);
+}
+
+
+struct oprofiled_ops opd_24_ops = {
+ .init = opd_24_init,
+ .start = opd_24_start,
+ .exit = opd_24_exit
+};
diff --git a/daemon/liblegacy/opd_24_stats.c b/daemon/liblegacy/opd_24_stats.c
new file mode 100644
index 0000000..52425c4
--- /dev/null
+++ b/daemon/liblegacy/opd_24_stats.c
@@ -0,0 +1,62 @@
+/**
+ * @file opd_24_stats.c
+ * Management of daemon statistics
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include "opd_24_stats.h"
+#include "opd_proc.h"
+#include "opd_image.h"
+#include "oprofiled.h"
+
+#include "op_get_time.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+
+unsigned long opd_24_stats[OPD_MAX_STATS];
+
+void opd_print_24_stats(void)
+{
+ printf("\n%s\n", op_get_time());
+ printf("Nr. proc struct: %d\n", opd_get_nr_procs());
+ printf("Nr. image struct: %d\n", opd_get_nr_images());
+ printf("Nr. kernel samples: %lu\n", opd_24_stats[OPD_KERNEL]);
+ printf("Nr. modules samples: %lu\n", opd_24_stats[OPD_MODULE]);
+ printf("Nr. modules samples lost: %lu\n", opd_24_stats[OPD_LOST_MODULE]);
+ printf("Nr. samples lost due to no process information: %lu\n",
+ opd_24_stats[OPD_LOST_PROCESS]);
+ printf("Nr. samples lost due to sample file open failure: %lu\n",
+ opd_24_stats[OPD_LOST_SAMPLEFILE]);
+ printf("Nr. process samples in user-space: %lu\n", opd_24_stats[OPD_PROCESS]);
+ printf("Nr. samples lost due to no map information: %lu\n",
+ opd_24_stats[OPD_LOST_MAP_PROCESS]);
+ if (opd_24_stats[OPD_PROC_QUEUE_ACCESS]) {
+ printf("Average depth of search of proc queue: %f\n",
+ (double)opd_24_stats[OPD_PROC_QUEUE_DEPTH]
+ / (double)opd_24_stats[OPD_PROC_QUEUE_ACCESS]);
+ }
+ if (opd_24_stats[OPD_MAP_ARRAY_ACCESS]) {
+ printf("Average depth of iteration through mapping array: %f\n",
+ (double)opd_24_stats[OPD_MAP_ARRAY_DEPTH]
+ / (double)opd_24_stats[OPD_MAP_ARRAY_ACCESS]);
+ }
+ if (opd_24_stats[OPD_IMAGE_HASH_ACCESS]) {
+ printf("Average depth of iteration through image hash array: %f\n",
+ (double)opd_24_stats[OPD_IMAGE_HASH_DEPTH]
+ / (double)opd_24_stats[OPD_IMAGE_HASH_ACCESS]);
+ }
+ printf("Nr. sample dumps: %lu\n", opd_24_stats[OPD_DUMP_COUNT]);
+ printf("Nr. samples total: %lu\n", opd_24_stats[OPD_SAMPLES]);
+ printf("Nr. notifications: %lu\n", opd_24_stats[OPD_NOTIFICATIONS]);
+ printf("Nr. kernel note buffer overflow: %u\n",
+ opd_read_fs_int(OP_MOUNT, "note_buffer_overflow", 0));
+ printf("Nr. kernel samples buffer overflow: %u\n",
+ opd_read_fs_int(OP_MOUNT, "buffer_overflow", 0));
+ fflush(stdout);
+}
diff --git a/daemon/liblegacy/opd_24_stats.h b/daemon/liblegacy/opd_24_stats.h
new file mode 100644
index 0000000..4acd860
--- /dev/null
+++ b/daemon/liblegacy/opd_24_stats.h
@@ -0,0 +1,39 @@
+/**
+ * @file opd_24_stats.h
+ * Management of daemon statistics
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#ifndef OPD_24_STATS_H
+#define OPD_24_STATS_H
+
+extern unsigned long opd_24_stats[];
+
+enum { OPD_KERNEL, /**< nr kernel samples */
+ OPD_MODULE, /**< nr module samples */
+ OPD_LOST_MODULE, /**< nr samples in module for which modules can not be located */
+ OPD_LOST_PROCESS, /**< nr samples for which process info couldn't be accessed */
+ OPD_PROCESS, /**< nr userspace samples */
+ OPD_LOST_MAP_PROCESS, /**< nr samples for which map info couldn't be accessed */
+ OPD_LOST_SAMPLEFILE, /**< nr samples for which sample file can't be opened */
+ OPD_PROC_QUEUE_ACCESS, /**< nr accesses of proc queue */
+ OPD_PROC_QUEUE_DEPTH, /**< cumulative depth of proc queue accesses */
+ OPD_DUMP_COUNT, /**< nr of times buffer is read */
+ OPD_MAP_ARRAY_ACCESS, /**< nr accesses of map array */
+ OPD_MAP_ARRAY_DEPTH, /**< cumulative depth of map array accesses */
+ OPD_IMAGE_HASH_ACCESS, /**< nr opd_find_image() */
+ OPD_IMAGE_HASH_DEPTH, /**< cumulative depth of image search */
+ OPD_SAMPLES, /**< nr distinct samples */
+ OPD_NOTIFICATIONS, /**< nr notifications */
+ OPD_MAX_STATS /**< end of stats */
+ };
+
+/** opd_print_24_stats - print out latest statistics */
+void opd_print_24_stats(void);
+
+#endif /* OPD_24_STATS_H */
diff --git a/daemon/liblegacy/opd_image.c b/daemon/liblegacy/opd_image.c
new file mode 100644
index 0000000..ac6b5a2
--- /dev/null
+++ b/daemon/liblegacy/opd_image.c
@@ -0,0 +1,264 @@
+/**
+ * @file opd_image.c
+ * Management of binary images
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include "opd_image.h"
+#include "opd_printf.h"
+#include "opd_sample_files.h"
+#include "opd_24_stats.h"
+#include "oprofiled.h"
+
+#include "op_file.h"
+#include "op_config_24.h"
+#include "op_libiberty.h"
+#include "op_string.h"
+
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+/* maintained for statistics purpose only */
+static int nr_images;
+
+/* list of images */
+#define OPD_IMAGE_HASH_SIZE 2048
+static struct list_head opd_images[OPD_IMAGE_HASH_SIZE];
+
+
+void opd_init_images(void)
+{
+ int i;
+ for (i = 0; i < OPD_IMAGE_HASH_SIZE; ++i)
+ list_init(&opd_images[i]);
+}
+
+
+int opd_get_nr_images(void)
+{
+ return nr_images;
+}
+
+
+void opd_delete_image(struct opd_image * image)
+{
+ verbprintf(vmisc, "Deleting image: name %s app_name %s, kernel %d, "
+ "tid %d, tgid %d ref count %u\n",
+ image->name, image->app_name, image->kernel,
+ image->tid, image->tgid, (int)image->ref_count);
+
+ if (image->ref_count <= 0) {
+ printf("image->ref_count < 0 for image: name %s app_name %s, "
+ "kernel %d, tid %d, tgid %d ref count %u\n",
+ image->name, image->app_name, image->kernel,
+ image->tid, image->tgid, image->ref_count);
+ abort();
+ }
+
+ if (--image->ref_count != 0)
+ return;
+
+ if (image->name)
+ free(image->name);
+ if (image->app_name)
+ free(image->app_name);
+ list_del(&image->hash_next);
+ opd_close_image_samples_files(image);
+ free(image);
+
+ nr_images--;
+}
+
+
+void opd_for_each_image(opd_image_cb image_cb)
+{
+ struct list_head * pos;
+ struct list_head * pos2;
+ int i;
+
+ for (i = 0; i < OPD_IMAGE_HASH_SIZE; ++i) {
+ list_for_each_safe(pos, pos2, &opd_images[i]) {
+ struct opd_image * image =
+ list_entry(pos, struct opd_image, hash_next);
+ image_cb(image);
+ }
+ }
+}
+
+
+/**
+ * opd_hash_image - hash an image
+ * @param hash hash of image name
+ * @param tid thread id
+ * @param tgid thread group id
+ *
+ * return the hash code for the passed parameters
+ */
+static size_t opd_hash_image(char const * name, pid_t tid, pid_t tgid)
+{
+ size_t hash = op_hash_string(name);
+ if (separate_thread)
+ hash += tid + tgid;
+ return hash % OPD_IMAGE_HASH_SIZE;
+}
+
+
+/**
+ * opd_new_image - create an image sample file
+ * @param app_name the application name where belongs this image
+ * @param name name of the image to add
+ * @param kernel is the image a kernel/module image
+ * @param tid thread id
+ * @param tgid thread group id
+ *
+ * image at funtion entry is uninitialised
+ * name is copied i.e. should be GC'd separately from the
+ * image structure if appropriate.
+ *
+ * Initialise an opd_image struct for the image image
+ * without opening the associated samples files. At return
+ * the image is fully initialized.
+ */
+static struct opd_image *
+opd_new_image(char const * name, char const * app_name, int kernel,
+ pid_t tid, pid_t tgid)
+{
+ size_t hash_image;
+ struct opd_image * image;
+
+ verbprintf(vmisc, "Creating image: %s %s, kernel %d, tid %d, "
+ "tgid %d\n", name, app_name, kernel, tid, tgid);
+
+ image = xmalloc(sizeof(struct opd_image));
+
+ list_init(&image->hash_next);
+ image->name = xstrdup(name);
+ image->kernel = kernel;
+ image->tid = tid;
+ image->tgid = tgid;
+ image->ref_count = 0;
+ image->app_name = app_name ? xstrdup(app_name) : NULL;
+ image->mtime = op_get_mtime(image->name);
+
+ image->ignored = 1;
+ if (separate_lib && app_name)
+ image->ignored = is_image_ignored(app_name);
+ if (image->ignored)
+ image->ignored = is_image_ignored(name);
+
+ memset(image->sfiles, '\0', NR_CPUS * sizeof(struct opd_24_sfile **));
+
+ hash_image = opd_hash_image(name, tid, tgid);
+ list_add(&image->hash_next, &opd_images[hash_image]);
+
+ nr_images++;
+
+ return image;
+}
+
+
+/**
+ * is_same_image - check for identical image
+ * @param image image to compare
+ * @param name name of image
+ * @param app_name image must belong to this application name
+ * @param tid thread id
+ * @param tgid thread group id
+ *
+ * on entry caller have checked than strcmp(image->name, name) == 0
+ * return 0 if the couple (name, app_name) refers to same image
+ */
+static int is_same_image(struct opd_image const * image, char const * app_name,
+ pid_t tid, pid_t tgid)
+{
+ /* correctness is really important here, if we fail to recognize
+ * identical image we will open/mmap multiple time the same samples
+ * files which is not supported by the kernel, strange assertion
+ * failure in libfd is a typical symptom of that */
+
+ if (separate_thread) {
+ if (image->tid != tid || image->tgid != tgid)
+ return 1;
+ }
+
+ /* if !separate_lib, the comparison made by caller is enough */
+ if (!separate_lib)
+ return 0;
+
+ if (image->app_name == NULL && app_name == NULL)
+ return 0;
+
+ if (image->app_name != NULL && app_name != NULL &&
+ !strcmp(image->app_name, app_name))
+ return 0;
+
+ /* /proc parsed image come with a non null app_name but notification
+ * for application itself come with a null app_name, in this case
+ * the test above fail so check for this case. */
+ if (image->app_name && !app_name && !strcmp(image->app_name, image->name))
+ return 0;
+
+ return 1;
+}
+
+
+/**
+ * opd_find_image - find an image
+ * @param name name of image to find
+ * @param hash hash of image to find
+ * @param app_name the application name where belongs this image
+ * @param tid thread id
+ * @param tgid thread group id
+ *
+ * Returns the image pointer for the file specified by name, or %NULL.
+ */
+static struct opd_image * opd_find_image(char const * name,
+ char const * app_name, pid_t tid, pid_t tgid)
+{
+ /* suppress uninitialized use warning */
+ struct opd_image * image = 0;
+ struct list_head * pos;
+ size_t bucket;
+
+ opd_24_stats[OPD_IMAGE_HASH_ACCESS]++;
+ bucket = opd_hash_image(name, tid, tgid);
+ list_for_each(pos, &opd_images[bucket]) {
+ opd_24_stats[OPD_IMAGE_HASH_DEPTH]++;
+ image = list_entry(pos, struct opd_image, hash_next);
+
+ if (!strcmp(image->name, name)) {
+ if (!is_same_image(image, app_name, tid, tgid))
+ break;
+ }
+ }
+
+ if (pos == &opd_images[bucket])
+ return NULL;
+
+ /* The app_name field is always valid */
+ return image;
+}
+
+
+struct opd_image * opd_get_image(char const * name, char const * app_name,
+ int kernel, pid_t tid, pid_t tgid)
+{
+ struct opd_image * image;
+ if ((image = opd_find_image(name, app_name, tid, tgid)) == NULL)
+ image = opd_new_image(name, app_name, kernel, tid, tgid);
+
+ return image;
+}
+
+
+struct opd_image * opd_get_kernel_image(char const * name,
+ char const * app_name, pid_t tid, pid_t tgid)
+{
+ return opd_get_image(name, app_name, 1, tid, tgid);
+}
diff --git a/daemon/liblegacy/opd_image.h b/daemon/liblegacy/opd_image.h
new file mode 100644
index 0000000..5d55270
--- /dev/null
+++ b/daemon/liblegacy/opd_image.h
@@ -0,0 +1,111 @@
+/**
+ * @file opd_image.h
+ * Management of binary images
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#ifndef OPD_IMAGE_H
+#define OPD_IMAGE_H
+
+#include "op_list.h"
+#include "op_config_24.h"
+#include "op_types.h"
+
+#include <time.h>
+
+struct opd_24_sfile;
+
+/**
+ * A binary (library, application, kernel or module)
+ * is represented by a struct opd_image.
+ */
+struct opd_image {
+ /** used by container of opd_images */
+ struct list_head hash_next;
+ /** how many time this opd_image is referenced */
+ int ref_count;
+ /** all samples files belonging to this image */
+ struct opd_24_sfile ** sfiles[NR_CPUS];
+ /** name of this image */
+ char * name;
+ /** the application name where belongs this image, NULL if image has
+ * no owner (such as vmlinux or module) */
+ char * app_name;
+ /** thread id, on 2.2 kernel always == to tgid */
+ pid_t tid;
+ /** thread group id */
+ pid_t tgid;
+ /** time of last modification */
+ time_t mtime;
+ /** kernel image or not */
+ int kernel;
+ /** non zero if this image must be profiled */
+ int ignored;
+};
+
+/** callback function passed to opd_for_each_image() */
+typedef void (*opd_image_cb)(struct opd_image *);
+
+/**
+ * @param imagecb callback to apply onto each existing image struct
+ *
+ * the callback receive a struct opd_image * (not a const struct) and is
+ * allowed to freeze the image struct itself.
+ */
+void opd_for_each_image(opd_image_cb imagecb);
+
+/**
+ * initialize opd_image container
+ */
+void opd_init_images(void);
+
+/**
+ * @param image the image pointer
+ *
+ * Decrement reference count of image, if reference count is zero flush and
+ * close the samples files then freeze all memory belonging to this image.
+ */
+void opd_delete_image(struct opd_image * image);
+
+/**
+ * opd_get_kernel_image - get a kernel image
+ * @param name of image
+ * @param app_name application owner of this kernel image. non-null only
+ * when separate_kernel_sample != 0
+ * @param tid thread id
+ * @param tgid thread group id
+ *
+ * Create and initialise an image adding it to the image lists and to image
+ * hash list. Note than at creation reference count is zero, it's caller
+ * responsabilities to incr this count.
+ */
+struct opd_image * opd_get_kernel_image(char const * name,
+ char const * app_name, pid_t tid, pid_t tgid);
+
+/**
+ * opd_get_image - get an image from the image structure
+ * @param name name of image
+ * @param app_name the application name where belongs this image
+ * @param kernel is the image a kernel/module image
+ * @param tid thread id
+ * @param tgid thread group id
+ *
+ * Get the image specified by the file name name from the
+ * image structure. If it is not present, the image is
+ * added to the structure. In either case, the image number
+ * is returned.
+ */
+struct opd_image * opd_get_image(char const * name, char const * app_name,
+ int kernel, pid_t tid, pid_t tgid);
+
+/**
+ * opd_get_nr_images - return number of images
+ */
+int opd_get_nr_images(void);
+
+#endif /* OPD_IMAGE_H */
diff --git a/daemon/liblegacy/opd_kernel.c b/daemon/liblegacy/opd_kernel.c
new file mode 100644
index 0000000..1131aa7
--- /dev/null
+++ b/daemon/liblegacy/opd_kernel.c
@@ -0,0 +1,464 @@
+/**
+ * @file daemon/liblegacy/opd_kernel.c
+ * Dealing with the kernel and kernel module samples
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include "opd_kernel.h"
+#include "opd_proc.h"
+#include "opd_image.h"
+#include "opd_mapping.h"
+#include "opd_printf.h"
+#include "opd_24_stats.h"
+#include "oprofiled.h"
+
+#include "op_fileio.h"
+#include "op_config_24.h"
+#include "op_libiberty.h"
+
+#include "p_module.h"
+#include <string.h>
+#include <stdlib.h>
+#include <errno.h>
+
+/* kernel module */
+struct opd_module {
+ char * name;
+ struct opd_image * image;
+ unsigned long start;
+ unsigned long end;
+ struct list_head module_list;
+};
+
+static struct opd_image * kernel_image;
+
+/* kernel and module support */
+static unsigned long kernel_start;
+static unsigned long kernel_end;
+static struct list_head opd_modules = { &opd_modules, &opd_modules };
+static unsigned int nr_modules=0;
+
+void opd_init_kernel_image(void)
+{
+ /* for no vmlinux */
+ if (!vmlinux)
+ vmlinux = "no-vmlinux";
+ kernel_image = opd_get_kernel_image(vmlinux, NULL, 0, 0);
+ kernel_image->ref_count++;
+}
+
+
+void opd_parse_kernel_range(char const * arg)
+{
+ sscanf(arg, "%lx,%lx", &kernel_start, &kernel_end);
+
+ verbprintf(vmisc, "OPD_PARSE_KERNEL_RANGE: kernel_start = %lx, kernel_end = %lx\n",
+ kernel_start, kernel_end);
+
+ if (!kernel_start && !kernel_end) {
+ fprintf(stderr,
+ "Warning: mis-parsed kernel range: %lx-%lx\n",
+ kernel_start, kernel_end);
+ fprintf(stderr, "kernel profiles will be wrong.\n");
+ }
+}
+
+
+/**
+ * opd_create_module - allocate and initialise a module description
+ * @param name module name
+ * @param start start address
+ * @param end end address
+ */
+static struct opd_module *
+opd_create_module(char * name, unsigned long start, unsigned long end)
+{
+ struct opd_module * module = xmalloc(sizeof(struct opd_module));
+
+ module->name = xstrdup(name);
+ module->image = NULL;
+ module->start = start;
+ module->end = end;
+ list_add(&module->module_list, &opd_modules);
+
+ return module;
+}
+
+
+/**
+ * opd_find_module_by_name - find a module by name, ccreating a new once if
+ * search fail
+ * @param name module name
+ */
+static struct opd_module * opd_find_module_by_name(char * name)
+{
+ struct list_head * pos;
+ struct opd_module * module;
+
+ list_for_each(pos, &opd_modules) {
+ module = list_entry(pos, struct opd_module, module_list);
+ if (!strcmp(name, module->name))
+ return module;
+ }
+
+ return opd_create_module(name, 0, 0);
+}
+
+
+void opd_clear_module_info(void)
+{
+ struct list_head * pos;
+ struct list_head * pos2;
+ struct opd_module * module;
+
+ verbprintf(vmodule, "Removing module list\n");
+ list_for_each_safe(pos, pos2, &opd_modules) {
+ module = list_entry(pos, struct opd_module, module_list);
+ free(module->name);
+ free(module);
+ }
+
+ list_init(&opd_modules);
+
+ opd_clear_kernel_mapping();
+}
+
+
+/**
+ * opd_get_module_info - parse mapping information for kernel modules
+ *
+ * Parse the file /proc/ksyms to read in mapping information for
+ * all kernel modules. The modutils package adds special symbols
+ * to this file which allows determination of the module image
+ * and mapping addresses of the form :
+ *
+ * __insmod_modulename_Oobjectfile_Mmtime_Vversion
+ * __insmod_modulename_Ssectionname_Llength
+ *
+ * Currently the image file "objectfile" is stored, and details of
+ * ".text" sections.
+ *
+ * There is no query_module API that allow to get directly the pathname
+ * of a module so we need to parse all the /proc/ksyms.
+ */
+static void opd_get_module_info(void)
+{
+ char * line;
+ char * cp, * cp2, * cp3;
+ FILE * fp;
+ struct opd_module * mod;
+ char * modname;
+ char * filename;
+
+ nr_modules=0;
+
+ fp = op_try_open_file("/proc/ksyms", "r");
+
+ if (!fp) {
+ printf("oprofiled: /proc/ksyms not readable, can't process module samples.\n");
+ return;
+ }
+
+ verbprintf(vmodule, "Read module info.\n");
+
+ while (1) {
+ line = op_get_line(fp);
+
+ if (!line)
+ break;
+
+ if (!strcmp("", line)) {
+ free(line);
+ continue;
+ }
+
+ if (strlen(line) < 9) {
+ printf("oprofiled: corrupt /proc/ksyms line \"%s\"\n", line);
+ break;
+ }
+
+ if (strncmp("__insmod_", line + 9, 9)) {
+ free(line);
+ continue;
+ }
+
+ cp = line + 18;
+ cp2 = cp;
+ while ((*cp2) && !!strncmp("_S", cp2+1, 2) && !!strncmp("_O", cp2+1, 2))
+ cp2++;
+
+ if (!*cp2) {
+ printf("oprofiled: corrupt /proc/ksyms line \"%s\"\n", line);
+ break;
+ }
+
+ cp2++;
+
+ modname = xmalloc((size_t)((cp2-cp) + 1));
+ strncpy(modname, cp, (size_t)((cp2-cp)));
+ modname[cp2-cp] = '\0';
+
+ mod = opd_find_module_by_name(modname);
+
+ free(modname);
+
+ switch (*(++cp2)) {
+ case 'O':
+ /* get filename */
+ cp2++;
+ cp3 = cp2;
+
+ while ((*cp3) && !!strncmp("_M", cp3+1, 2))
+ cp3++;
+
+ if (!*cp3) {
+ free(line);
+ continue;
+ }
+
+ cp3++;
+ filename = xmalloc((size_t)(cp3 - cp2 + 1));
+ strncpy(filename, cp2, (size_t)(cp3 - cp2));
+ filename[cp3-cp2] = '\0';
+
+ mod->image = opd_get_kernel_image(filename, NULL, 0, 0);
+ mod->image->ref_count++;
+ free(filename);
+ break;
+
+ case 'S':
+ /* get extent of .text section */
+ cp2++;
+ if (strncmp(".text_L", cp2, 7)) {
+ free(line);
+ continue;
+ }
+
+ cp2 += 7;
+ sscanf(line, "%lx", &mod->start);
+ sscanf(cp2, "%lu", &mod->end);
+ mod->end += mod->start;
+ break;
+ }
+
+ free(line);
+ }
+
+ if (line)
+ free(line);
+ op_close_file(fp);
+}
+
+
+/**
+ * opd_drop_module_sample - drop a module sample efficiently
+ * @param eip eip of sample
+ *
+ * This function is called to recover from failing to put a samples even
+ * after re-reading /proc/ksyms. It's either a rogue sample, or from a module
+ * that didn't create symbols (like in some initrd setups). So we check with
+ * query_module() if we can place it in a symbol-less module, and if so create
+ * a negative entry for it, to quickly ignore future samples.
+ *
+ * Problem uncovered by Bob Montgomery <bobm@fc.hp.com>
+ *
+ */
+static void opd_drop_module_sample(unsigned long eip)
+{
+ char * module_names;
+ char * name;
+ size_t size = 1024;
+ size_t ret;
+ uint nr_mods;
+ uint mod = 0;
+
+ opd_24_stats[OPD_LOST_MODULE]++;
+
+ module_names = xmalloc(size);
+ while (query_module(NULL, QM_MODULES, module_names, size, &ret)) {
+ if (errno != ENOSPC) {
+ verbprintf(vmodule, "query_module failed: %s\n", strerror(errno));
+ return;
+ }
+ size = ret;
+ module_names = xrealloc(module_names, size);
+ }
+
+ nr_mods = ret;
+ name = module_names;
+
+ while (mod < nr_mods) {
+ struct module_info info;
+ if (!query_module(name, QM_INFO, &info, sizeof(info), &ret)) {
+ if (eip >= info.addr && eip < info.addr + info.size) {
+ verbprintf(vmodule, "Sample from unprofilable module %s\n", name);
+ opd_create_module(name, info.addr, info.addr + info.size);
+ break;
+ }
+ }
+ mod++;
+ name += strlen(name) + 1;
+ }
+
+ if (module_names)
+ free(module_names);
+}
+
+
+/**
+ * opd_find_module_by_eip - find a module by its eip
+ * @param eip EIP value
+ *
+ * find in the modules container the module which
+ * contain this eip return %NULL if not found.
+ * caller must check than the module image is valid
+ */
+static struct opd_module * opd_find_module_by_eip(unsigned long eip)
+{
+ struct list_head * pos;
+ struct opd_module * module;
+
+ list_for_each(pos, &opd_modules) {
+ module = list_entry(pos, struct opd_module, module_list);
+ if (module->start <= eip && module->end > eip)
+ return module;
+ }
+
+ return NULL;
+}
+
+
+/**
+ * opd_handle_module_sample - process a module sample
+ * @param eip EIP value
+ * @param counter counter number
+ *
+ * Process a sample in module address space. The sample eip
+ * is matched against module information. If the search was
+ * successful, the sample is output to the relevant file.
+ *
+ * Note that for modules and the kernel, the offset will be
+ * wrong in the file, as it is not a file offset, but the offset
+ * from the text section. This is fixed up in pp.
+ *
+ * If the sample could not be located in a module, it is treated
+ * as a kernel sample.
+ */
+static void opd_handle_module_sample(unsigned long eip, u32 counter)
+{
+ struct opd_module * module;
+
+ module = opd_find_module_by_eip(eip);
+ if (!module) {
+ /* not found in known modules, re-read our info and retry */
+ opd_clear_module_info();
+ opd_get_module_info();
+
+ module = opd_find_module_by_eip(eip);
+ }
+
+ if (module) {
+ if (module->image != NULL) {
+ opd_24_stats[OPD_MODULE]++;
+ opd_put_image_sample(module->image,
+ eip - module->start, counter);
+ } else {
+ opd_24_stats[OPD_LOST_MODULE]++;
+ verbprintf(vmodule, "No image for sampled module %s\n",
+ module->name);
+ }
+ } else {
+ opd_drop_module_sample(eip);
+ }
+}
+
+
+void opd_handle_kernel_sample(unsigned long eip, u32 counter)
+{
+ if (no_vmlinux || eip < kernel_end) {
+ opd_24_stats[OPD_KERNEL]++;
+ opd_put_image_sample(kernel_image, eip - kernel_start, counter);
+ return;
+ }
+
+ /* in a module */
+ opd_handle_module_sample(eip, counter);
+}
+
+
+int opd_eip_is_kernel(unsigned long eip)
+{
+#ifdef __i386
+#define KERNEL_OFFSET 0xC0000000
+ /*
+ * kernel_start == 0 when using --no-vmlinux.
+ * This is wrong, wrong, wrong, wrong, but we don't have much
+ * choice. It obviously breaks for IA64.
+ */
+ if (!kernel_start)
+ return eip >= KERNEL_OFFSET;
+#endif
+
+ return eip >= kernel_start;
+}
+
+
+void opd_add_kernel_map(struct opd_proc * proc, unsigned long eip)
+{
+ struct opd_module * module;
+ struct opd_image * image;
+ char const * app_name;
+
+ app_name = proc->name;
+ if (!app_name) {
+ verbprintf(vmisc, "un-named proc for tid %d\n", proc->tid);
+ return;
+ }
+
+
+ if (eip < kernel_end) {
+ image = opd_get_kernel_image(vmlinux, app_name, proc->tid, proc->tgid);
+ if (!image) {
+ verbprintf(vmisc, "Can't create image for %s %s\n", vmlinux, app_name);
+ return;
+ }
+
+ opd_add_mapping(proc, image, kernel_start, 0, kernel_end);
+ return;
+ }
+
+ module = opd_find_module_by_eip(eip);
+ if (!module) {
+ /* not found in known modules, re-read our info and retry */
+ opd_clear_module_info();
+ opd_get_module_info();
+
+ module = opd_find_module_by_eip(eip);
+ }
+
+ if (module) {
+ /* module->name is only the module name not the full path */
+ char const * module_name = 0;
+ if (module->image)
+ module_name = module->image->name;
+ if (!module_name) {
+ verbprintf(vmodule, "unable to get path name for module %s\n",
+ module->name);
+ module_name = module->name;
+ }
+ image = opd_get_kernel_image(module_name, app_name, proc->tid, proc->tgid);
+ if (!image) {
+ verbprintf(vmodule, "Can't create image for %s %s\n",
+ module->name, app_name);
+ return;
+ }
+ opd_add_mapping(proc, image, module->start, 0, module->end);
+ } else {
+ opd_drop_module_sample(eip);
+ }
+}
diff --git a/daemon/liblegacy/opd_kernel.h b/daemon/liblegacy/opd_kernel.h
new file mode 100644
index 0000000..f854ae0
--- /dev/null
+++ b/daemon/liblegacy/opd_kernel.h
@@ -0,0 +1,67 @@
+/**
+ * @file daemon/liblegacy/opd_kernel.h
+ * Dealing with the kernel and kernel module samples
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#ifndef OPD_KERNEL_H
+#define OPD_KERNEL_H
+
+#include "op_types.h"
+
+struct opd_proc;
+
+/**
+ * opd_init_kernel_image - initialise the kernel image
+ */
+void opd_init_kernel_image(void);
+
+/**
+ * opd_parse_kernel_range - parse the kernel range values
+ */
+void opd_parse_kernel_range(char const * arg);
+
+/**
+ * opd_clear_module_info - clear kernel module information
+ *
+ * Clear and free all kernel module information and reset
+ * values.
+ */
+void opd_clear_module_info(void);
+
+/**
+ * opd_handle_kernel_sample - process a kernel sample
+ * @param eip EIP value of sample
+ * @param counter counter number
+ *
+ * Handle a sample in kernel address space or in a module. The sample is
+ * output to the relevant image file.
+ */
+void opd_handle_kernel_sample(unsigned long eip, u32 counter);
+
+/**
+ * opd_eip_is_kernel - is the sample from kernel/module space
+ * @param eip EIP value
+ *
+ * Returns %1 if eip is in the address space starting at
+ * kernel_start, %0 otherwise.
+ */
+int opd_eip_is_kernel(unsigned long eip);
+
+/**
+ * opd_add_kernel_map - add a module or kernel maps to a proc struct
+ *
+ * @param proc owning proc of the new mapping
+ * @param eip eip inside the new mapping
+ *
+ * We assume than eip >= kernel_start
+ *
+ */
+void opd_add_kernel_map(struct opd_proc * proc, unsigned long eip);
+
+#endif /* OPD_KERNEL_H */
diff --git a/daemon/liblegacy/opd_mapping.c b/daemon/liblegacy/opd_mapping.c
new file mode 100644
index 0000000..699c475
--- /dev/null
+++ b/daemon/liblegacy/opd_mapping.c
@@ -0,0 +1,170 @@
+/**
+ * @file opd_mapping.c
+ * Management of process mappings
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include "opd_mapping.h"
+#include "opd_proc.h"
+#include "opd_image.h"
+#include "opd_printf.h"
+
+#include "op_interface.h"
+#include "op_config_24.h"
+#include "op_libiberty.h"
+
+#include <sys/mman.h>
+#include <limits.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+/* hash map device mmap */
+static struct op_hash_index * hashmap;
+/* already seen mapping name */
+static char const * hash_name[OP_HASH_MAP_NR];
+
+
+void opd_cleanup_hash_name(void)
+{
+ int i;
+ for (i = 0; i < OP_HASH_MAP_NR; ++i)
+ free((char *)hash_name[i]);
+
+}
+
+
+void opd_init_hash_map(void)
+{
+ extern fd_t hashmapdevfd;
+
+ hashmap = mmap(0, OP_HASH_MAP_SIZE, PROT_READ, MAP_SHARED, hashmapdevfd, 0);
+ if ((long)hashmap == -1) {
+ perror("oprofiled: couldn't mmap hash map");
+ exit(EXIT_FAILURE);
+ }
+
+}
+
+
+void opd_kill_maps(struct opd_proc * proc)
+{
+ struct list_head * pos, * pos2;
+
+ list_for_each_safe(pos, pos2, &proc->maps) {
+ struct opd_map * map = list_entry(pos, struct opd_map, next);
+ list_del(pos);
+ opd_delete_image(map->image);
+ free(map);
+ }
+}
+
+
+void opd_add_mapping(struct opd_proc * proc, struct opd_image * image,
+ unsigned long start, unsigned long offset, unsigned long end)
+{
+ struct opd_map * map;
+
+ verbprintf(vmisc, "Adding mapping for process %d: 0x%.8lx-0x%.8lx, off 0x%.8lx, \"%s\"\n",
+ proc->tid, start, end, offset, image->name);
+
+ map = malloc(sizeof(struct opd_map));
+
+ /* first map is the primary image */
+ if (list_empty(&proc->maps)) {
+ if (proc->name)
+ free((char *)proc->name);
+ proc->name = xstrdup(image->name);
+ }
+
+ image->ref_count++;
+
+ map->image = image;
+ map->start = start;
+ map->offset = offset;
+ map->end = end;
+ list_add_tail(&map->next, &proc->maps);
+}
+
+
+/**
+ * get_from_pool - retrieve string from hash map pool
+ * @param ind index into pool
+ */
+inline static char * get_from_pool(uint ind)
+{
+ return ((char *)(hashmap + OP_HASH_MAP_NR) + ind);
+}
+
+
+/**
+ * opg_get_hash_name - find a mapping name from a hash
+ * @param hash hash value for this name
+ */
+static char const * opd_get_hash_name(int hash)
+{
+ char file[PATH_MAX];
+ char * c = &file[PATH_MAX-1];
+ int orighash = hash;
+
+ if (hash_name[hash])
+ return hash_name[hash];
+
+ *c = '\0';
+ while (hash) {
+ char * name = get_from_pool(hashmap[hash].name);
+
+ if (strlen(name) + 1 + strlen(c) >= PATH_MAX) {
+ fprintf(stderr, "String \"%s\" too large.\n", c);
+ exit(EXIT_FAILURE);
+ }
+
+ c -= strlen(name) + 1;
+ *c = '/';
+ strncpy(c + 1, name, strlen(name));
+
+ /* move onto parent */
+ hash = hashmap[hash].parent;
+ }
+
+ return hash_name[orighash] = xstrdup(c);
+}
+
+
+void opd_handle_mapping(struct op_note const * note)
+{
+ struct opd_proc * proc;
+ struct opd_image * image;
+ int hash;
+ char const * name;
+
+ proc = opd_get_proc(note->pid, note->tgid);
+
+ if (!proc) {
+ verbprintf(vmisc, "Told about mapping for non-existent process %u.\n", note->pid);
+ proc = opd_new_proc(note->pid, note->tgid);
+ }
+
+ hash = note->hash;
+
+ if (hash == -1) {
+ /* possibly deleted file */
+ return;
+ }
+
+ if (hash < 0 || hash >= OP_HASH_MAP_NR) {
+ fprintf(stderr, "hash value %u out of range.\n", hash);
+ return;
+ }
+
+ name = opd_get_hash_name(hash);
+ image = opd_get_image(name, proc->name, 0, note->pid, note->tgid);
+
+ opd_add_mapping(proc, image, note->addr, note->offset,
+ note->addr + note->len);
+}
diff --git a/daemon/liblegacy/opd_mapping.h b/daemon/liblegacy/opd_mapping.h
new file mode 100644
index 0000000..f10b0c8
--- /dev/null
+++ b/daemon/liblegacy/opd_mapping.h
@@ -0,0 +1,111 @@
+/**
+ * @file opd_mapping.h
+ * Management of process mappings
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#ifndef OPD_MAPPING_H
+#define OPD_MAPPING_H
+
+#include "op_list.h"
+
+struct opd_image;
+struct opd_proc;
+struct op_note;
+
+/**
+ * represent a mmap'ed area, we create such area only for vma area with exec
+ * access right
+ */
+struct opd_map {
+ /** next mapping for this image */
+ struct list_head next;
+ /** owning image */
+ struct opd_image * image;
+ /** mapping start vma */
+ unsigned long start;
+ /** mapping offset */
+ unsigned long offset;
+ /** mapping end vma */
+ unsigned long end;
+};
+
+/**
+ * opd_init_hash_map - initialise the hashmap
+ */
+void opd_init_hash_map(void);
+
+/**
+ * op_cleanup_hash_name
+ *
+ * release resource owned by hash_name array
+ */
+void opd_cleanup_hash_name(void);
+
+/**
+ * opd_handle_mapping - deal with mapping notification
+ * @param note mapping notification
+ *
+ * Deal with one notification that a process has mapped
+ * in a new executable file. The mapping information is
+ * added to the process structure.
+ */
+void opd_handle_mapping(struct op_note const * note);
+
+/**
+ * opd_put_mapping - add a mapping to a process
+ * @param proc process to add map to
+ * @param image mapped image pointer
+ * @param start start of mapping
+ * @param offset file offset of mapping
+ * @param end end of mapping
+ *
+ * Add the mapping specified to the process proc growing the maps array
+ * if necessary.
+ */
+void opd_add_mapping(struct opd_proc * proc, struct opd_image * image,
+ unsigned long start, unsigned long offset, unsigned long end);
+
+/**
+ * opd_kill_maps - delete mapping information for a process
+ * @param proc process to work on
+ *
+ * Frees structures holding mapping information
+ */
+void opd_kill_maps(struct opd_proc * proc);
+
+/**
+ * opd_is_in_map - check whether an EIP is within a mapping
+ * @param map map to check
+ * @param eip EIP value
+ *
+ * Return %1 if the EIP value @eip is within the boundaries
+ * of the map @map, %0 otherwise.
+ */
+inline static int opd_is_in_map(struct opd_map * map, unsigned long eip)
+{
+ return (eip >= map->start && eip < map->end);
+}
+
+
+/*
+ * opd_map_offset - return offset of sample against map
+ * @param map map to use
+ * @param eip EIP value to use
+ *
+ * Returns the offset of the EIP value @eip into
+ * the map @map, which is the same as the file offset
+ * for the relevant binary image.
+ */
+inline static unsigned long opd_map_offset(struct opd_map * map,
+ unsigned long eip)
+{
+ return (eip - map->start) + map->offset;
+}
+
+#endif /* OPD_MAPPING_H */
diff --git a/daemon/liblegacy/opd_parse_proc.c b/daemon/liblegacy/opd_parse_proc.c
new file mode 100644
index 0000000..8a2d4e8
--- /dev/null
+++ b/daemon/liblegacy/opd_parse_proc.c
@@ -0,0 +1,223 @@
+/**
+ * @file opd_parse_proc.c
+ * Parsing of /proc/#pid
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include "op_libiberty.h"
+
+#include "opd_parse_proc.h"
+#include "opd_proc.h"
+#include "opd_mapping.h"
+#include "opd_image.h"
+#include "opd_printf.h"
+
+#include "op_file.h"
+#include "op_fileio.h"
+
+#include <dirent.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+/**
+ * opd_add_ascii_map - parse an ASCII map string for a process
+ * @param proc process to add map to
+ * @param line 0-terminated ASCII string
+ * @param image_name the binary application name
+ *
+ * Attempt to parse the string @line for map information
+ * and add the info to the process @proc. Returns %1
+ * on success, %0 otherwise.
+ *
+ * The parsing is based on Linux 2.4 format, which looks like this :
+ *
+ * 4001e000-400fc000 r-xp 00000000 03:04 31011 /lib/libc-2.1.2.so
+ */
+/* FIXME: handle (deleted) */
+static int opd_add_ascii_map(struct opd_proc * proc, char const * line,
+ char * const image_name)
+{
+ unsigned long offset, start, end;
+ struct opd_image * image;
+ char const * cp = line;
+
+ /* skip to protection field */
+ while (*cp && *cp != ' ')
+ cp++;
+
+ /* handle rwx */
+ if (!*cp || (!*(++cp)) || (!*(++cp)) || (*(++cp) != 'x'))
+ return 0;
+
+ /* get start and end from "40000000-4001f000" */
+ if (sscanf(line, "%lx-%lx", &start, &end) != 2)
+ return 0;
+
+ /* "p " */
+ cp += 2;
+
+ /* read offset */
+ if (sscanf(cp, "%lx", &offset) != 1)
+ return 0;
+
+ while (*cp && *cp != '/')
+ cp++;
+
+ if (!*cp)
+ return 0;
+
+ image = opd_get_image(cp, image_name, 0, proc->tid, proc->tgid);
+ if (!image)
+ return 0;
+
+ opd_add_mapping(proc, image, start, offset, end);
+
+ return 1;
+}
+
+
+/**
+ * opd_get_ascii_maps - read all maps for a process
+ * @param proc process to work on
+ *
+ * Read the /proc/<pid>/maps file and add all
+ * mapping information found to the process @proc.
+ */
+static void opd_get_ascii_maps(struct opd_proc * proc)
+{
+ FILE * fp;
+ char mapsfile[20] = "/proc/";
+ char * line;
+ char exe_name[20];
+ char * image_name;
+ struct list_head * pos;
+
+ snprintf(mapsfile + 6, 6, "%hu", proc->tid);
+
+ strcpy(exe_name, mapsfile);
+
+ strcat(mapsfile, "/maps");
+
+ fp = op_try_open_file(mapsfile, "r");
+ if (!fp)
+ return;
+
+ strcat(exe_name, "/exe");
+ image_name = xmalloc(PATH_MAX);
+ if (!realpath(exe_name, image_name))
+ /* kernel thread are invalid symlink */
+ strcpy(image_name, exe_name);
+
+ verbprintf(vmisc, "image name %s for pid %u %u\n", image_name, proc->tid, proc->tgid);
+
+ while (1) {
+ line = op_get_line(fp);
+ if (!line)
+ break;
+
+ opd_add_ascii_map(proc, line, image_name);
+ free(line);
+ }
+
+ /* dae assume than the first map added is the primary image name, this
+ * is always true at exec time but not for /proc/pid so restore
+ * the primary image name
+ */
+ list_for_each(pos, &proc->maps) {
+ struct opd_map * map = list_entry(pos, struct opd_map, next);
+ if (!strcmp(map->image->name, image_name)) {
+ if (pos != proc->maps.next) {
+ fprintf(stderr, "swap map for image %s from %s to %s\n", image_name, proc->name, map->image->name);
+ free((char *)proc->name);
+ proc->name = xstrdup(map->image->name);
+ }
+ break;
+ }
+ }
+
+ if (list_empty(&proc->maps)) {
+ /* we always need a valid proc->maps[0], we artificially give
+ * a map of length zero so on no samples will never go to this
+ * map. This is used only with --separate-samples and kernel
+ * thread when adding vmlinux and module maps to proc->maps[]
+ */
+ /* FIXME: use the first field of /proc/pid/status as proc name
+ * for now we use /proc/%pid/exe as name */
+ struct opd_image * image = opd_get_image(image_name,
+ image_name, 0, proc->tid, proc->tgid);
+ if (image)
+ opd_add_mapping(proc, image, 0, 0, 0);
+ }
+
+ if (image_name)
+ free(image_name);
+
+ op_close_file(fp);
+}
+
+
+static u32 read_tgid(u32 tid)
+{
+ char status_file[30] = "/proc/";
+ char * line;
+ FILE * fp;
+ u32 tgid;
+
+ snprintf(status_file + 6, 6, "%hu", tid);
+
+ strcat(status_file, "/status");
+
+ fp = op_try_open_file(status_file, "r");
+ if (!fp)
+ return 0;
+
+ while (1) {
+ line = op_get_line(fp);
+ if (!line)
+ break;
+
+ if (sscanf(line, "Tgid: %u", &tgid) == 1) {
+ free(line);
+ op_close_file(fp);
+ return tgid;
+ }
+ free(line);
+ }
+
+ op_close_file(fp);
+
+ return 0;
+}
+
+
+void opd_get_ascii_procs(void)
+{
+ DIR * dir;
+ struct dirent * dirent;
+ struct opd_proc * proc;
+ u32 pid;
+
+ if (!(dir = opendir("/proc"))) {
+ perror("oprofiled: /proc directory could not be opened. ");
+ exit(EXIT_FAILURE);
+ }
+
+ while ((dirent = readdir(dir))) {
+ if (sscanf(dirent->d_name, "%u", &pid) == 1) {
+ u32 tgid = read_tgid(pid);
+ verbprintf(vmisc, "ASCII added %u %u\n", pid, tgid);
+ proc = opd_get_proc(pid, tgid);
+ if (!proc)
+ proc = opd_new_proc(pid, tgid);
+ opd_get_ascii_maps(proc);
+ }
+ }
+
+ closedir(dir);
+}
diff --git a/daemon/liblegacy/opd_parse_proc.h b/daemon/liblegacy/opd_parse_proc.h
new file mode 100644
index 0000000..a224be4
--- /dev/null
+++ b/daemon/liblegacy/opd_parse_proc.h
@@ -0,0 +1,23 @@
+/**
+ * @file opd_parse_proc.h
+ * Parsing of /proc/#pid
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#ifndef OPD_PARSE_PROC_H
+#define OPD_PARSE_PROC_H
+
+/**
+ * opd_get_ascii_procs - read process and mapping information from /proc
+ *
+ * Read information on each process and its mappings from the /proc
+ * filesystem.
+ */
+void opd_get_ascii_procs(void);
+
+#endif /* OPD_PARSE_PROC_H */
diff --git a/daemon/liblegacy/opd_proc.c b/daemon/liblegacy/opd_proc.c
new file mode 100644
index 0000000..2f9b38c
--- /dev/null
+++ b/daemon/liblegacy/opd_proc.c
@@ -0,0 +1,432 @@
+/**
+ * @file opd_proc.c
+ * Management of processes
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include "op_hw_config.h"
+#include "opd_proc.h"
+#include "opd_image.h"
+#include "opd_mapping.h"
+#include "opd_sample_files.h"
+#include "opd_kernel.h"
+#include "opd_24_stats.h"
+#include "opd_printf.h"
+#include "oprofiled.h"
+
+#include "op_interface.h"
+#include "op_libiberty.h"
+
+#include <sys/types.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+/* size of process hash table */
+#define OPD_MAX_PROC_HASH 1024
+
+extern int cpu_number;
+
+/* hash of process lists */
+static struct list_head opd_procs[OPD_MAX_PROC_HASH];
+
+/* statistics purpose */
+static int nr_procs;
+
+
+void opd_init_procs(void)
+{
+ int i;
+ for (i = 0; i < OPD_MAX_PROC_HASH; i++)
+ list_init(&opd_procs[i]);
+}
+
+
+int opd_get_nr_procs(void)
+{
+ return nr_procs;
+}
+
+
+/**
+ * proc_hash - hash pid value
+ * @param tid pid value to hash
+ *
+ */
+inline static uint proc_hash(pid_t tid)
+{
+ /* FIXME: hash tgid too! */
+ return ((tid >> 4) ^ (tid)) % OPD_MAX_PROC_HASH;
+}
+
+
+struct opd_proc * opd_new_proc(pid_t tid, pid_t tgid)
+{
+ struct opd_proc * proc;
+
+ nr_procs++;
+ proc = xmalloc(sizeof(struct opd_proc));
+ list_init(&proc->maps);
+ proc->name = NULL;
+ proc->tid = tid;
+ proc->tgid = tgid;
+ proc->dead = 0;
+ proc->accessed = 0;
+ list_add(&proc->next, &opd_procs[proc_hash(tid)]);
+ return proc;
+}
+
+
+struct opd_proc * opd_get_proc(pid_t tid, pid_t tgid)
+{
+ struct opd_proc * proc;
+ uint hash = proc_hash(tid);
+ struct list_head * pos, *pos2;
+
+ opd_24_stats[OPD_PROC_QUEUE_ACCESS]++;
+ list_for_each_safe(pos, pos2, &opd_procs[hash]) {
+ opd_24_stats[OPD_PROC_QUEUE_DEPTH]++;
+ proc = list_entry(pos, struct opd_proc, next);
+ if (tid == proc->tid && tgid == proc->tgid) {
+ /* LRU to head */
+ list_del(&proc->next);
+ list_add(&proc->next, &opd_procs[hash]);
+ return proc;
+ }
+ }
+
+ return NULL;
+}
+
+
+/**
+ * verb_show_sample - print the sample out to the log
+ * @param offset the offset value
+ * @param map map to print
+ */
+inline static void
+verb_show_sample(unsigned long offset, struct opd_map * map)
+{
+ verbprintf(vsamples, "DO_PUT_SAMPLE : calc offset 0x%.8lx, "
+ "map start 0x%.8lx, end 0x%.8lx, offset 0x%.8lx, name \"%s\"\n",
+ offset, map->start, map->end, map->offset,
+ map->image->name);
+}
+
+
+void opd_put_image_sample(struct opd_image * image, unsigned long offset,
+ u32 counter)
+{
+ struct opd_24_sfile * sfile;
+ int err;
+
+ if (image->ignored)
+ return;
+
+ if (!image->sfiles[cpu_number]) {
+ image->sfiles[cpu_number] =
+ xcalloc(OP_MAX_COUNTERS, sizeof(struct op_24_sfile *));
+ }
+ sfile = image->sfiles[cpu_number][counter];
+
+ if (!sfile || !odb_open_count(&sfile->sample_file)) {
+ if (opd_open_24_sample_file(image, counter, cpu_number)) {
+ /* opd_open_24_sample_file output an error message */
+ opd_24_stats[OPD_LOST_SAMPLEFILE]++;
+ return;
+ }
+ sfile = image->sfiles[cpu_number][counter];
+ }
+
+ err = odb_update_node(&sfile->sample_file, offset);
+ if (err) {
+ fprintf(stderr, "%s\n", strerror(err));
+ abort();
+ }
+
+ opd_24_sfile_lru(sfile);
+}
+
+
+/**
+ * opd_lookup_maps - lookup a proc mappings for a sample
+ * @param proc proc to lookup
+ * @param sample sample to lookup
+ *
+ * iterate through the proc maps searching the mapping which owns sample
+ * if sucessful sample count will be updated and we return non-zero
+ */
+static int opd_lookup_maps(struct opd_proc * proc,
+ struct op_sample const * sample)
+{
+ struct list_head * pos;
+
+ proc->accessed = 1;
+
+ opd_24_stats[OPD_MAP_ARRAY_ACCESS]++;
+ list_for_each(pos, &proc->maps) {
+ struct opd_map * map = list_entry(pos, struct opd_map, next);
+ if (opd_is_in_map(map, sample->eip)) {
+ unsigned long offset = opd_map_offset(map, sample->eip);
+ if (map->image != NULL) {
+ verb_show_sample(offset, map);
+ opd_put_image_sample(map->image, offset, sample->counter);
+ }
+ opd_24_stats[OPD_PROCESS]++;
+ return 1;
+ }
+ opd_24_stats[OPD_MAP_ARRAY_DEPTH]++;
+ }
+
+ return 0;
+}
+
+
+void opd_put_sample(struct op_sample const * sample)
+{
+ struct opd_proc * proc;
+ int in_kernel_eip = opd_eip_is_kernel(sample->eip);
+
+ opd_24_stats[OPD_SAMPLES]++;
+
+ verbprintf(vsamples, "DO_PUT_SAMPLE: c%d, EIP 0x%.8lx, tgid %.6d pid %.6d\n",
+ sample->counter, sample->eip, sample->tgid, sample->pid);
+
+ if (!separate_kernel && in_kernel_eip) {
+ opd_handle_kernel_sample(sample->eip, sample->counter);
+ return;
+ }
+
+ if (!(proc = opd_get_proc(sample->pid, sample->tgid))) {
+ if (in_kernel_eip || no_vmlinux) {
+ /* idle task get a 0 pid and is hidden we can never get
+ * a proc so on we fall back to put sample in vmlinux
+ * or module samples files. Here we will catch also
+ * sample for newly created kernel thread, currently
+ * we can handle properly only kenel thread created
+ * at daemon startup time */
+ opd_handle_kernel_sample(sample->eip, sample->counter);
+ } else {
+ verbprintf(vmisc, "No proc info for tgid %.6d pid %.6d.\n",
+ sample->tgid, sample->pid);
+ opd_24_stats[OPD_LOST_PROCESS]++;
+ }
+ return;
+ }
+
+ if (opd_lookup_maps(proc, sample))
+ return;
+
+ if (in_kernel_eip) {
+ opd_add_kernel_map(proc, sample->eip);
+ if (opd_lookup_maps(proc, sample))
+ return;
+ }
+
+ /* couldn't locate it */
+ verbprintf(vsamples, "Couldn't find map for pid %.6d, EIP 0x%.8lx.\n",
+ sample->pid, sample->eip);
+ opd_24_stats[OPD_LOST_MAP_PROCESS]++;
+}
+
+
+void opd_handle_fork(struct op_note const * note)
+{
+ struct opd_proc * old;
+ struct opd_proc * proc;
+ struct list_head * pos;
+
+ verbprintf(vmisc, "DO_FORK: from %d, %d to %ld, %ld\n", note->pid, note->tgid,
+ note->addr, note->len);
+
+ old = opd_get_proc(note->pid, note->tgid);
+
+ /* we can quite easily get a fork() after the execve() because the
+ * notifications are racy. In particular, the fork notification is
+ * done on parent return (so we know the pid), but this will often be
+ * after the execve is done by the child.
+ *
+ * So we only create a new setup if it doesn't exist already, allowing
+ * both the clone() and the execve() cases to work.
+ */
+ if (opd_get_proc(note->addr, note->len))
+ return;
+
+ /* eip/len is actually tid/tgid of new process */
+ proc = opd_new_proc(note->addr, note->len);
+
+ if (!old)
+ return;
+
+ /* copy the maps */
+ list_for_each(pos, &old->maps) {
+ struct opd_map * map = list_entry(pos, struct opd_map, next);
+ if (!separate_thread) {
+ opd_add_mapping(proc, map->image, map->start,
+ map->offset, map->end);
+ } else {
+ /* when separating thread we can't create blindly a new
+ * image e.g. pid re-use, multiple mapping with the
+ * same mapping name etc. */
+ struct opd_image * image =
+ opd_get_image(map->image->name, old->name,
+ map->image->kernel, note->addr, note->len);
+ opd_add_mapping(proc, image, map->start, map->offset,
+ map->end);
+ }
+ }
+}
+
+
+void opd_handle_exec(pid_t tid, pid_t tgid)
+{
+ struct opd_proc * proc;
+
+ verbprintf(vmisc, "DO_EXEC: pid %u %u\n", tid, tgid);
+
+ /* There is a race for samples received between fork/exec sequence.
+ * These samples belong to the old mapping but we can not say if
+ * samples has been received before the exec or after. This explains
+ * the message "Couldn't find map for ..." in verbose mode.
+ *
+ * Unhappily, it is difficult to get an estimation of these misplaced
+ * samples, the error message can count only out of mapping samples but
+ * not samples between the race and inside the mapping of the exec'ed
+ * process :/.
+ *
+ * Trying to save old mapping is not correct due the above reason. The
+ * only manner to handle this is to flush the module samples hash table
+ * after each fork which is unacceptable for performance reasons */
+ proc = opd_get_proc(tid, tgid);
+ if (proc) {
+ opd_kill_maps(proc);
+ /* proc->name will be set when the next mapping occurs */
+ free((char *)proc->name);
+ proc->name = NULL;
+ } else {
+ opd_new_proc(tid, tgid);
+ }
+}
+
+
+void opd_handle_exit(struct op_note const * note)
+{
+ struct opd_proc * proc;
+
+ verbprintf(vmisc, "DO_EXIT: process %d\n", note->pid);
+
+ proc = opd_get_proc(note->pid, note->tgid);
+ if (proc) {
+ proc->dead = 1;
+ proc->accessed = 1;
+ } else {
+ verbprintf(vmisc, "unknown proc %u just exited.\n", note->pid);
+ }
+}
+
+
+typedef void (*opd_proc_cb)(struct opd_proc *);
+
+/**
+ * @param proc_cb callback to apply onto each existing proc struct
+ *
+ * the callback receive a struct opd_proc * (not a const struct) and is
+ * allowed to freeze the proc struct itself.
+ */
+static void opd_for_each_proc(opd_proc_cb proc_cb)
+{
+ struct list_head * pos;
+ struct list_head * pos2;
+ int i;
+
+ for (i = 0; i < OPD_MAX_PROC_HASH; ++i) {
+ list_for_each_safe(pos, pos2, &opd_procs[i]) {
+ struct opd_proc * proc =
+ list_entry(pos, struct opd_proc, next);
+ proc_cb(proc);
+ }
+ }
+}
+
+
+/**
+ * opd_delete_proc - delete a process
+ * @param proc process to delete
+ *
+ * Remove the process proc from the process list and free
+ * the associated structures.
+ */
+static void opd_delete_proc(struct opd_proc * proc)
+{
+ --nr_procs;
+ list_del(&proc->next);
+ opd_kill_maps(proc);
+ if (proc->name)
+ free((char *)proc->name);
+ free(proc);
+}
+
+
+void opd_proc_cleanup(void)
+{
+ opd_for_each_proc(opd_delete_proc);
+}
+
+
+/**
+ * opd_age_proc - age a struct opd_proc
+ * @param proc proc to age
+ *
+ * age dead proc in such way if a proc doesn't receive any samples
+ * between two age_proc the opd_proc struct is deleted
+ */
+static void opd_age_proc(struct opd_proc * proc)
+{
+ // delay death whilst its still being accessed
+ if (proc->dead) {
+ proc->dead += proc->accessed;
+ proc->accessed = 0;
+ if (--proc->dead == 0)
+ opd_delete_proc(proc);
+ }
+}
+
+
+void opd_age_procs(void)
+{
+ opd_for_each_proc(opd_age_proc);
+}
+
+
+/**
+ * opd_remove_kernel_mapping - remove all kernel mapping for an opd_proc
+ * @param proc proc where mappings must be updated.
+ *
+ * invalidate (by removing them) all kernel mapping. This function do nothing
+ * when separate_kernel == 0 because we don't add mapping for kernel
+ * sample in proc struct.
+ */
+static void opd_remove_kernel_mapping(struct opd_proc * proc)
+{
+ struct list_head * pos, * pos2;
+
+ list_for_each_safe(pos, pos2, &proc->maps) {
+ struct opd_map * map = list_entry(pos, struct opd_map, next);
+ if (opd_eip_is_kernel(map->start + map->offset)) {
+ list_del(pos);
+ opd_delete_image(map->image);
+ free(map);
+ }
+ }
+}
+
+
+void opd_clear_kernel_mapping(void)
+{
+ opd_for_each_proc(opd_remove_kernel_mapping);
+}
diff --git a/daemon/liblegacy/opd_proc.h b/daemon/liblegacy/opd_proc.h
new file mode 100644
index 0000000..8140a46
--- /dev/null
+++ b/daemon/liblegacy/opd_proc.h
@@ -0,0 +1,151 @@
+/**
+ * @file opd_proc.h
+ * Management of processes
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#ifndef OPD_PROC_H
+#define OPD_PROC_H
+
+#include "op_types.h"
+#include "op_list.h"
+
+struct opd_map;
+struct opd_image;
+struct op_note;
+struct op_sample;
+
+/**
+ * track process, created either by a fork or an exec notification.
+ */
+struct opd_proc {
+ /** maps are always added to the end of head, so search will be done
+ * from the newest map to the oldest which mean we don't care about
+ * munmap. First added map must be the primary image */
+ struct list_head maps;
+ /** process name */
+ char const * name;
+ /** thread id for this process, always equal to tgid for 2.2 kernel */
+ pid_t tid;
+ /** thread group id for this process */
+ pid_t tgid;
+ /** non-zero if this process receive any samples, this field
+ * is used with dead field to defer opd_proc deletion */
+ int accessed;
+ /** Set to non-zero when an exit notification occur for this process */
+ int dead;
+ /** used by container of opd_proc */
+ struct list_head next;
+};
+
+/**
+ * initialize opd_proc container
+ */
+void opd_init_procs(void);
+
+/**
+ * opd_put_sample - process a sample
+ * @param sample sample to process
+ *
+ * Write out the sample to the appropriate sample file. This
+ * routine handles kernel and module samples as well as ordinary ones.
+ */
+void opd_put_sample(struct op_sample const * sample);
+
+/**
+ * opd_put_image_sample - write sample to file
+ * @param image image for sample
+ * @param offset (file) offset to write to
+ * @param counter counter number
+ *
+ * Add to the count stored at position offset in the
+ * image file. Overflow pins the count at the maximum
+ * value.
+ */
+void opd_put_image_sample(struct opd_image * image, unsigned long offset, u32 counter);
+
+/**
+ * opd_handle_fork - deal with fork notification
+ * @param note note to handle
+ *
+ * Deal with a fork() notification by creating a new process
+ * structure, and copying mapping information from the old process.
+ *
+ * sample->pid contains the process id of the old process.
+ * sample->eip contains the process id of the new process.
+ */
+void opd_handle_fork(struct op_note const * note);
+
+/**
+ * opd_handle_exec - deal with notification of execve()
+ * @param tid tid for this process
+ * @param tgid tgid for this process
+ *
+ * Drop all mapping information for the process.
+ */
+void opd_handle_exec(pid_t tid, pid_t tgid);
+
+/**
+ * opd_handle_exit - deal with exit notification
+ * @param note note to handle
+ *
+ * Deal with an exit() notification by setting the flag "dead"
+ * on a process. These will be later cleaned up by the %SIGALRM
+ * handler.
+ *
+ * sample->pid contains the process id of the exited process.
+ */
+void opd_handle_exit(struct op_note const * note);
+
+/**
+ * opd_get_proc - get process from process list
+ * @param tid tid for this process
+ * @param tgid tgid for this process
+ *
+ * A process with pid tid is searched on the process list,
+ * maintaining LRU order. If it is not found, %NULL is returned,
+ * otherwise the process structure is returned.
+ */
+struct opd_proc * opd_get_proc(pid_t tid, pid_t tgid);
+
+/**
+ * opd_new_proc - create a new process structure
+ * @param tid tid for this process
+ * @param tgid tgid for this process
+ *
+ * Allocate and initialise a process structure and insert
+ * it into the procs hash table.
+ */
+struct opd_proc * opd_new_proc(pid_t tid, pid_t tgid);
+
+/**
+ * opd_get_nr_procs - return number of processes tracked
+ */
+int opd_get_nr_procs(void);
+
+/**
+ * opd_age_procs - age all dead process preparing them for a deletion
+ */
+void opd_age_procs(void);
+
+/**
+ * freeze all resource used by opd_procs managment
+ */
+void opd_proc_cleanup(void);
+
+/**
+ * opd_clear_kernel_mapping - remove all kernel mapping for all opd_proc
+ *
+ * invalidate (by removing them) all kernel mapping. This function do nothing
+ * when separate_kernel == 0 because we don't add mapping for kernel
+ * sample in proc struct. As side effect decrease reference count of
+ * associated with these mapping which eventually close this image
+ */
+void opd_clear_kernel_mapping(void);
+
+#endif /* OPD_PROC_H */
diff --git a/daemon/liblegacy/opd_sample_files.c b/daemon/liblegacy/opd_sample_files.c
new file mode 100644
index 0000000..126ba99
--- /dev/null
+++ b/daemon/liblegacy/opd_sample_files.c
@@ -0,0 +1,179 @@
+/**
+ * @file opd_sample_files.c
+ * Management of sample files
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include <sys/types.h>
+
+#include "opd_sample_files.h"
+#include "opd_image.h"
+#include "opd_printf.h"
+#include "opd_events.h"
+#include "oprofiled.h"
+
+#include "op_sample_file.h"
+#include "op_file.h"
+#include "op_config.h"
+#include "op_mangle.h"
+#include "op_events.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+
+/** All sfiles are on this list. */
+static LIST_HEAD(lru_list);
+
+/* this value probably doesn't matter too much */
+#define LRU_AMOUNT 1000
+static int opd_24_sfile_lru_clear(void)
+{
+ struct list_head * pos;
+ struct list_head * pos2;
+ struct opd_24_sfile * sfile;
+ int amount = LRU_AMOUNT;
+
+ verbprintf(vsfile, "image lru clear\n");
+
+ if (list_empty(&lru_list))
+ return 1;
+
+ list_for_each_safe(pos, pos2, &lru_list) {
+ if (!--amount)
+ break;
+ sfile = list_entry(pos, struct opd_24_sfile, lru_next);
+ odb_close(&sfile->sample_file);
+ list_del_init(&sfile->lru_next);
+ }
+
+ return 0;
+}
+
+
+void opd_24_sfile_lru(struct opd_24_sfile * sfile)
+{
+ list_del(&sfile->lru_next);
+ list_add_tail(&sfile->lru_next, &lru_list);
+}
+
+
+static char * opd_mangle_filename(struct opd_image const * image, int counter,
+ int cpu_nr)
+{
+ char * mangled;
+ struct mangle_values values;
+ struct opd_event * event = find_counter_event(counter);
+
+ values.flags = 0;
+ if (image->kernel)
+ values.flags |= MANGLE_KERNEL;
+
+ if (separate_thread) {
+ values.flags |= MANGLE_TGID | MANGLE_TID;
+ values.tid = image->tid;
+ values.tgid = image->tgid;
+ }
+
+ if (separate_cpu) {
+ values.flags |= MANGLE_CPU;
+ values.cpu = cpu_nr;
+ }
+
+ values.event_name = event->name;
+ values.count = event->count;
+ values.unit_mask = event->um;
+
+ values.image_name = image->name;
+ values.dep_name = separate_lib && image->app_name
+ ? image->app_name : image->name;
+
+ mangled = op_mangle_filename(&values);
+
+ return mangled;
+}
+
+
+int opd_open_24_sample_file(struct opd_image * image, int counter, int cpu_nr)
+{
+ char * mangled;
+ struct opd_24_sfile * sfile;
+ int err;
+
+ mangled = opd_mangle_filename(image, counter, cpu_nr);
+
+ verbprintf(vsfile, "Opening \"%s\"\n", mangled);
+
+ create_path(mangled);
+
+ sfile = image->sfiles[cpu_nr][counter];
+ if (!sfile) {
+ sfile = malloc(sizeof(struct opd_24_sfile));
+ list_init(&sfile->lru_next);
+ odb_init(&sfile->sample_file);
+ image->sfiles[cpu_nr][counter] = sfile;
+ }
+
+ list_del(&sfile->lru_next);
+ list_add_tail(&sfile->lru_next, &lru_list);
+
+retry:
+ err = odb_open(&sfile->sample_file, mangled, ODB_RDWR,
+ sizeof(struct opd_header));
+
+ /* This can naturally happen when racing against opcontrol --reset. */
+ if (err) {
+ if (err == EMFILE) {
+ if (opd_24_sfile_lru_clear()) {
+ printf("LRU cleared but odb_open() fails for %s.\n", mangled);
+ abort();
+ }
+ goto retry;
+ }
+
+ fprintf(stderr, "oprofiled: open of %s failed: %s\n",
+ mangled, strerror(err));
+ goto out;
+ }
+
+ fill_header(odb_get_data(&sfile->sample_file), counter, 0, 0,
+ image->kernel, 0, 0, 0, image->mtime);
+
+out:
+ free(mangled);
+ return err;
+}
+
+
+void opd_sync_samples_files(void)
+{
+ struct list_head * pos;
+ struct opd_24_sfile * sfile;
+
+ list_for_each(pos, &lru_list) {
+ sfile = list_entry(pos, struct opd_24_sfile, lru_next);
+ odb_sync(&sfile->sample_file);
+ }
+}
+
+
+void opd_close_image_samples_files(struct opd_image * image)
+{
+ uint i, j;
+ for (i = 0 ; i < op_nr_counters ; ++i) {
+ for (j = 0; j < NR_CPUS; ++j) {
+ if (image->sfiles[j] && image->sfiles[j][i]) {
+ odb_close(&image->sfiles[j][i]->sample_file);
+ list_del(&image->sfiles[j][i]->lru_next);
+ free(image->sfiles[j][i]);
+ image->sfiles[j][i] = 0;
+ }
+ }
+ }
+}
diff --git a/daemon/liblegacy/opd_sample_files.h b/daemon/liblegacy/opd_sample_files.h
new file mode 100644
index 0000000..20555a9
--- /dev/null
+++ b/daemon/liblegacy/opd_sample_files.h
@@ -0,0 +1,63 @@
+/**
+ * @file opd_sample_files.h
+ * Management of sample files
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#ifndef OPD_SAMPLE_FILES_H
+#define OPD_SAMPLE_FILES_H
+
+#include "op_list.h"
+#include "odb.h"
+
+struct opd_image;
+
+/** one samples file when profiling on a 2.2/2.4 kernel */
+struct opd_24_sfile {
+ /** lru list of sample file */
+ struct list_head lru_next;
+ /** the sample file itself */
+ odb_t sample_file;
+};
+
+/**
+ * sync all samples files
+ */
+void opd_sync_samples_files(void);
+
+/**
+ * @param image the image pointer to work on
+ *
+ * close all samples files belonging to this image
+ */
+void opd_close_image_samples_files(struct opd_image * image);
+
+/**
+ * opd_open_24_sample_file - open an image sample file
+ * @param image image to open file for
+ * @param counter counter number
+ * @param cpu_nr cpu number
+ *
+ * Open image sample file for the image, counter
+ * counter and set up memory mappings for it.
+ * image->kernel and image->name must have meaningful
+ * values.
+ *
+ * Returns 0 on success.
+ */
+int opd_open_24_sample_file(struct opd_image * image, int counter, int cpu_nr);
+
+/**
+ * @param sfile sample file to act on
+ *
+ * put sfile at the head of samples files lru list
+ */
+void opd_24_sfile_lru(struct opd_24_sfile * sfile);
+
+
+#endif /* OPD_SAMPLE_FILES_H */
diff --git a/daemon/liblegacy/p_module.h b/daemon/liblegacy/p_module.h
new file mode 100644
index 0000000..9367508
--- /dev/null
+++ b/daemon/liblegacy/p_module.h
@@ -0,0 +1,207 @@
+/* Definitions for the Linux module syscall interface.
+ Copyright 1996, 1997 Linux International.
+
+ Contributed by Richard Henderson <rth@tamu.edu>
+
+ This file is part of the Linux modutils.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 2 of the License, or (at your
+ option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifndef MODUTILS_MODULE_H
+#define MODUTILS_MODULE_H 1
+
+/* This file contains the structures used by the 2.0 and 2.1 kernels.
+ We do not use the kernel headers directly because we do not wish
+ to be dependant on a particular kernel version to compile insmod. */
+
+
+/*======================================================================*/
+/* The structures used by Linux 2.0. */
+
+/* The symbol format used by get_kernel_syms(2). */
+struct old_kernel_sym
+{
+ unsigned long value;
+ char name[60];
+};
+
+struct old_module_ref
+{
+ unsigned long module; /* kernel addresses */
+ unsigned long next;
+};
+
+struct old_module_symbol
+{
+ unsigned long addr;
+ unsigned long name;
+};
+
+struct old_symbol_table
+{
+ int size; /* total, including string table!!! */
+ int n_symbols;
+ int n_refs;
+ struct old_module_symbol symbol[0]; /* actual size defined by n_symbols */
+ struct old_module_ref ref[0]; /* actual size defined by n_refs */
+};
+
+struct old_mod_routines
+{
+ unsigned long init;
+ unsigned long cleanup;
+};
+
+struct old_module
+{
+ unsigned long next;
+ unsigned long ref; /* the list of modules that refer to me */
+ unsigned long symtab;
+ unsigned long name;
+ int size; /* size of module in pages */
+ unsigned long addr; /* address of module */
+ int state;
+ unsigned long cleanup; /* cleanup routine */
+};
+
+/* Sent to init_module(2) or'ed into the code size parameter. */
+#define OLD_MOD_AUTOCLEAN 0x40000000 /* big enough, but no sign problems... */
+
+int get_kernel_syms(struct old_kernel_sym *);
+int old_sys_init_module(char const * name, char *code, unsigned codesize,
+ struct old_mod_routines *, struct old_symbol_table *);
+
+/*======================================================================*/
+/* For sizeof() which are related to the module platform and not to the
+ environment isnmod is running in, use sizeof_xx instead of sizeof(xx). */
+
+#define tgt_sizeof_char sizeof(char)
+#define tgt_sizeof_short sizeof(short)
+#define tgt_sizeof_int sizeof(int)
+#define tgt_sizeof_long sizeof(long)
+#define tgt_sizeof_char_p sizeof(char *)
+#define tgt_sizeof_void_p sizeof(void *)
+#define tgt_long long
+#define tgt_long_fmt "l"
+
+/* This assumes that long long on a 32 bit system is equivalent to long on the
+ * equivalent 64 bit system. Also that void and char pointers are 8 bytes on
+ * all 64 bit systems. Add per system tweaks if it ever becomes necessary.
+ */
+#if defined(COMMON_3264) && defined(ONLY_64)
+#undef tgt_long
+#undef tgt_long_fmt
+#undef tgt_sizeof_long
+#undef tgt_sizeof_char_p
+#undef tgt_sizeof_void_p
+#define tgt_long long long
+#define tgt_long_fmt "ll"
+#define tgt_sizeof_long 8
+#define tgt_sizeof_char_p 8
+#define tgt_sizeof_void_p 8
+#endif
+
+/*======================================================================*/
+/* The structures used in Linux 2.1 onwards. */
+
+/* Note: module_symbol does not use tgt_long intentionally */
+struct module_symbol
+{
+ unsigned long value;
+ unsigned long name;
+};
+
+struct module_ref
+{
+ unsigned tgt_long dep; /* kernel addresses */
+ unsigned tgt_long ref;
+ unsigned tgt_long next_ref;
+};
+
+struct module
+{
+ unsigned tgt_long size_of_struct; /* == sizeof(module) */
+ unsigned tgt_long next;
+ unsigned tgt_long name;
+ unsigned tgt_long size;
+
+ tgt_long usecount;
+ unsigned tgt_long flags; /* AUTOCLEAN et al */
+
+ unsigned nsyms;
+ unsigned ndeps;
+
+ unsigned tgt_long syms;
+ unsigned tgt_long deps;
+ unsigned tgt_long refs;
+ unsigned tgt_long init;
+ unsigned tgt_long cleanup;
+ unsigned tgt_long ex_table_start;
+ unsigned tgt_long ex_table_end;
+#ifdef __alpha__
+ unsigned tgt_long gp;
+#endif
+ /* Everything after here is extension. */
+ unsigned tgt_long read_start; /* Read data from existing module */
+ unsigned tgt_long read_end;
+ unsigned tgt_long can_unload;
+ unsigned tgt_long runsize;
+ unsigned tgt_long kallsyms_start;
+ unsigned tgt_long kallsyms_end;
+ unsigned tgt_long archdata_start;
+ unsigned tgt_long archdata_end;
+ unsigned tgt_long kernel_data;
+};
+
+struct module_info
+{
+ unsigned long addr;
+ unsigned long size;
+ unsigned long flags;
+ long usecount;
+};
+
+/* Bits of module.flags. */
+#define NEW_MOD_RUNNING 1
+#define NEW_MOD_DELETED 2
+#define NEW_MOD_AUTOCLEAN 4
+#define NEW_MOD_VISITED 8
+#define NEW_MOD_USED_ONCE 16
+#define NEW_MOD_INITIALIZING 64
+
+int sys_init_module(char const * name, const struct module *);
+int query_module(char const * name, int which, void *buf, size_t bufsize,
+ size_t *ret);
+
+/* Values for query_module's which. */
+
+#define QM_MODULES 1
+#define QM_DEPS 2
+#define QM_REFS 3
+#define QM_SYMBOLS 4
+#define QM_INFO 5
+
+/*======================================================================*/
+/* The system calls unchanged between 2.0 and 2.1. */
+
+unsigned long create_module(const char *, size_t);
+int delete_module(const char *);
+
+/* In safe mode the last parameter is forced to be a module name and meta
+ * expansion is not allowed on that name.
+ */
+extern unsigned int safemode;
+
+#endif /* module.h */
diff --git a/depcomp b/depcomp
new file mode 100755
index 0000000..04701da
--- /dev/null
+++ b/depcomp
@@ -0,0 +1,530 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2005-07-09.11
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+ '')
+ echo "$0: No command. Try \`$0 --help' for more information." 1>&2
+ exit 1;
+ ;;
+ -h | --h*)
+ cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+ depmode Dependency tracking mode.
+ source Source file read by `PROGRAMS ARGS'.
+ object Object file output by `PROGRAMS ARGS'.
+ DEPDIR directory where to store dependencies.
+ depfile Dependency file to output.
+ tmpdepfile Temporary file to use when outputing dependencies.
+ libtool Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+ exit $?
+ ;;
+ -v | --v*)
+ echo "depcomp $scriptversion"
+ exit $?
+ ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+ echo "depcomp: Variables source, object and depmode must be set" 1>&2
+ exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+ sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags. We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write. Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+ # HP compiler uses -M and no extra arg.
+ gccflag=-M
+ depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+ # This is just like dashmstdout with a different argument.
+ dashmflag=-xM
+ depmode=dashmstdout
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want. Yay! Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff. Hmm.
+ "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ mv "$tmpdepfile" "$depfile"
+ ;;
+
+gcc)
+## There are various ways to get dependency output from gcc. Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+## up in a subdir. Having to rename by hand is ugly.
+## (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+## -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+## than renaming).
+ if test -z "$gccflag"; then
+ gccflag=-MD,
+ fi
+ "$@" -Wp,"$gccflag$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+## The second -e expression handles DOS-style file names with drive letters.
+ sed -e 's/^[^:]*: / /' \
+ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header). We avoid this by adding
+## dummy dependencies for each header file. Too bad gcc doesn't do
+## this for us directly.
+ tr ' ' '
+' < "$tmpdepfile" |
+## Some versions of gcc put a space before the `:'. On the theory
+## that the space means something, we add a space to the output as
+## well.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+hp)
+ # This case exists only to let depend.m4 do its work. It works by
+ # looking at the text of this script. This case will never be run,
+ # since it is checked for above.
+ exit 1
+ ;;
+
+sgi)
+ if test "$libtool" = yes; then
+ "$@" "-Wp,-MDupdate,$tmpdepfile"
+ else
+ "$@" -MDupdate "$tmpdepfile"
+ fi
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+
+ if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
+ echo "$object : \\" > "$depfile"
+
+ # Clip off the initial element (the dependent). Don't try to be
+ # clever and replace this with sed code, as IRIX sed won't handle
+ # lines with more than a fixed number of characters (4096 in
+ # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
+ # the IRIX cc adds comments like `#:fec' to the end of the
+ # dependency line.
+ tr ' ' '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
+ tr '
+' ' ' >> $depfile
+ echo >> $depfile
+
+ # The second pass generates a dummy entry for each header file.
+ tr ' ' '
+' < "$tmpdepfile" \
+ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+ >> $depfile
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+aix)
+ # The C for AIX Compiler uses -M and outputs the dependencies
+ # in a .u file. In older versions, this file always lives in the
+ # current directory. Also, the AIX compiler puts `$object:' at the
+ # start of each line; $object doesn't have directory information.
+ # Version 6 uses the directory in both cases.
+ stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
+ tmpdepfile="$stripped.u"
+ if test "$libtool" = yes; then
+ "$@" -Wc,-M
+ else
+ "$@" -M
+ fi
+ stat=$?
+
+ if test -f "$tmpdepfile"; then :
+ else
+ stripped=`echo "$stripped" | sed 's,^.*/,,'`
+ tmpdepfile="$stripped.u"
+ fi
+
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+
+ if test -f "$tmpdepfile"; then
+ outname="$stripped.o"
+ # Each line is of the form `foo.o: dependent.h'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
+ sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
+ else
+ # The sourcefile does not contain any dependencies, so just
+ # store a dummy comment line, to avoid errors with the Makefile
+ # "include basename.Plo" scheme.
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+icc)
+ # Intel's C compiler understands `-MD -MF file'. However on
+ # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+ # ICC 7.0 will fill foo.d with something like
+ # foo.o: sub/foo.c
+ # foo.o: sub/foo.h
+ # which is wrong. We want:
+ # sub/foo.o: sub/foo.c
+ # sub/foo.o: sub/foo.h
+ # sub/foo.c:
+ # sub/foo.h:
+ # ICC 7.1 will output
+ # foo.o: sub/foo.c sub/foo.h
+ # and will wrap long lines using \ :
+ # foo.o: sub/foo.c ... \
+ # sub/foo.h ... \
+ # ...
+
+ "$@" -MD -MF "$tmpdepfile"
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ # Each line is of the form `foo.o: dependent.h',
+ # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process this invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
+ sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+tru64)
+ # The Tru64 compiler uses -MD to generate dependencies as a side
+ # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+ # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+ # dependencies in `foo.d' instead, so we check for that too.
+ # Subdirectories are respected.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+
+ if test "$libtool" = yes; then
+ # With Tru64 cc, shared objects can also be used to make a
+ # static library. This mecanism is used in libtool 1.4 series to
+ # handle both shared and static libraries in a single compilation.
+ # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+ #
+ # With libtool 1.5 this exception was removed, and libtool now
+ # generates 2 separate objects for the 2 libraries. These two
+ # compilations output dependencies in in $dir.libs/$base.o.d and
+ # in $dir$base.o.d. We have to check for both files, because
+ # one of the two compilations can be disabled. We should prefer
+ # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+ # automatically cleaned when .libs/ is deleted, while ignoring
+ # the former would cause a distcleancheck panic.
+ tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
+ tmpdepfile2=$dir$base.o.d # libtool 1.5
+ tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
+ tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
+ "$@" -Wc,-MD
+ else
+ tmpdepfile1=$dir$base.o.d
+ tmpdepfile2=$dir$base.d
+ tmpdepfile3=$dir$base.d
+ tmpdepfile4=$dir$base.d
+ "$@" -MD
+ fi
+
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+ # That's a tab and a space in the [].
+ sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+ else
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile"
+ ;;
+
+#nosideeffect)
+ # This comment above is used by automake to tell side-effect
+ # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout, regardless of -o.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove `-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ test -z "$dashmflag" && dashmflag=-M
+ # Require at least two characters before searching for `:'
+ # in the target name. This is to cope with DOS-style filenames:
+ # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+ "$@" $dashmflag |
+ sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+dashXmstdout)
+ # This case only exists to satisfy depend.m4. It is never actually
+ # run, as this mode is specially recognized in the preamble.
+ exit 1
+ ;;
+
+makedepend)
+ "$@" || exit $?
+ # Remove any Libtool call
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+ # X makedepend
+ shift
+ cleared=no
+ for arg in "$@"; do
+ case $cleared in
+ no)
+ set ""; shift
+ cleared=yes ;;
+ esac
+ case "$arg" in
+ -D*|-I*)
+ set fnord "$@" "$arg"; shift ;;
+ # Strip any option that makedepend may not understand. Remove
+ # the object too, otherwise makedepend will parse it as a source file.
+ -*|$object)
+ ;;
+ *)
+ set fnord "$@" "$arg"; shift ;;
+ esac
+ done
+ obj_suffix="`echo $object | sed 's/^.*\././'`"
+ touch "$tmpdepfile"
+ ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+ rm -f "$depfile"
+ cat < "$tmpdepfile" > "$depfile"
+ sed '1,2d' "$tmpdepfile" | tr ' ' '
+' | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly. Breaking it into two sed invocations is a workaround.
+ sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile" "$tmpdepfile".bak
+ ;;
+
+cpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout.
+ "$@" || exit $?
+
+ # Remove the call to Libtool.
+ if test "$libtool" = yes; then
+ while test $1 != '--mode=compile'; do
+ shift
+ done
+ shift
+ fi
+
+ # Remove `-o $object'.
+ IFS=" "
+ for arg
+ do
+ case $arg in
+ -o)
+ shift
+ ;;
+ $object)
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift # fnord
+ shift # $arg
+ ;;
+ esac
+ done
+
+ "$@" -E |
+ sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+ sed '$ s: \\$::' > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ cat < "$tmpdepfile" >> "$depfile"
+ sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+msvisualcpp)
+ # Important note: in order to support this mode, a compiler *must*
+ # always write the preprocessed file to stdout, regardless of -o,
+ # because we must use -o when running libtool.
+ "$@" || exit $?
+ IFS=" "
+ for arg
+ do
+ case "$arg" in
+ "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+ set fnord "$@"
+ shift
+ shift
+ ;;
+ *)
+ set fnord "$@" "$arg"
+ shift
+ shift
+ ;;
+ esac
+ done
+ "$@" -E |
+ sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
+ rm -f "$depfile"
+ echo "$object : \\" > "$depfile"
+ . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
+ echo " " >> "$depfile"
+ . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
+none)
+ exec "$@"
+ ;;
+
+*)
+ echo "Unknown depmode $depmode" 1>&2
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/doc/Makefile.am b/doc/Makefile.am
new file mode 100644
index 0000000..f84d4a8
--- /dev/null
+++ b/doc/Makefile.am
@@ -0,0 +1,92 @@
+RM=rm
+MANDIR=$(DESTDIR)@mandir@/man1
+
+XSLTPROC=xsltproc
+XSLTPROC_FLAGS=@XSLTPROC_FLAGS@
+XHTML_STYLESHEET=$(srcdir)/xsl/xhtml.xsl
+CHUNK_XHTML_STYLESHEET=$(srcdir)/xsl/xhtml-chunk.xsl
+XML_CATALOG_FILES=xsl/catalog.xml
+STYLESHEETS=$(CHUNK_XHTML_STYLESHEET) $(srcdir)/xsl/xhtml-common.xsl
+
+man_MANS = \
+ oprofile.1 \
+ opcontrol.1 \
+ opreport.1 \
+ opannotate.1 \
+ opgprof.1 \
+ ophelp.1 \
+ oparchive.1 \
+ opimport.1
+
+htmldir = $(prefix)/share/doc/oprofile
+dist_html_DATA = oprofile.html internals.html opreport.xsd op-jit-devel.html
+
+if have_xsltproc
+
+oprofile.html: ${top_srcdir}/doc/oprofile.xml
+ XML_CATALOG_FILES=$(XML_CATALOG_FILES) $(XSLTPROC) $(XSLTPROC_FLAGS) -o $@ --stringparam version @VERSION@ $(XHTML_STYLESHEET) $<
+
+op-jit-devel.html: ${top_srcdir}/doc/op-jit-devel.xml
+ XML_CATALOG_FILES=$(XML_CATALOG_FILES) $(XSLTPROC) $(XSLTPROC_FLAGS) -o $@ --stringparam version @VERSION@ $(XHTML_STYLESHEET) $<
+
+internals.html: ${top_srcdir}/doc/internals.xml
+ XML_CATALOG_FILES=$(XML_CATALOG_FILES) $(XSLTPROC) $(XSLTPROC_FLAGS) -o $@ --stringparam version @VERSION@ $(XHTML_STYLESHEET) $<
+
+# rules to generate oprofile.sf.net/doc files
+
+doc/index.html: ${top_srcdir}/doc/oprofile.xml
+ -mkdir doc/
+ $(XSLTPROC) -o doc/ $(XSLTPROC_FLAGS) --stringparam version @VERSION@ $(CHUNK_XHTML_STYLESHEET) $<
+
+doc/devel/index.html: ${top_srcdir}/doc/op-jit-devel.xml
+ -mkdir doc/devel/
+ $(XSLTPROC) -o doc/devel/ $(XSLTPROC_FLAGS) --stringparam version @VERSION@ $(CHUNK_XHTML_STYLESHEET) $<
+
+doc/internals/index.html: ${top_srcdir}/doc/internals.xml
+ -mkdir doc/internals/
+ $(XSLTPROC) -o doc/internals/ $(XSLTPROC_FLAGS) --stringparam version @VERSION@ $(CHUNK_XHTML_STYLESHEET) $<
+
+chunk: doc/index.html doc/internals/index.html doc/devel/index.html
+ cp ${top_srcdir}/doc/buffers.png doc/internals/
+
+else
+
+oprofile.html:
+ touch $@
+
+internals.html:
+ touch $@
+
+op-jit-devel.html:
+ touch $@
+
+chunk:
+
+endif
+
+distclean-local:
+ $(RM) -f xsl/catalog-1.xml xsl/catalog.xml
+
+clean-local:
+ $(RM) -f $(generated_mans)
+
+# these files are not cleaned by make uninstall automake bug ?
+uninstall-local:
+ rm -f @mandir@/cat1/oprofile.1.gz
+ @for f in $(LINK_LIST); do \
+ rm -f $(CATDIR)/cat1/$$f.gz; \
+ done
+
+EXTRA_DIST = \
+ oprofile.1 \
+ oprofile.1.in \
+ oprofile.xml \
+ op-jit-devel.xml \
+ internals.xml \
+ buffers.png \
+ xsl/catalog-1.xml.in \
+ xsl/xhtml.xsl \
+ xsl/xhtml-common.xsl \
+ xsl/xhtml-chunk.xsl \
+ srcdoc/Doxyfile.in \
+ srcdoc/Makefile
diff --git a/doc/Makefile.in b/doc/Makefile.in
new file mode 100644
index 0000000..be49353
--- /dev/null
+++ b/doc/Makefile.in
@@ -0,0 +1,555 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = doc
+DIST_COMMON = $(dist_html_DATA) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in $(srcdir)/opannotate.1.in \
+ $(srcdir)/oparchive.1.in $(srcdir)/opcontrol.1.in \
+ $(srcdir)/opgprof.1.in $(srcdir)/ophelp.1.in \
+ $(srcdir)/opimport.1.in $(srcdir)/opreport.1.in \
+ $(srcdir)/oprofile.1.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/binutils.m4 \
+ $(top_srcdir)/m4/builtinexpect.m4 \
+ $(top_srcdir)/m4/cellspubfdsupport.m4 \
+ $(top_srcdir)/m4/compileroption.m4 \
+ $(top_srcdir)/m4/configmodule.m4 \
+ $(top_srcdir)/m4/copyifchange.m4 $(top_srcdir)/m4/docbook.m4 \
+ $(top_srcdir)/m4/extradirs.m4 $(top_srcdir)/m4/findkernel.m4 \
+ $(top_srcdir)/m4/kerneloption.m4 \
+ $(top_srcdir)/m4/kernelversion.m4 \
+ $(top_srcdir)/m4/mallocattribute.m4 \
+ $(top_srcdir)/m4/poptconst.m4 \
+ $(top_srcdir)/m4/precompiledheader.m4 $(top_srcdir)/m4/qt.m4 \
+ $(top_srcdir)/m4/resultyn.m4 $(top_srcdir)/m4/sstream.m4 \
+ $(top_srcdir)/m4/typedef.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES = oprofile.1 opcontrol.1 ophelp.1 opreport.1 \
+ opannotate.1 opgprof.1 oparchive.1 opimport.1
+SOURCES =
+DIST_SOURCES =
+man1dir = $(mandir)/man1
+am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(htmldir)"
+NROFF = nroff
+MANS = $(man_MANS)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+dist_htmlDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(dist_html_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFD_LIBS = @BFD_LIBS@
+BUILD_JVMPI_AGENT_FALSE = @BUILD_JVMPI_AGENT_FALSE@
+BUILD_JVMPI_AGENT_TRUE = @BUILD_JVMPI_AGENT_TRUE@
+BUILD_JVMTI_AGENT_FALSE = @BUILD_JVMTI_AGENT_FALSE@
+BUILD_JVMTI_AGENT_TRUE = @BUILD_JVMTI_AGENT_TRUE@
+CAT_ENTRY_END = @CAT_ENTRY_END@
+CAT_ENTRY_START = @CAT_ENTRY_START@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOCBOOK_ROOT = @DOCBOOK_ROOT@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+EXTRA_CFLAGS_MODULE = @EXTRA_CFLAGS_MODULE@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAVA_HOMEDIR = @JAVA_HOMEDIR@
+KINC = @KINC@
+KSRC = @KSRC@
+KVERS = @KVERS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBERTY_LIBS = @LIBERTY_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MOC = @MOC@
+MODINSTALLDIR = @MODINSTALLDIR@
+OBJEXT = @OBJEXT@
+OPROFILE_DIR = @OPROFILE_DIR@
+OPROFILE_MODULE_ARCH = @OPROFILE_MODULE_ARCH@
+OP_CFLAGS = @OP_CFLAGS@
+OP_CXXFLAGS = @OP_CXXFLAGS@
+OP_DOCDIR = @OP_DOCDIR@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POPT_LIBS = @POPT_LIBS@
+PTRDIFF_T_TYPE = @PTRDIFF_T_TYPE@
+QT_INCLUDES = @QT_INCLUDES@
+QT_LDFLAGS = @QT_LDFLAGS@
+QT_LIB = @QT_LIB@
+QT_VERSION = @QT_VERSION@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIZE_T_TYPE = @SIZE_T_TYPE@
+STRIP = @STRIP@
+UIC = @UIC@
+VERSION = @VERSION@
+XML_CATALOG = @XML_CATALOG@
+XSLTPROC = xsltproc
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+have_qt_FALSE = @have_qt_FALSE@
+have_qt_TRUE = @have_qt_TRUE@
+have_xsltproc_FALSE = @have_xsltproc_FALSE@
+have_xsltproc_TRUE = @have_xsltproc_TRUE@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+kernel_support_FALSE = @kernel_support_FALSE@
+kernel_support_TRUE = @kernel_support_TRUE@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+topdir = @topdir@
+RM = rm
+MANDIR = $(DESTDIR)@mandir@/man1
+XHTML_STYLESHEET = $(srcdir)/xsl/xhtml.xsl
+CHUNK_XHTML_STYLESHEET = $(srcdir)/xsl/xhtml-chunk.xsl
+XML_CATALOG_FILES = xsl/catalog.xml
+STYLESHEETS = $(CHUNK_XHTML_STYLESHEET) $(srcdir)/xsl/xhtml-common.xsl
+man_MANS = \
+ oprofile.1 \
+ opcontrol.1 \
+ opreport.1 \
+ opannotate.1 \
+ opgprof.1 \
+ ophelp.1 \
+ oparchive.1 \
+ opimport.1
+
+htmldir = $(prefix)/share/doc/oprofile
+dist_html_DATA = oprofile.html internals.html opreport.xsd op-jit-devel.html
+EXTRA_DIST = \
+ oprofile.1 \
+ oprofile.1.in \
+ oprofile.xml \
+ op-jit-devel.xml \
+ internals.xml \
+ buffers.png \
+ xsl/catalog-1.xml.in \
+ xsl/xhtml.xsl \
+ xsl/xhtml-common.xsl \
+ xsl/xhtml-chunk.xsl \
+ srcdoc/Doxyfile.in \
+ srcdoc/Makefile
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign doc/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+oprofile.1: $(top_builddir)/config.status $(srcdir)/oprofile.1.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+opcontrol.1: $(top_builddir)/config.status $(srcdir)/opcontrol.1.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+ophelp.1: $(top_builddir)/config.status $(srcdir)/ophelp.1.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+opreport.1: $(top_builddir)/config.status $(srcdir)/opreport.1.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+opannotate.1: $(top_builddir)/config.status $(srcdir)/opannotate.1.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+opgprof.1: $(top_builddir)/config.status $(srcdir)/opgprof.1.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+oparchive.1: $(top_builddir)/config.status $(srcdir)/oparchive.1.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+opimport.1: $(top_builddir)/config.status $(srcdir)/opimport.1.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+install-man1: $(man1_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
+ test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)"
+ @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
+ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+ for i in $$l2; do \
+ case "$$i" in \
+ *.1*) list="$$list $$i" ;; \
+ esac; \
+ done; \
+ for i in $$list; do \
+ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
+ else file=$$i; fi; \
+ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ case "$$ext" in \
+ 1*) ;; \
+ *) ext='1' ;; \
+ esac; \
+ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed -e 's/^.*\///'`; \
+ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \
+ done
+uninstall-man1:
+ @$(NORMAL_UNINSTALL)
+ @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
+ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+ for i in $$l2; do \
+ case "$$i" in \
+ *.1*) list="$$list $$i" ;; \
+ esac; \
+ done; \
+ for i in $$list; do \
+ ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ case "$$ext" in \
+ 1*) ;; \
+ *) ext='1' ;; \
+ esac; \
+ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed -e 's/^.*\///'`; \
+ inst=`echo $$inst | sed '$(transform)'`.$$ext; \
+ echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \
+ rm -f "$(DESTDIR)$(man1dir)/$$inst"; \
+ done
+install-dist_htmlDATA: $(dist_html_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(htmldir)" || $(mkdir_p) "$(DESTDIR)$(htmldir)"
+ @list='$(dist_html_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(dist_htmlDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
+ $(dist_htmlDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
+ done
+
+uninstall-dist_htmlDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(dist_html_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(htmldir)/$$f'"; \
+ rm -f "$(DESTDIR)$(htmldir)/$$f"; \
+ done
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ $(mkdir_p) $(distdir)/srcdoc $(distdir)/xsl
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(MANS) $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(htmldir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-local mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+ distclean-local
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-dist_htmlDATA install-man
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man: install-man1
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-dist_htmlDATA uninstall-info-am \
+ uninstall-local uninstall-man
+
+uninstall-man: uninstall-man1
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ clean-local distclean distclean-generic distclean-libtool \
+ distclean-local distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am \
+ install-dist_htmlDATA install-exec install-exec-am \
+ install-info install-info-am install-man install-man1 \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ uninstall uninstall-am uninstall-dist_htmlDATA \
+ uninstall-info-am uninstall-local uninstall-man uninstall-man1
+
+
+@have_xsltproc_TRUE@oprofile.html: ${top_srcdir}/doc/oprofile.xml
+@have_xsltproc_TRUE@ XML_CATALOG_FILES=$(XML_CATALOG_FILES) $(XSLTPROC) $(XSLTPROC_FLAGS) -o $@ --stringparam version @VERSION@ $(XHTML_STYLESHEET) $<
+
+@have_xsltproc_TRUE@op-jit-devel.html: ${top_srcdir}/doc/op-jit-devel.xml
+@have_xsltproc_TRUE@ XML_CATALOG_FILES=$(XML_CATALOG_FILES) $(XSLTPROC) $(XSLTPROC_FLAGS) -o $@ --stringparam version @VERSION@ $(XHTML_STYLESHEET) $<
+
+@have_xsltproc_TRUE@internals.html: ${top_srcdir}/doc/internals.xml
+@have_xsltproc_TRUE@ XML_CATALOG_FILES=$(XML_CATALOG_FILES) $(XSLTPROC) $(XSLTPROC_FLAGS) -o $@ --stringparam version @VERSION@ $(XHTML_STYLESHEET) $<
+
+# rules to generate oprofile.sf.net/doc files
+
+@have_xsltproc_TRUE@doc/index.html: ${top_srcdir}/doc/oprofile.xml
+@have_xsltproc_TRUE@ -mkdir doc/
+@have_xsltproc_TRUE@ $(XSLTPROC) -o doc/ $(XSLTPROC_FLAGS) --stringparam version @VERSION@ $(CHUNK_XHTML_STYLESHEET) $<
+
+@have_xsltproc_TRUE@doc/devel/index.html: ${top_srcdir}/doc/op-jit-devel.xml
+@have_xsltproc_TRUE@ -mkdir doc/devel/
+@have_xsltproc_TRUE@ $(XSLTPROC) -o doc/devel/ $(XSLTPROC_FLAGS) --stringparam version @VERSION@ $(CHUNK_XHTML_STYLESHEET) $<
+
+@have_xsltproc_TRUE@doc/internals/index.html: ${top_srcdir}/doc/internals.xml
+@have_xsltproc_TRUE@ -mkdir doc/internals/
+@have_xsltproc_TRUE@ $(XSLTPROC) -o doc/internals/ $(XSLTPROC_FLAGS) --stringparam version @VERSION@ $(CHUNK_XHTML_STYLESHEET) $<
+
+@have_xsltproc_TRUE@chunk: doc/index.html doc/internals/index.html doc/devel/index.html
+@have_xsltproc_TRUE@ cp ${top_srcdir}/doc/buffers.png doc/internals/
+
+@have_xsltproc_FALSE@oprofile.html:
+@have_xsltproc_FALSE@ touch $@
+
+@have_xsltproc_FALSE@internals.html:
+@have_xsltproc_FALSE@ touch $@
+
+@have_xsltproc_FALSE@op-jit-devel.html:
+@have_xsltproc_FALSE@ touch $@
+
+@have_xsltproc_FALSE@chunk:
+
+distclean-local:
+ $(RM) -f xsl/catalog-1.xml xsl/catalog.xml
+
+clean-local:
+ $(RM) -f $(generated_mans)
+
+# these files are not cleaned by make uninstall automake bug ?
+uninstall-local:
+ rm -f @mandir@/cat1/oprofile.1.gz
+ @for f in $(LINK_LIST); do \
+ rm -f $(CATDIR)/cat1/$$f.gz; \
+ done
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/doc/buffers.png b/doc/buffers.png
new file mode 100644
index 0000000..25fabf3
--- /dev/null
+++ b/doc/buffers.png
Binary files differ
diff --git a/doc/internals.html b/doc/internals.html
new file mode 100644
index 0000000..97cc06a
--- /dev/null
+++ b/doc/internals.html
@@ -0,0 +1,2009 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ <title>OProfile Internals</title>
+ <meta name="generator" content="DocBook XSL Stylesheets V1.69.1" />
+ </head>
+ <body>
+ <div class="book" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h1 class="title"><a id="oprofile-internals"></a>OProfile Internals</h1>
+ </div>
+ <div>
+ <div class="authorgroup">
+ <div class="author">
+ <h3 class="author"><span class="firstname">John</span> <span class="surname">Levon</span></h3>
+ <div class="affiliation">
+ <div class="address">
+ <p>
+ <code class="email">&lt;<a href="mailto:levon@movementarian.org">levon@movementarian.org</a>&gt;</code>
+ </p>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div>
+ <p class="copyright">Copyright © 2003 John Levon</p>
+ </div>
+ </div>
+ <hr />
+ </div>
+ <div class="toc">
+ <p>
+ <b>Table of Contents</b>
+ </p>
+ <dl>
+ <dt>
+ <span class="chapter">
+ <a href="#introduction">1. Introduction</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect1">
+ <a href="#overview">1. Overview</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#components">2. Components of the OProfile system</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect2">
+ <a href="#arch-specific-components">2.1. Architecture-specific components</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#filesystem">2.2. oprofilefs</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#driver">2.3. Generic kernel driver</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#daemon">2.4. The OProfile daemon</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#post-profiling">2.5. Post-profiling tools</a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ </dl>
+ </dd>
+ <dt>
+ <span class="chapter">
+ <a href="#performance-counters">2. Performance counter management</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect1">
+ <a href="#performance-counters-ui">1. Providing a user interface</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#performance-counters-programming">2. Programming the performance counter registers</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect2">
+ <a href="#performance-counters-start">2.1. Starting and stopping the counters</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#id4669490">2.2. IA64 and perfmon</a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ </dl>
+ </dd>
+ <dt>
+ <span class="chapter">
+ <a href="#collecting-samples">3. Collecting and processing samples</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect1">
+ <a href="#receiving-interrupts">1. Receiving interrupts</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#core-structure">2. Core data structures</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#logging-sample">3. Logging a sample</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#logging-stack">4. Logging stack traces</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#synchronising-buffers">5. Synchronising the CPU buffers to the event buffer</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#dentry-cookies">6. Identifying binary images</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#finding-dentry">7. Finding a sample's binary image and offset</a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ <dt>
+ <span class="chapter">
+ <a href="#sample-files">4. Generating sample files</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect1">
+ <a href="#processing-buffer">1. Processing the buffer</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect2">
+ <a href="#handling-kernel-samples">1.1. Handling kernel samples</a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ <dt>
+ <span class="sect1">
+ <a href="#sample-file-generation">2. Locating and creating sample files</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#sample-file-writing">3. Writing data to a sample file</a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ <dt>
+ <span class="chapter">
+ <a href="#output">5. Generating useful output</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect1">
+ <a href="#profile-specification">1. Handling the profile specification</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#sample-file-collating">2. Collating the candidate sample files</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect2">
+ <a href="#sample-file-classifying">2.1. Classifying sample files</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#sample-file-inverting">2.2. Creating inverted profile lists</a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ <dt>
+ <span class="sect1">
+ <a href="#generating-profile-data">3. Generating profile data</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect2">
+ <a href="#bfd">3.1. Processing the binary image</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#processing-sample-files">3.2. Processing the sample files</a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ <dt>
+ <span class="sect1">
+ <a href="#generating-output">4. Generating output</a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ <dt>
+ <span class="chapter">
+ <a href="#ext">6. Extended Feature Interface</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect1">
+ <a href="#ext-intro">1. Introduction</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#ext-name-and-handlers">2. Feature Name and Handlers</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#ext-enable">3. Enabling Features</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#ext-types-of-handlers">4. Type of Handlers</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect2">
+ <a href="#ext_init">4.1. ext_init Handler</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#ext_print_stats">4.2. ext_print_stats Handler</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#ext_sfile_handlers">4.3. ext_sfile Handler</a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ <dt>
+ <span class="sect1">
+ <a href="#ext-implementation">5. Extended Feature Reference Implementation</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect2">
+ <a href="#ext-ibs">5.1. Instruction-Based Sampling (IBS)</a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ </dl>
+ </dd>
+ <dt>
+ <span class="glossary">
+ <a href="#glossary">Glossary of OProfile source concepts and types</a>
+ </span>
+ </dt>
+ </dl>
+ </div>
+ <div class="list-of-figures">
+ <p>
+ <b>List of Figures</b>
+ </p>
+ <dl>
+ <dt>3.1. <a href="#id4669660">The OProfile buffers</a></dt>
+ </dl>
+ </div>
+ <div class="chapter" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title"><a id="introduction"></a>Chapter 1. Introduction</h2>
+ </div>
+ </div>
+ </div>
+ <div class="toc">
+ <p>
+ <b>Table of Contents</b>
+ </p>
+ <dl>
+ <dt>
+ <span class="sect1">
+ <a href="#overview">1. Overview</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#components">2. Components of the OProfile system</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect2">
+ <a href="#arch-specific-components">2.1. Architecture-specific components</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#filesystem">2.2. oprofilefs</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#driver">2.3. Generic kernel driver</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#daemon">2.4. The OProfile daemon</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#post-profiling">2.5. Post-profiling tools</a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ </dl>
+ </div>
+ <p>
+This document is current for OProfile version 0.9.6.
+This document provides some details on the internal workings of OProfile for the
+interested hacker. This document assumes strong C, working C++, plus some knowledge of
+kernel internals and CPU hardware.
+</p>
+ <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
+ <h3 class="title">Note</h3>
+ <p>
+Only the "new" implementation associated with kernel 2.6 and above is covered here. 2.4
+uses a very different kernel module implementation and daemon to produce the sample files.
+</p>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="overview"></a>1. Overview</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+OProfile is a statistical continuous profiler. In other words, profiles are generated by
+regularly sampling the current registers on each CPU (from an interrupt handler, the
+saved PC value at the time of interrupt is stored), and converting that runtime PC
+value into something meaningful to the programmer.
+</p>
+ <p>
+OProfile achieves this by taking the stream of sampled PC values, along with the detail
+of which task was running at the time of the interrupt, and converting into a file offset
+against a particular binary file. Because applications <code class="function">mmap()</code>
+the code they run (be it <code class="filename">/bin/bash</code>, <code class="filename">/lib/libfoo.so</code>
+or whatever), it's possible to find the relevant binary file and offset by walking
+the task's list of mapped memory areas. Each PC value is thus converted into a tuple
+of binary-image,offset. This is something that the userspace tools can use directly
+to reconstruct where the code came from, including the particular assembly instructions,
+symbol, and source line (via the binary's debug information if present).
+</p>
+ <p>
+Regularly sampling the PC value like this approximates what actually was executed and
+how often - more often than not, this statistical approximation is good enough to
+reflect reality. In common operation, the time between each sample interrupt is regulated
+by a fixed number of clock cycles. This implies that the results will reflect where
+the CPU is spending the most time; this is obviously a very useful information source
+for performance analysis.
+</p>
+ <p>
+Sometimes though, an application programmer needs different kinds of information: for example,
+"which of the source routines cause the most cache misses ?". The rise in importance of
+such metrics in recent years has led many CPU manufacturers to provide hardware performance
+counters capable of measuring these events on the hardware level. Typically, these counters
+increment once per each event, and generate an interrupt on reaching some pre-defined
+number of events. OProfile can use these interrupts to generate samples: then, the
+profile results are a statistical approximation of which code caused how many of the
+given event.
+</p>
+ <p>
+Consider a simplified system that only executes two functions A and B. A
+takes one cycle to execute, whereas B takes 99 cycles. Imagine we run at
+100 cycles a second, and we've set the performance counter to create an
+interrupt after a set number of "events" (in this case an event is one
+clock cycle). It should be clear that the chances of the interrupt
+occurring in function A is 1/100, and 99/100 for function B. Thus, we
+statistically approximate the actual relative performance features of
+the two functions over time. This same analysis works for other types of
+events, providing that the interrupt is tied to the number of events
+occurring (that is, after N events, an interrupt is generated).
+</p>
+ <p>
+There are typically more than one of these counters, so it's possible to set up profiling
+for several different event types. Using these counters gives us a powerful, low-overhead
+way of gaining performance metrics. If OProfile, or the CPU, does not support performance
+counters, then a simpler method is used: the kernel timer interrupt feeds samples
+into OProfile itself.
+</p>
+ <p>
+The rest of this document concerns itself with how we get from receiving samples at
+interrupt time to producing user-readable profile information.
+</p>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="components"></a>2. Components of the OProfile system</h2>
+ </div>
+ </div>
+ </div>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="arch-specific-components"></a>2.1. Architecture-specific components</h3>
+ </div>
+ </div>
+ </div>
+ <p>
+If OProfile supports the hardware performance counters found on
+a particular architecture, code for managing the details of setting
+up and managing these counters can be found in the kernel source
+tree in the relevant <code class="filename">arch/<span class="emphasis"><em>arch</em></span>/oprofile/</code>
+directory. The architecture-specific implementation works via
+filling in the oprofile_operations structure at init time. This
+provides a set of operations such as <code class="function">setup()</code>,
+<code class="function">start()</code>, <code class="function">stop()</code>, etc.
+that manage the hardware-specific details of fiddling with the
+performance counter registers.
+</p>
+ <p>
+The other important facility available to the architecture code is
+<code class="function">oprofile_add_sample()</code>. This is where a particular sample
+taken at interrupt time is fed into the generic OProfile driver code.
+</p>
+ </div>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="filesystem"></a>2.2. oprofilefs</h3>
+ </div>
+ </div>
+ </div>
+ <p>
+OProfile implements a pseudo-filesystem known as "oprofilefs", mounted from
+userspace at <code class="filename">/dev/oprofile</code>. This consists of small
+files for reporting and receiving configuration from userspace, as well
+as the actual character device that the OProfile userspace receives samples
+from. At <code class="function">setup()</code> time, the architecture-specific may
+add further configuration files related to the details of the performance
+counters. For example, on x86, one numbered directory for each hardware
+performance counter is added, with files in each for the event type,
+reset value, etc.
+</p>
+ <p>
+The filesystem also contains a <code class="filename">stats</code> directory with
+a number of useful counters for various OProfile events.
+</p>
+ </div>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="driver"></a>2.3. Generic kernel driver</h3>
+ </div>
+ </div>
+ </div>
+ <p>
+This lives in <code class="filename">drivers/oprofile/</code>, and forms the core of
+how OProfile works in the kernel. Its job is to take samples delivered
+from the architecture-specific code (via <code class="function">oprofile_add_sample()</code>),
+and buffer this data, in a transformed form as described later, until releasing
+the data to the userspace daemon via the <code class="filename">/dev/oprofile/buffer</code>
+character device.
+</p>
+ </div>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="daemon"></a>2.4. The OProfile daemon</h3>
+ </div>
+ </div>
+ </div>
+ <p>
+The OProfile userspace daemon's job is to take the raw data provided by the
+kernel and write it to the disk. It takes the single data stream from the
+kernel and logs sample data against a number of sample files (found in
+<code class="filename">$SESSION_DIR/samples/current/</code>, by default located at
+<code class="filename">/var/lib/oprofile/samples/current/</code>. For the benefit
+of the "separate" functionality, the names/paths of these sample files
+are mangled to reflect where the samples were from: this can include
+thread IDs, the binary file path, the event type used, and more.
+</p>
+ <p>
+After this final step from interrupt to disk file, the data is now
+persistent (that is, changes in the running of the system do not invalidate
+stored data). So the post-profiling tools can run on this data at any
+time (assuming the original binary files are still available and unchanged,
+naturally).
+</p>
+ </div>
+ <div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="post-profiling"></a>2.5. Post-profiling tools</h3></div></div></div>
+So far, we've collected data, but we've yet to present it in a useful form
+to the user. This is the job of the post-profiling tools. In general form,
+they collate a subset of the available sample files, load and process each one
+correlated against the relevant binary file, and finally produce user-readable
+information.
+</div>
+ </div>
+ </div>
+ <div class="chapter" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title"><a id="performance-counters"></a>Chapter 2. Performance counter management</h2>
+ </div>
+ </div>
+ </div>
+ <div class="toc">
+ <p>
+ <b>Table of Contents</b>
+ </p>
+ <dl>
+ <dt>
+ <span class="sect1">
+ <a href="#performance-counters-ui">1. Providing a user interface</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#performance-counters-programming">2. Programming the performance counter registers</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect2">
+ <a href="#performance-counters-start">2.1. Starting and stopping the counters</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#id4669490">2.2. IA64 and perfmon</a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ </dl>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="performance-counters-ui"></a>1. Providing a user interface</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+The performance counter registers need programming in order to set the
+type of event to count, etc. OProfile uses a standard model across all
+CPUs for defining these events as follows :
+</p>
+ <div class="informaltable">
+ <table border="1">
+ <colgroup>
+ <col />
+ <col />
+ </colgroup>
+ <tbody>
+ <tr>
+ <td>
+ <code class="option">event</code>
+ </td>
+ <td>The event type e.g. DATA_MEM_REFS</td>
+ </tr>
+ <tr>
+ <td>
+ <code class="option">unit mask</code>
+ </td>
+ <td>The sub-events to count (more detailed specification)</td>
+ </tr>
+ <tr>
+ <td>
+ <code class="option">counter</code>
+ </td>
+ <td>The hardware counter(s) that can count this event</td>
+ </tr>
+ <tr>
+ <td>
+ <code class="option">count</code>
+ </td>
+ <td>The reset value (how many events before an interrupt)</td>
+ </tr>
+ <tr>
+ <td>
+ <code class="option">kernel</code>
+ </td>
+ <td>Whether the counter should increment when in kernel space</td>
+ </tr>
+ <tr>
+ <td>
+ <code class="option">user</code>
+ </td>
+ <td>Whether the counter should increment when in user space</td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <p>
+The term "unit mask" is borrowed from the Intel architectures, and can
+further specify exactly when a counter is incremented (for example,
+cache-related events can be restricted to particular state transitions
+of the cache lines).
+</p>
+ <p>
+All of the available hardware events and their details are specified in
+the textual files in the <code class="filename">events</code> directory. The
+syntax of these files should be fairly obvious. The user specifies the
+names and configuration details of the chosen counters via
+<span><strong class="command">opcontrol</strong></span>. These are then written to the kernel
+module (in numerical form) via <code class="filename">/dev/oprofile/N/</code>
+where N is the physical hardware counter (some events can only be used
+on specific counters; OProfile hides these details from the user when
+possible). On IA64, the perfmon-based interface behaves somewhat
+differently, as described later.
+</p>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="performance-counters-programming"></a>2. Programming the performance counter registers</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+We have described how the user interface fills in the desired
+configuration of the counters and transmits the information to the
+kernel. It is the job of the <code class="function">-&gt;setup()</code> method
+to actually program the performance counter registers. Clearly, the
+details of how this is done is architecture-specific; it is also
+model-specific on many architectures. For example, i386 provides methods
+for each model type that programs the counter registers correctly
+(see the <code class="filename">op_model_*</code> files in
+<code class="filename">arch/i386/oprofile</code> for the details). The method
+reads the values stored in the virtual oprofilefs files and programs
+the registers appropriately, ready for starting the actual profiling
+session.
+</p>
+ <p>
+The architecture-specific drivers make sure to save the old register
+settings before doing OProfile setup. They are restored when OProfile
+shuts down. This is useful, for example, on i386, where the NMI watchdog
+uses the same performance counter registers as OProfile; they cannot
+run concurrently, but OProfile makes sure to restore the setup it found
+before it was running.
+</p>
+ <p>
+In addition to programming the counter registers themselves, other setup
+is often necessary. For example, on i386, the local APIC needs
+programming in order to make the counter's overflow interrupt appear as
+an NMI (non-maskable interrupt). This allows sampling (and therefore
+profiling) of regions where "normal" interrupts are masked, enabling
+more reliable profiles.
+</p>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="performance-counters-start"></a>2.1. Starting and stopping the counters</h3>
+ </div>
+ </div>
+ </div>
+ <p>
+Initiating a profiling session is done via writing an ASCII '1'
+to the file <code class="filename">/dev/oprofile/enable</code>. This sets up the
+core, and calls into the architecture-specific driver to actually
+enable each configured counter. Again, the details of how this is
+done is model-specific (for example, the Athlon models can disable
+or enable on a per-counter basis, unlike the PPro models).
+</p>
+ </div>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="id4669490"></a>2.2. IA64 and perfmon</h3>
+ </div>
+ </div>
+ </div>
+ <p>
+The IA64 architecture provides a different interface from the other
+architectures, using the existing perfmon driver. Register programming
+is handled entirely in user-space (see
+<code class="filename">daemon/opd_perfmon.c</code> for the details). A process
+is forked for each CPU, which creates a perfmon context and sets the
+counter registers appropriately via the
+<code class="function">sys_perfmonctl</code> interface. In addition, the actual
+initiation and termination of the profiling session is handled via the
+same interface using <code class="constant">PFM_START</code> and
+<code class="constant">PFM_STOP</code>. On IA64, then, there are no oprofilefs
+files for the performance counters, as the kernel driver does not
+program the registers itself.
+</p>
+ <p>
+Instead, the perfmon driver for OProfile simply registers with the
+OProfile core with an OProfile-specific UUID. During a profiling
+session, the perfmon core calls into the OProfile perfmon driver and
+samples are registered with the OProfile core itself as usual (with
+<code class="function">oprofile_add_sample()</code>).
+</p>
+ </div>
+ </div>
+ </div>
+ <div class="chapter" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title"><a id="collecting-samples"></a>Chapter 3. Collecting and processing samples</h2>
+ </div>
+ </div>
+ </div>
+ <div class="toc">
+ <p>
+ <b>Table of Contents</b>
+ </p>
+ <dl>
+ <dt>
+ <span class="sect1">
+ <a href="#receiving-interrupts">1. Receiving interrupts</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#core-structure">2. Core data structures</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#logging-sample">3. Logging a sample</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#logging-stack">4. Logging stack traces</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#synchronising-buffers">5. Synchronising the CPU buffers to the event buffer</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#dentry-cookies">6. Identifying binary images</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#finding-dentry">7. Finding a sample's binary image and offset</a>
+ </span>
+ </dt>
+ </dl>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="receiving-interrupts"></a>1. Receiving interrupts</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+Naturally, how the overflow interrupts are received is specific
+to the hardware architecture, unless we are in "timer" mode, where the
+logging routine is called directly from the standard kernel timer
+interrupt handler.
+</p>
+ <p>
+On the i386 architecture, the local APIC is programmed such that when a
+counter overflows (that is, it receives an event that causes an integer
+overflow of the register value to zero), an NMI is generated. This calls
+into the general handler <code class="function">do_nmi()</code>; because OProfile
+has registered itself as capable of handling NMI interrupts, this will
+call into the OProfile driver code in
+<code class="filename">arch/i386/oprofile</code>. Here, the saved PC value (the
+CPU saves the register set at the time of interrupt on the stack
+available for inspection) is extracted, and the counters are examined to
+find out which one generated the interrupt. Also determined is whether
+the system was inside kernel or user space at the time of the interrupt.
+These three pieces of information are then forwarded onto the OProfile
+core via <code class="function">oprofile_add_sample()</code>. Finally, the
+counter values are reset to the chosen count value, to ensure another
+interrupt happens after another N events have occurred. Other
+architectures behave in a similar manner.
+</p>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="core-structure"></a>2. Core data structures</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+Before considering what happens when we log a sample, we shall digress
+for a moment and look at the general structure of the data collection
+system.
+</p>
+ <p>
+OProfile maintains a small buffer for storing the logged samples for
+each CPU on the system. Only this buffer is altered when we actually log
+a sample (remember, we may still be in an NMI context, so no locking is
+possible). The buffer is managed by a two-handed system; the "head"
+iterator dictates where the next sample data should be placed in the
+buffer. Of course, overflow of the buffer is possible, in which case
+the sample is discarded.
+</p>
+ <p>
+It is critical to remember that at this point, the PC value is an
+absolute value, and is therefore only meaningful in the context of which
+task it was logged against. Thus, these per-CPU buffers also maintain
+details of which task each logged sample is for, as described in the
+next section. In addition, we store whether the sample was in kernel
+space or user space (on some architectures and configurations, the address
+space is not sub-divided neatly at a specific PC value, so we must store
+this information).
+</p>
+ <p>
+As well as these small per-CPU buffers, we have a considerably larger
+single buffer. This holds the data that is eventually copied out into
+the OProfile daemon. On certain system events, the per-CPU buffers are
+processed and entered (in mutated form) into the main buffer, known in
+the source as the "event buffer". The "tail" iterator indicates the
+point from which the CPU may be read, up to the position of the "head"
+iterator. This provides an entirely lock-free method for extracting data
+from the CPU buffers. This process is described in detail later in this chapter.
+</p>
+ <div class="figure">
+ <a id="id4669660"></a>
+ <p class="title">
+ <b>Figure 3.1. The OProfile buffers</b>
+ </p>
+ <div>
+ <img src="buffers.png" alt="The OProfile buffers" />
+ </div>
+ </div>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="logging-sample"></a>3. Logging a sample</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+As mentioned, the sample is logged into the buffer specific to the
+current CPU. The CPU buffer is a simple array of pairs of unsigned long
+values; for a sample, they hold the PC value and the counter for the
+sample. (The counter value is later used to translate back into the relevant
+event type the counter was programmed to).
+</p>
+ <p>
+In addition to logging the sample itself, we also log task switches.
+This is simply done by storing the address of the last task to log a
+sample on that CPU in a data structure, and writing a task switch entry
+into the buffer if the new value of <code class="function">current()</code> has
+changed. Note that later we will directly de-reference this pointer;
+this imposes certain restrictions on when and how the CPU buffers need
+to be processed.
+</p>
+ <p>
+Finally, as mentioned, we log whether we have changed between kernel and
+userspace using a similar method. Both of these variables
+(<code class="varname">last_task</code> and <code class="varname">last_is_kernel</code>) are
+reset when the CPU buffer is read.
+</p>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="logging-stack"></a>4. Logging stack traces</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+OProfile can also provide statistical samples of call chains (on x86). To
+do this, at sample time, the frame pointer chain is traversed, recording
+the return address for each stack frame. This will only work if the code
+was compiled with frame pointers, but we're careful to abort the
+traversal if the frame pointer appears bad. We store the set of return
+addresses straight into the CPU buffer. Note that, since this traversal
+is keyed off the standard sample interrupt, the number of times a
+function appears in a stack trace is not an indicator of how many times
+the call site was executed: rather, it's related to the number of
+samples we took where that call site was involved. Thus, the results for
+stack traces are not necessarily proportional to the call counts:
+typical programs will have many <code class="function">main()</code> samples.
+</p>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="synchronising-buffers"></a>5. Synchronising the CPU buffers to the event buffer</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+At some point, we have to process the data in each CPU buffer and enter
+it into the main (event) buffer. The file
+<code class="filename">buffer_sync.c</code> contains the relevant code. We
+periodically (currently every <code class="constant">HZ</code>/4 jiffies) start
+the synchronisation process. In addition, we process the buffers on
+certain events, such as an application calling
+<code class="function">munmap()</code>. This is particularly important for
+<code class="function">exit()</code> - because the CPU buffers contain pointers
+to the task structure, if we don't process all the buffers before the
+task is actually destroyed and the task structure freed, then we could
+end up trying to dereference a bogus pointer in one of the CPU buffers.
+</p>
+ <p>
+We also add a notification when a kernel module is loaded; this is so
+that user-space can re-read <code class="filename">/proc/modules</code> to
+determine the load addresses of kernel module text sections. Without
+this notification, samples for a newly-loaded module could get lost or
+be attributed to the wrong module.
+</p>
+ <p>
+The synchronisation itself works in the following manner: first, mutual
+exclusion on the event buffer is taken. Remember, we do not need to do
+that for each CPU buffer, as we only read from the tail iterator (whilst
+interrupts might be arriving at the same buffer, but they will write to
+the position of the head iterator, leaving previously written entries
+intact). Then, we process each CPU buffer in turn. A CPU switch
+notification is added to the buffer first (for
+<code class="option">--separate=cpu</code> support). Then the processing of the
+actual data starts.
+</p>
+ <p>
+As mentioned, the CPU buffer consists of task switch entries and the
+actual samples. When the routine <code class="function">sync_buffer()</code> sees
+a task switch, the process ID and process group ID are recorded into the
+event buffer, along with a dcookie (see below) identifying the
+application binary (e.g. <code class="filename">/bin/bash</code>). The
+<code class="varname">mmap_sem</code> for the task is then taken, to allow safe
+iteration across the tasks' list of mapped areas. Each sample is then
+processed as described in the next section.
+</p>
+ <p>
+After a buffer has been read, the tail iterator is updated to reflect
+how much of the buffer was processed. Note that when we determined how
+much data there was to read in the CPU buffer, we also called
+<code class="function">cpu_buffer_reset()</code> to reset
+<code class="varname">last_task</code> and <code class="varname">last_is_kernel</code>, as
+we've already mentioned. During the processing, more samples may have
+been arriving in the CPU buffer; this is OK because we are careful to
+only update the tail iterator to how much we actually read - on the next
+buffer synchronisation, we will start again from that point.
+</p>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="dentry-cookies"></a>6. Identifying binary images</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+In order to produce useful profiles, we need to be able to associate a
+particular PC value sample with an actual ELF binary on the disk. This
+leaves us with the problem of how to export this information to
+user-space. We create unique IDs that identify a particular directory
+entry (dentry), and write those IDs into the event buffer. Later on,
+the user-space daemon can call the <code class="function">lookup_dcookie</code>
+system call, which looks up the ID and fills in the full path of
+the binary image in the buffer user-space passes in. These IDs are
+maintained by the code in <code class="filename">fs/dcookies.c</code>; the
+cache lasts for as long as the daemon has the event buffer open.
+</p>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="finding-dentry"></a>7. Finding a sample's binary image and offset</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+We haven't yet described how we process the absolute PC value into
+something usable by the user-space daemon. When we find a sample entered
+into the CPU buffer, we traverse the list of mappings for the task
+(remember, we will have seen a task switch earlier, so we know which
+task's lists to look at). When a mapping is found that contains the PC
+value, we look up the mapped file's dentry in the dcookie cache. This
+gives the dcookie ID that will uniquely identify the mapped file. Then
+we alter the absolute value such that it is an offset from the start of
+the file being mapped (the mapping need not start at the start of the
+actual file, so we have to consider the offset value of the mapping). We
+store this dcookie ID into the event buffer; this identifies which
+binary the samples following it are against.
+In this manner, we have converted a PC value, which has transitory
+meaning only, into a static offset value for later processing by the
+daemon.
+</p>
+ <p>
+We also attempt to avoid the relatively expensive lookup of the dentry
+cookie value by storing the cookie value directly into the dentry
+itself; then we can simply derive the cookie value immediately when we
+find the correct mapping.
+</p>
+ </div>
+ </div>
+ <div class="chapter" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title"><a id="sample-files"></a>Chapter 4. Generating sample files</h2>
+ </div>
+ </div>
+ </div>
+ <div class="toc">
+ <p>
+ <b>Table of Contents</b>
+ </p>
+ <dl>
+ <dt>
+ <span class="sect1">
+ <a href="#processing-buffer">1. Processing the buffer</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect2">
+ <a href="#handling-kernel-samples">1.1. Handling kernel samples</a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ <dt>
+ <span class="sect1">
+ <a href="#sample-file-generation">2. Locating and creating sample files</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#sample-file-writing">3. Writing data to a sample file</a>
+ </span>
+ </dt>
+ </dl>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="processing-buffer"></a>1. Processing the buffer</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+Now we can move onto user-space in our description of how raw interrupt
+samples are processed into useful information. As we described in
+previous sections, the kernel OProfile driver creates a large buffer of
+sample data consisting of offset values, interspersed with
+notification of changes in context. These context changes indicate how
+following samples should be attributed, and include task switches, CPU
+changes, and which dcookie the sample value is against. By processing
+this buffer entry-by-entry, we can determine where the samples should
+be accredited to. This is particularly important when using the
+<code class="option">--separate</code>.
+</p>
+ <p>
+The file <code class="filename">daemon/opd_trans.c</code> contains the basic routine
+for the buffer processing. The <code class="varname">struct transient</code>
+structure is used to hold changes in context. Its members are modified
+as we process each entry; it is passed into the routines in
+<code class="filename">daemon/opd_sfile.c</code> for actually logging the sample
+to a particular sample file (which will be held in
+<code class="filename">$SESSION_DIR/samples/current</code>).
+</p>
+ <p>
+The buffer format is designed for conciseness, as high sampling rates
+can easily generate a lot of data. Thus, context changes are prefixed
+by an escape code, identified by <code class="function">is_escape_code()</code>.
+If an escape code is found, the next entry in the buffer identifies
+what type of context change is being read. These are handed off to
+various handlers (see the <code class="varname">handlers</code> array), which
+modify the transient structure as appropriate. If it's not an escape
+code, then it must be a PC offset value, and the very next entry will
+be the numeric hardware counter. These values are read and recorded
+in the transient structure; we then do a lookup to find the correct
+sample file, and log the sample, as described in the next section.
+</p>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="handling-kernel-samples"></a>1.1. Handling kernel samples</h3>
+ </div>
+ </div>
+ </div>
+ <p>
+Samples from kernel code require a little special handling. Because
+the binary text which the sample is against does not correspond to
+any file that the kernel directly knows about, the OProfile driver
+stores the absolute PC value in the buffer, instead of the file offset.
+Of course, we need an offset against some particular binary. To handle
+this, we keep a list of loaded modules by parsing
+<code class="filename">/proc/modules</code> as needed. When a module is loaded,
+a notification is placed in the OProfile buffer, and this triggers a
+re-read. We store the module name, and the loading address and size.
+This is also done for the main kernel image, as specified by the user.
+The absolute PC value is matched against each address range, and
+modified into an offset when the matching module is found. See
+<code class="filename">daemon/opd_kernel.c</code> for the details.
+</p>
+ </div>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="sample-file-generation"></a>2. Locating and creating sample files</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+We have a sample value and its satellite data stored in a
+<code class="varname">struct transient</code>, and we must locate an
+actual sample file to store the sample in, using the context
+information in the transient structure as a key. The transient data to
+sample file lookup is handled in
+<code class="filename">daemon/opd_sfile.c</code>. A hash is taken of the
+transient values that are relevant (depending upon the setting of
+<code class="option">--separate</code>, some values might be irrelevant), and the
+hash value is used to lookup the list of currently open sample files.
+Of course, the sample file might not be found, in which case we need
+to create and open it.
+</p>
+ <p>
+OProfile uses a rather complex scheme for naming sample files, in order
+to make selecting relevant sample files easier for the post-profiling
+utilities. The exact details of the scheme are given in
+<code class="filename">oprofile-tests/pp_interface</code>, but for now it will
+suffice to remember that the filename will include only relevant
+information for the current settings, taken from the transient data. A
+fully-specified filename looks something like :
+</p>
+ <code class="computeroutput">
+/var/lib/oprofile/samples/current/{root}/usr/bin/xmms/{dep}/{root}/lib/tls/libc-2.3.2.so/CPU_CLK_UNHALTED.100000.0.28082.28089.0
+</code>
+ <p>
+It should be clear that this identifies such information as the
+application binary, the dependent (library) binary, the hardware event,
+and the process and thread ID. Typically, not all this information is
+needed, in which cases some values may be replaced with the token
+<code class="filename">all</code>.
+</p>
+ <p>
+The code that generates this filename and opens the file is found in
+<code class="filename">daemon/opd_mangling.c</code>. You may have realised that
+at this point, we do not have the binary image file names, only the
+dcookie values. In order to determine a file name, a dcookie value is
+looked up in the dcookie cache. This is to be found in
+<code class="filename">daemon/opd_cookie.c</code>. Since dcookies are both
+persistent and unique during a sampling session, we can cache the
+values. If the value is not found in the cache, then we ask the kernel
+to do the lookup from value to file name for us by calling
+<code class="function">lookup_dcookie()</code>. This looks up the value in a
+kernel-side cache (see <code class="filename">fs/dcookies.c</code>) and returns
+the fully-qualified file name to userspace.
+</p>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="sample-file-writing"></a>3. Writing data to a sample file</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+Each specific sample file is a hashed collection, where the key is
+the PC offset from the transient data, and the value is the number of
+samples recorded against that offset. The files are
+<code class="function">mmap()</code>ed into the daemon's memory space. The code
+to actually log the write against the sample file can be found in
+<code class="filename">libdb/</code>.
+</p>
+ <p>
+For recording stack traces, we have a more complicated sample filename
+mangling scheme that allows us to identify cross-binary calls. We use
+the same sample file format, where the key is a 64-bit value composed
+from the from,to pair of offsets.
+</p>
+ </div>
+ </div>
+ <div class="chapter" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title"><a id="output"></a>Chapter 5. Generating useful output</h2>
+ </div>
+ </div>
+ </div>
+ <div class="toc">
+ <p>
+ <b>Table of Contents</b>
+ </p>
+ <dl>
+ <dt>
+ <span class="sect1">
+ <a href="#profile-specification">1. Handling the profile specification</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#sample-file-collating">2. Collating the candidate sample files</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect2">
+ <a href="#sample-file-classifying">2.1. Classifying sample files</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#sample-file-inverting">2.2. Creating inverted profile lists</a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ <dt>
+ <span class="sect1">
+ <a href="#generating-profile-data">3. Generating profile data</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect2">
+ <a href="#bfd">3.1. Processing the binary image</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#processing-sample-files">3.2. Processing the sample files</a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ <dt>
+ <span class="sect1">
+ <a href="#generating-output">4. Generating output</a>
+ </span>
+ </dt>
+ </dl>
+ </div>
+ <p>
+All of the tools used to generate human-readable output have to take
+roughly the same steps to collect the data for processing. First, the
+profile specification given by the user has to be parsed. Next, a list
+of sample files matching the specification has to obtained. Using this
+list, we need to locate the binary file for each sample file, and then
+use them to extract meaningful data, before a final collation and
+presentation to the user.
+</p>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="profile-specification"></a>1. Handling the profile specification</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+The profile specification presented by the user is parsed in
+the function <code class="function">profile_spec::create()</code>. This
+creates an object representing the specification. Then we
+use <code class="function">profile_spec::generate_file_list()</code>
+to search for all sample files and match them against the
+<code class="varname">profile_spec</code>.
+</p>
+ <p>
+To enable this matching process to work, the attributes of
+each sample file is encoded in its filename. This is a low-tech
+approach to matching specifications against candidate sample
+files, but it works reasonably well. A typical sample file
+might look like these:
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+/var/lib/oprofile/samples/current/{root}/bin/ls/{dep}/{root}/bin/ls/{cg}/{root}/bin/ls/CPU_CLK_UNHALTED.100000.0.all.all.all
+/var/lib/oprofile/samples/current/{root}/bin/ls/{dep}/{root}/bin/ls/CPU_CLK_UNHALTED.100000.0.all.all.all
+/var/lib/oprofile/samples/current/{root}/bin/ls/{dep}/{root}/bin/ls/CPU_CLK_UNHALTED.100000.0.7423.7424.0
+/var/lib/oprofile/samples/current/{kern}/r128/{dep}/{kern}/r128/CPU_CLK_UNHALTED.100000.0.all.all.all
+</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+This looks unnecessarily complex, but it's actually fairly simple. First
+we have the session of the sample, by default located here
+<code class="filename">/var/lib/oprofile/samples/current</code>. This location
+can be changed by specifying the --session-dir option at command-line.
+This session could equally well be inside an archive from <span><strong class="command">oparchive</strong></span>.
+Next we have one of the tokens <code class="filename">{root}</code> or
+<code class="filename">{kern}</code>. <code class="filename">{root}</code> indicates
+that the binary is found on a file system, and we will encode its path
+in the next section (e.g. <code class="filename">/bin/ls</code>).
+<code class="filename">{kern}</code> indicates a kernel module - on 2.6 kernels
+the path information is not available from the kernel, so we have to
+special-case kernel modules like this; we encode merely the name of the
+module as loaded.
+</p>
+ <p>
+Next there is a <code class="filename">{dep}</code> token, indicating another
+token/path which identifies the dependent binary image. This is used even for
+the "primary" binary (i.e. the one that was
+<code class="function">execve()</code>d), as it simplifies processing. Finally,
+if this sample file is a normal flat profile, the actual file is next in
+the path. If it's a call-graph sample file, we need one further
+specification, to allow us to identify cross-binary arcs in the call
+graph.
+</p>
+ <p>
+The actual sample file name is dot-separated, where the fields are, in
+order: event name, event count, unit mask, task group ID, task ID, and
+CPU number.
+</p>
+ <p>
+This sample file can be reliably parsed (with
+<code class="function">parse_filename()</code>) into a
+<code class="varname">filename_spec</code>. Finally, we can check whether to
+include the sample file in the final results by comparing this
+<code class="varname">filename_spec</code> against the
+<code class="varname">profile_spec</code> the user specified (for the interested,
+see <code class="function">valid_candidate()</code> and
+<code class="function">profile_spec::match</code>). Then comes the really
+complicated bit...
+</p>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="sample-file-collating"></a>2. Collating the candidate sample files</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+At this point we have a duplicate-free list of sample files we need
+to process. But first we need to do some further arrangement: we
+need to classify each sample file, and we may also need to "invert"
+the profiles.
+</p>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="sample-file-classifying"></a>2.1. Classifying sample files</h3>
+ </div>
+ </div>
+ </div>
+ <p>
+It's possible for utilities like <span><strong class="command">opreport</strong></span> to show
+data in columnar format: for example, we might want to show the results
+of two threads within a process side-by-side. To do this, we need
+to classify each sample file into classes - the classes correspond
+with each <span><strong class="command">opreport</strong></span> column. The function that handles
+this is <code class="function">arrange_profiles()</code>. Each sample file
+is added to a particular class. If the sample file is the first in
+its class, a template is generated from the sample file. Each template
+describes a particular class (thus, in our example above, each template
+will have a different thread ID, and this uniquely identifies each
+class).
+</p>
+ <p>
+Each class has a list of "profile sets" matching that class's template.
+A profile set is either a profile of the primary binary image, or any of
+its dependent images. After all sample files have been listed in one of
+the profile sets belonging to the classes, we have to name each class and
+perform error-checking. This is done by
+<code class="function">identify_classes()</code>; each class is checked to ensure
+that its "axis" is the same as all the others. This is needed because
+<span><strong class="command">opreport</strong></span> can't produce results in 3D format: we can
+only differ in one aspect, such as thread ID or event name.
+</p>
+ </div>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="sample-file-inverting"></a>2.2. Creating inverted profile lists</h3>
+ </div>
+ </div>
+ </div>
+ <p>
+Remember that if we're using certain profile separation options, such as
+"--separate=lib", a single binary could be a dependent image to many
+different binaries. For example, the C library image would be a
+dependent image for most programs that have been profiled. As it
+happens, this can cause severe performance problems: without some
+re-arrangement, these dependent binary images would be opened each
+time we need to process sample files for each program.
+</p>
+ <p>
+The solution is to "invert" the profiles via
+<code class="function">invert_profiles()</code>. We create a new data structure
+where the dependent binary is first, and the primary binary images using
+that dependent binary are listed as sub-images. This helps our
+performance problem, as now we only need to open each dependent image
+once, when we process the list of inverted profiles.
+</p>
+ </div>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="generating-profile-data"></a>3. Generating profile data</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+Things don't get any simpler at this point, unfortunately. At this point
+we've collected and classified the sample files into the set of inverted
+profiles, as described in the previous section. Now we need to process
+each inverted profile and make something of the data. The entry point
+for this is <code class="function">populate_for_image()</code>.
+</p>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="bfd"></a>3.1. Processing the binary image</h3>
+ </div>
+ </div>
+ </div>
+ <p>
+The first thing we do with an inverted profile is attempt to open the
+binary image (remember each inverted profile set is only for one binary
+image, but may have many sample files to process). The
+<code class="varname">op_bfd</code> class provides an abstracted interface to
+this; internally it uses <code class="filename">libbfd</code>. The main purpose
+of this class is to process the symbols for the binary image; this is
+also where symbol filtering happens. This is actually quite tricky, but
+should be clear from the source.
+</p>
+ </div>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="processing-sample-files"></a>3.2. Processing the sample files</h3>
+ </div>
+ </div>
+ </div>
+ <p>
+The class <code class="varname">profile_container</code> is a hold-all that
+contains all the processed results. It is a container of
+<code class="varname">profile_t</code> objects. The
+<code class="function">add_sample_files()</code> method uses
+<code class="filename">libdb</code> to open the given sample file and add the
+key/value types to the <code class="varname">profile_t</code>. Once this has been
+done, <code class="function">profile_container::add()</code> is passed the
+<code class="varname">profile_t</code> plus the <code class="varname">op_bfd</code> for
+processing.
+</p>
+ <p>
+<code class="function">profile_container::add()</code> walks through the symbols
+collected in the <code class="varname">op_bfd</code>.
+<code class="function">op_bfd::get_symbol_range()</code> gives us the start and
+end of the symbol as an offset from the start of the binary image,
+then we interrogate the <code class="varname">profile_t</code> for the relevant samples
+for that offset range. We create a <code class="varname">symbol_entry</code>
+object for this symbol and fill it in. If needed, here we also collect
+debug information from the <code class="varname">op_bfd</code>, and possibly
+record the detailed sample information (as used by <span><strong class="command">opreport
+-d</strong></span> and <span><strong class="command">opannotate</strong></span>).
+Finally the <code class="varname">symbol_entry</code> is added to
+a private container of <code class="varname">profile_container</code> - this
+<code class="varname">symbol_container</code> holds all such processed symbols.
+</p>
+ </div>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="generating-output"></a>4. Generating output</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+After the processing described in the previous section, we've now got
+full details of what we need to output stored in the
+<code class="varname">profile_container</code> on a symbol-by-symbol basis. To
+produce output, we need to replay that data and format it suitably.
+</p>
+ <p>
+<span><strong class="command">opreport</strong></span> first asks the
+<code class="varname">profile_container</code> for a
+<code class="varname">symbol_collection</code> (this is also where thresholding
+happens).
+This is sorted, then a
+<code class="varname">opreport_formatter</code> is initialised.
+This object initialises a set of field formatters as requested. Then
+<code class="function">opreport_formatter::output()</code> is called. This
+iterates through the (sorted) <code class="varname">symbol_collection</code>;
+for each entry, the selected fields (as set by the
+<code class="varname">format_flags</code> options) are output by calling the
+field formatters, with the <code class="varname">symbol_entry</code> passed in.
+</p>
+ </div>
+ </div>
+ <div class="chapter" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title"><a id="ext"></a>Chapter 6. Extended Feature Interface</h2>
+ </div>
+ </div>
+ </div>
+ <div class="toc">
+ <p>
+ <b>Table of Contents</b>
+ </p>
+ <dl>
+ <dt>
+ <span class="sect1">
+ <a href="#ext-intro">1. Introduction</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#ext-name-and-handlers">2. Feature Name and Handlers</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#ext-enable">3. Enabling Features</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#ext-types-of-handlers">4. Type of Handlers</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect2">
+ <a href="#ext_init">4.1. ext_init Handler</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#ext_print_stats">4.2. ext_print_stats Handler</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#ext_sfile_handlers">4.3. ext_sfile Handler</a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ <dt>
+ <span class="sect1">
+ <a href="#ext-implementation">5. Extended Feature Reference Implementation</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect2">
+ <a href="#ext-ibs">5.1. Instruction-Based Sampling (IBS)</a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ </dl>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="ext-intro"></a>1. Introduction</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+The Extended Feature Interface is a standard callback interface
+designed to allow extension to the OProfile daemon's sample processing.
+Each feature defines a set of callback handlers which can be enabled or
+disabled through the OProfile daemon's command-line option.
+This interface can be used to implement support for architecture-specific
+features or features not commonly used by general OProfile users.
+</p>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="ext-name-and-handlers"></a>2. Feature Name and Handlers</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+Each extended feature has an entry in the <code class="varname">ext_feature_table</code>
+in <code class="filename">opd_extended.cpp</code>. Each entry contains a feature name,
+and a corresponding set of handlers. Feature name is a unique string, which is
+used to identify a feature in the table. Each feature provides a set
+of handlers, which will be executed by the OProfile daemon from pre-determined
+locations to perform certain tasks. At runtime, the OProfile daemon calls a feature
+handler wrapper from one of the predetermined locations to check whether
+an extended feature is enabled, and whether a particular handler exists.
+Only the handlers of the enabled feature will be executed.
+</p>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="ext-enable"></a>3. Enabling Features</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+Each feature is enabled using the OProfile daemon (oprofiled) command-line
+option "--ext-feature=&lt;extended-feature-name&gt;:[args]". The
+"extended-feature-name" is used to determine the feature to be enabled.
+The optional "args" is passed into the feature-specific initialization handler
+(<code class="function">ext_init</code>). Currently, only one extended feature can be
+enabled at a time.
+</p>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="ext-types-of-handlers"></a>4. Type of Handlers</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+Each feature is responsible for providing its own set of handlers.
+Types of handler are:
+</p>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="ext_init"></a>4.1. ext_init Handler</h3>
+ </div>
+ </div>
+ </div>
+ <p>
+"ext_init" handles initialization of an extended feature. It takes
+"args" parameter which is passed in through the "oprofiled --ext-feature=&lt;
+extended-feature-name&gt;:[args]". This handler is executed in the function
+<code class="function">opd_options()</code> in the file <code class="filename">daemon/oprofiled.c
+</code>.
+</p>
+ <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
+ <h3 class="title">Note</h3>
+ <p>
+The ext_init handler is required for all features.
+</p>
+ </div>
+ </div>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="ext_print_stats"></a>4.2. ext_print_stats Handler</h3>
+ </div>
+ </div>
+ </div>
+ <p>
+"ext_print_stats" handles the extended feature statistics report. It adds
+a new section in the OProfile daemon statistics report, which is normally
+outputed to the file
+<code class="filename">/var/lib/oprofile/samples/oprofiled.log</code>.
+This handler is executed in the function <code class="function">opd_print_stats()</code>
+in the file <code class="filename">daemon/opd_stats.c</code>.
+</p>
+ </div>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="ext_sfile_handlers"></a>4.3. ext_sfile Handler</h3>
+ </div>
+ </div>
+ </div>
+ <p>
+"ext_sfile" contains a set of handlers related to operations on the extended
+sample files (sample files for events related to extended feature).
+These operations include <code class="function">create_sfile()</code>,
+<code class="function">sfile_dup()</code>, <code class="function">close_sfile()</code>,
+<code class="function">sync_sfile()</code>, and <code class="function">get_file()</code>
+as defined in <code class="filename">daemon/opd_sfile.c</code>.
+An additional field, <code class="varname">odb_t * ext_file</code>, is added to the
+<code class="varname">struct sfile</code> for storing extended sample files
+information.
+
+</p>
+ </div>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="ext-implementation"></a>5. Extended Feature Reference Implementation</h2>
+ </div>
+ </div>
+ </div>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="ext-ibs"></a>5.1. Instruction-Based Sampling (IBS)</h3>
+ </div>
+ </div>
+ </div>
+ <p>
+An example of extended feature implementation can be seen by
+examining the AMD Instruction-Based Sampling support.
+</p>
+ <div class="sect3" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h4 class="title"><a id="ibs-init"></a>5.1.1. IBS Initialization</h4>
+ </div>
+ </div>
+ </div>
+ <p>
+Instruction-Based Sampling (IBS) is a new performance measurement technique
+available on AMD Family 10h processors. Enabling IBS profiling is done simply
+by specifying IBS performance events through the "--event=" options.
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+opcontrol --event=IBS_FETCH_XXX:&lt;count&gt;:&lt;um&gt;:&lt;kernel&gt;:&lt;user&gt;
+opcontrol --event=IBS_OP_XXX:&lt;count&gt;:&lt;um&gt;:&lt;kernel&gt;:&lt;user&gt;
+
+Note: * Count and unitmask for all IBS fetch events must be the same,
+ as do those for IBS op.
+</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+IBS performance events are listed in <code class="function">opcontrol --list-events</code>.
+When users specify these events, opcontrol verifies them using ophelp, which
+checks for the <code class="varname">ext:ibs_fetch</code> or <code class="varname">ext:ibs_op</code>
+tag in <code class="filename">events/x86-64/family10/events</code> file.
+Then, it configures the driver interface (/dev/oprofile/ibs_fetch/... and
+/dev/oprofile/ibs_op/...) and starts the OProfile daemon as follows.
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+oprofiled \
+ --ext-feature=ibs:\
+ fetch:&lt;IBS_FETCH_EVENT1&gt;,&lt;IBS_FETCH_EVENT2&gt;,...,:&lt;IBS fetch count&gt;:&lt;IBS Fetch um&gt;|\
+ op:&lt;IBS_OP_EVENT1&gt;,&lt;IBS_OP_EVENT2&gt;,...,:&lt;IBS op count&gt;:&lt;IBS op um&gt;
+</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+Here, the OProfile daemon parses the <code class="varname">--ext-feature</code>
+option and checks the feature name ("ibs") before calling the
+the initialization function to handle the string
+containing IBS events, counts, and unitmasks.
+Then, it stores each event in the IBS virtual-counter table
+(<code class="varname">struct opd_event ibs_vc[OP_MAX_IBS_COUNTERS]</code>) and
+stores the event index in the IBS Virtual Counter Index (VCI) map
+(<code class="varname">ibs_vci_map[OP_MAX_IBS_COUNTERS]</code>) with IBS event value
+as the map key.
+</p>
+ </div>
+ <div class="sect3" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h4 class="title"><a id="ibs-data-processing"></a>5.1.2. IBS Data Processing</h4>
+ </div>
+ </div>
+ </div>
+ <p>
+During a profile session, the OProfile daemon identifies IBS samples in the
+event buffer using the <code class="varname">"IBS_FETCH_CODE"</code> or
+<code class="varname">"IBS_OP_CODE"</code>. These codes trigger the handlers
+<code class="function">code_ibs_fetch_sample()</code> or
+<code class="function">code_ibs_op_sample()</code> listed in the
+<code class="varname">handler_t handlers[]</code> vector in
+<code class="filename">daemon/opd_trans.c </code>. These handlers are responsible for
+processing IBS samples and translate them into IBS performance events.
+</p>
+ <p>
+Unlike traditional performance events, each IBS sample can be derived into
+multiple IBS performance events. For each event that the user specifies,
+a combination of bits from Model-Specific Registers (MSR) are checked
+against the bitmask defining the event. If the condition is met, the event
+will then be recorded. The derivation logic is in the files
+<code class="filename">daemon/opd_ibs_macro.h</code> and
+<code class="filename">daemon/opd_ibs_trans.[h,c]</code>.
+</p>
+ </div>
+ <div class="sect3" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h4 class="title"><a id="ibs-sample-file"></a>5.1.3. IBS Sample File</h4>
+ </div>
+ </div>
+ </div>
+ <p>
+Traditionally, sample file information <code class="varname">(odb_t)</code> is stored
+in the <code class="varname">struct sfile::odb_t file[OP_MAX_COUNTER]</code>.
+Currently, <code class="varname">OP_MAX_COUNTER</code> is 8 on non-alpha, and 20 on
+alpha-based system. Event index (the counter number on which the event
+is configured) is used to access the corresponding entry in the array.
+Unlike the traditional performance event, IBS does not use the actual
+counter registers (i.e. <code class="filename">/dev/oprofile/0,1,2,3</code>).
+Also, the number of performance events generated by IBS could be larger than
+<code class="varname">OP_MAX_COUNTER</code> (currently upto 13 IBS-fetch and 46 IBS-op
+events). Therefore IBS requires a special data structure and sfile
+handlers (<code class="varname">struct opd_ext_sfile_handlers</code>) for managing
+IBS sample files. IBS-sample-file information is stored in a memory
+allocated by handler <code class="function">ibs_sfile_create()</code>, which can
+be accessed through <code class="varname">struct sfile::odb_t * ext_files</code>.
+</p>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="glossary">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title"><a id="glossary"></a>Glossary of OProfile source concepts and types</h2>
+ </div>
+ </div>
+ </div>
+ <dl>
+ <dt>application image</dt>
+ <dd>
+ <p>
+The primary binary image used by an application. This is derived
+from the kernel and corresponds to the binary started upon running
+an application: for example, <code class="filename">/bin/bash</code>.
+</p>
+ </dd>
+ <dt>binary image</dt>
+ <dd>
+ <p>
+An ELF file containing executable code: this includes kernel modules,
+the kernel itself (a.k.a. <code class="filename">vmlinux</code>), shared libraries,
+and application binaries.
+</p>
+ </dd>
+ <dt>dcookie</dt>
+ <dd>
+ <p>
+Short for "dentry cookie". A unique ID that can be looked up to provide
+the full path name of a binary image.
+</p>
+ </dd>
+ <dt>dependent image</dt>
+ <dd>
+ <p>
+A binary image that is dependent upon an application, used with
+per-application separation. Most commonly, shared libraries. For example,
+if <code class="filename">/bin/bash</code> is running and we take
+some samples inside the C library itself due to <span><strong class="command">bash</strong></span>
+calling library code, then the image <code class="filename">/lib/libc.so</code>
+would be dependent upon <code class="filename">/bin/bash</code>.
+</p>
+ </dd>
+ <dt>merging</dt>
+ <dd>
+ <p>
+This refers to the ability to merge several distinct sample files
+into one set of data at runtime, in the post-profiling tools. For example,
+per-thread sample files can be merged into one set of data, because
+they are compatible (i.e. the aggregation of the data is meaningful),
+but it's not possible to merge sample files for two different events,
+because there would be no useful meaning to the results.
+</p>
+ </dd>
+ <dt>profile class</dt>
+ <dd>
+ <p>
+A collection of profile data that has been collected under the same
+class template. For example, if we're using <span><strong class="command">opreport</strong></span>
+to show results after profiling with two performance counters enabled
+profiling <code class="constant">DATA_MEM_REFS</code> and <code class="constant">CPU_CLK_UNHALTED</code>,
+there would be two profile classes, one for each event. Or if we're on
+an SMP system and doing per-cpu profiling, and we request
+<span><strong class="command">opreport</strong></span> to show results for each CPU side-by-side,
+there would be a profile class for each CPU.
+</p>
+ </dd>
+ <dt>profile specification</dt>
+ <dd>
+ <p>
+The parameters the user passes to the post-profiling tools that limit
+what sample files are used. This specification is matched against
+the available sample files to generate a selection of profile data.
+</p>
+ </dd>
+ <dt>profile template</dt>
+ <dd>
+ <p>
+The parameters that define what goes in a particular profile class.
+This includes a symbolic name (e.g. "cpu:1") and the code-usable
+equivalent.
+</p>
+ </dd>
+ </dl>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/doc/internals.xml b/doc/internals.xml
new file mode 100644
index 0000000..a7feac7
--- /dev/null
+++ b/doc/internals.xml
@@ -0,0 +1,1194 @@
+<?xml version="1.0" encoding='ISO-8859-1'?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
+
+<book id="oprofile-internals">
+<bookinfo>
+ <title>OProfile Internals</title>
+
+ <authorgroup>
+ <author>
+ <firstname>John</firstname>
+ <surname>Levon</surname>
+ <affiliation>
+ <address><email>levon@movementarian.org</email></address>
+ </affiliation>
+ </author>
+ </authorgroup>
+
+ <copyright>
+ <year>2003</year>
+ <holder>John Levon</holder>
+ </copyright>
+</bookinfo>
+
+<toc></toc>
+
+<chapter id="introduction">
+<title>Introduction</title>
+
+<para>
+This document is current for OProfile version <oprofileversion />.
+This document provides some details on the internal workings of OProfile for the
+interested hacker. This document assumes strong C, working C++, plus some knowledge of
+kernel internals and CPU hardware.
+</para>
+<note>
+<para>
+Only the "new" implementation associated with kernel 2.6 and above is covered here. 2.4
+uses a very different kernel module implementation and daemon to produce the sample files.
+</para>
+</note>
+
+<sect1 id="overview">
+<title>Overview</title>
+<para>
+OProfile is a statistical continuous profiler. In other words, profiles are generated by
+regularly sampling the current registers on each CPU (from an interrupt handler, the
+saved PC value at the time of interrupt is stored), and converting that runtime PC
+value into something meaningful to the programmer.
+</para>
+<para>
+OProfile achieves this by taking the stream of sampled PC values, along with the detail
+of which task was running at the time of the interrupt, and converting into a file offset
+against a particular binary file. Because applications <function>mmap()</function>
+the code they run (be it <filename>/bin/bash</filename>, <filename>/lib/libfoo.so</filename>
+or whatever), it's possible to find the relevant binary file and offset by walking
+the task's list of mapped memory areas. Each PC value is thus converted into a tuple
+of binary-image,offset. This is something that the userspace tools can use directly
+to reconstruct where the code came from, including the particular assembly instructions,
+symbol, and source line (via the binary's debug information if present).
+</para>
+<para>
+Regularly sampling the PC value like this approximates what actually was executed and
+how often - more often than not, this statistical approximation is good enough to
+reflect reality. In common operation, the time between each sample interrupt is regulated
+by a fixed number of clock cycles. This implies that the results will reflect where
+the CPU is spending the most time; this is obviously a very useful information source
+for performance analysis.
+</para>
+<para>
+Sometimes though, an application programmer needs different kinds of information: for example,
+"which of the source routines cause the most cache misses ?". The rise in importance of
+such metrics in recent years has led many CPU manufacturers to provide hardware performance
+counters capable of measuring these events on the hardware level. Typically, these counters
+increment once per each event, and generate an interrupt on reaching some pre-defined
+number of events. OProfile can use these interrupts to generate samples: then, the
+profile results are a statistical approximation of which code caused how many of the
+given event.
+</para>
+<para>
+Consider a simplified system that only executes two functions A and B. A
+takes one cycle to execute, whereas B takes 99 cycles. Imagine we run at
+100 cycles a second, and we've set the performance counter to create an
+interrupt after a set number of "events" (in this case an event is one
+clock cycle). It should be clear that the chances of the interrupt
+occurring in function A is 1/100, and 99/100 for function B. Thus, we
+statistically approximate the actual relative performance features of
+the two functions over time. This same analysis works for other types of
+events, providing that the interrupt is tied to the number of events
+occurring (that is, after N events, an interrupt is generated).
+</para>
+<para>
+There are typically more than one of these counters, so it's possible to set up profiling
+for several different event types. Using these counters gives us a powerful, low-overhead
+way of gaining performance metrics. If OProfile, or the CPU, does not support performance
+counters, then a simpler method is used: the kernel timer interrupt feeds samples
+into OProfile itself.
+</para>
+<para>
+The rest of this document concerns itself with how we get from receiving samples at
+interrupt time to producing user-readable profile information.
+</para>
+</sect1>
+
+<sect1 id="components">
+<title>Components of the OProfile system</title>
+
+<sect2 id="arch-specific-components">
+<title>Architecture-specific components</title>
+<para>
+If OProfile supports the hardware performance counters found on
+a particular architecture, code for managing the details of setting
+up and managing these counters can be found in the kernel source
+tree in the relevant <filename>arch/<emphasis>arch</emphasis>/oprofile/</filename>
+directory. The architecture-specific implementation works via
+filling in the oprofile_operations structure at init time. This
+provides a set of operations such as <function>setup()</function>,
+<function>start()</function>, <function>stop()</function>, etc.
+that manage the hardware-specific details of fiddling with the
+performance counter registers.
+</para>
+<para>
+The other important facility available to the architecture code is
+<function>oprofile_add_sample()</function>. This is where a particular sample
+taken at interrupt time is fed into the generic OProfile driver code.
+</para>
+</sect2>
+
+<sect2 id="filesystem">
+<title>oprofilefs</title>
+<para>
+OProfile implements a pseudo-filesystem known as "oprofilefs", mounted from
+userspace at <filename>/dev/oprofile</filename>. This consists of small
+files for reporting and receiving configuration from userspace, as well
+as the actual character device that the OProfile userspace receives samples
+from. At <function>setup()</function> time, the architecture-specific may
+add further configuration files related to the details of the performance
+counters. For example, on x86, one numbered directory for each hardware
+performance counter is added, with files in each for the event type,
+reset value, etc.
+</para>
+<para>
+The filesystem also contains a <filename>stats</filename> directory with
+a number of useful counters for various OProfile events.
+</para>
+</sect2>
+
+<sect2 id="driver">
+<title>Generic kernel driver</title>
+<para>
+This lives in <filename>drivers/oprofile/</filename>, and forms the core of
+how OProfile works in the kernel. Its job is to take samples delivered
+from the architecture-specific code (via <function>oprofile_add_sample()</function>),
+and buffer this data, in a transformed form as described later, until releasing
+the data to the userspace daemon via the <filename>/dev/oprofile/buffer</filename>
+character device.
+</para>
+</sect2>
+
+<sect2 id="daemon">
+<title>The OProfile daemon</title>
+<para>
+The OProfile userspace daemon's job is to take the raw data provided by the
+kernel and write it to the disk. It takes the single data stream from the
+kernel and logs sample data against a number of sample files (found in
+<filename>$SESSION_DIR/samples/current/</filename>, by default located at
+<filename>/var/lib/oprofile/samples/current/</filename>. For the benefit
+of the "separate" functionality, the names/paths of these sample files
+are mangled to reflect where the samples were from: this can include
+thread IDs, the binary file path, the event type used, and more.
+</para>
+<para>
+After this final step from interrupt to disk file, the data is now
+persistent (that is, changes in the running of the system do not invalidate
+stored data). So the post-profiling tools can run on this data at any
+time (assuming the original binary files are still available and unchanged,
+naturally).
+</para>
+</sect2>
+
+<sect2 id="post-profiling">
+<title>Post-profiling tools</title>
+So far, we've collected data, but we've yet to present it in a useful form
+to the user. This is the job of the post-profiling tools. In general form,
+they collate a subset of the available sample files, load and process each one
+correlated against the relevant binary file, and finally produce user-readable
+information.
+</sect2>
+
+</sect1>
+
+</chapter>
+
+<chapter id="performance-counters">
+<title>Performance counter management</title>
+
+<sect1 id ="performance-counters-ui">
+<title>Providing a user interface</title>
+
+<para>
+The performance counter registers need programming in order to set the
+type of event to count, etc. OProfile uses a standard model across all
+CPUs for defining these events as follows :
+</para>
+<informaltable frame="all">
+<tgroup cols='2'>
+<tbody>
+<row><entry><option>event</option></entry><entry>The event type e.g. DATA_MEM_REFS</entry></row>
+<row><entry><option>unit mask</option></entry><entry>The sub-events to count (more detailed specification)</entry></row>
+<row><entry><option>counter</option></entry><entry>The hardware counter(s) that can count this event</entry></row>
+<row><entry><option>count</option></entry><entry>The reset value (how many events before an interrupt)</entry></row>
+<row><entry><option>kernel</option></entry><entry>Whether the counter should increment when in kernel space</entry></row>
+<row><entry><option>user</option></entry><entry>Whether the counter should increment when in user space</entry></row>
+</tbody>
+</tgroup>
+</informaltable>
+<para>
+The term "unit mask" is borrowed from the Intel architectures, and can
+further specify exactly when a counter is incremented (for example,
+cache-related events can be restricted to particular state transitions
+of the cache lines).
+</para>
+<para>
+All of the available hardware events and their details are specified in
+the textual files in the <filename>events</filename> directory. The
+syntax of these files should be fairly obvious. The user specifies the
+names and configuration details of the chosen counters via
+<command>opcontrol</command>. These are then written to the kernel
+module (in numerical form) via <filename>/dev/oprofile/N/</filename>
+where N is the physical hardware counter (some events can only be used
+on specific counters; OProfile hides these details from the user when
+possible). On IA64, the perfmon-based interface behaves somewhat
+differently, as described later.
+</para>
+
+</sect1>
+
+<sect1 id="performance-counters-programming">
+<title>Programming the performance counter registers</title>
+
+<para>
+We have described how the user interface fills in the desired
+configuration of the counters and transmits the information to the
+kernel. It is the job of the <function>-&gt;setup()</function> method
+to actually program the performance counter registers. Clearly, the
+details of how this is done is architecture-specific; it is also
+model-specific on many architectures. For example, i386 provides methods
+for each model type that programs the counter registers correctly
+(see the <filename>op_model_*</filename> files in
+<filename>arch/i386/oprofile</filename> for the details). The method
+reads the values stored in the virtual oprofilefs files and programs
+the registers appropriately, ready for starting the actual profiling
+session.
+</para>
+<para>
+The architecture-specific drivers make sure to save the old register
+settings before doing OProfile setup. They are restored when OProfile
+shuts down. This is useful, for example, on i386, where the NMI watchdog
+uses the same performance counter registers as OProfile; they cannot
+run concurrently, but OProfile makes sure to restore the setup it found
+before it was running.
+</para>
+<para>
+In addition to programming the counter registers themselves, other setup
+is often necessary. For example, on i386, the local APIC needs
+programming in order to make the counter's overflow interrupt appear as
+an NMI (non-maskable interrupt). This allows sampling (and therefore
+profiling) of regions where "normal" interrupts are masked, enabling
+more reliable profiles.
+</para>
+
+<sect2 id="performance-counters-start">
+<title>Starting and stopping the counters</title>
+<para>
+Initiating a profiling session is done via writing an ASCII '1'
+to the file <filename>/dev/oprofile/enable</filename>. This sets up the
+core, and calls into the architecture-specific driver to actually
+enable each configured counter. Again, the details of how this is
+done is model-specific (for example, the Athlon models can disable
+or enable on a per-counter basis, unlike the PPro models).
+</para>
+</sect2>
+
+<sect2>
+<title>IA64 and perfmon</title>
+<para>
+The IA64 architecture provides a different interface from the other
+architectures, using the existing perfmon driver. Register programming
+is handled entirely in user-space (see
+<filename>daemon/opd_perfmon.c</filename> for the details). A process
+is forked for each CPU, which creates a perfmon context and sets the
+counter registers appropriately via the
+<function>sys_perfmonctl</function> interface. In addition, the actual
+initiation and termination of the profiling session is handled via the
+same interface using <constant>PFM_START</constant> and
+<constant>PFM_STOP</constant>. On IA64, then, there are no oprofilefs
+files for the performance counters, as the kernel driver does not
+program the registers itself.
+</para>
+<para>
+Instead, the perfmon driver for OProfile simply registers with the
+OProfile core with an OProfile-specific UUID. During a profiling
+session, the perfmon core calls into the OProfile perfmon driver and
+samples are registered with the OProfile core itself as usual (with
+<function>oprofile_add_sample()</function>).
+</para>
+</sect2>
+
+</sect1>
+
+</chapter>
+
+<chapter id="collecting-samples">
+<title>Collecting and processing samples</title>
+
+<sect1 id="receiving-interrupts">
+<title>Receiving interrupts</title>
+<para>
+Naturally, how the overflow interrupts are received is specific
+to the hardware architecture, unless we are in "timer" mode, where the
+logging routine is called directly from the standard kernel timer
+interrupt handler.
+</para>
+<para>
+On the i386 architecture, the local APIC is programmed such that when a
+counter overflows (that is, it receives an event that causes an integer
+overflow of the register value to zero), an NMI is generated. This calls
+into the general handler <function>do_nmi()</function>; because OProfile
+has registered itself as capable of handling NMI interrupts, this will
+call into the OProfile driver code in
+<filename>arch/i386/oprofile</filename>. Here, the saved PC value (the
+CPU saves the register set at the time of interrupt on the stack
+available for inspection) is extracted, and the counters are examined to
+find out which one generated the interrupt. Also determined is whether
+the system was inside kernel or user space at the time of the interrupt.
+These three pieces of information are then forwarded onto the OProfile
+core via <function>oprofile_add_sample()</function>. Finally, the
+counter values are reset to the chosen count value, to ensure another
+interrupt happens after another N events have occurred. Other
+architectures behave in a similar manner.
+</para>
+</sect1>
+
+<sect1 id="core-structure">
+<title>Core data structures</title>
+<para>
+Before considering what happens when we log a sample, we shall digress
+for a moment and look at the general structure of the data collection
+system.
+</para>
+<para>
+OProfile maintains a small buffer for storing the logged samples for
+each CPU on the system. Only this buffer is altered when we actually log
+a sample (remember, we may still be in an NMI context, so no locking is
+possible). The buffer is managed by a two-handed system; the "head"
+iterator dictates where the next sample data should be placed in the
+buffer. Of course, overflow of the buffer is possible, in which case
+the sample is discarded.
+</para>
+<para>
+It is critical to remember that at this point, the PC value is an
+absolute value, and is therefore only meaningful in the context of which
+task it was logged against. Thus, these per-CPU buffers also maintain
+details of which task each logged sample is for, as described in the
+next section. In addition, we store whether the sample was in kernel
+space or user space (on some architectures and configurations, the address
+space is not sub-divided neatly at a specific PC value, so we must store
+this information).
+</para>
+<para>
+As well as these small per-CPU buffers, we have a considerably larger
+single buffer. This holds the data that is eventually copied out into
+the OProfile daemon. On certain system events, the per-CPU buffers are
+processed and entered (in mutated form) into the main buffer, known in
+the source as the "event buffer". The "tail" iterator indicates the
+point from which the CPU may be read, up to the position of the "head"
+iterator. This provides an entirely lock-free method for extracting data
+from the CPU buffers. This process is described in detail later in this chapter.
+</para>
+<figure><title>The OProfile buffers</title>
+<graphic fileref="buffers.png" />
+</figure>
+</sect1>
+
+<sect1 id="logging-sample">
+<title>Logging a sample</title>
+<para>
+As mentioned, the sample is logged into the buffer specific to the
+current CPU. The CPU buffer is a simple array of pairs of unsigned long
+values; for a sample, they hold the PC value and the counter for the
+sample. (The counter value is later used to translate back into the relevant
+event type the counter was programmed to).
+</para>
+<para>
+In addition to logging the sample itself, we also log task switches.
+This is simply done by storing the address of the last task to log a
+sample on that CPU in a data structure, and writing a task switch entry
+into the buffer if the new value of <function>current()</function> has
+changed. Note that later we will directly de-reference this pointer;
+this imposes certain restrictions on when and how the CPU buffers need
+to be processed.
+</para>
+<para>
+Finally, as mentioned, we log whether we have changed between kernel and
+userspace using a similar method. Both of these variables
+(<varname>last_task</varname> and <varname>last_is_kernel</varname>) are
+reset when the CPU buffer is read.
+</para>
+</sect1>
+
+<sect1 id="logging-stack">
+<title>Logging stack traces</title>
+<para>
+OProfile can also provide statistical samples of call chains (on x86). To
+do this, at sample time, the frame pointer chain is traversed, recording
+the return address for each stack frame. This will only work if the code
+was compiled with frame pointers, but we're careful to abort the
+traversal if the frame pointer appears bad. We store the set of return
+addresses straight into the CPU buffer. Note that, since this traversal
+is keyed off the standard sample interrupt, the number of times a
+function appears in a stack trace is not an indicator of how many times
+the call site was executed: rather, it's related to the number of
+samples we took where that call site was involved. Thus, the results for
+stack traces are not necessarily proportional to the call counts:
+typical programs will have many <function>main()</function> samples.
+</para>
+</sect1>
+
+<sect1 id="synchronising-buffers">
+<title>Synchronising the CPU buffers to the event buffer</title>
+<!-- FIXME: update when percpu patch goes in -->
+<para>
+At some point, we have to process the data in each CPU buffer and enter
+it into the main (event) buffer. The file
+<filename>buffer_sync.c</filename> contains the relevant code. We
+periodically (currently every <constant>HZ</constant>/4 jiffies) start
+the synchronisation process. In addition, we process the buffers on
+certain events, such as an application calling
+<function>munmap()</function>. This is particularly important for
+<function>exit()</function> - because the CPU buffers contain pointers
+to the task structure, if we don't process all the buffers before the
+task is actually destroyed and the task structure freed, then we could
+end up trying to dereference a bogus pointer in one of the CPU buffers.
+</para>
+<para>
+We also add a notification when a kernel module is loaded; this is so
+that user-space can re-read <filename>/proc/modules</filename> to
+determine the load addresses of kernel module text sections. Without
+this notification, samples for a newly-loaded module could get lost or
+be attributed to the wrong module.
+</para>
+<para>
+The synchronisation itself works in the following manner: first, mutual
+exclusion on the event buffer is taken. Remember, we do not need to do
+that for each CPU buffer, as we only read from the tail iterator (whilst
+interrupts might be arriving at the same buffer, but they will write to
+the position of the head iterator, leaving previously written entries
+intact). Then, we process each CPU buffer in turn. A CPU switch
+notification is added to the buffer first (for
+<option>--separate=cpu</option> support). Then the processing of the
+actual data starts.
+</para>
+<para>
+As mentioned, the CPU buffer consists of task switch entries and the
+actual samples. When the routine <function>sync_buffer()</function> sees
+a task switch, the process ID and process group ID are recorded into the
+event buffer, along with a dcookie (see below) identifying the
+application binary (e.g. <filename>/bin/bash</filename>). The
+<varname>mmap_sem</varname> for the task is then taken, to allow safe
+iteration across the tasks' list of mapped areas. Each sample is then
+processed as described in the next section.
+</para>
+<para>
+After a buffer has been read, the tail iterator is updated to reflect
+how much of the buffer was processed. Note that when we determined how
+much data there was to read in the CPU buffer, we also called
+<function>cpu_buffer_reset()</function> to reset
+<varname>last_task</varname> and <varname>last_is_kernel</varname>, as
+we've already mentioned. During the processing, more samples may have
+been arriving in the CPU buffer; this is OK because we are careful to
+only update the tail iterator to how much we actually read - on the next
+buffer synchronisation, we will start again from that point.
+</para>
+</sect1>
+
+<sect1 id="dentry-cookies">
+<title>Identifying binary images</title>
+<para>
+In order to produce useful profiles, we need to be able to associate a
+particular PC value sample with an actual ELF binary on the disk. This
+leaves us with the problem of how to export this information to
+user-space. We create unique IDs that identify a particular directory
+entry (dentry), and write those IDs into the event buffer. Later on,
+the user-space daemon can call the <function>lookup_dcookie</function>
+system call, which looks up the ID and fills in the full path of
+the binary image in the buffer user-space passes in. These IDs are
+maintained by the code in <filename>fs/dcookies.c</filename>; the
+cache lasts for as long as the daemon has the event buffer open.
+</para>
+</sect1>
+
+<sect1 id="finding-dentry">
+<title>Finding a sample's binary image and offset</title>
+<para>
+We haven't yet described how we process the absolute PC value into
+something usable by the user-space daemon. When we find a sample entered
+into the CPU buffer, we traverse the list of mappings for the task
+(remember, we will have seen a task switch earlier, so we know which
+task's lists to look at). When a mapping is found that contains the PC
+value, we look up the mapped file's dentry in the dcookie cache. This
+gives the dcookie ID that will uniquely identify the mapped file. Then
+we alter the absolute value such that it is an offset from the start of
+the file being mapped (the mapping need not start at the start of the
+actual file, so we have to consider the offset value of the mapping). We
+store this dcookie ID into the event buffer; this identifies which
+binary the samples following it are against.
+In this manner, we have converted a PC value, which has transitory
+meaning only, into a static offset value for later processing by the
+daemon.
+</para>
+<para>
+We also attempt to avoid the relatively expensive lookup of the dentry
+cookie value by storing the cookie value directly into the dentry
+itself; then we can simply derive the cookie value immediately when we
+find the correct mapping.
+</para>
+</sect1>
+
+</chapter>
+
+<chapter id="sample-files">
+<title>Generating sample files</title>
+
+<sect1 id="processing-buffer">
+<title>Processing the buffer</title>
+
+<para>
+Now we can move onto user-space in our description of how raw interrupt
+samples are processed into useful information. As we described in
+previous sections, the kernel OProfile driver creates a large buffer of
+sample data consisting of offset values, interspersed with
+notification of changes in context. These context changes indicate how
+following samples should be attributed, and include task switches, CPU
+changes, and which dcookie the sample value is against. By processing
+this buffer entry-by-entry, we can determine where the samples should
+be accredited to. This is particularly important when using the
+<option>--separate</option>.
+</para>
+<para>
+The file <filename>daemon/opd_trans.c</filename> contains the basic routine
+for the buffer processing. The <varname>struct transient</varname>
+structure is used to hold changes in context. Its members are modified
+as we process each entry; it is passed into the routines in
+<filename>daemon/opd_sfile.c</filename> for actually logging the sample
+to a particular sample file (which will be held in
+<filename>$SESSION_DIR/samples/current</filename>).
+</para>
+<para>
+The buffer format is designed for conciseness, as high sampling rates
+can easily generate a lot of data. Thus, context changes are prefixed
+by an escape code, identified by <function>is_escape_code()</function>.
+If an escape code is found, the next entry in the buffer identifies
+what type of context change is being read. These are handed off to
+various handlers (see the <varname>handlers</varname> array), which
+modify the transient structure as appropriate. If it's not an escape
+code, then it must be a PC offset value, and the very next entry will
+be the numeric hardware counter. These values are read and recorded
+in the transient structure; we then do a lookup to find the correct
+sample file, and log the sample, as described in the next section.
+</para>
+
+<sect2 id="handling-kernel-samples">
+<title>Handling kernel samples</title>
+
+<para>
+Samples from kernel code require a little special handling. Because
+the binary text which the sample is against does not correspond to
+any file that the kernel directly knows about, the OProfile driver
+stores the absolute PC value in the buffer, instead of the file offset.
+Of course, we need an offset against some particular binary. To handle
+this, we keep a list of loaded modules by parsing
+<filename>/proc/modules</filename> as needed. When a module is loaded,
+a notification is placed in the OProfile buffer, and this triggers a
+re-read. We store the module name, and the loading address and size.
+This is also done for the main kernel image, as specified by the user.
+The absolute PC value is matched against each address range, and
+modified into an offset when the matching module is found. See
+<filename>daemon/opd_kernel.c</filename> for the details.
+</para>
+
+</sect2>
+
+
+</sect1>
+
+<sect1 id="sample-file-generation">
+<title>Locating and creating sample files</title>
+
+<para>
+We have a sample value and its satellite data stored in a
+<varname>struct transient</varname>, and we must locate an
+actual sample file to store the sample in, using the context
+information in the transient structure as a key. The transient data to
+sample file lookup is handled in
+<filename>daemon/opd_sfile.c</filename>. A hash is taken of the
+transient values that are relevant (depending upon the setting of
+<option>--separate</option>, some values might be irrelevant), and the
+hash value is used to lookup the list of currently open sample files.
+Of course, the sample file might not be found, in which case we need
+to create and open it.
+</para>
+<para>
+OProfile uses a rather complex scheme for naming sample files, in order
+to make selecting relevant sample files easier for the post-profiling
+utilities. The exact details of the scheme are given in
+<filename>oprofile-tests/pp_interface</filename>, but for now it will
+suffice to remember that the filename will include only relevant
+information for the current settings, taken from the transient data. A
+fully-specified filename looks something like :
+</para>
+<computeroutput>
+/var/lib/oprofile/samples/current/{root}/usr/bin/xmms/{dep}/{root}/lib/tls/libc-2.3.2.so/CPU_CLK_UNHALTED.100000.0.28082.28089.0
+</computeroutput>
+<para>
+It should be clear that this identifies such information as the
+application binary, the dependent (library) binary, the hardware event,
+and the process and thread ID. Typically, not all this information is
+needed, in which cases some values may be replaced with the token
+<filename>all</filename>.
+</para>
+<para>
+The code that generates this filename and opens the file is found in
+<filename>daemon/opd_mangling.c</filename>. You may have realised that
+at this point, we do not have the binary image file names, only the
+dcookie values. In order to determine a file name, a dcookie value is
+looked up in the dcookie cache. This is to be found in
+<filename>daemon/opd_cookie.c</filename>. Since dcookies are both
+persistent and unique during a sampling session, we can cache the
+values. If the value is not found in the cache, then we ask the kernel
+to do the lookup from value to file name for us by calling
+<function>lookup_dcookie()</function>. This looks up the value in a
+kernel-side cache (see <filename>fs/dcookies.c</filename>) and returns
+the fully-qualified file name to userspace.
+</para>
+
+</sect1>
+
+<sect1 id="sample-file-writing">
+<title>Writing data to a sample file</title>
+
+<para>
+Each specific sample file is a hashed collection, where the key is
+the PC offset from the transient data, and the value is the number of
+samples recorded against that offset. The files are
+<function>mmap()</function>ed into the daemon's memory space. The code
+to actually log the write against the sample file can be found in
+<filename>libdb/</filename>.
+</para>
+<para>
+For recording stack traces, we have a more complicated sample filename
+mangling scheme that allows us to identify cross-binary calls. We use
+the same sample file format, where the key is a 64-bit value composed
+from the from,to pair of offsets.
+</para>
+
+</sect1>
+
+</chapter>
+
+<chapter id="output">
+<title>Generating useful output</title>
+
+<para>
+All of the tools used to generate human-readable output have to take
+roughly the same steps to collect the data for processing. First, the
+profile specification given by the user has to be parsed. Next, a list
+of sample files matching the specification has to obtained. Using this
+list, we need to locate the binary file for each sample file, and then
+use them to extract meaningful data, before a final collation and
+presentation to the user.
+</para>
+
+<sect1 id="profile-specification">
+<title>Handling the profile specification</title>
+
+<para>
+The profile specification presented by the user is parsed in
+the function <function>profile_spec::create()</function>. This
+creates an object representing the specification. Then we
+use <function>profile_spec::generate_file_list()</function>
+to search for all sample files and match them against the
+<varname>profile_spec</varname>.
+</para>
+
+<para>
+To enable this matching process to work, the attributes of
+each sample file is encoded in its filename. This is a low-tech
+approach to matching specifications against candidate sample
+files, but it works reasonably well. A typical sample file
+might look like these:
+</para>
+<screen>
+/var/lib/oprofile/samples/current/{root}/bin/ls/{dep}/{root}/bin/ls/{cg}/{root}/bin/ls/CPU_CLK_UNHALTED.100000.0.all.all.all
+/var/lib/oprofile/samples/current/{root}/bin/ls/{dep}/{root}/bin/ls/CPU_CLK_UNHALTED.100000.0.all.all.all
+/var/lib/oprofile/samples/current/{root}/bin/ls/{dep}/{root}/bin/ls/CPU_CLK_UNHALTED.100000.0.7423.7424.0
+/var/lib/oprofile/samples/current/{kern}/r128/{dep}/{kern}/r128/CPU_CLK_UNHALTED.100000.0.all.all.all
+</screen>
+<para>
+This looks unnecessarily complex, but it's actually fairly simple. First
+we have the session of the sample, by default located here
+<filename>/var/lib/oprofile/samples/current</filename>. This location
+can be changed by specifying the --session-dir option at command-line.
+This session could equally well be inside an archive from <command>oparchive</command>.
+Next we have one of the tokens <filename>{root}</filename> or
+<filename>{kern}</filename>. <filename>{root}</filename> indicates
+that the binary is found on a file system, and we will encode its path
+in the next section (e.g. <filename>/bin/ls</filename>).
+<filename>{kern}</filename> indicates a kernel module - on 2.6 kernels
+the path information is not available from the kernel, so we have to
+special-case kernel modules like this; we encode merely the name of the
+module as loaded.
+</para>
+<para>
+Next there is a <filename>{dep}</filename> token, indicating another
+token/path which identifies the dependent binary image. This is used even for
+the "primary" binary (i.e. the one that was
+<function>execve()</function>d), as it simplifies processing. Finally,
+if this sample file is a normal flat profile, the actual file is next in
+the path. If it's a call-graph sample file, we need one further
+specification, to allow us to identify cross-binary arcs in the call
+graph.
+</para>
+<para>
+The actual sample file name is dot-separated, where the fields are, in
+order: event name, event count, unit mask, task group ID, task ID, and
+CPU number.
+</para>
+<para>
+This sample file can be reliably parsed (with
+<function>parse_filename()</function>) into a
+<varname>filename_spec</varname>. Finally, we can check whether to
+include the sample file in the final results by comparing this
+<varname>filename_spec</varname> against the
+<varname>profile_spec</varname> the user specified (for the interested,
+see <function>valid_candidate()</function> and
+<function>profile_spec::match</function>). Then comes the really
+complicated bit...
+</para>
+
+</sect1>
+
+<sect1 id="sample-file-collating">
+<title>Collating the candidate sample files</title>
+
+<para>
+At this point we have a duplicate-free list of sample files we need
+to process. But first we need to do some further arrangement: we
+need to classify each sample file, and we may also need to "invert"
+the profiles.
+</para>
+
+<sect2 id="sample-file-classifying">
+<title>Classifying sample files</title>
+
+<para>
+It's possible for utilities like <command>opreport</command> to show
+data in columnar format: for example, we might want to show the results
+of two threads within a process side-by-side. To do this, we need
+to classify each sample file into classes - the classes correspond
+with each <command>opreport</command> column. The function that handles
+this is <function>arrange_profiles()</function>. Each sample file
+is added to a particular class. If the sample file is the first in
+its class, a template is generated from the sample file. Each template
+describes a particular class (thus, in our example above, each template
+will have a different thread ID, and this uniquely identifies each
+class).
+</para>
+
+<para>
+Each class has a list of "profile sets" matching that class's template.
+A profile set is either a profile of the primary binary image, or any of
+its dependent images. After all sample files have been listed in one of
+the profile sets belonging to the classes, we have to name each class and
+perform error-checking. This is done by
+<function>identify_classes()</function>; each class is checked to ensure
+that its "axis" is the same as all the others. This is needed because
+<command>opreport</command> can't produce results in 3D format: we can
+only differ in one aspect, such as thread ID or event name.
+</para>
+
+</sect2>
+
+<sect2 id="sample-file-inverting">
+<title>Creating inverted profile lists</title>
+
+<para>
+Remember that if we're using certain profile separation options, such as
+"--separate=lib", a single binary could be a dependent image to many
+different binaries. For example, the C library image would be a
+dependent image for most programs that have been profiled. As it
+happens, this can cause severe performance problems: without some
+re-arrangement, these dependent binary images would be opened each
+time we need to process sample files for each program.
+</para>
+
+<para>
+The solution is to "invert" the profiles via
+<function>invert_profiles()</function>. We create a new data structure
+where the dependent binary is first, and the primary binary images using
+that dependent binary are listed as sub-images. This helps our
+performance problem, as now we only need to open each dependent image
+once, when we process the list of inverted profiles.
+</para>
+
+</sect2>
+
+</sect1>
+
+<sect1 id="generating-profile-data">
+<title>Generating profile data</title>
+
+<para>
+Things don't get any simpler at this point, unfortunately. At this point
+we've collected and classified the sample files into the set of inverted
+profiles, as described in the previous section. Now we need to process
+each inverted profile and make something of the data. The entry point
+for this is <function>populate_for_image()</function>.
+</para>
+
+<sect2 id="bfd">
+<title>Processing the binary image</title>
+<para>
+The first thing we do with an inverted profile is attempt to open the
+binary image (remember each inverted profile set is only for one binary
+image, but may have many sample files to process). The
+<varname>op_bfd</varname> class provides an abstracted interface to
+this; internally it uses <filename>libbfd</filename>. The main purpose
+of this class is to process the symbols for the binary image; this is
+also where symbol filtering happens. This is actually quite tricky, but
+should be clear from the source.
+</para>
+</sect2>
+
+<sect2 id="processing-sample-files">
+<title>Processing the sample files</title>
+<para>
+The class <varname>profile_container</varname> is a hold-all that
+contains all the processed results. It is a container of
+<varname>profile_t</varname> objects. The
+<function>add_sample_files()</function> method uses
+<filename>libdb</filename> to open the given sample file and add the
+key/value types to the <varname>profile_t</varname>. Once this has been
+done, <function>profile_container::add()</function> is passed the
+<varname>profile_t</varname> plus the <varname>op_bfd</varname> for
+processing.
+</para>
+<para>
+<function>profile_container::add()</function> walks through the symbols
+collected in the <varname>op_bfd</varname>.
+<function>op_bfd::get_symbol_range()</function> gives us the start and
+end of the symbol as an offset from the start of the binary image,
+then we interrogate the <varname>profile_t</varname> for the relevant samples
+for that offset range. We create a <varname>symbol_entry</varname>
+object for this symbol and fill it in. If needed, here we also collect
+debug information from the <varname>op_bfd</varname>, and possibly
+record the detailed sample information (as used by <command>opreport
+-d</command> and <command>opannotate</command>).
+Finally the <varname>symbol_entry</varname> is added to
+a private container of <varname>profile_container</varname> - this
+<varname>symbol_container</varname> holds all such processed symbols.
+</para>
+</sect2>
+
+</sect1>
+
+<sect1 id="generating-output">
+<title>Generating output</title>
+
+<para>
+After the processing described in the previous section, we've now got
+full details of what we need to output stored in the
+<varname>profile_container</varname> on a symbol-by-symbol basis. To
+produce output, we need to replay that data and format it suitably.
+</para>
+<para>
+<command>opreport</command> first asks the
+<varname>profile_container</varname> for a
+<varname>symbol_collection</varname> (this is also where thresholding
+happens).
+This is sorted, then a
+<varname>opreport_formatter</varname> is initialised.
+This object initialises a set of field formatters as requested. Then
+<function>opreport_formatter::output()</function> is called. This
+iterates through the (sorted) <varname>symbol_collection</varname>;
+for each entry, the selected fields (as set by the
+<varname>format_flags</varname> options) are output by calling the
+field formatters, with the <varname>symbol_entry</varname> passed in.
+</para>
+
+</sect1>
+
+</chapter>
+
+<chapter id="ext">
+<title>Extended Feature Interface</title>
+
+<sect1 id="ext-intro">
+<title>Introduction</title>
+
+<para>
+The Extended Feature Interface is a standard callback interface
+designed to allow extension to the OProfile daemon's sample processing.
+Each feature defines a set of callback handlers which can be enabled or
+disabled through the OProfile daemon's command-line option.
+This interface can be used to implement support for architecture-specific
+features or features not commonly used by general OProfile users.
+</para>
+
+</sect1>
+
+<sect1 id="ext-name-and-handlers">
+<title>Feature Name and Handlers</title>
+
+<para>
+Each extended feature has an entry in the <varname>ext_feature_table</varname>
+in <filename>opd_extended.cpp</filename>. Each entry contains a feature name,
+and a corresponding set of handlers. Feature name is a unique string, which is
+used to identify a feature in the table. Each feature provides a set
+of handlers, which will be executed by the OProfile daemon from pre-determined
+locations to perform certain tasks. At runtime, the OProfile daemon calls a feature
+handler wrapper from one of the predetermined locations to check whether
+an extended feature is enabled, and whether a particular handler exists.
+Only the handlers of the enabled feature will be executed.
+</para>
+
+</sect1>
+
+<sect1 id="ext-enable">
+<title>Enabling Features</title>
+
+<para>
+Each feature is enabled using the OProfile daemon (oprofiled) command-line
+option "--ext-feature=&lt;extended-feature-name&gt;:[args]". The
+"extended-feature-name" is used to determine the feature to be enabled.
+The optional "args" is passed into the feature-specific initialization handler
+(<function>ext_init</function>). Currently, only one extended feature can be
+enabled at a time.
+</para>
+
+</sect1>
+
+<sect1 id="ext-types-of-handlers">
+<title>Type of Handlers</title>
+
+<para>
+Each feature is responsible for providing its own set of handlers.
+Types of handler are:
+</para>
+
+<sect2 id="ext_init">
+<title>ext_init Handler</title>
+
+<para>
+"ext_init" handles initialization of an extended feature. It takes
+"args" parameter which is passed in through the "oprofiled --ext-feature=&lt;
+extended-feature-name&gt;:[args]". This handler is executed in the function
+<function>opd_options()</function> in the file <filename>daemon/oprofiled.c
+</filename>.
+</para>
+
+<note>
+<para>
+The ext_init handler is required for all features.
+</para>
+</note>
+
+</sect2>
+
+<sect2 id="ext_print_stats">
+<title>ext_print_stats Handler</title>
+
+<para>
+"ext_print_stats" handles the extended feature statistics report. It adds
+a new section in the OProfile daemon statistics report, which is normally
+outputed to the file
+<filename>/var/lib/oprofile/samples/oprofiled.log</filename>.
+This handler is executed in the function <function>opd_print_stats()</function>
+in the file <filename>daemon/opd_stats.c</filename>.
+</para>
+
+</sect2>
+
+<sect2 id="ext_sfile_handlers">
+<title>ext_sfile Handler</title>
+
+<para>
+"ext_sfile" contains a set of handlers related to operations on the extended
+sample files (sample files for events related to extended feature).
+These operations include <function>create_sfile()</function>,
+<function>sfile_dup()</function>, <function>close_sfile()</function>,
+<function>sync_sfile()</function>, and <function>get_file()</function>
+as defined in <filename>daemon/opd_sfile.c</filename>.
+An additional field, <varname>odb_t * ext_file</varname>, is added to the
+<varname>struct sfile</varname> for storing extended sample files
+information.
+
+</para>
+
+</sect2>
+
+</sect1>
+
+<sect1 id="ext-implementation">
+<title>Extended Feature Reference Implementation</title>
+
+<sect2 id="ext-ibs">
+<title>Instruction-Based Sampling (IBS)</title>
+
+<para>
+An example of extended feature implementation can be seen by
+examining the AMD Instruction-Based Sampling support.
+</para>
+
+<sect3 id="ibs-init">
+<title>IBS Initialization</title>
+
+<para>
+Instruction-Based Sampling (IBS) is a new performance measurement technique
+available on AMD Family 10h processors. Enabling IBS profiling is done simply
+by specifying IBS performance events through the "--event=" options.
+</para>
+
+<screen>
+opcontrol --event=IBS_FETCH_XXX:&lt;count&gt;:&lt;um&gt;:&lt;kernel&gt;:&lt;user&gt;
+opcontrol --event=IBS_OP_XXX:&lt;count&gt;:&lt;um&gt;:&lt;kernel&gt;:&lt;user&gt;
+
+Note: * Count and unitmask for all IBS fetch events must be the same,
+ as do those for IBS op.
+</screen>
+
+<para>
+IBS performance events are listed in <function>opcontrol --list-events</function>.
+When users specify these events, opcontrol verifies them using ophelp, which
+checks for the <varname>ext:ibs_fetch</varname> or <varname>ext:ibs_op</varname>
+tag in <filename>events/x86-64/family10/events</filename> file.
+Then, it configures the driver interface (/dev/oprofile/ibs_fetch/... and
+/dev/oprofile/ibs_op/...) and starts the OProfile daemon as follows.
+</para>
+
+<screen>
+oprofiled \
+ --ext-feature=ibs:\
+ fetch:&lt;IBS_FETCH_EVENT1&gt;,&lt;IBS_FETCH_EVENT2&gt;,...,:&lt;IBS fetch count&gt;:&lt;IBS Fetch um&gt;|\
+ op:&lt;IBS_OP_EVENT1&gt;,&lt;IBS_OP_EVENT2&gt;,...,:&lt;IBS op count&gt;:&lt;IBS op um&gt;
+</screen>
+
+<para>
+Here, the OProfile daemon parses the <varname>--ext-feature</varname>
+option and checks the feature name ("ibs") before calling the
+the initialization function to handle the string
+containing IBS events, counts, and unitmasks.
+Then, it stores each event in the IBS virtual-counter table
+(<varname>struct opd_event ibs_vc[OP_MAX_IBS_COUNTERS]</varname>) and
+stores the event index in the IBS Virtual Counter Index (VCI) map
+(<varname>ibs_vci_map[OP_MAX_IBS_COUNTERS]</varname>) with IBS event value
+as the map key.
+</para>
+</sect3>
+
+<sect3 id="ibs-data-processing">
+<title>IBS Data Processing</title>
+
+<para>
+During a profile session, the OProfile daemon identifies IBS samples in the
+event buffer using the <varname>"IBS_FETCH_CODE"</varname> or
+<varname>"IBS_OP_CODE"</varname>. These codes trigger the handlers
+<function>code_ibs_fetch_sample()</function> or
+<function>code_ibs_op_sample()</function> listed in the
+<varname>handler_t handlers[]</varname> vector in
+<filename>daemon/opd_trans.c </filename>. These handlers are responsible for
+processing IBS samples and translate them into IBS performance events.
+</para>
+
+<para>
+Unlike traditional performance events, each IBS sample can be derived into
+multiple IBS performance events. For each event that the user specifies,
+a combination of bits from Model-Specific Registers (MSR) are checked
+against the bitmask defining the event. If the condition is met, the event
+will then be recorded. The derivation logic is in the files
+<filename>daemon/opd_ibs_macro.h</filename> and
+<filename>daemon/opd_ibs_trans.[h,c]</filename>.
+</para>
+
+</sect3>
+
+<sect3 id="ibs-sample-file">
+<title>IBS Sample File</title>
+
+<para>
+Traditionally, sample file information <varname>(odb_t)</varname> is stored
+in the <varname>struct sfile::odb_t file[OP_MAX_COUNTER]</varname>.
+Currently, <varname>OP_MAX_COUNTER</varname> is 8 on non-alpha, and 20 on
+alpha-based system. Event index (the counter number on which the event
+is configured) is used to access the corresponding entry in the array.
+Unlike the traditional performance event, IBS does not use the actual
+counter registers (i.e. <filename>/dev/oprofile/0,1,2,3</filename>).
+Also, the number of performance events generated by IBS could be larger than
+<varname>OP_MAX_COUNTER</varname> (currently upto 13 IBS-fetch and 46 IBS-op
+events). Therefore IBS requires a special data structure and sfile
+handlers (<varname>struct opd_ext_sfile_handlers</varname>) for managing
+IBS sample files. IBS-sample-file information is stored in a memory
+allocated by handler <function>ibs_sfile_create()</function>, which can
+be accessed through <varname>struct sfile::odb_t * ext_files</varname>.
+</para>
+
+</sect3>
+
+</sect2>
+
+</sect1>
+
+</chapter>
+
+<glossary id="glossary">
+<title>Glossary of OProfile source concepts and types</title>
+
+<glossentry><glossterm>application image</glossterm>
+<glossdef><para>
+The primary binary image used by an application. This is derived
+from the kernel and corresponds to the binary started upon running
+an application: for example, <filename>/bin/bash</filename>.
+</para></glossdef></glossentry>
+
+<glossentry><glossterm>binary image</glossterm>
+<glossdef><para>
+An ELF file containing executable code: this includes kernel modules,
+the kernel itself (a.k.a. <filename>vmlinux</filename>), shared libraries,
+and application binaries.
+</para></glossdef></glossentry>
+
+<glossentry><glossterm>dcookie</glossterm>
+<glossdef><para>
+Short for "dentry cookie". A unique ID that can be looked up to provide
+the full path name of a binary image.
+</para></glossdef></glossentry>
+
+<glossentry><glossterm>dependent image</glossterm>
+<glossdef><para>
+A binary image that is dependent upon an application, used with
+per-application separation. Most commonly, shared libraries. For example,
+if <filename>/bin/bash</filename> is running and we take
+some samples inside the C library itself due to <command>bash</command>
+calling library code, then the image <filename>/lib/libc.so</filename>
+would be dependent upon <filename>/bin/bash</filename>.
+</para></glossdef></glossentry>
+
+<glossentry><glossterm>merging</glossterm>
+<glossdef><para>
+This refers to the ability to merge several distinct sample files
+into one set of data at runtime, in the post-profiling tools. For example,
+per-thread sample files can be merged into one set of data, because
+they are compatible (i.e. the aggregation of the data is meaningful),
+but it's not possible to merge sample files for two different events,
+because there would be no useful meaning to the results.
+</para></glossdef></glossentry>
+
+<glossentry><glossterm>profile class</glossterm>
+<glossdef><para>
+A collection of profile data that has been collected under the same
+class template. For example, if we're using <command>opreport</command>
+to show results after profiling with two performance counters enabled
+profiling <constant>DATA_MEM_REFS</constant> and <constant>CPU_CLK_UNHALTED</constant>,
+there would be two profile classes, one for each event. Or if we're on
+an SMP system and doing per-cpu profiling, and we request
+<command>opreport</command> to show results for each CPU side-by-side,
+there would be a profile class for each CPU.
+</para></glossdef></glossentry>
+
+<glossentry><glossterm>profile specification</glossterm>
+<glossdef><para>
+The parameters the user passes to the post-profiling tools that limit
+what sample files are used. This specification is matched against
+the available sample files to generate a selection of profile data.
+</para></glossdef></glossentry>
+
+<glossentry><glossterm>profile template</glossterm>
+<glossdef><para>
+The parameters that define what goes in a particular profile class.
+This includes a symbolic name (e.g. "cpu:1") and the code-usable
+equivalent.
+</para></glossdef></glossentry>
+
+</glossary>
+
+</book>
diff --git a/doc/op-jit-devel.html b/doc/op-jit-devel.html
new file mode 100644
index 0000000..cd61102
--- /dev/null
+++ b/doc/op-jit-devel.html
@@ -0,0 +1,455 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ <title>OProfile JIT agent developer guide</title>
+ <meta name="generator" content="DocBook XSL Stylesheets V1.69.1" />
+ </head>
+ <body>
+ <div class="book" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h1 class="title"><a id="oprofile-devel-guide"></a>OProfile JIT agent developer guide</h1>
+ </div>
+ <div>
+ <div class="authorgroup">
+ <div class="author">
+ <h3 class="author"><span class="firstname">Maynard</span> <span class="surname">Johnson</span></h3>
+ <div class="affiliation">
+ <div class="address">
+ <p>
+ <code class="email">&lt;<a href="mailto:maynardj@us.ibm.com">maynardj@us.ibm.com</a>&gt;</code>
+ </p>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div>
+ <p class="copyright">Copyright © 2007 IBM Corporation</p>
+ </div>
+ </div>
+ <hr />
+ </div>
+ <div class="toc">
+ <p>
+ <b>Table of Contents</b>
+ </p>
+ <dl>
+ <dt>
+ <span class="chapter">
+ <a href="#developing">1. Developing a new JIT agent</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect1">
+ <a href="#jit-devel-overview">1. Overview</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#jit-interface">2. Implementing JIT support for a new virtual machine</a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ <dt>
+ <span class="chapter">
+ <a href="#jit-api">2. The JIT support API</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect1">
+ <a href="#op_open_agent">1. op_open_agent</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#op_close_agent">2. op_close_agent</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#op_write_native_code">3. op_write_native_code</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#op_write_debug_line_info">4. op_write_debug_line_info</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#op_unload_native_code">5. op_unload_native_code</a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ </dl>
+ </div>
+ <div class="chapter" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title"><a id="developing"></a>Chapter 1. Developing a new JIT agent</h2>
+ </div>
+ </div>
+ </div>
+ <div class="toc">
+ <p>
+ <b>Table of Contents</b>
+ </p>
+ <dl>
+ <dt>
+ <span class="sect1">
+ <a href="#jit-devel-overview">1. Overview</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#jit-interface">2. Implementing JIT support for a new virtual machine</a>
+ </span>
+ </dt>
+ </dl>
+ </div>
+ <p>
+ OProfile includes a header file and library that are intended to be used by
+ developers who wish to extend OProfile's JIT support to other non-supported
+ virtual machines. This developer guide describes these development files and how
+ to use them.
+ </p>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="jit-devel-overview"></a>1. Overview</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+ OProfile already includes some implementations that use the JIT support,
+ e.g., the Java Virtual Machine Toolkit Interface (JVMTI) library,
+ libjvmti_oprofile.so. In developing a new implementation, you will
+ likely follow a similar (if not identical) procedure as was used in
+ developing the JVMTI library. Following are the high level steps to follow:
+ </p>
+ <div class="orderedlist">
+ <ol type="1">
+ <li>Ensure your virtual machine provides an API that, at minimum,
+ can provide the following information about dynamically compiled code:
+ <div class="itemizedlist"><ul type="disc"><li>Notification when compilation occurs</li><li>Name of the symbol (i.e., function or class/method, etc.)</li><li>Address in anonymous memory where the compiled code was loaded</li><li>Length of the compiled code segment</li></ul></div></li>
+ <li>Write an agent library that communicates with your VM to obtain
+ compiled code notifications. Invoke the required functions from opagent.h
+ (<a href="#jit-interface" title="2. Implementing JIT support for a new virtual machine">Section 2, &#8220;Implementing JIT support for a new virtual machine&#8221;</a>) and link your library with libopagent.so
+ (installed at <code class="filename">&lt;oprofile_install_dir&gt;/lib/oprofile</code>).
+ </li>
+ </ol>
+ </div>
+ <p>
+
+ </p>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="jit-interface"></a>2. Implementing JIT support for a new virtual machine</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+ The JIT support API for OProfile is defined
+ in <code class="filename">&lt;oprofile-install-dir&gt;/include/opagent.h</code>.
+ Some parts of the API are mandatory for an agent library to use; other
+ parts are optional. The mandatory functions are shown below.
+ </p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+op_agent_t op_open_agent(void);
+
+void op_close_agent(op_agent_t hdl);
+
+int op_write_native_code(op_agent_t hdl, char const * symbol_name,
+ uint64_t vma, const void * code,
+ const unsigned int code_size);
+</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+ To implement this part of your library, you must perform the
+ following steps:
+ </p>
+ <div class="orderedlist">
+ <ol type="1">
+ <li>Implement a function to set up initial communication with the VM.
+ Once communication to the VM is established, your agent library should call
+ <code class="function">op_op_agent()</code> and cache the returned <code class="code">op_agent_t</code> handle for use in
+ future calls.</li>
+ <li>Perform any necessary steps to register with the VM to be notified of
+ compiled code load events. Registration must include a callback function you
+ will implement in the library to handle the compiled code load events.</li>
+ <li>The callback function mentioned above must obtain all required
+ information from the VM to pass to libopagent via <code class="function">op_write_native_code()</code>.</li>
+ <li>When disconnecting from the VM, your library should call
+ <code class="function">op_agent_close()</code>.</li>
+ </ol>
+ </div>
+ <p>
+ </p>
+ <p>Use of the functions below are optional, depending on the kinds of information your VM
+ can provide to your agent library. See the JVMTI agent library for an example of how to use
+ these functions.
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+int op_unload_native_code(op_agent_t hdl, uint64_t vma);
+
+int op_write_debug_line_info(op_agent_t hdl, void const * code,
+ size_t nr_entry,
+ struct debug_line_info const * compile_map);
+</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+ </p>
+ <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3>While the libopagent functions are thread-safe, you should not use them in
+ signal handlers.
+ </div>
+ </div>
+ </div>
+ <div class="chapter" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title"><a id="jit-api"></a>Chapter 2. The JIT support API</h2>
+ </div>
+ </div>
+ </div>
+ <div class="toc">
+ <p>
+ <b>Table of Contents</b>
+ </p>
+ <dl>
+ <dt>
+ <span class="sect1">
+ <a href="#op_open_agent">1. op_open_agent</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#op_close_agent">2. op_close_agent</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#op_write_native_code">3. op_write_native_code</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#op_write_debug_line_info">4. op_write_debug_line_info</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#op_unload_native_code">5. op_unload_native_code</a>
+ </span>
+ </dt>
+ </dl>
+ </div>
+ <p>
+ This chapter describes the JIT support API. See opagent.h for more details.
+ </p>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="op_open_agent"></a>1. op_open_agent</h2>
+ </div>
+ </div>
+ </div>
+ <div class="funcsynopsis">Initializes the agent library.
+<pre class="funcsynopsisinfo">#include &lt;opagent.h&gt;</pre><p><code class="funcdef">op_agent_t <b class="fsfunc">op_open_agent</b>(</code><code>)</code>;<br />void;</p></div>
+ <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Description</h3>
+This function must be called by agents before any other function.
+Creates and opens a JIT dump file in <code class="filename">/var/lib/oprofile/jitdump</code>
+using the naming convention <code class="filename">&lt;process_id&gt;.dump</code>.
+</div>
+ <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Parameters</h3>
+None
+</div>
+ <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
+ <h3 class="title">Return value</h3>
+ <p>Returns a valid <code class="code">op_agent_t</code> handle or NULL.
+If NULL is returned, <code class="code">errno</code> is set to indicate the nature of the error. For a list
+of possible <code class="code">errno</code> values, see the man pages for:</p>
+ <code class="code">
+stat, creat, gettimeofday, fdopen, fwrite
+</code>
+ </div>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="op_close_agent"></a>2. op_close_agent</h2>
+ </div>
+ </div>
+ </div>
+ <div class="funcsynopsis">Uninitialize the agent library.
+<pre class="funcsynopsisinfo">#include &lt;opagent.h&gt;</pre><p><code class="funcdef">int <b class="fsfunc">op_close_agent</b>(</code><var class="pdparam">hdl</var><code>)</code>;<br />op_agent_t <var class="pdparam">hdl</var>;</p></div>
+ <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Description</h3>
+Frees all resources and closes open file handles.
+</div>
+ <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Parameters</h3><em class="parameter"><code>hdl : </code></em>Handle returned from an earlier call to
+<code class="function">op_open_agent()</code></div>
+ <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
+ <h3 class="title">Return value</h3>
+ <p>Returns 0 on success; -1 otherwise. If -1 is returned, <code class="code">errno</code> is set
+to indicate the nature of the error.
+<code class="code">errno</code> is set to EINVAL if an invalid <code class="code">op_agent_t</code>
+handle is passed. For a list of other possible <code class="code">errno</code> values, see the man pages for:</p>
+ <code class="code">gettimeofday, fwrite</code>
+ </div>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="op_write_native_code"></a>3. op_write_native_code</h2>
+ </div>
+ </div>
+ </div>
+ <div class="funcsynopsis">Write information about compiled code to a JIT dump file.
+<pre class="funcsynopsisinfo">#include &lt;opagent.h&gt;</pre><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr><td><code class="funcdef">int <b class="fsfunc">op_write_native_code</b>(</code></td><td><var class="pdparam">hdl</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">symbol_name</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">vma</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">code</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">code_size</var><code>)</code>;</td><td> </td></tr></table><table border="0" summary="Function argument synopsis" cellspacing="0" cellpadding="0"><tr><td>op_agent_t </td><td><var class="pdparam">hdl</var>;</td></tr><tr><td>char const * </td><td><var class="pdparam">symbol_name</var>;</td></tr><tr><td>uint64_t </td><td><var class="pdparam">vma</var>;</td></tr><tr><td>void const * </td><td><var class="pdparam">code</var>;</td></tr><tr><td>const unsigned int </td><td><var class="pdparam">code_size</var>;</td></tr></table></div>
+ <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Description</h3>
+Signal the dynamic generation of native code from a virtual machine.
+Writes a JIT dump record to the open JIT dump file using the passed information.
+</div>
+ <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
+ <h3 class="title">Parameters</h3>
+ <p>
+<em class="parameter"><code>hdl : </code></em>Handle returned from an earlier call to
+<code class="function">op_open_agent()</code>
+</p>
+ <p>
+<em class="parameter"><code>symbol_name : </code></em>The name of the symbol being dynamically compiled.
+ This name can (and should) contain all necessary information to disambiguate it from
+ symbols of the same name; e.g., class, method signature.
+</p>
+ <p>
+<em class="parameter"><code>vma : </code></em>Virtual memory address of the executable code
+</p>
+ <p>
+<em class="parameter"><code>code : </code></em>Pointer to the location of the compiled code.
+ Theoretically, this may be a different location from
+ that given by the vma argument. For some JIT compilers,
+ obtaining the code may be impractical. For this (or any other)
+ reason, the agent can choose to pass NULL for this paraemter.
+ If NULL is passed, no code will be copied into the JIT dump
+ file.
+</p>
+ <p>
+<em class="parameter"><code>code_size : </code></em>Size of the compiled code
+</p>
+ </div>
+ <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
+ <h3 class="title">Return value</h3>
+ <p>Returns 0 on success; -1 otherwise. If -1 is returned, <code class="code">errno</code> is set
+to indicate the nature of the error.
+<code class="code">errno</code> is set to EINVAL if an invalid <code class="code">op_agent_t</code>
+handle is passed. For a list of other possible <code class="code">errno</code> values, see the man pages for:</p>
+ <code class="code">gettimeofday, fwrite</code>
+ </div>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="op_write_debug_line_info"></a>4. op_write_debug_line_info</h2>
+ </div>
+ </div>
+ </div>
+ <div class="funcsynopsis">Write debug information about compiled code to a JIT dump file.
+<pre class="funcsynopsisinfo">#include &lt;opagent.h&gt;</pre><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr><td><code class="funcdef">int <b class="fsfunc">op_write_debug_line_info</b>(</code></td><td><var class="pdparam">hdl</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">code</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">nr_entry</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">compile_map</var><code>)</code>;</td><td> </td></tr></table><table border="0" summary="Function argument synopsis" cellspacing="0" cellpadding="0"><tr><td>op_agent_t </td><td><var class="pdparam">hdl</var>;</td></tr><tr><td>void const * </td><td><var class="pdparam">code</var>;</td></tr><tr><td>size_t </td><td><var class="pdparam">nr_entry</var>;</td></tr><tr><td>struct debug_line_info const * </td><td><var class="pdparam">compile_map</var>;</td></tr></table></div>
+ <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Description</h3>
+Add debug line information to a piece of code. An <code class="function">op_write_native_code()</code>
+with the same code pointer should have occurred before this call. It's not
+necessary to provide one lineno information entry per machine instruction;
+the array can contain hole.
+</div>
+ <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
+ <h3 class="title">Parameters</h3>
+ <p>
+<em class="parameter"><code>hdl : </code></em>Handle returned from an earlier call to
+<code class="function">op_open_agent()</code>
+</p>
+ <p>
+<em class="parameter"><code>code : </code></em>Pointer to the location of the code with debug info
+</p>
+ <p>
+<em class="parameter"><code>nr_entry : </code></em>Number of entries in compile_map
+</p>
+ <p>
+<em class="parameter"><code>compile_map : </code></em>Array of struct debug_line_info. See the JVMTI agent
+library implementation for an example of what information should be retrieved
+from a VM to fill out this data structure.
+</p>
+ </div>
+ <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
+ <h3 class="title">Return value</h3>
+ <p>Returns 0 on success; -1 otherwise. If -1 is returned, <code class="code">errno</code> is set
+to indicate the nature of the error.
+<code class="code">errno</code> is set to EINVAL if an invalid <code class="code">op_agent_t</code>
+handle is passed. For a list of other possible <code class="code">errno</code> values, see the man pages for:</p>
+ <code class="code">gettimeofday, ftell, fwrite</code>
+ </div>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="op_unload_native_code"></a>5. op_unload_native_code</h2>
+ </div>
+ </div>
+ </div>
+ <div class="funcsynopsis">Write information to the JIT dump file about invalidated compiled code.
+<pre class="funcsynopsisinfo">#include &lt;opagent.h&gt;</pre><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" style="padding-bottom: 1em"><tr><td><code class="funcdef">int <b class="fsfunc">op_unload_native_code</b>(</code></td><td><var class="pdparam">hdl</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">vma</var><code>)</code>;</td><td> </td></tr></table><table border="0" summary="Function argument synopsis" cellspacing="0" cellpadding="0"><tr><td>op_agent_t </td><td><var class="pdparam">hdl</var>;</td></tr><tr><td>uint64_t </td><td><var class="pdparam">vma</var>;</td></tr></table></div>
+ <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Description</h3>
+Signal the invalidation of native code from a virtual machine.</div>
+ <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
+ <h3 class="title">Parameters</h3>
+ <p>
+<em class="parameter"><code>hdl : </code></em>Handle returned from an earlier call to
+<code class="function">op_open_agent()</code>
+</p>
+ <p>
+<em class="parameter"><code>vma : </code></em>Virtual memory address of the compiled code being unloaded.
+An <code class="function">op_write_native_code()</code> with the same vma should have occurred before this call.
+</p>
+ </div>
+ <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
+ <h3 class="title">Return value</h3>
+ <p>Returns 0 on success; -1 otherwise. If -1 is returned, <code class="code">errno</code> is set
+to indicate the nature of the error.
+<code class="code">errno</code> is set to EINVAL if an invalid <code class="code">op_agent_t</code>
+handle is passed. For a list of other possible <code class="code">errno</code> values, see the man pages for:</p>
+ <code class="code">gettimeofday, fwrite</code>
+ </div>
+ </div>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/doc/op-jit-devel.xml b/doc/op-jit-devel.xml
new file mode 100644
index 0000000..9bd9a88
--- /dev/null
+++ b/doc/op-jit-devel.xml
@@ -0,0 +1,319 @@
+<?xml version="1.0" encoding='ISO-8859-1'?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
+
+<book id="oprofile-devel-guide">
+<bookinfo>
+ <title>OProfile JIT agent developer guide</title>
+
+ <authorgroup>
+ <author>
+ <firstname>Maynard</firstname>
+ <surname>Johnson</surname>
+ <affiliation>
+ <address><email>maynardj@us.ibm.com</email></address>
+ </affiliation>
+ </author>
+ </authorgroup>
+
+ <copyright>
+ <year>2007</year>
+ <holder>IBM Corporation</holder>
+ </copyright>
+</bookinfo>
+
+<toc></toc>
+
+<chapter id="developing">
+ <title>Developing a new JIT agent</title>
+ <para>
+ OProfile includes a header file and library that are intended to be used by
+ developers who wish to extend OProfile's JIT support to other non-supported
+ virtual machines. This developer guide describes these development files and how
+ to use them.
+ </para>
+<sect1 id="jit-devel-overview">
+<title>Overview</title>
+ <para>
+ OProfile already includes some implementations that use the JIT support,
+ e.g., the Java Virtual Machine Toolkit Interface (JVMTI) library,
+ libjvmti_oprofile.so. In developing a new implementation, you will
+ likely follow a similar (if not identical) procedure as was used in
+ developing the JVMTI library. Following are the high level steps to follow:
+ <orderedlist>
+ <listitem>Ensure your virtual machine provides an API that, at minimum,
+ can provide the following information about dynamically compiled code:
+ <itemizedlist>
+ <listitem>Notification when compilation occurs</listitem>
+ <listitem>Name of the symbol (i.e., function or class/method, etc.)</listitem>
+ <listitem>Address in anonymous memory where the compiled code was loaded</listitem>
+ <listitem>Length of the compiled code segment</listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>Write an agent library that communicates with your VM to obtain
+ compiled code notifications. Invoke the required functions from opagent.h
+ (<xref linkend="jit-interface" />) and link your library with libopagent.so
+ (installed at <filename>&lt;oprofile_install_dir&gt;/lib/oprofile</filename>).
+ </listitem>
+ </orderedlist>
+
+ </para>
+</sect1>
+<sect1 id="jit-interface">
+<title>Implementing JIT support for a new virtual machine</title>
+ <para>
+ The JIT support API for OProfile is defined
+ in <filename>&lt;oprofile-install-dir&gt;/include/opagent.h</filename>.
+ Some parts of the API are mandatory for an agent library to use; other
+ parts are optional. The mandatory functions are shown below.
+ </para>
+<screen>
+op_agent_t op_open_agent(void);
+
+void op_close_agent(op_agent_t hdl);
+
+int op_write_native_code(op_agent_t hdl, char const * symbol_name,
+ uint64_t vma, const void * code,
+ const unsigned int code_size);
+</screen>
+
+ <para>
+ To implement this part of your library, you must perform the
+ following steps:
+ <orderedlist>
+ <listitem>Implement a function to set up initial communication with the VM.
+ Once communication to the VM is established, your agent library should call
+ <function>op_op_agent()</function> and cache the returned <code>op_agent_t</code> handle for use in
+ future calls.</listitem>
+ <listitem>Perform any necessary steps to register with the VM to be notified of
+ compiled code load events. Registration must include a callback function you
+ will implement in the library to handle the compiled code load events.</listitem>
+ <listitem>The callback function mentioned above must obtain all required
+ information from the VM to pass to libopagent via <function>op_write_native_code()</function>.</listitem>
+ <listitem>When disconnecting from the VM, your library should call
+ <function>op_agent_close()</function>.</listitem>
+ </orderedlist>
+ </para>
+
+ <para>Use of the functions below are optional, depending on the kinds of information your VM
+ can provide to your agent library. See the JVMTI agent library for an example of how to use
+ these functions.
+<screen>
+int op_unload_native_code(op_agent_t hdl, uint64_t vma);
+
+int op_write_debug_line_info(op_agent_t hdl, void const * code,
+ size_t nr_entry,
+ struct debug_line_info const * compile_map);
+</screen>
+ </para>
+ <note>While the libopagent functions are thread-safe, you should not use them in
+ signal handlers.
+ </note>
+</sect1>
+</chapter>
+
+
+<chapter id="jit-api">
+ <title>The JIT support API</title>
+ <para>
+ This chapter describes the JIT support API. See opagent.h for more details.
+ </para>
+
+<sect1 id="op_open_agent">
+<title>op_open_agent</title>
+
+<funcsynopsis>Initializes the agent library.
+<funcsynopsisinfo>#include &lt;opagent.h&gt;</funcsynopsisinfo>
+<funcprototype>
+<funcdef>op_agent_t <function>op_open_agent</function></funcdef>
+<paramdef>void</paramdef>
+</funcprototype>
+</funcsynopsis>
+<note>
+<title>Description</title>
+This function must be called by agents before any other function.
+Creates and opens a JIT dump file in <filename>/var/lib/oprofile/jitdump</filename>
+using the naming convention <filename>&lt;process_id&gt;.dump</filename>.
+</note>
+<note>
+<title>Parameters</title>
+None
+</note>
+<note>
+<title>Return value</title>
+<para>Returns a valid <code>op_agent_t</code> handle or NULL.
+If NULL is returned, <code>errno</code> is set to indicate the nature of the error. For a list
+of possible <code>errno</code> values, see the man pages for:</para>
+<code>
+stat, creat, gettimeofday, fdopen, fwrite
+</code>
+</note>
+</sect1>
+
+<sect1 id="op_close_agent">
+<title>op_close_agent</title>
+<funcsynopsis>Uninitialize the agent library.
+<funcsynopsisinfo>#include &lt;opagent.h&gt;</funcsynopsisinfo>
+<funcprototype>
+<funcdef>int <function>op_close_agent</function></funcdef>
+<paramdef>op_agent_t <parameter>hdl</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<note>
+<title>Description</title>
+Frees all resources and closes open file handles.
+</note>
+<note>
+<title>Parameters</title>
+<parameter>hdl : </parameter>Handle returned from an earlier call to
+<function>op_open_agent()</function>
+</note>
+<note>
+<title>Return value</title>
+<para>Returns 0 on success; -1 otherwise. If -1 is returned, <code>errno</code> is set
+to indicate the nature of the error.
+<code>errno</code> is set to EINVAL if an invalid <code>op_agent_t</code>
+handle is passed. For a list of other possible <code>errno</code> values, see the man pages for:</para>
+<code>gettimeofday, fwrite</code>
+</note>
+</sect1>
+
+<sect1 id="op_write_native_code">
+<title>op_write_native_code</title>
+<funcsynopsis>Write information about compiled code to a JIT dump file.
+<funcsynopsisinfo>#include &lt;opagent.h&gt;</funcsynopsisinfo>
+<funcprototype>
+<funcdef>int <function>op_write_native_code</function></funcdef>
+<paramdef>op_agent_t<parameter>hdl</parameter></paramdef>
+<paramdef>char const *<parameter>symbol_name</parameter></paramdef>
+<paramdef>uint64_t<parameter>vma</parameter></paramdef>
+<paramdef>void const *<parameter>code</parameter></paramdef>
+<paramdef>const unsigned int<parameter>code_size</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<note>
+<title>Description</title>
+Signal the dynamic generation of native code from a virtual machine.
+Writes a JIT dump record to the open JIT dump file using the passed information.
+</note>
+<note>
+<title>Parameters</title>
+<para>
+<parameter>hdl : </parameter>Handle returned from an earlier call to
+<function>op_open_agent()</function>
+</para>
+<para>
+<parameter>symbol_name : </parameter>The name of the symbol being dynamically compiled.
+ This name can (and should) contain all necessary information to disambiguate it from
+ symbols of the same name; e.g., class, method signature.
+</para>
+<para>
+<parameter>vma : </parameter>Virtual memory address of the executable code
+</para>
+<para>
+<parameter>code : </parameter>Pointer to the location of the compiled code.
+ Theoretically, this may be a different location from
+ that given by the vma argument. For some JIT compilers,
+ obtaining the code may be impractical. For this (or any other)
+ reason, the agent can choose to pass NULL for this paraemter.
+ If NULL is passed, no code will be copied into the JIT dump
+ file.
+</para>
+<para>
+<parameter>code_size : </parameter>Size of the compiled code
+</para>
+</note>
+<note>
+<title>Return value</title>
+<para>Returns 0 on success; -1 otherwise. If -1 is returned, <code>errno</code> is set
+to indicate the nature of the error.
+<code>errno</code> is set to EINVAL if an invalid <code>op_agent_t</code>
+handle is passed. For a list of other possible <code>errno</code> values, see the man pages for:</para>
+<code>gettimeofday, fwrite</code>
+</note>
+</sect1>
+
+
+<sect1 id="op_write_debug_line_info">
+<title>op_write_debug_line_info</title>
+<funcsynopsis>Write debug information about compiled code to a JIT dump file.
+<funcsynopsisinfo>#include &lt;opagent.h&gt;</funcsynopsisinfo>
+<funcprototype>
+<funcdef>int <function>op_write_debug_line_info</function></funcdef>
+<paramdef>op_agent_t<parameter>hdl</parameter></paramdef>
+<paramdef>void const *<parameter>code</parameter></paramdef>
+<paramdef>size_t<parameter>nr_entry</parameter></paramdef>
+<paramdef>struct debug_line_info const *<parameter>compile_map</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<note>
+<title>Description</title>
+Add debug line information to a piece of code. An <function>op_write_native_code()</function>
+with the same code pointer should have occurred before this call. It's not
+necessary to provide one lineno information entry per machine instruction;
+the array can contain hole.
+</note>
+<note>
+<title>Parameters</title>
+<para>
+<parameter>hdl : </parameter>Handle returned from an earlier call to
+<function>op_open_agent()</function>
+</para>
+<para>
+<parameter>code : </parameter>Pointer to the location of the code with debug info
+</para>
+<para>
+<parameter>nr_entry : </parameter>Number of entries in compile_map
+</para>
+<para>
+<parameter>compile_map : </parameter>Array of struct debug_line_info. See the JVMTI agent
+library implementation for an example of what information should be retrieved
+from a VM to fill out this data structure.
+</para>
+</note>
+<note>
+<title>Return value</title>
+<para>Returns 0 on success; -1 otherwise. If -1 is returned, <code>errno</code> is set
+to indicate the nature of the error.
+<code>errno</code> is set to EINVAL if an invalid <code>op_agent_t</code>
+handle is passed. For a list of other possible <code>errno</code> values, see the man pages for:</para>
+<code>gettimeofday, ftell, fwrite</code>
+</note>
+</sect1>
+
+<sect1 id="op_unload_native_code">
+<title>op_unload_native_code</title>
+<funcsynopsis>Write information to the JIT dump file about invalidated compiled code.
+<funcsynopsisinfo>#include &lt;opagent.h&gt;</funcsynopsisinfo>
+<funcprototype>
+<funcdef>int <function>op_unload_native_code</function></funcdef>
+<paramdef>op_agent_t<parameter>hdl</parameter></paramdef>
+<paramdef>uint64_t<parameter>vma</parameter></paramdef>
+</funcprototype>
+</funcsynopsis>
+<note>
+<title>Description</title>
+Signal the invalidation of native code from a virtual machine.</note>
+<note>
+<title>Parameters</title>
+<para>
+<parameter>hdl : </parameter>Handle returned from an earlier call to
+<function>op_open_agent()</function>
+</para>
+<para>
+<parameter>vma : </parameter>Virtual memory address of the compiled code being unloaded.
+An <function>op_write_native_code()</function> with the same vma should have occurred before this call.
+</para>
+</note>
+<note>
+<title>Return value</title>
+<para>Returns 0 on success; -1 otherwise. If -1 is returned, <code>errno</code> is set
+to indicate the nature of the error.
+<code>errno</code> is set to EINVAL if an invalid <code>op_agent_t</code>
+handle is passed. For a list of other possible <code>errno</code> values, see the man pages for:</para>
+<code>gettimeofday, fwrite</code>
+</note>
+</sect1>
+
+</chapter>
+
+</book>
diff --git a/doc/opannotate.1.in b/doc/opannotate.1.in
new file mode 100644
index 0000000..e1a369b
--- /dev/null
+++ b/doc/opannotate.1.in
@@ -0,0 +1,119 @@
+.TH OPANNOTATE 1 "@DATE@" "oprofile @VERSION@"
+.UC 4
+.SH NAME
+opannotate \- produce source or assembly annotated with profile data
+.SH SYNOPSIS
+.br
+.B opannotate
+[
+.I options
+]
+[profile specification]
+.SH DESCRIPTION
+
+.B opannotate
+outputs annotated source and/or assembly from profile data of an OProfile
+session. See oprofile(1) for how to write profile specifications.
+
+.SH OPTIONS
+.TP
+.BI "--assembly / -a"
+Output annotated assembly. If this is combined with --source, then mixed
+source / assembly annotations are output.
+.br
+.TP
+.BI "--demangle / -D none|smart|normal"
+none: no demangling. normal: use default demangler (default) smart: use
+pattern-matching to make C++ symbol demangling more readable.
+.br
+.TP
+.BI "--exclude-dependent / -x"
+Do not include application-specific images for libraries, kernel modules
+and the kernel. This option only makes sense if the profile session
+used --separate.
+.br
+.TP
+.BI "--exclude-file [files]"
+Exclude all files in the given comma-separated list of glob patterns.
+.br
+.TP
+.BI "--exclude-symbols / -e [symbols]"
+Exclude all the symbols in the given comma-separated list.
+.br
+.TP
+.BI "--help / -? / --usage"
+Show help message.
+.br
+.TP
+.BI "--image-path / -p [paths]"
+Comma-separated list of additional paths to search for binaries.
+This is needed to find modules in kernels 2.6 and upwards.
+.br
+.TP
+.BI "--root / -R [path]"
+A path to a filesystem to search for additional binaries.
+.br
+.TP
+.BI "--include-file [files]"
+Only include files in the given comma-separated list of glob patterns.
+.br
+.TP
+.BI "--include-symbols / -i [symbols]"
+Only include symbols in the given comma-separated list.
+.br
+.TP
+.BI "--objdump-params [params]"
+Pass the given parameters as extra values when calling objdump.
+.br
+.TP
+.BI "--output-dir / -o [dir]"
+Output directory. This makes opannotate output one annotated file for each
+source file. This option can't be used in conjunction with --assembly.
+.br
+.TP
+.BI "--search-dirs / -d [paths]"
+Comma-separated list of paths to search for source files. You may need to use
+this option when the debug information for an image contains relative paths.
+.br
+.TP
+.BI "--base-dirs / -b [paths]"
+Comma-separated list of paths to strip from debug source files, prior to
+looking for them in --search-dirs.
+.br
+.TP
+.BI "--session-dir="dir_path
+Use sample database out of directory dir_path instead of the default location (/var/lib/oprofile).
+.br
+.TP
+.BI "--source / -s"
+Output annotated source. This requires debugging information to be available
+for the binaries.
+.br
+.TP
+.BI "--threshold / -t [percentage]"
+Only output data for symbols that have more than the given percentage
+of total samples.
+.br
+.TP
+.BI "--verbose / -V [options]"
+Give verbose debugging output.
+.br
+.TP
+.BI "--version / -v"
+Show version.
+
+.SH ENVIRONMENT
+No special environment variables are recognised by opannotate.
+
+.SH FILES
+.TP
+.I /var/lib/oprofile/samples/
+The location of the generated sample files.
+
+.SH VERSION
+.TP
+This man page is current for @PACKAGE@-@VERSION@.
+
+.SH SEE ALSO
+.BR @OP_DOCDIR@,
+.BR oprofile(1)
diff --git a/doc/oparchive.1.in b/doc/oparchive.1.in
new file mode 100644
index 0000000..6e33634
--- /dev/null
+++ b/doc/oparchive.1.in
@@ -0,0 +1,76 @@
+.TH OPARCHIVE 1 "@DATE@" "oprofile @VERSION@"
+.UC 4
+.SH NAME
+oparchive \- produce archive of oprofile data for offline analysis
+.SH SYNOPSIS
+.br
+.B oparchive
+[
+.I options
+]
+[profile specification]
+.B -o
+[directory]
+.SH DESCRIPTION
+
+.B oparchive
+generates a directory populated with executable, debug, and oprofile sample
+files. This directory can be move to another machine via tar and analyzed
+without further use of the data collection machine. See oprofile(1) for how
+to write profile specifications.
+
+.SH OPTIONS
+.TP
+.BI "--help / -? / --usage"
+Show help message.
+.br
+.TP
+.BI "--version / -v"
+Show version.
+.br
+.TP
+.BI "--verbose / -V [options]"
+Give verbose debugging output.
+.br
+.TP
+.BI "--session-dir="dir_path
+Use sample database out of directory dir_path instead of the default location (/var/lib/oprofile).
+.br
+.TP
+.BI "--image-path / -p [paths]"
+Comma-separated list of additional paths to search for binaries.
+This is needed to find modules in kernels 2.6 and upwards.
+.br
+.TP
+.BI "--root / -R [path]"
+A path to a filesystem to search for additional binaries.
+.br
+.TP
+.BI "--output-directory / -o [directory]"
+Output to the given directory. There is no default. This must be specified.
+.br
+.TP
+.BI "--exclude-dependent / -x"
+Do not include application-specific images for libraries, kernel modules
+and the kernel. This option only makes sense if the profile session
+used --separate.
+.br
+.TP
+.BI "--list-files / -l"
+Only list the files that would be archived, don't copy them.
+
+.SH ENVIRONMENT
+No special environment variables are recognised by oparchive.
+
+.SH FILES
+.TP
+.I /var/lib/oprofile/samples/
+The location of the generated sample files.
+
+.SH VERSION
+.TP
+This man page is current for @PACKAGE@-@VERSION@.
+
+.SH SEE ALSO
+.BR @OP_DOCDIR@,
+.BR oprofile(1)
diff --git a/doc/opcontrol.1.in b/doc/opcontrol.1.in
new file mode 100644
index 0000000..b9cf61e
--- /dev/null
+++ b/doc/opcontrol.1.in
@@ -0,0 +1,177 @@
+.TH OPCONTROL 1 "@DATE@" "oprofile @VERSION@"
+.UC 4
+.SH NAME
+opcontrol \- control OProfile profiling
+.SH SYNOPSIS
+.br
+.B opcontrol
+[
+.I options
+]
+.SH DESCRIPTION
+.B opcontrol
+can be used to start profiling, end a profiling session,
+dump profile data, and set up the profiling parameters.
+
+.SH OPTIONS
+.TP
+.BI "--help"
+Show help message.
+.br
+.TP
+.BI "--version"
+Show version.
+.br
+.TP
+.BI "--list-events"
+Shows the monitorable events.
+.br
+.TP
+.BI "--init"
+Load the OProfile module if required and make the OProfile driver
+interface available.
+.br
+.TP
+.BI "--setup"
+Followed by list options for profiling setup. Store setup
+in ~root/.oprofile/daemonrc. Optional.
+.br
+.TP
+.BI "--status"
+Show configuration information.
+.br
+.TP
+.BI "--start-daemon"
+Start the oprofile daemon without starting profiling. Not available
+in 2.2/2.4 kernels.
+.br
+.TP
+.BI "--start"
+Start data collection with either arguments provided by --setup
+or with information saved in ~root/.oprofile/daemonrc.
+.br
+.TP
+.BI "--dump"
+Force a flush of the collected profiling data to the daemon.
+.br
+.TP
+.BI "--stop"
+Stop data collection. Not available in 2.2/2.4 kernels.
+.br
+.TP
+.BI "--shutdown"
+Stop data collection and kill the daemon.
+.br
+.TP
+.BI "--reset"
+Clear out data from current session, but leaves saved sessions.
+.br
+.TP
+.BI "--save="sessionname
+Save data from current session to sessionname.
+.br
+.TP
+.BI "--deinit"
+Shut down daemon. Unload the oprofile module and oprofilefs.
+.br
+.TP
+.BI "--session-dir="dir_path
+Use sample database out of directory dir_path instead of the default location (/var/lib/oprofile).
+.br
+.TP
+.BI "--buffer-size="num
+Set kernel buffer to num samples. When using a 2.6 kernel buffer watershed need
+to be tweaked when changing this value.
+.br
+.TP
+.BI "--buffer-watershed="num
+Set kernel buffer watershed to num samples (2.6 only). When it'll remain only
+buffer-size - buffer-watershed free entry in the kernel buffer data will be
+flushed to daemon, most usefull value are in the range [0.25 - 0.5] * buffer-size.
+.br
+.TP
+.BI "--cpu-buffer-size="num
+Set kernel per cpu buffer to num samples (2.6 only). If you profile at high
+rate it can help to increase this if the log file show excessive count of
+sample lost cpu buffer overflow.
+.br
+.TP
+.BI "--event="[event|"default"]
+Specify an event to measure for the hardware performance counters,
+or "default" for the default event. The event is of the form
+"CPU_CLK_UNHALTED:30000:0:1:1" where the numeric values are
+count, unit mask, kernel-space counting, user-space counting,
+respectively. Note that this over-rides all previous events selected;
+if you want two or more counters used simultaneously, you must specify
+them on the same opcontrol invocation.
+.br
+.TP
+.BI "--separate="[none,lib,kernel,thread,cpu,all]
+Separate samples based on the given separator. 'lib' separates
+dynamically linked library samples per application. 'kernel' separates
+kernel and kernel module samples per application; 'kernel'
+implies 'library'. 'thread' gives separation for each thread and
+task. 'cpu' separates for each CPU. 'all' implies all of the above
+options and 'none' turns off separation.
+.br
+.TP
+.BI "--callgraph=#depth"
+Enable callgraph sample collection with a maximum depth. Use 0 to disable
+callgraph profiling. This option is available on x86 using a
+2.6+ kernel with callgraph support enabled. It is also available on PowerPC using a 2.6.17+ kernel.
+.br
+.TP
+.BI "--image="[name,name...|"all"]
+Only profile the given absolute paths to binaries, or "all" to profile
+everything (the default).
+.br
+.TP
+.BI "--vmlinux="file
+vmlinux kernel image.
+.br
+.TP
+.BI "--no-vmlinux"
+Use this when you don't have a kernel vmlinux file, and you don't want to
+profile the kernel.
+.br
+.TP
+.BI "--verbose"
+Be verbose in the daemon log. This has a high overhead.
+.br
+.TP
+.BI "--kernel-range="start,end
+Set kernel range vma address in hexadecimal.
+
+.SH OPTIONS (specific to Xen)
+.TP
+.BI "--xen="file
+Xen image
+.br
+.TP
+.BI "--active-domains="<list>
+List of domain ids participating in a multi-domain profiling session. If
+more than one domain is specified in <list> they should be separated using
+commas. This option can only be used in domain 0 which is the only domain
+that can coordinate a multi-domain profiling session. Including domain 0 in
+the list of active domains is optional. (e.g. --active-domains=2,5,6 and
+--active-domains=0,2,5,6 are equivalent)
+.br
+
+.SH ENVIRONMENT
+No special environment variables are recognised by opcontrol.
+
+.SH FILES
+.TP
+.I /root/.oprofile/daemonrc
+Configuration file for opcontrol
+.TP
+.I /var/lib/oprofile/samples/
+The location of the generated sample files.
+
+.SH VERSION
+.TP
+This man page is current for @PACKAGE@-@VERSION@.
+
+.SH SEE ALSO
+.BR @OP_DOCDIR@,
+.BR oprofile(1)
diff --git a/doc/opgprof.1.in b/doc/opgprof.1.in
new file mode 100644
index 0000000..3e61ba9
--- /dev/null
+++ b/doc/opgprof.1.in
@@ -0,0 +1,67 @@
+.TH OPGPROF 1 "@DATE@" "oprofile @VERSION@"
+.UC 4
+.SH NAME
+opgprof \- produce gprof-format profile data
+.SH SYNOPSIS
+.br
+.B opgprof
+[
+.I options
+]
+[profile specification]
+.SH DESCRIPTION
+
+.B opgprof
+outputs gprof-format profile data for a given binary image,
+from an OProfile session. See oprofile(1) for how to write profile specifications.
+
+.SH OPTIONS
+.TP
+.BI "--help / -? / --usage"
+Show help message.
+.br
+.TP
+.BI "--version / -v"
+Show version.
+.br
+.TP
+.BI "--verbose / -V [options]"
+Give verbose debugging output.
+.br
+.TP
+.BI "--session-dir="dir_path
+Use sample database out of directory dir_path instead of the default location (/var/lib/oprofile).
+.br
+.TP
+.BI "--image-path / -p [paths]"
+Comma-separated list of additional paths to search for binaries.
+This is needed to find modules in kernels 2.6 and upwards.
+.br
+.TP
+.BI "--root / -R [path]"
+A path to a filesystem to search for additional binaries.
+.br
+.TP
+.BI "--threshold / -t [percentage]"
+Only output data for symbols that have more than the given percentage
+of total samples.
+.br
+.TP
+.BI "--output-filename / -o [file]"
+Output to the given file instead of the default, gmon.out
+
+.SH ENVIRONMENT
+No special environment variables are recognised by opgprof.
+
+.SH FILES
+.TP
+.I /var/lib/oprofile/samples/
+The location of the generated sample files.
+
+.SH VERSION
+.TP
+This man page is current for @PACKAGE@-@VERSION@.
+
+.SH SEE ALSO
+.BR @OP_DOCDIR@,
+.BR oprofile(1)
diff --git a/doc/ophelp.1.in b/doc/ophelp.1.in
new file mode 100644
index 0000000..3548d74
--- /dev/null
+++ b/doc/ophelp.1.in
@@ -0,0 +1,58 @@
+.TH OPHELP 1 "@DATE@" "oprofile @VERSION@"
+.UC 4
+.SH NAME
+ophelp \- list OProfile events
+.SH SYNOPSIS
+.br
+.B ophelp
+[
+.I options
+]
+[event name]
+.SH DESCRIPTION
+
+By default,
+.B ophelp
+lists the available performance counter options. If you
+give it a symbolic event name, it will return the hardware
+value (e.g. "ophelp DATA_MEM_REFS").
+
+.SH OPTIONS
+.TP
+.BI "--cpu-type / -c"
+Show the events for the given numerical CPU type.
+.br
+.TP
+.BI "--get-cpu-type / -r"
+Show the symbolic CPU name.
+.br
+.TP
+.BI "--xml / -X"
+List events in XML format.
+.br
+.TP
+.BI "--help / -? / --usage"
+Show help message.
+.br
+.TP
+.BI "--version / -v"
+Show version.
+
+.SH ENVIRONMENT
+No special environment variables are recognised by ophelp.
+
+.SH FILES
+.TP
+.I $prefix/share/oprofile/
+Event description files used by OProfile.
+.TP
+.I /var/lib/oprofile/samples/
+The location of the generated sample files.
+
+.SH VERSION
+.TP
+This man page is current for @PACKAGE@-@VERSION@.
+
+.SH SEE ALSO
+.BR @OP_DOCDIR@,
+.BR oprofile(1)
diff --git a/doc/opimport.1.in b/doc/opimport.1.in
new file mode 100644
index 0000000..ef8ef5c
--- /dev/null
+++ b/doc/opimport.1.in
@@ -0,0 +1,59 @@
+.TH OPIMPORT 1 "@DATE@" "oprofile @VERSION@"
+.UC 4
+.SH NAME
+opimport \- converts sample database files
+.SH SYNOPSIS
+.br
+.B opimport
+[
+.I options
+]
+input_file
+.SH DESCRIPTION
+
+.B opimport
+converts sample database files from a foreign binary format (abi) to the native format.
+
+.SH OPTIONS
+.TP
+.BI "--abi / -a"
+Input abi file description location.
+.br
+.TP
+.BI "--force / -f"
+Force conversion even if the input and output abi are identical.
+.br
+.TP
+.BI "--output / -o filename"
+Specify the output filename. If the output file already exists it is not overwritten but data are accumulated in. Sample filename are informative
+for post profile tools and must be kept identical, in other word the pathname
+from the first path component containing a '{' must be kept as it in the
+output filename.
+.br
+.TP
+.BI "--help / -? / --usage"
+Show help message.
+.br
+.TP
+.BI "--verbose / -V"
+Give verbose debugging output.
+.br
+.TP
+.BI "--version / -v"
+Show version.
+
+.SH ENVIRONMENT
+No special environment variables are recognised by opimport
+
+.SH FILES
+.TP
+.I /var/lib/oprofile/abi
+The abi file description of the sample database files
+
+.SH VERSION
+.TP
+This man page is current for @PACKAGE@-@VERSION@.
+
+.SH SEE ALSO
+.BR @OP_DOCDIR@,
+.BR oprofile(1)
diff --git a/doc/opreport.1.in b/doc/opreport.1.in
new file mode 100644
index 0000000..24fcca9
--- /dev/null
+++ b/doc/opreport.1.in
@@ -0,0 +1,140 @@
+.TH OPREPORT 1 "@DATE@" "oprofile @VERSION@"
+.UC 4
+.SH NAME
+opreport \- produce symbol or binary image summaries
+.SH SYNOPSIS
+.br
+.B opreport
+[
+.I options
+]
+[profile specification]
+.SH DESCRIPTION
+
+.B opreport
+outputs binary image summaries, or per-symbol data, from OProfile profiling
+sessions. See oprofile(1) for how to write profile specifications.
+
+.SH OPTIONS
+.TP
+.BI "--accumulated / -a"
+Accumulate sample and percentage counts in the symbol list.
+.br
+.TP
+.BI "--debug-info / -g"
+Show source file and line for each symbol.
+.br
+.TP
+.BI "--demangle / -D none|smart|normal"
+none: no demangling. normal: use default demangler (default) smart: use
+pattern-matching to make C++ symbol demangling more readable.
+.br
+.TP
+.BI "--callgraph / -c"
+Show call graph information if available.
+.br
+.TP
+.BI "--details / -d"
+Show per-instruction details for all selected symbols.
+.br
+.TP
+.BI "--exclude-dependent / -x"
+Do not include application-specific images for libraries, kernel modules
+and the kernel. This option only makes sense if the profile session
+used --separate.
+.br
+.TP
+.BI "--exclude-symbols / -e [symbols]"
+Exclude all the symbols in the given comma-separated list.
+.br
+.TP
+.BI "--global-percent / -%"
+Make all percentages relative to the whole profile.
+.br
+.TP
+.BI "--help / -? / --usage"
+Show help message.
+.br
+.TP
+.BI "--image-path / -p [paths]"
+Comma-separated list of additional paths to search for binaries.
+This is needed to find modules in kernels 2.6 and upwards.
+.br
+.TP
+.BI "--root / -R [path]"
+A path to a filesystem to search for additional binaries.
+.br
+.TP
+.BI "--include-symbols / -i [symbols]"
+Only include symbols in the given comma-separated list.
+.br
+.TP
+.BI "--long-filenames / -f"
+Output full paths instead of basenames.
+.br
+.TP
+.BI "--merge / -m [lib,cpu,tid,tgid,unitmask,all]"
+Merge any profiles separated in a --separate session.
+.br
+.TP
+.BI "--no-header"
+Don't output a header detailing profiling parameters.
+.br
+.TP
+.BI "--output-file / -o [file]"
+Output to the given file instead of stdout.
+.br
+.TP
+.BI "--reverse-sort / -r"
+Reverse the sort from the default.
+.br
+.TP
+.BI "--session-dir="dir_path
+Use sample database out of directory dir_path instead of the default location (/var/lib/oprofile).
+.br
+.TP
+.BI "--show-address / -w"
+Show each symbol's VMA address.
+.br
+.TP
+.BI "--sort / -s [vma,sample,symbol,debug,image]"
+Sort the list of symbols by, respectively, symbol address,
+number of samples, symbol name, debug filename and line number,
+binary image filename.
+.br
+.TP
+.BI "--symbols / -l"
+List per-symbol information instead of a binary image summary.
+.br
+.TP
+.BI "--threshold / -t [percentage]"
+Only output data for symbols that have more than the given percentage
+of total samples.
+.br
+.TP
+.BI "--verbose / -V [options]"
+Give verbose debugging output.
+.br
+.TP
+.BI "--version / -v"
+Show version.
+.br
+.TP
+.BI "--xml / -X"
+Generate XML output.
+
+.SH ENVIRONMENT
+No special environment variables are recognised by opreport.
+
+.SH FILES
+.TP
+.I /var/lib/oprofile/samples/
+The location of the generated sample files.
+
+.SH VERSION
+.TP
+This man page is current for @PACKAGE@-@VERSION@.
+
+.SH SEE ALSO
+.BR @OP_DOCDIR@,
+.BR oprofile(1)
diff --git a/doc/opreport.xsd b/doc/opreport.xsd
new file mode 100644
index 0000000..682a0bf
--- /dev/null
+++ b/doc/opreport.xsd
@@ -0,0 +1,279 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema
+ xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <xs:element name="profile">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="1" maxOccurs="1" ref="options"/>
+ <xs:element minOccurs="1" maxOccurs="1" ref="setup"/>
+ <xs:element minOccurs="0" maxOccurs="1" ref="classes"/>
+ <xs:choice>
+ <xs:element maxOccurs="unbounded" ref="process"/>
+ <!-- a binary can be either an application or a library -->
+ <xs:element maxOccurs="unbounded" ref="binary"/>
+ </xs:choice>
+ <xs:element minOccurs="1" maxOccurs="1" ref="symboltable"/>
+ <!-- put details last to allow parser to gather summary information -->
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="detailtable"/>
+ <!-- bytestable only present when details option used -->
+ <xs:element minOccurs="0" maxOccurs="1" ref="bytestable"/>
+ </xs:sequence>
+ <xs:attribute name="title" type="xs:string" use="required"/>
+ <!-- integer part of schemaversion should changes for major schema -->
+ <xs:attribute name="schemaversion" use="required">
+ <xs:simpleType>
+ <xs:restriction base = "xs:string">
+ <xs:pattern value = "3\.[0-9]+"/>
+ </xs:restriction>
+ </xs:simpleType> </xs:attribute>
+
+ <xs:attribute name="cputype" type="xs:NCName" use="required"/>
+ <xs:attribute name="processor" type="xs:NCName" use="required"/>
+ <xs:attribute name="mhz" type="xs:decimal" use="required"/>
+ <!-- separatedcpus is only used for profiles with separate=cpu -->
+ <xs:attribute name="separatedcpus" type="xs:nonNegativeInteger" use="optional"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="options">
+ <xs:complexType>
+ <xs:attribute name="session" type="xs:string" use="optional"/>
+ <xs:attribute name="debuginfo" type="xs:boolean" use="optional"/>
+ <xs:attribute name="details" type="xs:boolean" use="optional"/>
+ <xs:attribute name="excludedependent" type="xs:boolean" use="optional"/>
+ <xs:attribute name="excludesymbols" type="xs:string" use="optional"/>
+ <xs:attribute name="imagepath" type="xs:string" use="optional"/>
+ <xs:attribute name="includesymbols" type="xs:string" use="optional"/>
+ <xs:attribute name="merge" type="xs:string" use="optional"/>
+ <xs:attribute name="reversesort" type="xs:boolean" use="optional"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="setup">
+ <xs:complexType>
+ <xs:choice>
+ <xs:element maxOccurs="1" ref="timersetup"/>
+ <xs:element maxOccurs="unbounded" ref="eventsetup"/>
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="timersetup">
+ <xs:complexType>
+ <xs:attribute name="rtcinterrupts" type="xs:nonNegativeInteger"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="eventsetup">
+ <xs:complexType>
+ <xs:attribute name="id" type="xs:nonNegativeInteger" use="required"/>
+ <xs:attribute name="eventname" type="xs:Name" use="required"/>
+ <xs:attribute name="unitmask" type="xs:string" use="optional"/>
+ <xs:attribute name="setupcount" type="xs:nonNegativeInteger" use="required"/>
+ </xs:complexType>
+ </xs:element>
+
+ <!--
+ the cpu attribute will only be present in profiles with more than one
+ separated cpus. the event attribute will only appear if there is more
+ than one event in the profile. the mask attribute will only appear if
+ there is a single non-zero mask, or multiple mask values.
+ -->
+ <xs:element name="class">
+ <xs:complexType>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="cpu" type="xs:nonNegativeInteger" use="optional"/>
+ <xs:attribute name="event" type="xs:nonNegativeInteger" use="optional"/>
+ <xs:attribute name="mask" type="xs:nonNegativeInteger" use="optional"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="classes">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="1" maxOccurs="unbounded" ref="class"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="count">
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:nonNegativeInteger">
+ <!-- if no separation by cpu and only a single non masked event
+ the class attribute is unnecessary -->
+ <xs:attribute name="class" type="xs:string" use="optional"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="process">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="1" maxOccurs="1" ref="count"/>
+ <xs:element minOccurs="1" maxOccurs="unbounded" ref="thread"/>
+ </xs:sequence>
+ <xs:attribute name="pid" type="xs:integer" use="required"/>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="thread">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="1" maxOccurs="1" ref="count"/>
+ <xs:element minOccurs="1" maxOccurs="unbounded" ref="module"/>
+ </xs:sequence>
+ <xs:attribute name="tid" type="xs:integer" use="required"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="binary">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="1" maxOccurs="1" ref="count"/>
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="symbol"/>
+ <!-- When the separate=lib option is used an binary
+ can contain a list of library Modules. -->
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="module"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="module">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" maxOccurs="1" ref="count"/>
+ <xs:element minOccurs="1" maxOccurs="unbounded" ref="symbol"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="callees">
+ <xs:complexType>
+ <xs:choice>
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="module"/>
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="symbol"/>
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="callers">
+ <xs:complexType>
+ <xs:choice>
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="module"/>
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="symbol"/>
+ </xs:choice>
+ </xs:complexType>
+ </xs:element>
+
+
+ <xs:element name="symboltable">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="1" maxOccurs="unbounded" ref="symboldata"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <!--
+ The symboldata element contains the symbolic debug information that is
+ made available by the debug-info and details options. This information
+ is shared across by all module instances that reference it and thus it
+ does not contain any sample dependent data.
+ -->
+ <xs:element name="symboldata">
+ <xs:complexType>
+ <xs:attribute name="name" type="xs:string" use="required"/>
+ <xs:attribute name="id" type="xs:integer" use="required"/>
+ <!-- optional debug-info attributes -->
+ <xs:attribute name="file" type="xs:string" use="optional"/>
+ <xs:attribute name="line" type="xs:nonNegativeInteger" use="optional"/>
+ <!-- startingaddr: optional details or show-address attribute -->
+ <xs:attribute name="startingaddr" use="optional"/>
+ <!-- codelength: optional details attribute -->
+ <xs:attribute name="codelength" type="xs:integer" use="optional"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="symbol">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" maxOccurs="1" ref="callers"/>
+ <xs:element minOccurs="0" maxOccurs="1" ref="callees"/>
+ <xs:element minOccurs="0" maxOccurs="1" ref="count"/>
+ </xs:sequence>
+ <!-- idref is an index into symboltable table-->
+ <xs:attribute name="idref" type="xs:nonNegativeInteger" use="required"/>
+ <!-- self is a boolean to mark self referencing callee symbols -->
+ <xs:attribute name="self" type="xs:boolean" use="optional"/>
+ <!-- detaillo,detailhi lookup ids into corresponding symboldetails -->
+ <xs:attribute name="detaillo" type="xs:nonNegativeInteger" use="optional"/>
+ <xs:attribute name="detailhi" type="xs:nonNegativeInteger" use="optional"/>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- detailtable is a table of symboldetails that are referenced
+ from symboldata. The table is only generated with the details
+ option is used and appears at the end of the XML file so that
+ a GUI can process the summary data without having to process
+ all of the details. -->
+ <xs:element name="detailtable">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="1" maxOccurs="unbounded" ref="symboldetails"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <!-- symboldetails is a collection of all of the individual detaildata
+ associated with possibly multiple instances of a symbol. -->
+ <xs:element name="symboldetails">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="1" maxOccurs="unbounded" ref="detaildata"/>
+ </xs:sequence>
+ <xs:attribute name="id" type="xs:integer" use="required"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="detaildata">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="1" maxOccurs="unbounded" ref="count"/>
+ </xs:sequence>
+ <!-- line only occurs when debug-info option used -->
+ <xs:attribute name="line" type="xs:nonNegativeInteger" use="optional"/>
+ <!-- file only occurs when debug-info option used and
+ the file is different than the symbol associated with
+ this sample data. this situation can occur when inline functions
+ are defined in #include header files.
+ -->
+ <xs:attribute name="file" type="xs:string" use="optional"/>
+ <xs:attribute name="vmaoffset" type="xs:hexBinary" use="required"/>
+ <xs:attribute name="id" type="xs:integer" use="required"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="bytes">
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:hexBinary">
+ <xs:attribute name="id" type="xs:nonNegativeInteger" use="required"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="bytestable">
+ <xs:complexType>
+ <xs:sequence>
+ <!-- Contains binary data for the machine instructions -->
+ <xs:element minOccurs="1" maxOccurs="unbounded" ref="bytes"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+</xs:schema>
+
diff --git a/doc/oprofile.1 b/doc/oprofile.1
new file mode 100644
index 0000000..9c6cbb1
--- /dev/null
+++ b/doc/oprofile.1
@@ -0,0 +1,193 @@
+.TH OPROFILE 1 "Tue 24 November 2009" "oprofile 0.9.6"
+.UC 4
+.SH NAME
+oprofile \- a system-wide profiler
+.SH SYNOPSIS
+.br
+.B opcontrol
+[
+.I options
+]
+.br
+.B opreport
+[
+.I options
+]
+[ profile specification ]
+.br
+.B opannotate
+[
+.I options
+]
+[ profile specification ]
+.br
+.B oparchive
+[
+.I options
+]
+[ profile specification ]
+.br
+.B opgprof
+[
+.I options
+]
+[ profile specification ]
+.br
+.SH DESCRIPTION
+OProfile is a profiling system for systems running Linux
+2.2, 2.4, and 2.6. Profiling runs transparently in the background and profile
+data can be collected at any time. OProfile makes use of the hardware
+performance counters provided on Intel, AMD, and other processors,
+and uses a timer-interrupt based mechanism on CPUs without counters.
+OProfile can profile the whole system in high detail.
+.br
+For a gentle guide to using OProfile, please read the HTML documentation
+listed in SEE ALSO.
+.br
+.SH OPCONTROL
+.B opcontrol
+is used for starting and stopping the OProfile daemon, and providing set-up
+parameters.
+.SH OPREPORT
+.B opreport
+gives image and symbol-based profile summaries for the whole system or
+a subset of binary images.
+.SH OPANNOTATE
+.B opannotate
+can produce annotated source or mixed source and assembly output.
+.SH OPARCHIVE
+.B oparchive
+produces oprofile archive for offline analysis
+.SH OPGPROF
+.B opgprof
+can produce a gprof-format profile for a single binary.
+
+.SH PROFILE SPECIFICATIONS
+All of the post-profiling tools can take profile specifications,
+which is some combination of the following parameters. Enclosing
+part of a profile specification in curly braces { } can be used
+for differential profiles with
+.B opreport
+; the braces
+.B must
+be surrounded by whitespace.
+
+.TP
+.BI "archive:"archive
+Path to the archive to inspect, as generated by
+.B oparchive
+.br
+.TP
+.BI "session:"sessionlist
+A comma-separated list of session names to resolve in. Absence of this
+tag, unlike all others, means "the current session", equivalent to
+specifying "session:current".
+.br
+.TP
+.BI "session-exclude:"sessionlist
+A comma-separated list of sessions to exclude.
+.br
+.TP
+.BI "image:"imagelist
+A comma-separated list of image names to resolve. Each entry may be relative
+path, glob-style name, or full path, e.g.
+opreport 'image:/usr/bin/oprofiled,*op*,./oprofpp'
+.br
+.TP
+.BI "image-exclude:"imagelist
+Same as image:, but the matching images are excluded.
+.br
+.TP
+.BI "lib-image:"imagelist
+Same as image:, but only for images that are for
+a particular primary binary image (namely, an application). This only
+makes sense to use if you're using --separate.
+This includes kernel modules and the kernel when using
+--separate=kernel.
+.br
+.TP
+.BI "lib-image-exclude:"imagelist
+Same as <option>lib-image:</option>, but the matching images
+are excluded.
+.br
+.TP
+.BI "event:"eventname
+The symbolic event name to match on, e.g. event:DATA_MEM_REFS.
+.br
+.TP
+.BI "count:"eventcount
+The event count to match on, e.g. event:DATA_MEM_REFS count:30000.
+.br
+.TP
+.BI "unit-mask:"maskvalue
+The unit mask value of the event to match on, e.g. unit-mask:1.
+.br
+.TP
+.BI "cpu:"cpulist
+Only consider profiles for the given numbered CPU (starting from zero).
+This is only useful when using CPU profile separation.
+.br
+.TP
+.BI "tgid:"pidlist
+Only consider profiles for the given task groups. Unless some program is
+using threads, the task group ID of a process is the same as its process
+ID. This option corresponds to the POSIX notion of a thread group. This
+is only useful when using per-process profile separation.
+.br
+.TP
+.BI "tid:"tidlist
+Only consider profiles for the given threads. When using recent thread
+libraries, all threads in a process share the same task group ID, but
+have different thread IDs. You can use this option in combination with
+tgid: to restrict the results to particular threads within a process.
+This is only useful when using per-process profile separation.
+
+.SH ENVIRONMENT
+No special environment variables are recognised by oprofile.
+
+.SH FILES
+.TP
+.I $HOME/.oprofile/
+Configuration files
+.TP
+.I /root/.oprofile/daemonrc
+Configuration file for opcontrol
+.TP
+.I /usr/local/share/oprofile/
+Event description files used by OProfile.
+.TP
+.I /var/lib/oprofile/samples/oprofiled.log
+The user-space daemon logfile.
+.TP
+.I /var/lib/oprofile/opdev, /var/lib/oprofile/ophashmapdev, /var/lib/oprofile/opnotedev
+The device files for communication with the Linux 2.4 kernel module.
+.TP
+.I /dev/oprofile
+The device filesystem for communication with the Linux 2.6 kernel module.
+.TP
+.I /var/lib/oprofile/samples/
+The location of the generated sample files.
+
+.SH VERSION
+.TP
+This man page is current for oprofile-0.9.6.
+
+.SH SEE ALSO
+.BR /usr/local/share/doc/oprofile/,
+.BR opcontrol(1),
+.BR opreport(1),
+.BR opannotate(1),
+.BR oparchive(1),
+.BR opgprof(1),
+.BR gprof(1),
+.BR readprofile(1),
+.BR "CPU vendor architecture manuals"
+
+.SH COPYRIGHT
+oprofile is Copyright (C) 1998-2004 University of Manchester, UK, John Levon,
+and others.
+OProfile is released under the GNU General Public License, Version 2,
+or (at your option) any later version.
+.SH AUTHORS
+John Levon <levon@movementarian.org> is the primary author. See the documentation
+for other contributors.
diff --git a/doc/oprofile.1.in b/doc/oprofile.1.in
new file mode 100644
index 0000000..3d0f0ed
--- /dev/null
+++ b/doc/oprofile.1.in
@@ -0,0 +1,193 @@
+.TH OPROFILE 1 "@DATE@" "oprofile @VERSION@"
+.UC 4
+.SH NAME
+oprofile \- a system-wide profiler
+.SH SYNOPSIS
+.br
+.B opcontrol
+[
+.I options
+]
+.br
+.B opreport
+[
+.I options
+]
+[ profile specification ]
+.br
+.B opannotate
+[
+.I options
+]
+[ profile specification ]
+.br
+.B oparchive
+[
+.I options
+]
+[ profile specification ]
+.br
+.B opgprof
+[
+.I options
+]
+[ profile specification ]
+.br
+.SH DESCRIPTION
+OProfile is a profiling system for systems running Linux
+2.2, 2.4, and 2.6. Profiling runs transparently in the background and profile
+data can be collected at any time. OProfile makes use of the hardware
+performance counters provided on Intel, AMD, and other processors,
+and uses a timer-interrupt based mechanism on CPUs without counters.
+OProfile can profile the whole system in high detail.
+.br
+For a gentle guide to using OProfile, please read the HTML documentation
+listed in SEE ALSO.
+.br
+.SH OPCONTROL
+.B opcontrol
+is used for starting and stopping the OProfile daemon, and providing set-up
+parameters.
+.SH OPREPORT
+.B opreport
+gives image and symbol-based profile summaries for the whole system or
+a subset of binary images.
+.SH OPANNOTATE
+.B opannotate
+can produce annotated source or mixed source and assembly output.
+.SH OPARCHIVE
+.B oparchive
+produces oprofile archive for offline analysis
+.SH OPGPROF
+.B opgprof
+can produce a gprof-format profile for a single binary.
+
+.SH PROFILE SPECIFICATIONS
+All of the post-profiling tools can take profile specifications,
+which is some combination of the following parameters. Enclosing
+part of a profile specification in curly braces { } can be used
+for differential profiles with
+.B opreport
+; the braces
+.B must
+be surrounded by whitespace.
+
+.TP
+.BI "archive:"archive
+Path to the archive to inspect, as generated by
+.B oparchive
+.br
+.TP
+.BI "session:"sessionlist
+A comma-separated list of session names to resolve in. Absence of this
+tag, unlike all others, means "the current session", equivalent to
+specifying "session:current".
+.br
+.TP
+.BI "session-exclude:"sessionlist
+A comma-separated list of sessions to exclude.
+.br
+.TP
+.BI "image:"imagelist
+A comma-separated list of image names to resolve. Each entry may be relative
+path, glob-style name, or full path, e.g.
+opreport 'image:/usr/bin/oprofiled,*op*,./oprofpp'
+.br
+.TP
+.BI "image-exclude:"imagelist
+Same as image:, but the matching images are excluded.
+.br
+.TP
+.BI "lib-image:"imagelist
+Same as image:, but only for images that are for
+a particular primary binary image (namely, an application). This only
+makes sense to use if you're using --separate.
+This includes kernel modules and the kernel when using
+--separate=kernel.
+.br
+.TP
+.BI "lib-image-exclude:"imagelist
+Same as <option>lib-image:</option>, but the matching images
+are excluded.
+.br
+.TP
+.BI "event:"eventname
+The symbolic event name to match on, e.g. event:DATA_MEM_REFS.
+.br
+.TP
+.BI "count:"eventcount
+The event count to match on, e.g. event:DATA_MEM_REFS count:30000.
+.br
+.TP
+.BI "unit-mask:"maskvalue
+The unit mask value of the event to match on, e.g. unit-mask:1.
+.br
+.TP
+.BI "cpu:"cpulist
+Only consider profiles for the given numbered CPU (starting from zero).
+This is only useful when using CPU profile separation.
+.br
+.TP
+.BI "tgid:"pidlist
+Only consider profiles for the given task groups. Unless some program is
+using threads, the task group ID of a process is the same as its process
+ID. This option corresponds to the POSIX notion of a thread group. This
+is only useful when using per-process profile separation.
+.br
+.TP
+.BI "tid:"tidlist
+Only consider profiles for the given threads. When using recent thread
+libraries, all threads in a process share the same task group ID, but
+have different thread IDs. You can use this option in combination with
+tgid: to restrict the results to particular threads within a process.
+This is only useful when using per-process profile separation.
+
+.SH ENVIRONMENT
+No special environment variables are recognised by oprofile.
+
+.SH FILES
+.TP
+.I $HOME/.oprofile/
+Configuration files
+.TP
+.I /root/.oprofile/daemonrc
+Configuration file for opcontrol
+.TP
+.I @prefix@/share/oprofile/
+Event description files used by OProfile.
+.TP
+.I /var/lib/oprofile/samples/oprofiled.log
+The user-space daemon logfile.
+.TP
+.I /var/lib/oprofile/opdev, /var/lib/oprofile/ophashmapdev, /var/lib/oprofile/opnotedev
+The device files for communication with the Linux 2.4 kernel module.
+.TP
+.I /dev/oprofile
+The device filesystem for communication with the Linux 2.6 kernel module.
+.TP
+.I /var/lib/oprofile/samples/
+The location of the generated sample files.
+
+.SH VERSION
+.TP
+This man page is current for @PACKAGE@-@VERSION@.
+
+.SH SEE ALSO
+.BR @OP_DOCDIR@,
+.BR opcontrol(1),
+.BR opreport(1),
+.BR opannotate(1),
+.BR oparchive(1),
+.BR opgprof(1),
+.BR gprof(1),
+.BR readprofile(1),
+.BR "CPU vendor architecture manuals"
+
+.SH COPYRIGHT
+oprofile is Copyright (C) 1998-2004 University of Manchester, UK, John Levon,
+and others.
+OProfile is released under the GNU General Public License, Version 2,
+or (at your option) any later version.
+.SH AUTHORS
+John Levon <levon@movementarian.org> is the primary author. See the documentation
+for other contributors.
diff --git a/doc/oprofile.html b/doc/oprofile.html
new file mode 100644
index 0000000..1361383
--- /dev/null
+++ b/doc/oprofile.html
@@ -0,0 +1,5373 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ <title>OProfile manual</title>
+ <meta name="generator" content="DocBook XSL Stylesheets V1.69.1" />
+ </head>
+ <body>
+ <div class="book" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h1 class="title"><a id="oprofile-guide"></a>OProfile manual</h1>
+ </div>
+ <div>
+ <div class="authorgroup">
+ <div class="author">
+ <h3 class="author"><span class="firstname">John</span> <span class="surname">Levon</span></h3>
+ <div class="affiliation">
+ <div class="address">
+ <p>
+ <code class="email">&lt;<a href="mailto:levon@movementarian.org">levon@movementarian.org</a>&gt;</code>
+ </p>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div>
+ <p class="copyright">Copyright © 2000-2004 Victoria University of Manchester, John Levon and others</p>
+ </div>
+ </div>
+ <hr />
+ </div>
+ <div class="toc">
+ <p>
+ <b>Table of Contents</b>
+ </p>
+ <dl>
+ <dt>
+ <span class="chapter">
+ <a href="#introduction">1. Introduction</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect1">
+ <a href="#applications">1. Applications of OProfile</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect2">
+ <a href="#jitsupport">1.1. Support for dynamically compiled (JIT) code</a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ <dt>
+ <span class="sect1">
+ <a href="#requirements">2. System requirements</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#resources">3. Internet resources</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#install">4. Installation</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#uninstall">5. Uninstalling OProfile</a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ <dt>
+ <span class="chapter">
+ <a href="#overview">2. Overview</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect1">
+ <a href="#getting-started">1. Getting started</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#tools-overview">2. Tools summary</a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ <dt>
+ <span class="chapter">
+ <a href="#controlling">3. Controlling the profiler</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect1">
+ <a href="#controlling-daemon">1. Using <span><strong class="command">opcontrol</strong></span></a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect2">
+ <a href="#opcontrolexamples">1.1. Examples</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#eventspec">1.2. Specifying performance counter events</a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ <dt>
+ <span class="sect1">
+ <a href="#setup-jit">2. Setting up the JIT profiling feature</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect2">
+ <a href="#setup-jit-jvm">2.1. JVM instrumentation</a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ <dt>
+ <span class="sect1">
+ <a href="#oprofile-gui">3. Using <span><strong class="command">oprof_start</strong></span></a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#detailed-parameters">4. Configuration details</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect2">
+ <a href="#hardware-counters">4.1. Hardware performance counters</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#rtc">4.2. OProfile in RTC mode</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#timer">4.3. OProfile in timer interrupt mode</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#p4">4.4. Pentium 4 support</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#ia64">4.5. Intel Itanium 2 support</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#ppc64">4.6. PowerPC64 support</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#cell-be">4.7. Cell Broadband Engine support</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#amd-ibs-support">4.8. AMD64 (x86_64) Instruction-Based Sampling (IBS) support</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#misuse">4.9. Dangerous counter settings</a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ </dl>
+ </dd>
+ <dt>
+ <span class="chapter">
+ <a href="#results">4. Obtaining results</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect1">
+ <a href="#profile-spec">1. Profile specifications</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect2">
+ <a href="#profile-spec-examples">1.1. Examples</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#profile-spec-details">1.2. Profile specification parameters</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#locating-and-managing-binary-images">1.3. Locating and managing binary images</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#no-results">1.4. What to do when you don't get any results</a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ <dt>
+ <span class="sect1">
+ <a href="#opreport">2. Image summaries and symbol summaries (<span><strong class="command">opreport</strong></span>)</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect2">
+ <a href="#opreport-merging">2.1. Merging separate profiles</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#opreport-comparison">2.2. Side-by-side multiple results</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#opreport-callgraph">2.3. Callgraph output</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#opreport-diff">2.4. Differential profiles with <span><strong class="command">opreport</strong></span></a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#opreport-anon">2.5. Anonymous executable mappings</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#opreport-xml">2.6. XML formatted output</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#opreport-options">2.7. Options for <span><strong class="command">opreport</strong></span></a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ <dt>
+ <span class="sect1">
+ <a href="#opannotate">3. Outputting annotated source (<span><strong class="command">opannotate</strong></span>)</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect2">
+ <a href="#opannotate-finding-source">3.1. Locating source files</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#opannotate-details">3.2. Usage of <span><strong class="command">opannotate</strong></span></a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ <dt>
+ <span class="sect1">
+ <a href="#getting-jit-reports">4. OProfile results with JIT samples</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#opgprof">5. <span><strong class="command">gprof</strong></span>-compatible output (<span><strong class="command">opgprof</strong></span>)</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect2">
+ <a href="#opgprof-details">5.1. Usage of <span><strong class="command">opgprof</strong></span></a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ <dt>
+ <span class="sect1">
+ <a href="#oparchive">6. Archiving measurements (<span><strong class="command">oparchive</strong></span>)</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect2">
+ <a href="#oparchive-details">6.1. Usage of <span><strong class="command">oparchive</strong></span></a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ <dt>
+ <span class="sect1">
+ <a href="#opimport">7. Converting sample database files (<span><strong class="command">opimport</strong></span>)</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect2">
+ <a href="#opimport-details">7.1. Usage of <span><strong class="command">opimport</strong></span></a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ </dl>
+ </dd>
+ <dt>
+ <span class="chapter">
+ <a href="#interpreting">5. Interpreting profiling results</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect1">
+ <a href="#irq-latency">1. Profiling interrupt latency</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#kernel-profiling">2. Kernel profiling</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect2">
+ <a href="#irq-masking">2.1. Interrupt masking</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#idle">2.2. Idle time</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#kernel-modules">2.3. Profiling kernel modules</a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ <dt>
+ <span class="sect1">
+ <a href="#interpreting-callgraph">3. Interpreting call-graph profiles</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#debug-info">4. Inaccuracies in annotated source</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect2">
+ <a href="#effect-of-optimizations">4.1. Side effects of optimizations</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#prologues">4.2. Prologues and epilogues</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#inlined-function">4.3. Inlined functions</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#wrong-linenr-info">4.4. Inaccuracy in line number information</a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ <dt>
+ <span class="sect1">
+ <a href="#symbol-without-debug-info">5. Assembly functions</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#overlapping-symbols">6. Overlapping symbols in JITed code</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#hidden-cost">7. Other discrepancies</a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ <dt>
+ <span class="chapter">
+ <a href="#ack">6. Acknowledgments</a>
+ </span>
+ </dt>
+ </dl>
+ </div>
+ <div class="chapter" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title"><a id="introduction"></a>Chapter 1. Introduction</h2>
+ </div>
+ </div>
+ </div>
+ <div class="toc">
+ <p>
+ <b>Table of Contents</b>
+ </p>
+ <dl>
+ <dt>
+ <span class="sect1">
+ <a href="#applications">1. Applications of OProfile</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect2">
+ <a href="#jitsupport">1.1. Support for dynamically compiled (JIT) code</a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ <dt>
+ <span class="sect1">
+ <a href="#requirements">2. System requirements</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#resources">3. Internet resources</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#install">4. Installation</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#uninstall">5. Uninstalling OProfile</a>
+ </span>
+ </dt>
+ </dl>
+ </div>
+ <p>
+This manual applies to OProfile version 0.9.6.
+OProfile is a profiling system for Linux 2.2/2.4/2.6 systems on a number of architectures. It is capable of profiling
+all parts of a running system, from the kernel (including modules and interrupt handlers) to shared libraries
+to binaries. It runs transparently in the background collecting information at a low overhead. These
+features make it ideal for profiling entire systems to determine bottle necks in real-world systems.
+</p>
+ <p>
+Many CPUs provide "performance counters", hardware registers that can count "events"; for example,
+cache misses, or CPU cycles. OProfile provides profiles of code based on the number of these occurring events:
+repeatedly, every time a certain (configurable) number of events has occurred, the PC value is recorded.
+This information is aggregated into profiles for each binary image.</p>
+ <p>
+Some hardware setups do not allow OProfile to use performance counters: in these cases, no
+events are available, and OProfile operates in timer/RTC mode, as described in later chapters.
+</p>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="applications"></a>1. Applications of OProfile</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+OProfile is useful in a number of situations. You might want to use OProfile when you :
+</p>
+ <div class="itemizedlist">
+ <ul type="disc">
+ <li>
+ <p>need low overhead</p>
+ </li>
+ <li>
+ <p>cannot use highly intrusive profiling methods</p>
+ </li>
+ <li>
+ <p>need to profile interrupt handlers</p>
+ </li>
+ <li>
+ <p>need to profile an application and its shared libraries</p>
+ </li>
+ <li>
+ <p>need to profile dynamically compiled code of supported virtual machines (see <a href="#jitsupport" title="1.1. Support for dynamically compiled (JIT) code">Section 1.1, &#8220;Support for dynamically compiled (JIT) code&#8221;</a>)</p>
+ </li>
+ <li>
+ <p>need to capture the performance behaviour of entire system</p>
+ </li>
+ <li>
+ <p>want to examine hardware effects such as cache misses</p>
+ </li>
+ <li>
+ <p>want detailed source annotation</p>
+ </li>
+ <li>
+ <p>want instruction-level profiles</p>
+ </li>
+ <li>
+ <p>want call-graph profiles</p>
+ </li>
+ </ul>
+ </div>
+ <p>
+OProfile is not a panacea. OProfile might not be a complete solution when you :
+</p>
+ <div class="itemizedlist">
+ <ul type="disc">
+ <li>
+ <p>require call graph profiles on platforms other than 2.6/x86</p>
+ </li>
+ <li>
+ <p>don't have root permissions</p>
+ </li>
+ <li>
+ <p>require 100% instruction-accurate profiles</p>
+ </li>
+ <li>
+ <p>need function call counts or an interstitial profiling API</p>
+ </li>
+ <li>
+ <p>cannot tolerate any disturbance to the system whatsoever</p>
+ </li>
+ <li>
+ <p>need to profile interpreted or dynamically compiled code of non-supported virtual machines</p>
+ </li>
+ </ul>
+ </div>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="jitsupport"></a>1.1. Support for dynamically compiled (JIT) code</h3>
+ </div>
+ </div>
+ </div>
+ <p>
+Older versions of OProfile were not capable of attributing samples to symbols from dynamically
+compiled code, i.e. "just-in-time (JIT) code". Typical JIT compilers load the JIT code into
+anonymous memory regions. OProfile reported the samples from such code, but the attribution
+provided was simply:
+ </p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">"anon: &lt;tgid&gt;&lt;address range&gt;" </pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+Due to this limitation, it wasn't possible to profile applications executed by virtual machines (VMs)
+like the Java Virtual Machine. OProfile now contains an infrastructure to support JITed code.
+A development library is provided to allow developers
+to add support for any VM that produces dynamically compiled code (see the <span class="emphasis"><em>OProfile JIT agent
+developer guide</em></span>).
+In addition, built-in support is included for the following:</p>
+ <div class="itemizedlist">
+ <ul type="disc">
+ <li>JVMTI agent library for Java (1.5 and higher)</li>
+ <li>JVMPI agent library for Java (1.5 and lower)</li>
+ </ul>
+ </div>
+ <p>
+For information on how to use OProfile's JIT support, see <a href="#setup-jit" title="2. Setting up the JIT profiling feature">Section 2, &#8220;Setting up the JIT profiling feature&#8221;</a>.
+</p>
+ </div>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="requirements"></a>2. System requirements</h2>
+ </div>
+ </div>
+ </div>
+ <div class="variablelist">
+ <dl>
+ <dt>
+ <span class="term">Linux kernel 2.2/2.4/2.6</span>
+ </dt>
+ <dd>
+ <p>
+ OProfile uses a kernel module that can be compiled for
+ 2.2.11 or later and 2.4. 2.4.10 or above is required if you use the
+ boot-time kernel option <code class="option">nosmp</code>. 2.6 kernels are supported with the in-kernel
+ OProfile driver. Note that only 32-bit x86 and IA64 are supported on 2.2/2.4 kernels.
+ </p>
+ <p>
+ 2.6 kernels are strongly recommended. Under 2.4, OProfile may cause system crashes if power
+ management is used, or the BIOS does not correctly deal with local APICs.
+ </p>
+ <p>
+ PPC64 processors (Power4/Power5/PPC970, etc.) require a recent (&gt; 2.6.5) kernel with the line
+ <code class="constant">#define PV_970</code> present in <code class="filename">include/asm-ppc64/processor.h</code>.
+
+ </p>
+ <p>
+ Profiling the Cell Broadband Engine PowerPC Processing Element (PPE) requires a kernel version
+ of 2.6.18 or more recent.
+ Profiling the Cell Broadband Engine Synergistic Processing Element (SPE) requires a kernel version
+ of 2.6.22 or more recent. Additionally, full support of SPE profiling requires a BFD library
+ from binutils code dated January 2007 or later. To ensure the proper BFD support exists, run
+ the <code class="code">configure</code> utility with <code class="code">--with-target=cell-be</code>.
+
+ Profiling the Cell Broadband Engine using SPU events requires a kernel version of 2.6.29-rc1
+ or more recent.
+
+ </p>
+ <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3>Attempting to profile SPEs with kernel versions older than 2.6.22 may cause the
+ system to crash.</div>
+ <p>
+ </p>
+ <p>
+ Instruction-Based Sampling (IBS) profile on AMD family10h processors requires
+ kernel version 2.6.28-rc2 or later.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">modutils 2.4.6 or above</span>
+ </dt>
+ <dd>
+ <p>
+ You should have installed modutils 2.4.6 or higher (in fact earlier versions work well in almost all
+ cases).
+ </p>
+ </dd>
+ <dt>
+ <span class="term">Supported architecture</span>
+ </dt>
+ <dd>
+ <p>
+ For Intel IA32, a CPU with either a P6 generation or Pentium 4 core is
+ required. In marketing terms this translates to anything
+ between an Intel Pentium Pro (not Pentium Classics) and
+ a Pentium 4 / Xeon, including all Celerons. The AMD
+ Athlon, Opteron, Phenom, and Turion CPUs are also supported. Other IA32
+ CPU types only support the RTC mode of OProfile; please
+ see later in this manual for details. Hyper-threaded Pentium IVs
+ are not supported in 2.4. For 2.4 kernels, the Intel
+ IA-64 CPUs are also supported. For 2.6 kernels, there is additionally
+ support for Alpha processors, MIPS, ARM, x86-64, sparc64, ppc64, AVR32, and,
+ in timer mode, PA-RISC and s390.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">Uniprocessor or SMP</span>
+ </dt>
+ <dd>
+ <p>
+ SMP machines are fully supported.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">Required libraries</span>
+ </dt>
+ <dd>
+ <p>
+ These libraries are required : <code class="filename">popt</code>, <code class="filename">bfd</code>,
+ <code class="filename">liberty</code> (debian users: libiberty is provided in binutils-dev package), <code class="filename">dl</code>,
+ plus the standard C++ libraries.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">Required user account</span>
+ </dt>
+ <dd>
+ <p>
+ For secure processing of sample data from JIT virtual machines (e.g., Java),
+ the special user account "oprofile" must exist on the system. The 'configure'
+ and 'make install' operations will print warning messages if this
+ account is not found. If you intend to profile JITed code, you must create
+ a group account named 'oprofile' and then create the 'oprofile' user account,
+ setting the default group to 'oprofile'. A runtime error message is printed to
+ the oprofile daemon log when processing JIT samples if this special user
+ account cannot be found.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">OProfile GUI</span>
+ </dt>
+ <dd>
+ <p>
+ The use of the GUI to start the profiler requires the <code class="filename">Qt 2</code> library. <code class="filename">Qt 3</code> should
+ also work.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">
+ <span class="acronym">ELF</span>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ Probably not too strenuous a requirement, but older <span class="acronym">A.OUT</span> binaries/libraries are not supported.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">K&amp;R coding style</span>
+ </dt>
+ <dd>
+ <p>
+ OK, so it's not really a requirement, but I wish it was...
+ </p>
+ </dd>
+ </dl>
+ </div>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="resources"></a>3. Internet resources</h2>
+ </div>
+ </div>
+ </div>
+ <div class="variablelist">
+ <dl>
+ <dt>
+ <span class="term">Web page</span>
+ </dt>
+ <dd>
+ <p>
+ There is a web page (which you may be reading now) at
+ <a href="http://oprofile.sf.net/">http://oprofile.sf.net/</a>.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">Download</span>
+ </dt>
+ <dd>
+ <p>
+ You can download a source tarball or get anonymous CVS at the sourceforge page,
+ <a href="http://sf.net/projects/oprofile/">http://sf.net/projects/oprofile/</a>.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">Mailing list</span>
+ </dt>
+ <dd>
+ <p>
+ There is a low-traffic OProfile-specific mailing list, details at
+ <a href="http://sf.net/mail/?group_id=16191">http://sf.net/mail/?group_id=16191</a>.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">Bug tracker</span>
+ </dt>
+ <dd>
+ <p>
+ There is a bug tracker for OProfile at SourceForge,
+ <a href="http://sf.net/tracker/?group_id=16191&amp;atid=116191">http://sf.net/tracker/?group_id=16191&amp;atid=116191</a>.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">IRC channel</span>
+ </dt>
+ <dd>
+ <p>
+ Several OProfile developers and users sometimes hang out on channel <span><strong class="command">#oprofile</strong></span>
+ on the <a href="http://oftc.net">OFTC</a> network.
+ </p>
+ </dd>
+ </dl>
+ </div>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="install"></a>4. Installation</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+First you need to build OProfile and install it. <span><strong class="command">./configure</strong></span>, <span><strong class="command">make</strong></span>, <span><strong class="command">make install</strong></span>
+is often all you need, but note these arguments to <span><strong class="command">./configure</strong></span> :
+</p>
+ <div class="variablelist">
+ <dl>
+ <dt>
+ <span class="term">
+ <code class="option">--with-linux</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ Use this option to specify the location of the kernel source tree you wish
+ to compile against. The kernel module is built against this source and
+ will only work with a running kernel built from the same source with
+ exact same options, so it is important you specify this option if you need
+ to.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--with-java</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ Use this option if you need to profile Java applications. Also, see
+ <a href="#requirements" title="2. System requirements">Section 2, &#8220;System requirements&#8221;</a>, "Required user account". This option
+ is used to specify the location of the Java Development Kit (JDK)
+ source tree you wish to use. This is necessary to get the interface description
+ of the JVMPI (or JVMTI) interface to compile the JIT support code successfully.
+ </p>
+ <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
+ <h3 class="title">Note</h3>
+ <p>
+ The Java Runtime Environment (JRE) does not include the development
+ files that are required to compile the JIT support code, so the full
+ JDK must be installed in order to use this option.
+ </p>
+ </div>
+ <p>
+ By default, the Oprofile JIT support libraries will be installed in
+ <code class="filename">&lt;oprof_install_dir&gt;/lib/oprofile</code>. To build
+ and install OProfile and the JIT support libraries as 64-bit, you can
+ do something like the following:
+ </p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+ # CFLAGS="-m64" CXXFLAGS="-m64" ./configure \
+ --with-kernel-support --with-java={my_jdk_installdir} \
+ --libdir=/usr/local/lib64
+ </pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+ </p>
+ <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
+ <h3 class="title">Note</h3>
+ <p>
+ If you encounter errors building 64-bit, you should
+ install libtool 1.5.26 or later since that release of
+ libtool fixes known problems for certain platforms.
+ If you install libtool into a non-standard location,
+ you'll need to edit the invocation of 'aclocal' in
+ OProfile's autogen.sh as follows (assume an install
+ location of /usr/local):
+ </p>
+ <p>
+ <code class="code">aclocal -I m4 -I /usr/local/share/aclocal</code>
+ </p>
+ </div>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--with-kernel-support</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ Use this option with 2.6 and above kernels to indicate the
+ kernel provides the OProfile device driver.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--with-qt-dir/includes/libraries</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ Specify the location of Qt headers and libraries. It defaults to searching in
+ <code class="constant">$QTDIR</code> if these are not specified.
+ </p>
+ </dd>
+ <dt>
+ <a id="disable-werror"></a>
+ <span class="term">
+ <code class="option">--disable-werror</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ Development versions of OProfile build by
+ default with <code class="option">-Werror</code>. This option turns
+ <code class="option">-Werror</code> off.
+ </p>
+ </dd>
+ <dt>
+ <a id="disable-optimization"></a>
+ <span class="term">
+ <code class="option">--disable-optimization</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ Disable the <code class="option">-O2</code> compiler flag
+ (useful if you discover an OProfile bug and want to give a useful
+ back-trace etc.)
+ </p>
+ </dd>
+ </dl>
+ </div>
+ <p>
+You'll need to have a configured kernel source for the current kernel
+to build the module for 2.4 kernels. Since all distributions provide different kernels it's unlikely the running kernel match the configured source
+you installed. The safest way is to recompile your own kernel, run it and compile oprofile. It is also recommended that if you have a
+uniprocessor machine, you enable the local APIC / IO_APIC support for
+your kernel (this is automatically enabled for SMP kernels). With many BIOS, kernel &gt;= 2.6.9 and UP kernel it's not sufficient to enable the local APIC you must also turn it on explicitly at boot time by providing "lapic" option to the kernel. On
+machines with power management, such as laptops, the power management
+must be turned off when using OProfile with 2.4 kernels. The power management software
+in the BIOS cannot handle the non-maskable interrupts (NMIs) used by
+OProfile for data collection. If you use the NMI watchdog, be aware that
+the watchdog is disabled when profiling starts, and not re-enabled until the
+OProfile module is removed (or, in 2.6, when OProfile is not running). If you compile OProfile for
+a 2.2 kernel you must be root to compile the module. If you are using
+2.6 kernels or higher, you do not need kernel source, as long as the
+OProfile driver is enabled; additionally, you should not need to disable
+power management.
+</p>
+ <p>
+Please note that you must save or have available the <code class="filename">vmlinux</code> file
+generated during a kernel compile, as OProfile needs it (you can use
+<code class="option">--no-vmlinux</code>, but this will prevent kernel profiling).
+</p>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="uninstall"></a>5. Uninstalling OProfile</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+You must have the source tree available to uninstall OProfile; a <span><strong class="command">make uninstall</strong></span> will
+remove all installed files except your configuration file in the directory <code class="filename">~/.oprofile</code>.
+</p>
+ </div>
+ </div>
+ <div class="chapter" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title"><a id="overview"></a>Chapter 2. Overview</h2>
+ </div>
+ </div>
+ </div>
+ <div class="toc">
+ <p>
+ <b>Table of Contents</b>
+ </p>
+ <dl>
+ <dt>
+ <span class="sect1">
+ <a href="#getting-started">1. Getting started</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#tools-overview">2. Tools summary</a>
+ </span>
+ </dt>
+ </dl>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="getting-started"></a>1. Getting started</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+Before you can use OProfile, you must set it up. The minimum setup required for this
+is to tell OProfile where the <code class="filename">vmlinux</code> file corresponding to the
+running kernel is, for example :
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">opcontrol --vmlinux=/boot/vmlinux-`uname -r`</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+If you don't want to profile the kernel itself,
+you can tell OProfile you don't have a <code class="filename">vmlinux</code> file :
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">opcontrol --no-vmlinux</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+Now we are ready to start the daemon (<span><strong class="command">oprofiled</strong></span>) which collects
+the profile data :
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">opcontrol --start</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+When I want to stop profiling, I can do so with :
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">opcontrol --shutdown</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+Note that unlike <span><strong class="command">gprof</strong></span>, no instrumentation (<code class="option">-pg</code>
+and <code class="option">-a</code> options to <span><strong class="command">gcc</strong></span>)
+is necessary.
+</p>
+ <p>
+Periodically (or on <span><strong class="command">opcontrol --shutdown</strong></span> or <span><strong class="command">opcontrol --dump</strong></span>)
+the profile data is written out into the $SESSION_DIR/samples directory (by default at <code class="filename">/var/lib/oprofile/samples</code>).
+These profile files cover shared libraries, applications, the kernel (vmlinux), and kernel modules.
+You can clear the profile data (at any time) with <span><strong class="command">opcontrol --reset</strong></span>.
+</p>
+ <p>
+To place these sample database files in a specific directory instead of the default location (<code class="filename">/var/lib/oprofile</code>) use the <code class="option">--session-dir=dir</code> option. You must also specify the <code class="option">--session-dir</code> to tell the tools to continue using this directory. (In the future, we should allow this to be specified in an environment variable.) :
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">opcontrol --no-vmlinux --session-dir=/home/me/tmpsession</pre>
+ </td>
+ </tr>
+ </table>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">opcontrol --start --session-dir=/home/me/tmpsession</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+You can get summaries of this data in a number of ways at any time. To get a summary of
+data across the entire system for all of these profiles, you can do :
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">opreport [--session-dir=dir]</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+Or to get a more detailed summary, for a particular image, you can do something like :
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">opreport -l /boot/vmlinux-`uname -r`</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+There are also a number of other ways of presenting the data, as described later in this manual.
+Note that OProfile will choose a default profiling setup for you. However, there are a number
+of options you can pass to <span><strong class="command">opcontrol</strong></span> if you need to change something,
+also detailed later.
+</p>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="tools-overview"></a>2. Tools summary</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+This section gives a brief description of the available OProfile utilities and their purpose.
+</p>
+ <div class="variablelist">
+ <dl>
+ <dt>
+ <span class="term">
+ <code class="filename">ophelp</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ This utility lists the available events and short descriptions.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="filename">opcontrol</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ Used for controlling the OProfile data collection, discussed in <a href="#controlling" title="Chapter 3. Controlling the profiler">Chapter 3, <i>Controlling the profiler</i></a>.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="filename">agent libraries</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ Used by virtual machines (like the Java VM) to record information about JITed code being profiled. See <a href="#setup-jit" title="2. Setting up the JIT profiling feature">Section 2, &#8220;Setting up the JIT profiling feature&#8221;</a>.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="filename">opreport</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ This is the main tool for retrieving useful profile data, described in
+ <a href="#opreport" title="2. Image summaries and symbol summaries (opreport)">Section 2, &#8220;Image summaries and symbol summaries (<span><strong class="command">opreport</strong></span>)&#8221;</a>.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="filename">opannotate</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ This utility can be used to produce annotated source, assembly or mixed source/assembly.
+ Source level annotation is available only if the application was compiled with
+ debugging symbols. See <a href="#opannotate" title="3. Outputting annotated source (opannotate)">Section 3, &#8220;Outputting annotated source (<span><strong class="command">opannotate</strong></span>)&#8221;</a>.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="filename">opgprof</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ This utility can output gprof-style data files for a binary, for use with
+ <span><strong class="command">gprof -p</strong></span>. See <a href="#opgprof" title="5. gprof-compatible output (opgprof)">Section 5, &#8220;<span><strong class="command">gprof</strong></span>-compatible output (<span><strong class="command">opgprof</strong></span>)&#8221;</a>.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="filename">oparchive</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ This utility can be used to collect executables, debuginfo,
+ and sample files and copy the files into an archive.
+ The archive is self-contained and can be moved to another
+ machine for further analysis.
+ See <a href="#oparchive" title="6. Archiving measurements (oparchive)">Section 6, &#8220;Archiving measurements (<span><strong class="command">oparchive</strong></span>)&#8221;</a>.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="filename">opimport</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ This utility converts sample database files from a foreign binary format (abi) to
+ the native format. This is useful only when moving sample files between hosts,
+ for analysis on platforms other than the one used for collection.
+ See <a href="#opimport" title="7. Converting sample database files (opimport)">Section 7, &#8220;Converting sample database files (<span><strong class="command">opimport</strong></span>)&#8221;</a>.
+ </p>
+ </dd>
+ </dl>
+ </div>
+ </div>
+ </div>
+ <div class="chapter" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title"><a id="controlling"></a>Chapter 3. Controlling the profiler</h2>
+ </div>
+ </div>
+ </div>
+ <div class="toc">
+ <p>
+ <b>Table of Contents</b>
+ </p>
+ <dl>
+ <dt>
+ <span class="sect1">
+ <a href="#controlling-daemon">1. Using <span><strong class="command">opcontrol</strong></span></a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect2">
+ <a href="#opcontrolexamples">1.1. Examples</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#eventspec">1.2. Specifying performance counter events</a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ <dt>
+ <span class="sect1">
+ <a href="#setup-jit">2. Setting up the JIT profiling feature</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect2">
+ <a href="#setup-jit-jvm">2.1. JVM instrumentation</a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ <dt>
+ <span class="sect1">
+ <a href="#oprofile-gui">3. Using <span><strong class="command">oprof_start</strong></span></a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#detailed-parameters">4. Configuration details</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect2">
+ <a href="#hardware-counters">4.1. Hardware performance counters</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#rtc">4.2. OProfile in RTC mode</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#timer">4.3. OProfile in timer interrupt mode</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#p4">4.4. Pentium 4 support</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#ia64">4.5. Intel Itanium 2 support</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#ppc64">4.6. PowerPC64 support</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#cell-be">4.7. Cell Broadband Engine support</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#amd-ibs-support">4.8. AMD64 (x86_64) Instruction-Based Sampling (IBS) support</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#misuse">4.9. Dangerous counter settings</a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ </dl>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="controlling-daemon"></a>1. Using <span><strong class="command">opcontrol</strong></span></h2>
+ </div>
+ </div>
+ </div>
+ <p>
+In this section we describe the configuration and control of the profiling system
+with opcontrol in more depth.
+The <span><strong class="command">opcontrol</strong></span> script has a default setup, but you
+can alter this with the options given below. In particular,
+if your hardware supports performance counters, you can configure them.
+There are a number of counters (for example, counter 0 and counter 1
+on the Pentium III). Each of these counters can be programmed with
+an event to count, such as cache misses or MMX operations. The event
+chosen for each counter is reflected in the profile data collected
+by OProfile: functions and binaries at the top of the profiles reflect
+that most of the chosen events happened within that code.
+</p>
+ <p>
+Additionally, each counter has a "count" value: this corresponds to how
+detailed the profile is. The lower the value, the more frequently profile
+samples are taken. A counter can choose to sample only kernel code, user-space code,
+or both (both is the default). Finally, some events have a "unit mask"
+- this is a value that further restricts the types of event that are counted.
+The event types and unit masks for your CPU are listed by <span><strong class="command">opcontrol
+--list-events</strong></span>.
+</p>
+ <p>
+The <span><strong class="command">opcontrol</strong></span> script provides the following actions :
+</p>
+ <div class="variablelist">
+ <dl>
+ <dt>
+ <span class="term">
+ <code class="option">--init</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ Loads the OProfile module if required and makes the OProfile driver
+ interface available.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--setup</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ Followed by list arguments for profiling set up. List of arguments
+ saved in <code class="filename">/root/.oprofile/daemonrc</code>.
+ Giving this option is not necessary; you can just directly pass one
+ of the setup options, e.g. <span><strong class="command">opcontrol --no-vmlinux</strong></span>.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--status</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ Show configuration information.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--start-daemon</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ Start the oprofile daemon without starting actual profiling. The profiling
+ can then be started using <code class="option">--start</code>. This is useful for avoiding
+ measuring the cost of daemon startup, as <code class="option">--start</code> is a simple
+ write to a file in oprofilefs. Not available in 2.2/2.4 kernels.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--start</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ Start data collection with either arguments provided by <code class="option">--setup</code>
+ or information saved in <code class="filename">/root/.oprofile/daemonrc</code>. Specifying
+ the addition <code class="option">--verbose</code> makes the daemon generate lots of debug data
+ whilst it is running.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--dump</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ Force a flush of the collected profiling data to the daemon.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--stop</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ Stop data collection (this separate step is not possible with 2.2 or 2.4 kernels).
+ </p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--shutdown</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ Stop data collection and kill the daemon.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--reset</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ Clears out data from current session, but leaves saved sessions.
+ </p>
+ </dd>
+ <dt>
+ <span class="term"><code class="option">--save=</code>session_name</span>
+ </dt>
+ <dd>
+ <p>
+ Save data from current session to session_name.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--deinit</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ Shuts down daemon. Unload the OProfile module and oprofilefs.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--list-events</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ List event types and unit masks.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--help</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ Generate usage messages.
+ </p>
+ </dd>
+ </dl>
+ </div>
+ <p>
+There are a number of possible settings, of which, only
+<code class="option">--vmlinux</code> (or <code class="option">--no-vmlinux</code>)
+is required. These settings are stored in <code class="filename">~/.oprofile/daemonrc</code>.
+</p>
+ <div class="variablelist">
+ <dl>
+ <dt>
+ <span class="term"><code class="option">--buffer-size=</code>num</span>
+ </dt>
+ <dd>
+ <p>
+ Number of samples in kernel buffer. When using a 2.6 kernel
+ buffer watershed need to be tweaked when changing this value.
+ </p>
+ </dd>
+ <dt>
+ <span class="term"><code class="option">--buffer-watershed=</code>num</span>
+ </dt>
+ <dd>
+ <p>
+ Set kernel buffer watershed to num samples (2.6 only). When it'll remain only
+ buffer-size - buffer-watershed free entry in the kernel buffer data will be
+ flushed to daemon, most usefull value are in the range [0.25 - 0.5] * buffer-size.
+ </p>
+ </dd>
+ <dt>
+ <span class="term"><code class="option">--cpu-buffer-size=</code>num</span>
+ </dt>
+ <dd>
+ <p>
+ Number of samples in kernel per-cpu buffer (2.6 only). If you
+ profile at high rate it can help to increase this if the log
+ file show excessive count of sample lost cpu buffer overflow.
+ </p>
+ </dd>
+ <dt>
+ <span class="term"><code class="option">--event=</code>[eventspec]</span>
+ </dt>
+ <dd>
+ <p>
+ Use the given performance counter event to profile.
+ See <a href="#eventspec" title="1.2. Specifying performance counter events">Section 1.2, &#8220;Specifying performance counter events&#8221;</a> below.
+ </p>
+ </dd>
+ <dt>
+ <span class="term"><code class="option">--session-dir=</code>dir_path</span>
+ </dt>
+ <dd>
+ <p>
+ Create/use sample database out of directory <code class="filename">dir_path</code> instead of
+ the default location (/var/lib/oprofile).
+ </p>
+ </dd>
+ <dt>
+ <span class="term"><code class="option">--separate=</code>[none,lib,kernel,thread,cpu,all]</span>
+ </dt>
+ <dd>
+ <p>
+ By default, every profile is stored in a single file. Thus, for example,
+ samples in the C library are all accredited to the <code class="filename">/lib/libc.o</code>
+ profile. However, you choose to create separate sample files by specifying
+ one of the below options.
+ </p>
+ <div class="informaltable">
+ <table border="1">
+ <colgroup>
+ <col />
+ <col />
+ </colgroup>
+ <tbody>
+ <tr>
+ <td>
+ <code class="option">none</code>
+ </td>
+ <td>No profile separation (default)</td>
+ </tr>
+ <tr>
+ <td>
+ <code class="option">lib</code>
+ </td>
+ <td>Create per-application profiles for libraries</td>
+ </tr>
+ <tr>
+ <td>
+ <code class="option">kernel</code>
+ </td>
+ <td>Create per-application profiles for the kernel and kernel modules</td>
+ </tr>
+ <tr>
+ <td>
+ <code class="option">thread</code>
+ </td>
+ <td>Create profiles for each thread and each task</td>
+ </tr>
+ <tr>
+ <td>
+ <code class="option">cpu</code>
+ </td>
+ <td>Create profiles for each CPU</td>
+ </tr>
+ <tr>
+ <td>
+ <code class="option">all</code>
+ </td>
+ <td>All of the above options</td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <p>
+ Note that <code class="option">--separate=kernel</code> also turns on <code class="option">--separate=lib</code>.
+
+ When using <code class="option">--separate=kernel</code>, samples in hardware interrupts, soft-irqs, or other
+ asynchronous kernel contexts are credited to the task currently running. This means you will see
+ seemingly nonsense profiles such as <code class="filename">/bin/bash</code> showing samples for the PPP modules,
+ etc.
+ </p>
+ <p>
+ On 2.2/2.4 only kernel threads already started when profiling begins are correctly profiled;
+ newly started kernel thread samples are credited to the vmlinux (kernel) profile.
+ </p>
+ <p>
+ Using <code class="option">--separate=thread</code> creates a lot
+ of sample files if you leave OProfile running for a while; it's most
+ useful when used for short sessions, or when using image filtering.
+ </p>
+ </dd>
+ <dt>
+ <span class="term"><code class="option">--callgraph=</code>#depth</span>
+ </dt>
+ <dd>
+ <p>
+ Enable call-graph sample collection with a maximum depth. Use 0 to disable
+ callgraph profiling. NOTE: Callgraph support is available on a limited
+ number of platforms at this time; for example:
+ </p>
+ <p>
+ </p>
+ <div class="itemizedlist">
+ <ul type="disc">
+ <li>
+ <p>x86 with recent 2.6 kernel</p>
+ </li>
+ <li>
+ <p>ARM with recent 2.6 kernel</p>
+ </li>
+ <li>
+ <p>PowerPC with 2.6.17 kernel</p>
+ </li>
+ </ul>
+ </div>
+ <p>
+ </p>
+ <p>
+ </p>
+ </dd>
+ <dt>
+ <span class="term"><code class="option">--image=</code>image,[images]|"all"</span>
+ </dt>
+ <dd>
+ <p>
+ Image filtering. If you specify one or more absolute
+ paths to binaries, OProfile will only produce profile results for those
+ binary images. This is useful for restricting the sometimes voluminous
+ output you may get otherwise, especially with
+ <code class="option">--separate=thread</code>. Note that if you are using
+ <code class="option">--separate=lib</code> or
+ <code class="option">--separate=kernel</code>, then if you specification an
+ application binary, the shared libraries and kernel code
+ <span class="emphasis"><em>are</em></span> included. Specify the value
+ "all" to profile everything (the default).
+ </p>
+ </dd>
+ <dt>
+ <span class="term"><code class="option">--vmlinux=</code>file</span>
+ </dt>
+ <dd>
+ <p>
+ vmlinux kernel image.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--no-vmlinux</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ Use this when you don't have a kernel vmlinux file, and you don't want
+ to profile the kernel. This still counts the total number of kernel samples,
+ but can't give symbol-based results for the kernel or any modules.
+ </p>
+ </dd>
+ </dl>
+ </div>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="opcontrolexamples"></a>1.1. Examples</h3>
+ </div>
+ </div>
+ </div>
+ <div class="sect3" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h4 class="title"><a id="examplesperfctr"></a>1.1.1. Intel performance counter setup</h4>
+ </div>
+ </div>
+ </div>
+ <p>
+Here, we have a Pentium III running at 800MHz, and we want to look at where data memory
+references are happening most, and also get results for CPU time.
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+# opcontrol --event=CPU_CLK_UNHALTED:400000 --event=DATA_MEM_REFS:10000
+# opcontrol --vmlinux=/boot/2.6.0/vmlinux
+# opcontrol --start
+</pre>
+ </td>
+ </tr>
+ </table>
+ </div>
+ <div class="sect3" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h4 class="title"><a id="examplesrtc"></a>1.1.2. RTC mode</h4>
+ </div>
+ </div>
+ </div>
+ <p>
+Here, we have an Intel laptop without support for performance counters, running on 2.4 kernels.
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+# ophelp -r
+CPU with RTC device
+# opcontrol --vmlinux=/boot/2.4.13/vmlinux --event=RTC_INTERRUPTS:1024
+# opcontrol --start
+</pre>
+ </td>
+ </tr>
+ </table>
+ </div>
+ <div class="sect3" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h4 class="title"><a id="examplesstartdaemon"></a>1.1.3. Starting the daemon separately</h4>
+ </div>
+ </div>
+ </div>
+ <p>
+If we're running 2.6 kernels, we can use <code class="option">--start-daemon</code> to avoid
+the profiler startup affecting results.
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+# opcontrol --vmlinux=/boot/2.6.0/vmlinux
+# opcontrol --start-daemon
+# my_favourite_benchmark --init
+# opcontrol --start ; my_favourite_benchmark --run ; opcontrol --stop
+</pre>
+ </td>
+ </tr>
+ </table>
+ </div>
+ <div class="sect3" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h4 class="title"><a id="exampleseparate"></a>1.1.4. Separate profiles for libraries and the kernel</h4>
+ </div>
+ </div>
+ </div>
+ <p>
+Here, we want to see a profile of the OProfile daemon itself, including when
+it was running inside the kernel driver, and its use of shared libraries.
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+# opcontrol --separate=kernel --vmlinux=/boot/2.6.0/vmlinux
+# opcontrol --start
+# my_favourite_stress_test --run
+# opreport -l -p /lib/modules/2.6.0/kernel /usr/local/bin/oprofiled
+</pre>
+ </td>
+ </tr>
+ </table>
+ </div>
+ <div class="sect3" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h4 class="title"><a id="examplessessions"></a>1.1.5. Profiling sessions</h4>
+ </div>
+ </div>
+ </div>
+ <p>
+It can often be useful to split up profiling data into several different
+time periods. For example, you may want to collect data on an application's
+startup separately from the normal runtime data. You can use the simple
+command <span><strong class="command">opcontrol --save</strong></span> to do this. For example :
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+# opcontrol --save=blah
+</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+will create a sub-directory in <code class="filename">$SESSION_DIR/samples</code> containing the samples
+up to that point (the current session's sample files are moved into this
+directory). You can then pass this session name as a parameter to the post-profiling
+analysis tools, to only get data up to the point you named the
+session. If you do not want to save a session, you can do
+<span><strong class="command">rm -rf $SESSION_DIR/samples/sessionname</strong></span> or, for the
+current session, <span><strong class="command">opcontrol --reset</strong></span>.
+</p>
+ </div>
+ </div>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="eventspec"></a>1.2. Specifying performance counter events</h3>
+ </div>
+ </div>
+ </div>
+ <p>
+The <code class="option">--event</code> option to <span><strong class="command">opcontrol</strong></span>
+takes a specification that indicates how the details of each
+hardware performance counter should be setup. If you want to
+revert to OProfile's default setting (<code class="option">--event</code>
+is strictly optional), use <code class="option">--event=default</code>. Use of this
+option over-rides all previous event selections.
+</p>
+ <p>
+You can pass multiple event specifications. OProfile will allocate
+hardware counters as necessary. Note that some combinations are not
+allowed by the CPU; running <span><strong class="command">opcontrol --list-events</strong></span> gives the details
+of each event. The event specification is a colon-separated string
+of the form <code class="option"><span class="emphasis"><em>name</em></span>:<span class="emphasis"><em>count</em></span>:<span class="emphasis"><em>unitmask</em></span>:<span class="emphasis"><em>kernel</em></span>:<span class="emphasis"><em>user</em></span></code> as described in this table:
+</p>
+ <div class="informaltable">
+ <table border="1">
+ <colgroup>
+ <col />
+ <col />
+ </colgroup>
+ <tbody>
+ <tr>
+ <td>
+ <code class="option">name</code>
+ </td>
+ <td>The symbolic event name, e.g. <code class="constant">CPU_CLK_UNHALTED</code></td>
+ </tr>
+ <tr>
+ <td>
+ <code class="option">count</code>
+ </td>
+ <td>The counter reset value, e.g. 100000</td>
+ </tr>
+ <tr>
+ <td>
+ <code class="option">unitmask</code>
+ </td>
+ <td>The unit mask, as given in the events list, e.g. 0x0f</td>
+ </tr>
+ <tr>
+ <td>
+ <code class="option">kernel</code>
+ </td>
+ <td>Whether to profile kernel code</td>
+ </tr>
+ <tr>
+ <td>
+ <code class="option">user</code>
+ </td>
+ <td>Whether to profile userspace code</td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <p>
+The last three values are optional, if you omit them (e.g. <code class="option">--event=DATA_MEM_REFS:30000</code>),
+they will be set to the default values (a unit mask of 0, and profiling both kernel and
+userspace code). Note that some events require a unit mask.
+</p>
+ <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
+ <h3 class="title">Note</h3>
+ <p>
+For the PowerPC platforms, all events specified must be in the same group; i.e., the group number
+appended to the event name (e.g. <code class="constant">&lt;<span class="emphasis"><em>some-event-name</em></span>&gt;_GRP9</code>) must be the same.
+</p>
+ </div>
+ <p>
+If OProfile is using RTC mode, and you want to alter the default counter value,
+you can use something like <code class="option">--event=RTC_INTERRUPTS:2048</code>. Note the last
+three values here are ignored.
+If OProfile is using timer-interrupt mode, there is no configuration possible.
+</p>
+ <p>
+The table below lists the events selected by default
+(<code class="option">--event=default</code>) for the various computer architectures:
+</p>
+ <div class="informaltable">
+ <table border="1">
+ <colgroup>
+ <col />
+ <col />
+ <col />
+ </colgroup>
+ <tbody>
+ <tr>
+ <td>Processor</td>
+ <td>cpu_type</td>
+ <td>Default event</td>
+ </tr>
+ <tr>
+ <td>Alpha EV4</td>
+ <td>alpha/ev4</td>
+ <td>CYCLES:100000:0:1:1</td>
+ </tr>
+ <tr>
+ <td>Alpha EV5</td>
+ <td>alpha/ev5</td>
+ <td>CYCLES:100000:0:1:1</td>
+ </tr>
+ <tr>
+ <td>Alpha PCA56</td>
+ <td>alpha/pca56</td>
+ <td>CYCLES:100000:0:1:1</td>
+ </tr>
+ <tr>
+ <td>Alpha EV6</td>
+ <td>alpha/ev6</td>
+ <td>CYCLES:100000:0:1:1</td>
+ </tr>
+ <tr>
+ <td>Alpha EV67</td>
+ <td>alpha/ev67</td>
+ <td>CYCLES:100000:0:1:1</td>
+ </tr>
+ <tr>
+ <td>ARM/XScale PMU1</td>
+ <td>arm/xscale1</td>
+ <td>CPU_CYCLES:100000:0:1:1</td>
+ </tr>
+ <tr>
+ <td>ARM/XScale PMU2</td>
+ <td>arm/xscale2</td>
+ <td>CPU_CYCLES:100000:0:1:1</td>
+ </tr>
+ <tr>
+ <td>ARM/MPCore</td>
+ <td>arm/mpcore</td>
+ <td>CPU_CYCLES:100000:0:1:1</td>
+ </tr>
+ <tr>
+ <td>AVR32</td>
+ <td>avr32</td>
+ <td>CPU_CYCLES:100000:0:1:1</td>
+ </tr>
+ <tr>
+ <td>Athlon</td>
+ <td>i386/athlon</td>
+ <td>CPU_CLK_UNHALTED:100000:0:1:1</td>
+ </tr>
+ <tr>
+ <td>Pentium Pro</td>
+ <td>i386/ppro</td>
+ <td>CPU_CLK_UNHALTED:100000:0:1:1</td>
+ </tr>
+ <tr>
+ <td>Pentium II</td>
+ <td>i386/pii</td>
+ <td>CPU_CLK_UNHALTED:100000:0:1:1</td>
+ </tr>
+ <tr>
+ <td>Pentium III</td>
+ <td>i386/piii</td>
+ <td>CPU_CLK_UNHALTED:100000:0:1:1</td>
+ </tr>
+ <tr>
+ <td>Pentium M (P6 core)</td>
+ <td>i386/p6_mobile</td>
+ <td>CPU_CLK_UNHALTED:100000:0:1:1</td>
+ </tr>
+ <tr>
+ <td>Pentium 4 (non-HT)</td>
+ <td>i386/p4</td>
+ <td>GLOBAL_POWER_EVENTS:100000:1:1:1</td>
+ </tr>
+ <tr>
+ <td>Pentium 4 (HT)</td>
+ <td>i386/p4-ht</td>
+ <td>GLOBAL_POWER_EVENTS:100000:1:1:1</td>
+ </tr>
+ <tr>
+ <td>Hammer</td>
+ <td>x86-64/hammer</td>
+ <td>CPU_CLK_UNHALTED:100000:0:1:1</td>
+ </tr>
+ <tr>
+ <td>Family10h</td>
+ <td>x86-64/family10</td>
+ <td>CPU_CLK_UNHALTED:100000:0:1:1</td>
+ </tr>
+ <tr>
+ <td>Family11h</td>
+ <td>x86-64/family11h</td>
+ <td>CPU_CLK_UNHALTED:100000:0:1:1</td>
+ </tr>
+ <tr>
+ <td>Itanium</td>
+ <td>ia64/itanium</td>
+ <td>CPU_CYCLES:100000:0:1:1</td>
+ </tr>
+ <tr>
+ <td>Itanium 2</td>
+ <td>ia64/itanium2</td>
+ <td>CPU_CYCLES:100000:0:1:1</td>
+ </tr>
+ <tr>
+ <td>TIMER_INT</td>
+ <td>timer</td>
+ <td>None selectable</td>
+ </tr>
+ <tr>
+ <td>IBM iseries</td>
+ <td>PowerPC 4/5/970</td>
+ <td>CYCLES:10000:0:1:1</td>
+ </tr>
+ <tr>
+ <td>IBM pseries</td>
+ <td>PowerPC 4/5/970/Cell</td>
+ <td>CYCLES:10000:0:1:1</td>
+ </tr>
+ <tr>
+ <td>IBM s390</td>
+ <td>timer</td>
+ <td>None selectable</td>
+ </tr>
+ <tr>
+ <td>IBM s390x</td>
+ <td>timer</td>
+ <td>None selectable</td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="setup-jit"></a>2. Setting up the JIT profiling feature</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+ To gather information about JITed code from a virtual machine,
+ it needs to be instrumented with an agent library. We use the
+ agent libraries for Java in the following example. To use the
+ Java profiling feature, you must build OProfile with the "--with-java" option
+ (<a href="#install" title="4. Installation">Section 4, &#8220;Installation&#8221;</a>).
+
+ </p>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="setup-jit-jvm"></a>2.1. JVM instrumentation</h3>
+ </div>
+ </div>
+ </div>
+ <p>
+ Add this to the startup parameters of the JVM (for JVMTI):
+
+ </p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen"><code xmlns="http://www.w3.org/1999/xhtml" class="option">-agentpath:&lt;libdir&gt;/libjvmti_oprofile.so[=&lt;options&gt;]</code> </pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+ or
+ </p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen"><code xmlns="http://www.w3.org/1999/xhtml" class="option">-agentlib:jvmti_oprofile[=&lt;options&gt;]</code> </pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+ </p>
+ <p>
+ The JVMPI agent implementation is enabled with the command line option
+ </p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen"><code xmlns="http://www.w3.org/1999/xhtml" class="option">-Xrunjvmpi_oprofile[:&lt;options&gt;]</code> </pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+ </p>
+ <p>
+ Currently, there is just one option available -- <code class="option">debug</code>. For JVMPI,
+ the convention for specifying an option is <code class="option">option_name=[yes|no]</code>.
+ For JVMTI, the option specification is simply the option name, implying
+ "yes"; no option specified implies "no".
+ </p>
+ <p>
+ The agent library (installed in <code class="filename">&lt;oprof_install_dir&gt;/lib/oprofile</code>)
+ needs to be in the library search path (e.g. add the library directory
+ to <code class="constant">LD_LIBRARY_PATH</code>). If the command line of
+ the JVM is not accessible, it may be buried within shell scripts or a
+ launcher program. It may also be possible to set an environment variable to add
+ the instrumentation.
+ For Sun JVMs this is <code class="constant">JAVA_TOOL_OPTIONS</code>. Please check
+ your JVM documentation for
+ further information on the agent startup options.
+ </p>
+ </div>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="oprofile-gui"></a>3. Using <span><strong class="command">oprof_start</strong></span></h2>
+ </div>
+ </div>
+ </div>
+ <p>
+The <span><strong class="command">oprof_start</strong></span> application provides a convenient way to start the profiler.
+Note that <span><strong class="command">oprof_start</strong></span> is just a wrapper around the <span><strong class="command">opcontrol</strong></span> script,
+so it does not provide more services than the script itself.
+</p>
+ <p>
+After <span><strong class="command">oprof_start</strong></span> is started you can select the event type for each counter;
+the sampling rate and other related parameters are explained in <a href="#controlling-daemon" title="1. Using opcontrol">Section 1, &#8220;Using <span><strong class="command">opcontrol</strong></span>&#8221;</a>.
+The "Configuration" section allows you to set general parameters such as the buffer size, kernel filename
+etc. The counter setup interface should be self-explanatory; <a href="#hardware-counters" title="4.1. Hardware performance counters">Section 4.1, &#8220;Hardware performance counters&#8221;</a> and related
+links contain information on using unit masks.
+</p>
+ <p>
+A status line shows the current status of the profiler: how long it has been running, and the average
+number of interrupts received per second and the total, over all processors.
+Note that quitting <span><strong class="command">oprof_start</strong></span> does not stop the profiler.
+</p>
+ <p>
+Your configuration is saved in the same file as <span><strong class="command">opcontrol</strong></span> uses; that is,
+<code class="filename">~/.oprofile/daemonrc</code>.
+</p>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="detailed-parameters"></a>4. Configuration details</h2>
+ </div>
+ </div>
+ </div>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="hardware-counters"></a>4.1. Hardware performance counters</h3>
+ </div>
+ </div>
+ </div>
+ <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
+ <h3 class="title">Note</h3>
+ <p>
+Your CPU type may not include the requisite support for hardware performance counters, in which case
+you must use OProfile in RTC mode in 2.4 (see <a href="#rtc" title="4.2. OProfile in RTC mode">Section 4.2, &#8220;OProfile in RTC mode&#8221;</a>), or timer mode in 2.6 (see <a href="#timer" title="4.3. OProfile in timer interrupt mode">Section 4.3, &#8220;OProfile in timer interrupt mode&#8221;</a>).
+You do not really need to read this section unless you are interested in using
+events other than the default event chosen by OProfile.
+</p>
+ </div>
+ <p>
+The Intel hardware performance counters are detailed in the Intel IA-32 Architecture Manual, Volume 3, available
+from <a href="http://developer.intel.com/">http://developer.intel.com/</a>.
+The AMD Athlon/Opteron/Phenom/Turion implementation is detailed in <a href="http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/22007.pdf">
+http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/22007.pdf</a>.
+For PowerPC64 processors in IBM iSeries, pSeries, and blade server systems, processor documentation
+is available at <a href="http://www-01.ibm.com/chips/techlib/techlib.nsf/productfamilies/PowerPC/">
+http://www-01.ibm.com/chips/techlib/techlib.nsf/productfamilies/PowerPC</a>. (For example, the
+specific publication containing information on the performance monitor unit for the PowerPC970 is
+"IBM PowerPC 970FX RISC Microprocessor User's Manual.")
+These processors are capable of delivering an interrupt when a counter overflows.
+This is the basic mechanism on which OProfile is based. The delivery mode is <span class="acronym">NMI</span>,
+so blocking interrupts in the kernel does not prevent profiling. When the interrupt handler is called,
+the current <span class="acronym">PC</span> value and the current task are recorded into the profiling structure.
+This allows the overflow event to be attached to a specific assembly instruction in a binary image.
+The daemon receives this data from the kernel, and writes it to the sample files.
+</p>
+ <p>
+If we use an event such as <code class="constant">CPU_CLK_UNHALTED</code> or <code class="constant">INST_RETIRED</code>
+(<code class="constant">GLOBAL_POWER_EVENTS</code> or <code class="constant">INSTR_RETIRED</code>, respectively, on the Pentium 4), we can
+use the overflow counts as an estimate of actual time spent in each part of code. Alternatively we can profile interesting
+data such as the cache behaviour of routines with the other available counters.
+</p>
+ <p>
+However there are several caveats. First, there are those issues listed in the Intel manual. There is a delay
+between the counter overflow and the interrupt delivery that can skew results on a small scale - this means
+you cannot rely on the profiles at the instruction level as being perfectly accurate.
+If you are using an "event-mode" counter such as the cache counters, a count registered against it doesn't mean
+that it is responsible for that event. However, it implies that the counter overflowed in the dynamic
+vicinity of that instruction, to within a few instructions. Further details on this problem can be found in
+<a href="#interpreting" title="Chapter 5. Interpreting profiling results">Chapter 5, <i>Interpreting profiling results</i></a> and also in the Digital paper "ProfileMe: A Hardware Performance Counter".
+</p>
+ <p>
+Each counter has several configuration parameters.
+First, there is the unit mask: this simply further specifies what to count.
+Second, there is the counter value, discussed below. Third, there is a parameter whether to increment counts
+whilst in kernel or user space. You can configure these separately for each counter.
+</p>
+ <p>
+After each overflow event, the counter will be re-initialized
+such that another overflow will occur after this many events have been counted. Thus, higher
+values mean less-detailed profiling, and lower values mean more detail, but higher overhead.
+Picking a good value for this
+parameter is, unfortunately, somewhat of a black art. It is of course dependent on the event
+you have chosen.
+Specifying too large a value will mean not enough interrupts are generated
+to give a realistic profile (though this problem can be ameliorated by profiling for <span class="emphasis"><em>longer</em></span>).
+Specifying too small a value can lead to higher performance overhead.
+</p>
+ </div>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="rtc"></a>4.2. OProfile in RTC mode</h3>
+ </div>
+ </div>
+ </div>
+ <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
+ <h3 class="title">Note</h3>
+ <p>
+This section applies to 2.2/2.4 kernels only.
+</p>
+ </div>
+ <p>
+Some CPU types do not provide the needed hardware support to use the hardware performance counters. This includes
+some laptops, classic Pentiums, and other CPU types not yet supported by OProfile (such as Cyrix).
+On these machines, OProfile falls
+back to using the real-time clock interrupt to collect samples. This interrupt is also used by the <span><strong class="command">rtc</strong></span>
+module: you cannot have both the OProfile and rtc modules loaded nor the rtc support compiled in the kernel.
+</p>
+ <p>
+RTC mode is less capable than the hardware counters mode; in particular, it is unable to profile sections of
+the kernel where interrupts are disabled. There is just one available event, "RTC interrupts", and its value
+corresponds to the number of interrupts generated per second (that is, a higher number means a better profiling
+resolution, and higher overhead). The current implementation of the real-time clock supports only power-of-two
+sampling rates from 2 to 4096 per second. Other values within this range are rounded to the nearest power of
+two.
+</p>
+ <p>
+You can force use of the RTC interrupt with the <code class="option">force_rtc=1</code> module parameter.
+</p>
+ <p>
+Setting the value from the GUI should be straightforward. On the command line, you need to specify the
+event to <span><strong class="command">opcontrol</strong></span>, e.g. :
+</p>
+ <p>
+ <span>
+ <strong class="command">opcontrol --event=RTC_INTERRUPTS:256</strong>
+ </span>
+ </p>
+ </div>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="timer"></a>4.3. OProfile in timer interrupt mode</h3>
+ </div>
+ </div>
+ </div>
+ <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
+ <h3 class="title">Note</h3>
+ <p>
+This section applies to 2.6 kernels and above only.
+</p>
+ </div>
+ <p>
+In 2.6 kernels on CPUs without OProfile support for the hardware performance counters, the driver
+falls back to using the timer interrupt for profiling. Like the RTC mode in 2.4 kernels, this is not able to
+profile code that has interrupts disabled. Note that there are no configuration parameters for
+setting this, unlike the RTC and hardware performance counter setup.
+</p>
+ <p>
+You can force use of the timer interrupt by using the <code class="option">timer=1</code> module
+parameter (or <code class="option">oprofile.timer=1</code> on the boot command line if OProfile is
+built-in).
+</p>
+ </div>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="p4"></a>4.4. Pentium 4 support</h3>
+ </div>
+ </div>
+ </div>
+ <p>
+The Pentium 4 / Xeon performance counters are organized around 3 types of model specific registers (MSRs): 45 event
+selection control registers (ESCRs), 18 counter configuration control registers (CCCRs) and 18 counters. ESCRs describe a
+particular set of events which are to be recorded, and CCCRs bind ESCRs to counters and configure their
+operation. Unfortunately the relationship between these registers is quite complex; they cannot all be used with one
+another at any time. There is, however, a subset of 8 counters, 8 ESCRs, and 8 CCCRs which can be used independently of
+one another, so OProfile only accesses those registers, treating them as a bank of 8 "normal" counters, similar
+to those in the P6 or Athlon/Opteron/Phenom/Turion families of CPU.
+</p>
+ <p>
+There is currently no support for Precision Event-Based Sampling (PEBS), nor any advanced uses of the Debug Store
+(DS). Current support is limited to the conservative extension of OProfile's existing interrupt-based model described
+above. Performance monitoring hardware on Pentium 4 / Xeon processors with Hyperthreading enabled (multiple logical
+processors on a single die) is not supported in 2.4 kernels (you can use OProfile if you disable hyper-threading,
+though).
+</p>
+ </div>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="ia64"></a>4.5. Intel Itanium 2 support</h3>
+ </div>
+ </div>
+ </div>
+ <p>
+The Itanium 2 performance monitoring unit (PMU) organizes the counters as four
+pairs of performance event monitoring registers. Each pair is composed of a
+Performance Monitoring Configuration (PMC) register and Performance Monitoring
+Data (PMD) register. The PMC selects the performance event being monitored and
+the PMD determines the sampling interval. The IA64 Performance Monitoring Unit
+(PMU) triggers sampling with maskable interrupts. Thus, samples will not occur
+in sections of the IA64 kernel where interrupts are disabled.
+</p>
+ <p>
+None of the advance features of the Itanium 2 performance monitoring unit
+such as opcode matching, address range matching, or precise event sampling are
+supported by this version of OProfile. The Itanium 2 support only maps OProfile's
+existing interrupt-based model to the PMU hardware.
+</p>
+ </div>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="ppc64"></a>4.6. PowerPC64 support</h3>
+ </div>
+ </div>
+ </div>
+ <p>
+The performance monitoring unit (PMU) for the IBM PowerPC 64-bit processors
+consists of between 4 and 8 counters (depending on the model), plus three
+special purpose registers used for programming the counters -- MMCR0, MMCR1,
+and MMCRA. Advanced features such as instruction matching and thresholding are
+not supported by this version of OProfile.
+</p>
+ <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3>Later versions of the IBM POWER5+ processor (beginning with revision 3.0)
+run the performance monitor unit in POWER6 mode, effectively removing OProfile's
+access to counters 5 and 6. These two counters are dedicated to counting
+instructions completed and cycles, respectively. In POWER6 mode, however, the
+counters do not generate an interrupt on overflow and so are unusable by
+OProfile. Kernel versions 2.6.23 and higher will recognize this mode
+and export "ppc64/power5++" as the cpu_type to the oprofilefs pseudo filesystem.
+OProfile userspace responds to this cpu_type by removing these counters from
+the list of potential events to count. Without this kernel support, attempts
+to profile using an event from one of these counters will yield incorrect
+results -- typically, zero (or near zero) samples in the generated report.
+</div>
+ <p>
+</p>
+ </div>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="cell-be"></a>4.7. Cell Broadband Engine support</h3>
+ </div>
+ </div>
+ </div>
+ <p>
+The Cell Broadband Engine (CBE) processor core consists of a PowerPC Processing
+Element (PPE) and 8 Synergistic Processing Elements (SPE). PPEs and SPEs each
+consist of a processing unit (PPU and SPU, respectively) and other hardware
+components, such as memory controllers.
+</p>
+ <p>
+A PPU has two hardware threads (aka "virtual CPUs"). The performance monitor
+unit of the CBE collects event information on one hardware thread at a time.
+Therefore, when profiling PPE events,
+OProfile collects the profile based on the selected events by time slicing the
+performance counter hardware between the two threads. The user must ensure the
+collection interval is long enough so that the time spent collecting data for
+each PPU is sufficient to obtain a good profile.
+</p>
+ <p>
+To profile an SPU application, the user should specify the SPU_CYCLES event.
+When starting OProfile with SPU_CYCLES, the opcontrol script enforces certain
+separation parameters (separate=cpu,lib) to ensure that sufficient information
+is collected in the sample data in order to generate a complete report. The
+--merge=cpu option can be used to obtain a more readable report if analyzing
+the performance of each separate SPU is not necessary.
+</p>
+ <p>
+Profiling with an SPU event (events 4100 through 4163) is not compatible with any other
+event. Further more, only one SPU event can be specified at a time. The hardware only
+supports profiling on one SPU per node at a time. The OProfile kernel code time slices
+between the eight SPUs to collect data on all SPUs.
+</p>
+ <p>
+SPU profile reports have some unique characteristics compared to reports for
+standard architectures:
+</p>
+ <div class="itemizedlist">
+ <ul type="disc">
+ <li>Typically no "app name" column. This is really standard OProfile behavior
+when the report contains samples for just a single application, which is
+commonly the case when profiling SPUs.</li>
+ <li>"CPU" equates to "SPU"</li>
+ <li>Specifying '--long-filenames' on the opreport command does not always result
+in long filenames. This happens when the SPU application code is embedded in
+the PPE executable or shared library. The embedded SPU ELF data contains only the
+short filename (i.e., no path information) for the SPU binary file that was used as
+the source for embedding. The reason that just the short filename is used is because
+the original SPU binary file may not exist or be accessible at runtime. The performance
+analyst must have sufficient knowledge of the application to be able to correlate the
+SPU binary image names found in the report to the application's source files.
+<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3>
+Compile the application with -g and generate the OProfile report
+with -g to facilitate finding the right source file(s) on which to focus.
+</div></li>
+ </ul>
+ </div>
+ </div>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="amd-ibs-support"></a>4.8. AMD64 (x86_64) Instruction-Based Sampling (IBS) support</h3>
+ </div>
+ </div>
+ </div>
+ <p>
+Instruction-Based Sampling (IBS) is a new performance measurement technique
+available on AMD Family 10h processors. Traditional performance counter
+sampling is not precise enough to isolate performance issues to individual
+instructions. IBS, however, precisely identifies instructions which are not
+making the best use of the processor pipeline and memory hierarchy.
+For more information, please refer to the "Instruction-Based Sampling:
+A New Performance Analysis Technique for AMD Family 10h Processors" (
+<a href="http://developer.amd.com/assets/AMD_IBS_paper_EN.pdf">
+http://developer.amd.com/assets/AMD_IBS_paper_EN.pdf</a>).
+There are two types of IBS profile types, described in the following sections.
+</p>
+ <div class="sect3" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h4 class="title"><a id="ibs-fetch"></a>4.8.1. IBS Fetch</h4>
+ </div>
+ </div>
+ </div>
+ <p>
+IBS fetch sampling is a statistical sampling method which counts completed
+fetch operations. When the number of completed fetch operations reaches the
+maximum fetch count (the sampling period), IBS tags the fetch operation and
+monitors that operation until it either completes or aborts. When a tagged
+fetch completes or aborts, a sampling interrupt is generated and an IBS fetch
+sample is taken. An IBS fetch sample contains a timestamp, the identifier of
+the interrupted process, the virtual fetch address, and several event flags
+and values that describe what happened during the fetch operation.
+</p>
+ </div>
+ <div class="sect3" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h4 class="title"><a id="ibs-op"></a>4.8.2. IBS Op</h4>
+ </div>
+ </div>
+ </div>
+ <p>
+IBS op sampling selects, tags, and monitors macro-ops as issued from AMD64
+instructions. Two options are available for selecting ops for sampling:
+</p>
+ <div class="itemizedlist">
+ <ul type="disc">
+ <li>
+Cycles-based selection counts CPU clock cycles. The op is tagged and monitored
+when the count reaches a threshold (the sampling period) and a valid op is
+available.
+</li>
+ <li>
+Dispatched op-based selection counts dispatched macro-ops.
+When the count reaches a threshold, the next valid op is tagged and monitored.
+</li>
+ </ul>
+ </div>
+ <p>
+In both cases, an IBS sample is generated only if the tagged op retires.
+Thus, IBS op event information does not measure speculative execution activity.
+The execution stages of the pipeline monitor the tagged macro-op. When the
+tagged macro-op retires, a sampling interrupt is generated and an IBS op
+sample is taken. An IBS op sample contains a timestamp, the identifier of
+the interrupted process, the virtual address of the AMD64 instruction from
+which the op was issued, and several event flags and values that describe
+what happened when the macro-op executed.
+</p>
+ </div>
+ <p>
+Enabling IBS profiling is done simply by specifying IBS performance events
+through the "--event=" options. These events are listed in the
+<code class="function">opcontrol --list-events</code>.
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+opcontrol --event=IBS_FETCH_XXX:&lt;count&gt;:&lt;um&gt;:&lt;kernel&gt;:&lt;user&gt;
+opcontrol --event=IBS_OP_XXX:&lt;count&gt;:&lt;um&gt;:&lt;kernel&gt;:&lt;user&gt;
+
+Note: * All IBS fetch event must have the same event count and unitmask,
+ as do those for IBS op.
+</pre>
+ </td>
+ </tr>
+ </table>
+ </div>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="misuse"></a>4.9. Dangerous counter settings</h3>
+ </div>
+ </div>
+ </div>
+ <p>
+OProfile is a low-level profiler which allow continuous profiling with a low-overhead cost.
+If too low a count reset value is set for a counter, the system can become overloaded with counter
+interrupts, and seem as if the system has frozen. Whilst some validation is done, it
+is not foolproof.
+</p>
+ <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
+ <h3 class="title">Note</h3>
+ <p>
+This can happen as follows: When the profiler count
+reaches zero an NMI handler is called which stores the sample values in an internal buffer, then resets the counter
+to its original value. If the count is very low, a pending NMI can be sent before the NMI handler has
+completed. Due to the priority of the NMI, the local APIC delivers the pending interrupt immediately after
+completion of the previous interrupt handler, and control never returns to other parts of the system.
+In this way the system seems to be frozen.
+</p>
+ </div>
+ <p>If this happens, it will be impossible to bring the system back to a workable state.
+There is no way to provide real security against this happening, other than making sure to use a reasonable value
+for the counter reset. For example, setting <code class="constant">CPU_CLK_UNHALTED</code> event type with a ridiculously low reset count (e.g. 500)
+is likely to freeze the system.
+</p>
+ <p>
+In short : <span><strong class="command">Don't try a foolish sample count value</strong></span>. Unfortunately the definition of a foolish value
+is really dependent on the event type - if ever in doubt, e-mail </p>
+ <div class="address">
+ <p><code class="email">&lt;<a href="mailto:oprofile-list@lists.sf.net">oprofile-list@lists.sf.net</a>&gt;</code>.</p>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="chapter" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title"><a id="results"></a>Chapter 4. Obtaining results</h2>
+ </div>
+ </div>
+ </div>
+ <div class="toc">
+ <p>
+ <b>Table of Contents</b>
+ </p>
+ <dl>
+ <dt>
+ <span class="sect1">
+ <a href="#profile-spec">1. Profile specifications</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect2">
+ <a href="#profile-spec-examples">1.1. Examples</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#profile-spec-details">1.2. Profile specification parameters</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#locating-and-managing-binary-images">1.3. Locating and managing binary images</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#no-results">1.4. What to do when you don't get any results</a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ <dt>
+ <span class="sect1">
+ <a href="#opreport">2. Image summaries and symbol summaries (<span><strong class="command">opreport</strong></span>)</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect2">
+ <a href="#opreport-merging">2.1. Merging separate profiles</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#opreport-comparison">2.2. Side-by-side multiple results</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#opreport-callgraph">2.3. Callgraph output</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#opreport-diff">2.4. Differential profiles with <span><strong class="command">opreport</strong></span></a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#opreport-anon">2.5. Anonymous executable mappings</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#opreport-xml">2.6. XML formatted output</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#opreport-options">2.7. Options for <span><strong class="command">opreport</strong></span></a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ <dt>
+ <span class="sect1">
+ <a href="#opannotate">3. Outputting annotated source (<span><strong class="command">opannotate</strong></span>)</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect2">
+ <a href="#opannotate-finding-source">3.1. Locating source files</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#opannotate-details">3.2. Usage of <span><strong class="command">opannotate</strong></span></a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ <dt>
+ <span class="sect1">
+ <a href="#getting-jit-reports">4. OProfile results with JIT samples</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#opgprof">5. <span><strong class="command">gprof</strong></span>-compatible output (<span><strong class="command">opgprof</strong></span>)</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect2">
+ <a href="#opgprof-details">5.1. Usage of <span><strong class="command">opgprof</strong></span></a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ <dt>
+ <span class="sect1">
+ <a href="#oparchive">6. Archiving measurements (<span><strong class="command">oparchive</strong></span>)</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect2">
+ <a href="#oparchive-details">6.1. Usage of <span><strong class="command">oparchive</strong></span></a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ <dt>
+ <span class="sect1">
+ <a href="#opimport">7. Converting sample database files (<span><strong class="command">opimport</strong></span>)</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect2">
+ <a href="#opimport-details">7.1. Usage of <span><strong class="command">opimport</strong></span></a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ </dl>
+ </div>
+ <p>
+OK, so the profiler has been running, but it's not much use unless we can get some data out. Fairly often,
+OProfile does a little <span class="emphasis"><em>too</em></span> good a job of keeping overhead low, and no data reaches
+the profiler. This can happen on lightly-loaded machines. Remember you can force a dump at any time with :
+</p>
+ <p>
+ <span>
+ <strong class="command">opcontrol --dump</strong>
+ </span>
+ </p>
+ <p>Remember to do this before complaining there is no profiling data !
+Now that we've got some data, it has to be processed. That's the job of <span><strong class="command">opreport</strong></span>,
+<span><strong class="command">opannotate</strong></span>, or <span><strong class="command">opgprof</strong></span>.
+</p>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="profile-spec"></a>1. Profile specifications</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+All of the analysis tools take a <span class="emphasis"><em>profile specification</em></span>.
+This is a set of definitions that describe which actual profiles should be
+examined. The simplest profile specification is empty: this will match all
+the available profile files for the current session (this is what happens
+when you do <span><strong class="command">opreport</strong></span>).
+</p>
+ <p>
+Specification parameters are of the form <code class="option">name:value[,value]</code>.
+For example, if I wanted to get a combined symbol summary for
+<code class="filename">/bin/myprog</code> and <code class="filename">/bin/myprog2</code>,
+I could do <span><strong class="command">opreport -l image:/bin/myprog,/bin/myprog2</strong></span>.
+As a special case, you don't actually need to specify the <code class="option">image:</code>
+part here: anything left on the command line is assumed to be an
+<code class="option">image:</code> name. Similarly, if no <code class="option">session:</code>
+is specified, then <code class="option">session:current</code> is assumed ("current"
+is a special name of the current / last profiling session).
+</p>
+ <p>
+In addition to the comma-separated list shown above, some of the
+specification parameters can take <span><strong class="command">glob</strong></span>-style
+values. For example, if I want to see image summaries for all
+binaries profiled in <code class="filename">/usr/bin/</code>, I could do
+<span><strong class="command">opreport image:/usr/bin/\*</strong></span>. Note the necessity
+to escape the special character from the shell.
+</p>
+ <p>
+For <span><strong class="command">opreport</strong></span>, profile specifications can be used to
+define two profiles, giving differential output. This is done by
+enclosing each of the two specifications within curly braces, as shown
+in the examples below. Any specifications outside of curly braces are
+shared across both.
+</p>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="profile-spec-examples"></a>1.1. Examples</h3>
+ </div>
+ </div>
+ </div>
+ <p>
+Image summaries for all profiles with <code class="constant">DATA_MEM_REFS</code>
+samples in the saved session called "stresstest" :
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+# opreport session:stresstest event:DATA_MEM_REFS
+</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+Symbol summary for the application called "test_sym53c8xx,9xx". Note the
+escaping is necessary as <code class="option">image:</code> takes a comma-separated list.
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+# opreport -l ./test/test_sym53c8xx\,9xx
+</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+Image summaries for all binaries in the <code class="filename">test</code> directory,
+excepting <code class="filename">boring-test</code> :
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+# opreport image:./test/\* image-exclude:./test/boring-test
+</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+Differential profile of a binary stored in two archives :
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+# opreport -l /bin/bash { archive:./orig } { archive:./new }
+</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+Differential profile of an archived binary with the current session :
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+# opreport -l /bin/bash { archive:./orig } { }
+</pre>
+ </td>
+ </tr>
+ </table>
+ </div>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="profile-spec-details"></a>1.2. Profile specification parameters</h3>
+ </div>
+ </div>
+ </div>
+ <div class="variablelist">
+ <dl>
+ <dt>
+ <span class="term">
+ <code class="option">archive:</code>
+ <span class="emphasis">
+ <em>archivepath</em>
+ </span>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ A path to an archive made with <span><strong class="command">oparchive</strong></span>.
+ Absence of this tag, unlike others, means "the current system",
+ equivalent to specifying "archive:".
+ </p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">session:</code>
+ <span class="emphasis">
+ <em>sessionlist</em>
+ </span>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ A comma-separated list of session names to resolve in. Absence of this
+ tag, unlike others, means "the current session", equivalent to
+ specifying "session:current".
+ </p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">session-exclude:</code>
+ <span class="emphasis">
+ <em>sessionlist</em>
+ </span>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ A comma-separated list of sessions to exclude.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">image:</code>
+ <span class="emphasis">
+ <em>imagelist</em>
+ </span>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ A comma-separated list of image names to resolve. Each entry may be relative
+ path, <span><strong class="command">glob</strong></span>-style name, or full path, e.g.</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">opreport 'image:/usr/bin/oprofiled,*op*,./opreport'</pre>
+ </td>
+ </tr>
+ </table>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">image-exclude:</code>
+ <span class="emphasis">
+ <em>imagelist</em>
+ </span>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ Same as <code class="option">image:</code>, but the matching images are excluded.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">lib-image:</code>
+ <span class="emphasis">
+ <em>imagelist</em>
+ </span>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ Same as <code class="option">image:</code>, but only for images that are for
+ a particular primary binary image (namely, an application). This only
+ makes sense to use if you're using <code class="option">--separate</code>.
+ This includes kernel modules and the kernel when using
+ <code class="option">--separate=kernel</code>.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">lib-image-exclude:</code>
+ <span class="emphasis">
+ <em>imagelist</em>
+ </span>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ Same as <code class="option">lib-image:</code>, but the matching images
+ are excluded.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">event:</code>
+ <span class="emphasis">
+ <em>eventlist</em>
+ </span>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ The symbolic event name to match on, e.g. <code class="option">event:DATA_MEM_REFS</code>.
+ You can pass a list of events for side-by-side comparison with <span><strong class="command">opreport</strong></span>.
+ When using the timer interrupt, the event is always "TIMER".
+ </p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">count:</code>
+ <span class="emphasis">
+ <em>eventcountlist</em>
+ </span>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ The event count to match on, e.g. <code class="option">event:DATA_MEM_REFS count:30000</code>.
+ Note that this value refers to the setting used for <span><strong class="command">opcontrol</strong></span>
+ only, and has nothing to do with the sample counts in the profile data
+ itself.
+ You can pass a list of events for side-by-side comparison with <span><strong class="command">opreport</strong></span>.
+ When using the timer interrupt, the count is always 0 (indicating it cannot be set).
+ </p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">unit-mask:</code>
+ <span class="emphasis">
+ <em>masklist</em>
+ </span>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ The unit mask value of the event to match on, e.g. <code class="option">unit-mask:1</code>.
+ You can pass a list of events for side-by-side comparison with <span><strong class="command">opreport</strong></span>.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">cpu:</code>
+ <span class="emphasis">
+ <em>cpulist</em>
+ </span>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ Only consider profiles for the given numbered CPU (starting from zero).
+ This is only useful when using CPU profile separation.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">tgid:</code>
+ <span class="emphasis">
+ <em>pidlist</em>
+ </span>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ Only consider profiles for the given task groups. Unless some program
+ is using threads, the task group ID of a process is the same
+ as its process ID. This option corresponds to the POSIX
+ notion of a thread group.
+ This is only useful when using per-process profile separation.
+ </p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">tid:</code>
+ <span class="emphasis">
+ <em>tidlist</em>
+ </span>
+ </span>
+ </dt>
+ <dd>
+ <p>
+ Only consider profiles for the given threads. When using
+ recent thread libraries, all threads in a process share the
+ same task group ID, but have different thread IDs. You can
+ use this option in combination with <code class="option">tgid:</code> to
+ restrict the results to particular threads within a process.
+ This is only useful when using per-process profile separation.
+ </p>
+ </dd>
+ </dl>
+ </div>
+ </div>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="locating-and-managing-binary-images"></a>1.3. Locating and managing binary images</h3>
+ </div>
+ </div>
+ </div>
+ <p>
+Each session's sample files can be found in the $SESSION_DIR/samples/ directory (default: <code class="filename">/var/lib/oprofile/samples/</code>).
+These are used, along with the binary image files, to produce human-readable data.
+In some circumstances (kernel modules in an initrd, or modules on 2.6 kernels), OProfile
+will not be able to find the binary images. All the tools have an <code class="option">--image-path</code>
+option to which you can pass a comma-separated list of alternate paths to search. For example,
+I can let OProfile find my 2.6 modules by using <span><strong class="command">--image-path /lib/modules/2.6.0/kernel/</strong></span>.
+It is your responsibility to ensure that the correct images are found when using this
+option.
+</p>
+ <p>
+Note that if a binary image changes after the sample file was created, you won't be able to get useful
+symbol-based data out. This situation is detected for you. If you replace a binary, you should
+make sure to save the old binary if you need to do comparative profiles.
+</p>
+ </div>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="no-results"></a>1.4. What to do when you don't get any results</h3>
+ </div>
+ </div>
+ </div>
+ <p>
+When attempting to get output, you may see the error :
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+error: no sample files found: profile specification too strict ?
+</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+What this is saying is that the profile specification you passed in,
+when matched against the available sample files, resulted in no matches.
+There are a number of reasons this might happen:
+</p>
+ <div class="variablelist">
+ <dl>
+ <dt>
+ <span class="term">spelling</span>
+ </dt>
+ <dd>
+ <p>
+You specified a binary name, but spelt it wrongly. Check your spelling !
+</p>
+ </dd>
+ <dt>
+ <span class="term">profiler wasn't running</span>
+ </dt>
+ <dd>
+ <p>
+Make very sure that OProfile was actually up and running when you ran
+the binary.
+</p>
+ </dd>
+ <dt>
+ <span class="term">binary didn't run long enough</span>
+ </dt>
+ <dd>
+ <p>
+Remember OProfile is a statistical profiler - you're not guaranteed to
+get samples for short-running programs. You can help this by using a
+lower count for the performance counter, so there are a lot more samples
+taken per second.
+</p>
+ </dd>
+ <dt>
+ <span class="term">binary spent most of its time in libraries</span>
+ </dt>
+ <dd>
+ <p>
+Similarly, if the binary spends little time in the main binary image
+itself, with most of it spent in shared libraries it uses, you might
+not see any samples for the binary image itself. You can check this
+by using <span><strong class="command">opcontrol --separate=lib</strong></span> before the
+profiling session, so <span><strong class="command">opreport</strong></span> and friends show
+the library profiles on a per-application basis.
+</p>
+ </dd>
+ <dt>
+ <span class="term">specification was really too strict</span>
+ </dt>
+ <dd>
+ <p>
+For example, you specified something like <code class="option">tgid:3433</code>,
+but no task with that group ID ever ran the code.
+</p>
+ </dd>
+ <dt>
+ <span class="term">binary didn't generate any events</span>
+ </dt>
+ <dd>
+ <p>
+If you're using a particular event counter, for example counting MMX
+operations, the code might simply have not generated any events in the
+first place. Verify the code you're profiling does what you expect it
+to.
+</p>
+ </dd>
+ <dt>
+ <span class="term">you didn't specify kernel module name correctly</span>
+ </dt>
+ <dd>
+ <p>
+If you're using 2.6 kernels, and trying to get reports for a kernel
+module, make sure to use the <code class="option">-p</code> option, and specify the
+module name <span class="emphasis"><em>with</em></span> the <code class="filename">.ko</code>
+extension. Check if the module is one loaded from initrd.
+</p>
+ </dd>
+ </dl>
+ </div>
+ </div>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="opreport"></a>2. Image summaries and symbol summaries (<span><strong class="command">opreport</strong></span>)</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+The <span><strong class="command">opreport</strong></span> utility is the primary utility you will use for
+getting formatted data out of OProfile. It produces two types of data: image summaries
+and symbol summaries. An image summary lists the number of samples for individual
+binary images such as libraries or applications. Symbol summaries provide per-symbol
+profile data. In the following example, we're getting an image summary for the whole
+system:
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+$ opreport --long-filenames
+CPU: PIII, speed 863.195 MHz (estimated)
+Counted CPU_CLK_UNHALTED events (clocks processor is not halted) with a unit mask of 0x00 (No unit mask) count 23150
+ 905898 59.7415 /usr/lib/gcc-lib/i386-redhat-linux/3.2/cc1plus
+ 214320 14.1338 /boot/2.6.0/vmlinux
+ 103450 6.8222 /lib/i686/libc-2.3.2.so
+ 60160 3.9674 /usr/local/bin/madplay
+ 31769 2.0951 /usr/local/oprofile-pp/bin/oprofiled
+ 26550 1.7509 /usr/lib/libartsflow.so.1.0.0
+ 23906 1.5765 /usr/bin/as
+ 18770 1.2378 /oprofile
+ 15528 1.0240 /usr/lib/qt-3.0.5/lib/libqt-mt.so.3.0.5
+ 11979 0.7900 /usr/X11R6/bin/XFree86
+ 11328 0.7471 /bin/bash
+ ...
+</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+If we had specified <code class="option">--symbols</code> in the previous command, we would have
+gotten a symbol summary of all the images across the entire system. We can restrict this to only
+part of the system profile; for example,
+below is a symbol summary of the OProfile daemon. Note that as we used
+<span><strong class="command">opcontrol --separate=kernel</strong></span>, symbols from images that <span><strong class="command">oprofiled</strong></span>
+has used are also shown.
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+$ opreport -l `which oprofiled` 2&gt;/dev/null | more
+CPU: PIII, speed 863.195 MHz (estimated)
+Counted CPU_CLK_UNHALTED events (clocks processor is not halted) with a unit mask of 0x00 (No unit mask) count 23150
+vma samples % image name symbol name
+0804be10 14971 28.1993 oprofiled odb_insert
+0804afdc 7144 13.4564 oprofiled pop_buffer_value
+c01daea0 6113 11.5144 vmlinux __copy_to_user_ll
+0804b060 2816 5.3042 oprofiled opd_put_sample
+0804b4a0 2147 4.0441 oprofiled opd_process_samples
+0804acf4 1855 3.4941 oprofiled opd_put_image_sample
+0804ad84 1766 3.3264 oprofiled opd_find_image
+0804a5ec 1084 2.0418 oprofiled opd_find_module
+0804ba5c 741 1.3957 oprofiled odb_hash_add_node
+...
+</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+These are the two basic ways you are most likely to use regularly, but <span><strong class="command">opreport</strong></span>
+can do a lot more than that, as described below.
+</p>
+ <div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="opreport-merging"></a>2.1. Merging separate profiles</h3></div></div></div>
+
+If you have used one of the <code class="option">--separate=</code> options
+whilst profiling, there can be several separate profiles for
+a single binary image within a session. Normally the output
+will keep these images separated (so, for example, the image summary
+output shows library image summaries on a per-application basis,
+when using <code class="option">--separate=lib</code>).
+Sometimes it can be useful to merge these results back together
+before getting results. The <code class="option">--merge</code> option allows
+you to do that.
+</div>
+ <div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="opreport-comparison"></a>2.2. Side-by-side multiple results</h3></div></div></div>
+If you have used multiple events when profiling, by default you get
+side-by-side results of each event's sample values from <span><strong class="command">opreport</strong></span>.
+You can restrict which events to list by appropriate use of the
+<code class="option">event:</code> profile specifications, etc.
+</div>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="opreport-callgraph"></a>2.3. Callgraph output</h3>
+ </div>
+ </div>
+ </div>
+ <p>
+This section provides details on how to use the OProfile callgraph feature.
+</p>
+ <div class="sect3" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h4 class="title"><a id="op-cg1"></a>2.3.1. Callgraph details</h4>
+ </div>
+ </div>
+ </div>
+ <p>
+When using the <code class="option">opcontrol --callgraph</code> option, you can see what
+functions are calling other functions in the output. Consider the
+following program:
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+#include &lt;string.h&gt;
+#include &lt;stdlib.h&gt;
+#include &lt;stdio.h&gt;
+
+#define SIZE 500000
+
+static int compare(const void *s1, const void *s2)
+{
+ return strcmp(s1, s2);
+}
+
+static void repeat(void)
+{
+ int i;
+ char *strings[SIZE];
+ char str[] = "abcdefghijklmnopqrstuvwxyz";
+
+ for (i = 0; i &lt; SIZE; ++i) {
+ strings[i] = strdup(str);
+ strfry(strings[i]);
+ }
+
+ qsort(strings, SIZE, sizeof(char *), compare);
+}
+
+int main()
+{
+ while (1)
+ repeat();
+}
+</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+When running with the call-graph option, OProfile will
+record the function stack every time it takes a sample.
+<span><strong class="command">opreport --callgraph</strong></span> outputs an entry for each
+function, where each entry looks similar to:
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+samples % image name symbol name
+ 197 0.1548 cg main
+ 127036 99.8452 cg repeat
+84590 42.5084 libc-2.3.2.so strfry
+ 84590 66.4838 libc-2.3.2.so strfry [self]
+ 39169 30.7850 libc-2.3.2.so random_r
+ 3475 2.7312 libc-2.3.2.so __i686.get_pc_thunk.bx
+-------------------------------------------------------------------------------
+</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+Here the non-indented line is the function we're focussing upon
+(<code class="function">strfry()</code>). This
+line is the same as you'd get from a normal <span><strong class="command">opreport</strong></span>
+output.
+</p>
+ <p>
+Above the non-indented line we find the functions that called this
+function (for example, <code class="function">repeat()</code> calls
+<code class="function">strfry()</code>). The samples and percentage values here
+refer to the number of times we took a sample where this call was found
+in the stack; the percentage is relative to all other callers of the
+function we're focussing on. Note that these values are
+<span class="emphasis"><em>not</em></span> call counts; they only reflect the call stack
+every time a sample is taken; that is, if a call is found in the stack
+at the time of a sample, it is recorded in this count.
+</p>
+ <p>
+Below the line are functions that are called by
+<code class="function">strfry()</code> (called <span class="emphasis"><em>callees</em></span>).
+It's clear here that <code class="function">strfry()</code> calls
+<code class="function">random_r()</code>. We also see a special entry with a
+"[self]" marker. This records the normal samples for the function, but
+the percentage becomes relative to all callees. This allows you to
+compare time spent in the function itself compared to functions it
+calls. Note that if a function calls itself, then it will appear in the
+list of callees of itself, but without the "[self]" marker; so recursive
+calls are still clearly separable.
+</p>
+ <p>
+You may have noticed that the output lists <code class="function">main()</code>
+as calling <code class="function">strfry()</code>, but it's clear from the source
+that this doesn't actually happen. See <a href="#interpreting-callgraph" title="3. Interpreting call-graph profiles">Section 3, &#8220;Interpreting call-graph profiles&#8221;</a> for an explanation.
+</p>
+ </div>
+ <div class="sect3" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h4 class="title"><a id="cg-with-jitsupport"></a>2.3.2. Callgraph and JIT support</h4>
+ </div>
+ </div>
+ </div>
+ <p>
+Callgraph output where anonymously mapped code is in the callstack can sometimes be misleading.
+For all such code, the samples for the anonymously mapped code are stored in a samples subdirectory
+named <code class="filename">{anon:anon}/&lt;tgid&gt;.&lt;begin_addr&gt;.&lt;end_addr&gt;</code>.
+As stated earlier, if this anonymously mapped code is JITed code from a supported VM like Java,
+OProfile creates an ELF file to provide a (somewhat) permanent backing file for the code.
+However, when viewing callgraph output, any anonymously mapped code in the callstack
+will be attributed to <code class="filename">anon (&lt;tgid&gt;: range:&lt;begin_addr&gt;-&lt;end_addr&gt;</code>,
+even if a <code class="filename">.jo</code> ELF file had been created for it. See the example below.
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+-------------------------------------------------------------------------------
+ 1 2.2727 libj9ute23.so java.bin traceV
+ 2 4.5455 libj9ute23.so java.bin utsTraceV
+ 4 9.0909 libj9trc23.so java.bin fillInUTInterfaces
+ 37 84.0909 libj9trc23.so java.bin twGetSequenceCounter
+8 0.0154 libj9prt23.so java.bin j9time_hires_clock
+ 27 61.3636 anon (tgid:10014 range:0x100000-0x103000) java.bin (no symbols)
+ 9 20.4545 libc-2.4.so java.bin gettimeofday
+ 8 18.1818 libj9prt23.so java.bin j9time_hires_clock [self]
+-------------------------------------------------------------------------------
+</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+The output shows that "anon (tgid:10014 range:0x100000-0x103000)" was a callee of
+<code class="code">j9time_hires_clock</code>, even though the ELF file <code class="filename">10014.jo</code> was
+created for this profile run. Unfortunately, there is currently no way to correlate
+that anonymous callgraph entry with its corresponding <code class="filename">.jo</code> file.
+</p>
+ </div>
+ </div>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="opreport-diff"></a>2.4. Differential profiles with <span><strong class="command">opreport</strong></span></h3>
+ </div>
+ </div>
+ </div>
+ <p>
+Often, we'd like to be able to compare two profiles. For example, when
+analysing the performance of an application, we'd like to make code
+changes and examine the effect of the change. This is supported in
+<span><strong class="command">opreport</strong></span> by giving a profile specification that
+identifies two different profiles. The general form is of:
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+$ opreport &lt;shared-spec&gt; { &lt;first-profile&gt; } { &lt;second-profile&gt; }
+</pre>
+ </td>
+ </tr>
+ </table>
+ <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
+ <h3 class="title">Note</h3>
+ <p>
+We lost our Dragon book down the back of the sofa, so you have to be
+careful to have spaces around those braces, or things will get
+hopelessly confused. We can only apologise.
+</p>
+ </div>
+ <p>
+For each of the profiles, the shared section is prefixed, and then the
+specification is analysed. The usual parameters work both within the
+shared section, and in the sub-specification within the curly braces.
+</p>
+ <p>
+A typical way to use this feature is with archives created with
+<span><strong class="command">oparchive</strong></span>. Let's look at an example:
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+$ ./a
+$ oparchive -o orig ./a
+$ opcontrol --reset
+ # edit and recompile a
+$ ./a
+ # now compare the current profile of a with the archived profile
+$ opreport -xl ./a { archive:./orig } { }
+CPU: PIII, speed 863.233 MHz (estimated)
+Counted CPU_CLK_UNHALTED events (clocks processor is not halted) with a
+unit mask of 0x00 (No unit mask) count 100000
+samples % diff % symbol name
+92435 48.5366 +0.4999 a
+54226 --- --- c
+49222 25.8459 +++ d
+48787 25.6175 -2.2e-01 b
+</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+Note that we specified an empty second profile in the curly braces, as
+we wanted to use the current session; alternatively, we could
+have specified another archive, or a tgid etc. We specified the binary
+<span><strong class="command">a</strong></span> in the shared section, so we matched that in both
+the profiles we're diffing.
+</p>
+ <p>
+As in the normal output, the results are sorted by the number of
+samples, and the percentage field represents the relative percentage of
+the symbol's samples in the second profile.
+</p>
+ <p>
+Notice the new column in the output. This value represents the
+percentage change of the relative percent between the first and the
+second profile: roughly, "how much more important this symbol is".
+Looking at the symbol <code class="function">a()</code>, we can see that it took
+roughly the same amount of the total profile in both the first and the
+second profile. The function <code class="function">c()</code> was not in the new
+profile, so has been marked with <code class="function">---</code>. Note that the
+sample value is the number of samples in the first profile; since we're
+displaying results for the second profile, we don't list a percentage
+value for it, as it would be meaningless. <code class="function">d()</code> is
+new in the second profile, and consequently marked with
+<code class="function">+++</code>.
+</p>
+ <p>
+When comparing profiles between different binaries, it should be clear
+that functions can change in terms of VMA and size. To avoid this
+problem, <span><strong class="command">opreport</strong></span> considers a symbol to be the same
+if the symbol name, image name, and owning application name all match;
+any other factors are ignored. Note that the check for application name
+means that trying to compare library profiles between two different
+applications will not work as you might expect: each symbol will be
+considered different.
+</p>
+ </div>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="opreport-anon"></a>2.5. Anonymous executable mappings</h3>
+ </div>
+ </div>
+ </div>
+ <p>
+Many applications, typically ones involving dynamic compilation into
+machine code (just-in-time, or "JIT", compilation), have executable mappings that
+are not backed by an ELF file. <span><strong class="command">opreport</strong></span> has basic support for showing the
+samples taken in these regions; for example:
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+$ opreport /usr/bin/mono -l
+CPU: ppc64 POWER5, speed 1654.34 MHz (estimated)
+Counted CYCLES events (Processor Cycles using continuous sampling) with a unit mask of 0x00 (No unit mask) count 100000
+samples % image name symbol name
+47 58.7500 mono (no symbols)
+14 17.5000 anon (tgid:3189 range:0xf72aa000-0xf72fa000) (no symbols)
+9 11.2500 anon (tgid:3189 range:0xf6cca000-0xf6dd9000) (no symbols)
+. . . .
+</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+</p>
+ <p>
+Note that, since such mappings are dependent upon individual invocations of
+a binary, these mappings are always listed as a dependent image,
+even when using <code class="option">--separate=none</code>.
+Equally, the results are not affected by the <code class="option">--merge</code>
+option.
+</p>
+ <p>
+As shown in the opreport output above, OProfile is unable to attribute the samples to any
+symbol(s) because there is no ELF file for this code.
+Enhanced support for JITed code is now available for some virtual machines;
+e.g., the Java Virtual Machine. For details about OProfile output for
+JITed code, see <a href="#getting-jit-reports" title="4. OProfile results with JIT samples">Section 4, &#8220;OProfile results with JIT samples&#8221;</a>.
+</p>
+ <p>For more information about JIT support in OProfile, see <a href="#jitsupport" title="1.1. Support for dynamically compiled (JIT) code">Section 1.1, &#8220;Support for dynamically compiled (JIT) code&#8221;</a>.
+</p>
+ </div>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="opreport-xml"></a>2.6. XML formatted output</h3>
+ </div>
+ </div>
+ </div>
+ <p>
+The -xml option can be used to generate XML instead of the usual
+text format. This allows opreport to eliminate some of the constraints
+dictated by the two dimensional text format. For example, it is possible
+to separate the sample data across multiple events, cpus and threads. The XML
+schema implemented by opreport is found in doc/opreport.xsd. It contains
+more detailed comments about the structure of the XML generated by opreport.
+</p>
+ <p>
+Since XML is consumed by a client program rather than a user, its structure
+is fairly static. In particular, the --sort option is incompatible with the
+--xml option. Percentages are not dislayed in the XML so the options related
+to percentages will have no effect. Full pathnames are always displayed in
+the XML so --long-filenames is not necessary. The --details option will cause
+all of the individual sample data to be included in the XML as well as the
+instruction byte stream for each symbol (for doing disassembly) and can result
+in very large XML files.
+</p>
+ </div>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="opreport-options"></a>2.7. Options for <span><strong class="command">opreport</strong></span></h3>
+ </div>
+ </div>
+ </div>
+ <div class="variablelist">
+ <dl>
+ <dt>
+ <span class="term">
+ <code class="option">--accumulated / -a</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Accumulate sample and percentage counts in the symbol list.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--callgraph / -c</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Show callgraph information.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--debug-info / -g</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Show source file and line for each symbol.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--demangle / -D none|normal|smart</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+none: no demangling. normal: use default demangler (default) smart: use
+pattern-matching to make C++ symbol demangling more readable.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--details / -d</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Show per-instruction details for all selected symbols. Note that, for
+binaries without symbol information, the VMA values shown are raw file
+offsets for the image binary.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--exclude-dependent / -x</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Do not include application-specific images for libraries, kernel modules
+and the kernel. This option only makes sense if the profile session
+used --separate.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--exclude-symbols / -e [symbols]</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Exclude all the symbols in the given comma-separated list.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--global-percent / -%</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Make all percentages relative to the whole profile.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--help / -? / --usage</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Show help message.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--image-path / -p [paths]</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Comma-separated list of additional paths to search for binaries.
+This is needed to find modules in kernels 2.6 and upwards.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--root / -R [path]</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+A path to a filesystem to search for additional binaries.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--include-symbols / -i [symbols]</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Only include symbols in the given comma-separated list.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--long-filenames / -f</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Output full paths instead of basenames.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--merge / -m [lib,cpu,tid,tgid,unitmask,all]</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Merge any profiles separated in a --separate session.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--no-header</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Don't output a header detailing profiling parameters.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--output-file / -o [file]</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Output to the given file instead of stdout.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--reverse-sort / -r</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Reverse the sort from the default.
+</p>
+ </dd>
+ <dt>
+ <span class="term"><code class="option">--session-dir=</code>dir_path</span>
+ </dt>
+ <dd>
+ <p>
+Use sample database out of directory <code class="filename">dir_path</code>
+instead of the default location (/var/lib/oprofile).
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--show-address / -w</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Show the VMA address of each symbol (off by default).
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--sort / -s [vma,sample,symbol,debug,image]</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Sort the list of symbols by, respectively, symbol address,
+number of samples, symbol name, debug filename and line number,
+binary image filename.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--symbols / -l</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+List per-symbol information instead of a binary image summary.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--threshold / -t [percentage]</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Only output data for symbols that have more than the given percentage
+of total samples.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--verbose / -V [options]</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Give verbose debugging output.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--version / -v</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Show version.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--xml / -X</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Generate XML output.
+</p>
+ </dd>
+ </dl>
+ </div>
+ </div>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="opannotate"></a>3. Outputting annotated source (<span><strong class="command">opannotate</strong></span>)</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+The <span><strong class="command">opannotate</strong></span> utility generates annotated source files or assembly listings, optionally
+mixed with source.
+If you want to see the source file, the profiled application needs to have debug information, and the source
+must be available through this debug information. For GCC, you must use the <code class="option">-g</code> option
+when you are compiling.
+If the binary doesn't contain sufficient debug information, you can still
+use <span><strong class="command">opannotate <code class="option">--assembly</code></strong></span> to get annotated assembly.
+</p>
+ <p>
+Note that for the reason explained in <a href="#hardware-counters" title="4.1. Hardware performance counters">Section 4.1, &#8220;Hardware performance counters&#8221;</a> the results can be
+inaccurate. The debug information itself can add other problems; for example, the line number for a symbol can be
+incorrect. Assembly instructions can be re-ordered and moved by the compiler, and this can lead to
+crediting source lines with samples not really "owned" by this line. Also see
+<a href="#interpreting" title="Chapter 5. Interpreting profiling results">Chapter 5, <i>Interpreting profiling results</i></a>.
+</p>
+ <p>
+You can output the annotation to one single file, containing all the source found using the
+<code class="option">--source</code>. You can use this in conjunction with <code class="option">--assembly</code>
+to get combined source/assembly output.
+</p>
+ <p>
+You can also output a directory of annotated source files that maintains the structure of
+the original sources. Each line in the annotated source is prepended with the samples
+for that line. Additionally, each symbol is annotated giving details for the symbol
+as a whole. An example:
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+$ opannotate --source --output-dir=annotated /usr/local/oprofile-pp/bin/oprofiled
+$ ls annotated/home/moz/src/oprofile-pp/daemon/
+opd_cookie.h opd_image.c opd_kernel.c opd_sample_files.c oprofiled.c
+</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+Line numbers are maintained in the source files, but each file has
+a footer appended describing the profiling details. The actual annotation
+looks something like this :
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+...
+ :static uint64_t pop_buffer_value(struct transient * trans)
+ 11510 1.9661 :{ /* pop_buffer_value total: 89901 15.3566 */
+ : uint64_t val;
+ :
+ 10227 1.7469 : if (!trans-&gt;remaining) {
+ : fprintf(stderr, "BUG: popping empty buffer !\n");
+ : exit(EXIT_FAILURE);
+ : }
+ :
+ : val = get_buffer_value(trans-&gt;buffer, 0);
+ 2281 0.3896 : trans-&gt;remaining--;
+ 2296 0.3922 : trans-&gt;buffer += kernel_pointer_size;
+ : return val;
+ 10454 1.7857 :}
+...
+</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+The first number on each line is the number of samples, whilst the second is
+the relative percentage of total samples.
+</p>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="opannotate-finding-source"></a>3.1. Locating source files</h3>
+ </div>
+ </div>
+ </div>
+ <p>
+Of course, <span><strong class="command">opannotate</strong></span> needs to be able to locate the source files
+for the binary image(s) in order to produce output. Some binary images have debug
+information where the given source file paths are relative, not absolute. You can
+specify search paths to look for these files (similar to <span><strong class="command">gdb</strong></span>'s
+<code class="option">dir</code> command) with the <code class="option">--search-dirs</code> option.
+</p>
+ <p>
+Sometimes you may have a binary image which gives absolute paths for the source files,
+but you have the actual sources elsewhere (commonly, you've installed an SRPM for
+a binary on your system and you want annotation from an existing profile). You can
+use the <code class="option">--base-dirs</code> option to redirect OProfile to look somewhere
+else for source files. For example, imagine we have a binary generated from a source
+file that is given in the debug information as <code class="filename">/tmp/build/libfoo/foo.c</code>,
+and you have the source tree matching that binary installed in <code class="filename">/home/user/libfoo/</code>.
+You can redirect OProfile to find <code class="filename">foo.c</code> correctly like this :
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+$ opannotate --source --base-dirs=/tmp/build/libfoo/ --search-dirs=/home/user/libfoo/ --output-dir=annotated/ /lib/libfoo.so
+</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+You can specify multiple (comma-separated) paths to both options.
+</p>
+ </div>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="opannotate-details"></a>3.2. Usage of <span><strong class="command">opannotate</strong></span></h3>
+ </div>
+ </div>
+ </div>
+ <div class="variablelist">
+ <dl>
+ <dt>
+ <span class="term">
+ <code class="option">--assembly / -a</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Output annotated assembly. If this is combined with --source, then mixed
+source / assembly annotations are output.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--base-dirs / -b [paths]/</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Comma-separated list of path prefixes. This can be used to point OProfile to a
+different location for source files when the debug information specifies an
+absolute path on your system for the source that does not exist. The prefix
+is stripped from the debug source file paths, then searched in the search dirs
+specified by <code class="option">--search-dirs</code>.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--demangle / -D none|normal|smart</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+none: no demangling. normal: use default demangler (default) smart: use
+pattern-matching to make C++ symbol demangling more readable.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--exclude-dependent / -x</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Do not include application-specific images for libraries, kernel modules
+and the kernel. This option only makes sense if the profile session
+used --separate.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--exclude-file [files]</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Exclude all files in the given comma-separated list of glob patterns.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--exclude-symbols / -e [symbols]</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Exclude all the symbols in the given comma-separated list.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--help / -? / --usage</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Show help message.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--image-path / -p [paths]</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Comma-separated list of additional paths to search for binaries.
+This is needed to find modules in kernels 2.6 and upwards.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--root / -R [path]</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+A path to a filesystem to search for additional binaries.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--include-file [files]</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Only include files in the given comma-separated list of glob patterns.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--include-symbols / -i [symbols]</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Only include symbols in the given comma-separated list.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--objdump-params [params]</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Pass the given parameters as extra values when calling objdump.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--output-dir / -o [dir]</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Output directory. This makes opannotate output one annotated file for each
+source file. This option can't be used in conjunction with --assembly.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--search-dirs / -d [paths]</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Comma-separated list of paths to search for source files. This is useful to find
+source files when the debug information only contains relative paths.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--source / -s</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Output annotated source. This requires debugging information to be available
+for the binaries.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--threshold / -t [percentage]</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Only output data for symbols that have more than the given percentage
+of total samples.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--verbose / -V [options]</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Give verbose debugging output.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--version / -v</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Show version.
+</p>
+ </dd>
+ </dl>
+ </div>
+ </div>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="getting-jit-reports"></a>4. OProfile results with JIT samples</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+ After profiling a Java (or other supported VM) application, the command
+ </p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen"><span xmlns="http://www.w3.org/1999/xhtml"><strong class="command">"opcontrol --dump"</strong></span> </pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+ flushes the sample buffers and creates ELF binaries from the
+ intermediate files that were written by the agent library.
+ The ELF binaries are named <code class="filename">&lt;tgid&gt;.jo</code>.
+ With the symbol information stored in these ELF files, it is
+ possible to map samples to the appropriate symbols.
+ </p>
+ <p>
+ The usual analysis tools (<span><strong class="command">opreport</strong></span> and/or
+ <span><strong class="command">opannotate</strong></span>) can now be used
+ to get symbols and assembly code for the instrumented VM processes.
+ </p>
+ <p>
+Below is an example of a profile report of a Java application that has been
+instrumented with the provided agent library.
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+$ opreport -l /usr/lib/jvm/jre-1.5.0-ibm/bin/java
+CPU: Core Solo / Duo, speed 2167 MHz (estimated)
+Counted CPU_CLK_UNHALTED events (Unhalted clock cycles) with a unit mask of 0x00 (Unhalted core cycles) count 100000
+samples % image name symbol name
+186020 50.0523 no-vmlinux no-vmlinux (no symbols)
+34333 9.2380 7635.jo java void test.f1()
+19022 5.1182 libc-2.5.so libc-2.5.so _IO_file_xsputn@@GLIBC_2.1
+18762 5.0483 libc-2.5.so libc-2.5.so vfprintf
+16408 4.4149 7635.jo java void test$HelloThread.run()
+16250 4.3724 7635.jo java void test$test_1.f2(int)
+15303 4.1176 7635.jo java void test.f2(int, int)
+13252 3.5657 7635.jo java void test.f2(int)
+5165 1.3897 7635.jo java void test.f4()
+955 0.2570 7635.jo java void test$HelloThread.run()~
+
+</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+</p>
+ <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
+ <h3 class="title">Note</h3>
+ <p>
+ Depending on the JVM that is used, certain options of opreport and opannotate
+ do NOT work since they rely on debug information (e.g. source code line number)
+ that is not always available. The Sun JVM does provide the necessary debug
+ information via the JVMTI[PI] interface,
+ but other JVMs do not.
+ </p>
+ </div>
+ <p>
+ As you can see in the opreport output, the JIT support agent for Java
+ generates symbols to include the class and method signature.
+ A symbol with the suffix &#732;&lt;n&gt; (e.g.
+ <code class="code">void test$HelloThread.run()&#732;1</code>) means that this is
+ the &lt;n&gt;th occurrence of the identical name. This happens if a method is re-JITed.
+ A symbol with the suffix %&lt;n&gt;, means that the address space of this symbol
+ was reused during the sample session (see <a href="#overlapping-symbols" title="6. Overlapping symbols in JITed code">Section 6, &#8220;Overlapping symbols in JITed code&#8221;</a>).
+ The value &lt;n&gt; is the percentage of time that this symbol/code was present in
+ relation to the total lifetime of all overlapping other symbols. A symbol of the form
+ <code class="code">&lt;return_val&gt; &lt;class_name&gt;$&lt;method_sig&gt;</code> denotes an
+ inner class.
+ </p>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="opgprof"></a>5. <span><strong class="command">gprof</strong></span>-compatible output (<span><strong class="command">opgprof</strong></span>)</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+If you're familiar with the output produced by <span><strong class="command">GNU gprof</strong></span>,
+you may find <span><strong class="command">opgprof</strong></span> useful. It takes a single binary
+as an argument, and produces a <code class="filename">gmon.out</code> file for use
+with <span><strong class="command">gprof -p</strong></span>. If call-graph profiling is enabled,
+then this is also included.
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+$ opgprof `which oprofiled` # generates gmon.out file
+$ gprof -p `which oprofiled` | head
+Flat profile:
+
+Each sample counts as 1 samples.
+ % cumulative self self total
+ time samples samples calls T1/call T1/call name
+ 33.13 206237.00 206237.00 odb_insert
+ 22.67 347386.00 141149.00 pop_buffer_value
+ 9.56 406881.00 59495.00 opd_put_sample
+ 7.34 452599.00 45718.00 opd_find_image
+ 7.19 497327.00 44728.00 opd_process_samples
+</pre>
+ </td>
+ </tr>
+ </table>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="opgprof-details"></a>5.1. Usage of <span><strong class="command">opgprof</strong></span></h3>
+ </div>
+ </div>
+ </div>
+ <div class="variablelist">
+ <dl>
+ <dt>
+ <span class="term">
+ <code class="option">--help / -? / --usage</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Show help message.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--image-path / -p [paths]</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Comma-separated list of additional paths to search for binaries.
+This is needed to find modules in kernels 2.6 and upwards.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--root / -R [path]</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+A path to a filesystem to search for additional binaries.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--output-filename / -o [file]</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Output to the given file instead of the default, gmon.out
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--threshold / -t [percentage]</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Only output data for symbols that have more than the given percentage
+of total samples.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--verbose / -V [options]</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Give verbose debugging output.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--version / -v</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Show version.
+</p>
+ </dd>
+ </dl>
+ </div>
+ </div>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="oparchive"></a>6. Archiving measurements (<span><strong class="command">oparchive</strong></span>)</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+ The <span><strong class="command">oparchive</strong></span> utility generates a directory populated
+ with executable, debug, and oprofile sample files. This directory can be
+ moved to another machine via <span><strong class="command">tar</strong></span> and analyzed without
+ further use of the data collection machine.
+</p>
+ <p>
+ The following command would collect the sample files, the executables
+ associated with the sample files, and the debuginfo files associated
+ with the executables and copy them into
+ <code class="filename">/tmp/current_data</code>:
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+# oparchive -o /tmp/current_data
+</pre>
+ </td>
+ </tr>
+ </table>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="oparchive-details"></a>6.1. Usage of <span><strong class="command">oparchive</strong></span></h3>
+ </div>
+ </div>
+ </div>
+ <div class="variablelist">
+ <dl>
+ <dt>
+ <span class="term">
+ <code class="option">--help / -? / --usage</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Show help message.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--exclude-dependent / -x</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Do not include application-specific images for libraries, kernel modules
+and the kernel. This option only makes sense if the profile session
+used --separate.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--image-path / -p [paths]</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Comma-separated list of additional paths to search for binaries.
+This is needed to find modules in kernels 2.6 and upwards.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--root / -R [path]</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+A path to a filesystem to search for additional binaries.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--output-directory / -o [directory]</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Output to the given directory. There is no default. This must be specified.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--list-files / -l</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Only list the files that would be archived, don't copy them.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--verbose / -V [options]</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Give verbose debugging output.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--version / -v</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Show version.
+</p>
+ </dd>
+ </dl>
+ </div>
+ </div>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="opimport"></a>7. Converting sample database files (<span><strong class="command">opimport</strong></span>)</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+ This utility converts sample database files from a foreign binary format (abi) to
+ the native format. This is useful only when moving sample files between hosts,
+ for analysis on platforms other than the one used for collection. The abi format
+ of the file to be imported is described in a text file located in <code class="filename">$SESSION_DIR/abi</code>.
+</p>
+ <p>
+ The following command would convert the input samples files to the
+ output samples files using the given abi file as a binary description
+ of the input file and the curent platform abi as a binary description
+ of the output file.
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+# opimport -a /var/lib/oprofile/abi -o /tmp/current/.../GLOBAL_POWER_EVENTS.200000.1.all.all.all /var/lib/.../mprime/GLOBAL_POWER_EVENTS.200000.1.all.all.all
+</pre>
+ </td>
+ </tr>
+ </table>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="opimport-details"></a>7.1. Usage of <span><strong class="command">opimport</strong></span></h3>
+ </div>
+ </div>
+ </div>
+ <div class="variablelist">
+ <dl>
+ <dt>
+ <span class="term">
+ <code class="option">--help / -? / --usage</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Show help message.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--abi / -a [filename]</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Input abi file description location.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--force / -f</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Force conversion even if the input and output abi are identical.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--output / -o [filename]</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Specify the output filename. If the output file already exists, the file is
+not overwritten but data are accumulated in. Sample filename are informative
+for post profile tools and must be kept identical, in other word the pathname
+from the first path component containing a '{' must be kept as it in the
+output filename.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--verbose / -V</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Give verbose debugging output.
+</p>
+ </dd>
+ <dt>
+ <span class="term">
+ <code class="option">--version / -v</code>
+ </span>
+ </dt>
+ <dd>
+ <p>
+Show version.
+</p>
+ </dd>
+ </dl>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="chapter" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title"><a id="interpreting"></a>Chapter 5. Interpreting profiling results</h2>
+ </div>
+ </div>
+ </div>
+ <div class="toc">
+ <p>
+ <b>Table of Contents</b>
+ </p>
+ <dl>
+ <dt>
+ <span class="sect1">
+ <a href="#irq-latency">1. Profiling interrupt latency</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#kernel-profiling">2. Kernel profiling</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect2">
+ <a href="#irq-masking">2.1. Interrupt masking</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#idle">2.2. Idle time</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#kernel-modules">2.3. Profiling kernel modules</a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ <dt>
+ <span class="sect1">
+ <a href="#interpreting-callgraph">3. Interpreting call-graph profiles</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#debug-info">4. Inaccuracies in annotated source</a>
+ </span>
+ </dt>
+ <dd>
+ <dl>
+ <dt>
+ <span class="sect2">
+ <a href="#effect-of-optimizations">4.1. Side effects of optimizations</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#prologues">4.2. Prologues and epilogues</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#inlined-function">4.3. Inlined functions</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect2">
+ <a href="#wrong-linenr-info">4.4. Inaccuracy in line number information</a>
+ </span>
+ </dt>
+ </dl>
+ </dd>
+ <dt>
+ <span class="sect1">
+ <a href="#symbol-without-debug-info">5. Assembly functions</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#overlapping-symbols">6. Overlapping symbols in JITed code</a>
+ </span>
+ </dt>
+ <dt>
+ <span class="sect1">
+ <a href="#hidden-cost">7. Other discrepancies</a>
+ </span>
+ </dt>
+ </dl>
+ </div>
+ <p>
+The standard caveats of profiling apply in interpreting the results from OProfile:
+profile realistic situations, profile different scenarios, profile
+for as long as a time as possible, avoid system-specific artifacts, don't trust
+the profile data too much. Also bear in mind the comments on the performance
+counters above - you <span class="emphasis"><em>cannot</em></span> rely on totally accurate
+instruction-level profiling. However, for almost all circumstances the data
+can be useful. Ideally a utility such as Intel's VTUNE would be available to
+allow careful instruction-level analysis; go hassle Intel for this, not me ;)
+</p>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="irq-latency"></a>1. Profiling interrupt latency</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+This is an example of how the latency of delivery of profiling interrupts
+can impact the reliability of the profiling data. This is pretty much a
+worst-case-scenario example: these problems are fairly rare.
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+double fun(double a, double b, double c)
+{
+ double result = 0;
+ for (int i = 0 ; i &lt; 10000; ++i) {
+ result += a;
+ result *= b;
+ result /= c;
+ }
+ return result;
+}
+</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+Here the last instruction of the loop is very costly, and you would expect the result
+reflecting that - but (cutting the instructions inside the loop):
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+$ opannotate -a -t 10 ./a.out
+
+ 88 15.38% : 8048337: fadd %st(3),%st
+ 48 8.391% : 8048339: fmul %st(2),%st
+ 68 11.88% : 804833b: fdiv %st(1),%st
+ 368 64.33% : 804833d: inc %eax
+ : 804833e: cmp $0x270f,%eax
+ : 8048343: jle 8048337
+</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+The problem comes from the x86 hardware; when the counter overflows the IRQ
+is asserted but the hardware has features that can delay the NMI interrupt:
+x86 hardware is synchronous (i.e. cannot interrupt during an instruction);
+there is also a latency when the IRQ is asserted, and the multiple
+execution units and the out-of-order model of modern x86 CPUs also causes
+problems. This is the same function, with annotation :
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+$ opannotate -s -t 10 ./a.out
+
+ :double fun(double a, double b, double c)
+ :{ /* _Z3funddd total: 572 100.0% */
+ : double result = 0;
+ 368 64.33% : for (int i = 0 ; i &lt; 10000; ++i) {
+ 88 15.38% : result += a;
+ 48 8.391% : result *= b;
+ 68 11.88% : result /= c;
+ : }
+ : return result;
+ :}
+</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+The conclusion: don't trust samples coming at the end of a loop,
+particularly if the last instruction generated by the compiler is costly. This
+case can also occur for branches. Always bear in mind that samples
+can be delayed by a few cycles from its real position. That's a hardware
+problem and OProfile can do nothing about it.
+</p>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="kernel-profiling"></a>2. Kernel profiling</h2>
+ </div>
+ </div>
+ </div>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="irq-masking"></a>2.1. Interrupt masking</h3>
+ </div>
+ </div>
+ </div>
+ <p>
+OProfile uses non-maskable interrupts (NMI) on the P6 generation, Pentium 4,
+Athlon, Opteron, Phenom, and Turion processors. These interrupts can occur even in section of the
+Linux where interrupts are disabled, allowing collection of samples in virtually
+all executable code. The RTC, timer interrupt mode, and Itanium 2 collection mechanisms
+use maskable interrupts. Thus, the RTC and Itanium 2 data collection mechanism have "sample
+shadows", or blind spots: regions where no samples will be collected. Typically, the samples
+will be attributed to the code immediately after the interrupts are re-enabled.
+</p>
+ </div>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="idle"></a>2.2. Idle time</h3>
+ </div>
+ </div>
+ </div>
+ <p>
+Your kernel is likely to support halting the processor when a CPU is idle. As
+the typical hardware events like <code class="constant">CPU_CLK_UNHALTED</code> do not
+count when the CPU is halted, the kernel profile will not reflect the actual
+amount of time spent idle. You can change this behaviour by booting with
+the <code class="option">idle=poll</code> option, which uses a different idle routine. This
+will appear as <code class="function">poll_idle()</code> in your kernel profile.
+</p>
+ </div>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="kernel-modules"></a>2.3. Profiling kernel modules</h3>
+ </div>
+ </div>
+ </div>
+ <p>
+OProfile profiles kernel modules by default. However, there are a couple of problems
+you may have when trying to get results. First, you may have booted via an initrd;
+this means that the actual path for the module binaries cannot be determined automatically.
+To get around this, you can use the <code class="option">-p</code> option to the profiling tools
+to specify where to look for the kernel modules.
+</p>
+ <p>
+In 2.6, the information on where kernel module binaries are located has been removed.
+This means OProfile needs guiding with the <code class="option">-p</code> option to find your
+modules. Normally, you can just use your standard module top-level directory for this.
+Note that due to this problem, OProfile cannot check that the modification times match;
+it is your responsibility to make sure you do not modify a binary after a profile
+has been created.
+</p>
+ <p>
+If you have run <span><strong class="command">insmod</strong></span> or <span><strong class="command">modprobe</strong></span> to insert a module
+in a particular directory, it is important that you specify this directory with the
+<code class="option">-p</code> option first, so that it over-rides an older module binary that might
+exist in other directories you've specified with <code class="option">-p</code>. It is up to you
+to make sure that these values are correct: 2.6 kernels simply do not provide enough
+information for OProfile to get this information.
+</p>
+ </div>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="interpreting-callgraph"></a>3. Interpreting call-graph profiles</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+Sometimes the results from call-graph profiles may be different to what
+you expect to see. The first thing to check is whether the target
+binaries where compiled with frame pointers enabled (if the binary was
+compiled using <span><strong class="command">gcc</strong></span>'s
+<code class="option">-fomit-frame-pointer</code> option, you will not get
+meaningful results). Note that as of this writing, the GCC developers
+plan to disable frame pointers by default. The Linux kernel is built
+without frame pointers by default; there is a configuration option you
+can use to turn it on under the "Kernel Hacking" menu.
+</p>
+ <p>
+Often you may see a caller of a function that does not actually directly
+call the function you're looking at (e.g. if <code class="function">a()</code>
+calls <code class="function">b()</code>, which in turn calls
+<code class="function">c()</code>, you may see an entry for
+<code class="function">a()-&gt;c()</code>). What's actually occurring is that we
+are taking samples at the very start (or the very end) of
+<code class="function">c()</code>; at these few instructions, we haven't yet
+created the new function's frame, so it appears as if
+<code class="function">a()</code> is calling directly into
+<code class="function">c()</code>. Be careful not to be misled by these
+entries.
+</p>
+ <p>
+Like the rest of OProfile, call-graph profiling uses a statistical
+approach; this means that sometimes a backtrace sample is truncated, or
+even partially wrong. Bear this in mind when examining results.
+</p>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="debug-info"></a>4. Inaccuracies in annotated source</h2>
+ </div>
+ </div>
+ </div>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="effect-of-optimizations"></a>4.1. Side effects of optimizations</h3>
+ </div>
+ </div>
+ </div>
+ <p>
+The compiler can introduce some pitfalls in the annotated source output.
+The optimizer can move pieces of code in such manner that two line of codes
+are interlaced (instruction scheduling). Also debug info generated by the compiler
+can show strange behavior. This is especially true for complex expressions e.g. inside
+an if statement:
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+ if (a &amp;&amp; ..
+ b &amp;&amp; ..
+ c &amp;&amp;)
+</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+here the problem come from the position of line number. The available debug
+info does not give enough details for the if condition, so all samples are
+accumulated at the position of the right brace of the expression. Using
+<span><strong class="command">opannotate <code class="option">-a</code></strong></span> can help to show the real
+samples at an assembly level.
+</p>
+ </div>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="prologues"></a>4.2. Prologues and epilogues</h3>
+ </div>
+ </div>
+ </div>
+ <p>
+The compiler generally needs to generate "glue" code across function calls, dependent
+on the particular function call conventions used. Additionally other things
+need to happen, like stack pointer adjustment for the local variables; this
+code is known as the function prologue. Similar code is needed at function return,
+and is known as the function epilogue. This will show up in annotations as
+samples at the very start and end of a function, where there is no apparent
+executable code in the source.
+</p>
+ </div>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="inlined-function"></a>4.3. Inlined functions</h3>
+ </div>
+ </div>
+ </div>
+ <p>
+You may see that a function is credited with a certain number of samples, but
+the listing does not add up to the correct total. To pick a real example :
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+ :internal_sk_buff_alloc_security(struct sk_buff *skb)
+ 353 2.342% :{ /* internal_sk_buff_alloc_security total: 1882 12.48% */
+ :
+ : sk_buff_security_t *sksec;
+ 15 0.0995% : int rc = 0;
+ :
+ 10 0.06633% : sksec = skb-&gt;lsm_security;
+ 468 3.104% : if (sksec &amp;&amp; sksec-&gt;magic == DSI_MAGIC) {
+ : goto out;
+ : }
+ :
+ : sksec = (sk_buff_security_t *) get_sk_buff_memory(skb);
+ 3 0.0199% : if (!sksec) {
+ 38 0.2521% : rc = -ENOMEM;
+ : goto out;
+ 10 0.06633% : }
+ : memset(sksec, 0, sizeof (sk_buff_security_t));
+ 44 0.2919% : sksec-&gt;magic = DSI_MAGIC;
+ 32 0.2123% : sksec-&gt;skb = skb;
+ 45 0.2985% : sksec-&gt;sid = DSI_SID_NORMAL;
+ 31 0.2056% : skb-&gt;lsm_security = sksec;
+ :
+ : out:
+ :
+ 146 0.9685% : return rc;
+ :
+ 98 0.6501% :}
+</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+Here, the function is credited with 1,882 samples, but the annotations
+below do not account for this. This is usually because of inline functions -
+the compiler marks such code with debug entries for the inline function
+definition, and this is where <span><strong class="command">opannotate</strong></span> annotates
+such samples. In the case above, <code class="function">memset</code> is the most
+likely candidate for this problem. Examining the mixed source/assembly
+output can help identify such results.
+</p>
+ <p>
+This problem is more visible when there is no source file available, in the
+following example it's trivially visible the sums of symbols samples is less
+than the number of the samples for this file. The difference must be accounted
+to inline functions.
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+/*
+ * Total samples for file : "arch/i386/kernel/process.c"
+ *
+ * 109 2.4616
+ */
+
+ /* default_idle total: 84 1.8970 */
+ /* cpu_idle total: 21 0.4743 */
+ /* flush_thread total: 1 0.0226 */
+ /* prepare_to_copy total: 1 0.0226 */
+ /* __switch_to total: 18 0.4065 */
+</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+The missing samples are not lost, they will be credited to another source
+location where the inlined function is defined. The inlined function will be
+credited from multiple call site and merged in one place in the annotated
+source file so there is no way to see from what call site are coming the
+samples for an inlined function.
+</p>
+ <p>
+When running <span><strong class="command">opannotate</strong></span>, you may get a warning
+"some functions compiled without debug information may have incorrect source line attributions".
+In some rare cases, OProfile is not able to verify that the derived source line
+is correct (when some parts of the binary image are compiled without debugging
+information). Be wary of results if this warning appears.
+</p>
+ <p>
+Furthermore, for some languages the compiler can implicitly generate functions,
+such as default copy constructors. Such functions are labelled by the compiler
+as having a line number of 0, which means the source annotation can be confusing.
+</p>
+ </div>
+ <div class="sect2" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h3 class="title"><a id="wrong-linenr-info"></a>4.4. Inaccuracy in line number information</h3>
+ </div>
+ </div>
+ </div>
+ <p>
+Depending on your compiler you can fall into the following problem:
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+struct big_object { int a[500]; };
+
+int main()
+{
+ big_object a, b;
+ for (int i = 0 ; i != 1000 * 1000; ++i)
+ b = a;
+ return 0;
+}
+
+</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+Compiled with <span><strong class="command">gcc</strong></span> 3.0.4 the annotated source is clearly inaccurate:
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+ :int main()
+ :{ /* main total: 7871 100% */
+ : big_object a, b;
+ : for (int i = 0 ; i != 1000 * 1000; ++i)
+ : b = a;
+ 7871 100% : return 0;
+ :}
+</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+The problem here is distinct from the IRQ latency problem; the debug line number
+information is not precise enough; again, looking at output of <span><strong class="command">opannoatate -as</strong></span> can help.
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+ :int main()
+ :{
+ : big_object a, b;
+ : for (int i = 0 ; i != 1000 * 1000; ++i)
+ : 80484c0: push %ebp
+ : 80484c1: mov %esp,%ebp
+ : 80484c3: sub $0xfac,%esp
+ : 80484c9: push %edi
+ : 80484ca: push %esi
+ : 80484cb: push %ebx
+ : b = a;
+ : 80484cc: lea 0xfffff060(%ebp),%edx
+ : 80484d2: lea 0xfffff830(%ebp),%eax
+ : 80484d8: mov $0xf423f,%ebx
+ : 80484dd: lea 0x0(%esi),%esi
+ : return 0;
+ 3 0.03811% : 80484e0: mov %edx,%edi
+ : 80484e2: mov %eax,%esi
+ 1 0.0127% : 80484e4: cld
+ 8 0.1016% : 80484e5: mov $0x1f4,%ecx
+ 7850 99.73% : 80484ea: repz movsl %ds:(%esi),%es:(%edi)
+ 9 0.1143% : 80484ec: dec %ebx
+ : 80484ed: jns 80484e0
+ : 80484ef: xor %eax,%eax
+ : 80484f1: pop %ebx
+ : 80484f2: pop %esi
+ : 80484f3: pop %edi
+ : 80484f4: leave
+ : 80484f5: ret
+</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+So here it's clear that copying is correctly credited with of all the samples, but the
+line number information is misplaced. <span><strong class="command">objdump -dS</strong></span> exposes the
+same problem. Note that maintaining accurate debug information for compilers when optimizing is difficult, so this problem is not suprising.
+The problem of debug information
+accuracy is also dependent on the binutils version used; some BFD library versions
+contain a work-around for known problems of <span><strong class="command">gcc</strong></span>, some others do not. This is unfortunate but we must live with that,
+since profiling is pointless when you disable optimisation (which would give better debugging entries).
+</p>
+ </div>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="symbol-without-debug-info"></a>5. Assembly functions</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+Often the assembler cannot generate debug information automatically.
+This means that you cannot get a source report unless
+you manually define the neccessary debug information; read your assembler documentation for how you might
+do that. The only
+debugging info needed currently by OProfile is the line-number/filename-VMA association. When profiling assembly
+without debugging info you can always get report for symbols, and optionally for VMA, through <span><strong class="command">opreport -l</strong></span>
+or <span><strong class="command">opreport -d</strong></span>, but this works only for symbols with the right attributes.
+For <span><strong class="command">gas</strong></span> you can get this by
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+.globl foo
+ .type foo,@function
+</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+whilst for <span><strong class="command">nasm</strong></span> you must use
+</p>
+ <table xmlns="" border="0" style="background: #E0E0E0;" width="90%">
+ <tr>
+ <td>
+ <pre class="screen">
+ GLOBAL foo:function ; [1]
+</pre>
+ </td>
+ </tr>
+ </table>
+ <p>
+Note that OProfile does not need the global attribute, only the function attribute.
+</p>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="overlapping-symbols"></a>6. Overlapping symbols in JITed code</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+ Some virtual machines (e.g., Java) may re-JIT a method, resulting in previously
+ allocated space for a piece of compiled code to be reused. This means that, at one distinct
+ code address, multiple symbols/methods may be present during the run time of the application.
+ </p>
+ <p>
+ Since OProfile samples are buffered and don&#8242;t have timing information, there is no way
+ to correlate samples with the (possibly) varying address ranges in which the code for a symbol
+ may reside.
+ An alternative would be flushing the OProfile sampling buffer when we get an unload event,
+ but this could result in high overhead.
+ </p>
+ <p>
+ To moderate the problem of overlapping symbols, OProfile tries to select the symbol that was
+ present at this address range most of the time. Additionally, other overlapping symbols
+ are truncated in the overlapping area.
+ This gives reasonable results, because in reality, address reuse typically takes place
+ during phase changes of the application -- in particular, during application startup.
+ Thus, for optimum profiling results, start the sampling session after application startup
+ and burn in.
+ </p>
+ </div>
+ <div class="sect1" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title" style="clear: both"><a id="hidden-cost"></a>7. Other discrepancies</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+Another cause of apparent problems is the hidden cost of instructions. A very
+common example is two memory reads: one from L1 cache and the other from memory:
+the second memory read is likely to have more samples.
+There are many other causes of hidden cost of instructions. A non-exhaustive
+list: mis-predicted branch, TLB cache miss, partial register stall,
+partial register dependencies, memory mismatch stall, re-executed µops. If you want to write
+programs at the assembly level, be sure to take a look at the Intel and
+AMD documentation at <a href="http://developer.intel.com/">http://developer.intel.com/</a>
+and <a href="http://developer.amd.com/devguides.jsp/">http://developer.amd.com/devguides.jsp</a>.
+</p>
+ </div>
+ </div>
+ <div class="chapter" lang="en" xml:lang="en">
+ <div class="titlepage">
+ <div>
+ <div>
+ <h2 class="title"><a id="ack"></a>Chapter 6. Acknowledgments</h2>
+ </div>
+ </div>
+ </div>
+ <p>
+Thanks to (in no particular order) : Arjan van de Ven, Rik van Riel, Juan Quintela, Philippe Elie,
+Phillipp Rumpf, Tigran Aivazian, Alex Brown, Alisdair Rawsthorne, Bob Montgomery, Ray Bryant, H.J. Lu,
+Jeff Esper, Will Cohen, Graydon Hoare, Cliff Woolley, Alex Tsariounov, Al Stone, Jason Yeh,
+Randolph Chung, Anton Blanchard, Richard Henderson, Andries Brouwer, Bryan Rittmeyer,
+Maynard P. Johnson,
+Richard Reich (rreich@rdrtech.com), Zwane Mwaikambo, Dave Jones, Charles Filtness; and finally Pulp, for "Intro".
+</p>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/doc/oprofile.xml b/doc/oprofile.xml
new file mode 100644
index 0000000..35ba48a
--- /dev/null
+++ b/doc/oprofile.xml
@@ -0,0 +1,2942 @@
+<?xml version="1.0" encoding='ISO-8859-1'?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
+
+<book id="oprofile-guide">
+<bookinfo>
+ <title>OProfile manual</title>
+
+ <authorgroup>
+ <author>
+ <firstname>John</firstname>
+ <surname>Levon</surname>
+ <affiliation>
+ <address><email>levon@movementarian.org</email></address>
+ </affiliation>
+ </author>
+ </authorgroup>
+
+ <copyright>
+ <year>2000-2004</year>
+ <holder>Victoria University of Manchester, John Levon and others</holder>
+ </copyright>
+</bookinfo>
+
+<toc></toc>
+
+<chapter id="introduction">
+<title>Introduction</title>
+
+<para>
+This manual applies to OProfile version <oprofileversion />.
+OProfile is a profiling system for Linux 2.2/2.4/2.6 systems on a number of architectures. It is capable of profiling
+all parts of a running system, from the kernel (including modules and interrupt handlers) to shared libraries
+to binaries. It runs transparently in the background collecting information at a low overhead. These
+features make it ideal for profiling entire systems to determine bottle necks in real-world systems.
+</para>
+<para>
+Many CPUs provide "performance counters", hardware registers that can count "events"; for example,
+cache misses, or CPU cycles. OProfile provides profiles of code based on the number of these occurring events:
+repeatedly, every time a certain (configurable) number of events has occurred, the PC value is recorded.
+This information is aggregated into profiles for each binary image.</para>
+<para>
+Some hardware setups do not allow OProfile to use performance counters: in these cases, no
+events are available, and OProfile operates in timer/RTC mode, as described in later chapters.
+</para>
+<sect1 id="applications">
+<title>Applications of OProfile</title>
+<para>
+OProfile is useful in a number of situations. You might want to use OProfile when you :
+</para>
+<itemizedlist>
+<listitem><para>need low overhead</para></listitem>
+<listitem><para>cannot use highly intrusive profiling methods</para></listitem>
+<listitem><para>need to profile interrupt handlers</para></listitem>
+<listitem><para>need to profile an application and its shared libraries</para></listitem>
+<listitem><para>need to profile dynamically compiled code of supported virtual machines (see <xref linkend="jitsupport"/>)</para></listitem>
+<listitem><para>need to capture the performance behaviour of entire system</para></listitem>
+<listitem><para>want to examine hardware effects such as cache misses</para></listitem>
+<listitem><para>want detailed source annotation</para></listitem>
+<listitem><para>want instruction-level profiles</para></listitem>
+<listitem><para>want call-graph profiles</para></listitem>
+</itemizedlist>
+<para>
+OProfile is not a panacea. OProfile might not be a complete solution when you :
+</para>
+<itemizedlist>
+<listitem><para>require call graph profiles on platforms other than 2.6/x86</para></listitem>
+<listitem><para>don't have root permissions</para></listitem>
+<listitem><para>require 100% instruction-accurate profiles</para></listitem>
+<listitem><para>need function call counts or an interstitial profiling API</para></listitem>
+<listitem><para>cannot tolerate any disturbance to the system whatsoever</para></listitem>
+<listitem><para>need to profile interpreted or dynamically compiled code of non-supported virtual machines</para></listitem>
+</itemizedlist>
+<sect2 id="jitsupport">
+<title>Support for dynamically compiled (JIT) code</title>
+<para>
+Older versions of OProfile were not capable of attributing samples to symbols from dynamically
+compiled code, i.e. "just-in-time (JIT) code". Typical JIT compilers load the JIT code into
+anonymous memory regions. OProfile reported the samples from such code, but the attribution
+provided was simply:
+ <screen>"anon: &lt;tgid&gt;&lt;address range&gt;" </screen>
+Due to this limitation, it wasn't possible to profile applications executed by virtual machines (VMs)
+like the Java Virtual Machine. OProfile now contains an infrastructure to support JITed code.
+A development library is provided to allow developers
+to add support for any VM that produces dynamically compiled code (see the <emphasis>OProfile JIT agent
+developer guide</emphasis>).
+In addition, built-in support is included for the following:</para>
+<itemizedlist><listitem>JVMTI agent library for Java (1.5 and higher)</listitem>
+<listitem>JVMPI agent library for Java (1.5 and lower)</listitem>
+</itemizedlist>
+<para>
+For information on how to use OProfile's JIT support, see <xref linkend="setup-jit"/>.
+</para>
+</sect2>
+</sect1>
+
+<sect1 id="requirements">
+<title>System requirements</title>
+
+<variablelist>
+ <varlistentry>
+ <term>Linux kernel 2.2/2.4/2.6</term>
+ <listitem><para>
+ OProfile uses a kernel module that can be compiled for
+ 2.2.11 or later and 2.4. 2.4.10 or above is required if you use the
+ boot-time kernel option <option>nosmp</option>. 2.6 kernels are supported with the in-kernel
+ OProfile driver. Note that only 32-bit x86 and IA64 are supported on 2.2/2.4 kernels.
+ </para>
+
+ <para>
+ 2.6 kernels are strongly recommended. Under 2.4, OProfile may cause system crashes if power
+ management is used, or the BIOS does not correctly deal with local APICs.
+ </para>
+
+ <para>
+ PPC64 processors (Power4/Power5/PPC970, etc.) require a recent (&gt; 2.6.5) kernel with the line
+ <constant>#define PV_970</constant> present in <filename>include/asm-ppc64/processor.h</filename>.
+<!-- FIXME: do we require always gte 2.4.10 for nosmp ? -->
+ </para>
+ <para>
+ Profiling the Cell Broadband Engine PowerPC Processing Element (PPE) requires a kernel version
+ of 2.6.18 or more recent.
+ Profiling the Cell Broadband Engine Synergistic Processing Element (SPE) requires a kernel version
+ of 2.6.22 or more recent. Additionally, full support of SPE profiling requires a BFD library
+ from binutils code dated January 2007 or later. To ensure the proper BFD support exists, run
+ the <code>configure</code> utility with <code>--with-target=cell-be</code>.
+
+ Profiling the Cell Broadband Engine using SPU events requires a kernel version of 2.6.29-rc1
+ or more recent.
+
+ <note>Attempting to profile SPEs with kernel versions older than 2.6.22 may cause the
+ system to crash.</note>
+ </para>
+
+ <para>
+ Instruction-Based Sampling (IBS) profile on AMD family10h processors requires
+ kernel version 2.6.28-rc2 or later.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>modutils 2.4.6 or above</term>
+ <listitem><para>
+ You should have installed modutils 2.4.6 or higher (in fact earlier versions work well in almost all
+ cases).
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Supported architecture</term>
+ <listitem><para>
+ For Intel IA32, a CPU with either a P6 generation or Pentium 4 core is
+ required. In marketing terms this translates to anything
+ between an Intel Pentium Pro (not Pentium Classics) and
+ a Pentium 4 / Xeon, including all Celerons. The AMD
+ Athlon, Opteron, Phenom, and Turion CPUs are also supported. Other IA32
+ CPU types only support the RTC mode of OProfile; please
+ see later in this manual for details. Hyper-threaded Pentium IVs
+ are not supported in 2.4. For 2.4 kernels, the Intel
+ IA-64 CPUs are also supported. For 2.6 kernels, there is additionally
+ support for Alpha processors, MIPS, ARM, x86-64, sparc64, ppc64, AVR32, and,
+ in timer mode, PA-RISC and s390.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Uniprocessor or SMP</term>
+ <listitem><para>
+ SMP machines are fully supported.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Required libraries</term>
+ <listitem><para>
+ These libraries are required : <filename>popt</filename>, <filename>bfd</filename>,
+ <filename>liberty</filename> (debian users: libiberty is provided in binutils-dev package), <filename>dl</filename>,
+ plus the standard C++ libraries.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Required user account</term>
+ <listitem><para>
+ For secure processing of sample data from JIT virtual machines (e.g., Java),
+ the special user account "oprofile" must exist on the system. The 'configure'
+ and 'make install' operations will print warning messages if this
+ account is not found. If you intend to profile JITed code, you must create
+ a group account named 'oprofile' and then create the 'oprofile' user account,
+ setting the default group to 'oprofile'. A runtime error message is printed to
+ the oprofile daemon log when processing JIT samples if this special user
+ account cannot be found.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>OProfile GUI</term>
+ <listitem><para>
+ The use of the GUI to start the profiler requires the <filename>Qt 2</filename> library. <filename>Qt 3</filename> should
+ also work.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><acronym>ELF</acronym></term>
+ <listitem><para>
+ Probably not too strenuous a requirement, but older <acronym>A.OUT</acronym> binaries/libraries are not supported.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>K&amp;R coding style</term>
+ <listitem><para>
+ OK, so it's not really a requirement, but I wish it was...
+ </para></listitem>
+ </varlistentry>
+</variablelist>
+
+
+</sect1>
+
+<sect1 id="resources">
+<title>Internet resources</title>
+
+<variablelist>
+ <varlistentry>
+ <term>Web page</term>
+ <listitem><para>
+ There is a web page (which you may be reading now) at
+ <ulink url="http://oprofile.sf.net/">http://oprofile.sf.net/</ulink>.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Download</term>
+ <listitem><para>
+ You can download a source tarball or get anonymous CVS at the sourceforge page,
+ <ulink url="http://sf.net/projects/oprofile/">http://sf.net/projects/oprofile/</ulink>.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Mailing list</term>
+ <listitem><para>
+ There is a low-traffic OProfile-specific mailing list, details at
+ <ulink url="http://sf.net/mail/?group_id=16191">http://sf.net/mail/?group_id=16191</ulink>.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>Bug tracker</term>
+ <listitem><para>
+ There is a bug tracker for OProfile at SourceForge,
+ <ulink url="http://sf.net/tracker/?group_id=16191&amp;atid=116191">http://sf.net/tracker/?group_id=16191&amp;atid=116191</ulink>.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>IRC channel</term>
+ <listitem><para>
+ Several OProfile developers and users sometimes hang out on channel <command>#oprofile</command>
+ on the <ulink url="http://oftc.net">OFTC</ulink> network.
+ </para></listitem>
+ </varlistentry>
+</variablelist>
+
+</sect1>
+
+<sect1 id="install">
+<title>Installation</title>
+
+<para>
+First you need to build OProfile and install it. <command>./configure</command>, <command>make</command>, <command>make install</command>
+is often all you need, but note these arguments to <command>./configure</command> :
+</para>
+<variablelist>
+ <varlistentry>
+ <term><option>--with-linux</option></term>
+ <listitem><para>
+ Use this option to specify the location of the kernel source tree you wish
+ to compile against. The kernel module is built against this source and
+ will only work with a running kernel built from the same source with
+ exact same options, so it is important you specify this option if you need
+ to.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--with-java</option></term>
+ <listitem>
+ <para>
+ Use this option if you need to profile Java applications. Also, see
+ <xref linkend="requirements"/>, "Required user account". This option
+ is used to specify the location of the Java Development Kit (JDK)
+ source tree you wish to use. This is necessary to get the interface description
+ of the JVMPI (or JVMTI) interface to compile the JIT support code successfully.
+ </para>
+ <note>
+ <para>
+ The Java Runtime Environment (JRE) does not include the development
+ files that are required to compile the JIT support code, so the full
+ JDK must be installed in order to use this option.
+ </para>
+ </note>
+ <para>
+ By default, the Oprofile JIT support libraries will be installed in
+ <filename>&lt;oprof_install_dir&gt;/lib/oprofile</filename>. To build
+ and install OProfile and the JIT support libraries as 64-bit, you can
+ do something like the following:
+ <screen>
+ # CFLAGS="-m64" CXXFLAGS="-m64" ./configure \
+ --with-kernel-support --with-java={my_jdk_installdir} \
+ --libdir=/usr/local/lib64
+ </screen>
+ </para>
+ <note>
+ <para>
+ If you encounter errors building 64-bit, you should
+ install libtool 1.5.26 or later since that release of
+ libtool fixes known problems for certain platforms.
+ If you install libtool into a non-standard location,
+ you'll need to edit the invocation of 'aclocal' in
+ OProfile's autogen.sh as follows (assume an install
+ location of /usr/local):
+ </para>
+ <para>
+ <code>aclocal -I m4 -I /usr/local/share/aclocal</code>
+ </para>
+ </note>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--with-kernel-support</option></term>
+ <listitem><para>
+ Use this option with 2.6 and above kernels to indicate the
+ kernel provides the OProfile device driver.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--with-qt-dir/includes/libraries</option></term>
+ <listitem><para>
+ Specify the location of Qt headers and libraries. It defaults to searching in
+ <constant>$QTDIR</constant> if these are not specified.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry id="disable-werror">
+ <term><option>--disable-werror</option></term>
+ <listitem><para>
+ Development versions of OProfile build by
+ default with <option>-Werror</option>. This option turns
+ <option>-Werror</option> off.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry id="disable-optimization">
+ <term><option>--disable-optimization</option></term>
+ <listitem><para>
+ Disable the <option>-O2</option> compiler flag
+ (useful if you discover an OProfile bug and want to give a useful
+ back-trace etc.)
+ </para></listitem>
+ </varlistentry>
+</variablelist>
+<para>
+You'll need to have a configured kernel source for the current kernel
+to build the module for 2.4 kernels. Since all distributions provide different kernels it's unlikely the running kernel match the configured source
+you installed. The safest way is to recompile your own kernel, run it and compile oprofile. It is also recommended that if you have a
+uniprocessor machine, you enable the local APIC / IO_APIC support for
+your kernel (this is automatically enabled for SMP kernels). With many BIOS, kernel &gt;= 2.6.9 and UP kernel it's not sufficient to enable the local APIC you must also turn it on explicitly at boot time by providing "lapic" option to the kernel. On
+machines with power management, such as laptops, the power management
+must be turned off when using OProfile with 2.4 kernels. The power management software
+in the BIOS cannot handle the non-maskable interrupts (NMIs) used by
+OProfile for data collection. If you use the NMI watchdog, be aware that
+the watchdog is disabled when profiling starts, and not re-enabled until the
+OProfile module is removed (or, in 2.6, when OProfile is not running). If you compile OProfile for
+a 2.2 kernel you must be root to compile the module. If you are using
+2.6 kernels or higher, you do not need kernel source, as long as the
+OProfile driver is enabled; additionally, you should not need to disable
+power management.
+</para>
+<para>
+Please note that you must save or have available the <filename>vmlinux</filename> file
+generated during a kernel compile, as OProfile needs it (you can use
+<option>--no-vmlinux</option>, but this will prevent kernel profiling).
+</para>
+
+</sect1>
+
+<sect1 id="uninstall">
+<title>Uninstalling OProfile</title>
+<para>
+You must have the source tree available to uninstall OProfile; a <command>make uninstall</command> will
+remove all installed files except your configuration file in the directory <filename>~/.oprofile</filename>.
+</para>
+</sect1>
+
+</chapter>
+
+<chapter id="overview">
+<title>Overview</title>
+
+<sect1 id="getting-started">
+<title>Getting started</title>
+<para>
+Before you can use OProfile, you must set it up. The minimum setup required for this
+is to tell OProfile where the <filename>vmlinux</filename> file corresponding to the
+running kernel is, for example :
+</para>
+<screen>opcontrol --vmlinux=/boot/vmlinux-`uname -r`</screen>
+<para>
+If you don't want to profile the kernel itself,
+you can tell OProfile you don't have a <filename>vmlinux</filename> file :
+</para>
+<screen>opcontrol --no-vmlinux</screen>
+<para>
+Now we are ready to start the daemon (<command>oprofiled</command>) which collects
+the profile data :
+</para>
+<screen>opcontrol --start</screen>
+<para>
+When I want to stop profiling, I can do so with :
+</para>
+<screen>opcontrol --shutdown</screen>
+<para>
+Note that unlike <command>gprof</command>, no instrumentation (<option>-pg</option>
+and <option>-a</option> options to <command>gcc</command>)
+is necessary.
+</para>
+<para>
+Periodically (or on <command>opcontrol --shutdown</command> or <command>opcontrol --dump</command>)
+the profile data is written out into the $SESSION_DIR/samples directory (by default at <filename>/var/lib/oprofile/samples</filename>).
+These profile files cover shared libraries, applications, the kernel (vmlinux), and kernel modules.
+You can clear the profile data (at any time) with <command>opcontrol --reset</command>.
+</para>
+<para>
+To place these sample database files in a specific directory instead of the default location (<filename>/var/lib/oprofile</filename>) use the <option>--session-dir=dir</option> option. You must also specify the <option>--session-dir</option> to tell the tools to continue using this directory. (In the future, we should allow this to be specified in an environment variable.) :
+</para>
+<screen>opcontrol --no-vmlinux --session-dir=/home/me/tmpsession</screen>
+<screen>opcontrol --start --session-dir=/home/me/tmpsession</screen>
+<para>
+You can get summaries of this data in a number of ways at any time. To get a summary of
+data across the entire system for all of these profiles, you can do :
+</para>
+<screen>opreport [--session-dir=dir]</screen>
+<para>
+Or to get a more detailed summary, for a particular image, you can do something like :
+</para>
+<screen>opreport -l /boot/vmlinux-`uname -r`</screen>
+<para>
+There are also a number of other ways of presenting the data, as described later in this manual.
+Note that OProfile will choose a default profiling setup for you. However, there are a number
+of options you can pass to <command>opcontrol</command> if you need to change something,
+also detailed later.
+</para>
+
+</sect1>
+
+<sect1 id="tools-overview">
+<title>Tools summary</title>
+<para>
+This section gives a brief description of the available OProfile utilities and their purpose.
+</para>
+<variablelist>
+<varlistentry>
+ <term><filename>ophelp</filename></term>
+ <listitem><para>
+ This utility lists the available events and short descriptions.
+ </para></listitem>
+</varlistentry>
+
+<varlistentry>
+ <term><filename>opcontrol</filename></term>
+ <listitem><para>
+ Used for controlling the OProfile data collection, discussed in <xref linkend="controlling" />.
+ </para></listitem>
+</varlistentry>
+
+<varlistentry>
+ <term><filename>agent libraries</filename></term>
+ <listitem><para>
+ Used by virtual machines (like the Java VM) to record information about JITed code being profiled. See <xref linkend="setup-jit" />.
+ </para></listitem>
+</varlistentry>
+
+<varlistentry>
+ <term><filename>opreport</filename></term>
+ <listitem><para>
+ This is the main tool for retrieving useful profile data, described in
+ <xref linkend="opreport" />.
+ </para></listitem>
+</varlistentry>
+
+<varlistentry>
+ <term><filename>opannotate</filename></term>
+ <listitem><para>
+ This utility can be used to produce annotated source, assembly or mixed source/assembly.
+ Source level annotation is available only if the application was compiled with
+ debugging symbols. See <xref linkend="opannotate" />.
+ </para></listitem>
+</varlistentry>
+
+<varlistentry>
+ <term><filename>opgprof</filename></term>
+ <listitem><para>
+ This utility can output gprof-style data files for a binary, for use with
+ <command>gprof -p</command>. See <xref linkend="opgprof" />.
+ </para></listitem>
+</varlistentry>
+
+<varlistentry>
+ <term><filename>oparchive</filename></term>
+ <listitem><para>
+ This utility can be used to collect executables, debuginfo,
+ and sample files and copy the files into an archive.
+ The archive is self-contained and can be moved to another
+ machine for further analysis.
+ See <xref linkend="oparchive" />.
+ </para></listitem>
+</varlistentry>
+
+<varlistentry>
+ <term><filename>opimport</filename></term>
+ <listitem><para>
+ This utility converts sample database files from a foreign binary format (abi) to
+ the native format. This is useful only when moving sample files between hosts,
+ for analysis on platforms other than the one used for collection.
+ See <xref linkend="opimport" />.
+ </para></listitem>
+</varlistentry>
+
+</variablelist>
+</sect1>
+
+</chapter>
+
+<chapter id="controlling">
+<title>Controlling the profiler</title>
+
+<sect1 id="controlling-daemon">
+<title>Using <command>opcontrol</command></title>
+<para>
+In this section we describe the configuration and control of the profiling system
+with opcontrol in more depth.
+The <command>opcontrol</command> script has a default setup, but you
+can alter this with the options given below. In particular,
+if your hardware supports performance counters, you can configure them.
+There are a number of counters (for example, counter 0 and counter 1
+on the Pentium III). Each of these counters can be programmed with
+an event to count, such as cache misses or MMX operations. The event
+chosen for each counter is reflected in the profile data collected
+by OProfile: functions and binaries at the top of the profiles reflect
+that most of the chosen events happened within that code.
+</para>
+<para>
+Additionally, each counter has a "count" value: this corresponds to how
+detailed the profile is. The lower the value, the more frequently profile
+samples are taken. A counter can choose to sample only kernel code, user-space code,
+or both (both is the default). Finally, some events have a "unit mask"
+- this is a value that further restricts the types of event that are counted.
+The event types and unit masks for your CPU are listed by <command>opcontrol
+--list-events</command>.
+</para>
+<para>
+The <command>opcontrol</command> script provides the following actions :
+</para>
+<variablelist>
+ <varlistentry>
+ <term><option>--init</option></term>
+ <listitem><para>
+ Loads the OProfile module if required and makes the OProfile driver
+ interface available.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--setup</option></term>
+ <listitem><para>
+ Followed by list arguments for profiling set up. List of arguments
+ saved in <filename>/root/.oprofile/daemonrc</filename>.
+ Giving this option is not necessary; you can just directly pass one
+ of the setup options, e.g. <command>opcontrol --no-vmlinux</command>.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--status</option></term>
+ <listitem><para>
+ Show configuration information.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--start-daemon</option></term>
+ <listitem><para>
+ Start the oprofile daemon without starting actual profiling. The profiling
+ can then be started using <option>--start</option>. This is useful for avoiding
+ measuring the cost of daemon startup, as <option>--start</option> is a simple
+ write to a file in oprofilefs. Not available in 2.2/2.4 kernels.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--start</option></term>
+ <listitem><para>
+ Start data collection with either arguments provided by <option>--setup</option>
+ or information saved in <filename>/root/.oprofile/daemonrc</filename>. Specifying
+ the addition <option>--verbose</option> makes the daemon generate lots of debug data
+ whilst it is running.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--dump</option></term>
+ <listitem><para>
+ Force a flush of the collected profiling data to the daemon.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--stop</option></term>
+ <listitem><para>
+ Stop data collection (this separate step is not possible with 2.2 or 2.4 kernels).
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--shutdown</option></term>
+ <listitem><para>
+ Stop data collection and kill the daemon.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--reset</option></term>
+ <listitem><para>
+ Clears out data from current session, but leaves saved sessions.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--save=</option>session_name</term>
+ <listitem><para>
+ Save data from current session to session_name.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--deinit</option></term>
+ <listitem><para>
+ Shuts down daemon. Unload the OProfile module and oprofilefs.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--list-events</option></term>
+ <listitem><para>
+ List event types and unit masks.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--help</option></term>
+ <listitem><para>
+ Generate usage messages.
+ </para></listitem>
+ </varlistentry>
+</variablelist>
+
+<para>
+There are a number of possible settings, of which, only
+<option>--vmlinux</option> (or <option>--no-vmlinux</option>)
+is required. These settings are stored in <filename>~/.oprofile/daemonrc</filename>.
+</para>
+<variablelist>
+ <varlistentry>
+ <term><option>--buffer-size=</option>num</term>
+ <listitem><para>
+ Number of samples in kernel buffer. When using a 2.6 kernel
+ buffer watershed need to be tweaked when changing this value.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--buffer-watershed=</option>num</term>
+ <listitem><para>
+ Set kernel buffer watershed to num samples (2.6 only). When it'll remain only
+ buffer-size - buffer-watershed free entry in the kernel buffer data will be
+ flushed to daemon, most usefull value are in the range [0.25 - 0.5] * buffer-size.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--cpu-buffer-size=</option>num</term>
+ <listitem><para>
+ Number of samples in kernel per-cpu buffer (2.6 only). If you
+ profile at high rate it can help to increase this if the log
+ file show excessive count of sample lost cpu buffer overflow.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--event=</option>[eventspec]</term>
+ <listitem><para>
+ Use the given performance counter event to profile.
+ See <xref linkend="eventspec" /> below.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--session-dir=</option>dir_path</term>
+ <listitem><para>
+ Create/use sample database out of directory <filename>dir_path</filename> instead of
+ the default location (/var/lib/oprofile).
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--separate=</option>[none,lib,kernel,thread,cpu,all]</term>
+ <listitem><para>
+ By default, every profile is stored in a single file. Thus, for example,
+ samples in the C library are all accredited to the <filename>/lib/libc.o</filename>
+ profile. However, you choose to create separate sample files by specifying
+ one of the below options.
+ </para>
+ <informaltable frame="all">
+ <tgroup cols='2'>
+ <tbody>
+ <row><entry><option>none</option></entry><entry>No profile separation (default)</entry></row>
+ <row><entry><option>lib</option></entry><entry>Create per-application profiles for libraries</entry></row>
+ <row><entry><option>kernel</option></entry><entry>Create per-application profiles for the kernel and kernel modules</entry></row>
+ <row><entry><option>thread</option></entry><entry>Create profiles for each thread and each task</entry></row>
+ <row><entry><option>cpu</option></entry><entry>Create profiles for each CPU</entry></row>
+ <row><entry><option>all</option></entry><entry>All of the above options</entry></row>
+ </tbody>
+ </tgroup>
+ </informaltable>
+ <para>
+ Note that <option>--separate=kernel</option> also turns on <option>--separate=lib</option>.
+ <!-- FIXME: update if this change -->
+ When using <option>--separate=kernel</option>, samples in hardware interrupts, soft-irqs, or other
+ asynchronous kernel contexts are credited to the task currently running. This means you will see
+ seemingly nonsense profiles such as <filename>/bin/bash</filename> showing samples for the PPP modules,
+ etc.
+ </para>
+ <para>
+ On 2.2/2.4 only kernel threads already started when profiling begins are correctly profiled;
+ newly started kernel thread samples are credited to the vmlinux (kernel) profile.
+ </para>
+ <para>
+ Using <option>--separate=thread</option> creates a lot
+ of sample files if you leave OProfile running for a while; it's most
+ useful when used for short sessions, or when using image filtering.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--callgraph=</option>#depth</term>
+ <listitem><para>
+ Enable call-graph sample collection with a maximum depth. Use 0 to disable
+ callgraph profiling. NOTE: Callgraph support is available on a limited
+ number of platforms at this time; for example:
+ <para>
+ <itemizedlist>
+ <listitem><para>x86 with recent 2.6 kernel</para></listitem>
+ <listitem><para>ARM with recent 2.6 kernel</para></listitem>
+ <listitem><para>PowerPC with 2.6.17 kernel</para></listitem>
+ </itemizedlist>
+ </para>
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--image=</option>image,[images]|"all"</term>
+ <listitem><para>
+ Image filtering. If you specify one or more absolute
+ paths to binaries, OProfile will only produce profile results for those
+ binary images. This is useful for restricting the sometimes voluminous
+ output you may get otherwise, especially with
+ <option>--separate=thread</option>. Note that if you are using
+ <option>--separate=lib</option> or
+ <option>--separate=kernel</option>, then if you specification an
+ application binary, the shared libraries and kernel code
+ <emphasis>are</emphasis> included. Specify the value
+ "all" to profile everything (the default).
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--vmlinux=</option>file</term>
+ <listitem><para>
+ vmlinux kernel image.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>--no-vmlinux</option></term>
+ <listitem><para>
+ Use this when you don't have a kernel vmlinux file, and you don't want
+ to profile the kernel. This still counts the total number of kernel samples,
+ but can't give symbol-based results for the kernel or any modules.
+ </para></listitem>
+ </varlistentry>
+</variablelist>
+
+<sect2 id="opcontrolexamples">
+<title>Examples</title>
+
+<sect3 id="examplesperfctr">
+<title>Intel performance counter setup</title>
+<para>
+Here, we have a Pentium III running at 800MHz, and we want to look at where data memory
+references are happening most, and also get results for CPU time.
+</para>
+<screen>
+# opcontrol --event=CPU_CLK_UNHALTED:400000 --event=DATA_MEM_REFS:10000
+# opcontrol --vmlinux=/boot/2.6.0/vmlinux
+# opcontrol --start
+</screen>
+</sect3>
+
+<sect3 id="examplesrtc">
+<title>RTC mode</title>
+<para>
+Here, we have an Intel laptop without support for performance counters, running on 2.4 kernels.
+</para>
+<screen>
+# ophelp -r
+CPU with RTC device
+# opcontrol --vmlinux=/boot/2.4.13/vmlinux --event=RTC_INTERRUPTS:1024
+# opcontrol --start
+</screen>
+</sect3>
+
+<sect3 id="examplesstartdaemon">
+<title>Starting the daemon separately</title>
+<para>
+If we're running 2.6 kernels, we can use <option>--start-daemon</option> to avoid
+the profiler startup affecting results.
+</para>
+<screen>
+# opcontrol --vmlinux=/boot/2.6.0/vmlinux
+# opcontrol --start-daemon
+# my_favourite_benchmark --init
+# opcontrol --start ; my_favourite_benchmark --run ; opcontrol --stop
+</screen>
+</sect3>
+
+<sect3 id="exampleseparate">
+<title>Separate profiles for libraries and the kernel</title>
+<para>
+Here, we want to see a profile of the OProfile daemon itself, including when
+it was running inside the kernel driver, and its use of shared libraries.
+</para>
+<screen>
+# opcontrol --separate=kernel --vmlinux=/boot/2.6.0/vmlinux
+# opcontrol --start
+# my_favourite_stress_test --run
+# opreport -l -p /lib/modules/2.6.0/kernel /usr/local/bin/oprofiled
+</screen>
+</sect3>
+
+<sect3 id="examplessessions">
+<title>Profiling sessions</title>
+<para>
+It can often be useful to split up profiling data into several different
+time periods. For example, you may want to collect data on an application's
+startup separately from the normal runtime data. You can use the simple
+command <command>opcontrol --save</command> to do this. For example :
+</para>
+<screen>
+# opcontrol --save=blah
+</screen>
+<para>
+will create a sub-directory in <filename>$SESSION_DIR/samples</filename> containing the samples
+up to that point (the current session's sample files are moved into this
+directory). You can then pass this session name as a parameter to the post-profiling
+analysis tools, to only get data up to the point you named the
+session. If you do not want to save a session, you can do
+<command>rm -rf $SESSION_DIR/samples/sessionname</command> or, for the
+current session, <command>opcontrol --reset</command>.
+</para>
+</sect3>
+</sect2>
+
+<sect2 id="eventspec">
+<title>Specifying performance counter events</title>
+<para>
+The <option>--event</option> option to <command>opcontrol</command>
+takes a specification that indicates how the details of each
+hardware performance counter should be setup. If you want to
+revert to OProfile's default setting (<option>--event</option>
+is strictly optional), use <option>--event=default</option>. Use of this
+option over-rides all previous event selections.
+</para>
+<para>
+You can pass multiple event specifications. OProfile will allocate
+hardware counters as necessary. Note that some combinations are not
+allowed by the CPU; running <command>opcontrol --list-events</command> gives the details
+of each event. The event specification is a colon-separated string
+of the form <option><emphasis>name</emphasis>:<emphasis>count</emphasis>:<emphasis>unitmask</emphasis>:<emphasis>kernel</emphasis>:<emphasis>user</emphasis></option> as described in this table:
+</para>
+<informaltable frame="all">
+<tgroup cols='2'>
+<tbody>
+<row><entry><option>name</option></entry><entry>The symbolic event name, e.g. <constant>CPU_CLK_UNHALTED</constant></entry></row>
+<row><entry><option>count</option></entry><entry>The counter reset value, e.g. 100000</entry></row>
+<row><entry><option>unitmask</option></entry><entry>The unit mask, as given in the events list, e.g. 0x0f</entry></row>
+<row><entry><option>kernel</option></entry><entry>Whether to profile kernel code</entry></row>
+<row><entry><option>user</option></entry><entry>Whether to profile userspace code</entry></row>
+</tbody>
+</tgroup>
+</informaltable>
+<para>
+The last three values are optional, if you omit them (e.g. <option>--event=DATA_MEM_REFS:30000</option>),
+they will be set to the default values (a unit mask of 0, and profiling both kernel and
+userspace code). Note that some events require a unit mask.
+</para>
+<note><para>
+For the PowerPC platforms, all events specified must be in the same group; i.e., the group number
+appended to the event name (e.g. <constant>&lt;<emphasis>some-event-name</emphasis>&gt;_GRP9</constant>) must be the same.
+</para></note>
+<para>
+If OProfile is using RTC mode, and you want to alter the default counter value,
+you can use something like <option>--event=RTC_INTERRUPTS:2048</option>. Note the last
+three values here are ignored.
+If OProfile is using timer-interrupt mode, there is no configuration possible.
+</para>
+<para>
+The table below lists the events selected by default
+(<option>--event=default</option>) for the various computer architectures:
+</para>
+<informaltable frame="all">
+<tgroup cols='3'>
+<tbody>
+<row><entry>Processor</entry><entry>cpu_type</entry><entry>Default event</entry></row>
+<row><entry>Alpha EV4</entry><entry>alpha/ev4</entry><entry>CYCLES:100000:0:1:1</entry></row>
+<row><entry>Alpha EV5</entry><entry>alpha/ev5</entry><entry>CYCLES:100000:0:1:1</entry></row>
+<row><entry>Alpha PCA56</entry><entry>alpha/pca56</entry><entry>CYCLES:100000:0:1:1</entry></row>
+<row><entry>Alpha EV6</entry><entry>alpha/ev6</entry><entry>CYCLES:100000:0:1:1</entry></row>
+<row><entry>Alpha EV67</entry><entry>alpha/ev67</entry><entry>CYCLES:100000:0:1:1</entry></row>
+<row><entry>ARM/XScale PMU1</entry><entry>arm/xscale1</entry><entry>CPU_CYCLES:100000:0:1:1</entry></row>
+<row><entry>ARM/XScale PMU2</entry><entry>arm/xscale2</entry><entry>CPU_CYCLES:100000:0:1:1</entry></row>
+<row><entry>ARM/MPCore</entry><entry>arm/mpcore</entry><entry>CPU_CYCLES:100000:0:1:1</entry></row>
+<row><entry>AVR32</entry><entry>avr32</entry><entry>CPU_CYCLES:100000:0:1:1</entry></row>
+<row><entry>Athlon</entry><entry>i386/athlon</entry><entry>CPU_CLK_UNHALTED:100000:0:1:1</entry></row>
+<row><entry>Pentium Pro</entry><entry>i386/ppro</entry><entry>CPU_CLK_UNHALTED:100000:0:1:1</entry></row>
+<row><entry>Pentium II</entry><entry>i386/pii</entry><entry>CPU_CLK_UNHALTED:100000:0:1:1</entry></row>
+<row><entry>Pentium III</entry><entry>i386/piii</entry><entry>CPU_CLK_UNHALTED:100000:0:1:1</entry></row>
+<row><entry>Pentium M (P6 core)</entry><entry>i386/p6_mobile</entry><entry>CPU_CLK_UNHALTED:100000:0:1:1</entry></row>
+<row><entry>Pentium 4 (non-HT)</entry><entry>i386/p4</entry><entry>GLOBAL_POWER_EVENTS:100000:1:1:1</entry></row>
+<row><entry>Pentium 4 (HT)</entry><entry>i386/p4-ht</entry><entry>GLOBAL_POWER_EVENTS:100000:1:1:1</entry></row>
+<row><entry>Hammer</entry><entry>x86-64/hammer</entry><entry>CPU_CLK_UNHALTED:100000:0:1:1</entry></row>
+<row><entry>Family10h</entry><entry>x86-64/family10</entry><entry>CPU_CLK_UNHALTED:100000:0:1:1</entry></row>
+<row><entry>Family11h</entry><entry>x86-64/family11h</entry><entry>CPU_CLK_UNHALTED:100000:0:1:1</entry></row>
+<row><entry>Itanium</entry><entry>ia64/itanium</entry><entry>CPU_CYCLES:100000:0:1:1</entry></row>
+<row><entry>Itanium 2</entry><entry>ia64/itanium2</entry><entry>CPU_CYCLES:100000:0:1:1</entry></row>
+<row><entry>TIMER_INT</entry><entry>timer</entry><entry>None selectable</entry></row>
+<row><entry>IBM iseries</entry><entry>PowerPC 4/5/970</entry><entry>CYCLES:10000:0:1:1</entry></row>
+<row><entry>IBM pseries</entry><entry>PowerPC 4/5/970/Cell</entry><entry>CYCLES:10000:0:1:1</entry></row>
+<row><entry>IBM s390</entry><entry>timer</entry><entry>None selectable</entry></row>
+<row><entry>IBM s390x</entry><entry>timer</entry><entry>None selectable</entry></row>
+</tbody>
+</tgroup>
+</informaltable>
+
+</sect2>
+
+</sect1>
+
+<sect1 id="setup-jit">
+ <title>Setting up the JIT profiling feature</title>
+ <para>
+ To gather information about JITed code from a virtual machine,
+ it needs to be instrumented with an agent library. We use the
+ agent libraries for Java in the following example. To use the
+ Java profiling feature, you must build OProfile with the "--with-java" option
+ (<xref linkend="install" />).
+
+ </para>
+
+ <sect2 id="setup-jit-jvm">
+ <title>JVM instrumentation</title>
+ <para>
+ Add this to the startup parameters of the JVM (for JVMTI):
+
+ <screen><option>-agentpath:&lt;libdir&gt;/libjvmti_oprofile.so[=&lt;options&gt;]</option> </screen>
+ or
+ <screen><option>-agentlib:jvmti_oprofile[=&lt;options&gt;]</option> </screen>
+ </para>
+ <para>
+ The JVMPI agent implementation is enabled with the command line option
+ <screen><option>-Xrunjvmpi_oprofile[:&lt;options&gt;]</option> </screen>
+ </para>
+ <para>
+ Currently, there is just one option available -- <option>debug</option>. For JVMPI,
+ the convention for specifying an option is <option>option_name=[yes|no]</option>.
+ For JVMTI, the option specification is simply the option name, implying
+ "yes"; no option specified implies "no".
+ </para>
+ <para>
+ The agent library (installed in <filename>&lt;oprof_install_dir&gt;/lib/oprofile</filename>)
+ needs to be in the library search path (e.g. add the library directory
+ to <constant>LD_LIBRARY_PATH</constant>). If the command line of
+ the JVM is not accessible, it may be buried within shell scripts or a
+ launcher program. It may also be possible to set an environment variable to add
+ the instrumentation.
+ For Sun JVMs this is <constant>JAVA_TOOL_OPTIONS</constant>. Please check
+ your JVM documentation for
+ further information on the agent startup options.
+ </para>
+
+ </sect2>
+</sect1>
+
+<sect1 id="oprofile-gui">
+<title>Using <command>oprof_start</command></title>
+<para>
+The <command>oprof_start</command> application provides a convenient way to start the profiler.
+Note that <command>oprof_start</command> is just a wrapper around the <command>opcontrol</command> script,
+so it does not provide more services than the script itself.
+</para>
+<para>
+After <command>oprof_start</command> is started you can select the event type for each counter;
+the sampling rate and other related parameters are explained in <xref linkend="controlling-daemon" />.
+The "Configuration" section allows you to set general parameters such as the buffer size, kernel filename
+etc. The counter setup interface should be self-explanatory; <xref linkend="hardware-counters" /> and related
+links contain information on using unit masks.
+</para>
+<para>
+A status line shows the current status of the profiler: how long it has been running, and the average
+number of interrupts received per second and the total, over all processors.
+Note that quitting <command>oprof_start</command> does not stop the profiler.
+</para>
+<para>
+Your configuration is saved in the same file as <command>opcontrol</command> uses; that is,
+<filename>~/.oprofile/daemonrc</filename>.
+</para>
+
+</sect1>
+
+<sect1 id="detailed-parameters">
+<title>Configuration details</title>
+
+<sect2 id="hardware-counters">
+<title>Hardware performance counters</title>
+<note>
+<para>
+Your CPU type may not include the requisite support for hardware performance counters, in which case
+you must use OProfile in RTC mode in 2.4 (see <xref linkend="rtc" />), or timer mode in 2.6 (see <xref linkend="timer" />).
+You do not really need to read this section unless you are interested in using
+events other than the default event chosen by OProfile.
+</para>
+</note>
+<para>
+The Intel hardware performance counters are detailed in the Intel IA-32 Architecture Manual, Volume 3, available
+from <ulink url="http://developer.intel.com/">http://developer.intel.com/</ulink>.
+The AMD Athlon/Opteron/Phenom/Turion implementation is detailed in <ulink
+url="http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/22007.pdf">
+http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/22007.pdf</ulink>.
+For PowerPC64 processors in IBM iSeries, pSeries, and blade server systems, processor documentation
+is available at <ulink url="http://www-01.ibm.com/chips/techlib/techlib.nsf/productfamilies/PowerPC/">
+http://www-01.ibm.com/chips/techlib/techlib.nsf/productfamilies/PowerPC</ulink>. (For example, the
+specific publication containing information on the performance monitor unit for the PowerPC970 is
+"IBM PowerPC 970FX RISC Microprocessor User's Manual.")
+These processors are capable of delivering an interrupt when a counter overflows.
+This is the basic mechanism on which OProfile is based. The delivery mode is <acronym>NMI</acronym>,
+so blocking interrupts in the kernel does not prevent profiling. When the interrupt handler is called,
+the current <acronym>PC</acronym> value and the current task are recorded into the profiling structure.
+This allows the overflow event to be attached to a specific assembly instruction in a binary image.
+The daemon receives this data from the kernel, and writes it to the sample files.
+</para>
+<para>
+If we use an event such as <constant>CPU_CLK_UNHALTED</constant> or <constant>INST_RETIRED</constant>
+(<constant>GLOBAL_POWER_EVENTS</constant> or <constant>INSTR_RETIRED</constant>, respectively, on the Pentium 4), we can
+use the overflow counts as an estimate of actual time spent in each part of code. Alternatively we can profile interesting
+data such as the cache behaviour of routines with the other available counters.
+</para>
+<para>
+However there are several caveats. First, there are those issues listed in the Intel manual. There is a delay
+between the counter overflow and the interrupt delivery that can skew results on a small scale - this means
+you cannot rely on the profiles at the instruction level as being perfectly accurate.
+If you are using an "event-mode" counter such as the cache counters, a count registered against it doesn't mean
+that it is responsible for that event. However, it implies that the counter overflowed in the dynamic
+vicinity of that instruction, to within a few instructions. Further details on this problem can be found in
+<xref linkend="interpreting" /> and also in the Digital paper "ProfileMe: A Hardware Performance Counter".
+</para>
+<para>
+Each counter has several configuration parameters.
+First, there is the unit mask: this simply further specifies what to count.
+Second, there is the counter value, discussed below. Third, there is a parameter whether to increment counts
+whilst in kernel or user space. You can configure these separately for each counter.
+</para>
+<para>
+After each overflow event, the counter will be re-initialized
+such that another overflow will occur after this many events have been counted. Thus, higher
+values mean less-detailed profiling, and lower values mean more detail, but higher overhead.
+Picking a good value for this
+parameter is, unfortunately, somewhat of a black art. It is of course dependent on the event
+you have chosen.
+Specifying too large a value will mean not enough interrupts are generated
+to give a realistic profile (though this problem can be ameliorated by profiling for <emphasis>longer</emphasis>).
+Specifying too small a value can lead to higher performance overhead.
+</para>
+
+</sect2>
+
+<sect2 id="rtc">
+<title>OProfile in RTC mode</title>
+<note><para>
+This section applies to 2.2/2.4 kernels only.
+</para></note>
+<para>
+Some CPU types do not provide the needed hardware support to use the hardware performance counters. This includes
+some laptops, classic Pentiums, and other CPU types not yet supported by OProfile (such as Cyrix).
+On these machines, OProfile falls
+back to using the real-time clock interrupt to collect samples. This interrupt is also used by the <command>rtc</command>
+module: you cannot have both the OProfile and rtc modules loaded nor the rtc support compiled in the kernel.
+</para>
+<para>
+RTC mode is less capable than the hardware counters mode; in particular, it is unable to profile sections of
+the kernel where interrupts are disabled. There is just one available event, "RTC interrupts", and its value
+corresponds to the number of interrupts generated per second (that is, a higher number means a better profiling
+resolution, and higher overhead). The current implementation of the real-time clock supports only power-of-two
+sampling rates from 2 to 4096 per second. Other values within this range are rounded to the nearest power of
+two.
+</para>
+<para>
+You can force use of the RTC interrupt with the <option>force_rtc=1</option> module parameter.
+</para>
+<para>
+Setting the value from the GUI should be straightforward. On the command line, you need to specify the
+event to <command>opcontrol</command>, e.g. :
+</para>
+<para><command>opcontrol --event=RTC_INTERRUPTS:256</command></para>
+</sect2>
+
+<sect2 id="timer">
+<title>OProfile in timer interrupt mode</title>
+<note><para>
+This section applies to 2.6 kernels and above only.
+</para></note>
+<para>
+In 2.6 kernels on CPUs without OProfile support for the hardware performance counters, the driver
+falls back to using the timer interrupt for profiling. Like the RTC mode in 2.4 kernels, this is not able to
+profile code that has interrupts disabled. Note that there are no configuration parameters for
+setting this, unlike the RTC and hardware performance counter setup.
+</para>
+<para>
+You can force use of the timer interrupt by using the <option>timer=1</option> module
+parameter (or <option>oprofile.timer=1</option> on the boot command line if OProfile is
+built-in).
+</para>
+</sect2>
+
+<sect2 id="p4">
+<title>Pentium 4 support</title>
+<para>
+The Pentium 4 / Xeon performance counters are organized around 3 types of model specific registers (MSRs): 45 event
+selection control registers (ESCRs), 18 counter configuration control registers (CCCRs) and 18 counters. ESCRs describe a
+particular set of events which are to be recorded, and CCCRs bind ESCRs to counters and configure their
+operation. Unfortunately the relationship between these registers is quite complex; they cannot all be used with one
+another at any time. There is, however, a subset of 8 counters, 8 ESCRs, and 8 CCCRs which can be used independently of
+one another, so OProfile only accesses those registers, treating them as a bank of 8 "normal" counters, similar
+to those in the P6 or Athlon/Opteron/Phenom/Turion families of CPU.
+</para>
+<para>
+There is currently no support for Precision Event-Based Sampling (PEBS), nor any advanced uses of the Debug Store
+(DS). Current support is limited to the conservative extension of OProfile's existing interrupt-based model described
+above. Performance monitoring hardware on Pentium 4 / Xeon processors with Hyperthreading enabled (multiple logical
+processors on a single die) is not supported in 2.4 kernels (you can use OProfile if you disable hyper-threading,
+though).
+</para>
+</sect2>
+
+<sect2 id="ia64">
+<title>Intel Itanium 2 support</title>
+<para>
+The Itanium 2 performance monitoring unit (PMU) organizes the counters as four
+pairs of performance event monitoring registers. Each pair is composed of a
+Performance Monitoring Configuration (PMC) register and Performance Monitoring
+Data (PMD) register. The PMC selects the performance event being monitored and
+the PMD determines the sampling interval. The IA64 Performance Monitoring Unit
+(PMU) triggers sampling with maskable interrupts. Thus, samples will not occur
+in sections of the IA64 kernel where interrupts are disabled.
+</para>
+<para>
+None of the advance features of the Itanium 2 performance monitoring unit
+such as opcode matching, address range matching, or precise event sampling are
+supported by this version of OProfile. The Itanium 2 support only maps OProfile's
+existing interrupt-based model to the PMU hardware.
+</para>
+</sect2>
+
+<sect2 id="ppc64">
+<title>PowerPC64 support</title>
+<para>
+The performance monitoring unit (PMU) for the IBM PowerPC 64-bit processors
+consists of between 4 and 8 counters (depending on the model), plus three
+special purpose registers used for programming the counters -- MMCR0, MMCR1,
+and MMCRA. Advanced features such as instruction matching and thresholding are
+not supported by this version of OProfile.
+<note>Later versions of the IBM POWER5+ processor (beginning with revision 3.0)
+run the performance monitor unit in POWER6 mode, effectively removing OProfile's
+access to counters 5 and 6. These two counters are dedicated to counting
+instructions completed and cycles, respectively. In POWER6 mode, however, the
+counters do not generate an interrupt on overflow and so are unusable by
+OProfile. Kernel versions 2.6.23 and higher will recognize this mode
+and export "ppc64/power5++" as the cpu_type to the oprofilefs pseudo filesystem.
+OProfile userspace responds to this cpu_type by removing these counters from
+the list of potential events to count. Without this kernel support, attempts
+to profile using an event from one of these counters will yield incorrect
+results -- typically, zero (or near zero) samples in the generated report.
+</note>
+</para>
+
+</sect2>
+
+<sect2 id="cell-be">
+<title>Cell Broadband Engine support</title>
+<para>
+The Cell Broadband Engine (CBE) processor core consists of a PowerPC Processing
+Element (PPE) and 8 Synergistic Processing Elements (SPE). PPEs and SPEs each
+consist of a processing unit (PPU and SPU, respectively) and other hardware
+components, such as memory controllers.
+</para>
+<para>
+A PPU has two hardware threads (aka "virtual CPUs"). The performance monitor
+unit of the CBE collects event information on one hardware thread at a time.
+Therefore, when profiling PPE events,
+OProfile collects the profile based on the selected events by time slicing the
+performance counter hardware between the two threads. The user must ensure the
+collection interval is long enough so that the time spent collecting data for
+each PPU is sufficient to obtain a good profile.
+</para>
+<para>
+To profile an SPU application, the user should specify the SPU_CYCLES event.
+When starting OProfile with SPU_CYCLES, the opcontrol script enforces certain
+separation parameters (separate=cpu,lib) to ensure that sufficient information
+is collected in the sample data in order to generate a complete report. The
+--merge=cpu option can be used to obtain a more readable report if analyzing
+the performance of each separate SPU is not necessary.
+</para>
+<para>
+Profiling with an SPU event (events 4100 through 4163) is not compatible with any other
+event. Further more, only one SPU event can be specified at a time. The hardware only
+supports profiling on one SPU per node at a time. The OProfile kernel code time slices
+between the eight SPUs to collect data on all SPUs.
+</para>
+<para>
+SPU profile reports have some unique characteristics compared to reports for
+standard architectures:
+</para>
+<itemizedlist>
+<listitem>Typically no "app name" column. This is really standard OProfile behavior
+when the report contains samples for just a single application, which is
+commonly the case when profiling SPUs.</listitem>
+<listitem>"CPU" equates to "SPU"</listitem>
+<listitem>Specifying '--long-filenames' on the opreport command does not always result
+in long filenames. This happens when the SPU application code is embedded in
+the PPE executable or shared library. The embedded SPU ELF data contains only the
+short filename (i.e., no path information) for the SPU binary file that was used as
+the source for embedding. The reason that just the short filename is used is because
+the original SPU binary file may not exist or be accessible at runtime. The performance
+analyst must have sufficient knowledge of the application to be able to correlate the
+SPU binary image names found in the report to the application's source files.
+<note>
+Compile the application with -g and generate the OProfile report
+with -g to facilitate finding the right source file(s) on which to focus.
+</note>
+</listitem>
+</itemizedlist>
+
+</sect2>
+
+<sect2 id="amd-ibs-support">
+<title>AMD64 (x86_64) Instruction-Based Sampling (IBS) support</title>
+
+<para>
+Instruction-Based Sampling (IBS) is a new performance measurement technique
+available on AMD Family 10h processors. Traditional performance counter
+sampling is not precise enough to isolate performance issues to individual
+instructions. IBS, however, precisely identifies instructions which are not
+making the best use of the processor pipeline and memory hierarchy.
+For more information, please refer to the "Instruction-Based Sampling:
+A New Performance Analysis Technique for AMD Family 10h Processors" (
+<ulink url="http://developer.amd.com/assets/AMD_IBS_paper_EN.pdf">
+http://developer.amd.com/assets/AMD_IBS_paper_EN.pdf</ulink>).
+There are two types of IBS profile types, described in the following sections.
+</para>
+
+<sect3 id="ibs-fetch">
+<title>IBS Fetch</title>
+
+<para>
+IBS fetch sampling is a statistical sampling method which counts completed
+fetch operations. When the number of completed fetch operations reaches the
+maximum fetch count (the sampling period), IBS tags the fetch operation and
+monitors that operation until it either completes or aborts. When a tagged
+fetch completes or aborts, a sampling interrupt is generated and an IBS fetch
+sample is taken. An IBS fetch sample contains a timestamp, the identifier of
+the interrupted process, the virtual fetch address, and several event flags
+and values that describe what happened during the fetch operation.
+</para>
+
+</sect3>
+
+<sect3 id="ibs-op">
+<title>IBS Op</title>
+
+<para>
+IBS op sampling selects, tags, and monitors macro-ops as issued from AMD64
+instructions. Two options are available for selecting ops for sampling:
+</para>
+
+<itemizedlist>
+<listitem>
+Cycles-based selection counts CPU clock cycles. The op is tagged and monitored
+when the count reaches a threshold (the sampling period) and a valid op is
+available.
+</listitem>
+
+<listitem>
+Dispatched op-based selection counts dispatched macro-ops.
+When the count reaches a threshold, the next valid op is tagged and monitored.
+</listitem>
+</itemizedlist>
+
+<para>
+In both cases, an IBS sample is generated only if the tagged op retires.
+Thus, IBS op event information does not measure speculative execution activity.
+The execution stages of the pipeline monitor the tagged macro-op. When the
+tagged macro-op retires, a sampling interrupt is generated and an IBS op
+sample is taken. An IBS op sample contains a timestamp, the identifier of
+the interrupted process, the virtual address of the AMD64 instruction from
+which the op was issued, and several event flags and values that describe
+what happened when the macro-op executed.
+</para>
+
+</sect3>
+
+<para>
+Enabling IBS profiling is done simply by specifying IBS performance events
+through the "--event=" options. These events are listed in the
+<function>opcontrol --list-events</function>.
+</para>
+
+<screen>
+opcontrol --event=IBS_FETCH_XXX:&lt;count&gt;:&lt;um&gt;:&lt;kernel&gt;:&lt;user&gt;
+opcontrol --event=IBS_OP_XXX:&lt;count&gt;:&lt;um&gt;:&lt;kernel&gt;:&lt;user&gt;
+
+Note: * All IBS fetch event must have the same event count and unitmask,
+ as do those for IBS op.
+</screen>
+
+</sect2>
+
+
+<sect2 id="misuse">
+<title>Dangerous counter settings</title>
+<para>
+OProfile is a low-level profiler which allow continuous profiling with a low-overhead cost.
+If too low a count reset value is set for a counter, the system can become overloaded with counter
+interrupts, and seem as if the system has frozen. Whilst some validation is done, it
+is not foolproof.
+</para>
+<note><para>
+This can happen as follows: When the profiler count
+reaches zero an NMI handler is called which stores the sample values in an internal buffer, then resets the counter
+to its original value. If the count is very low, a pending NMI can be sent before the NMI handler has
+completed. Due to the priority of the NMI, the local APIC delivers the pending interrupt immediately after
+completion of the previous interrupt handler, and control never returns to other parts of the system.
+In this way the system seems to be frozen.
+</para></note>
+<para>If this happens, it will be impossible to bring the system back to a workable state.
+There is no way to provide real security against this happening, other than making sure to use a reasonable value
+for the counter reset. For example, setting <constant>CPU_CLK_UNHALTED</constant> event type with a ridiculously low reset count (e.g. 500)
+is likely to freeze the system.
+</para>
+<para>
+In short : <command>Don't try a foolish sample count value</command>. Unfortunately the definition of a foolish value
+is really dependent on the event type - if ever in doubt, e-mail </para>
+<address><email>oprofile-list@lists.sf.net</email>.</address>
+</sect2>
+
+</sect1>
+
+</chapter>
+
+<chapter id="results">
+<title>Obtaining results</title>
+<para>
+OK, so the profiler has been running, but it's not much use unless we can get some data out. Fairly often,
+OProfile does a little <emphasis>too</emphasis> good a job of keeping overhead low, and no data reaches
+the profiler. This can happen on lightly-loaded machines. Remember you can force a dump at any time with :
+</para>
+<para><command>opcontrol --dump</command></para>
+<para>Remember to do this before complaining there is no profiling data !
+Now that we've got some data, it has to be processed. That's the job of <command>opreport</command>,
+<command>opannotate</command>, or <command>opgprof</command>.
+</para>
+
+<sect1 id="profile-spec">
+<title>Profile specifications</title>
+
+<para>
+All of the analysis tools take a <emphasis>profile specification</emphasis>.
+This is a set of definitions that describe which actual profiles should be
+examined. The simplest profile specification is empty: this will match all
+the available profile files for the current session (this is what happens
+when you do <command>opreport</command>).
+</para>
+<para>
+Specification parameters are of the form <option>name:value[,value]</option>.
+For example, if I wanted to get a combined symbol summary for
+<filename>/bin/myprog</filename> and <filename>/bin/myprog2</filename>,
+I could do <command>opreport -l image:/bin/myprog,/bin/myprog2</command>.
+As a special case, you don't actually need to specify the <option>image:</option>
+part here: anything left on the command line is assumed to be an
+<option>image:</option> name. Similarly, if no <option>session:</option>
+is specified, then <option>session:current</option> is assumed ("current"
+is a special name of the current / last profiling session).
+</para>
+<para>
+In addition to the comma-separated list shown above, some of the
+specification parameters can take <command>glob</command>-style
+values. For example, if I want to see image summaries for all
+binaries profiled in <filename>/usr/bin/</filename>, I could do
+<command>opreport image:/usr/bin/\*</command>. Note the necessity
+to escape the special character from the shell.
+</para>
+<para>
+For <command>opreport</command>, profile specifications can be used to
+define two profiles, giving differential output. This is done by
+enclosing each of the two specifications within curly braces, as shown
+in the examples below. Any specifications outside of curly braces are
+shared across both.
+</para>
+
+<sect2 id="profile-spec-examples">
+<title>Examples</title>
+
+<para>
+Image summaries for all profiles with <constant>DATA_MEM_REFS</constant>
+samples in the saved session called "stresstest" :
+</para>
+<screen>
+# opreport session:stresstest event:DATA_MEM_REFS
+</screen>
+
+<para>
+Symbol summary for the application called "test_sym53c8xx,9xx". Note the
+escaping is necessary as <option>image:</option> takes a comma-separated list.
+</para>
+<screen>
+# opreport -l ./test/test_sym53c8xx\,9xx
+</screen>
+
+<para>
+Image summaries for all binaries in the <filename>test</filename> directory,
+excepting <filename>boring-test</filename> :
+</para>
+<screen>
+# opreport image:./test/\* image-exclude:./test/boring-test
+</screen>
+
+<para>
+Differential profile of a binary stored in two archives :
+</para>
+<screen>
+# opreport -l /bin/bash { archive:./orig } { archive:./new }
+</screen>
+
+<para>
+Differential profile of an archived binary with the current session :
+</para>
+<screen>
+# opreport -l /bin/bash { archive:./orig } { }
+</screen>
+
+</sect2> <!-- profile spec examples -->
+
+<sect2 id="profile-spec-details">
+<title>Profile specification parameters</title>
+
+<variablelist>
+ <varlistentry>
+ <term><option>archive:</option><emphasis>archivepath</emphasis></term>
+ <listitem><para>
+ A path to an archive made with <command>oparchive</command>.
+ Absence of this tag, unlike others, means "the current system",
+ equivalent to specifying "archive:".
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>session:</option><emphasis>sessionlist</emphasis></term>
+ <listitem><para>
+ A comma-separated list of session names to resolve in. Absence of this
+ tag, unlike others, means "the current session", equivalent to
+ specifying "session:current".
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>session-exclude:</option><emphasis>sessionlist</emphasis></term>
+ <listitem><para>
+ A comma-separated list of sessions to exclude.
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><option>image:</option><emphasis>imagelist</emphasis></term>
+ <listitem><para>
+ A comma-separated list of image names to resolve. Each entry may be relative
+ path, <command>glob</command>-style name, or full path, e.g.</para>
+ <screen>opreport 'image:/usr/bin/oprofiled,*op*,./opreport'</screen>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>image-exclude:</option><emphasis>imagelist</emphasis></term>
+ <listitem><para>
+ Same as <option>image:</option>, but the matching images are excluded.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>lib-image:</option><emphasis>imagelist</emphasis></term>
+ <listitem><para>
+ Same as <option>image:</option>, but only for images that are for
+ a particular primary binary image (namely, an application). This only
+ makes sense to use if you're using <option>--separate</option>.
+ This includes kernel modules and the kernel when using
+ <option>--separate=kernel</option>.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>lib-image-exclude:</option><emphasis>imagelist</emphasis></term>
+ <listitem><para>
+ Same as <option>lib-image:</option>, but the matching images
+ are excluded.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>event:</option><emphasis>eventlist</emphasis></term>
+ <listitem><para>
+ The symbolic event name to match on, e.g. <option>event:DATA_MEM_REFS</option>.
+ You can pass a list of events for side-by-side comparison with <command>opreport</command>.
+ When using the timer interrupt, the event is always "TIMER".
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>count:</option><emphasis>eventcountlist</emphasis></term>
+ <listitem><para>
+ The event count to match on, e.g. <option>event:DATA_MEM_REFS count:30000</option>.
+ Note that this value refers to the setting used for <command>opcontrol</command>
+ only, and has nothing to do with the sample counts in the profile data
+ itself.
+ You can pass a list of events for side-by-side comparison with <command>opreport</command>.
+ When using the timer interrupt, the count is always 0 (indicating it cannot be set).
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>unit-mask:</option><emphasis>masklist</emphasis></term>
+ <listitem><para>
+ The unit mask value of the event to match on, e.g. <option>unit-mask:1</option>.
+ You can pass a list of events for side-by-side comparison with <command>opreport</command>.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>cpu:</option><emphasis>cpulist</emphasis></term>
+ <listitem><para>
+ Only consider profiles for the given numbered CPU (starting from zero).
+ This is only useful when using CPU profile separation.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>tgid:</option><emphasis>pidlist</emphasis></term>
+ <listitem><para>
+ Only consider profiles for the given task groups. Unless some program
+ is using threads, the task group ID of a process is the same
+ as its process ID. This option corresponds to the POSIX
+ notion of a thread group.
+ This is only useful when using per-process profile separation.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term><option>tid:</option><emphasis>tidlist</emphasis></term>
+ <listitem><para>
+ Only consider profiles for the given threads. When using
+ recent thread libraries, all threads in a process share the
+ same task group ID, but have different thread IDs. You can
+ use this option in combination with <option>tgid:</option> to
+ restrict the results to particular threads within a process.
+ This is only useful when using per-process profile separation.
+ </para></listitem>
+ </varlistentry>
+</variablelist>
+
+</sect2>
+
+<sect2 id="locating-and-managing-binary-images">
+<title>Locating and managing binary images</title>
+<para>
+Each session's sample files can be found in the $SESSION_DIR/samples/ directory (default: <filename>/var/lib/oprofile/samples/</filename>).
+These are used, along with the binary image files, to produce human-readable data.
+In some circumstances (kernel modules in an initrd, or modules on 2.6 kernels), OProfile
+will not be able to find the binary images. All the tools have an <option>--image-path</option>
+option to which you can pass a comma-separated list of alternate paths to search. For example,
+I can let OProfile find my 2.6 modules by using <command>--image-path /lib/modules/2.6.0/kernel/</command>.
+It is your responsibility to ensure that the correct images are found when using this
+option.
+</para>
+<para>
+Note that if a binary image changes after the sample file was created, you won't be able to get useful
+symbol-based data out. This situation is detected for you. If you replace a binary, you should
+make sure to save the old binary if you need to do comparative profiles.
+</para>
+
+</sect2>
+
+<sect2 id="no-results">
+<title>What to do when you don't get any results</title>
+<para>
+When attempting to get output, you may see the error :
+</para>
+<screen>
+error: no sample files found: profile specification too strict ?
+</screen>
+<para>
+What this is saying is that the profile specification you passed in,
+when matched against the available sample files, resulted in no matches.
+There are a number of reasons this might happen:
+</para>
+<variablelist>
+<varlistentry><term>spelling</term><listitem><para>
+You specified a binary name, but spelt it wrongly. Check your spelling !
+</para></listitem></varlistentry>
+<varlistentry><term>profiler wasn't running</term><listitem><para>
+Make very sure that OProfile was actually up and running when you ran
+the binary.
+</para></listitem></varlistentry>
+<varlistentry><term>binary didn't run long enough</term><listitem><para>
+Remember OProfile is a statistical profiler - you're not guaranteed to
+get samples for short-running programs. You can help this by using a
+lower count for the performance counter, so there are a lot more samples
+taken per second.
+</para></listitem></varlistentry>
+<varlistentry><term>binary spent most of its time in libraries</term><listitem><para>
+Similarly, if the binary spends little time in the main binary image
+itself, with most of it spent in shared libraries it uses, you might
+not see any samples for the binary image itself. You can check this
+by using <command>opcontrol --separate=lib</command> before the
+profiling session, so <command>opreport</command> and friends show
+the library profiles on a per-application basis.
+</para></listitem></varlistentry>
+<varlistentry><term>specification was really too strict</term><listitem><para>
+For example, you specified something like <option>tgid:3433</option>,
+but no task with that group ID ever ran the code.
+</para></listitem></varlistentry>
+<varlistentry><term>binary didn't generate any events</term><listitem><para>
+If you're using a particular event counter, for example counting MMX
+operations, the code might simply have not generated any events in the
+first place. Verify the code you're profiling does what you expect it
+to.
+</para></listitem></varlistentry>
+<varlistentry><term>you didn't specify kernel module name correctly</term><listitem><para>
+If you're using 2.6 kernels, and trying to get reports for a kernel
+module, make sure to use the <option>-p</option> option, and specify the
+module name <emphasis>with</emphasis> the <filename>.ko</filename>
+extension. Check if the module is one loaded from initrd.
+</para></listitem></varlistentry>
+</variablelist>
+
+</sect2>
+
+</sect1> <!-- profile-spec -->
+
+<sect1 id="opreport">
+<title>Image summaries and symbol summaries (<command>opreport</command>)</title>
+<para>
+The <command>opreport</command> utility is the primary utility you will use for
+getting formatted data out of OProfile. It produces two types of data: image summaries
+and symbol summaries. An image summary lists the number of samples for individual
+binary images such as libraries or applications. Symbol summaries provide per-symbol
+profile data. In the following example, we're getting an image summary for the whole
+system:
+</para>
+<screen>
+$ opreport --long-filenames
+CPU: PIII, speed 863.195 MHz (estimated)
+Counted CPU_CLK_UNHALTED events (clocks processor is not halted) with a unit mask of 0x00 (No unit mask) count 23150
+ 905898 59.7415 /usr/lib/gcc-lib/i386-redhat-linux/3.2/cc1plus
+ 214320 14.1338 /boot/2.6.0/vmlinux
+ 103450 6.8222 /lib/i686/libc-2.3.2.so
+ 60160 3.9674 /usr/local/bin/madplay
+ 31769 2.0951 /usr/local/oprofile-pp/bin/oprofiled
+ 26550 1.7509 /usr/lib/libartsflow.so.1.0.0
+ 23906 1.5765 /usr/bin/as
+ 18770 1.2378 /oprofile
+ 15528 1.0240 /usr/lib/qt-3.0.5/lib/libqt-mt.so.3.0.5
+ 11979 0.7900 /usr/X11R6/bin/XFree86
+ 11328 0.7471 /bin/bash
+ ...
+</screen>
+<para>
+If we had specified <option>--symbols</option> in the previous command, we would have
+gotten a symbol summary of all the images across the entire system. We can restrict this to only
+part of the system profile; for example,
+below is a symbol summary of the OProfile daemon. Note that as we used
+<command>opcontrol --separate=kernel</command>, symbols from images that <command>oprofiled</command>
+has used are also shown.
+</para>
+<screen>
+$ opreport -l `which oprofiled` 2>/dev/null | more
+CPU: PIII, speed 863.195 MHz (estimated)
+Counted CPU_CLK_UNHALTED events (clocks processor is not halted) with a unit mask of 0x00 (No unit mask) count 23150
+vma samples % image name symbol name
+0804be10 14971 28.1993 oprofiled odb_insert
+0804afdc 7144 13.4564 oprofiled pop_buffer_value
+c01daea0 6113 11.5144 vmlinux __copy_to_user_ll
+0804b060 2816 5.3042 oprofiled opd_put_sample
+0804b4a0 2147 4.0441 oprofiled opd_process_samples
+0804acf4 1855 3.4941 oprofiled opd_put_image_sample
+0804ad84 1766 3.3264 oprofiled opd_find_image
+0804a5ec 1084 2.0418 oprofiled opd_find_module
+0804ba5c 741 1.3957 oprofiled odb_hash_add_node
+...
+</screen>
+
+<para>
+These are the two basic ways you are most likely to use regularly, but <command>opreport</command>
+can do a lot more than that, as described below.
+</para>
+
+<sect2 id="opreport-merging">
+<title>Merging separate profiles</title>
+
+If you have used one of the <option>--separate=</option> options
+whilst profiling, there can be several separate profiles for
+a single binary image within a session. Normally the output
+will keep these images separated (so, for example, the image summary
+output shows library image summaries on a per-application basis,
+when using <option>--separate=lib</option>).
+Sometimes it can be useful to merge these results back together
+before getting results. The <option>--merge</option> option allows
+you to do that.
+</sect2>
+
+<sect2 id="opreport-comparison">
+<title>Side-by-side multiple results</title>
+If you have used multiple events when profiling, by default you get
+side-by-side results of each event's sample values from <command>opreport</command>.
+You can restrict which events to list by appropriate use of the
+<option>event:</option> profile specifications, etc.
+</sect2>
+
+<sect2 id="opreport-callgraph">
+<title>Callgraph output</title>
+<para>
+This section provides details on how to use the OProfile callgraph feature.
+</para>
+<sect3 id="op-cg1">
+<title>Callgraph details</title>
+<para>
+When using the <option>opcontrol --callgraph</option> option, you can see what
+functions are calling other functions in the output. Consider the
+following program:
+</para>
+<screen>
+#include &lt;string.h&gt;
+#include &lt;stdlib.h&gt;
+#include &lt;stdio.h&gt;
+
+#define SIZE 500000
+
+static int compare(const void *s1, const void *s2)
+{
+ return strcmp(s1, s2);
+}
+
+static void repeat(void)
+{
+ int i;
+ char *strings[SIZE];
+ char str[] = "abcdefghijklmnopqrstuvwxyz";
+
+ for (i = 0; i &lt; SIZE; ++i) {
+ strings[i] = strdup(str);
+ strfry(strings[i]);
+ }
+
+ qsort(strings, SIZE, sizeof(char *), compare);
+}
+
+int main()
+{
+ while (1)
+ repeat();
+}
+</screen>
+<para>
+When running with the call-graph option, OProfile will
+record the function stack every time it takes a sample.
+<command>opreport --callgraph</command> outputs an entry for each
+function, where each entry looks similar to:
+</para>
+<screen>
+samples % image name symbol name
+ 197 0.1548 cg main
+ 127036 99.8452 cg repeat
+84590 42.5084 libc-2.3.2.so strfry
+ 84590 66.4838 libc-2.3.2.so strfry [self]
+ 39169 30.7850 libc-2.3.2.so random_r
+ 3475 2.7312 libc-2.3.2.so __i686.get_pc_thunk.bx
+-------------------------------------------------------------------------------
+</screen>
+<para>
+Here the non-indented line is the function we're focussing upon
+(<function>strfry()</function>). This
+line is the same as you'd get from a normal <command>opreport</command>
+output.
+</para>
+<para>
+Above the non-indented line we find the functions that called this
+function (for example, <function>repeat()</function> calls
+<function>strfry()</function>). The samples and percentage values here
+refer to the number of times we took a sample where this call was found
+in the stack; the percentage is relative to all other callers of the
+function we're focussing on. Note that these values are
+<emphasis>not</emphasis> call counts; they only reflect the call stack
+every time a sample is taken; that is, if a call is found in the stack
+at the time of a sample, it is recorded in this count.
+</para>
+<para>
+Below the line are functions that are called by
+<function>strfry()</function> (called <emphasis>callees</emphasis>).
+It's clear here that <function>strfry()</function> calls
+<function>random_r()</function>. We also see a special entry with a
+"[self]" marker. This records the normal samples for the function, but
+the percentage becomes relative to all callees. This allows you to
+compare time spent in the function itself compared to functions it
+calls. Note that if a function calls itself, then it will appear in the
+list of callees of itself, but without the "[self]" marker; so recursive
+calls are still clearly separable.
+</para>
+<para>
+You may have noticed that the output lists <function>main()</function>
+as calling <function>strfry()</function>, but it's clear from the source
+that this doesn't actually happen. See <xref
+linkend="interpreting-callgraph" /> for an explanation.
+</para>
+</sect3>
+<sect3 id="cg-with-jitsupport">
+<title>Callgraph and JIT support</title>
+<para>
+Callgraph output where anonymously mapped code is in the callstack can sometimes be misleading.
+For all such code, the samples for the anonymously mapped code are stored in a samples subdirectory
+named <filename>{anon:anon}/&lt;tgid&gt;.&lt;begin_addr&gt;.&lt;end_addr&gt;</filename>.
+As stated earlier, if this anonymously mapped code is JITed code from a supported VM like Java,
+OProfile creates an ELF file to provide a (somewhat) permanent backing file for the code.
+However, when viewing callgraph output, any anonymously mapped code in the callstack
+will be attributed to <filename>anon (&lt;tgid&gt;: range:&lt;begin_addr&gt;-&lt;end_addr&gt;</filename>,
+even if a <filename>.jo</filename> ELF file had been created for it. See the example below.
+</para>
+<screen>
+-------------------------------------------------------------------------------
+ 1 2.2727 libj9ute23.so java.bin traceV
+ 2 4.5455 libj9ute23.so java.bin utsTraceV
+ 4 9.0909 libj9trc23.so java.bin fillInUTInterfaces
+ 37 84.0909 libj9trc23.so java.bin twGetSequenceCounter
+8 0.0154 libj9prt23.so java.bin j9time_hires_clock
+ 27 61.3636 anon (tgid:10014 range:0x100000-0x103000) java.bin (no symbols)
+ 9 20.4545 libc-2.4.so java.bin gettimeofday
+ 8 18.1818 libj9prt23.so java.bin j9time_hires_clock [self]
+-------------------------------------------------------------------------------
+</screen>
+<para>
+The output shows that "anon (tgid:10014 range:0x100000-0x103000)" was a callee of
+<code>j9time_hires_clock</code>, even though the ELF file <filename>10014.jo</filename> was
+created for this profile run. Unfortunately, there is currently no way to correlate
+that anonymous callgraph entry with its corresponding <filename>.jo</filename> file.
+</para>
+</sect3>
+
+
+</sect2> <!-- opreport-callgraph -->
+
+<sect2 id="opreport-diff">
+<title>Differential profiles with <command>opreport</command></title>
+
+<para>
+Often, we'd like to be able to compare two profiles. For example, when
+analysing the performance of an application, we'd like to make code
+changes and examine the effect of the change. This is supported in
+<command>opreport</command> by giving a profile specification that
+identifies two different profiles. The general form is of:
+</para>
+<screen>
+$ opreport &lt;shared-spec&gt; { &lt;first-profile&gt; } { &lt;second-profile&gt; }
+</screen>
+<note><para>
+We lost our Dragon book down the back of the sofa, so you have to be
+careful to have spaces around those braces, or things will get
+hopelessly confused. We can only apologise.
+</para></note>
+<para>
+For each of the profiles, the shared section is prefixed, and then the
+specification is analysed. The usual parameters work both within the
+shared section, and in the sub-specification within the curly braces.
+</para>
+<para>
+A typical way to use this feature is with archives created with
+<command>oparchive</command>. Let's look at an example:
+</para>
+<screen>
+$ ./a
+$ oparchive -o orig ./a
+$ opcontrol --reset
+ # edit and recompile a
+$ ./a
+ # now compare the current profile of a with the archived profile
+$ opreport -xl ./a { archive:./orig } { }
+CPU: PIII, speed 863.233 MHz (estimated)
+Counted CPU_CLK_UNHALTED events (clocks processor is not halted) with a
+unit mask of 0x00 (No unit mask) count 100000
+samples % diff % symbol name
+92435 48.5366 +0.4999 a
+54226 --- --- c
+49222 25.8459 +++ d
+48787 25.6175 -2.2e-01 b
+</screen>
+<para>
+Note that we specified an empty second profile in the curly braces, as
+we wanted to use the current session; alternatively, we could
+have specified another archive, or a tgid etc. We specified the binary
+<command>a</command> in the shared section, so we matched that in both
+the profiles we're diffing.
+</para>
+<para>
+As in the normal output, the results are sorted by the number of
+samples, and the percentage field represents the relative percentage of
+the symbol's samples in the second profile.
+</para>
+<para>
+Notice the new column in the output. This value represents the
+percentage change of the relative percent between the first and the
+second profile: roughly, "how much more important this symbol is".
+Looking at the symbol <function>a()</function>, we can see that it took
+roughly the same amount of the total profile in both the first and the
+second profile. The function <function>c()</function> was not in the new
+profile, so has been marked with <function>---</function>. Note that the
+sample value is the number of samples in the first profile; since we're
+displaying results for the second profile, we don't list a percentage
+value for it, as it would be meaningless. <function>d()</function> is
+new in the second profile, and consequently marked with
+<function>+++</function>.
+</para>
+<para>
+When comparing profiles between different binaries, it should be clear
+that functions can change in terms of VMA and size. To avoid this
+problem, <command>opreport</command> considers a symbol to be the same
+if the symbol name, image name, and owning application name all match;
+any other factors are ignored. Note that the check for application name
+means that trying to compare library profiles between two different
+applications will not work as you might expect: each symbol will be
+considered different.
+</para>
+
+</sect2> <!-- opreport-diff -->
+
+<sect2 id="opreport-anon">
+<title>Anonymous executable mappings</title>
+<para>
+Many applications, typically ones involving dynamic compilation into
+machine code (just-in-time, or "JIT", compilation), have executable mappings that
+are not backed by an ELF file. <command>opreport</command> has basic support for showing the
+samples taken in these regions; for example:
+<screen>
+$ opreport /usr/bin/mono -l
+CPU: ppc64 POWER5, speed 1654.34 MHz (estimated)
+Counted CYCLES events (Processor Cycles using continuous sampling) with a unit mask of 0x00 (No unit mask) count 100000
+samples % image name symbol name
+47 58.7500 mono (no symbols)
+14 17.5000 anon (tgid:3189 range:0xf72aa000-0xf72fa000) (no symbols)
+9 11.2500 anon (tgid:3189 range:0xf6cca000-0xf6dd9000) (no symbols)
+. . . .
+</screen>
+</para>
+<para>
+Note that, since such mappings are dependent upon individual invocations of
+a binary, these mappings are always listed as a dependent image,
+even when using <option>--separate=none</option>.
+Equally, the results are not affected by the <option>--merge</option>
+option.
+</para>
+<para>
+As shown in the opreport output above, OProfile is unable to attribute the samples to any
+symbol(s) because there is no ELF file for this code.
+Enhanced support for JITed code is now available for some virtual machines;
+e.g., the Java Virtual Machine. For details about OProfile output for
+JITed code, see <xref linkend="getting-jit-reports" />.
+</para>
+<para>For more information about JIT support in OProfile, see <xref linkend="jitsupport"/>.
+</para>
+</sect2> <!-- opreport-anon -->
+
+<sect2 id="opreport-xml">
+<title>XML formatted output</title>
+<para>
+The -xml option can be used to generate XML instead of the usual
+text format. This allows opreport to eliminate some of the constraints
+dictated by the two dimensional text format. For example, it is possible
+to separate the sample data across multiple events, cpus and threads. The XML
+schema implemented by opreport is found in doc/opreport.xsd. It contains
+more detailed comments about the structure of the XML generated by opreport.
+</para>
+<para>
+Since XML is consumed by a client program rather than a user, its structure
+is fairly static. In particular, the --sort option is incompatible with the
+--xml option. Percentages are not dislayed in the XML so the options related
+to percentages will have no effect. Full pathnames are always displayed in
+the XML so --long-filenames is not necessary. The --details option will cause
+all of the individual sample data to be included in the XML as well as the
+instruction byte stream for each symbol (for doing disassembly) and can result
+in very large XML files.
+</para>
+</sect2> <!-- opreport-xml -->
+
+<sect2 id="opreport-options">
+<title>Options for <command>opreport</command></title>
+
+<variablelist>
+<varlistentry><term><option>--accumulated / -a</option></term><listitem><para>
+Accumulate sample and percentage counts in the symbol list.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--callgraph / -c</option></term><listitem><para>
+Show callgraph information.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--debug-info / -g</option></term><listitem><para>
+Show source file and line for each symbol.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--demangle / -D none|normal|smart</option></term><listitem><para>
+none: no demangling. normal: use default demangler (default) smart: use
+pattern-matching to make C++ symbol demangling more readable.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--details / -d</option></term><listitem><para>
+Show per-instruction details for all selected symbols. Note that, for
+binaries without symbol information, the VMA values shown are raw file
+offsets for the image binary.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--exclude-dependent / -x</option></term><listitem><para>
+Do not include application-specific images for libraries, kernel modules
+and the kernel. This option only makes sense if the profile session
+used --separate.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--exclude-symbols / -e [symbols]</option></term><listitem><para>
+Exclude all the symbols in the given comma-separated list.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--global-percent / -%</option></term><listitem><para>
+Make all percentages relative to the whole profile.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--help / -? / --usage</option></term><listitem><para>
+Show help message.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--image-path / -p [paths]</option></term><listitem><para>
+Comma-separated list of additional paths to search for binaries.
+This is needed to find modules in kernels 2.6 and upwards.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--root / -R [path]</option></term><listitem><para>
+A path to a filesystem to search for additional binaries.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--include-symbols / -i [symbols]</option></term><listitem><para>
+Only include symbols in the given comma-separated list.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--long-filenames / -f</option></term><listitem><para>
+Output full paths instead of basenames.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--merge / -m [lib,cpu,tid,tgid,unitmask,all]</option></term><listitem><para>
+Merge any profiles separated in a --separate session.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--no-header</option></term><listitem><para>
+Don't output a header detailing profiling parameters.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--output-file / -o [file]</option></term><listitem><para>
+Output to the given file instead of stdout.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--reverse-sort / -r</option></term><listitem><para>
+Reverse the sort from the default.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--session-dir=</option>dir_path</term><listitem><para>
+Use sample database out of directory <filename>dir_path</filename>
+instead of the default location (/var/lib/oprofile).
+</para></listitem></varlistentry>
+<varlistentry><term><option>--show-address / -w</option></term><listitem><para>
+Show the VMA address of each symbol (off by default).
+</para></listitem></varlistentry>
+<varlistentry><term><option>--sort / -s [vma,sample,symbol,debug,image]</option></term><listitem><para>
+Sort the list of symbols by, respectively, symbol address,
+number of samples, symbol name, debug filename and line number,
+binary image filename.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--symbols / -l</option></term><listitem><para>
+List per-symbol information instead of a binary image summary.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--threshold / -t [percentage]</option></term><listitem><para>
+Only output data for symbols that have more than the given percentage
+of total samples.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--verbose / -V [options]</option></term><listitem><para>
+Give verbose debugging output.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--version / -v</option></term><listitem><para>
+Show version.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--xml / -X</option></term><listitem><para>
+Generate XML output.
+</para></listitem></varlistentry>
+</variablelist>
+
+</sect2>
+
+</sect1> <!-- opreport -->
+
+<sect1 id="opannotate">
+<title>Outputting annotated source (<command>opannotate</command>)</title>
+<para>
+The <command>opannotate</command> utility generates annotated source files or assembly listings, optionally
+mixed with source.
+If you want to see the source file, the profiled application needs to have debug information, and the source
+must be available through this debug information. For GCC, you must use the <option>-g</option> option
+when you are compiling.
+If the binary doesn't contain sufficient debug information, you can still
+use <command>opannotate <option>--assembly</option></command> to get annotated assembly.
+</para>
+<para>
+Note that for the reason explained in <xref linkend="hardware-counters" /> the results can be
+inaccurate. The debug information itself can add other problems; for example, the line number for a symbol can be
+incorrect. Assembly instructions can be re-ordered and moved by the compiler, and this can lead to
+crediting source lines with samples not really "owned" by this line. Also see
+<xref linkend="interpreting" />.
+</para>
+<para>
+You can output the annotation to one single file, containing all the source found using the
+<option>--source</option>. You can use this in conjunction with <option>--assembly</option>
+to get combined source/assembly output.
+</para>
+<para>
+You can also output a directory of annotated source files that maintains the structure of
+the original sources. Each line in the annotated source is prepended with the samples
+for that line. Additionally, each symbol is annotated giving details for the symbol
+as a whole. An example:
+</para>
+<screen>
+$ opannotate --source --output-dir=annotated /usr/local/oprofile-pp/bin/oprofiled
+$ ls annotated/home/moz/src/oprofile-pp/daemon/
+opd_cookie.h opd_image.c opd_kernel.c opd_sample_files.c oprofiled.c
+</screen>
+<para>
+Line numbers are maintained in the source files, but each file has
+a footer appended describing the profiling details. The actual annotation
+looks something like this :
+</para>
+<screen>
+...
+ :static uint64_t pop_buffer_value(struct transient * trans)
+ 11510 1.9661 :{ /* pop_buffer_value total: 89901 15.3566 */
+ : uint64_t val;
+ :
+ 10227 1.7469 : if (!trans->remaining) {
+ : fprintf(stderr, "BUG: popping empty buffer !\n");
+ : exit(EXIT_FAILURE);
+ : }
+ :
+ : val = get_buffer_value(trans->buffer, 0);
+ 2281 0.3896 : trans->remaining--;
+ 2296 0.3922 : trans->buffer += kernel_pointer_size;
+ : return val;
+ 10454 1.7857 :}
+...
+</screen>
+
+<para>
+The first number on each line is the number of samples, whilst the second is
+the relative percentage of total samples.
+</para>
+
+<sect2 id="opannotate-finding-source">
+<title>Locating source files</title>
+<para>
+Of course, <command>opannotate</command> needs to be able to locate the source files
+for the binary image(s) in order to produce output. Some binary images have debug
+information where the given source file paths are relative, not absolute. You can
+specify search paths to look for these files (similar to <command>gdb</command>'s
+<option>dir</option> command) with the <option>--search-dirs</option> option.
+</para>
+<para>
+Sometimes you may have a binary image which gives absolute paths for the source files,
+but you have the actual sources elsewhere (commonly, you've installed an SRPM for
+a binary on your system and you want annotation from an existing profile). You can
+use the <option>--base-dirs</option> option to redirect OProfile to look somewhere
+else for source files. For example, imagine we have a binary generated from a source
+file that is given in the debug information as <filename>/tmp/build/libfoo/foo.c</filename>,
+and you have the source tree matching that binary installed in <filename>/home/user/libfoo/</filename>.
+You can redirect OProfile to find <filename>foo.c</filename> correctly like this :
+</para>
+<screen>
+$ opannotate --source --base-dirs=/tmp/build/libfoo/ --search-dirs=/home/user/libfoo/ --output-dir=annotated/ /lib/libfoo.so
+</screen>
+<para>
+You can specify multiple (comma-separated) paths to both options.
+</para>
+</sect2>
+
+<sect2 id="opannotate-details">
+<title>Usage of <command>opannotate</command></title>
+
+<variablelist>
+<varlistentry><term><option>--assembly / -a</option></term><listitem><para>
+Output annotated assembly. If this is combined with --source, then mixed
+source / assembly annotations are output.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--base-dirs / -b [paths]/</option></term><listitem><para>
+Comma-separated list of path prefixes. This can be used to point OProfile to a
+different location for source files when the debug information specifies an
+absolute path on your system for the source that does not exist. The prefix
+is stripped from the debug source file paths, then searched in the search dirs
+specified by <option>--search-dirs</option>.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--demangle / -D none|normal|smart</option></term><listitem><para>
+none: no demangling. normal: use default demangler (default) smart: use
+pattern-matching to make C++ symbol demangling more readable.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--exclude-dependent / -x</option></term><listitem><para>
+Do not include application-specific images for libraries, kernel modules
+and the kernel. This option only makes sense if the profile session
+used --separate.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--exclude-file [files]</option></term><listitem><para>
+Exclude all files in the given comma-separated list of glob patterns.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--exclude-symbols / -e [symbols]</option></term><listitem><para>
+Exclude all the symbols in the given comma-separated list.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--help / -? / --usage</option></term><listitem><para>
+Show help message.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--image-path / -p [paths]</option></term><listitem><para>
+Comma-separated list of additional paths to search for binaries.
+This is needed to find modules in kernels 2.6 and upwards.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--root / -R [path]</option></term><listitem><para>
+A path to a filesystem to search for additional binaries.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--include-file [files]</option></term><listitem><para>
+Only include files in the given comma-separated list of glob patterns.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--include-symbols / -i [symbols]</option></term><listitem><para>
+Only include symbols in the given comma-separated list.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--objdump-params [params]</option></term><listitem><para>
+Pass the given parameters as extra values when calling objdump.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--output-dir / -o [dir]</option></term><listitem><para>
+Output directory. This makes opannotate output one annotated file for each
+source file. This option can't be used in conjunction with --assembly.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--search-dirs / -d [paths]</option></term><listitem><para>
+Comma-separated list of paths to search for source files. This is useful to find
+source files when the debug information only contains relative paths.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--source / -s</option></term><listitem><para>
+Output annotated source. This requires debugging information to be available
+for the binaries.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--threshold / -t [percentage]</option></term><listitem><para>
+Only output data for symbols that have more than the given percentage
+of total samples.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--verbose / -V [options]</option></term><listitem><para>
+Give verbose debugging output.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--version / -v</option></term><listitem><para>
+Show version.
+</para></listitem></varlistentry>
+</variablelist>
+
+
+</sect2> <!-- opannotate-details -->
+
+</sect1> <!-- opannotate -->
+
+<sect1 id="getting-jit-reports">
+ <title>OProfile results with JIT samples</title>
+ <para>
+ After profiling a Java (or other supported VM) application, the command
+ <screen><command>"opcontrol --dump"</command> </screen>
+ flushes the sample buffers and creates ELF binaries from the
+ intermediate files that were written by the agent library.
+ The ELF binaries are named <filename>&lt;tgid&gt;.jo</filename>.
+ With the symbol information stored in these ELF files, it is
+ possible to map samples to the appropriate symbols.
+ </para>
+ <para>
+ The usual analysis tools (<command>opreport</command> and/or
+ <command>opannotate</command>) can now be used
+ to get symbols and assembly code for the instrumented VM processes.
+ </para>
+<para>
+Below is an example of a profile report of a Java application that has been
+instrumented with the provided agent library.
+<screen>
+$ opreport -l /usr/lib/jvm/jre-1.5.0-ibm/bin/java
+CPU: Core Solo / Duo, speed 2167 MHz (estimated)
+Counted CPU_CLK_UNHALTED events (Unhalted clock cycles) with a unit mask of 0x00 (Unhalted core cycles) count 100000
+samples % image name symbol name
+186020 50.0523 no-vmlinux no-vmlinux (no symbols)
+34333 9.2380 7635.jo java void test.f1()
+19022 5.1182 libc-2.5.so libc-2.5.so _IO_file_xsputn@@GLIBC_2.1
+18762 5.0483 libc-2.5.so libc-2.5.so vfprintf
+16408 4.4149 7635.jo java void test$HelloThread.run()
+16250 4.3724 7635.jo java void test$test_1.f2(int)
+15303 4.1176 7635.jo java void test.f2(int, int)
+13252 3.5657 7635.jo java void test.f2(int)
+5165 1.3897 7635.jo java void test.f4()
+955 0.2570 7635.jo java void test$HelloThread.run()~
+
+</screen>
+</para>
+<note><para>
+ Depending on the JVM that is used, certain options of opreport and opannotate
+ do NOT work since they rely on debug information (e.g. source code line number)
+ that is not always available. The Sun JVM does provide the necessary debug
+ information via the JVMTI[PI] interface,
+ but other JVMs do not.
+ </para></note>
+ <para>
+ As you can see in the opreport output, the JIT support agent for Java
+ generates symbols to include the class and method signature.
+ A symbol with the suffix &tilde;&lt;n&gt; (e.g.
+ <code>void test$HelloThread.run()&tilde;1</code>) means that this is
+ the &lt;n&gt;th occurrence of the identical name. This happens if a method is re-JITed.
+ A symbol with the suffix %&lt;n&gt;, means that the address space of this symbol
+ was reused during the sample session (see <xref linkend="overlapping-symbols" />).
+ The value &lt;n&gt; is the percentage of time that this symbol/code was present in
+ relation to the total lifetime of all overlapping other symbols. A symbol of the form
+ <code>&lt;return_val&gt; &lt;class_name&gt;$&lt;method_sig&gt;</code> denotes an
+ inner class.
+ </para>
+</sect1>
+
+<sect1 id="opgprof">
+<title><command>gprof</command>-compatible output (<command>opgprof</command>)</title>
+<para>
+If you're familiar with the output produced by <command>GNU gprof</command>,
+you may find <command>opgprof</command> useful. It takes a single binary
+as an argument, and produces a <filename>gmon.out</filename> file for use
+with <command>gprof -p</command>. If call-graph profiling is enabled,
+then this is also included.
+</para>
+<screen>
+$ opgprof `which oprofiled` # generates gmon.out file
+$ gprof -p `which oprofiled` | head
+Flat profile:
+
+Each sample counts as 1 samples.
+ % cumulative self self total
+ time samples samples calls T1/call T1/call name
+ 33.13 206237.00 206237.00 odb_insert
+ 22.67 347386.00 141149.00 pop_buffer_value
+ 9.56 406881.00 59495.00 opd_put_sample
+ 7.34 452599.00 45718.00 opd_find_image
+ 7.19 497327.00 44728.00 opd_process_samples
+</screen>
+
+<sect2 id="opgprof-details">
+<title>Usage of <command>opgprof</command></title>
+
+<variablelist>
+<varlistentry><term><option>--help / -? / --usage</option></term><listitem><para>
+Show help message.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--image-path / -p [paths]</option></term><listitem><para>
+Comma-separated list of additional paths to search for binaries.
+This is needed to find modules in kernels 2.6 and upwards.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--root / -R [path]</option></term><listitem><para>
+A path to a filesystem to search for additional binaries.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--output-filename / -o [file]</option></term><listitem><para>
+Output to the given file instead of the default, gmon.out
+</para></listitem></varlistentry>
+<varlistentry><term><option>--threshold / -t [percentage]</option></term><listitem><para>
+Only output data for symbols that have more than the given percentage
+of total samples.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--verbose / -V [options]</option></term><listitem><para>
+Give verbose debugging output.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--version / -v</option></term><listitem><para>
+Show version.
+</para></listitem></varlistentry>
+</variablelist>
+
+</sect2> <!-- opgprof-details -->
+
+</sect1> <!-- opgprof -->
+
+<sect1 id="oparchive">
+<title>Archiving measurements (<command>oparchive</command>)</title>
+<para>
+ The <command>oparchive</command> utility generates a directory populated
+ with executable, debug, and oprofile sample files. This directory can be
+ moved to another machine via <command>tar</command> and analyzed without
+ further use of the data collection machine.
+</para>
+
+<para>
+ The following command would collect the sample files, the executables
+ associated with the sample files, and the debuginfo files associated
+ with the executables and copy them into
+ <filename>/tmp/current_data</filename>:
+</para>
+
+<screen>
+# oparchive -o /tmp/current_data
+</screen>
+
+<sect2 id="oparchive-details">
+<title>Usage of <command>oparchive</command></title>
+
+<variablelist>
+<varlistentry><term><option>--help / -? / --usage</option></term><listitem><para>
+Show help message.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--exclude-dependent / -x</option></term><listitem><para>
+Do not include application-specific images for libraries, kernel modules
+and the kernel. This option only makes sense if the profile session
+used --separate.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--image-path / -p [paths]</option></term><listitem><para>
+Comma-separated list of additional paths to search for binaries.
+This is needed to find modules in kernels 2.6 and upwards.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--root / -R [path]</option></term><listitem><para>
+A path to a filesystem to search for additional binaries.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--output-directory / -o [directory]</option></term><listitem><para>
+Output to the given directory. There is no default. This must be specified.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--list-files / -l</option></term><listitem><para>
+Only list the files that would be archived, don't copy them.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--verbose / -V [options]</option></term><listitem><para>
+Give verbose debugging output.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--version / -v</option></term><listitem><para>
+Show version.
+</para></listitem></varlistentry>
+</variablelist>
+
+</sect2> <!-- oparchive-details -->
+
+</sect1> <!-- oparchive -->
+
+<sect1 id="opimport">
+<title>Converting sample database files (<command>opimport</command>)</title>
+<para>
+ This utility converts sample database files from a foreign binary format (abi) to
+ the native format. This is useful only when moving sample files between hosts,
+ for analysis on platforms other than the one used for collection. The abi format
+ of the file to be imported is described in a text file located in <filename>$SESSION_DIR/abi</filename>.
+</para>
+
+<para>
+ The following command would convert the input samples files to the
+ output samples files using the given abi file as a binary description
+ of the input file and the curent platform abi as a binary description
+ of the output file.
+</para>
+
+<screen>
+# opimport -a /var/lib/oprofile/abi -o /tmp/current/.../GLOBAL_POWER_EVENTS.200000.1.all.all.all /var/lib/.../mprime/GLOBAL_POWER_EVENTS.200000.1.all.all.all
+</screen>
+
+<sect2 id="opimport-details">
+<title>Usage of <command>opimport</command></title>
+
+<variablelist>
+<varlistentry><term><option>--help / -? / --usage</option></term><listitem><para>
+Show help message.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--abi / -a [filename]</option></term><listitem><para>
+Input abi file description location.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--force / -f</option></term><listitem><para>
+Force conversion even if the input and output abi are identical.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--output / -o [filename]</option></term><listitem><para>
+Specify the output filename. If the output file already exists, the file is
+not overwritten but data are accumulated in. Sample filename are informative
+for post profile tools and must be kept identical, in other word the pathname
+from the first path component containing a '{' must be kept as it in the
+output filename.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--verbose / -V</option></term><listitem><para>
+Give verbose debugging output.
+</para></listitem></varlistentry>
+<varlistentry><term><option>--version / -v</option></term><listitem><para>
+Show version.
+</para></listitem></varlistentry>
+</variablelist>
+
+</sect2> <!-- opimport-details -->
+
+</sect1> <!-- opimport -->
+
+</chapter>
+
+<chapter id="interpreting">
+<title>Interpreting profiling results</title>
+<para>
+The standard caveats of profiling apply in interpreting the results from OProfile:
+profile realistic situations, profile different scenarios, profile
+for as long as a time as possible, avoid system-specific artifacts, don't trust
+the profile data too much. Also bear in mind the comments on the performance
+counters above - you <emphasis>cannot</emphasis> rely on totally accurate
+instruction-level profiling. However, for almost all circumstances the data
+can be useful. Ideally a utility such as Intel's VTUNE would be available to
+allow careful instruction-level analysis; go hassle Intel for this, not me ;)
+</para>
+<sect1 id="irq-latency">
+<title>Profiling interrupt latency</title>
+<para>
+This is an example of how the latency of delivery of profiling interrupts
+can impact the reliability of the profiling data. This is pretty much a
+worst-case-scenario example: these problems are fairly rare.
+</para>
+<screen>
+double fun(double a, double b, double c)
+{
+ double result = 0;
+ for (int i = 0 ; i &lt; 10000; ++i) {
+ result += a;
+ result *= b;
+ result /= c;
+ }
+ return result;
+}
+</screen>
+<para>
+Here the last instruction of the loop is very costly, and you would expect the result
+reflecting that - but (cutting the instructions inside the loop):
+</para>
+<screen>
+$ opannotate -a -t 10 ./a.out
+
+ 88 15.38% : 8048337: fadd %st(3),%st
+ 48 8.391% : 8048339: fmul %st(2),%st
+ 68 11.88% : 804833b: fdiv %st(1),%st
+ 368 64.33% : 804833d: inc %eax
+ : 804833e: cmp $0x270f,%eax
+ : 8048343: jle 8048337
+</screen>
+<para>
+The problem comes from the x86 hardware; when the counter overflows the IRQ
+is asserted but the hardware has features that can delay the NMI interrupt:
+x86 hardware is synchronous (i.e. cannot interrupt during an instruction);
+there is also a latency when the IRQ is asserted, and the multiple
+execution units and the out-of-order model of modern x86 CPUs also causes
+problems. This is the same function, with annotation :
+</para>
+<screen>
+$ opannotate -s -t 10 ./a.out
+
+ :double fun(double a, double b, double c)
+ :{ /* _Z3funddd total: 572 100.0% */
+ : double result = 0;
+ 368 64.33% : for (int i = 0 ; i &lt; 10000; ++i) {
+ 88 15.38% : result += a;
+ 48 8.391% : result *= b;
+ 68 11.88% : result /= c;
+ : }
+ : return result;
+ :}
+</screen>
+<para>
+The conclusion: don't trust samples coming at the end of a loop,
+particularly if the last instruction generated by the compiler is costly. This
+case can also occur for branches. Always bear in mind that samples
+can be delayed by a few cycles from its real position. That's a hardware
+problem and OProfile can do nothing about it.
+</para>
+</sect1>
+<sect1 id="kernel-profiling">
+<title>Kernel profiling</title>
+<sect2 id="irq-masking">
+<title>Interrupt masking</title>
+<para>
+OProfile uses non-maskable interrupts (NMI) on the P6 generation, Pentium 4,
+Athlon, Opteron, Phenom, and Turion processors. These interrupts can occur even in section of the
+Linux where interrupts are disabled, allowing collection of samples in virtually
+all executable code. The RTC, timer interrupt mode, and Itanium 2 collection mechanisms
+use maskable interrupts. Thus, the RTC and Itanium 2 data collection mechanism have "sample
+shadows", or blind spots: regions where no samples will be collected. Typically, the samples
+will be attributed to the code immediately after the interrupts are re-enabled.
+</para>
+</sect2>
+<sect2 id="idle">
+<title>Idle time</title>
+<para>
+Your kernel is likely to support halting the processor when a CPU is idle. As
+the typical hardware events like <constant>CPU_CLK_UNHALTED</constant> do not
+count when the CPU is halted, the kernel profile will not reflect the actual
+amount of time spent idle. You can change this behaviour by booting with
+the <option>idle=poll</option> option, which uses a different idle routine. This
+will appear as <function>poll_idle()</function> in your kernel profile.
+</para>
+</sect2>
+<sect2 id="kernel-modules">
+<title>Profiling kernel modules</title>
+<para>
+OProfile profiles kernel modules by default. However, there are a couple of problems
+you may have when trying to get results. First, you may have booted via an initrd;
+this means that the actual path for the module binaries cannot be determined automatically.
+To get around this, you can use the <option>-p</option> option to the profiling tools
+to specify where to look for the kernel modules.
+</para>
+<para>
+In 2.6, the information on where kernel module binaries are located has been removed.
+This means OProfile needs guiding with the <option>-p</option> option to find your
+modules. Normally, you can just use your standard module top-level directory for this.
+Note that due to this problem, OProfile cannot check that the modification times match;
+it is your responsibility to make sure you do not modify a binary after a profile
+has been created.
+</para>
+<para>
+If you have run <command>insmod</command> or <command>modprobe</command> to insert a module
+in a particular directory, it is important that you specify this directory with the
+<option>-p</option> option first, so that it over-rides an older module binary that might
+exist in other directories you've specified with <option>-p</option>. It is up to you
+to make sure that these values are correct: 2.6 kernels simply do not provide enough
+information for OProfile to get this information.
+</para>
+</sect2>
+</sect1>
+
+<sect1 id="interpreting-callgraph">
+<title>Interpreting call-graph profiles</title>
+<para>
+Sometimes the results from call-graph profiles may be different to what
+you expect to see. The first thing to check is whether the target
+binaries where compiled with frame pointers enabled (if the binary was
+compiled using <command>gcc</command>'s
+<option>-fomit-frame-pointer</option> option, you will not get
+meaningful results). Note that as of this writing, the GCC developers
+plan to disable frame pointers by default. The Linux kernel is built
+without frame pointers by default; there is a configuration option you
+can use to turn it on under the "Kernel Hacking" menu.
+</para>
+<para>
+Often you may see a caller of a function that does not actually directly
+call the function you're looking at (e.g. if <function>a()</function>
+calls <function>b()</function>, which in turn calls
+<function>c()</function>, you may see an entry for
+<function>a()->c()</function>). What's actually occurring is that we
+are taking samples at the very start (or the very end) of
+<function>c()</function>; at these few instructions, we haven't yet
+created the new function's frame, so it appears as if
+<function>a()</function> is calling directly into
+<function>c()</function>. Be careful not to be misled by these
+entries.
+</para>
+<para>
+Like the rest of OProfile, call-graph profiling uses a statistical
+approach; this means that sometimes a backtrace sample is truncated, or
+even partially wrong. Bear this in mind when examining results.
+</para>
+<!-- FIXME: what do we need here ? -->
+</sect1>
+
+<sect1 id="debug-info">
+<title>Inaccuracies in annotated source</title>
+<sect2 id="effect-of-optimizations">
+<title>Side effects of optimizations</title>
+<para>
+The compiler can introduce some pitfalls in the annotated source output.
+The optimizer can move pieces of code in such manner that two line of codes
+are interlaced (instruction scheduling). Also debug info generated by the compiler
+can show strange behavior. This is especially true for complex expressions e.g. inside
+an if statement:
+</para>
+<screen>
+ if (a &amp;&amp; ..
+ b &amp;&amp; ..
+ c &amp;&amp;)
+</screen>
+<para>
+here the problem come from the position of line number. The available debug
+info does not give enough details for the if condition, so all samples are
+accumulated at the position of the right brace of the expression. Using
+<command>opannotate <option>-a</option></command> can help to show the real
+samples at an assembly level.
+</para>
+</sect2>
+<sect2 id="prologues">
+<title>Prologues and epilogues</title>
+<para>
+The compiler generally needs to generate "glue" code across function calls, dependent
+on the particular function call conventions used. Additionally other things
+need to happen, like stack pointer adjustment for the local variables; this
+code is known as the function prologue. Similar code is needed at function return,
+and is known as the function epilogue. This will show up in annotations as
+samples at the very start and end of a function, where there is no apparent
+executable code in the source.
+</para>
+</sect2>
+<sect2 id="inlined-function">
+<title>Inlined functions</title>
+<para>
+You may see that a function is credited with a certain number of samples, but
+the listing does not add up to the correct total. To pick a real example :
+</para>
+<screen>
+ :internal_sk_buff_alloc_security(struct sk_buff *skb)
+ 353 2.342% :{ /* internal_sk_buff_alloc_security total: 1882 12.48% */
+ :
+ : sk_buff_security_t *sksec;
+ 15 0.0995% : int rc = 0;
+ :
+ 10 0.06633% : sksec = skb-&gt;lsm_security;
+ 468 3.104% : if (sksec &amp;&amp; sksec-&gt;magic == DSI_MAGIC) {
+ : goto out;
+ : }
+ :
+ : sksec = (sk_buff_security_t *) get_sk_buff_memory(skb);
+ 3 0.0199% : if (!sksec) {
+ 38 0.2521% : rc = -ENOMEM;
+ : goto out;
+ 10 0.06633% : }
+ : memset(sksec, 0, sizeof (sk_buff_security_t));
+ 44 0.2919% : sksec-&gt;magic = DSI_MAGIC;
+ 32 0.2123% : sksec-&gt;skb = skb;
+ 45 0.2985% : sksec-&gt;sid = DSI_SID_NORMAL;
+ 31 0.2056% : skb-&gt;lsm_security = sksec;
+ :
+ : out:
+ :
+ 146 0.9685% : return rc;
+ :
+ 98 0.6501% :}
+</screen>
+<para>
+Here, the function is credited with 1,882 samples, but the annotations
+below do not account for this. This is usually because of inline functions -
+the compiler marks such code with debug entries for the inline function
+definition, and this is where <command>opannotate</command> annotates
+such samples. In the case above, <function>memset</function> is the most
+likely candidate for this problem. Examining the mixed source/assembly
+output can help identify such results.
+</para>
+<para>
+This problem is more visible when there is no source file available, in the
+following example it's trivially visible the sums of symbols samples is less
+than the number of the samples for this file. The difference must be accounted
+to inline functions.
+</para>
+<screen>
+/*
+ * Total samples for file : "arch/i386/kernel/process.c"
+ *
+ * 109 2.4616
+ */
+
+ /* default_idle total: 84 1.8970 */
+ /* cpu_idle total: 21 0.4743 */
+ /* flush_thread total: 1 0.0226 */
+ /* prepare_to_copy total: 1 0.0226 */
+ /* __switch_to total: 18 0.4065 */
+</screen>
+<para>
+The missing samples are not lost, they will be credited to another source
+location where the inlined function is defined. The inlined function will be
+credited from multiple call site and merged in one place in the annotated
+source file so there is no way to see from what call site are coming the
+samples for an inlined function.
+</para>
+<para>
+When running <command>opannotate</command>, you may get a warning
+"some functions compiled without debug information may have incorrect source line attributions".
+In some rare cases, OProfile is not able to verify that the derived source line
+is correct (when some parts of the binary image are compiled without debugging
+information). Be wary of results if this warning appears.
+</para>
+<para>
+Furthermore, for some languages the compiler can implicitly generate functions,
+such as default copy constructors. Such functions are labelled by the compiler
+as having a line number of 0, which means the source annotation can be confusing.
+</para>
+<!-- FIXME so what *actually* happens to those samples ? ignored ? -->
+</sect2>
+<sect2 id="wrong-linenr-info">
+<title>Inaccuracy in line number information</title>
+<para>
+Depending on your compiler you can fall into the following problem:
+</para>
+<screen>
+struct big_object { int a[500]; };
+
+int main()
+{
+ big_object a, b;
+ for (int i = 0 ; i != 1000 * 1000; ++i)
+ b = a;
+ return 0;
+}
+
+</screen>
+<para>
+Compiled with <command>gcc</command> 3.0.4 the annotated source is clearly inaccurate:
+</para>
+<screen>
+ :int main()
+ :{ /* main total: 7871 100% */
+ : big_object a, b;
+ : for (int i = 0 ; i != 1000 * 1000; ++i)
+ : b = a;
+ 7871 100% : return 0;
+ :}
+</screen>
+<para>
+The problem here is distinct from the IRQ latency problem; the debug line number
+information is not precise enough; again, looking at output of <command>opannoatate -as</command> can help.
+</para>
+<screen>
+ :int main()
+ :{
+ : big_object a, b;
+ : for (int i = 0 ; i != 1000 * 1000; ++i)
+ : 80484c0: push %ebp
+ : 80484c1: mov %esp,%ebp
+ : 80484c3: sub $0xfac,%esp
+ : 80484c9: push %edi
+ : 80484ca: push %esi
+ : 80484cb: push %ebx
+ : b = a;
+ : 80484cc: lea 0xfffff060(%ebp),%edx
+ : 80484d2: lea 0xfffff830(%ebp),%eax
+ : 80484d8: mov $0xf423f,%ebx
+ : 80484dd: lea 0x0(%esi),%esi
+ : return 0;
+ 3 0.03811% : 80484e0: mov %edx,%edi
+ : 80484e2: mov %eax,%esi
+ 1 0.0127% : 80484e4: cld
+ 8 0.1016% : 80484e5: mov $0x1f4,%ecx
+ 7850 99.73% : 80484ea: repz movsl %ds:(%esi),%es:(%edi)
+ 9 0.1143% : 80484ec: dec %ebx
+ : 80484ed: jns 80484e0
+ : 80484ef: xor %eax,%eax
+ : 80484f1: pop %ebx
+ : 80484f2: pop %esi
+ : 80484f3: pop %edi
+ : 80484f4: leave
+ : 80484f5: ret
+</screen>
+<para>
+So here it's clear that copying is correctly credited with of all the samples, but the
+line number information is misplaced. <command>objdump -dS</command> exposes the
+same problem. Note that maintaining accurate debug information for compilers when optimizing is difficult, so this problem is not suprising.
+The problem of debug information
+accuracy is also dependent on the binutils version used; some BFD library versions
+contain a work-around for known problems of <command>gcc</command>, some others do not. This is unfortunate but we must live with that,
+since profiling is pointless when you disable optimisation (which would give better debugging entries).
+</para>
+</sect2>
+</sect1>
+<sect1 id="symbol-without-debug-info">
+<title>Assembly functions</title>
+<para>
+Often the assembler cannot generate debug information automatically.
+This means that you cannot get a source report unless
+you manually define the neccessary debug information; read your assembler documentation for how you might
+do that. The only
+debugging info needed currently by OProfile is the line-number/filename-VMA association. When profiling assembly
+without debugging info you can always get report for symbols, and optionally for VMA, through <command>opreport -l</command>
+or <command>opreport -d</command>, but this works only for symbols with the right attributes.
+For <command>gas</command> you can get this by
+</para>
+<screen>
+.globl foo
+ .type foo,@function
+</screen>
+<para>
+whilst for <command>nasm</command> you must use
+</para>
+<screen>
+ GLOBAL foo:function ; [1]
+</screen>
+<para>
+Note that OProfile does not need the global attribute, only the function attribute.
+</para>
+</sect1>
+<!--
+
+FIXME: I commented this bit out until we've written something ...
+
+improve this ? but look first why this file is special
+<sect2 id="small-functions">
+<title>Small functions</title>
+<para>
+Very small functions can show strange behavior. The file in your source
+directory of OProfile <filename>$SRC/test-oprofile/understanding/puzzle.c</filename>
+show such example
+</para>
+</sect2>
+-->
+
+<sect1 id="overlapping-symbols">
+ <title>Overlapping symbols in JITed code</title>
+ <para>
+ Some virtual machines (e.g., Java) may re-JIT a method, resulting in previously
+ allocated space for a piece of compiled code to be reused. This means that, at one distinct
+ code address, multiple symbols/methods may be present during the run time of the application.
+ </para>
+ <para>
+ Since OProfile samples are buffered and don&prime;t have timing information, there is no way
+ to correlate samples with the (possibly) varying address ranges in which the code for a symbol
+ may reside.
+ An alternative would be flushing the OProfile sampling buffer when we get an unload event,
+ but this could result in high overhead.
+ </para>
+ <para>
+ To moderate the problem of overlapping symbols, OProfile tries to select the symbol that was
+ present at this address range most of the time. Additionally, other overlapping symbols
+ are truncated in the overlapping area.
+ This gives reasonable results, because in reality, address reuse typically takes place
+ during phase changes of the application -- in particular, during application startup.
+ Thus, for optimum profiling results, start the sampling session after application startup
+ and burn in.
+ </para>
+</sect1>
+
+<sect1 id="hidden-cost">
+<title>Other discrepancies</title>
+<para>
+Another cause of apparent problems is the hidden cost of instructions. A very
+common example is two memory reads: one from L1 cache and the other from memory:
+the second memory read is likely to have more samples.
+There are many other causes of hidden cost of instructions. A non-exhaustive
+list: mis-predicted branch, TLB cache miss, partial register stall,
+partial register dependencies, memory mismatch stall, re-executed µops. If you want to write
+programs at the assembly level, be sure to take a look at the Intel and
+AMD documentation at <ulink url="http://developer.intel.com/">http://developer.intel.com/</ulink>
+and <ulink url="http://developer.amd.com/devguides.jsp/">http://developer.amd.com/devguides.jsp</ulink>.
+</para>
+</sect1>
+</chapter>
+
+
+<chapter id="ack">
+<title>Acknowledgments</title>
+<para>
+Thanks to (in no particular order) : Arjan van de Ven, Rik van Riel, Juan Quintela, Philippe Elie,
+Phillipp Rumpf, Tigran Aivazian, Alex Brown, Alisdair Rawsthorne, Bob Montgomery, Ray Bryant, H.J. Lu,
+Jeff Esper, Will Cohen, Graydon Hoare, Cliff Woolley, Alex Tsariounov, Al Stone, Jason Yeh,
+Randolph Chung, Anton Blanchard, Richard Henderson, Andries Brouwer, Bryan Rittmeyer,
+Maynard P. Johnson,
+Richard Reich (rreich@rdrtech.com), Zwane Mwaikambo, Dave Jones, Charles Filtness; and finally Pulp, for "Intro".
+</para>
+</chapter>
+
+</book>
diff --git a/doc/srcdoc/Doxyfile.in b/doc/srcdoc/Doxyfile.in
new file mode 100644
index 0000000..1f76ff4
--- /dev/null
+++ b/doc/srcdoc/Doxyfile.in
@@ -0,0 +1,184 @@
+# Doxyfile 1.2.13-20020210
+
+#---------------------------------------------------------------------------
+# General configuration options
+#---------------------------------------------------------------------------
+PROJECT_NAME = @PACKAGE@
+PROJECT_NUMBER = @VERSION@
+OUTPUT_DIRECTORY =
+OUTPUT_LANGUAGE = English
+EXTRACT_ALL = YES
+EXTRACT_PRIVATE = NO
+EXTRACT_STATIC = NO
+EXTRACT_LOCAL_CLASSES = YES
+HIDE_UNDOC_MEMBERS = NO
+HIDE_UNDOC_CLASSES = NO
+BRIEF_MEMBER_DESC = YES
+REPEAT_BRIEF = YES
+ALWAYS_DETAILED_SEC = NO
+INLINE_INHERITED_MEMB = NO
+FULL_PATH_NAMES = NO
+STRIP_FROM_PATH =
+INTERNAL_DOCS = NO
+STRIP_CODE_COMMENTS = NO
+CASE_SENSE_NAMES = YES
+SHORT_NAMES = NO
+HIDE_SCOPE_NAMES = NO
+VERBATIM_HEADERS = YES
+SHOW_INCLUDE_FILES = YES
+JAVADOC_AUTOBRIEF = YES
+INHERIT_DOCS = YES
+INLINE_INFO = YES
+SORT_MEMBER_DOCS = YES
+DISTRIBUTE_GROUP_DOC = NO
+TAB_SIZE = 8
+GENERATE_TODOLIST = NO
+GENERATE_TESTLIST = NO
+GENERATE_BUGLIST = NO
+ALIASES =
+ENABLED_SECTIONS =
+MAX_INITIALIZER_LINES = 30
+OPTIMIZE_OUTPUT_FOR_C = NO
+OPTIMIZE_OUTPUT_JAVA = NO
+SHOW_USED_FILES = YES
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET = NO
+WARNINGS = YES
+WARN_IF_UNDOCUMENTED = YES
+WARN_FORMAT = "$file:$line: $text"
+WARN_LOGFILE =
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT = ../../
+FILE_PATTERNS = *.cpp *.c *.h
+RECURSIVE = YES
+EXCLUDE = ../../module
+EXCLUDE_SYMLINKS = NO
+EXCLUDE_PATTERNS = *.moc.cpp *.moc.h oprof_start.base.cpp
+EXAMPLE_PATH =
+EXAMPLE_PATTERNS =
+EXAMPLE_RECURSIVE = NO
+IMAGE_PATH =
+INPUT_FILTER =
+FILTER_SOURCE_FILES = NO
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER = NO
+INLINE_SOURCES = NO
+REFERENCED_BY_RELATION = YES
+REFERENCES_RELATION = YES
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX = NO
+COLS_IN_ALPHA_INDEX = 5
+IGNORE_PREFIX =
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML = YES
+HTML_OUTPUT = html
+HTML_FILE_EXTENSION = .html
+HTML_HEADER =
+HTML_FOOTER =
+HTML_STYLESHEET =
+HTML_ALIGN_MEMBERS = YES
+GENERATE_HTMLHELP = NO
+GENERATE_CHI = NO
+BINARY_TOC = NO
+TOC_EXPAND = NO
+DISABLE_INDEX = NO
+ENUM_VALUES_PER_LINE = 4
+GENERATE_TREEVIEW = NO
+TREEVIEW_WIDTH = 250
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX = NO
+LATEX_OUTPUT = latex
+LATEX_CMD_NAME = latex
+MAKEINDEX_CMD_NAME = makeindex
+COMPACT_LATEX = NO
+PAPER_TYPE = a4wide
+EXTRA_PACKAGES =
+LATEX_HEADER =
+PDF_HYPERLINKS = NO
+USE_PDFLATEX = NO
+LATEX_BATCHMODE = NO
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF = NO
+RTF_OUTPUT = rtf
+COMPACT_RTF = NO
+RTF_HYPERLINKS = NO
+RTF_STYLESHEET_FILE =
+RTF_EXTENSIONS_FILE =
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN = NO
+MAN_OUTPUT = man
+MAN_EXTENSION = .3
+MAN_LINKS = NO
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML = NO
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF = NO
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING = YES
+MACRO_EXPANSION = YES
+EXPAND_ONLY_PREDEF = YES
+SEARCH_INCLUDES = YES
+INCLUDE_PATH =
+INCLUDE_FILE_PATTERNS =
+PREDEFINED =
+EXPAND_AS_DEFINED =
+SKIP_FUNCTION_MACROS = YES
+#---------------------------------------------------------------------------
+# Configuration::addtions related to external references
+#---------------------------------------------------------------------------
+TAGFILES =
+GENERATE_TAGFILE =
+ALLEXTERNALS = NO
+EXTERNAL_GROUPS = YES
+PERL_PATH = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS = YES
+HAVE_DOT = YES
+CLASS_GRAPH = YES
+COLLABORATION_GRAPH = YES
+TEMPLATE_RELATIONS = YES
+HIDE_UNDOC_RELATIONS = YES
+INCLUDE_GRAPH = YES
+INCLUDED_BY_GRAPH = YES
+GRAPHICAL_HIERARCHY = YES
+DOT_IMAGE_FORMAT = png
+DOT_PATH =
+DOTFILE_DIRS =
+MAX_DOT_GRAPH_WIDTH = 1024
+MAX_DOT_GRAPH_HEIGHT = 1024
+GENERATE_LEGEND = YES
+DOT_CLEANUP = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+SEARCHENGINE = NO
+#CGI_NAME = search.cgi
+#CGI_URL =
+#DOC_URL =
+#DOC_ABSPATH =
+#BIN_ABSPATH = /usr/local/bin/
+#EXT_DOC_PATHS =
diff --git a/doc/srcdoc/Makefile b/doc/srcdoc/Makefile
new file mode 100644
index 0000000..e848669
--- /dev/null
+++ b/doc/srcdoc/Makefile
@@ -0,0 +1,9 @@
+DOXYGEN=doxygen
+
+.PHONY: clean
+
+all: clean
+ doxygen Doxyfile
+
+clean:
+ rm -rf html/
diff --git a/doc/xsl/catalog-1.xml.in b/doc/xsl/catalog-1.xml.in
new file mode 100644
index 0000000..6ab6e7a
--- /dev/null
+++ b/doc/xsl/catalog-1.xml.in
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<!DOCTYPE catalog PUBLIC "-//OASIS/DTD Entity Resolution XML Catalog V1.0//EN"
+ "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
+
+<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
+ <nextCatalog catalog="@XML_CATALOG@" />
+
+ @CAT_ENTRY_START@
+ <uri name="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"
+ uri="@DOCBOOK_ROOT@/xhtml/docbook.xsl"/>
+ <uri name="http://docbook.sourceforge.net/release/xsl/current/xhtml/chunk.xsl"
+ uri="@DOCBOOK_ROOT@/xhtml/chunk.xsl"/>
+ @CAT_ENTRY_END@
+
+ <uri name="xsl/xhtml-common.xsl" uri="@top_srcdir@/doc/xsl/xhtml-common.xsl"/>
+</catalog>
diff --git a/doc/xsl/xhtml-chunk.xsl b/doc/xsl/xhtml-chunk.xsl
new file mode 100644
index 0000000..b3320e8
--- /dev/null
+++ b/doc/xsl/xhtml-chunk.xsl
@@ -0,0 +1,52 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version="1.0">
+<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/chunk.xsl"/>
+<xsl:import href="xhtml-common.xsl"/>
+
+<xsl:template name="process-chunk">
+ <xsl:param name="prev" select="."/>
+ <xsl:param name="next" select="."/>
+
+ <xsl:variable name="ischunk">
+ <xsl:call-template name="chunk"/>
+ </xsl:variable>
+
+ <xsl:variable name="chunkfn">
+ <xsl:if test="$ischunk='1'">
+ <xsl:apply-templates mode="chunk-filename" select="."/>
+ </xsl:if>
+ </xsl:variable>
+
+ <xsl:if test="$ischunk='0'">
+ <xsl:message>
+ <xsl:text>Error </xsl:text>
+ <xsl:value-of select="name(.)"/>
+ <xsl:text> is not a chunk!</xsl:text>
+ </xsl:message>
+ </xsl:if>
+
+ <xsl:variable name="filename">
+ <xsl:call-template name="make-relative-filename">
+ <xsl:with-param name="base.dir" select="$base.dir"/>
+ <xsl:with-param name="base.name" select="$chunkfn"/>
+ </xsl:call-template>
+ </xsl:variable>
+
+<!-- FIXME: use Strict when the problems with width on td/th are
+ sorted out. Not yet. -->
+ <xsl:call-template name="write.chunk.with.doctype">
+ <xsl:with-param name="filename" select="$filename"/>
+ <xsl:with-param name="indent" select="'yes'"/>
+ <xsl:with-param name="doctype-public">-//W3C//DTD XHTML 1.0 Transitional//EN</xsl:with-param>
+ <xsl:with-param name="doctype-system">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</xsl:with-param>
+ <xsl:with-param name="content">
+ <xsl:call-template name="chunk-element-content">
+ <xsl:with-param name="prev" select="$prev"/>
+ <xsl:with-param name="next" select="$next"/>
+ </xsl:call-template>
+ </xsl:with-param>
+ </xsl:call-template>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/doc/xsl/xhtml-common.xsl b/doc/xsl/xhtml-common.xsl
new file mode 100644
index 0000000..99f2bf7
--- /dev/null
+++ b/doc/xsl/xhtml-common.xsl
@@ -0,0 +1,55 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version="1.0">
+
+<xsl:param name="use.id.as.filename" select="1"/>
+<xsl:param name="section.autolabel" select="1"/>
+<xsl:param name="chapter.autolabel" select="1"/>
+<xsl:param name="ulink.target" select="''"/>
+
+<xsl:param name="version"/>
+<xsl:template match="oprofileversion">
+ <xsl:value-of select="$version"/>
+</xsl:template>
+
+<!-- Custom template for programlisting, screen and synopsis to generate a gray
+ background to the item. -->
+<xsl:template match="programlisting|screen|synopsis">
+ <xsl:param name="suppress-numbers" select="'0'"/>
+ <xsl:variable name="vendor" select="system-property('xsl:vendor')"/>
+ <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
+
+ <xsl:if test="@id">
+ <a href="{$id}"/>
+ </xsl:if>
+
+ <xsl:choose>
+ <xsl:when test="$suppress-numbers = '0'
+ and @linenumbering = 'numbered'
+ and $use.extensions != '0'
+ and $linenumbering.extension != '0'">
+ <xsl:variable name="rtf">
+ <xsl:apply-templates/>
+ </xsl:variable>
+ <!-- Change the color background color in the line below. -->
+ <table border="0" style="background: #E0E0E0;" width="90%">
+ <tr><td>
+ <pre class="{name(.)}">
+ <xsl:call-template name="number.rtf.lines">
+ <xsl:with-param name="rtf" select="$rtf"/>
+ </xsl:call-template>
+ </pre>
+ </td></tr></table>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- Change the color background color in the line below. -->
+ <table border="0" style="background: #E0E0E0;" width="90%">
+ <tr><td>
+ <pre class="{name(.)}">
+ <xsl:apply-templates/>
+ </pre>
+ </td></tr></table>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/doc/xsl/xhtml.xsl b/doc/xsl/xhtml.xsl
new file mode 100644
index 0000000..31217a6
--- /dev/null
+++ b/doc/xsl/xhtml.xsl
@@ -0,0 +1,13 @@
+<?xml version='1.0'?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" version="1.0">
+
+<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"/>
+<xsl:import href="xhtml-common.xsl"/>
+
+<xsl:output method="xml" encoding="ISO-8859-1" indent="yes"
+doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
+doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
+/>
+
+</xsl:stylesheet>
diff --git a/events/Makefile.am b/events/Makefile.am
new file mode 100644
index 0000000..aaaacb7
--- /dev/null
+++ b/events/Makefile.am
@@ -0,0 +1,83 @@
+event_files = \
+ alpha/ev4/events alpha/ev4/unit_masks \
+ alpha/ev5/events alpha/ev5/unit_masks \
+ alpha/ev67/events alpha/ev67/unit_masks \
+ alpha/ev6/events alpha/ev6/unit_masks \
+ alpha/pca56/events alpha/pca56/unit_masks \
+ i386/athlon/events i386/athlon/unit_masks \
+ i386/core_2/events i386/core_2/unit_masks \
+ i386/p4/events i386/p4-ht/events \
+ i386/p4-ht/unit_masks i386/p4/unit_masks \
+ i386/pii/events i386/pii/unit_masks \
+ i386/piii/events i386/piii/unit_masks \
+ i386/ppro/events i386/ppro/unit_masks \
+ i386/p6_mobile/events i386/p6_mobile/unit_masks \
+ i386/core/events i386/core/unit_masks \
+ i386/arch_perfmon/events i386/arch_perfmon/unit_masks \
+ i386/atom/events i386/atom/unit_masks \
+ i386/core_i7/events i386/core_i7/unit_masks \
+ i386/nehalem/events i386/nehalem/unit_masks \
+ ia64/ia64/events ia64/ia64/unit_masks \
+ ia64/itanium2/events ia64/itanium2/unit_masks \
+ ia64/itanium/events ia64/itanium/unit_masks \
+ ppc64/power4/events ppc64/power4/event_mappings ppc64/power4/unit_masks \
+ ppc64/power5/events ppc64/power5/event_mappings ppc64/power5/unit_masks \
+ ppc64/power5+/events ppc64/power5+/event_mappings ppc64/power5+/unit_masks \
+ ppc64/power5++/events ppc64/power5++/event_mappings ppc64/power5++/unit_masks \
+ ppc64/power6/events ppc64/power6/event_mappings ppc64/power6/unit_masks \
+ ppc64/power7/events ppc64/power7/event_mappings ppc64/power7/unit_masks \
+ ppc64/970/events ppc64/970/event_mappings ppc64/970/unit_masks \
+ ppc64/970MP/events ppc64/970MP/event_mappings ppc64/970MP/unit_masks \
+ ppc64/ibm-compat-v1/events ppc64/ibm-compat-v1/event_mappings ppc64/ibm-compat-v1/unit_masks \
+ ppc64/pa6t/events ppc64/pa6t/event_mappings ppc64/pa6t/unit_masks \
+ ppc64/cell-be/events ppc64/cell-be/unit_masks \
+ rtc/events rtc/unit_masks \
+ x86-64/hammer/events x86-64/hammer/unit_masks \
+ x86-64/family10/events x86-64/family10/unit_masks \
+ x86-64/family11h/events x86-64/family11h/unit_masks \
+ arm/xscale1/events arm/xscale1/unit_masks \
+ arm/xscale2/events arm/xscale2/unit_masks \
+ arm/armv6/events arm/armv6/unit_masks \
+ arm/armv7/events arm/armv7/unit_masks \
+ arm/mpcore/events arm/mpcore/unit_masks \
+ avr32/events avr32/unit_masks \
+ mips/20K/events mips/20K/unit_masks \
+ mips/24K/events mips/24K/unit_masks \
+ mips/25K/events mips/25K/unit_masks \
+ mips/34K/events mips/34K/unit_masks \
+ mips/5K/events mips/5K/unit_masks \
+ mips/rm7000/events mips/rm7000/unit_masks \
+ mips/rm9000/events mips/rm9000/unit_masks \
+ mips/sb1/events mips/sb1/unit_masks \
+ mips/r10000/events mips/r10000/unit_masks \
+ mips/r12000/events mips/r12000/unit_masks \
+ mips/vr5432/events mips/vr5432/unit_masks \
+ mips/vr5500/events mips/vr5500/unit_masks \
+ ppc/7450/events ppc/7450/unit_masks \
+ ppc/e500/events ppc/e500/unit_masks \
+ ppc/e500v2/events ppc/e500v2/unit_masks \
+ ppc/e300/events ppc/e300/unit_masks
+
+install-data-local:
+ for i in ${event_files} ; do \
+ dir=`dirname $$i` ; \
+ mkdir -p $(DESTDIR)$(pkgdatadir)/$$dir ; \
+ $(INSTALL_DATA) $(top_srcdir)/events/$$i $(DESTDIR)$(pkgdatadir)/$$i ; \
+ done
+
+uninstall-local:
+ for i in ${event_files} ; do \
+ dir=`dirname $$i` ; \
+ archdir=`dirname $$dir` ; \
+ if test -f $(DESTDIR)$(pkgdatadir)/$$i ; then \
+ rm $(DESTDIR)$(pkgdatadir)/$$i ; \
+ fi; \
+ if test -d $(DESTDIR)$(pkgdatadir)/$$dir ; then \
+ rmdir --ignore-fail-on-non-empty $(DESTDIR)$(pkgdatadir)/$$dir ; \
+ fi; \
+ if test $$archdir != "." -a -d $(DESTDIR)$(pkgdatadir)/$$archdir ; then \
+ rmdir --ignore-fail-on-non-empty $(DESTDIR)$(pkgdatadir)/$$archdir ; \
+ fi; \
+ done
+
+EXTRA_DIST = $(event_files)
diff --git a/events/Makefile.in b/events/Makefile.in
new file mode 100644
index 0000000..ce7c3b3
--- /dev/null
+++ b/events/Makefile.in
@@ -0,0 +1,450 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = events
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/binutils.m4 \
+ $(top_srcdir)/m4/builtinexpect.m4 \
+ $(top_srcdir)/m4/cellspubfdsupport.m4 \
+ $(top_srcdir)/m4/compileroption.m4 \
+ $(top_srcdir)/m4/configmodule.m4 \
+ $(top_srcdir)/m4/copyifchange.m4 $(top_srcdir)/m4/docbook.m4 \
+ $(top_srcdir)/m4/extradirs.m4 $(top_srcdir)/m4/findkernel.m4 \
+ $(top_srcdir)/m4/kerneloption.m4 \
+ $(top_srcdir)/m4/kernelversion.m4 \
+ $(top_srcdir)/m4/mallocattribute.m4 \
+ $(top_srcdir)/m4/poptconst.m4 \
+ $(top_srcdir)/m4/precompiledheader.m4 $(top_srcdir)/m4/qt.m4 \
+ $(top_srcdir)/m4/resultyn.m4 $(top_srcdir)/m4/sstream.m4 \
+ $(top_srcdir)/m4/typedef.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFD_LIBS = @BFD_LIBS@
+BUILD_JVMPI_AGENT_FALSE = @BUILD_JVMPI_AGENT_FALSE@
+BUILD_JVMPI_AGENT_TRUE = @BUILD_JVMPI_AGENT_TRUE@
+BUILD_JVMTI_AGENT_FALSE = @BUILD_JVMTI_AGENT_FALSE@
+BUILD_JVMTI_AGENT_TRUE = @BUILD_JVMTI_AGENT_TRUE@
+CAT_ENTRY_END = @CAT_ENTRY_END@
+CAT_ENTRY_START = @CAT_ENTRY_START@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOCBOOK_ROOT = @DOCBOOK_ROOT@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+EXTRA_CFLAGS_MODULE = @EXTRA_CFLAGS_MODULE@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAVA_HOMEDIR = @JAVA_HOMEDIR@
+KINC = @KINC@
+KSRC = @KSRC@
+KVERS = @KVERS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBERTY_LIBS = @LIBERTY_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MOC = @MOC@
+MODINSTALLDIR = @MODINSTALLDIR@
+OBJEXT = @OBJEXT@
+OPROFILE_DIR = @OPROFILE_DIR@
+OPROFILE_MODULE_ARCH = @OPROFILE_MODULE_ARCH@
+OP_CFLAGS = @OP_CFLAGS@
+OP_CXXFLAGS = @OP_CXXFLAGS@
+OP_DOCDIR = @OP_DOCDIR@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POPT_LIBS = @POPT_LIBS@
+PTRDIFF_T_TYPE = @PTRDIFF_T_TYPE@
+QT_INCLUDES = @QT_INCLUDES@
+QT_LDFLAGS = @QT_LDFLAGS@
+QT_LIB = @QT_LIB@
+QT_VERSION = @QT_VERSION@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIZE_T_TYPE = @SIZE_T_TYPE@
+STRIP = @STRIP@
+UIC = @UIC@
+VERSION = @VERSION@
+XML_CATALOG = @XML_CATALOG@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+have_qt_FALSE = @have_qt_FALSE@
+have_qt_TRUE = @have_qt_TRUE@
+have_xsltproc_FALSE = @have_xsltproc_FALSE@
+have_xsltproc_TRUE = @have_xsltproc_TRUE@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+kernel_support_FALSE = @kernel_support_FALSE@
+kernel_support_TRUE = @kernel_support_TRUE@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+topdir = @topdir@
+event_files = \
+ alpha/ev4/events alpha/ev4/unit_masks \
+ alpha/ev5/events alpha/ev5/unit_masks \
+ alpha/ev67/events alpha/ev67/unit_masks \
+ alpha/ev6/events alpha/ev6/unit_masks \
+ alpha/pca56/events alpha/pca56/unit_masks \
+ i386/athlon/events i386/athlon/unit_masks \
+ i386/core_2/events i386/core_2/unit_masks \
+ i386/p4/events i386/p4-ht/events \
+ i386/p4-ht/unit_masks i386/p4/unit_masks \
+ i386/pii/events i386/pii/unit_masks \
+ i386/piii/events i386/piii/unit_masks \
+ i386/ppro/events i386/ppro/unit_masks \
+ i386/p6_mobile/events i386/p6_mobile/unit_masks \
+ i386/core/events i386/core/unit_masks \
+ i386/arch_perfmon/events i386/arch_perfmon/unit_masks \
+ i386/atom/events i386/atom/unit_masks \
+ i386/core_i7/events i386/core_i7/unit_masks \
+ i386/nehalem/events i386/nehalem/unit_masks \
+ ia64/ia64/events ia64/ia64/unit_masks \
+ ia64/itanium2/events ia64/itanium2/unit_masks \
+ ia64/itanium/events ia64/itanium/unit_masks \
+ ppc64/power4/events ppc64/power4/event_mappings ppc64/power4/unit_masks \
+ ppc64/power5/events ppc64/power5/event_mappings ppc64/power5/unit_masks \
+ ppc64/power5+/events ppc64/power5+/event_mappings ppc64/power5+/unit_masks \
+ ppc64/power5++/events ppc64/power5++/event_mappings ppc64/power5++/unit_masks \
+ ppc64/power6/events ppc64/power6/event_mappings ppc64/power6/unit_masks \
+ ppc64/power7/events ppc64/power7/event_mappings ppc64/power7/unit_masks \
+ ppc64/970/events ppc64/970/event_mappings ppc64/970/unit_masks \
+ ppc64/970MP/events ppc64/970MP/event_mappings ppc64/970MP/unit_masks \
+ ppc64/ibm-compat-v1/events ppc64/ibm-compat-v1/event_mappings ppc64/ibm-compat-v1/unit_masks \
+ ppc64/pa6t/events ppc64/pa6t/event_mappings ppc64/pa6t/unit_masks \
+ ppc64/cell-be/events ppc64/cell-be/unit_masks \
+ rtc/events rtc/unit_masks \
+ x86-64/hammer/events x86-64/hammer/unit_masks \
+ x86-64/family10/events x86-64/family10/unit_masks \
+ x86-64/family11h/events x86-64/family11h/unit_masks \
+ arm/xscale1/events arm/xscale1/unit_masks \
+ arm/xscale2/events arm/xscale2/unit_masks \
+ arm/armv6/events arm/armv6/unit_masks \
+ arm/armv7/events arm/armv7/unit_masks \
+ arm/mpcore/events arm/mpcore/unit_masks \
+ avr32/events avr32/unit_masks \
+ mips/20K/events mips/20K/unit_masks \
+ mips/24K/events mips/24K/unit_masks \
+ mips/25K/events mips/25K/unit_masks \
+ mips/34K/events mips/34K/unit_masks \
+ mips/5K/events mips/5K/unit_masks \
+ mips/rm7000/events mips/rm7000/unit_masks \
+ mips/rm9000/events mips/rm9000/unit_masks \
+ mips/sb1/events mips/sb1/unit_masks \
+ mips/r10000/events mips/r10000/unit_masks \
+ mips/r12000/events mips/r12000/unit_masks \
+ mips/vr5432/events mips/vr5432/unit_masks \
+ mips/vr5500/events mips/vr5500/unit_masks \
+ ppc/7450/events ppc/7450/unit_masks \
+ ppc/e500/events ppc/e500/unit_masks \
+ ppc/e500v2/events ppc/e500v2/unit_masks \
+ ppc/e300/events ppc/e300/unit_masks
+
+EXTRA_DIST = $(event_files)
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign events/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign events/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ $(mkdir_p) $(distdir)/alpha/ev4 $(distdir)/alpha/ev5 $(distdir)/alpha/ev6 $(distdir)/alpha/ev67 $(distdir)/alpha/pca56 $(distdir)/arm/armv6 $(distdir)/arm/armv7 $(distdir)/arm/mpcore $(distdir)/arm/xscale1 $(distdir)/arm/xscale2 $(distdir)/avr32 $(distdir)/i386/arch_perfmon $(distdir)/i386/athlon $(distdir)/i386/atom $(distdir)/i386/core $(distdir)/i386/core_2 $(distdir)/i386/core_i7 $(distdir)/i386/nehalem $(distdir)/i386/p4 $(distdir)/i386/p4-ht $(distdir)/i386/p6_mobile $(distdir)/i386/pii $(distdir)/i386/piii $(distdir)/i386/ppro $(distdir)/ia64/ia64 $(distdir)/ia64/itanium $(distdir)/ia64/itanium2 $(distdir)/mips/20K $(distdir)/mips/24K $(distdir)/mips/25K $(distdir)/mips/34K $(distdir)/mips/5K $(distdir)/mips/r10000 $(distdir)/mips/r12000 $(distdir)/mips/rm7000 $(distdir)/mips/rm9000 $(distdir)/mips/sb1 $(distdir)/mips/vr5432 $(distdir)/mips/vr5500 $(distdir)/ppc/7450 $(distdir)/ppc/e300 $(distdir)/ppc/e500 $(distdir)/ppc/e500v2 $(distdir)/ppc64/970 $(distdir)/ppc64/970MP $(distdir)/ppc64/cell-be $(distdir)/ppc64/ibm-compat-v1 $(distdir)/ppc64/pa6t $(distdir)/ppc64/power4 $(distdir)/ppc64/power5 $(distdir)/ppc64/power5+ $(distdir)/ppc64/power5++ $(distdir)/ppc64/power6 $(distdir)/ppc64/power7 $(distdir)/rtc $(distdir)/x86-64/family10 $(distdir)/x86-64/family11h $(distdir)/x86-64/hammer
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-data-local
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-local
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ distclean distclean-generic distclean-libtool distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-data-local install-exec \
+ install-exec-am install-info install-info-am install-man \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ uninstall uninstall-am uninstall-info-am uninstall-local
+
+
+install-data-local:
+ for i in ${event_files} ; do \
+ dir=`dirname $$i` ; \
+ mkdir -p $(DESTDIR)$(pkgdatadir)/$$dir ; \
+ $(INSTALL_DATA) $(top_srcdir)/events/$$i $(DESTDIR)$(pkgdatadir)/$$i ; \
+ done
+
+uninstall-local:
+ for i in ${event_files} ; do \
+ dir=`dirname $$i` ; \
+ archdir=`dirname $$dir` ; \
+ if test -f $(DESTDIR)$(pkgdatadir)/$$i ; then \
+ rm $(DESTDIR)$(pkgdatadir)/$$i ; \
+ fi; \
+ if test -d $(DESTDIR)$(pkgdatadir)/$$dir ; then \
+ rmdir --ignore-fail-on-non-empty $(DESTDIR)$(pkgdatadir)/$$dir ; \
+ fi; \
+ if test $$archdir != "." -a -d $(DESTDIR)$(pkgdatadir)/$$archdir ; then \
+ rmdir --ignore-fail-on-non-empty $(DESTDIR)$(pkgdatadir)/$$archdir ; \
+ fi; \
+ done
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/events/arm/armv6/events b/events/arm/armv6/events
new file mode 100644
index 0000000..d885118
--- /dev/null
+++ b/events/arm/armv6/events
@@ -0,0 +1,23 @@
+# ARM V6 events
+#
+event:0x00 counters:0,1 um:zero minimum:500 name:IFU_IFETCH_MISS : number of instruction fetch misses
+event:0x01 counters:0,1 um:zero minimum:500 name:CYCLES_IFU_MEM_STALL : cycles instruction fetch pipe is stalled
+event:0x02 counters:0,1 um:zero minimum:500 name:CYCLES_DATA_STALL : cycles stall occurs for due to data dependency
+event:0x03 counters:0,1 um:zero minimum:500 name:ITLB_MISS : number of Instruction MicroTLB misses
+event:0x04 counters:0,1 um:zero minimum:500 name:DTLB_MISS : number of Data MicroTLB misses
+event:0x05 counters:0,1 um:zero minimum:500 name:BR_INST_EXECUTED : branch instruction executed w/ or w/o program flow change
+event:0x06 counters:0,1 um:zero minimum:500 name:BR_INST_MISS_PRED : branch mispredicted
+event:0x07 counters:0,1 um:zero minimum:500 name:INSN_EXECUTED : instructions executed
+event:0x09 counters:0,1 um:zero minimum:500 name:DCACHE_ACCESS : data cache access, cacheable locations
+event:0x0a counters:0,1 um:zero minimum:500 name:DCACHE_ACCESS_ALL : data cache access, all locations
+event:0x0b counters:0,1 um:zero minimum:500 name:DCACHE_MISS : data cache miss
+event:0x0c counters:0,1 um:zero minimum:500 name:DCACHE_WB : data cache writeback, 1 event for every half cacheline
+event:0x0d counters:0,1 um:zero minimum:500 name:PC_CHANGE : number of times the program counter was changed without a mode switch
+event:0x0f counters:0,1 um:zero minimum:500 name:TLB_MISS : Main TLB miss
+event:0x10 counters:0,1 um:zero minimum:500 name:EXP_EXTERNAL : Explict external data access
+event:0x11 counters:0,1 um:zero minimum:500 name:LSU_STALL : cycles stalled because Load Store request queque is full
+event:0x12 counters:0,1 um:zero minimum:500 name:WRITE_DRAIN : Times write buffer was drained
+event:0x20 counters:0,1 um:zero minimum:500 name:ETMEXTOUT0 : nuber of cycles ETMEXTOUT[0] signal was asserted
+event:0x21 counters:0,1 um:zero minimum:500 name:ETMEXTOUT1 : nuber of cycles ETMEXTOUT[1] signal was asserted
+event:0x22 counters:0,1 um:zero minimum:500 name:ETMEXTOUT_BOTH : nuber of cycles both ETMEXTOUT [0] and [1] were asserted * 2
+event:0xff counters:0,1,2 um:zero minimum:500 name:CPU_CYCLES : clock cycles counter
diff --git a/events/arm/armv6/unit_masks b/events/arm/armv6/unit_masks
new file mode 100644
index 0000000..4add7e4
--- /dev/null
+++ b/events/arm/armv6/unit_masks
@@ -0,0 +1,4 @@
+# ARM V6 PMU possible unit masks
+#
+name:zero type:mandatory default:0x00
+ 0x00 No unit mask
diff --git a/events/arm/armv7/events b/events/arm/armv7/events
new file mode 100644
index 0000000..ffecf2b
--- /dev/null
+++ b/events/arm/armv7/events
@@ -0,0 +1,53 @@
+# ARM V7 events
+# From Cortex A8 DDI (ARM DDI 0344B, revision r1p1)
+#
+event:0x00 counters:1,2,3,4 um:zero minimum:500 name:PMNC_SW_INCR : Software increment of PMNC registers
+event:0x01 counters:1,2,3,4 um:zero minimum:500 name:IFETCH_MISS : Instruction fetch misses from cache or normal cacheable memory
+event:0x02 counters:1,2,3,4 um:zero minimum:500 name:ITLB_MISS : Instruction fetch misses from TLB
+event:0x03 counters:1,2,3,4 um:zero minimum:500 name:DCACHE_REFILL : Data R/W operation that causes a refill from cache or normal cacheable memory
+event:0x04 counters:1,2,3,4 um:zero minimum:500 name:DCACHE_ACCESS : Data R/W from cache
+event:0x05 counters:1,2,3,4 um:zero minimum:500 name:DTLB_REFILL : Data R/W that causes a TLB refill
+event:0x06 counters:1,2,3,4 um:zero minimum:500 name:DREAD : Data read architecturally executed (note: architecturally executed = for instructions that are unconditional or that pass the condition code)
+event:0x07 counters:1,2,3,4 um:zero minimum:500 name:DWRITE : Data write architecturally executed
+event:0x08 counters:1,2,3,4 um:zero minimum:500 name:INSTR_EXECUTED : All executed instructions
+event:0x09 counters:1,2,3,4 um:zero minimum:500 name:EXC_TAKEN : Exception taken
+event:0x0A counters:1,2,3,4 um:zero minimum:500 name:EXC_EXECUTED : Exception return architecturally executed
+event:0x0B counters:1,2,3,4 um:zero minimum:500 name:CID_WRITE : Instruction that writes to the Context ID Register architecturally executed
+event:0x0C counters:1,2,3,4 um:zero minimum:500 name:PC_WRITE : SW change of PC, architecturally executed (not by exceptions)
+event:0x0D counters:1,2,3,4 um:zero minimum:500 name:PC_IMM_BRANCH : Immediate branch instruction executed (taken or not)
+event:0x0E counters:1,2,3,4 um:zero minimum:500 name:PC_PROC_RETURN : Procedure return architecturally executed (not by exceptions)
+event:0x0F counters:1,2,3,4 um:zero minimum:500 name:UNALIGNED_ACCESS : Unaligned access architecturally executed
+event:0x10 counters:1,2,3,4 um:zero minimum:500 name:PC_BRANCH_MIS_PRED : Branch mispredicted or not predicted. Counts pipeline flushes because of misprediction
+event:0x12 counters:1,2,3,4 um:zero minimum:500 name:PC_BRANCH_MIS_USED : Branch or change in program flow that could have been predicted
+event:0x40 counters:1,2,3,4 um:zero minimum:500 name:WRITE_BUFFER_FULL : Any write buffer full cycle
+event:0x41 counters:1,2,3,4 um:zero minimum:500 name:L2_STORE_MERGED : Any store that is merged in L2 cache
+event:0x42 counters:1,2,3,4 um:zero minimum:500 name:L2_STORE_BUFF : Any bufferable store from load/store to L2 cache
+event:0x43 counters:1,2,3,4 um:zero minimum:500 name:L2_ACCESS : Any access to L2 cache
+event:0x44 counters:1,2,3,4 um:zero minimum:500 name:L2_CACH_MISS : Any cacheable miss in L2 cache
+event:0x45 counters:1,2,3,4 um:zero minimum:500 name:AXI_READ_CYCLES : Number of cycles for an active AXI read
+event:0x46 counters:1,2,3,4 um:zero minimum:500 name:AXI_WRITE_CYCLES : Number of cycles for an active AXI write
+event:0x47 counters:1,2,3,4 um:zero minimum:500 name:MEMORY_REPLAY : Any replay event in the memory subsystem
+event:0x48 counters:1,2,3,4 um:zero minimum:500 name:UNALIGNED_ACCESS_REPLAY : Unaligned access that causes a replay
+event:0x49 counters:1,2,3,4 um:zero minimum:500 name:L1_DATA_MISS : L1 data cache miss as a result of the hashing algorithm
+event:0x4A counters:1,2,3,4 um:zero minimum:500 name:L1_INST_MISS : L1 instruction cache miss as a result of the hashing algorithm
+event:0x4B counters:1,2,3,4 um:zero minimum:500 name:L1_DATA_COLORING : L1 data access in which a page coloring alias occurs
+event:0x4C counters:1,2,3,4 um:zero minimum:500 name:L1_NEON_DATA : NEON data access that hits L1 cache
+event:0x4D counters:1,2,3,4 um:zero minimum:500 name:L1_NEON_CACH_DATA : NEON cacheable data access that hits L1 cache
+event:0x4E counters:1,2,3,4 um:zero minimum:500 name:L2_NEON : L2 access as a result of NEON memory access
+event:0x4F counters:1,2,3,4 um:zero minimum:500 name:L2_NEON_HIT : Any NEON hit in L2 cache
+event:0x50 counters:1,2,3,4 um:zero minimum:500 name:L1_INST : Any L1 instruction cache access, excluding CP15 cache accesses
+event:0x51 counters:1,2,3,4 um:zero minimum:500 name:PC_RETURN_MIS_PRED : Return stack misprediction at return stack pop (incorrect target address)
+event:0x52 counters:1,2,3,4 um:zero minimum:500 name:PC_BRANCH_FAILED : Branch prediction misprediction
+event:0x53 counters:1,2,3,4 um:zero minimum:500 name:PC_BRANCH_TAKEN : Any predicted branch that is taken
+event:0x54 counters:1,2,3,4 um:zero minimum:500 name:PC_BRANCH_EXECUTED : Any taken branch that is executed
+event:0x55 counters:1,2,3,4 um:zero minimum:500 name:OP_EXECUTED : Number of operations executed (in instruction or mutli-cycle instruction)
+event:0x56 counters:1,2,3,4 um:zero minimum:500 name:CYCLES_INST_STALL : Cycles where no instruction available
+event:0x57 counters:1,2,3,4 um:zero minimum:500 name:CYCLES_INST : Number of instructions issued in a cycle
+event:0x58 counters:1,2,3,4 um:zero minimum:500 name:CYCLES_NEON_DATA_STALL : Number of cycles the processor waits on MRC data from NEON
+event:0x59 counters:1,2,3,4 um:zero minimum:500 name:CYCLES_NEON_INST_STALL : Number of cycles the processor waits on NEON instruction queue or NEON load queue
+event:0x5A counters:1,2,3,4 um:zero minimum:500 name:NEON_CYCLES : Number of cycles NEON and integer processors are not idle
+event:0x70 counters:1,2,3,4 um:zero minimum:500 name:PMU0_EVENTS : Number of events from external input source PMUEXTIN[0]
+event:0x71 counters:1,2,3,4 um:zero minimum:500 name:PMU1_EVENTS : Number of events from external input source PMUEXTIN[1]
+event:0x72 counters:1,2,3,4 um:zero minimum:500 name:PMU_EVENTS : Number of events from both external input sources PMUEXTIN[0] and PMUEXTIN[1]
+event:0xFF counters:0 um:zero minimum:500 name:CPU_CYCLES : Number of CPU cycles
+
diff --git a/events/arm/armv7/unit_masks b/events/arm/armv7/unit_masks
new file mode 100644
index 0000000..4027469
--- /dev/null
+++ b/events/arm/armv7/unit_masks
@@ -0,0 +1,4 @@
+# ARM V7 PMNC possible unit masks
+#
+name:zero type:mandatory default:0x00
+ 0x00 No unit mask
diff --git a/events/arm/mpcore/events b/events/arm/mpcore/events
new file mode 100644
index 0000000..3806cf9
--- /dev/null
+++ b/events/arm/mpcore/events
@@ -0,0 +1,28 @@
+# MPCore events
+#
+event:0x00 counters:0,1 um:zero minimum:500 name:IFU_IFETCH_MISS : number of instruction fetch misses
+event:0x01 counters:0,1 um:zero minimum:500 name:CYCLES_IFU_MEM_STALL : cycles instruction fetch pipe is stalled
+event:0x02 counters:0,1 um:zero minimum:500 name:CYCLES_DATA_STALL : cycles stall occurs for due to data dependency
+event:0x03 counters:0,1 um:zero minimum:500 name:ITLB_MISS : number of ITLB misses
+event:0x04 counters:0,1 um:zero minimum:500 name:DTLB_MISS : number of DTLB misses
+event:0x05 counters:0,1 um:zero minimum:500 name:BR_INST_EXECUTED : branch instruction executed w/ or w/o program flow change
+event:0x06 counters:0,1 um:zero minimum:500 name:BR_INST_NOT_PRED : branch not predicted
+event:0x07 counters:0,1 um:zero minimum:500 name:BR_INST_MISPRED : branch mispredicted
+event:0x08 counters:0,1 um:zero minimum:500 name:INSN_EXECUTED : instruction executed
+event:0x09 counters:0,1 um:zero minimum:500 name:INSN_FOLD_EXECUTED : folded instruction executed
+event:0x0a counters:0,1 um:zero minimum:500 name:DCACHE_ACCESS : data cache read access
+event:0x0b counters:0,1 um:zero minimum:500 name:DCACHE_MISS : data cache miss
+event:0x0c counters:0,1 um:zero minimum:500 name:DCACHE_WA : data cache write access
+event:0x0d counters:0,1 um:zero minimum:500 name:DCACHE_WM : data cache write miss
+event:0x0e counters:0,1 um:zero minimum:500 name:DCACHE_LINE_EV : data cache line eviction
+event:0x0f counters:0,1 um:zero minimum:500 name:SOFT_PC_CHANGE : software changed PC without mode change
+event:0x10 counters:0,1 um:zero minimum:500 name:TLB_MISS : main TLB miss
+event:0x11 counters:0,1 um:zero minimum:500 name:MEM_REQUEST : external memory request (Cache request, write back)
+event:0x12 counters:0,1 um:zero minimum:500 name:LS_QUEUE_FULL : stall because load store unit queue being full
+event:0x13 counters:0,1 um:zero minimum:500 name:LS_QUEUE_DRAINED : number of times store buffer drained
+event:0x14 counters:0,1 um:zero minimum:500 name:LS_QUEUE_WMERGE : buffered write merged into a store buffer slot
+event:0x15 counters:0,1 um:zero minimum:500 name:LS_SAFE_MODE : LSU in safe mode
+event:0xff counters:0,1 um:zero minimum:500 name:CPU_CYCLES : clock cycles counter
+
+#see ARM11 MPCore Techical Reference Manual rev. r1p0, page 3-70
+
diff --git a/events/arm/mpcore/unit_masks b/events/arm/mpcore/unit_masks
new file mode 100644
index 0000000..5f3923a
--- /dev/null
+++ b/events/arm/mpcore/unit_masks
@@ -0,0 +1,4 @@
+# MPCore possible unit masks
+#
+name:zero type:mandatory default:0x00
+ 0x00 No unit mask
diff --git a/events/arm/xscale1/events b/events/arm/xscale1/events
new file mode 100644
index 0000000..459223d
--- /dev/null
+++ b/events/arm/xscale1/events
@@ -0,0 +1,23 @@
+# XScale 1 events
+#
+event:0x00 counters:1,2 um:zero minimum:500 name:IFU_IFETCH_MISS : number of instruction fetch misses
+event:0x01 counters:1,2 um:zero minimum:500 name:CYCLES_IFU_MEM_STALL : cycles instruction fetch pipe is stalled
+event:0x02 counters:1,2 um:zero minimum:500 name:CYCLES_DATA_STALL : cycles stall occurs for due to data dependency
+event:0x03 counters:1,2 um:zero minimum:500 name:ITLB_MISS : number of ITLB misses
+event:0x04 counters:1,2 um:zero minimum:500 name:DTLB_MISS : number of DTLB misses
+event:0x05 counters:1,2 um:zero minimum:500 name:BR_INST_EXECUTED : branch instruction executed w/ or w/o program flow change
+event:0x06 counters:1,2 um:zero minimum:500 name:BR_INST_MISS_PRED : branch mispredicted
+event:0x07 counters:1,2 um:zero minimum:500 name:INSN_EXECUTED : instruction executed
+event:0x08 counters:1,2 um:zero minimum:500 name:CYCLES_DCACHE_FULL_STALL : cycles in stall due to full dcache
+event:0x09 counters:1,1 um:zero minimum:500 name:DCACHE_FULL_STALL_CNT : number of stalls due to dcache full condition
+event:0x0a counters:1,2 um:zero minimum:500 name:DCACHE_ACCESS : data cache access
+event:0x0b counters:1,2 um:zero minimum:500 name:DCACHE_MISS : data cache miss
+event:0x0c counters:1,2 um:zero minimum:500 name:DCACHE_WB : data cache writeback, 1 event for every half cacheline
+event:0x0d counters:1,2 um:zero minimum:500 name:PC_CHANGE : number of times the program counter was changed without a mode switch
+event:0x10 counters:1,2 um:zero minimum:500 name:BCU_REQUEST : number of time the BCU received a new memory request from the core
+event:0x11 counters:1,2 um:zero minimum:500 name:BCU_FULL : number of cycles the BCUs request queue is full
+event:0x12 counters:1,2 um:zero minimum:500 name:BCU_DRAIN : number of times the BCU queues were drained due to a Drain Write Buffer command or an I/O transaction on a non-cacheable and non-bufferable page
+event:0x14 counters:1,2 um:zero minimum:500 name:BCU_ECC_NO_ELOG : number of times the BCU detected an ECC error, but no ELOG register was available in which to log the error
+event:0x15 counters:1,2 um:zero minimum:500 name:BCU_1_BIT_ERR : number of times the BCU detected a 1-bit error while reading data from the bus
+event:0x16 counters:1,2 um:zero minimum:500 name:RMW : number of times an RMW cycle occurred due to narrow write on ECC-protected memory
+event:0xfe counters:0 um:zero minimum:500 name:CPU_CYCLES : clock cycles counter
diff --git a/events/arm/xscale1/unit_masks b/events/arm/xscale1/unit_masks
new file mode 100644
index 0000000..f45eb10
--- /dev/null
+++ b/events/arm/xscale1/unit_masks
@@ -0,0 +1,4 @@
+# XScale 1 possible unit masks
+#
+name:zero type:mandatory default:0x00
+ 0x00 No unit mask
diff --git a/events/arm/xscale2/events b/events/arm/xscale2/events
new file mode 100644
index 0000000..9055ef4
--- /dev/null
+++ b/events/arm/xscale2/events
@@ -0,0 +1,23 @@
+# XScale 2 events
+#
+event:0x00 counters:1,2,3,4 um:zero minimum:500 name:IFU_IFETCH_MISS : number of instruction fetch misses
+event:0x01 counters:1,2,3,4 um:zero minimum:500 name:CYCLES_IFU_MEM_STALL : cycles instruction fetch pipe is stalled
+event:0x02 counters:1,2,3,4 um:zero minimum:500 name:CYCLES_DATA_STALL : cycles stall occurs for due to data dependency
+event:0x03 counters:1,2,3,4 um:zero minimum:500 name:ITLB_MISS : number of ITLB misses
+event:0x04 counters:1,2,3,4 um:zero minimum:500 name:DTLB_MISS : number of DTLB misses
+event:0x05 counters:1,2,3,4 um:zero minimum:500 name:BR_INST_EXECUTED : branch instruction executed w/ or w/o program flow change
+event:0x06 counters:1,2,3,4 um:zero minimum:500 name:BR_INST_MISS_PRED : branch mispredicted
+event:0x07 counters:1,2,3,4 um:zero minimum:500 name:INSN_EXECUTED : instruction executed
+event:0x08 counters:1,2,3,4 um:zero minimum:500 name:CYCLES_DCACHE_FULL_STALL : cycles in stall due to full dcache
+event:0x09 counters:1,2,3,4 um:zero minimum:500 name:DCACHE_FULL_STALL_CNT : number of stalls due to dcache full condition
+event:0x0a counters:1,2,3,4 um:zero minimum:500 name:DCACHE_ACCESS : data cache access
+event:0x0b counters:1,2,3,4 um:zero minimum:500 name:DCACHE_MISS : data cache miss
+event:0x0c counters:1,2,3,4 um:zero minimum:500 name:DCACHE_WB : data cache writeback, 1 event for every half cacheline
+event:0x0d counters:1,2,3,4 um:zero minimum:500 name:PC_CHANGE : number of times the program counter was changed without a mode switch
+event:0x10 counters:1,2,3,4 um:zero minimum:500 name:BCU_REQUEST : number of time the BCU received a new memory request from the core
+event:0x11 counters:1,2,3,4 um:zero minimum:500 name:BCU_FULL : number of cycles the BCUs request queue is full
+event:0x12 counters:1,2,3,4 um:zero minimum:500 name:BCU_DRAIN : number of times the BCU queues were drained due to a Drain Write Buffer command or an I/O transaction on a non-cacheable and non-bufferable page
+event:0x14 counters:1,2,3,4 um:zero minimum:500 name:BCU_ECC_NO_ELOG : number of times the BCU detected an ECC error, but no ELOG register was available in which to log the error
+event:0x15 counters:1,2,3,4 um:zero minimum:500 name:BCU_1_BIT_ERR : number of times the BCU detected a 1-bit error while reading data from the bus
+event:0x16 counters:1,2,3,4 um:zero minimum:500 name:RMW : number of times an RMW cycle occurred due to narrow write on ECC-protected memory
+event:0xfe counters:0 um:zero minimum:500 name:CPU_CYCLES : clock cycles counter
diff --git a/events/arm/xscale2/unit_masks b/events/arm/xscale2/unit_masks
new file mode 100644
index 0000000..437aab5
--- /dev/null
+++ b/events/arm/xscale2/unit_masks
@@ -0,0 +1,4 @@
+# XScale 2 possible unit masks
+#
+name:zero type:mandatory default:0x00
+ 0x00 No unit mask
diff --git a/gui/Makefile.am b/gui/Makefile.am
new file mode 100644
index 0000000..ba5e27c
--- /dev/null
+++ b/gui/Makefile.am
@@ -0,0 +1,43 @@
+SUBDIRS = ui
+
+dist_sources = \
+ oprof_start.cpp \
+ oprof_start_config.cpp \
+ oprof_start_util.cpp \
+ oprof_start_main.cpp \
+ oprof_start.h \
+ oprof_start_config.h \
+ oprof_start_util.h
+
+EXTRA_DIST = $(dist_sources)
+
+if have_qt
+
+AM_CPPFLAGS = \
+ @QT_INCLUDES@ \
+ -I ${top_srcdir}/libop \
+ -I ${top_srcdir}/libutil++ \
+ -I ${top_srcdir}/libutil
+
+AM_CXXFLAGS = @OP_CXXFLAGS@
+
+bin_PROGRAMS = oprof_start
+
+oprof_start_SOURCES = $(dist_sources)
+nodist_oprof_start_SOURCES = oprof_start.moc.cpp
+oprof_start_LDADD = \
+ ../libutil++/libutil++.a \
+ ../libop/libop.a \
+ ../libutil/libutil.a \
+ ui/liboprof_start.a \
+ @QT_LDFLAGS@ \
+ @QT_LIB@ \
+ @X_LIBS@
+
+oprof_start.moc.cpp: ${top_srcdir}/gui/oprof_start.h
+ $(MOC) -o $@ ${top_srcdir}/gui/oprof_start.h
+
+clean-local:
+ rm -f oprof_start.moc.cpp
+
+endif
diff --git a/gui/Makefile.in b/gui/Makefile.in
new file mode 100644
index 0000000..251b9f1
--- /dev/null
+++ b/gui/Makefile.in
@@ -0,0 +1,669 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+@have_qt_TRUE@bin_PROGRAMS = oprof_start$(EXEEXT)
+subdir = gui
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/binutils.m4 \
+ $(top_srcdir)/m4/builtinexpect.m4 \
+ $(top_srcdir)/m4/cellspubfdsupport.m4 \
+ $(top_srcdir)/m4/compileroption.m4 \
+ $(top_srcdir)/m4/configmodule.m4 \
+ $(top_srcdir)/m4/copyifchange.m4 $(top_srcdir)/m4/docbook.m4 \
+ $(top_srcdir)/m4/extradirs.m4 $(top_srcdir)/m4/findkernel.m4 \
+ $(top_srcdir)/m4/kerneloption.m4 \
+ $(top_srcdir)/m4/kernelversion.m4 \
+ $(top_srcdir)/m4/mallocattribute.m4 \
+ $(top_srcdir)/m4/poptconst.m4 \
+ $(top_srcdir)/m4/precompiledheader.m4 $(top_srcdir)/m4/qt.m4 \
+ $(top_srcdir)/m4/resultyn.m4 $(top_srcdir)/m4/sstream.m4 \
+ $(top_srcdir)/m4/typedef.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am__oprof_start_SOURCES_DIST = oprof_start.cpp oprof_start_config.cpp \
+ oprof_start_util.cpp oprof_start_main.cpp oprof_start.h \
+ oprof_start_config.h oprof_start_util.h
+am__objects_1 = oprof_start.$(OBJEXT) oprof_start_config.$(OBJEXT) \
+ oprof_start_util.$(OBJEXT) oprof_start_main.$(OBJEXT)
+@have_qt_TRUE@am_oprof_start_OBJECTS = $(am__objects_1)
+@have_qt_TRUE@nodist_oprof_start_OBJECTS = oprof_start.moc.$(OBJEXT)
+oprof_start_OBJECTS = $(am_oprof_start_OBJECTS) \
+ $(nodist_oprof_start_OBJECTS)
+@have_qt_TRUE@oprof_start_DEPENDENCIES = ../libutil++/libutil++.a \
+@have_qt_TRUE@ ../libop/libop.a ../libutil/libutil.a \
+@have_qt_TRUE@ ui/liboprof_start.a
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(oprof_start_SOURCES) $(nodist_oprof_start_SOURCES)
+DIST_SOURCES = $(am__oprof_start_SOURCES_DIST)
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-exec-recursive install-info-recursive \
+ install-recursive installcheck-recursive installdirs-recursive \
+ pdf-recursive ps-recursive uninstall-info-recursive \
+ uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFD_LIBS = @BFD_LIBS@
+BUILD_JVMPI_AGENT_FALSE = @BUILD_JVMPI_AGENT_FALSE@
+BUILD_JVMPI_AGENT_TRUE = @BUILD_JVMPI_AGENT_TRUE@
+BUILD_JVMTI_AGENT_FALSE = @BUILD_JVMTI_AGENT_FALSE@
+BUILD_JVMTI_AGENT_TRUE = @BUILD_JVMTI_AGENT_TRUE@
+CAT_ENTRY_END = @CAT_ENTRY_END@
+CAT_ENTRY_START = @CAT_ENTRY_START@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOCBOOK_ROOT = @DOCBOOK_ROOT@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+EXTRA_CFLAGS_MODULE = @EXTRA_CFLAGS_MODULE@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAVA_HOMEDIR = @JAVA_HOMEDIR@
+KINC = @KINC@
+KSRC = @KSRC@
+KVERS = @KVERS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBERTY_LIBS = @LIBERTY_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MOC = @MOC@
+MODINSTALLDIR = @MODINSTALLDIR@
+OBJEXT = @OBJEXT@
+OPROFILE_DIR = @OPROFILE_DIR@
+OPROFILE_MODULE_ARCH = @OPROFILE_MODULE_ARCH@
+OP_CFLAGS = @OP_CFLAGS@
+OP_CXXFLAGS = @OP_CXXFLAGS@
+OP_DOCDIR = @OP_DOCDIR@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POPT_LIBS = @POPT_LIBS@
+PTRDIFF_T_TYPE = @PTRDIFF_T_TYPE@
+QT_INCLUDES = @QT_INCLUDES@
+QT_LDFLAGS = @QT_LDFLAGS@
+QT_LIB = @QT_LIB@
+QT_VERSION = @QT_VERSION@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIZE_T_TYPE = @SIZE_T_TYPE@
+STRIP = @STRIP@
+UIC = @UIC@
+VERSION = @VERSION@
+XML_CATALOG = @XML_CATALOG@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+have_qt_FALSE = @have_qt_FALSE@
+have_qt_TRUE = @have_qt_TRUE@
+have_xsltproc_FALSE = @have_xsltproc_FALSE@
+have_xsltproc_TRUE = @have_xsltproc_TRUE@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+kernel_support_FALSE = @kernel_support_FALSE@
+kernel_support_TRUE = @kernel_support_TRUE@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+topdir = @topdir@
+SUBDIRS = ui
+dist_sources = \
+ oprof_start.cpp \
+ oprof_start_config.cpp \
+ oprof_start_util.cpp \
+ oprof_start_main.cpp \
+ oprof_start.h \
+ oprof_start_config.h \
+ oprof_start_util.h
+
+EXTRA_DIST = $(dist_sources)
+@have_qt_TRUE@AM_CPPFLAGS = \
+@have_qt_TRUE@ @QT_INCLUDES@ \
+@have_qt_TRUE@ -I ${top_srcdir}/libop \
+@have_qt_TRUE@ -I ${top_srcdir}/libutil++ \
+@have_qt_TRUE@ -I ${top_srcdir}/libutil
+
+@have_qt_TRUE@AM_CXXFLAGS = @OP_CXXFLAGS@
+@have_qt_TRUE@oprof_start_SOURCES = $(dist_sources)
+@have_qt_TRUE@nodist_oprof_start_SOURCES = oprof_start.moc.cpp
+@have_qt_TRUE@oprof_start_LDADD = \
+@have_qt_TRUE@ ../libutil++/libutil++.a \
+@have_qt_TRUE@ ../libop/libop.a \
+@have_qt_TRUE@ ../libutil/libutil.a \
+@have_qt_TRUE@ ui/liboprof_start.a \
+@have_qt_TRUE@ @QT_LDFLAGS@ \
+@have_qt_TRUE@ @QT_LIB@ \
+@have_qt_TRUE@ @X_LIBS@
+
+all: all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gui/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign gui/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ if test -f $$p \
+ || test -f $$p1 \
+ ; then \
+ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+ else :; fi; \
+ done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+ rm -f "$(DESTDIR)$(bindir)/$$f"; \
+ done
+
+clean-binPROGRAMS:
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+oprof_start$(EXEEXT): $(oprof_start_OBJECTS) $(oprof_start_DEPENDENCIES)
+ @rm -f oprof_start$(EXEEXT)
+ $(CXXLINK) $(oprof_start_LDFLAGS) $(oprof_start_OBJECTS) $(oprof_start_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oprof_start.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oprof_start.moc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oprof_start_config.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oprof_start_main.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oprof_start_util.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(mkdir_p) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(PROGRAMS)
+installdirs: installdirs-recursive
+installdirs-am:
+ for dir in "$(DESTDIR)$(bindir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+@have_qt_FALSE@clean-local:
+clean: clean-recursive
+
+clean-am: clean-binPROGRAMS clean-generic clean-libtool clean-local \
+ mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+ clean clean-binPROGRAMS clean-generic clean-libtool \
+ clean-local clean-recursive ctags ctags-recursive distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-recursive distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-binPROGRAMS \
+ install-data install-data-am install-exec install-exec-am \
+ install-info install-info-am install-man install-strip \
+ installcheck installcheck-am installdirs installdirs-am \
+ maintainer-clean maintainer-clean-generic \
+ maintainer-clean-recursive mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \
+ pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
+ uninstall-binPROGRAMS uninstall-info-am
+
+
+@have_qt_TRUE@oprof_start.moc.cpp: ${top_srcdir}/gui/oprof_start.h
+@have_qt_TRUE@ $(MOC) -o $@ ${top_srcdir}/gui/oprof_start.h
+
+@have_qt_TRUE@clean-local:
+@have_qt_TRUE@ rm -f oprof_start.moc.cpp
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/gui/oprof_start.cpp b/gui/oprof_start.cpp
new file mode 100644
index 0000000..0387136
--- /dev/null
+++ b/gui/oprof_start.cpp
@@ -0,0 +1,1071 @@
+/**
+ * @file oprof_start.cpp
+ * The GUI start main class
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include <ctime>
+#include <cstdio>
+#include <cmath>
+#include <sstream>
+#include <iostream>
+#include <fstream>
+#include <algorithm>
+
+#include <qlineedit.h>
+#include <qlistview.h>
+#include <qcombobox.h>
+#include <qlistbox.h>
+#include <qfiledialog.h>
+#include <qbuttongroup.h>
+#include <qcheckbox.h>
+#include <qtabwidget.h>
+#include <qmessagebox.h>
+#include <qvalidator.h>
+#include <qlabel.h>
+#include <qpushbutton.h>
+#include <qheader.h>
+
+#include "config.h"
+#include "oprof_start.h"
+#include "op_config.h"
+#include "op_config_24.h"
+#include "string_manip.h"
+#include "op_cpufreq.h"
+#include "op_alloc_counter.h"
+#include "oprof_start_util.h"
+#include "file_manip.h"
+
+#include "op_hw_config.h"
+
+using namespace std;
+
+static char const * green_xpm[] = {
+"16 16 2 1",
+" c None",
+". c #00FF00",
+" ....... ",
+" ........... ",
+" ............. ",
+" ............. ",
+"............... ",
+"............... ",
+"............... ",
+"............... ",
+"............... ",
+"............... ",
+"............... ",
+" ............. ",
+" ............. ",
+" ........... ",
+" ....... ",
+" " };
+
+static char const * red_xpm[] = {
+"16 16 2 1",
+" c None",
+". c #FF0000",
+" ....... ",
+" ........... ",
+" ............. ",
+" ............. ",
+"............... ",
+"............... ",
+"............... ",
+"............... ",
+"............... ",
+"............... ",
+"............... ",
+" ............. ",
+" ............. ",
+" ........... ",
+" ....... ",
+" " };
+
+static QPixmap * green_pixmap;
+static QPixmap * red_pixmap;
+
+
+op_event_descr::op_event_descr()
+ :
+ counter_mask(0),
+ val(0),
+ unit(0),
+ min_count(0)
+{
+}
+
+
+oprof_start::oprof_start()
+ :
+ oprof_start_base(0, 0, false, 0),
+ event_count_validator(new QIntValidator(event_count_edit)),
+ current_event(0),
+ cpu_speed(op_cpu_frequency()),
+ total_nr_interrupts(0)
+{
+ green_pixmap = new QPixmap(green_xpm);
+ red_pixmap = new QPixmap(red_xpm);
+ vector<string> args;
+ args.push_back("--init");
+
+ if (do_exec_command(OP_BINDIR "/opcontrol", args))
+ exit(EXIT_FAILURE);
+
+ cpu_type = op_get_cpu_type();
+ op_nr_counters = op_get_nr_counters(cpu_type);
+
+ if (cpu_type == CPU_TIMER_INT) {
+ setup_config_tab->removePage(counter_setup_page);
+ } else {
+ fill_events();
+ }
+
+ op_interface interface = op_get_interface();
+ if (interface == OP_INTERFACE_NO_GOOD) {
+ QMessageBox::warning(this, 0, "Couldn't determine kernel"
+ " interface version");
+ exit(EXIT_FAILURE);
+ }
+ bool is_26 = interface == OP_INTERFACE_26;
+
+ if (is_26) {
+ note_table_size_edit->hide();
+ note_table_size_label->hide();
+ if (!op_file_readable("/dev/oprofile/backtrace_depth")) {
+ callgraph_depth_label->hide();
+ callgraph_depth_edit->hide();
+ }
+ } else {
+ callgraph_depth_label->hide();
+ callgraph_depth_edit->hide();
+ buffer_watershed_label->hide();
+ buffer_watershed_edit->hide();
+ cpu_buffer_size_label->hide();
+ cpu_buffer_size_edit->hide();
+ }
+
+ // setup the configuration page.
+ kernel_filename_edit->setText(config.kernel_filename.c_str());
+
+ no_vmlinux->setChecked(config.no_kernel);
+
+ buffer_size_edit->setText(QString().setNum(config.buffer_size));
+ buffer_watershed_edit->setText(QString().setNum(config.buffer_watershed));
+ cpu_buffer_size_edit->setText(QString().setNum(config.cpu_buffer_size));
+ note_table_size_edit->setText(QString().setNum(config.note_table_size));
+ callgraph_depth_edit->setText(QString().setNum(config.callgraph_depth));
+ verbose->setChecked(config.verbose);
+ separate_lib_cb->setChecked(config.separate_lib);
+ separate_kernel_cb->setChecked(config.separate_kernel);
+ separate_cpu_cb->setChecked(config.separate_cpu);
+ separate_thread_cb->setChecked(config.separate_thread);
+
+ // the unit mask check boxes
+ hide_masks();
+
+ event_count_edit->setValidator(event_count_validator);
+ QIntValidator * iv;
+ iv = new QIntValidator(OP_MIN_BUF_SIZE, OP_MAX_BUF_SIZE, buffer_size_edit);
+ buffer_size_edit->setValidator(iv);
+ iv = new QIntValidator(OP_MIN_NOTE_TABLE_SIZE, OP_MAX_NOTE_TABLE_SIZE, note_table_size_edit);
+ note_table_size_edit->setValidator(iv);
+ iv = new QIntValidator(0, INT_MAX, callgraph_depth_edit);
+ callgraph_depth_edit->setValidator(iv);
+ iv = new QIntValidator(0, INT_MAX, buffer_watershed_edit);
+ buffer_watershed_edit->setValidator(iv);
+ iv = new QIntValidator(0, OP_MAX_CPU_BUF_SIZE, cpu_buffer_size_edit);
+ cpu_buffer_size_edit->setValidator(iv);
+
+ // daemon status timer
+ startTimer(5000);
+ timerEvent(0);
+
+ resize(minimumSizeHint());
+
+ // force the pixmap re-draw
+ event_selected();
+}
+
+
+void oprof_start::fill_events()
+{
+ // we need to build the event descr stuff before loading the
+ // configuration because we use locate_event to get an event descr
+ // from its name.
+ struct list_head * pos;
+ struct list_head * events = op_events(cpu_type);
+
+ list_for_each(pos, events) {
+ struct op_event * event = list_entry(pos, struct op_event, event_next);
+
+ op_event_descr descr;
+
+ descr.counter_mask = event->counter_mask;
+ descr.val = event->val;
+ if (event->unit->num) {
+ descr.unit = event->unit;
+ } else {
+ descr.unit = 0;
+ }
+
+ descr.name = event->name;
+ descr.help_str = event->desc;
+ descr.min_count = event->min_count;
+
+ for (uint ctr = 0; ctr < op_nr_counters; ++ctr) {
+ uint count;
+
+ if (!(descr.counter_mask & (1 << ctr)))
+ continue;
+
+ if (cpu_type == CPU_RTC) {
+ count = 1024;
+ } else {
+ /* setting to cpu Hz / 2000 gives a safe value for
+ * all events, and a good one for most.
+ */
+ if (cpu_speed)
+ count = int(cpu_speed * 500);
+ else
+ count = descr.min_count * 100;
+ }
+
+ event_cfgs[descr.name].count = count;
+ event_cfgs[descr.name].umask = 0;
+ if (descr.unit)
+ event_cfgs[descr.name].umask = descr.unit->default_mask;
+ event_cfgs[descr.name].os_ring_count = 1;
+ event_cfgs[descr.name].user_ring_count = 1;
+ }
+
+ v_events.push_back(descr);
+ }
+
+ events_list->header()->hide();
+ events_list->setSorting(-1);
+
+ fill_events_listbox();
+
+ read_set_events();
+
+ // FIXME: why this ?
+ if (cpu_type == CPU_RTC)
+ events_list->setCurrentItem(events_list->firstChild());
+
+ load_config_file();
+}
+
+
+namespace {
+
+/// find the first item with the given text in column 0 or return NULL
+QListViewItem * findItem(QListView * view, char const * name)
+{
+ // Qt 2.3.1 does not have QListView::findItem()
+ QListViewItem * item = view->firstChild();
+
+ while (item && strcmp(item->text(0).latin1(), name))
+ item = item->nextSibling();
+
+ return item;
+}
+
+};
+
+
+void oprof_start::setup_default_event()
+{
+ struct op_default_event_descr descr;
+ op_default_event(cpu_type, &descr);
+
+ event_cfgs[descr.name].umask = descr.um;
+ event_cfgs[descr.name].count = descr.count;
+ event_cfgs[descr.name].user_ring_count = 1;
+ event_cfgs[descr.name].os_ring_count = 1;
+
+ QListViewItem * item = findItem(events_list, descr.name);
+ if (item)
+ item->setSelected(true);
+}
+
+
+void oprof_start::read_set_events()
+{
+ string name = get_config_filename(".oprofile/daemonrc");
+
+ ifstream in(name.c_str());
+
+ if (!in) {
+ setup_default_event();
+ return;
+ }
+
+ string str;
+
+ bool one_enabled = false;
+
+ while (getline(in, str)) {
+ string const val = split(str, '=');
+ string const name = str;
+
+ if (!is_prefix(name, "CHOSEN_EVENTS_"))
+ continue;
+
+ one_enabled = true;
+
+ // CHOSEN_EVENTS_#nr=CPU_CLK_UNHALTED:10000:0:1:1
+ vector<string> parts = separate_token(val, ':');
+
+ if (parts.size() != 5 && parts.size() != 2) {
+ cerr << "invalid configuration file\n";
+ // FIXME
+ exit(EXIT_FAILURE);
+ }
+
+ string ev_name = parts[0];
+ event_cfgs[ev_name].count =
+ op_lexical_cast<unsigned int>(parts[1]);
+
+ // CPU_CLK_UNHALTED:10000 is also valid
+ if (parts.size() == 5) {
+ event_cfgs[ev_name].umask =
+ op_lexical_cast<unsigned int>(parts[2]);
+ event_cfgs[ev_name].user_ring_count =
+ op_lexical_cast<unsigned int>(parts[3]);
+ event_cfgs[ev_name].os_ring_count =
+ op_lexical_cast<unsigned int>(parts[4]);
+ } else {
+ event_cfgs[ev_name].umask = 0;
+ event_cfgs[ev_name].user_ring_count = 1;
+ event_cfgs[ev_name].os_ring_count = 1;
+ }
+
+ QListViewItem * item = findItem(events_list, ev_name.c_str());
+ if (item)
+ item->setSelected(true);
+ }
+
+ // use default event if none set
+ if (!one_enabled)
+ setup_default_event();
+}
+
+
+void oprof_start::load_config_file()
+{
+ string name = get_config_filename(".oprofile/daemonrc");
+
+ ifstream in(name.c_str());
+ if (!in) {
+ if (!check_and_create_config_dir())
+ return;
+
+ ofstream out(name.c_str());
+ if (!out) {
+ QMessageBox::warning(this, 0, "Unable to open configuration "
+ "file ~/.oprofile/daemonrc");
+ }
+ return;
+ }
+
+ in >> config;
+}
+
+
+// user request a "normal" exit so save the config file.
+void oprof_start::accept()
+{
+ // record the previous settings
+ record_selected_event_config();
+
+ save_config();
+
+ QDialog::accept();
+}
+
+
+void oprof_start::closeEvent(QCloseEvent *)
+{
+ accept();
+}
+
+
+void oprof_start::timerEvent(QTimerEvent *)
+{
+ static time_t last = time(0);
+
+ daemon_status dstat;
+
+ flush_profiler_data_btn->setEnabled(dstat.running);
+ stop_profiler_btn->setEnabled(dstat.running);
+ start_profiler_btn->setEnabled(!dstat.running);
+ reset_sample_files_btn->setEnabled(!dstat.running);
+
+ if (!dstat.running) {
+ daemon_label->setText("Profiler is not running.");
+ return;
+ }
+
+ ostringstream ss;
+ ss << "Profiler running:";
+
+ time_t curr = time(0);
+ total_nr_interrupts += dstat.nr_interrupts;
+
+ if (curr - last)
+ ss << " (" << dstat.nr_interrupts / (curr - last) << " interrupts / second, total " << total_nr_interrupts << ")";
+
+ daemon_label->setText(ss.str().c_str());
+
+ last = curr;
+}
+
+
+void oprof_start::fill_events_listbox()
+{
+ setUpdatesEnabled(false);
+
+ for (vector<op_event_descr>::reverse_iterator cit = v_events.rbegin();
+ cit != v_events.rend(); ++cit) {
+ new QListViewItem(events_list, cit->name.c_str());
+ }
+
+ setUpdatesEnabled(true);
+ update();
+}
+
+
+void oprof_start::display_event(op_event_descr const & descr)
+{
+ setUpdatesEnabled(false);
+
+ setup_unit_masks(descr);
+ os_ring_count_cb->setEnabled(true);
+ user_ring_count_cb->setEnabled(true);
+ event_count_edit->setEnabled(true);
+
+ event_setting & cfg = event_cfgs[descr.name];
+
+ os_ring_count_cb->setChecked(cfg.os_ring_count);
+ user_ring_count_cb->setChecked(cfg.user_ring_count);
+ QString count_text;
+ count_text.setNum(cfg.count);
+ event_count_edit->setText(count_text);
+ event_count_validator->setRange(descr.min_count, max_perf_count());
+
+ setUpdatesEnabled(true);
+ update();
+}
+
+
+bool oprof_start::is_selectable_event(QListViewItem * item)
+{
+ if (item->isSelected())
+ return true;
+
+ selected_events.insert(item);
+
+ bool ret = false;
+ if (alloc_selected_events())
+ ret = true;
+
+ selected_events.erase(item);
+
+ return ret;
+}
+
+
+void oprof_start::draw_event_list()
+{
+ QListViewItem * cur;
+ for (cur = events_list->firstChild(); cur; cur = cur->nextSibling()) {
+ if (is_selectable_event(cur))
+ cur->setPixmap(0, *green_pixmap);
+ else
+ cur->setPixmap(0, *red_pixmap);
+ }
+}
+
+
+bool oprof_start::alloc_selected_events() const
+{
+ vector<op_event const *> events;
+
+ set<QListViewItem *>::const_iterator it;
+ for (it = selected_events.begin(); it != selected_events.end(); ++it)
+ events.push_back(find_event_by_name((*it)->text(0).latin1(),0,0));
+
+ size_t * map =
+ map_event_to_counter(&events[0], events.size(), cpu_type);
+
+ if (!map)
+ return false;
+
+ free(map);
+ return true;
+}
+
+void oprof_start::event_selected()
+{
+ // The deal is simple: QT lack of a way to know what item was the last
+ // (de)selected item so we record a set of selected items and diff
+ // it in the appropriate way with the previous list of selected items.
+
+ set<QListViewItem *> current_selection;
+ QListViewItem * cur;
+ for (cur = events_list->firstChild(); cur; cur = cur->nextSibling()) {
+ if (cur->isSelected())
+ current_selection.insert(cur);
+ }
+
+ // First remove the deselected item.
+ vector<QListViewItem *> new_deselected;
+ set_difference(selected_events.begin(), selected_events.end(),
+ current_selection.begin(), current_selection.end(),
+ back_inserter(new_deselected));
+ vector<QListViewItem *>::const_iterator it;
+ for (it = new_deselected.begin(); it != new_deselected.end(); ++it)
+ selected_events.erase(*it);
+
+ // Now try to add the newly selected item if enough HW resource exists
+ vector<QListViewItem *> new_selected;
+ set_difference(current_selection.begin(), current_selection.end(),
+ selected_events.begin(), selected_events.end(),
+ back_inserter(new_selected));
+ for (it = new_selected.begin(); it != new_selected.end(); ++it) {
+ selected_events.insert(*it);
+ if (!alloc_selected_events()) {
+ (*it)->setSelected(false);
+ selected_events.erase(*it);
+ } else {
+ current_event = *it;
+ }
+ }
+
+ draw_event_list();
+
+ if (current_event)
+ display_event(locate_event(current_event->text(0).latin1()));
+}
+
+
+void oprof_start::event_over(QListViewItem * item)
+{
+ op_event_descr const & descr = locate_event(item->text(0).latin1());
+
+ string help_str = descr.help_str.c_str();
+ if (!is_selectable_event(item)) {
+ help_str += " conflicts with:";
+
+ set<QListViewItem *>::const_iterator it;
+ for (it = selected_events.begin();
+ it != selected_events.end(); ) {
+ QListViewItem * temp = *it;
+ selected_events.erase(it++);
+ if (is_selectable_event(item)) {
+ help_str += " ";
+ help_str += temp->text(0).latin1();
+ }
+ selected_events.insert(temp);
+ }
+ }
+
+ event_help_label->setText(help_str.c_str());
+}
+
+
+/// select the kernel image filename
+void oprof_start::choose_kernel_filename()
+{
+ string name = kernel_filename_edit->text().latin1();
+ string result = do_open_file_or_dir(name, false);
+
+ if (!result.empty())
+ kernel_filename_edit->setText(result.c_str());
+}
+
+
+// this record the current selected event setting in the event_cfg[] stuff.
+// FIXME: need validation?
+void oprof_start::record_selected_event_config()
+{
+ if (!current_event)
+ return;
+
+ string name(current_event->text(0).latin1());
+
+ event_setting & cfg = event_cfgs[name];
+ op_event_descr const & curr = locate_event(name);
+
+ cfg.count = event_count_edit->text().toUInt();
+ cfg.os_ring_count = os_ring_count_cb->isChecked();
+ cfg.user_ring_count = user_ring_count_cb->isChecked();
+ cfg.umask = get_unit_mask(curr);
+}
+
+
+// validate and save the configuration (The qt validator installed
+// are not sufficient to do the validation)
+bool oprof_start::record_config()
+{
+ config.kernel_filename = kernel_filename_edit->text().latin1();
+ config.no_kernel = no_vmlinux->isChecked();
+
+ uint temp = buffer_size_edit->text().toUInt();
+ if (temp < OP_MIN_BUF_SIZE || temp > OP_MAX_BUF_SIZE) {
+ ostringstream error;
+
+ error << "buffer size out of range: " << temp
+ << " valid range is [" << OP_MIN_BUF_SIZE << ", "
+ << OP_MAX_BUF_SIZE << "]";
+
+ QMessageBox::warning(this, 0, error.str().c_str());
+
+ return false;
+ }
+ config.buffer_size = temp;
+
+ temp = buffer_watershed_edit->text().toUInt();
+ // watershed above half of buffer size make little sense.
+ if (temp > config.buffer_size / 2) {
+ ostringstream error;
+
+ error << "buffer watershed out of range: " << temp
+ << " valid range is [0 (use default), buffer size/2] "
+ << "generally 0.25 * buffer size is fine";
+
+ QMessageBox::warning(this, 0, error.str().c_str());
+
+ return false;
+ }
+ config.buffer_watershed = temp;
+
+ temp = cpu_buffer_size_edit->text().toUInt();
+ if ((temp != 0 && temp < OP_MIN_CPU_BUF_SIZE) ||
+ temp > OP_MAX_CPU_BUF_SIZE) {
+ ostringstream error;
+
+ error << "cpu buffer size out of range: " << temp
+ << " valid range is [" << OP_MIN_CPU_BUF_SIZE << ", "
+ << OP_MAX_CPU_BUF_SIZE << "] (size = 0: use default)";
+
+ QMessageBox::warning(this, 0, error.str().c_str());
+
+ return false;
+ }
+ config.cpu_buffer_size = temp;
+
+ temp = note_table_size_edit->text().toUInt();
+ if (temp < OP_MIN_NOTE_TABLE_SIZE || temp > OP_MAX_NOTE_TABLE_SIZE) {
+ ostringstream error;
+
+ error << "note table size out of range: " << temp
+ << " valid range is [" << OP_MIN_NOTE_TABLE_SIZE << ", "
+ << OP_MAX_NOTE_TABLE_SIZE << "]";
+
+ QMessageBox::warning(this, 0, error.str().c_str());
+
+ return false;
+ }
+ config.note_table_size = temp;
+
+ temp = callgraph_depth_edit->text().toUInt();
+ if (temp > INT_MAX) {
+ ostringstream error;
+
+ error << "callgraph depth out of range: " << temp
+ << " valid range is [" << 0 << ", "
+ << INT_MAX << "]";
+
+ QMessageBox::warning(this, 0, error.str().c_str());
+
+ return false;
+ }
+ config.callgraph_depth = temp;
+
+ config.verbose = verbose->isChecked();
+ config.separate_lib = separate_lib_cb->isChecked();
+ config.separate_kernel = separate_kernel_cb->isChecked();
+ config.separate_cpu = separate_cpu_cb->isChecked();
+ config.separate_thread = separate_thread_cb->isChecked();
+
+ return true;
+}
+
+
+void oprof_start::get_unit_mask_part(op_event_descr const & descr, uint num,
+ bool selected, uint & mask)
+{
+ if (!selected)
+ return;
+ if (num >= descr.unit->num)
+ return;
+
+ if (descr.unit->unit_type_mask == utm_bitmask)
+ mask |= descr.unit->um[num].value;
+ else
+ mask = descr.unit->um[num].value;
+}
+
+
+// return the unit mask selected through the unit mask check box
+uint oprof_start::get_unit_mask(op_event_descr const & descr)
+{
+ uint mask = 0;
+
+ if (!descr.unit)
+ return 0;
+
+ // mandatory mask is transparent for user.
+ if (descr.unit->unit_type_mask == utm_mandatory) {
+ mask = descr.unit->default_mask;
+ return mask;
+ }
+
+ get_unit_mask_part(descr, 0, check0->isChecked(), mask);
+ get_unit_mask_part(descr, 1, check1->isChecked(), mask);
+ get_unit_mask_part(descr, 2, check2->isChecked(), mask);
+ get_unit_mask_part(descr, 3, check3->isChecked(), mask);
+ get_unit_mask_part(descr, 4, check4->isChecked(), mask);
+ get_unit_mask_part(descr, 5, check5->isChecked(), mask);
+ get_unit_mask_part(descr, 6, check6->isChecked(), mask);
+ get_unit_mask_part(descr, 7, check7->isChecked(), mask);
+ get_unit_mask_part(descr, 8, check8->isChecked(), mask);
+ get_unit_mask_part(descr, 9, check9->isChecked(), mask);
+ get_unit_mask_part(descr, 10, check10->isChecked(), mask);
+ get_unit_mask_part(descr, 11, check11->isChecked(), mask);
+ get_unit_mask_part(descr, 12, check12->isChecked(), mask);
+ get_unit_mask_part(descr, 13, check13->isChecked(), mask);
+ get_unit_mask_part(descr, 14, check14->isChecked(), mask);
+ get_unit_mask_part(descr, 15, check15->isChecked(), mask);
+ return mask;
+}
+
+
+void oprof_start::hide_masks()
+{
+ check0->hide();
+ check1->hide();
+ check2->hide();
+ check3->hide();
+ check4->hide();
+ check5->hide();
+ check6->hide();
+ check7->hide();
+ check8->hide();
+ check9->hide();
+ check10->hide();
+ check11->hide();
+ check12->hide();
+ check13->hide();
+ check14->hide();
+ check15->hide();
+}
+
+
+void oprof_start::setup_unit_masks(op_event_descr const & descr)
+{
+ op_unit_mask const * um = descr.unit;
+
+ hide_masks();
+
+ if (!um || um->unit_type_mask == utm_mandatory)
+ return;
+
+ event_setting & cfg = event_cfgs[descr.name];
+
+ unit_mask_group->setExclusive(um->unit_type_mask == utm_exclusive);
+
+ for (size_t i = 0; i < um->num ; ++i) {
+ QCheckBox * check = 0;
+ switch (i) {
+ case 0: check = check0; break;
+ case 1: check = check1; break;
+ case 2: check = check2; break;
+ case 3: check = check3; break;
+ case 4: check = check4; break;
+ case 5: check = check5; break;
+ case 6: check = check6; break;
+ case 7: check = check7; break;
+ case 8: check = check8; break;
+ case 9: check = check9; break;
+ case 10: check = check10; break;
+ case 11: check = check11; break;
+ case 12: check = check12; break;
+ case 13: check = check13; break;
+ case 14: check = check14; break;
+ case 15: check = check15; break;
+ }
+ check->setText(um->um[i].desc);
+ if (um->unit_type_mask == utm_exclusive)
+ check->setChecked(cfg.umask == um->um[i].value);
+ else
+ check->setChecked(cfg.umask & um->um[i].value);
+
+ check->show();
+ }
+ unit_mask_group->setMinimumSize(unit_mask_group->sizeHint());
+ setup_config_tab->setMinimumSize(setup_config_tab->sizeHint());
+}
+
+
+uint oprof_start::max_perf_count() const
+{
+ return cpu_type == CPU_RTC ? OP_MAX_RTC_COUNT : OP_MAX_PERF_COUNT;
+}
+
+
+void oprof_start::on_flush_profiler_data()
+{
+ vector<string> args;
+ args.push_back("--dump");
+
+ if (daemon_status().running)
+ do_exec_command(OP_BINDIR "/opcontrol", args);
+ else
+ QMessageBox::warning(this, 0, "The profiler is not started.");
+}
+
+
+// user is happy of its setting.
+void oprof_start::on_start_profiler()
+{
+ // save the current settings
+ record_selected_event_config();
+
+ bool one_enable = false;
+
+ QListViewItem * cur;
+ for (cur = events_list->firstChild(); cur; cur = cur->nextSibling()) {
+ if (!cur->isSelected())
+ continue;
+
+ // the missing reference is intended: gcc 2.91.66 can compile
+ // "op_event_descr const & descr = ..." w/o a warning
+ op_event_descr const descr =
+ locate_event(cur->text(0).latin1());
+
+ event_setting & cfg = event_cfgs[cur->text(0).latin1()];
+
+ one_enable = true;
+
+ if (!cfg.os_ring_count && !cfg.user_ring_count) {
+ QMessageBox::warning(this, 0, "You must select to "
+ "profile at least one of user binaries/kernel");
+ return;
+ }
+
+ if (cfg.count < descr.min_count ||
+ cfg.count > max_perf_count()) {
+ ostringstream out;
+
+ out << "event " << descr.name << " count of range: "
+ << cfg.count << " must be in [ "
+ << descr.min_count << ", "
+ << max_perf_count()
+ << "]";
+
+ QMessageBox::warning(this, 0, out.str().c_str());
+ return;
+ }
+
+ if (descr.unit &&
+ descr.unit->unit_type_mask == utm_bitmask &&
+ cfg.umask == 0) {
+ ostringstream out;
+
+ out << "event " << descr.name << " invalid unit mask: "
+ << cfg.umask << endl;
+
+ QMessageBox::warning(this, 0, out.str().c_str());
+ return;
+ }
+ }
+
+ if (one_enable == false && cpu_type != CPU_TIMER_INT) {
+ QMessageBox::warning(this, 0, "No counters enabled.\n");
+ return;
+ }
+
+ if (daemon_status().running) {
+ // gcc 2.91 work around
+ int user_choice = 0;
+ user_choice =
+ QMessageBox::warning(this, 0,
+ "Profiler already started:\n\n"
+ "stop and restart it?",
+ "&Restart", "&Cancel", 0, 0, 1);
+
+ if (user_choice == 1)
+ return;
+
+ // this flush profiler data also.
+ on_stop_profiler();
+ }
+
+ vector<string> args;
+
+ // save_config validate and setup the config
+ if (save_config()) {
+ // now actually start
+ args.push_back("--start");
+ if (config.verbose)
+ args.push_back("--verbose");
+ do_exec_command(OP_BINDIR "/opcontrol", args);
+ }
+
+ total_nr_interrupts = 0;
+ timerEvent(0);
+}
+
+
+bool oprof_start::save_config()
+{
+ if (!record_config())
+ return false;
+
+ vector<string> args;
+
+ // saving config is done by running opcontrol --setup with appropriate
+ // setted parameters so we use the same config file as command line
+ // tools
+
+ args.push_back("--setup");
+
+ bool one_enabled = false;
+
+ vector<string> tmpargs;
+ tmpargs.push_back("--setup");
+
+ QListViewItem * cur;
+ for (cur = events_list->firstChild(); cur; cur = cur->nextSibling()) {
+ if (!cur->isSelected())
+ continue;
+
+ event_setting & cfg = event_cfgs[cur->text(0).latin1()];
+
+ op_event_descr const & descr =
+ locate_event(cur->text(0).latin1());
+
+ one_enabled = true;
+
+ string arg = "--event=" + descr.name;
+ arg += ":" + op_lexical_cast<string>(cfg.count);
+ arg += ":" + op_lexical_cast<string>(cfg.umask);
+ arg += ":" + op_lexical_cast<string>(cfg.os_ring_count);
+ arg += ":" + op_lexical_cast<string>(cfg.user_ring_count);
+
+ tmpargs.push_back(arg);
+ }
+
+ // only set counters if at least one is enabled
+ if (one_enabled)
+ args = tmpargs;
+
+ if (config.no_kernel) {
+ args.push_back("--no-vmlinux");
+ } else {
+ args.push_back("--vmlinux=" + config.kernel_filename);
+ }
+
+ args.push_back("--buffer-size=" +
+ op_lexical_cast<string>(config.buffer_size));
+
+ if (op_get_interface() == OP_INTERFACE_24) {
+ args.push_back("--note-table-size=" +
+ op_lexical_cast<string>(config.note_table_size));
+ } else {
+ args.push_back("--buffer-watershed=" +
+ op_lexical_cast<string>(config.buffer_watershed));
+ args.push_back("--cpu-buffer-size=" +
+ op_lexical_cast<string>(config.cpu_buffer_size));
+ if (op_file_readable("/dev/oprofile/backtrace_depth")) {
+ args.push_back("--callgraph=" +
+ op_lexical_cast<string>(config.callgraph_depth));
+ }
+ }
+
+ string sep = "--separate=";
+
+ if (config.separate_lib)
+ sep += "library,";
+ if (config.separate_kernel)
+ sep += "kernel,";
+ if (config.separate_cpu)
+ sep += "cpu,";
+ if (config.separate_thread)
+ sep += "thread,";
+
+ if (sep == "--separate=")
+ sep += "none";
+ args.push_back(sep);
+
+ // 2.95 work-around, it didn't like return !do_exec_command()
+ bool ret = !do_exec_command(OP_BINDIR "/opcontrol", args);
+ return ret;
+}
+
+
+// flush and stop the profiler if it was started.
+void oprof_start::on_stop_profiler()
+{
+ vector<string> args;
+ args.push_back("--shutdown");
+
+ if (daemon_status().running)
+ do_exec_command(OP_BINDIR "/opcontrol", args);
+ else
+ QMessageBox::warning(this, 0, "The profiler is already stopped.");
+
+ timerEvent(0);
+}
+
+
+void oprof_start::on_separate_kernel_cb_changed(int state)
+{
+ if (state == 2)
+ separate_lib_cb->setChecked(true);
+}
+
+void oprof_start::on_reset_sample_files()
+{
+ int ret = QMessageBox::warning(this, 0, "Are you sure you want to "
+ "reset your last profile session ?", "Yes", "No", 0, 0, 1);
+ if (!ret) {
+ vector<string> args;
+ args.push_back("--reset");
+ if (!do_exec_command(OP_BINDIR "/opcontrol", args))
+ // the next timer event will overwrite the message
+ daemon_label->setText("Last profile session reseted.");
+ else
+ QMessageBox::warning(this, 0,
+ "Can't reset profiling session.");
+ }
+}
+
+
+/// function object for matching against name
+class event_name_eq {
+ string name_;
+public:
+ explicit event_name_eq(string const & s) : name_(s) {}
+ bool operator()(op_event_descr const & d) const {
+ return d.name == name_;
+ }
+};
+
+
+// helper to retrieve an event descr through its name.
+op_event_descr const & oprof_start::locate_event(string const & name) const
+{
+ return *(find_if(v_events.begin(), v_events.end(), event_name_eq(name)));
+}
diff --git a/gui/oprof_start.h b/gui/oprof_start.h
new file mode 100644
index 0000000..c2910ee
--- /dev/null
+++ b/gui/oprof_start.h
@@ -0,0 +1,164 @@
+/**
+ * @file oprof_start.h
+ * The GUI start main class
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#ifndef OPROF_START_H
+#define OPROF_START_H
+
+#include <vector>
+#include <map>
+#include <set>
+
+#include "ui/oprof_start.base.h"
+#include "oprof_start_config.h"
+
+#include "op_events.h"
+
+class QIntValidator;
+class QListViewItem;
+class QTimerEvent;
+
+/// a struct describing a particular event type
+struct op_event_descr {
+ op_event_descr();
+
+ /// bit mask of allowed counters
+ uint counter_mask;
+ /// hardware event number
+ u32 val;
+ /// unit mask values if applicable
+ op_unit_mask const * unit;
+ /// name of event
+ std::string name;
+ /// description of event
+ std::string help_str;
+ /// minimum counter value
+ uint min_count;
+};
+
+class oprof_start : public oprof_start_base
+{
+ Q_OBJECT
+
+public:
+ oprof_start();
+
+protected slots:
+ /// select the kernel image filename
+ void choose_kernel_filename();
+ /// flush profiler
+ void on_flush_profiler_data();
+ /// start profiler
+ void on_start_profiler();
+ /// stop profiler
+ void on_stop_profiler();
+ /// events selection change
+ void event_selected();
+ /// the mouse is over an event
+ void event_over(QListViewItem *);
+ /// state of separate_kernel_cb changed
+ void on_separate_kernel_cb_changed(int);
+ /// reset sample files
+ void on_reset_sample_files();
+
+ /// close the dialog
+ void accept();
+
+ /// WM hide event
+ void closeEvent(QCloseEvent * e);
+
+ /// timer event
+ void timerEvent(QTimerEvent * e);
+
+private:
+ /// the counter combo has been activated
+ void fill_events_listbox();
+
+ /// fill the event details and gui setup
+ void fill_events();
+
+ /// find an event description by name
+ op_event_descr const & locate_event(std::string const & name) const;
+
+ /// update config on user change
+ void record_selected_event_config();
+ /// update config and validate
+ bool record_config();
+
+ /// calculate unit mask for given event and unit mask part
+ void get_unit_mask_part(op_event_descr const & descr, uint num, bool selected, uint & mask);
+ /// calculate unit mask for given event
+ uint get_unit_mask(op_event_descr const & descr);
+ /// set the unit mask widgets for given event
+ void setup_unit_masks(op_event_descr const & descr);
+
+ /// return the maximum perf counter value for the current cpu type
+ uint max_perf_count() const;
+
+ /// show an event's settings
+ void display_event(op_event_descr const & descrp);
+
+ /// hide unit mask widgets
+ void hide_masks(void);
+
+ /// read the events set in daemonrc
+ void read_set_events();
+ /// use the default event
+ void setup_default_event();
+ /// load the extra config file
+ void load_config_file();
+ /// save the config
+ bool save_config();
+
+ /// redraw the event list by changing icon status
+ void draw_event_list();
+
+ /// return true if item is selectable or already selected
+ bool is_selectable_event(QListViewItem * item);
+
+ /// try to alloc counters for the selected_events
+ bool alloc_selected_events() const;
+
+ /// validator for event count
+ QIntValidator* event_count_validator;
+
+ /// all available events for this hardware
+ std::vector<op_event_descr> v_events;
+
+ /// current event configs for each counter
+ typedef std::map<std::string, event_setting> event_setting_map;
+ event_setting_map event_cfgs;
+
+ /// The currently selected events. We must track this because
+ /// with multiple selection listbox QT doesn't allow to know
+ /// what is the last selected item. events_selected() update it
+ std::set<QListViewItem *> selected_events;
+ QListViewItem * current_event;
+
+ /// current config
+ config_setting config;
+
+ /// the expansion of "~" directory
+ std::string user_dir;
+
+ /// CPU type
+ op_cpu cpu_type;
+
+ /// CPU speed in MHz
+ double cpu_speed;
+
+ /// total number of available HW counters
+ uint op_nr_counters;
+
+ /// Total number of samples for this run
+ unsigned long total_nr_interrupts;
+};
+
+#endif // OPROF_START_H
diff --git a/gui/oprof_start_config.cpp b/gui/oprof_start_config.cpp
new file mode 100644
index 0000000..b120af4
--- /dev/null
+++ b/gui/oprof_start_config.cpp
@@ -0,0 +1,112 @@
+/**
+ * @file oprof_start_config.cpp
+ * GUI startup config management
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include <stdio.h>
+
+#include <sstream>
+#include <fstream>
+#include <iomanip>
+#include <sys/utsname.h>
+
+#include "string_manip.h"
+#include "oprof_start_config.h"
+#include "op_config.h"
+#include "op_config_24.h"
+
+using namespace std;
+
+event_setting::event_setting()
+ :
+ count(0),
+ umask(0),
+ os_ring_count(0),
+ user_ring_count(0)
+{
+}
+
+
+config_setting::config_setting()
+ :
+ buffer_size(OP_DEFAULT_BUF_SIZE),
+ note_table_size(OP_DEFAULT_NOTE_SIZE),
+ no_kernel(false),
+ verbose(false),
+ separate_lib(false),
+ separate_kernel(false),
+ separate_cpu(false),
+ separate_thread(false),
+ callgraph_depth(0),
+ buffer_watershed(0),
+ cpu_buffer_size(0)
+{
+ struct utsname info;
+
+ /* Guess path to vmlinux based on kernel currently running. */
+ if (uname(&info)) {
+ perror("oprof_start: Unable to determine OS release.");
+ } else {
+ string const version(info.release);
+ string const vmlinux_path("/lib/modules/" + version
+ + "/build/vmlinux");
+ kernel_filename = vmlinux_path;
+ }
+}
+
+
+void config_setting::load(istream & in)
+{
+ buffer_size = OP_DEFAULT_BUF_SIZE;
+ note_table_size = OP_DEFAULT_NOTE_SIZE;
+
+ string str;
+
+ while (getline(in, str)) {
+ string val = split(str, '=');
+ if (str == "BUF_SIZE") {
+ buffer_size = op_lexical_cast<unsigned int>(val);
+ if (buffer_size < OP_DEFAULT_BUF_SIZE)
+ buffer_size = OP_DEFAULT_BUF_SIZE;
+ } else if (str == "NOTE_SIZE") {
+ note_table_size = op_lexical_cast<unsigned int>(val);
+ if (note_table_size < OP_DEFAULT_NOTE_SIZE)
+ note_table_size = OP_DEFAULT_NOTE_SIZE;
+ } else if (str == "VMLINUX") {
+ if (val == "none") {
+ kernel_filename = "";
+ no_kernel = true;
+ } else if (!val.empty()) {
+ no_kernel = false;
+ kernel_filename = val;
+ }
+ } else if (str == "SEPARATE_LIB") {
+ separate_lib = op_lexical_cast<bool>(val);
+ } else if (str == "SEPARATE_KERNEL") {
+ separate_kernel = op_lexical_cast<bool>(val);
+ } else if (str == "SEPARATE_CPU") {
+ separate_cpu = op_lexical_cast<bool>(val);
+ } else if (str == "SEPARATE_THREAD") {
+ separate_thread = op_lexical_cast<bool>(val);
+ } else if (str == "CALLGRAPH") {
+ callgraph_depth = op_lexical_cast<unsigned int>(val);
+ } else if (str == "BUF_WATERSHED") {
+ buffer_watershed = op_lexical_cast<unsigned int>(val);
+ } else if (str == "CPU_BUF_SIZE") {
+ cpu_buffer_size = op_lexical_cast<unsigned int>(val);
+ }
+ }
+}
+
+
+istream & operator>>(istream & in, config_setting & object)
+{
+ object.load(in);
+ return in;
+}
diff --git a/gui/oprof_start_config.h b/gui/oprof_start_config.h
new file mode 100644
index 0000000..07b25d8
--- /dev/null
+++ b/gui/oprof_start_config.h
@@ -0,0 +1,56 @@
+/**
+ * @file oprof_start_config.h
+ * GUI startup config management
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#ifndef OPROF_START_CONFIG_H
+#define OPROF_START_CONFIG_H
+
+#include <sys/types.h>
+#include <string>
+#include <iosfwd>
+
+/// Store the setup of one event
+struct event_setting {
+
+ event_setting();
+
+ uint count;
+ uint umask;
+ bool os_ring_count;
+ bool user_ring_count;
+};
+
+/**
+ * Store the general configuration of the profiler.
+ * There is no save(), instead opcontrol --setup must be
+ * called. This uses opcontrol's daemonrc file.
+ */
+struct config_setting {
+ config_setting();
+
+ void load(std::istream & in);
+
+ uint buffer_size;
+ uint note_table_size;
+ std::string kernel_filename;
+ bool no_kernel;
+ bool verbose;
+ bool separate_lib;
+ bool separate_kernel;
+ bool separate_cpu;
+ bool separate_thread;
+ uint callgraph_depth;
+ uint buffer_watershed;
+ uint cpu_buffer_size;
+};
+
+std::istream & operator>>(std::istream & in, config_setting & object);
+
+#endif // ! OPROF_START_CONFIG_H
diff --git a/gui/oprof_start_main.cpp b/gui/oprof_start_main.cpp
new file mode 100644
index 0000000..44da5de
--- /dev/null
+++ b/gui/oprof_start_main.cpp
@@ -0,0 +1,27 @@
+/**
+ * @file oprof_start_main.cpp
+ * main routine for GUI start
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#include <qapplication.h>
+
+#include "oprof_start.h"
+
+int main(int argc, char* argv[])
+{
+ QApplication a(argc, argv);
+
+ oprof_start* dlg = new oprof_start();
+
+ a.setMainWidget(dlg);
+
+ dlg->show();
+
+ return a.exec();
+}
diff --git a/gui/oprof_start_util.cpp b/gui/oprof_start_util.cpp
new file mode 100644
index 0000000..d293431
--- /dev/null
+++ b/gui/oprof_start_util.cpp
@@ -0,0 +1,331 @@
+/**
+ * @file oprof_start_util.cpp
+ * Miscellaneous helpers for the GUI start
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#include <dirent.h>
+#include <unistd.h>
+#include <glob.h>
+
+#include <cerrno>
+#include <vector>
+#include <cmath>
+#include <sstream>
+#include <iostream>
+#include <fstream>
+#include <cstdlib>
+
+#include <qfiledialog.h>
+#include <qmessagebox.h>
+
+#include "op_file.h"
+#include "file_manip.h"
+#include "child_reader.h"
+#include "op_libiberty.h"
+
+#include "oprof_start.h"
+#include "oprof_start_util.h"
+
+using namespace std;
+
+namespace {
+
+// return the ~ expansion suffixed with a '/'
+string const get_config_dir()
+{
+ return "/root";
+}
+
+string daemon_pid;
+
+} // namespace anon
+
+daemon_status::daemon_status()
+ : running(false),
+ nr_interrupts(0)
+{
+ int HZ;
+ if (!daemon_pid.empty()) {
+ string proc_filename = string("/proc/") + daemon_pid + "/exe";
+ string const exec = op_realpath(proc_filename);
+ if (exec == proc_filename)
+ daemon_pid.erase();
+ else
+ running = true;
+ }
+
+ if (daemon_pid.empty()) {
+ DIR * dir;
+ struct dirent * dirent;
+
+ if (!(dir = opendir("/proc"))) {
+ perror("oprofiled: /proc directory could not be opened. ");
+ exit(EXIT_FAILURE);
+ }
+
+ while ((dirent = readdir(dir))) {
+ string const exec =
+ op_realpath(string("/proc/")
+ + dirent->d_name + "/exe");
+ string const name = op_basename(exec);
+ if (name != "oprofiled")
+ continue;
+
+ daemon_pid = dirent->d_name;
+ running = true;
+ }
+
+ closedir(dir);
+ }
+
+ HZ = sysconf(_SC_CLK_TCK);
+ if (HZ == -1) {
+ perror("oprofiled: Unable to determine clock ticks per second. ");
+ exit(EXIT_FAILURE);
+ }
+
+ if (daemon_pid.empty())
+ return;
+
+ nr_interrupts = 0;
+
+ switch (op_get_interface()) {
+ case OP_INTERFACE_24:
+ {
+ ifstream ifs3("/proc/sys/dev/oprofile/nr_interrupts");
+ if (ifs3)
+ ifs3 >> nr_interrupts;
+ }
+ break;
+ case OP_INTERFACE_26:
+ {
+ static unsigned int old_sum_interrupts;
+ unsigned int sum_interrupts = 0;
+ glob_t file_names;
+
+ file_names.gl_offs = 0;
+ glob("/dev/oprofile/stats/cpu*/sample_received",
+ GLOB_DOOFFS, NULL, &file_names);
+
+ for (size_t i = 0; i < file_names.gl_pathc; ++i) {
+ ifstream ifs3(file_names.gl_pathv[i]);
+ if (ifs3) {
+ unsigned int file_interrupts;
+ ifs3 >> file_interrupts;
+ sum_interrupts += file_interrupts;
+ }
+ }
+ if (old_sum_interrupts > sum_interrupts)
+ // occur if we stop/restart daemon.
+ old_sum_interrupts = 0;
+ nr_interrupts = sum_interrupts - old_sum_interrupts;
+ old_sum_interrupts = sum_interrupts;
+ globfree(&file_names);
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+
+/**
+ * get_config_filename - get absolute filename of file in user $HOME
+ * @param filename the relative filename
+ *
+ * Get the absolute path of a file in a user's home directory.
+ */
+string const get_config_filename(string const & filename)
+{
+ return get_config_dir() + "/" + filename;
+}
+
+
+/**
+ * check_and_create_config_dir - make sure config dir is accessible
+ *
+ * Returns %true if the dir is accessible.
+ */
+bool check_and_create_config_dir()
+{
+ string dir = get_config_filename(".oprofile");
+
+ char * name = xstrdup(dir.c_str());
+
+ if (create_dir(name)) {
+ ostringstream out;
+ out << "unable to create " << dir << " directory ";
+ out << "cause: " << strerror(errno);
+ QMessageBox::warning(0, 0, out.str().c_str());
+
+ free(name);
+
+ return false;
+ }
+
+ free(name);
+ return true;
+}
+
+
+/**
+ * format - re-format a string
+ * @param orig string to format
+ * @param maxlen width of line
+ *
+ * Re-formats a string to fit into a certain width,
+ * breaking lines at spaces between words.
+ *
+ * Returns the formatted string
+ */
+string const format(string const & orig, uint const maxlen)
+{
+ string text(orig);
+
+ istringstream ss(text);
+ vector<string> lines;
+
+ string oline;
+ string line;
+
+ while (getline(ss, oline)) {
+ if (line.size() + oline.size() < maxlen) {
+ lines.push_back(line + oline);
+ line.erase();
+ } else {
+ lines.push_back(line);
+ line.erase();
+ string s;
+ string word;
+ istringstream oss(oline);
+ while (oss >> word) {
+ if (line.size() + word.size() > maxlen) {
+ lines.push_back(line);
+ line.erase();
+ }
+ line += word + " ";
+ }
+ }
+ }
+
+ if (line.size())
+ lines.push_back(line);
+
+ string ret;
+
+ for(vector<string>::const_iterator it = lines.begin(); it != lines.end(); ++it)
+ ret += *it + "\n";
+
+ return ret;
+}
+
+
+/**
+ * do_exec_command - execute a command
+ * @param cmd command name
+ * @param args arguments to command
+ *
+ * Execute a command synchronously. An error message is shown
+ * if the command returns a non-zero status, which is also returned.
+ *
+ * The arguments are verified and will refuse to execute if they contain
+ * shell metacharacters.
+ */
+int do_exec_command(string const & cmd, vector<string> const & args)
+{
+ ostringstream err;
+ bool ok = true;
+
+ // verify arguments
+ for (vector<string>::const_iterator cit = args.begin();
+ cit != args.end(); ++cit) {
+ if (verify_argument(*cit))
+ continue;
+
+ QMessageBox::warning(0, 0,
+ string(
+ "Could not execute: Argument \"" + *cit +
+ "\" contains shell metacharacters.\n").c_str());
+ return EINVAL;
+ }
+
+ child_reader reader(cmd, args);
+ if (reader.error())
+ ok = false;
+
+ if (ok)
+ reader.get_data(cout, err);
+
+ int ret = reader.terminate_process();
+ if (ret) {
+ string error = reader.error_str() + "\n";
+ error += "Failed: \n" + err.str() + "\n";
+ string cmdline = cmd;
+ for (vector<string>::const_iterator cit = args.begin();
+ cit != args.end(); ++cit) {
+ cmdline += " " + *cit + " ";
+ }
+ error += "\n\nCommand was :\n\n" + cmdline + "\n";
+
+ QMessageBox::warning(0, 0, format(error, 50).c_str());
+ }
+
+ return ret;
+}
+
+
+/**
+ * do_open_file_or_dir - open file/directory
+ * @param base_dir directory to start at
+ * @param dir_only directory or filename to select
+ *
+ * Select a file or directory. The selection is returned;
+ * an empty string if the selection was cancelled.
+ */
+string const do_open_file_or_dir(string const & base_dir, bool dir_only)
+{
+ QString result;
+
+ if (dir_only) {
+ result = QFileDialog::getExistingDirectory(base_dir.c_str(), 0,
+ "open_file_or_dir", "Get directory name", true);
+ } else {
+ result = QFileDialog::getOpenFileName(base_dir.c_str(), 0, 0,
+ "open_file_or_dir", "Get filename");
+ }
+
+ if (result.isNull())
+ return string();
+ else
+ return result.latin1();
+}
+
+/**
+ * verify_argument - check string for potentially dangerous characters
+ *
+ * This function returns false if the string contains dangerous shell
+ * metacharacters.
+ *
+ * WWW Security FAQ dangerous chars:
+ *
+ * & ; ` ' \ " | * ? ~ < > ^ ( ) [ ] { } $ \n \r
+ *
+ * David Wheeler: ! #
+ *
+ * We allow '-' because we disallow whitespace. We allow ':' and '='
+ */
+bool verify_argument(string const & str)
+{
+ if (str.find_first_not_of(
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ "abcdefghijklmnopqrstuvwxyz0123456789_:=-+%,./")
+ != string::npos)
+ return false;
+ return true;
+}
diff --git a/gui/oprof_start_util.h b/gui/oprof_start_util.h
new file mode 100644
index 0000000..cce646d
--- /dev/null
+++ b/gui/oprof_start_util.h
@@ -0,0 +1,39 @@
+/**
+ * @file oprof_start_util.h
+ * Miscellaneous helpers for the GUI start
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#ifndef OPROF_START_UTIL_H
+#define OPROF_START_UTIL_H
+
+#include <cmath>
+#include <string>
+#include <vector>
+
+/// Store various daemon status data
+struct daemon_status {
+ /// fill various data member according to the current daemon status
+ daemon_status();
+ bool running; ///< true if daemon is running
+ unsigned int nr_interrupts; ///< nr_interrupts from profiling start
+};
+
+inline double ratio(double x1, double x2)
+{
+ return fabs(((x1 - x2) / x2)) * 100;
+}
+
+std::string const get_config_filename(std::string const & filename);
+bool check_and_create_config_dir();
+std::string const format(std::string const & orig, uint const maxlen);
+int do_exec_command(std::string const & cmd, std::vector<std::string> const & args = std::vector<std::string>());
+std::string const do_open_file_or_dir(std::string const & base_dir, bool dir_only);
+bool verify_argument(std::string const & str);
+
+#endif // OPROF_START_UTIL_H
diff --git a/gui/ui/Makefile.am b/gui/ui/Makefile.am
new file mode 100644
index 0000000..387ef4e
--- /dev/null
+++ b/gui/ui/Makefile.am
@@ -0,0 +1,24 @@
+EXTRA_DIST = oprof_start.base.ui
+
+if have_qt
+
+AM_CPPFLAGS = @QT_INCLUDES@
+
+AM_CXXFLAGS = @OP_CXXFLAGS@
+
+noinst_LIBRARIES = liboprof_start.a
+nodist_liboprof_start_a_SOURCES = oprof_start.base.cpp oprof_start.base.moc.cpp
+
+oprof_start.base.h: oprof_start.base.ui
+ $(UIC) -o $@ $<
+
+oprof_start.base.cpp: oprof_start.base.h oprof_start.base.ui
+ $(UIC) -o $@ -impl $^
+
+oprof_start.base.moc.cpp: oprof_start.base.h
+ $(MOC) -o $@ $<
+
+clean-local:
+ rm -f oprof_start.base.h oprof_start.base.cpp oprof_start.base.moc.cpp
+
+endif
diff --git a/gui/ui/Makefile.in b/gui/ui/Makefile.in
new file mode 100644
index 0000000..020db85
--- /dev/null
+++ b/gui/ui/Makefile.in
@@ -0,0 +1,493 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = gui/ui
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/binutils.m4 \
+ $(top_srcdir)/m4/builtinexpect.m4 \
+ $(top_srcdir)/m4/cellspubfdsupport.m4 \
+ $(top_srcdir)/m4/compileroption.m4 \
+ $(top_srcdir)/m4/configmodule.m4 \
+ $(top_srcdir)/m4/copyifchange.m4 $(top_srcdir)/m4/docbook.m4 \
+ $(top_srcdir)/m4/extradirs.m4 $(top_srcdir)/m4/findkernel.m4 \
+ $(top_srcdir)/m4/kerneloption.m4 \
+ $(top_srcdir)/m4/kernelversion.m4 \
+ $(top_srcdir)/m4/mallocattribute.m4 \
+ $(top_srcdir)/m4/poptconst.m4 \
+ $(top_srcdir)/m4/precompiledheader.m4 $(top_srcdir)/m4/qt.m4 \
+ $(top_srcdir)/m4/resultyn.m4 $(top_srcdir)/m4/sstream.m4 \
+ $(top_srcdir)/m4/typedef.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+ARFLAGS = cru
+liboprof_start_a_AR = $(AR) $(ARFLAGS)
+liboprof_start_a_LIBADD =
+@have_qt_TRUE@nodist_liboprof_start_a_OBJECTS = \
+@have_qt_TRUE@ oprof_start.base.$(OBJEXT) \
+@have_qt_TRUE@ oprof_start.base.moc.$(OBJEXT)
+liboprof_start_a_OBJECTS = $(nodist_liboprof_start_a_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(nodist_liboprof_start_a_SOURCES)
+DIST_SOURCES =
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFD_LIBS = @BFD_LIBS@
+BUILD_JVMPI_AGENT_FALSE = @BUILD_JVMPI_AGENT_FALSE@
+BUILD_JVMPI_AGENT_TRUE = @BUILD_JVMPI_AGENT_TRUE@
+BUILD_JVMTI_AGENT_FALSE = @BUILD_JVMTI_AGENT_FALSE@
+BUILD_JVMTI_AGENT_TRUE = @BUILD_JVMTI_AGENT_TRUE@
+CAT_ENTRY_END = @CAT_ENTRY_END@
+CAT_ENTRY_START = @CAT_ENTRY_START@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOCBOOK_ROOT = @DOCBOOK_ROOT@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+EXTRA_CFLAGS_MODULE = @EXTRA_CFLAGS_MODULE@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAVA_HOMEDIR = @JAVA_HOMEDIR@
+KINC = @KINC@
+KSRC = @KSRC@
+KVERS = @KVERS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBERTY_LIBS = @LIBERTY_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MOC = @MOC@
+MODINSTALLDIR = @MODINSTALLDIR@
+OBJEXT = @OBJEXT@
+OPROFILE_DIR = @OPROFILE_DIR@
+OPROFILE_MODULE_ARCH = @OPROFILE_MODULE_ARCH@
+OP_CFLAGS = @OP_CFLAGS@
+OP_CXXFLAGS = @OP_CXXFLAGS@
+OP_DOCDIR = @OP_DOCDIR@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POPT_LIBS = @POPT_LIBS@
+PTRDIFF_T_TYPE = @PTRDIFF_T_TYPE@
+QT_INCLUDES = @QT_INCLUDES@
+QT_LDFLAGS = @QT_LDFLAGS@
+QT_LIB = @QT_LIB@
+QT_VERSION = @QT_VERSION@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIZE_T_TYPE = @SIZE_T_TYPE@
+STRIP = @STRIP@
+UIC = @UIC@
+VERSION = @VERSION@
+XML_CATALOG = @XML_CATALOG@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+have_qt_FALSE = @have_qt_FALSE@
+have_qt_TRUE = @have_qt_TRUE@
+have_xsltproc_FALSE = @have_xsltproc_FALSE@
+have_xsltproc_TRUE = @have_xsltproc_TRUE@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+kernel_support_FALSE = @kernel_support_FALSE@
+kernel_support_TRUE = @kernel_support_TRUE@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+topdir = @topdir@
+EXTRA_DIST = oprof_start.base.ui
+@have_qt_TRUE@AM_CPPFLAGS = @QT_INCLUDES@
+@have_qt_TRUE@AM_CXXFLAGS = @OP_CXXFLAGS@
+@have_qt_TRUE@noinst_LIBRARIES = liboprof_start.a
+@have_qt_TRUE@nodist_liboprof_start_a_SOURCES = oprof_start.base.cpp oprof_start.base.moc.cpp
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign gui/ui/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign gui/ui/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLIBRARIES:
+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+liboprof_start.a: $(liboprof_start_a_OBJECTS) $(liboprof_start_a_DEPENDENCIES)
+ -rm -f liboprof_start.a
+ $(liboprof_start_a_AR) liboprof_start.a $(liboprof_start_a_OBJECTS) $(liboprof_start_a_LIBADD)
+ $(RANLIB) liboprof_start.a
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oprof_start.base.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oprof_start.base.moc.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LIBRARIES)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+@have_qt_FALSE@clean-local:
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-local \
+ clean-noinstLIBRARIES mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-local clean-noinstLIBRARIES ctags \
+ distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-exec install-exec-am install-info \
+ install-info-am install-man install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-info-am
+
+
+@have_qt_TRUE@oprof_start.base.h: oprof_start.base.ui
+@have_qt_TRUE@ $(UIC) -o $@ $<
+
+@have_qt_TRUE@oprof_start.base.cpp: oprof_start.base.h oprof_start.base.ui
+@have_qt_TRUE@ $(UIC) -o $@ -impl $^
+
+@have_qt_TRUE@oprof_start.base.moc.cpp: oprof_start.base.h
+@have_qt_TRUE@ $(MOC) -o $@ $<
+
+@have_qt_TRUE@clean-local:
+@have_qt_TRUE@ rm -f oprof_start.base.h oprof_start.base.cpp oprof_start.base.moc.cpp
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/gui/ui/oprof_start.base.ui b/gui/ui/oprof_start.base.ui
new file mode 100644
index 0000000..4fcc43f
--- /dev/null
+++ b/gui/ui/oprof_start.base.ui
@@ -0,0 +1,1190 @@
+<!DOCTYPE UI><UI>
+<class>oprof_start_base</class>
+<widget>
+ <class>QDialog</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>oprof_start_base</cstring>
+ </property>
+ <property stdset="1">
+ <name>geometry</name>
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>625</width>
+ <height>735</height>
+ </rect>
+ </property>
+ <property stdset="1">
+ <name>caption</name>
+ <string>Start profiler</string>
+ </property>
+ <property stdset="1">
+ <name>sizeGripEnabled</name>
+ <bool>true</bool>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>11</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QTabWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>setup_config_tab</cstring>
+ </property>
+ <widget>
+ <class>QWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>counter_setup_page</cstring>
+ </property>
+ <attribute>
+ <name>title</name>
+ <string>&amp;Setup</string>
+ </attribute>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>11</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QGroupBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>counter_group</cstring>
+ </property>
+ <property stdset="1">
+ <name>title</name>
+ <string>Events</string>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>11</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout10</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QListView</class>
+ <column>
+ <property>
+ <name>text</name>
+ <string>Removedincode</string>
+ </property>
+ <property>
+ <name>clickable</name>
+ <bool>false</bool>
+ </property>
+ <property>
+ <name>resizeable</name>
+ <bool>true</bool>
+ </property>
+ </column>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>events_list</cstring>
+ </property>
+ <property stdset="1">
+ <name>minimumSize</name>
+ <size>
+ <width>250</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property stdset="1">
+ <name>selectionMode</name>
+ <enum>Multi</enum>
+ </property>
+ <property>
+ <name>toolTip</name>
+ <string>Available events</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout9</cstring>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>os_ring_count_cb</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Profile &amp;kernel</string>
+ </property>
+ <property>
+ <name>toolTip</name>
+ <string>Profile kernel code</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>user_ring_count_cb</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Profile &amp;user binaries</string>
+ </property>
+ <property>
+ <name>toolTip</name>
+ <string>Profile user libraries and applications</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout16</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1_2</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>C&amp;ount</string>
+ </property>
+ <property>
+ <name>buddy</name>
+ <cstring>event_count_edit</cstring>
+ </property>
+ </widget>
+ <widget>
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>event_count_edit</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ </sizepolicy>
+ </property>
+ <property>
+ <name>toolTip</name>
+ <string>Set the count value</string>
+ </property>
+ </widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer13_2</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Horizontal</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Expanding</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QButtonGroup</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>unit_mask_group</cstring>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>5</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>title</name>
+ <string>Unit mask</string>
+ </property>
+ <property>
+ <name>toolTip</name>
+ <string>Unit mask settings for this event</string>
+ </property>
+ <grid>
+ <property stdset="1">
+ <name>margin</name>
+ <number>11</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget row="0" column="0" >
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>check0</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>check0</string>
+ </property>
+ </widget>
+ <widget row="1" column="0" rowspan="2" colspan="2" >
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>check1</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>check1</string>
+ </property>
+ </widget>
+ <widget row="3" column="0" rowspan="2" colspan="2" >
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>check2</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>check2</string>
+ </property>
+ </widget>
+ <widget row="5" column="0" >
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>check3</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>check3</string>
+ </property>
+ </widget>
+ <widget row="6" column="0" >
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>check4</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>check4</string>
+ </property>
+ </widget>
+ <widget row="7" column="0" >
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>check5</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>check5</string>
+ </property>
+ </widget>
+ <widget row="8" column="0" rowspan="2" colspan="2" >
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>check6</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>check6</string>
+ </property>
+ </widget>
+ <widget row="10" column="0" >
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>check7</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>check7</string>
+ </property>
+ </widget>
+ <spacer row="11" column="1" >
+ <property>
+ <name>name</name>
+ <cstring>Spacer14</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Vertical</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Expanding</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget row="5" column="1" >
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>check11</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>check11</string>
+ </property>
+ </widget>
+ <widget row="7" column="1" >
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>check13</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>check13</string>
+ </property>
+ </widget>
+ <widget row="10" column="1" >
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>check15</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>check15</string>
+ </property>
+ </widget>
+ <widget row="4" column="1" >
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>check10</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>check10</string>
+ </property>
+ </widget>
+ <widget row="9" column="1" >
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>check14</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>check14</string>
+ </property>
+ </widget>
+ <widget row="2" column="1" >
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>check9</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>check9</string>
+ </property>
+ </widget>
+ <widget row="0" column="1" >
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>check8</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>check8</string>
+ </property>
+ </widget>
+ <widget row="6" column="1" >
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>check12</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>check12</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>event_help_label</cstring>
+ </property>
+ <property stdset="1">
+ <name>enabled</name>
+ <bool>true</bool>
+ </property>
+ <property stdset="1">
+ <name>sizePolicy</name>
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>1</vsizetype>
+ </sizepolicy>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>WinPanel</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Sunken</enum>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string></string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget>
+ <class>QWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>configuration_page</cstring>
+ </property>
+ <attribute>
+ <name>title</name>
+ <string>&amp;Configuration</string>
+ </attribute>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>11</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout11</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>&amp;Kernel image file</string>
+ </property>
+ <property>
+ <name>buddy</name>
+ <cstring>kernel_filename_edit</cstring>
+ </property>
+ </widget>
+ <widget>
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>kernel_filename_edit</cstring>
+ </property>
+ <property>
+ <name>toolTip</name>
+ <string>The vmlinux file of the running kernel</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QToolButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>kernel_filename_tb</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>...</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>no_vmlinux</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>No kernel image</string>
+ </property>
+ <property>
+ <name>toolTip</name>
+ <string>No kernel image available. Disables kernel profiling.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout12</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout11</cstring>
+ </property>
+ <grid>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget row="0" column="1" >
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>buffer_size_edit</cstring>
+ </property>
+ <property>
+ <name>toolTip</name>
+ <string>The size of the profiler's buffers</string>
+ </property>
+ </widget>
+ <widget row="1" column="1" >
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>note_table_size_edit</cstring>
+ </property>
+ </widget>
+ <widget row="3" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>cpu_buffer_size_label</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Cpu buffer size</string>
+ </property>
+ <property>
+ <name>buddy</name>
+ <cstring>cpu_buffer_size_edit</cstring>
+ </property>
+ </widget>
+ <widget row="3" column="1" >
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>cpu_buffer_size_edit</cstring>
+ </property>
+ </widget>
+ <widget row="0" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>buffer_size_label</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>&amp;Buffer size</string>
+ </property>
+ <property>
+ <name>buddy</name>
+ <cstring>buffer_size_edit</cstring>
+ </property>
+ </widget>
+ <widget row="1" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>note_table_size_label</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Note Size</string>
+ </property>
+ <property>
+ <name>buddy</name>
+ <cstring>note_table_size_edit</cstring>
+ </property>
+ </widget>
+ <widget row="2" column="1" >
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>buffer_watershed_edit</cstring>
+ </property>
+ </widget>
+ <widget row="2" column="0" >
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>buffer_watershed_label</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Buffer watershed</string>
+ </property>
+ <property>
+ <name>buddy</name>
+ <cstring>buffer_watershed_edit</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer11</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Horizontal</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Expanding</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout36</cstring>
+ </property>
+ <grid>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget row="0" column="0" >
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout34</cstring>
+ </property>
+ <vbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>verbose</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>&amp;Verbose</string>
+ </property>
+ <property>
+ <name>toolTip</name>
+ <string>Very verbose output in log file</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>separate_lib_cb</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Per-application profiles</string>
+ </property>
+ <property>
+ <name>toolTip</name>
+ <string>Separate samples for each shared library. This increases the time and space overhead of OProfile.</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>separate_kernel_cb</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Per-application profiles, including kernel</string>
+ </property>
+ <property>
+ <name>toolTip</name>
+ <string>Separate samples for each shared library and kernel samples. This increases the time and space overhead of OProfile.</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>separate_cpu_cb</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Per-CPU profiles</string>
+ </property>
+ <property>
+ <name>toolTip</name>
+ <string>Separate samples for each shared library and kernel samples. This increases the time and space overhead of OProfile.</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QCheckBox</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>separate_thread_cb</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Per-thread/task profiles</string>
+ </property>
+ <property>
+ <name>toolTip</name>
+ <string>Separate samples for each shared library and kernel samples. This increases the time and space overhead of OProfile.</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout33</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>callgraph_depth_label</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>callgraph depth, zero to disable</string>
+ </property>
+ <property>
+ <name>buddy</name>
+ <cstring>callgraph_depth_edit</cstring>
+ </property>
+ </widget>
+ <widget>
+ <class>QLineEdit</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>callgraph_depth_edit</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <spacer row="0" column="1" >
+ <property>
+ <name>name</name>
+ <cstring>Spacer12</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Horizontal</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Expanding</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer9</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Vertical</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Expanding</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ </widget>
+ <widget>
+ <class>QLabel</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>daemon_label</cstring>
+ </property>
+ <property stdset="1">
+ <name>frameShape</name>
+ <enum>Panel</enum>
+ </property>
+ <property stdset="1">
+ <name>frameShadow</name>
+ <enum>Sunken</enum>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string></string>
+ </property>
+ <property>
+ <name>toolTip</name>
+ <string>Current daemon status</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QLayoutWidget</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>Layout37</cstring>
+ </property>
+ <hbox>
+ <property stdset="1">
+ <name>margin</name>
+ <number>0</number>
+ </property>
+ <property stdset="1">
+ <name>spacing</name>
+ <number>6</number>
+ </property>
+ <widget>
+ <class>QPushButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>start_profiler_btn</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>St&amp;art</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QPushButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>flush_profiler_data_btn</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>&amp;Flush</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QPushButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>stop_profiler_btn</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Stop</string>
+ </property>
+ </widget>
+ <spacer>
+ <property>
+ <name>name</name>
+ <cstring>Spacer5</cstring>
+ </property>
+ <property stdset="1">
+ <name>orientation</name>
+ <enum>Horizontal</enum>
+ </property>
+ <property stdset="1">
+ <name>sizeType</name>
+ <enum>Expanding</enum>
+ </property>
+ <property>
+ <name>sizeHint</name>
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget>
+ <class>QPushButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>reset_sample_files_btn</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Reset sample files</string>
+ </property>
+ </widget>
+ <widget>
+ <class>QPushButton</class>
+ <property stdset="1">
+ <name>name</name>
+ <cstring>quit_and_save_btn</cstring>
+ </property>
+ <property stdset="1">
+ <name>text</name>
+ <string>Save and &amp;quit</string>
+ </property>
+ <property stdset="1">
+ <name>autoDefault</name>
+ <bool>true</bool>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>start_profiler_btn</sender>
+ <signal>clicked()</signal>
+ <receiver>oprof_start_base</receiver>
+ <slot>on_start_profiler()</slot>
+ </connection>
+ <connection>
+ <sender>stop_profiler_btn</sender>
+ <signal>clicked()</signal>
+ <receiver>oprof_start_base</receiver>
+ <slot>on_stop_profiler()</slot>
+ </connection>
+ <connection>
+ <sender>flush_profiler_data_btn</sender>
+ <signal>clicked()</signal>
+ <receiver>oprof_start_base</receiver>
+ <slot>on_flush_profiler_data()</slot>
+ </connection>
+ <connection>
+ <sender>quit_and_save_btn</sender>
+ <signal>clicked()</signal>
+ <receiver>oprof_start_base</receiver>
+ <slot>accept()</slot>
+ </connection>
+ <connection>
+ <sender>kernel_filename_tb</sender>
+ <signal>clicked()</signal>
+ <receiver>oprof_start_base</receiver>
+ <slot>choose_kernel_filename()</slot>
+ </connection>
+ <connection>
+ <sender>no_vmlinux</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>kernel_filename_tb</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>no_vmlinux</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>kernel_filename_edit</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>no_vmlinux</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>TextLabel1</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>separate_kernel_cb</sender>
+ <signal>stateChanged(int)</signal>
+ <receiver>oprof_start_base</receiver>
+ <slot>on_separate_kernel_cb_changed(int)</slot>
+ </connection>
+ <connection>
+ <sender>reset_sample_files_btn</sender>
+ <signal>clicked()</signal>
+ <receiver>oprof_start_base</receiver>
+ <slot>on_reset_sample_files()</slot>
+ </connection>
+ <connection>
+ <sender>events_list</sender>
+ <signal>selectionChanged()</signal>
+ <receiver>oprof_start_base</receiver>
+ <slot>event_selected()</slot>
+ </connection>
+ <connection>
+ <sender>events_list</sender>
+ <signal>currentChanged(QListViewItem*)</signal>
+ <receiver>oprof_start_base</receiver>
+ <slot>event_over(QListViewItem *)</slot>
+ </connection>
+ <connection>
+ <sender>events_list</sender>
+ <signal>onItem(QListViewItem*)</signal>
+ <receiver>oprof_start_base</receiver>
+ <slot>event_over(QListViewItem *)</slot>
+ </connection>
+ <slot access="protected">choose_kernel_filename()</slot>
+ <slot access="protected">event_over(QListViewItem *)</slot>
+ <slot access="protected">event_selected()</slot>
+ <slot access="protected">on_reset_sample_files()</slot>
+ <slot access="protected">on_flush_profiler_data()</slot>
+ <slot access="protected">on_separate_kernel_cb_changed(int)</slot>
+ <slot access="protected">on_start_profiler()</slot>
+ <slot access="protected">on_stop_profiler()</slot>
+</connections>
+<tabstops>
+ <tabstop>setup_config_tab</tabstop>
+ <tabstop>events_list</tabstop>
+ <tabstop>os_ring_count_cb</tabstop>
+ <tabstop>user_ring_count_cb</tabstop>
+ <tabstop>event_count_edit</tabstop>
+ <tabstop>check0</tabstop>
+ <tabstop>check1</tabstop>
+ <tabstop>check2</tabstop>
+ <tabstop>check3</tabstop>
+ <tabstop>check4</tabstop>
+ <tabstop>check5</tabstop>
+ <tabstop>check6</tabstop>
+ <tabstop>check7</tabstop>
+ <tabstop>check8</tabstop>
+ <tabstop>check9</tabstop>
+ <tabstop>check10</tabstop>
+ <tabstop>check11</tabstop>
+ <tabstop>check12</tabstop>
+ <tabstop>check13</tabstop>
+ <tabstop>check14</tabstop>
+ <tabstop>check15</tabstop>
+ <tabstop>start_profiler_btn</tabstop>
+ <tabstop>flush_profiler_data_btn</tabstop>
+ <tabstop>stop_profiler_btn</tabstop>
+ <tabstop>reset_sample_files_btn</tabstop>
+ <tabstop>quit_and_save_btn</tabstop>
+ <tabstop>kernel_filename_edit</tabstop>
+ <tabstop>no_vmlinux</tabstop>
+ <tabstop>buffer_size_edit</tabstop>
+ <tabstop>note_table_size_edit</tabstop>
+ <tabstop>buffer_watershed_edit</tabstop>
+ <tabstop>verbose</tabstop>
+ <tabstop>separate_lib_cb</tabstop>
+ <tabstop>separate_kernel_cb</tabstop>
+ <tabstop>separate_cpu_cb</tabstop>
+ <tabstop>separate_thread_cb</tabstop>
+ <tabstop>callgraph_depth_edit</tabstop>
+</tabstops>
+</UI>
diff --git a/include/sstream b/include/sstream
new file mode 100644
index 0000000..45393b1
--- /dev/null
+++ b/include/sstream
@@ -0,0 +1,343 @@
+/* This is part of libio/iostream, providing -*- C++ -*- input/output.
+Copyright (C) 2000 Free Software Foundation
+
+This file is part of the GNU IO Library. This library is free
+software; you can redistribute it and/or modify it under the
+terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this library; see the file COPYING. If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+As a special exception, if you link this library with files
+compiled with a GNU compiler to produce an executable, this does not cause
+the resulting executable to be covered by the GNU General Public License.
+This exception does not however invalidate any other reasons why
+the executable file might be covered by the GNU General Public License. */
+
+/* Written by Magnus Fromreide (magfr@lysator.liu.se). */
+/* seekoff and ideas for overflow is largely borrowed from libstdc++-v3 */
+
+#ifndef __SSTREAM__
+#define __SSTREAM__
+
+#include <iostream.h>
+#include <streambuf.h>
+#include <string>
+
+namespace std
+{
+ class stringbuf : public streambuf
+ {
+ public:
+ typedef char char_type;
+ typedef int int_type;
+ typedef streampos pos_type;
+ typedef streamoff off_type;
+
+ explicit
+ stringbuf(int which=ios::in|ios::out)
+ : streambuf(), mode(static_cast<ios::open_mode>(which)),
+ stream(NULL), stream_len(0)
+ {
+ stringbuf_init();
+ }
+
+ explicit
+ stringbuf(const string &str, int which=ios::in|ios::out)
+ : streambuf(), mode(static_cast<ios::open_mode>(which)),
+ stream(NULL), stream_len(0)
+ {
+ if (mode & (ios::in|ios::out))
+ {
+ stream_len = str.size();
+ stream = new char_type[stream_len];
+ str.copy(stream, stream_len);
+ }
+ stringbuf_init();
+ }
+
+ virtual
+ ~stringbuf()
+ {
+ delete[] stream;
+ }
+
+ string
+ str() const
+ {
+ if (pbase() != 0)
+ return string(stream, pptr()-pbase());
+ else
+ return string();
+ }
+
+ void
+ str(const string& str)
+ {
+ delete[] stream;
+ stream_len = str.size();
+ stream = new char_type[stream_len];
+ str.copy(stream, stream_len);
+ stringbuf_init();
+ }
+
+ protected:
+ // The buffer is already in gptr, so if it ends then it is out of data.
+ virtual int
+ underflow()
+ {
+ return EOF;
+ }
+
+ virtual int
+ overflow(int c = EOF)
+ {
+ int res;
+ if (mode & ios::out)
+ {
+ if (c != EOF)
+ {
+ streamsize old_stream_len = stream_len;
+ stream_len += 1;
+ char_type* new_stream = new char_type[stream_len];
+ memcpy(new_stream, stream, old_stream_len);
+ delete[] stream;
+ stream = new_stream;
+ stringbuf_sync(gptr()-eback(), pptr()-pbase());
+ sputc(c);
+ res = c;
+ }
+ else
+ res = EOF;
+ }
+ else
+ res = 0;
+ return res;
+ }
+
+ virtual streambuf*
+ setbuf(char_type* s, streamsize n)
+ {
+ if (n != 0)
+ {
+ delete[] stream;
+ stream = new char_type[n];
+ memcpy(stream, s, n);
+ stream_len = n;
+ stringbuf_sync(0, 0);
+ }
+ return this;
+ }
+
+ virtual pos_type
+ seekoff(off_type off, ios::seek_dir way, int which = ios::in | ios::out)
+ {
+ pos_type ret = pos_type(off_type(-1));
+ bool testin = which & ios::in && mode & ios::in;
+ bool testout = which & ios::out && mode & ios::out;
+ bool testboth = testin && testout && way != ios::cur;
+
+ if (stream_len && ((testin != testout) || testboth))
+ {
+ char_type* beg = stream;
+ char_type* curi = NULL;
+ char_type* curo = NULL;
+ char_type* endi = NULL;
+ char_type* endo = NULL;
+
+ if (testin)
+ {
+ curi = gptr();
+ endi = egptr();
+ }
+ if (testout)
+ {
+ curo = pptr();
+ endo = epptr();
+ }
+
+ off_type newoffi = 0;
+ off_type newoffo = 0;
+ if (way == ios::beg)
+ {
+ newoffi = beg - curi;
+ newoffo = beg - curo;
+ }
+ else if (way == ios::end)
+ {
+ newoffi = endi - curi;
+ newoffo = endo - curo;
+ }
+
+ if (testin && newoffi + off + curi - beg >= 0 &&
+ endi - beg >= newoffi + off + curi - beg)
+ {
+ gbump(newoffi + off);
+ ret = pos_type(newoffi + off + curi);
+ }
+ if (testout && newoffo + off + curo - beg >= 0 &&
+ endo - beg >= newoffo + off + curo - beg)
+ {
+ pbump(newoffo + off);
+ ret = pos_type(newoffo + off + curo);
+ }
+ }
+ return ret;
+ }
+
+ virtual pos_type
+ seekpos(pos_type sp, int which = ios::in | ios::out)
+ {
+ pos_type ret = seekoff(sp, ios::beg, which);
+ return ret;
+ }
+
+ private:
+ void
+ stringbuf_sync(streamsize i, streamsize o)
+ {
+ if (mode & ios::in)
+ setg(stream, stream + i, stream + stream_len);
+ if (mode & ios::out)
+ {
+ setp(stream, stream + stream_len);
+ pbump(o);
+ }
+ }
+ void
+ stringbuf_init()
+ {
+ if (mode & ios::ate)
+ stringbuf_sync(0, stream_len);
+ else
+ stringbuf_sync(0, 0);
+ }
+
+ private:
+ ios::open_mode mode;
+ char_type* stream;
+ streamsize stream_len;
+ };
+
+ class istringstream : public istream {
+ public:
+ typedef char char_type;
+ typedef int int_type;
+ typedef streampos pos_type;
+ typedef streamoff off_type;
+
+ explicit
+ istringstream(int which=ios::in)
+ : istream(&sb), sb(which | ios::in)
+ { }
+
+ explicit
+ istringstream(const string& str, int which=ios::in)
+ : istream(&sb), sb(str, which | ios::in)
+ { }
+
+ stringbuf*
+ rdbuf() const
+ {
+ return const_cast<stringbuf*>(&sb);
+ }
+
+ string
+ str() const
+ {
+ return rdbuf()->str();
+ }
+ void
+ str(const string& s)
+ {
+ rdbuf()->str(s);
+ }
+ private:
+ stringbuf sb;
+ };
+
+ class ostringstream : public ostream {
+ public:
+ typedef char char_type;
+ typedef int int_type;
+ typedef streampos pos_type;
+ typedef streamoff off_type;
+
+ explicit
+ ostringstream(int which=ios::out)
+ : ostream(&sb), sb(which | ios::out)
+ { }
+
+ explicit
+ ostringstream(const string& str, int which=ios::out)
+ : ostream(&sb), sb(str, which | ios::out)
+ { }
+
+ stringbuf*
+ rdbuf() const
+ {
+ return const_cast<stringbuf*>(&sb);
+ }
+
+ string
+ str() const
+ {
+ return rdbuf()->str();
+ }
+
+ void str(const string& s)
+ {
+ rdbuf()->str(s);
+ }
+ private:
+ stringbuf sb;
+ };
+
+ class stringstream : public iostream {
+ public:
+ typedef char char_type;
+ typedef int int_type;
+ typedef streampos pos_type;
+ typedef streamoff off_type;
+
+ explicit
+ stringstream(int which=ios::out|ios::in)
+ : iostream(&sb), sb(which)
+ { }
+
+ explicit
+ stringstream(const string& str, int which=ios::out|ios::in)
+ : iostream(&sb), sb(str, which)
+ { }
+
+ stringbuf*
+ rdbuf() const
+ {
+ return const_cast<stringbuf*>(&sb);
+ }
+
+ string
+ str() const
+ {
+ return rdbuf()->str();
+ }
+
+ void
+ str(const string& s)
+ {
+ rdbuf()->str(s);
+ }
+ private:
+ stringbuf sb;
+ };
+};
+
+#endif /* not __STRSTREAM__ */
diff --git a/install-sh b/install-sh
new file mode 100755
index 0000000..4d4a951
--- /dev/null
+++ b/install-sh
@@ -0,0 +1,323 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2005-05-14.22
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch. It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+chmodcmd="$chmodprog 0755"
+chowncmd=
+chgrpcmd=
+stripcmd=
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=
+dst=
+dir_arg=
+dstarg=
+no_target_directory=
+
+usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+ or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+-c (ignored)
+-d create directories instead of installing files.
+-g GROUP $chgrpprog installed files to GROUP.
+-m MODE $chmodprog installed files to MODE.
+-o USER $chownprog installed files to USER.
+-s $stripprog installed files.
+-t DIRECTORY install into DIRECTORY.
+-T report an error if DSTFILE is a directory.
+--help display this help and exit.
+--version display version info and exit.
+
+Environment variables override the default commands:
+ CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
+"
+
+while test -n "$1"; do
+ case $1 in
+ -c) shift
+ continue;;
+
+ -d) dir_arg=true
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ --help) echo "$usage"; exit $?;;
+
+ -m) chmodcmd="$chmodprog $2"
+ shift
+ shift
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd=$stripprog
+ shift
+ continue;;
+
+ -t) dstarg=$2
+ shift
+ shift
+ continue;;
+
+ -T) no_target_directory=true
+ shift
+ continue;;
+
+ --version) echo "$0 $scriptversion"; exit $?;;
+
+ *) # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ test -n "$dir_arg$dstarg" && break
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dstarg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dstarg"
+ shift # fnord
+ fi
+ shift # arg
+ dstarg=$arg
+ done
+ break;;
+ esac
+done
+
+if test -z "$1"; then
+ if test -z "$dir_arg"; then
+ echo "$0: no input file specified." >&2
+ exit 1
+ fi
+ # It's OK to call `install-sh -d' without argument.
+ # This can happen when creating conditional directories.
+ exit 0
+fi
+
+for src
+do
+ # Protect names starting with `-'.
+ case $src in
+ -*) src=./$src ;;
+ esac
+
+ if test -n "$dir_arg"; then
+ dst=$src
+ src=
+
+ if test -d "$dst"; then
+ mkdircmd=:
+ chmodcmd=
+ else
+ mkdircmd=$mkdirprog
+ fi
+ else
+ # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+ # might cause directories to be created, which would be especially bad
+ # if $src (and thus $dsttmp) contains '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
+
+ if test -z "$dstarg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
+
+ dst=$dstarg
+ # Protect names starting with `-'.
+ case $dst in
+ -*) dst=./$dst ;;
+ esac
+
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
+ if test -d "$dst"; then
+ if test -n "$no_target_directory"; then
+ echo "$0: $dstarg: Is a directory" >&2
+ exit 1
+ fi
+ dst=$dst/`basename "$src"`
+ fi
+ fi
+
+ # This sed command emulates the dirname command.
+ dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
+
+ # Make sure that the destination directory exists.
+
+ # Skip lots of stat calls in the usual case.
+ if test ! -d "$dstdir"; then
+ defaultIFS='
+ '
+ IFS="${IFS-$defaultIFS}"
+
+ oIFS=$IFS
+ # Some sh's can't handle IFS=/ for some reason.
+ IFS='%'
+ set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
+ shift
+ IFS=$oIFS
+
+ pathcomp=
+
+ while test $# -ne 0 ; do
+ pathcomp=$pathcomp$1
+ shift
+ if test ! -d "$pathcomp"; then
+ $mkdirprog "$pathcomp"
+ # mkdir can fail with a `File exist' error in case several
+ # install-sh are creating the directory concurrently. This
+ # is OK.
+ test -d "$pathcomp" || exit
+ fi
+ pathcomp=$pathcomp/
+ done
+ fi
+
+ if test -n "$dir_arg"; then
+ $doit $mkdircmd "$dst" \
+ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
+ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
+ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
+ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
+
+ else
+ dstfile=`basename "$dst"`
+
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=$dstdir/_inst.$$_
+ rmtmp=$dstdir/_rm.$$_
+
+ # Trap to clean up those temp files at exit.
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+ trap '(exit $?); exit' 1 2 13 15
+
+ # Copy the file name to the temp name.
+ $doit $cpprog "$src" "$dsttmp" &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+ # If any of these fail, we abort the whole thing. If we want to
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $cpprog $src $dsttmp" command.
+ #
+ { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
+ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
+ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
+ && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
+
+ # Now rename the file to the real destination.
+ { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
+ || {
+ # The rename failed, perhaps because mv can't rename something else
+ # to itself, or perhaps because mv is so ancient that it does not
+ # support -f.
+
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ if test -f "$dstdir/$dstfile"; then
+ $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
+ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
+ || {
+ echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
+ (exit 1); exit 1
+ }
+ else
+ :
+ fi
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
+ }
+ }
+ fi || { (exit 1); exit 1; }
+done
+
+# The final little trick to "correctly" pass the exit status to the exit trap.
+{
+ (exit 0); exit 0
+}
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/libabi/Makefile.am b/libabi/Makefile.am
new file mode 100644
index 0000000..95c0c8c
--- /dev/null
+++ b/libabi/Makefile.am
@@ -0,0 +1,24 @@
+SUBDIRS=. tests
+
+LIBS=@POPT_LIBS@ @LIBERTY_LIBS@
+
+AM_CPPFLAGS = \
+ -I ${top_srcdir}/libop \
+ -I ${top_srcdir}/libutil \
+ -I ${top_srcdir}/libdb \
+ -I ${top_srcdir}/libopt++
+
+AM_CXXFLAGS = @OP_CXXFLAGS@
+
+noinst_LIBRARIES = libabi.a
+libabi_a_SOURCES = abi.cpp abi.h op_abi.c op_abi.h
+
+bin_PROGRAMS = opimport
+
+opimport_SOURCES = opimport.cpp
+opimport_LDADD = \
+ libabi.a \
+ ../libdb/libodb.a \
+ ../libopt++/libopt++.a \
+ ../libutil++/libutil++.a \
+ ../libutil/libutil.a
diff --git a/libabi/Makefile.in b/libabi/Makefile.in
new file mode 100644
index 0000000..bcd3eba
--- /dev/null
+++ b/libabi/Makefile.in
@@ -0,0 +1,677 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+bin_PROGRAMS = opimport$(EXEEXT)
+subdir = libabi
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/binutils.m4 \
+ $(top_srcdir)/m4/builtinexpect.m4 \
+ $(top_srcdir)/m4/cellspubfdsupport.m4 \
+ $(top_srcdir)/m4/compileroption.m4 \
+ $(top_srcdir)/m4/configmodule.m4 \
+ $(top_srcdir)/m4/copyifchange.m4 $(top_srcdir)/m4/docbook.m4 \
+ $(top_srcdir)/m4/extradirs.m4 $(top_srcdir)/m4/findkernel.m4 \
+ $(top_srcdir)/m4/kerneloption.m4 \
+ $(top_srcdir)/m4/kernelversion.m4 \
+ $(top_srcdir)/m4/mallocattribute.m4 \
+ $(top_srcdir)/m4/poptconst.m4 \
+ $(top_srcdir)/m4/precompiledheader.m4 $(top_srcdir)/m4/qt.m4 \
+ $(top_srcdir)/m4/resultyn.m4 $(top_srcdir)/m4/sstream.m4 \
+ $(top_srcdir)/m4/typedef.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+ARFLAGS = cru
+libabi_a_AR = $(AR) $(ARFLAGS)
+libabi_a_LIBADD =
+am_libabi_a_OBJECTS = abi.$(OBJEXT) op_abi.$(OBJEXT)
+libabi_a_OBJECTS = $(am_libabi_a_OBJECTS)
+am__installdirs = "$(DESTDIR)$(bindir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am_opimport_OBJECTS = opimport.$(OBJEXT)
+opimport_OBJECTS = $(am_opimport_OBJECTS)
+opimport_DEPENDENCIES = libabi.a ../libdb/libodb.a \
+ ../libopt++/libopt++.a ../libutil++/libutil++.a \
+ ../libutil/libutil.a
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libabi_a_SOURCES) $(opimport_SOURCES)
+DIST_SOURCES = $(libabi_a_SOURCES) $(opimport_SOURCES)
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-exec-recursive install-info-recursive \
+ install-recursive installcheck-recursive installdirs-recursive \
+ pdf-recursive ps-recursive uninstall-info-recursive \
+ uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFD_LIBS = @BFD_LIBS@
+BUILD_JVMPI_AGENT_FALSE = @BUILD_JVMPI_AGENT_FALSE@
+BUILD_JVMPI_AGENT_TRUE = @BUILD_JVMPI_AGENT_TRUE@
+BUILD_JVMTI_AGENT_FALSE = @BUILD_JVMTI_AGENT_FALSE@
+BUILD_JVMTI_AGENT_TRUE = @BUILD_JVMTI_AGENT_TRUE@
+CAT_ENTRY_END = @CAT_ENTRY_END@
+CAT_ENTRY_START = @CAT_ENTRY_START@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOCBOOK_ROOT = @DOCBOOK_ROOT@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+EXTRA_CFLAGS_MODULE = @EXTRA_CFLAGS_MODULE@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAVA_HOMEDIR = @JAVA_HOMEDIR@
+KINC = @KINC@
+KSRC = @KSRC@
+KVERS = @KVERS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBERTY_LIBS = @LIBERTY_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @POPT_LIBS@ @LIBERTY_LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MOC = @MOC@
+MODINSTALLDIR = @MODINSTALLDIR@
+OBJEXT = @OBJEXT@
+OPROFILE_DIR = @OPROFILE_DIR@
+OPROFILE_MODULE_ARCH = @OPROFILE_MODULE_ARCH@
+OP_CFLAGS = @OP_CFLAGS@
+OP_CXXFLAGS = @OP_CXXFLAGS@
+OP_DOCDIR = @OP_DOCDIR@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POPT_LIBS = @POPT_LIBS@
+PTRDIFF_T_TYPE = @PTRDIFF_T_TYPE@
+QT_INCLUDES = @QT_INCLUDES@
+QT_LDFLAGS = @QT_LDFLAGS@
+QT_LIB = @QT_LIB@
+QT_VERSION = @QT_VERSION@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIZE_T_TYPE = @SIZE_T_TYPE@
+STRIP = @STRIP@
+UIC = @UIC@
+VERSION = @VERSION@
+XML_CATALOG = @XML_CATALOG@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+have_qt_FALSE = @have_qt_FALSE@
+have_qt_TRUE = @have_qt_TRUE@
+have_xsltproc_FALSE = @have_xsltproc_FALSE@
+have_xsltproc_TRUE = @have_xsltproc_TRUE@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+kernel_support_FALSE = @kernel_support_FALSE@
+kernel_support_TRUE = @kernel_support_TRUE@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+topdir = @topdir@
+SUBDIRS = . tests
+AM_CPPFLAGS = \
+ -I ${top_srcdir}/libop \
+ -I ${top_srcdir}/libutil \
+ -I ${top_srcdir}/libdb \
+ -I ${top_srcdir}/libopt++
+
+AM_CXXFLAGS = @OP_CXXFLAGS@
+noinst_LIBRARIES = libabi.a
+libabi_a_SOURCES = abi.cpp abi.h op_abi.c op_abi.h
+opimport_SOURCES = opimport.cpp
+opimport_LDADD = \
+ libabi.a \
+ ../libdb/libodb.a \
+ ../libopt++/libopt++.a \
+ ../libutil++/libutil++.a \
+ ../libutil/libutil.a
+
+all: all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .c .cpp .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libabi/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign libabi/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLIBRARIES:
+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+libabi.a: $(libabi_a_OBJECTS) $(libabi_a_DEPENDENCIES)
+ -rm -f libabi.a
+ $(libabi_a_AR) libabi.a $(libabi_a_OBJECTS) $(libabi_a_LIBADD)
+ $(RANLIB) libabi.a
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ if test -f $$p \
+ || test -f $$p1 \
+ ; then \
+ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+ else :; fi; \
+ done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+ rm -f "$(DESTDIR)$(bindir)/$$f"; \
+ done
+
+clean-binPROGRAMS:
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+opimport$(EXEEXT): $(opimport_OBJECTS) $(opimport_DEPENDENCIES)
+ @rm -f opimport$(EXEEXT)
+ $(CXXLINK) $(opimport_LDFLAGS) $(opimport_OBJECTS) $(opimport_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/abi.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/op_abi.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opimport.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+.cpp.o:
+@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(mkdir_p) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(LIBRARIES) $(PROGRAMS)
+installdirs: installdirs-recursive
+installdirs-am:
+ for dir in "$(DESTDIR)$(bindir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-binPROGRAMS clean-generic clean-libtool \
+ clean-noinstLIBRARIES mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+ clean clean-binPROGRAMS clean-generic clean-libtool \
+ clean-noinstLIBRARIES clean-recursive ctags ctags-recursive \
+ distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-recursive distclean-tags distdir \
+ dvi dvi-am html html-am info info-am install install-am \
+ install-binPROGRAMS install-data install-data-am install-exec \
+ install-exec-am install-info install-info-am install-man \
+ install-strip installcheck installcheck-am installdirs \
+ installdirs-am maintainer-clean maintainer-clean-generic \
+ maintainer-clean-recursive mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \
+ pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
+ uninstall-binPROGRAMS uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/libabi/tests/Makefile.am b/libabi/tests/Makefile.am
new file mode 100644
index 0000000..3eb7e1a
--- /dev/null
+++ b/libabi/tests/Makefile.am
@@ -0,0 +1,21 @@
+LIBS=@POPT_LIBS@ @LIBERTY_LIBS@
+
+AM_CPPFLAGS = \
+ -I ${top_srcdir}/libabi \
+ -I ${top_srcdir}/libop \
+ -I ${top_srcdir}/libdb \
+ -I ${top_srcdir}/libopt++ \
+ -I ${top_srcdir}/libutil
+
+AM_CXXFLAGS = @OP_CXXFLAGS@
+
+check_PROGRAMS = abi_test
+
+abi_test_SOURCES = abi_test.cpp
+abi_test_LDADD = \
+ ../libabi.a \
+ ../../libop/libop.a \
+ ../../libdb/libodb.a \
+ ../../libopt++/libopt++.a \
+ ../../libutil++/libutil++.a \
+ ../../libutil/libutil.a
diff --git a/libabi/tests/Makefile.in b/libabi/tests/Makefile.in
new file mode 100644
index 0000000..3203cb3
--- /dev/null
+++ b/libabi/tests/Makefile.in
@@ -0,0 +1,492 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+check_PROGRAMS = abi_test$(EXEEXT)
+subdir = libabi/tests
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/binutils.m4 \
+ $(top_srcdir)/m4/builtinexpect.m4 \
+ $(top_srcdir)/m4/cellspubfdsupport.m4 \
+ $(top_srcdir)/m4/compileroption.m4 \
+ $(top_srcdir)/m4/configmodule.m4 \
+ $(top_srcdir)/m4/copyifchange.m4 $(top_srcdir)/m4/docbook.m4 \
+ $(top_srcdir)/m4/extradirs.m4 $(top_srcdir)/m4/findkernel.m4 \
+ $(top_srcdir)/m4/kerneloption.m4 \
+ $(top_srcdir)/m4/kernelversion.m4 \
+ $(top_srcdir)/m4/mallocattribute.m4 \
+ $(top_srcdir)/m4/poptconst.m4 \
+ $(top_srcdir)/m4/precompiledheader.m4 $(top_srcdir)/m4/qt.m4 \
+ $(top_srcdir)/m4/resultyn.m4 $(top_srcdir)/m4/sstream.m4 \
+ $(top_srcdir)/m4/typedef.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am_abi_test_OBJECTS = abi_test.$(OBJEXT)
+abi_test_OBJECTS = $(am_abi_test_OBJECTS)
+abi_test_DEPENDENCIES = ../libabi.a ../../libop/libop.a \
+ ../../libdb/libodb.a ../../libopt++/libopt++.a \
+ ../../libutil++/libutil++.a ../../libutil/libutil.a
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(abi_test_SOURCES)
+DIST_SOURCES = $(abi_test_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFD_LIBS = @BFD_LIBS@
+BUILD_JVMPI_AGENT_FALSE = @BUILD_JVMPI_AGENT_FALSE@
+BUILD_JVMPI_AGENT_TRUE = @BUILD_JVMPI_AGENT_TRUE@
+BUILD_JVMTI_AGENT_FALSE = @BUILD_JVMTI_AGENT_FALSE@
+BUILD_JVMTI_AGENT_TRUE = @BUILD_JVMTI_AGENT_TRUE@
+CAT_ENTRY_END = @CAT_ENTRY_END@
+CAT_ENTRY_START = @CAT_ENTRY_START@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOCBOOK_ROOT = @DOCBOOK_ROOT@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+EXTRA_CFLAGS_MODULE = @EXTRA_CFLAGS_MODULE@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAVA_HOMEDIR = @JAVA_HOMEDIR@
+KINC = @KINC@
+KSRC = @KSRC@
+KVERS = @KVERS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBERTY_LIBS = @LIBERTY_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @POPT_LIBS@ @LIBERTY_LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MOC = @MOC@
+MODINSTALLDIR = @MODINSTALLDIR@
+OBJEXT = @OBJEXT@
+OPROFILE_DIR = @OPROFILE_DIR@
+OPROFILE_MODULE_ARCH = @OPROFILE_MODULE_ARCH@
+OP_CFLAGS = @OP_CFLAGS@
+OP_CXXFLAGS = @OP_CXXFLAGS@
+OP_DOCDIR = @OP_DOCDIR@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POPT_LIBS = @POPT_LIBS@
+PTRDIFF_T_TYPE = @PTRDIFF_T_TYPE@
+QT_INCLUDES = @QT_INCLUDES@
+QT_LDFLAGS = @QT_LDFLAGS@
+QT_LIB = @QT_LIB@
+QT_VERSION = @QT_VERSION@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIZE_T_TYPE = @SIZE_T_TYPE@
+STRIP = @STRIP@
+UIC = @UIC@
+VERSION = @VERSION@
+XML_CATALOG = @XML_CATALOG@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+have_qt_FALSE = @have_qt_FALSE@
+have_qt_TRUE = @have_qt_TRUE@
+have_xsltproc_FALSE = @have_xsltproc_FALSE@
+have_xsltproc_TRUE = @have_xsltproc_TRUE@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+kernel_support_FALSE = @kernel_support_FALSE@
+kernel_support_TRUE = @kernel_support_TRUE@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+topdir = @topdir@
+AM_CPPFLAGS = \
+ -I ${top_srcdir}/libabi \
+ -I ${top_srcdir}/libop \
+ -I ${top_srcdir}/libdb \
+ -I ${top_srcdir}/libopt++ \
+ -I ${top_srcdir}/libutil
+
+AM_CXXFLAGS = @OP_CXXFLAGS@
+abi_test_SOURCES = abi_test.cpp
+abi_test_LDADD = \
+ ../libabi.a \
+ ../../libop/libop.a \
+ ../../libdb/libodb.a \
+ ../../libopt++/libopt++.a \
+ ../../libutil++/libutil++.a \
+ ../../libutil/libutil.a
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libabi/tests/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign libabi/tests/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-checkPROGRAMS:
+ @list='$(check_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+abi_test$(EXEEXT): $(abi_test_OBJECTS) $(abi_test_DEPENDENCIES)
+ @rm -f abi_test$(EXEEXT)
+ $(CXXLINK) $(abi_test_LDFLAGS) $(abi_test_OBJECTS) $(abi_test_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/abi_test.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean \
+ clean-checkPROGRAMS clean-generic clean-libtool ctags \
+ distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-exec install-exec-am install-info \
+ install-info-am install-man install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/libabi/tests/abi_test.cpp b/libabi/tests/abi_test.cpp
new file mode 100644
index 0000000..b129a28
--- /dev/null
+++ b/libabi/tests/abi_test.cpp
@@ -0,0 +1,96 @@
+/**
+ * @file abi_test.cpp
+ * Import sample files from other ABI
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Graydon Hoare
+ */
+
+#include "abi.h"
+#include "odb.h"
+#include "popt_options.h"
+#include "op_sample_file.h"
+#include "op_cpu_type.h"
+#include "op_config.h"
+
+#include <fstream>
+#include <iostream>
+
+#include <cstdlib>
+#include <cstring>
+
+using namespace std;
+
+namespace {
+ string db_filename;
+ string abi_filename;
+}
+
+
+popt::option options_array[] = {
+ popt::option(db_filename, "db", 'd', "output db to file", "filename"),
+ popt::option(abi_filename, "abi", 'a', "output abi to file", "filename")
+};
+
+
+int main(int argc, char const ** argv)
+{
+ vector<string> rest;
+ popt::parse_options(argc, argv, rest);
+
+ if (abi_filename.empty() && db_filename.empty()) {
+ cerr << "error: no file specified to work on" << endl;
+ exit(1);
+ }
+
+
+ if (!abi_filename.empty()) {
+ ofstream file(abi_filename.c_str());
+ if (!file) {
+ cerr << "error: cannot open " << abi_filename
+ << " for writing" << endl;
+ exit(1);
+ }
+ file << abi();
+ }
+
+ if (!db_filename.empty()) {
+ odb_t dest;
+ int rc = odb_open(&dest, db_filename.c_str(), ODB_RDWR,
+ sizeof(struct opd_header));
+
+ if (rc) {
+ cerr << "odb_open() fail:\n"
+ << strerror(rc) << endl;
+ exit(EXIT_FAILURE);
+ }
+
+ struct opd_header * header;
+ header = static_cast<struct opd_header *>(odb_get_data(&dest));
+ memset(header, '\0', sizeof(struct opd_header));
+ header->version = OPD_VERSION;
+ memcpy(header->magic, OPD_MAGIC, sizeof(header->magic));
+ header->is_kernel = 1;
+ /* ICACHE_FETCHES */
+ header->ctr_event = 0x80;
+ header->ctr_um = 0x0;
+ header->cpu_type = CPU_ATHLON;
+ header->ctr_count = 0xdeadbeef;
+ header->cpu_speed = 0;
+ header->mtime = 1034790063;
+ header->cg_to_is_kernel = 1;
+ header->anon_start = 0;
+ header->cg_to_anon_start = 0;
+
+ for (int i = 0; i < 3793; ++i) {
+ int rc = odb_add_node(&dest, i, i);
+ if (rc != EXIT_SUCCESS) {
+ cerr << strerror(rc) << endl;
+ exit(EXIT_FAILURE);
+ }
+ }
+ odb_close(&dest);
+ }
+}
diff --git a/libdb/Makefile.am b/libdb/Makefile.am
new file mode 100644
index 0000000..61658f9
--- /dev/null
+++ b/libdb/Makefile.am
@@ -0,0 +1,18 @@
+SUBDIRS=. tests
+
+AM_CPPFLAGS = \
+ -I ${top_srcdir}/libop \
+ -I ${top_srcdir}/libutil
+
+AM_CFLAGS = @OP_CFLAGS@
+
+noinst_LIBRARIES = libodb.a
+
+libodb_a_SOURCES = \
+ db_manage.c \
+ db_insert.c \
+ db_travel.c \
+ db_debug.c \
+ db_stat.c \
+ odb.h
+
diff --git a/libdb/Makefile.in b/libdb/Makefile.in
new file mode 100644
index 0000000..5726228
--- /dev/null
+++ b/libdb/Makefile.in
@@ -0,0 +1,603 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = libdb
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/binutils.m4 \
+ $(top_srcdir)/m4/builtinexpect.m4 \
+ $(top_srcdir)/m4/cellspubfdsupport.m4 \
+ $(top_srcdir)/m4/compileroption.m4 \
+ $(top_srcdir)/m4/configmodule.m4 \
+ $(top_srcdir)/m4/copyifchange.m4 $(top_srcdir)/m4/docbook.m4 \
+ $(top_srcdir)/m4/extradirs.m4 $(top_srcdir)/m4/findkernel.m4 \
+ $(top_srcdir)/m4/kerneloption.m4 \
+ $(top_srcdir)/m4/kernelversion.m4 \
+ $(top_srcdir)/m4/mallocattribute.m4 \
+ $(top_srcdir)/m4/poptconst.m4 \
+ $(top_srcdir)/m4/precompiledheader.m4 $(top_srcdir)/m4/qt.m4 \
+ $(top_srcdir)/m4/resultyn.m4 $(top_srcdir)/m4/sstream.m4 \
+ $(top_srcdir)/m4/typedef.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+ARFLAGS = cru
+libodb_a_AR = $(AR) $(ARFLAGS)
+libodb_a_LIBADD =
+am_libodb_a_OBJECTS = db_manage.$(OBJEXT) db_insert.$(OBJEXT) \
+ db_travel.$(OBJEXT) db_debug.$(OBJEXT) db_stat.$(OBJEXT)
+libodb_a_OBJECTS = $(am_libodb_a_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libodb_a_SOURCES)
+DIST_SOURCES = $(libodb_a_SOURCES)
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-exec-recursive install-info-recursive \
+ install-recursive installcheck-recursive installdirs-recursive \
+ pdf-recursive ps-recursive uninstall-info-recursive \
+ uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFD_LIBS = @BFD_LIBS@
+BUILD_JVMPI_AGENT_FALSE = @BUILD_JVMPI_AGENT_FALSE@
+BUILD_JVMPI_AGENT_TRUE = @BUILD_JVMPI_AGENT_TRUE@
+BUILD_JVMTI_AGENT_FALSE = @BUILD_JVMTI_AGENT_FALSE@
+BUILD_JVMTI_AGENT_TRUE = @BUILD_JVMTI_AGENT_TRUE@
+CAT_ENTRY_END = @CAT_ENTRY_END@
+CAT_ENTRY_START = @CAT_ENTRY_START@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOCBOOK_ROOT = @DOCBOOK_ROOT@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+EXTRA_CFLAGS_MODULE = @EXTRA_CFLAGS_MODULE@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAVA_HOMEDIR = @JAVA_HOMEDIR@
+KINC = @KINC@
+KSRC = @KSRC@
+KVERS = @KVERS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBERTY_LIBS = @LIBERTY_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MOC = @MOC@
+MODINSTALLDIR = @MODINSTALLDIR@
+OBJEXT = @OBJEXT@
+OPROFILE_DIR = @OPROFILE_DIR@
+OPROFILE_MODULE_ARCH = @OPROFILE_MODULE_ARCH@
+OP_CFLAGS = @OP_CFLAGS@
+OP_CXXFLAGS = @OP_CXXFLAGS@
+OP_DOCDIR = @OP_DOCDIR@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POPT_LIBS = @POPT_LIBS@
+PTRDIFF_T_TYPE = @PTRDIFF_T_TYPE@
+QT_INCLUDES = @QT_INCLUDES@
+QT_LDFLAGS = @QT_LDFLAGS@
+QT_LIB = @QT_LIB@
+QT_VERSION = @QT_VERSION@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIZE_T_TYPE = @SIZE_T_TYPE@
+STRIP = @STRIP@
+UIC = @UIC@
+VERSION = @VERSION@
+XML_CATALOG = @XML_CATALOG@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+have_qt_FALSE = @have_qt_FALSE@
+have_qt_TRUE = @have_qt_TRUE@
+have_xsltproc_FALSE = @have_xsltproc_FALSE@
+have_xsltproc_TRUE = @have_xsltproc_TRUE@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+kernel_support_FALSE = @kernel_support_FALSE@
+kernel_support_TRUE = @kernel_support_TRUE@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+topdir = @topdir@
+SUBDIRS = . tests
+AM_CPPFLAGS = \
+ -I ${top_srcdir}/libop \
+ -I ${top_srcdir}/libutil
+
+AM_CFLAGS = @OP_CFLAGS@
+noinst_LIBRARIES = libodb.a
+libodb_a_SOURCES = \
+ db_manage.c \
+ db_insert.c \
+ db_travel.c \
+ db_debug.c \
+ db_stat.c \
+ odb.h
+
+all: all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libdb/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign libdb/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLIBRARIES:
+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+libodb.a: $(libodb_a_OBJECTS) $(libodb_a_DEPENDENCIES)
+ -rm -f libodb.a
+ $(libodb_a_AR) libodb.a $(libodb_a_OBJECTS) $(libodb_a_LIBADD)
+ $(RANLIB) libodb.a
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/db_debug.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/db_insert.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/db_manage.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/db_stat.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/db_travel.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(mkdir_p) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(LIBRARIES)
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+ clean clean-generic clean-libtool clean-noinstLIBRARIES \
+ clean-recursive ctags ctags-recursive distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-recursive distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-exec install-exec-am install-info \
+ install-info-am install-man install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic maintainer-clean-recursive \
+ mostlyclean mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \
+ tags tags-recursive uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/libdb/tests/Makefile.am b/libdb/tests/Makefile.am
new file mode 100644
index 0000000..6932088
--- /dev/null
+++ b/libdb/tests/Makefile.am
@@ -0,0 +1,15 @@
+AM_CPPFLAGS = \
+ -I ${top_srcdir}/libop \
+ -I ${top_srcdir}/libutil \
+ -I ${top_srcdir}/libdb
+
+AM_CFLAGS = @OP_CFLAGS@
+
+LIBS = @LIBERTY_LIBS@
+
+check_PROGRAMS = db_test
+
+db_test_SOURCES = db_test.c
+db_test_LDADD = ../libodb.a ../../libutil/libutil.a
+
+TESTS = ${check_PROGRAMS}
diff --git a/libdb/tests/Makefile.in b/libdb/tests/Makefile.in
new file mode 100644
index 0000000..31e4f5e
--- /dev/null
+++ b/libdb/tests/Makefile.in
@@ -0,0 +1,556 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+check_PROGRAMS = db_test$(EXEEXT)
+subdir = libdb/tests
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/binutils.m4 \
+ $(top_srcdir)/m4/builtinexpect.m4 \
+ $(top_srcdir)/m4/cellspubfdsupport.m4 \
+ $(top_srcdir)/m4/compileroption.m4 \
+ $(top_srcdir)/m4/configmodule.m4 \
+ $(top_srcdir)/m4/copyifchange.m4 $(top_srcdir)/m4/docbook.m4 \
+ $(top_srcdir)/m4/extradirs.m4 $(top_srcdir)/m4/findkernel.m4 \
+ $(top_srcdir)/m4/kerneloption.m4 \
+ $(top_srcdir)/m4/kernelversion.m4 \
+ $(top_srcdir)/m4/mallocattribute.m4 \
+ $(top_srcdir)/m4/poptconst.m4 \
+ $(top_srcdir)/m4/precompiledheader.m4 $(top_srcdir)/m4/qt.m4 \
+ $(top_srcdir)/m4/resultyn.m4 $(top_srcdir)/m4/sstream.m4 \
+ $(top_srcdir)/m4/typedef.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am_db_test_OBJECTS = db_test.$(OBJEXT)
+db_test_OBJECTS = $(am_db_test_OBJECTS)
+db_test_DEPENDENCIES = ../libodb.a ../../libutil/libutil.a
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(db_test_SOURCES)
+DIST_SOURCES = $(db_test_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFD_LIBS = @BFD_LIBS@
+BUILD_JVMPI_AGENT_FALSE = @BUILD_JVMPI_AGENT_FALSE@
+BUILD_JVMPI_AGENT_TRUE = @BUILD_JVMPI_AGENT_TRUE@
+BUILD_JVMTI_AGENT_FALSE = @BUILD_JVMTI_AGENT_FALSE@
+BUILD_JVMTI_AGENT_TRUE = @BUILD_JVMTI_AGENT_TRUE@
+CAT_ENTRY_END = @CAT_ENTRY_END@
+CAT_ENTRY_START = @CAT_ENTRY_START@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOCBOOK_ROOT = @DOCBOOK_ROOT@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+EXTRA_CFLAGS_MODULE = @EXTRA_CFLAGS_MODULE@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAVA_HOMEDIR = @JAVA_HOMEDIR@
+KINC = @KINC@
+KSRC = @KSRC@
+KVERS = @KVERS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBERTY_LIBS = @LIBERTY_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBERTY_LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MOC = @MOC@
+MODINSTALLDIR = @MODINSTALLDIR@
+OBJEXT = @OBJEXT@
+OPROFILE_DIR = @OPROFILE_DIR@
+OPROFILE_MODULE_ARCH = @OPROFILE_MODULE_ARCH@
+OP_CFLAGS = @OP_CFLAGS@
+OP_CXXFLAGS = @OP_CXXFLAGS@
+OP_DOCDIR = @OP_DOCDIR@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POPT_LIBS = @POPT_LIBS@
+PTRDIFF_T_TYPE = @PTRDIFF_T_TYPE@
+QT_INCLUDES = @QT_INCLUDES@
+QT_LDFLAGS = @QT_LDFLAGS@
+QT_LIB = @QT_LIB@
+QT_VERSION = @QT_VERSION@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIZE_T_TYPE = @SIZE_T_TYPE@
+STRIP = @STRIP@
+UIC = @UIC@
+VERSION = @VERSION@
+XML_CATALOG = @XML_CATALOG@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+have_qt_FALSE = @have_qt_FALSE@
+have_qt_TRUE = @have_qt_TRUE@
+have_xsltproc_FALSE = @have_xsltproc_FALSE@
+have_xsltproc_TRUE = @have_xsltproc_TRUE@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+kernel_support_FALSE = @kernel_support_FALSE@
+kernel_support_TRUE = @kernel_support_TRUE@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+topdir = @topdir@
+AM_CPPFLAGS = \
+ -I ${top_srcdir}/libop \
+ -I ${top_srcdir}/libutil \
+ -I ${top_srcdir}/libdb
+
+AM_CFLAGS = @OP_CFLAGS@
+db_test_SOURCES = db_test.c
+db_test_LDADD = ../libodb.a ../../libutil/libutil.a
+TESTS = ${check_PROGRAMS}
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libdb/tests/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign libdb/tests/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-checkPROGRAMS:
+ @list='$(check_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+db_test$(EXEEXT): $(db_test_OBJECTS) $(db_test_DEPENDENCIES)
+ @rm -f db_test$(EXEEXT)
+ $(LINK) $(db_test_LDFLAGS) $(db_test_OBJECTS) $(db_test_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/db_test.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+check-TESTS: $(TESTS)
+ @failed=0; all=0; xfail=0; xpass=0; skip=0; \
+ srcdir=$(srcdir); export srcdir; \
+ list='$(TESTS)'; \
+ if test -n "$$list"; then \
+ for tst in $$list; do \
+ if test -f ./$$tst; then dir=./; \
+ elif test -f $$tst; then dir=; \
+ else dir="$(srcdir)/"; fi; \
+ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *" $$tst "*) \
+ xpass=`expr $$xpass + 1`; \
+ failed=`expr $$failed + 1`; \
+ echo "XPASS: $$tst"; \
+ ;; \
+ *) \
+ echo "PASS: $$tst"; \
+ ;; \
+ esac; \
+ elif test $$? -ne 77; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *" $$tst "*) \
+ xfail=`expr $$xfail + 1`; \
+ echo "XFAIL: $$tst"; \
+ ;; \
+ *) \
+ failed=`expr $$failed + 1`; \
+ echo "FAIL: $$tst"; \
+ ;; \
+ esac; \
+ else \
+ skip=`expr $$skip + 1`; \
+ echo "SKIP: $$tst"; \
+ fi; \
+ done; \
+ if test "$$failed" -eq 0; then \
+ if test "$$xfail" -eq 0; then \
+ banner="All $$all tests passed"; \
+ else \
+ banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
+ fi; \
+ else \
+ if test "$$xpass" -eq 0; then \
+ banner="$$failed of $$all tests failed"; \
+ else \
+ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
+ fi; \
+ fi; \
+ dashes="$$banner"; \
+ skipped=""; \
+ if test "$$skip" -ne 0; then \
+ skipped="($$skip tests were not run)"; \
+ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$skipped"; \
+ fi; \
+ report=""; \
+ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+ report="Please report to $(PACKAGE_BUGREPORT)"; \
+ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$report"; \
+ fi; \
+ dashes=`echo "$$dashes" | sed s/./=/g`; \
+ echo "$$dashes"; \
+ echo "$$banner"; \
+ test -z "$$skipped" || echo "$$skipped"; \
+ test -z "$$report" || echo "$$report"; \
+ echo "$$dashes"; \
+ test "$$failed" -eq 0; \
+ else :; fi
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
+ clean-checkPROGRAMS clean-generic clean-libtool ctags \
+ distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-exec install-exec-am install-info \
+ install-info-am install-man install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/libdb/tests/db_test.c b/libdb/tests/db_test.c
new file mode 100644
index 0000000..fe0b189
--- /dev/null
+++ b/libdb/tests/db_test.c
@@ -0,0 +1,187 @@
+/**
+ * @file db_test.c
+ * Tests for DB hash
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ */
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <fcntl.h>
+
+#include "op_sample_file.h"
+#include "odb.h"
+
+#define TEST_FILENAME "test-hash-db.dat"
+
+static int nr_error;
+
+static int verbose = 0;
+
+#define verbprintf(args...) \
+ do { \
+ if (verbose) \
+ printf(args); \
+ } while (0)
+
+static double used_time(void)
+{
+ struct rusage usage;
+
+ getrusage(RUSAGE_SELF, &usage);
+
+ return (usage.ru_utime.tv_sec + usage.ru_stime.tv_sec) * 1E9 +
+ ((usage.ru_utime.tv_usec + usage.ru_stime.tv_usec)) * 1000;
+}
+
+
+/* update nr item */
+static void speed_test(int nr_item, char const * test_name)
+{
+ int i;
+ double begin, end;
+ odb_t hash;
+ int rc;
+
+ rc = odb_open(&hash, TEST_FILENAME, ODB_RDWR, sizeof(struct opd_header));
+ if (rc) {
+ fprintf(stderr, "%s", strerror(rc));
+ exit(EXIT_FAILURE);
+ }
+ begin = used_time();
+ for (i = 0 ; i < nr_item ; ++i) {
+ rc = odb_update_node(&hash, i);
+ if (rc != EXIT_SUCCESS) {
+ fprintf(stderr, "%s", strerror(rc));
+ exit(EXIT_FAILURE);
+ }
+ }
+
+ end = used_time();
+ odb_close(&hash);
+
+ verbprintf("%s: nr item: %d, elapsed: %f ns\n",
+ test_name, nr_item, (end - begin) / nr_item);
+}
+
+
+static void do_speed_test(void)
+{
+ int i;
+
+ for (i = 100000; i <= 10000000; i *= 10) {
+ // first test count insertion, second fetch and incr count
+ speed_test(i, "insert");
+ speed_test(i, "update");
+ remove(TEST_FILENAME);
+ }
+}
+
+
+static int test(int nr_item, int nr_unique_item)
+{
+ int i;
+ odb_t hash;
+ int ret;
+ int rc;
+
+ rc = odb_open(&hash, TEST_FILENAME, ODB_RDWR, sizeof(struct opd_header));
+ if (rc) {
+ fprintf(stderr, "%s", strerror(rc));
+ exit(EXIT_FAILURE);
+ }
+
+
+ for (i = 0 ; i < nr_item ; ++i) {
+ odb_key_t key = (random() % nr_unique_item) + 1;
+ rc = odb_update_node(&hash, key);
+ if (rc != EXIT_SUCCESS) {
+ fprintf(stderr, "%s", strerror(rc));
+ exit(EXIT_FAILURE);
+ }
+ }
+
+ ret = odb_check_hash(&hash);
+
+ odb_close(&hash);
+
+ remove(TEST_FILENAME);
+
+ return ret;
+}
+
+
+static void do_test(void)
+{
+ int i, j;
+
+ for (i = 1000; i <= 100000; i *= 10) {
+ for (j = 100 ; j <= i / 10 ; j *= 10) {
+ if (test(i, j)) {
+ fprintf(stderr, "%s:%d failure for %d %d\n",
+ __FILE__, __LINE__, i, j);
+ nr_error++;
+ } else {
+ verbprintf("test() ok %d %d\n", i, j);
+ }
+ }
+ }
+}
+
+
+static void sanity_check(char const * filename)
+{
+ odb_t hash;
+ int rc;
+
+ rc = odb_open(&hash, filename, ODB_RDONLY, sizeof(struct opd_header));
+ if (rc) {
+ fprintf(stderr, "%s", strerror(rc));
+ exit(EXIT_FAILURE);
+ }
+
+ if (odb_check_hash(&hash)) {
+ fprintf(stderr, "checking file %s FAIL\n", filename);
+ ++nr_error;
+ } else if (verbose) {
+ odb_hash_stat_t * stats;
+ stats = odb_hash_stat(&hash);
+ odb_hash_display_stat(stats);
+ odb_hash_free_stat(stats);
+ }
+
+ odb_close(&hash);
+}
+
+int main(int argc, char * argv[1])
+{
+ /* if a filename is given take it as: "check this db" */
+ if (argc > 1) {
+ int i;
+ verbose = 1;
+ if (!strcmp(argv[1], "--speed"))
+ goto speed_test;
+ for (i = 1 ; i < argc ; ++i)
+ sanity_check(argv[i]);
+ return 0;
+ }
+
+speed_test:
+ remove(TEST_FILENAME);
+
+ do_test();
+
+ do_speed_test();
+
+ if (nr_error)
+ printf("%d error occured\n", nr_error);
+
+ return nr_error ? EXIT_FAILURE : EXIT_SUCCESS;
+}
diff --git a/libop/Makefile.am b/libop/Makefile.am
new file mode 100644
index 0000000..22f8578
--- /dev/null
+++ b/libop/Makefile.am
@@ -0,0 +1,29 @@
+SUBDIRS = . tests
+
+AM_CPPFLAGS=-I${top_srcdir}/libutil
+AM_CFLAGS = @OP_CFLAGS@
+
+noinst_LIBRARIES = libop.a
+libop_a_SOURCES = \
+ op_events.c \
+ op_events.h \
+ op_parse_event.c \
+ op_parse_event.h \
+ op_cpu_type.c \
+ op_cpu_type.h \
+ op_mangle.c \
+ op_mangle.h \
+ op_get_interface.c \
+ op_interface.h \
+ op_alloc_counter.c \
+ op_alloc_counter.h \
+ op_hw_config.h \
+ op_config.c \
+ op_config.h \
+ op_config_24.h \
+ op_sample_file.h \
+ op_xml_events.c \
+ op_xml_events.h \
+ op_xml_out.c \
+ op_xml_out.h \
+ op_hw_specific.h
diff --git a/libop/Makefile.in b/libop/Makefile.in
new file mode 100644
index 0000000..a91b612
--- /dev/null
+++ b/libop/Makefile.in
@@ -0,0 +1,623 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = libop
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/binutils.m4 \
+ $(top_srcdir)/m4/builtinexpect.m4 \
+ $(top_srcdir)/m4/cellspubfdsupport.m4 \
+ $(top_srcdir)/m4/compileroption.m4 \
+ $(top_srcdir)/m4/configmodule.m4 \
+ $(top_srcdir)/m4/copyifchange.m4 $(top_srcdir)/m4/docbook.m4 \
+ $(top_srcdir)/m4/extradirs.m4 $(top_srcdir)/m4/findkernel.m4 \
+ $(top_srcdir)/m4/kerneloption.m4 \
+ $(top_srcdir)/m4/kernelversion.m4 \
+ $(top_srcdir)/m4/mallocattribute.m4 \
+ $(top_srcdir)/m4/poptconst.m4 \
+ $(top_srcdir)/m4/precompiledheader.m4 $(top_srcdir)/m4/qt.m4 \
+ $(top_srcdir)/m4/resultyn.m4 $(top_srcdir)/m4/sstream.m4 \
+ $(top_srcdir)/m4/typedef.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+ARFLAGS = cru
+libop_a_AR = $(AR) $(ARFLAGS)
+libop_a_LIBADD =
+am_libop_a_OBJECTS = op_events.$(OBJEXT) op_parse_event.$(OBJEXT) \
+ op_cpu_type.$(OBJEXT) op_mangle.$(OBJEXT) \
+ op_get_interface.$(OBJEXT) op_alloc_counter.$(OBJEXT) \
+ op_config.$(OBJEXT) op_xml_events.$(OBJEXT) \
+ op_xml_out.$(OBJEXT)
+libop_a_OBJECTS = $(am_libop_a_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libop_a_SOURCES)
+DIST_SOURCES = $(libop_a_SOURCES)
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-exec-recursive install-info-recursive \
+ install-recursive installcheck-recursive installdirs-recursive \
+ pdf-recursive ps-recursive uninstall-info-recursive \
+ uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFD_LIBS = @BFD_LIBS@
+BUILD_JVMPI_AGENT_FALSE = @BUILD_JVMPI_AGENT_FALSE@
+BUILD_JVMPI_AGENT_TRUE = @BUILD_JVMPI_AGENT_TRUE@
+BUILD_JVMTI_AGENT_FALSE = @BUILD_JVMTI_AGENT_FALSE@
+BUILD_JVMTI_AGENT_TRUE = @BUILD_JVMTI_AGENT_TRUE@
+CAT_ENTRY_END = @CAT_ENTRY_END@
+CAT_ENTRY_START = @CAT_ENTRY_START@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOCBOOK_ROOT = @DOCBOOK_ROOT@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+EXTRA_CFLAGS_MODULE = @EXTRA_CFLAGS_MODULE@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAVA_HOMEDIR = @JAVA_HOMEDIR@
+KINC = @KINC@
+KSRC = @KSRC@
+KVERS = @KVERS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBERTY_LIBS = @LIBERTY_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MOC = @MOC@
+MODINSTALLDIR = @MODINSTALLDIR@
+OBJEXT = @OBJEXT@
+OPROFILE_DIR = @OPROFILE_DIR@
+OPROFILE_MODULE_ARCH = @OPROFILE_MODULE_ARCH@
+OP_CFLAGS = @OP_CFLAGS@
+OP_CXXFLAGS = @OP_CXXFLAGS@
+OP_DOCDIR = @OP_DOCDIR@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POPT_LIBS = @POPT_LIBS@
+PTRDIFF_T_TYPE = @PTRDIFF_T_TYPE@
+QT_INCLUDES = @QT_INCLUDES@
+QT_LDFLAGS = @QT_LDFLAGS@
+QT_LIB = @QT_LIB@
+QT_VERSION = @QT_VERSION@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIZE_T_TYPE = @SIZE_T_TYPE@
+STRIP = @STRIP@
+UIC = @UIC@
+VERSION = @VERSION@
+XML_CATALOG = @XML_CATALOG@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+have_qt_FALSE = @have_qt_FALSE@
+have_qt_TRUE = @have_qt_TRUE@
+have_xsltproc_FALSE = @have_xsltproc_FALSE@
+have_xsltproc_TRUE = @have_xsltproc_TRUE@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+kernel_support_FALSE = @kernel_support_FALSE@
+kernel_support_TRUE = @kernel_support_TRUE@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+topdir = @topdir@
+SUBDIRS = . tests
+AM_CPPFLAGS = -I${top_srcdir}/libutil
+AM_CFLAGS = @OP_CFLAGS@
+noinst_LIBRARIES = libop.a
+libop_a_SOURCES = \
+ op_events.c \
+ op_events.h \
+ op_parse_event.c \
+ op_parse_event.h \
+ op_cpu_type.c \
+ op_cpu_type.h \
+ op_mangle.c \
+ op_mangle.h \
+ op_get_interface.c \
+ op_interface.h \
+ op_alloc_counter.c \
+ op_alloc_counter.h \
+ op_hw_config.h \
+ op_config.c \
+ op_config.h \
+ op_config_24.h \
+ op_sample_file.h \
+ op_xml_events.c \
+ op_xml_events.h \
+ op_xml_out.c \
+ op_xml_out.h \
+ op_hw_specific.h
+
+all: all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libop/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign libop/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLIBRARIES:
+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+libop.a: $(libop_a_OBJECTS) $(libop_a_DEPENDENCIES)
+ -rm -f libop.a
+ $(libop_a_AR) libop.a $(libop_a_OBJECTS) $(libop_a_LIBADD)
+ $(RANLIB) libop.a
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/op_alloc_counter.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/op_config.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/op_cpu_type.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/op_events.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/op_get_interface.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/op_mangle.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/op_parse_event.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/op_xml_events.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/op_xml_out.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(mkdir_p) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(LIBRARIES)
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+ clean clean-generic clean-libtool clean-noinstLIBRARIES \
+ clean-recursive ctags ctags-recursive distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-recursive distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-exec install-exec-am install-info \
+ install-info-am install-man install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic maintainer-clean-recursive \
+ mostlyclean mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \
+ tags tags-recursive uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/libop/tests/Makefile.am b/libop/tests/Makefile.am
new file mode 100644
index 0000000..cf5e8fc
--- /dev/null
+++ b/libop/tests/Makefile.am
@@ -0,0 +1,33 @@
+AM_CPPFLAGS = \
+ -I ${top_srcdir}/libutil \
+ -I ${top_srcdir}/libop
+
+AM_CFLAGS = @OP_CFLAGS@ -DOPROFILE_SRCDIR=\"@top_srcdir@\"
+
+COMMON_LIBS = ../libop.a ../../libutil/libutil.a
+
+LIBS = @LIBERTY_LIBS@
+
+check_PROGRAMS = \
+ cpu_type_tests \
+ parse_event_tests \
+ load_events_files_tests \
+ alloc_counter_tests \
+ mangle_tests
+
+cpu_type_tests_SOURCES = cpu_type_tests.c
+cpu_type_tests_LDADD = ${COMMON_LIBS}
+
+parse_event_tests_SOURCES = parse_event_tests.c
+parse_event_tests_LDADD = ${COMMON_LIBS}
+
+alloc_counter_tests_SOURCES = alloc_counter_tests.c
+alloc_counter_tests_LDADD = ${COMMON_LIBS}
+
+load_events_files_tests_SOURCES = load_events_files_tests.c
+load_events_files_tests_LDADD = ${COMMON_LIBS}
+
+mangle_tests_SOURCES = mangle_tests.c
+mangle_tests_LDADD = ${COMMON_LIBS}
+
+TESTS = ${check_PROGRAMS}
diff --git a/libop/tests/Makefile.in b/libop/tests/Makefile.in
new file mode 100644
index 0000000..3755df4
--- /dev/null
+++ b/libop/tests/Makefile.in
@@ -0,0 +1,601 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+check_PROGRAMS = cpu_type_tests$(EXEEXT) parse_event_tests$(EXEEXT) \
+ load_events_files_tests$(EXEEXT) alloc_counter_tests$(EXEEXT) \
+ mangle_tests$(EXEEXT)
+subdir = libop/tests
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/binutils.m4 \
+ $(top_srcdir)/m4/builtinexpect.m4 \
+ $(top_srcdir)/m4/cellspubfdsupport.m4 \
+ $(top_srcdir)/m4/compileroption.m4 \
+ $(top_srcdir)/m4/configmodule.m4 \
+ $(top_srcdir)/m4/copyifchange.m4 $(top_srcdir)/m4/docbook.m4 \
+ $(top_srcdir)/m4/extradirs.m4 $(top_srcdir)/m4/findkernel.m4 \
+ $(top_srcdir)/m4/kerneloption.m4 \
+ $(top_srcdir)/m4/kernelversion.m4 \
+ $(top_srcdir)/m4/mallocattribute.m4 \
+ $(top_srcdir)/m4/poptconst.m4 \
+ $(top_srcdir)/m4/precompiledheader.m4 $(top_srcdir)/m4/qt.m4 \
+ $(top_srcdir)/m4/resultyn.m4 $(top_srcdir)/m4/sstream.m4 \
+ $(top_srcdir)/m4/typedef.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am_alloc_counter_tests_OBJECTS = alloc_counter_tests.$(OBJEXT)
+alloc_counter_tests_OBJECTS = $(am_alloc_counter_tests_OBJECTS)
+am__DEPENDENCIES_1 = ../libop.a ../../libutil/libutil.a
+alloc_counter_tests_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_cpu_type_tests_OBJECTS = cpu_type_tests.$(OBJEXT)
+cpu_type_tests_OBJECTS = $(am_cpu_type_tests_OBJECTS)
+cpu_type_tests_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_load_events_files_tests_OBJECTS = \
+ load_events_files_tests.$(OBJEXT)
+load_events_files_tests_OBJECTS = \
+ $(am_load_events_files_tests_OBJECTS)
+load_events_files_tests_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_mangle_tests_OBJECTS = mangle_tests.$(OBJEXT)
+mangle_tests_OBJECTS = $(am_mangle_tests_OBJECTS)
+mangle_tests_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_parse_event_tests_OBJECTS = parse_event_tests.$(OBJEXT)
+parse_event_tests_OBJECTS = $(am_parse_event_tests_OBJECTS)
+parse_event_tests_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(alloc_counter_tests_SOURCES) $(cpu_type_tests_SOURCES) \
+ $(load_events_files_tests_SOURCES) $(mangle_tests_SOURCES) \
+ $(parse_event_tests_SOURCES)
+DIST_SOURCES = $(alloc_counter_tests_SOURCES) \
+ $(cpu_type_tests_SOURCES) $(load_events_files_tests_SOURCES) \
+ $(mangle_tests_SOURCES) $(parse_event_tests_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFD_LIBS = @BFD_LIBS@
+BUILD_JVMPI_AGENT_FALSE = @BUILD_JVMPI_AGENT_FALSE@
+BUILD_JVMPI_AGENT_TRUE = @BUILD_JVMPI_AGENT_TRUE@
+BUILD_JVMTI_AGENT_FALSE = @BUILD_JVMTI_AGENT_FALSE@
+BUILD_JVMTI_AGENT_TRUE = @BUILD_JVMTI_AGENT_TRUE@
+CAT_ENTRY_END = @CAT_ENTRY_END@
+CAT_ENTRY_START = @CAT_ENTRY_START@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOCBOOK_ROOT = @DOCBOOK_ROOT@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+EXTRA_CFLAGS_MODULE = @EXTRA_CFLAGS_MODULE@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAVA_HOMEDIR = @JAVA_HOMEDIR@
+KINC = @KINC@
+KSRC = @KSRC@
+KVERS = @KVERS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBERTY_LIBS = @LIBERTY_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBERTY_LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MOC = @MOC@
+MODINSTALLDIR = @MODINSTALLDIR@
+OBJEXT = @OBJEXT@
+OPROFILE_DIR = @OPROFILE_DIR@
+OPROFILE_MODULE_ARCH = @OPROFILE_MODULE_ARCH@
+OP_CFLAGS = @OP_CFLAGS@
+OP_CXXFLAGS = @OP_CXXFLAGS@
+OP_DOCDIR = @OP_DOCDIR@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POPT_LIBS = @POPT_LIBS@
+PTRDIFF_T_TYPE = @PTRDIFF_T_TYPE@
+QT_INCLUDES = @QT_INCLUDES@
+QT_LDFLAGS = @QT_LDFLAGS@
+QT_LIB = @QT_LIB@
+QT_VERSION = @QT_VERSION@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIZE_T_TYPE = @SIZE_T_TYPE@
+STRIP = @STRIP@
+UIC = @UIC@
+VERSION = @VERSION@
+XML_CATALOG = @XML_CATALOG@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+have_qt_FALSE = @have_qt_FALSE@
+have_qt_TRUE = @have_qt_TRUE@
+have_xsltproc_FALSE = @have_xsltproc_FALSE@
+have_xsltproc_TRUE = @have_xsltproc_TRUE@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+kernel_support_FALSE = @kernel_support_FALSE@
+kernel_support_TRUE = @kernel_support_TRUE@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+topdir = @topdir@
+AM_CPPFLAGS = \
+ -I ${top_srcdir}/libutil \
+ -I ${top_srcdir}/libop
+
+AM_CFLAGS = @OP_CFLAGS@ -DOPROFILE_SRCDIR=\"@top_srcdir@\"
+COMMON_LIBS = ../libop.a ../../libutil/libutil.a
+cpu_type_tests_SOURCES = cpu_type_tests.c
+cpu_type_tests_LDADD = ${COMMON_LIBS}
+parse_event_tests_SOURCES = parse_event_tests.c
+parse_event_tests_LDADD = ${COMMON_LIBS}
+alloc_counter_tests_SOURCES = alloc_counter_tests.c
+alloc_counter_tests_LDADD = ${COMMON_LIBS}
+load_events_files_tests_SOURCES = load_events_files_tests.c
+load_events_files_tests_LDADD = ${COMMON_LIBS}
+mangle_tests_SOURCES = mangle_tests.c
+mangle_tests_LDADD = ${COMMON_LIBS}
+TESTS = ${check_PROGRAMS}
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libop/tests/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign libop/tests/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-checkPROGRAMS:
+ @list='$(check_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+alloc_counter_tests$(EXEEXT): $(alloc_counter_tests_OBJECTS) $(alloc_counter_tests_DEPENDENCIES)
+ @rm -f alloc_counter_tests$(EXEEXT)
+ $(LINK) $(alloc_counter_tests_LDFLAGS) $(alloc_counter_tests_OBJECTS) $(alloc_counter_tests_LDADD) $(LIBS)
+cpu_type_tests$(EXEEXT): $(cpu_type_tests_OBJECTS) $(cpu_type_tests_DEPENDENCIES)
+ @rm -f cpu_type_tests$(EXEEXT)
+ $(LINK) $(cpu_type_tests_LDFLAGS) $(cpu_type_tests_OBJECTS) $(cpu_type_tests_LDADD) $(LIBS)
+load_events_files_tests$(EXEEXT): $(load_events_files_tests_OBJECTS) $(load_events_files_tests_DEPENDENCIES)
+ @rm -f load_events_files_tests$(EXEEXT)
+ $(LINK) $(load_events_files_tests_LDFLAGS) $(load_events_files_tests_OBJECTS) $(load_events_files_tests_LDADD) $(LIBS)
+mangle_tests$(EXEEXT): $(mangle_tests_OBJECTS) $(mangle_tests_DEPENDENCIES)
+ @rm -f mangle_tests$(EXEEXT)
+ $(LINK) $(mangle_tests_LDFLAGS) $(mangle_tests_OBJECTS) $(mangle_tests_LDADD) $(LIBS)
+parse_event_tests$(EXEEXT): $(parse_event_tests_OBJECTS) $(parse_event_tests_DEPENDENCIES)
+ @rm -f parse_event_tests$(EXEEXT)
+ $(LINK) $(parse_event_tests_LDFLAGS) $(parse_event_tests_OBJECTS) $(parse_event_tests_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alloc_counter_tests.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu_type_tests.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/load_events_files_tests.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mangle_tests.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_event_tests.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+check-TESTS: $(TESTS)
+ @failed=0; all=0; xfail=0; xpass=0; skip=0; \
+ srcdir=$(srcdir); export srcdir; \
+ list='$(TESTS)'; \
+ if test -n "$$list"; then \
+ for tst in $$list; do \
+ if test -f ./$$tst; then dir=./; \
+ elif test -f $$tst; then dir=; \
+ else dir="$(srcdir)/"; fi; \
+ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *" $$tst "*) \
+ xpass=`expr $$xpass + 1`; \
+ failed=`expr $$failed + 1`; \
+ echo "XPASS: $$tst"; \
+ ;; \
+ *) \
+ echo "PASS: $$tst"; \
+ ;; \
+ esac; \
+ elif test $$? -ne 77; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *" $$tst "*) \
+ xfail=`expr $$xfail + 1`; \
+ echo "XFAIL: $$tst"; \
+ ;; \
+ *) \
+ failed=`expr $$failed + 1`; \
+ echo "FAIL: $$tst"; \
+ ;; \
+ esac; \
+ else \
+ skip=`expr $$skip + 1`; \
+ echo "SKIP: $$tst"; \
+ fi; \
+ done; \
+ if test "$$failed" -eq 0; then \
+ if test "$$xfail" -eq 0; then \
+ banner="All $$all tests passed"; \
+ else \
+ banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
+ fi; \
+ else \
+ if test "$$xpass" -eq 0; then \
+ banner="$$failed of $$all tests failed"; \
+ else \
+ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
+ fi; \
+ fi; \
+ dashes="$$banner"; \
+ skipped=""; \
+ if test "$$skip" -ne 0; then \
+ skipped="($$skip tests were not run)"; \
+ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$skipped"; \
+ fi; \
+ report=""; \
+ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+ report="Please report to $(PACKAGE_BUGREPORT)"; \
+ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$report"; \
+ fi; \
+ dashes=`echo "$$dashes" | sed s/./=/g`; \
+ echo "$$dashes"; \
+ echo "$$banner"; \
+ test -z "$$skipped" || echo "$$skipped"; \
+ test -z "$$report" || echo "$$report"; \
+ echo "$$dashes"; \
+ test "$$failed" -eq 0; \
+ else :; fi
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
+ clean-checkPROGRAMS clean-generic clean-libtool ctags \
+ distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-exec install-exec-am install-info \
+ install-info-am install-man install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/libop/tests/alloc_counter_tests.c b/libop/tests/alloc_counter_tests.c
new file mode 100644
index 0000000..e2cdd04
--- /dev/null
+++ b/libop/tests/alloc_counter_tests.c
@@ -0,0 +1,219 @@
+/**
+ * @file alloc_counter_tests.c
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "op_parse_event.h"
+#include "op_alloc_counter.h"
+#include "op_events.h"
+#include "op_hw_config.h"
+#include "op_cpu_type.h"
+#include "op_events.h"
+
+/* FIXME: alpha description events need 20 but when running test on x86
+ * OP_MAX_COUNTERS is 8, so we can't use it */
+#define MAX_EVENTS 20
+
+
+/* some test are setup to fail in a known way */
+enum failure_type {
+ no_failure,
+ fail_to_find_event,
+ fail_to_alloc_counter
+};
+
+struct allocated_counter {
+ op_cpu cpu_type;
+ char const * const * events;
+ size_t alloc_map[MAX_EVENTS];
+ /* expected failure for this test */
+ enum failure_type failure;
+};
+
+
+/* not more than MAX_EVENTS string for all these arrays */
+static char const * const events_alpha_ev4_1[] = {
+ "ISSUES:4096:0:1:1",
+ NULL
+};
+
+static char const * const events_alpha_ev4_2[] = {
+ "UNKNOWN_EVENT:4096:0:1:1",
+ NULL
+};
+
+static char const * const events_ppro_1[] = {
+ "CPU_CLK_UNHALTED:4096:0:1:1",
+ NULL
+};
+
+static char const * const events_ppro_2[] = {
+ "CPU_CLK_UNHALTED:4096:0:1:1",
+ "DATA_MEM_REFS:4096:0:1:1",
+ NULL
+};
+
+static char const * const events_ppro_3[] = {
+ /* fail_to_alloc_counter: 2 event to counter 0 */
+ "COMP_FLOP_RET:4096:0:1:1",
+ "FLOPS:4096:0:1:1",
+ NULL
+};
+
+static char const * const events_ppro_4[] = {
+ "FLOPS:4096:0:1:1",
+ "FP_ASSIST:4096:0:1:1",
+ NULL
+};
+
+static char const * const events_ppro_5[] = {
+ "FP_ASSIST:4096:0:1:1",
+ "FLOPS:4096:0:1:1",
+ NULL
+};
+
+static char const * const events_p4_1[] = {
+ "BRANCH_RETIRED:4096:1:1:1",
+ "MISPRED_BRANCH_RETIRED:4096:1:1:1",
+ "BPU_FETCH_REQUEST:4096:1:1:1",
+ "ITLB_REFERENCE:4096:1:1:1",
+ "MEMORY_CANCEL:4096:4:1:1",
+ "MEMORY_COMPLETE:4096:1:1:1",
+ "TC_MS_XFER:4096:1:1:1",
+ "UOP_QUEUE_WRITES:4096:1:1:1",
+ NULL
+};
+
+static char const * const events_p4_2[] = {
+ /* fail_to_alloc_counter: 3 event to counter 3, 7 */
+ "BRANCH_RETIRED:4096:1:1:1",
+ "MISPRED_BRANCH_RETIRED:4096:1:1:1",
+ "INSTR_RETIRED:4096:1:1:1",
+ "BPU_FETCH_REQUEST:4096:1:1:1",
+ "ITLB_REFERENCE:4096:1:1:1",
+ "MEMORY_CANCEL:4096:4:1:1",
+ "MEMORY_COMPLETE:4096:1:1:1",
+ "TC_MS_XFER:4096:1:1:1",
+ NULL
+};
+
+static char const * const events_mips_34k[] = {
+ /* fail_to_alloc_counter: w/o 2006-8-03 Jeremiah Lott patch, see
+ * ChangeLog */
+ "INSTRUCTIONS:500:0:1:1",
+ "JR_31_INSN_EXECED:500:0:1:1",
+ "BRANCH_INSNS_LAUNCHED:500:0:1:1",
+ "L2_MISSES:500:0:1:1",
+ NULL
+};
+
+static struct allocated_counter const tests[] = {
+ { CPU_AXP_EV4, events_alpha_ev4_1, { 0 }, no_failure },
+ { CPU_AXP_EV4, events_alpha_ev4_2, { -1 }, fail_to_find_event },
+ { CPU_PPRO, events_ppro_1, { 0 }, no_failure },
+ { CPU_PPRO, events_ppro_2, { 0, 1 }, no_failure },
+ { CPU_PPRO, events_ppro_3, { -1 }, fail_to_alloc_counter },
+ { CPU_PPRO, events_ppro_4, { 0, 1 }, no_failure },
+ { CPU_PPRO, events_ppro_5, { 1, 0 }, no_failure },
+ { CPU_P4, events_p4_1, { 3, 7, 0, 4, 2, 6, 1, 5 }, no_failure },
+ { CPU_P4, events_p4_2, { -1 }, fail_to_alloc_counter },
+ { CPU_MIPS_34K, events_mips_34k, { 1, 0, 2, 3 }, no_failure },
+ { CPU_NO_GOOD, 0, { 0 }, 0 }
+};
+
+
+static void show_events(char const * const * events)
+{
+ for ( ; *events; ++events)
+ printf("%s\n", *events);
+}
+
+
+static void show_counter_map(size_t const * counter_map, size_t nr_events)
+{
+ size_t i;
+ for (i = 0; i < nr_events; ++i)
+ printf("%lu ", (unsigned long)counter_map[i]);
+ printf("\n");
+}
+
+
+static void do_test(struct allocated_counter const * it)
+{
+ size_t i;
+ size_t * counter_map;
+ size_t nr_events;
+ struct parsed_event parsed[MAX_EVENTS];
+ struct op_event const * event[MAX_EVENTS];
+
+ op_events(it->cpu_type);
+
+ nr_events = parse_events(parsed, MAX_EVENTS, it->events);
+
+ for (i = 0; i < nr_events; ++i) {
+ event[i] = find_event_by_name(parsed[i].name, parsed[i].unit_mask,
+ parsed[i].unit_mask_valid);
+ if (!event[i]) {
+ if (it->failure == fail_to_find_event)
+ goto free_events;
+ printf("Can't find events %s for cpu %s\n",
+ parsed[i].name,
+ op_get_cpu_type_str(it->cpu_type));
+ exit(EXIT_FAILURE);
+ }
+ }
+
+ counter_map = map_event_to_counter(event, nr_events, it->cpu_type);
+ if (!counter_map) {
+ if (it->failure == fail_to_alloc_counter)
+ goto free_events;
+ printf("Can't map this set of events to counter:\n");
+ show_events(it->events);
+ exit(EXIT_FAILURE);
+ }
+
+ for (i = 0; i < nr_events; ++i) {
+ if (counter_map[i] != it->alloc_map[i]) {
+ printf("Incorrect allocation map for these events:\n");
+ show_events(it->events);
+ printf("(expect, found):\n");
+ show_counter_map(it->alloc_map, nr_events);
+ show_counter_map(counter_map, nr_events);
+ exit(EXIT_FAILURE);
+ }
+ }
+
+ if (it->failure != no_failure) {
+ /* test should fail but success! */
+ printf("test should fail with a failure type %d but succeed "
+ "for events:\n", it->failure);
+ for (i = 0; i < nr_events; ++i)
+ printf("%s\n", it->events[i]);
+ exit(EXIT_FAILURE);
+ }
+
+ free(counter_map);
+free_events:
+ op_free_events();
+}
+
+
+int main(void)
+{
+ struct allocated_counter const * it;
+
+ setenv("OPROFILE_EVENTS_DIR", OPROFILE_SRCDIR "/events", 1);
+
+ for (it = tests; it->cpu_type != CPU_NO_GOOD; ++it)
+ do_test(it);
+
+ return 0;
+}
diff --git a/libop/tests/cpu_type_tests.c b/libop/tests/cpu_type_tests.c
new file mode 100644
index 0000000..2b0f6ba
--- /dev/null
+++ b/libop/tests/cpu_type_tests.c
@@ -0,0 +1,79 @@
+/**
+ * @file cpu_type_tests.c
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "op_cpu_type.h"
+
+static struct cpu_type {
+ char const * name;
+ op_cpu type;
+} cpu_str[] = {
+ { "i386/ppro", CPU_PPRO },
+ { "i386/pii", CPU_PII },
+ { "i386/piii", CPU_PIII },
+ { "i386/athlon", CPU_ATHLON },
+ { "timer", CPU_TIMER_INT },
+ { "rtc", CPU_RTC },
+ { "i386/p4", CPU_P4 },
+ { "ia64/ia64", CPU_IA64 },
+ { "ia64/itanium", CPU_IA64_1 },
+ { "ia64/itanium2", CPU_IA64_2 },
+ { "x86-64/hammer", CPU_HAMMER },
+ { "i386/p4-ht", CPU_P4_HT2 },
+ { "alpha/ev4", CPU_AXP_EV4 },
+ { "alpha/ev5", CPU_AXP_EV5 },
+ { "alpha/pca56", CPU_AXP_PCA56 },
+ { "alpha/ev6", CPU_AXP_EV6 },
+ { "alpha/ev67", CPU_AXP_EV67 },
+ { "foo", CPU_NO_GOOD },
+ { "-3", CPU_NO_GOOD },
+ { "2927", CPU_NO_GOOD },
+ { "", CPU_NO_GOOD },
+ { NULL, CPU_NO_GOOD }
+};
+
+
+static void test(struct cpu_type const * cpu)
+{
+ char const * name;
+ op_cpu type;
+
+ name = op_get_cpu_name(cpu->type);
+ if (cpu->type != CPU_NO_GOOD && strcmp(cpu->name, name)) {
+ printf("for %d expect %s found %s\n", cpu->type, cpu->name,
+ name);
+ exit(EXIT_FAILURE);
+ }
+ if (cpu->type == CPU_NO_GOOD && strcmp("invalid cpu type", name)) {
+ printf("for %d expect %s found %s\n", cpu->type,
+ "invalid cpu type", name);
+ exit(EXIT_FAILURE);
+ }
+
+ type = op_get_cpu_number(cpu->name);
+ if (type != cpu->type) {
+ printf("for %s expect %d found %d\n", cpu->name, cpu->type,
+ type);
+ exit(EXIT_FAILURE);
+ }
+}
+
+
+int main(void)
+{
+ struct cpu_type * cpu;
+ for (cpu = cpu_str; cpu->name; ++cpu)
+ test(cpu);
+ return 0;
+}
diff --git a/libop/tests/load_events_files_tests.c b/libop/tests/load_events_files_tests.c
new file mode 100644
index 0000000..de548e5
--- /dev/null
+++ b/libop/tests/load_events_files_tests.c
@@ -0,0 +1,31 @@
+/**
+ * @file load_events_files_tests.c
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "op_events.h"
+#include "op_cpu_type.h"
+
+int main(void)
+{
+ op_cpu cpu_type;
+
+ setenv("OPROFILE_EVENTS_DIR", OPROFILE_SRCDIR "/events", 1);
+
+ for (cpu_type = CPU_NO_GOOD + 1; cpu_type < MAX_CPU_TYPE; ++cpu_type) {
+ if (cpu_type != CPU_TIMER_INT) {
+ op_events(cpu_type);
+ op_free_events();
+ }
+ }
+
+ return 0;
+}
diff --git a/libop/tests/mangle_tests.c b/libop/tests/mangle_tests.c
new file mode 100644
index 0000000..5e662dd
--- /dev/null
+++ b/libop/tests/mangle_tests.c
@@ -0,0 +1,67 @@
+/**
+ * @file mangle_tests.c
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "op_libiberty.h"
+#include "op_mangle.h"
+#include "op_config.h"
+
+struct test_input {
+ struct mangle_values values;
+ char const * result;
+};
+
+static struct test_input const tests[] = {
+ { { MANGLE_NONE, "foo", "", "bar", NULL, "EVENT", 0, 0, 0, 0, 0 },
+ "{root}/bar/{dep}/{root}/foo/EVENT.0.0.all.all.all" },
+ { { MANGLE_CPU, "foo", "", "bar", NULL, "EVENT", 0, 0, 0, 0, 2 },
+ "{root}/bar/{dep}/{root}/foo/EVENT.0.0.all.all.2" },
+ { { MANGLE_TID, "foo", "", "bar", NULL, "EVENT", 0, 0, 0, 33, 0 },
+ "{root}/bar/{dep}/{root}/foo/EVENT.0.0.all.33.all" },
+ { { MANGLE_TGID, "foo", "", "bar", NULL, "EVENT", 0, 0, 34, 0, 0 },
+ "{root}/bar/{dep}/{root}/foo/EVENT.0.0.34.all.all" },
+ { { MANGLE_KERNEL, "foo", "", "bar", NULL, "EVENT", 0, 0, 0, 0, 0 },
+ "{kern}/bar/{dep}/{kern}/foo/EVENT.0.0.all.all.all" },
+ { { MANGLE_CALLGRAPH, "foo-from", "", "bar-from", "foo-to", "EVENT", 0, 0, 0, 0, 0 },
+ "{root}/bar-from/{dep}/{root}/foo-from/{cg}/{root}/foo-to/EVENT.0.0.all.all.all" },
+ { { MANGLE_CPU|MANGLE_TID|MANGLE_TID|MANGLE_TGID|MANGLE_KERNEL, "foo", "", "bar", NULL, "EVENT", 1234, 8192, 34, 35, 2 },
+ "{kern}/bar/{dep}/{kern}/foo/EVENT.1234.8192.34.35.2" },
+ { { MANGLE_CPU|MANGLE_TID|MANGLE_TID|MANGLE_TGID|MANGLE_KERNEL, "foo1/foo2", "", "bar1/bar2", NULL, "EVENT", 1234, 8192, 34, 35, 2 },
+ "{root}/bar1/bar2/{dep}/{root}/foo1/foo2/EVENT.1234.8192.34.35.2" },
+ { { MANGLE_CALLGRAPH|MANGLE_CPU|MANGLE_TID|MANGLE_TID|MANGLE_TGID|MANGLE_KERNEL, "bar1/bar2", "", "bar1/bar2", "bar1/bar2-to", "EVENT", 1234, 8192, 34, 35, 2 },
+ "{root}/bar1/bar2/{dep}/{root}/bar1/bar2/{cg}/{root}/bar1/bar2-to/EVENT.1234.8192.34.35.2" },
+
+ { { 0, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, 0 }, NULL }
+};
+
+
+int main(void)
+{
+ struct test_input const * test;
+ for (test = tests; test->result; ++test) {
+ char * result = op_mangle_filename(&test->values);
+ char * expect = xmalloc(strlen(test->result) +
+ strlen(op_samples_current_dir) + 1);
+ strcpy(expect, op_samples_current_dir);
+ strcat(expect, test->result);
+ if (strcmp(result, expect)) {
+ fprintf(stderr, "test %d:\nfound: %s\nexpect: %s\n",
+ (int)(test - tests), result, expect);
+ exit(EXIT_FAILURE);
+ }
+ free(expect);
+ free(result);
+ }
+
+ return EXIT_SUCCESS;
+}
diff --git a/libop/tests/parse_event_tests.c b/libop/tests/parse_event_tests.c
new file mode 100644
index 0000000..b2fda3b
--- /dev/null
+++ b/libop/tests/parse_event_tests.c
@@ -0,0 +1,59 @@
+/**
+ * @file parse_event_tests.c
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "op_parse_event.h"
+
+struct events_test {
+ /* second pointer is the null terminating array marker */
+ char const * const tests[2];
+ struct parsed_event expected;
+};
+
+static struct events_test const events[] =
+{
+ { { "FOO:3000:0:0:0", 0 }, { "FOO", 3000, 0, 0, 0, 0 } },
+ { { "BAR:3000", 0 }, { "BAR", 3000, 0, 1, 1, 0 } },
+ { { "FOOBAR:3000:1:1:1", 0 }, { "FOOBAR", 3000, 1, 1, 1, 0 } },
+ { { NULL, NULL }, { 0, 0, 0, 0, 0, 0 } }
+};
+
+static void do_test(struct events_test const * ev)
+{
+ struct parsed_event parsed;
+
+ parse_events(&parsed, 1, ev->tests);
+
+ if (strcmp(ev->expected.name, parsed.name) ||
+ ev->expected.count != parsed.count ||
+ ev->expected.unit_mask != parsed.unit_mask ||
+ ev->expected.kernel != parsed.kernel ||
+ ev->expected.user != parsed.user) {
+ printf("for %s expect { %s, %d, %d, %d, %d } found "
+ "{ %s, %d, %d, %d, %d }\n",
+ ev->tests[0], ev->expected.name, ev->expected.count,
+ ev->expected.unit_mask, ev->expected.kernel,
+ ev->expected.user, parsed.name, parsed.count,
+ parsed.unit_mask, parsed.kernel, parsed.user);
+ exit(EXIT_FAILURE);
+ }
+}
+
+int main(void)
+{
+ struct events_test const * ev;
+ for (ev = events; ev->tests[0]; ++ev)
+ do_test(ev);
+
+ return 0;
+}
diff --git a/libopagent/Makefile.am b/libopagent/Makefile.am
new file mode 100644
index 0000000..7b891a3
--- /dev/null
+++ b/libopagent/Makefile.am
@@ -0,0 +1,25 @@
+pkglib_LTLIBRARIES = libopagent.la
+
+# install opagent.h to include directory
+include_HEADERS = opagent.h
+
+libopagent_la_SOURCES = opagent.c \
+ jitdump.h \
+ opagent.h
+
+EXTRA_DIST = opagent_symbols.ver
+
+
+libopagent_la_CFLAGS = -fPIC -I ${top_srcdir}/libop -I ${top_srcdir}/libutil
+libopagent_la_LIBADD = $(BFD_LIBS)
+
+# Do not increment the major version for this library except to
+# intentionally break backward ABI compatability. Use the
+# symbol versioning technique (via the version script) to add new or
+# change existing functions; then just increment the minor version.
+# See http://www.gnu.org/software/binutils/manual/ld-2.9.1/html_node/ld_25.html
+# for details about the --version-script option.
+libopagent_la_LDFLAGS = -version-info 1:0:0 \
+ -Wl,--version-script=${top_srcdir}/libopagent/opagent_symbols.ver
+
+
diff --git a/libopagent/Makefile.in b/libopagent/Makefile.in
new file mode 100644
index 0000000..de96d3b
--- /dev/null
+++ b/libopagent/Makefile.in
@@ -0,0 +1,556 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = libopagent
+DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/binutils.m4 \
+ $(top_srcdir)/m4/builtinexpect.m4 \
+ $(top_srcdir)/m4/cellspubfdsupport.m4 \
+ $(top_srcdir)/m4/compileroption.m4 \
+ $(top_srcdir)/m4/configmodule.m4 \
+ $(top_srcdir)/m4/copyifchange.m4 $(top_srcdir)/m4/docbook.m4 \
+ $(top_srcdir)/m4/extradirs.m4 $(top_srcdir)/m4/findkernel.m4 \
+ $(top_srcdir)/m4/kerneloption.m4 \
+ $(top_srcdir)/m4/kernelversion.m4 \
+ $(top_srcdir)/m4/mallocattribute.m4 \
+ $(top_srcdir)/m4/poptconst.m4 \
+ $(top_srcdir)/m4/precompiledheader.m4 $(top_srcdir)/m4/qt.m4 \
+ $(top_srcdir)/m4/resultyn.m4 $(top_srcdir)/m4/sstream.m4 \
+ $(top_srcdir)/m4/typedef.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(includedir)"
+pkglibLTLIBRARIES_INSTALL = $(INSTALL)
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+am__DEPENDENCIES_1 =
+libopagent_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_libopagent_la_OBJECTS = libopagent_la-opagent.lo
+libopagent_la_OBJECTS = $(am_libopagent_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libopagent_la_SOURCES)
+DIST_SOURCES = $(libopagent_la_SOURCES)
+includeHEADERS_INSTALL = $(INSTALL_HEADER)
+HEADERS = $(include_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFD_LIBS = @BFD_LIBS@
+BUILD_JVMPI_AGENT_FALSE = @BUILD_JVMPI_AGENT_FALSE@
+BUILD_JVMPI_AGENT_TRUE = @BUILD_JVMPI_AGENT_TRUE@
+BUILD_JVMTI_AGENT_FALSE = @BUILD_JVMTI_AGENT_FALSE@
+BUILD_JVMTI_AGENT_TRUE = @BUILD_JVMTI_AGENT_TRUE@
+CAT_ENTRY_END = @CAT_ENTRY_END@
+CAT_ENTRY_START = @CAT_ENTRY_START@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOCBOOK_ROOT = @DOCBOOK_ROOT@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+EXTRA_CFLAGS_MODULE = @EXTRA_CFLAGS_MODULE@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAVA_HOMEDIR = @JAVA_HOMEDIR@
+KINC = @KINC@
+KSRC = @KSRC@
+KVERS = @KVERS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBERTY_LIBS = @LIBERTY_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MOC = @MOC@
+MODINSTALLDIR = @MODINSTALLDIR@
+OBJEXT = @OBJEXT@
+OPROFILE_DIR = @OPROFILE_DIR@
+OPROFILE_MODULE_ARCH = @OPROFILE_MODULE_ARCH@
+OP_CFLAGS = @OP_CFLAGS@
+OP_CXXFLAGS = @OP_CXXFLAGS@
+OP_DOCDIR = @OP_DOCDIR@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POPT_LIBS = @POPT_LIBS@
+PTRDIFF_T_TYPE = @PTRDIFF_T_TYPE@
+QT_INCLUDES = @QT_INCLUDES@
+QT_LDFLAGS = @QT_LDFLAGS@
+QT_LIB = @QT_LIB@
+QT_VERSION = @QT_VERSION@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIZE_T_TYPE = @SIZE_T_TYPE@
+STRIP = @STRIP@
+UIC = @UIC@
+VERSION = @VERSION@
+XML_CATALOG = @XML_CATALOG@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+have_qt_FALSE = @have_qt_FALSE@
+have_qt_TRUE = @have_qt_TRUE@
+have_xsltproc_FALSE = @have_xsltproc_FALSE@
+have_xsltproc_TRUE = @have_xsltproc_TRUE@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+kernel_support_FALSE = @kernel_support_FALSE@
+kernel_support_TRUE = @kernel_support_TRUE@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+topdir = @topdir@
+pkglib_LTLIBRARIES = libopagent.la
+
+# install opagent.h to include directory
+include_HEADERS = opagent.h
+libopagent_la_SOURCES = opagent.c \
+ jitdump.h \
+ opagent.h
+
+EXTRA_DIST = opagent_symbols.ver
+libopagent_la_CFLAGS = -fPIC -I ${top_srcdir}/libop -I ${top_srcdir}/libutil
+libopagent_la_LIBADD = $(BFD_LIBS)
+
+# Do not increment the major version for this library except to
+# intentionally break backward ABI compatability. Use the
+# symbol versioning technique (via the version script) to add new or
+# change existing functions; then just increment the minor version.
+# See http://www.gnu.org/software/binutils/manual/ld-2.9.1/html_node/ld_25.html
+# for details about the --version-script option.
+libopagent_la_LDFLAGS = -version-info 1:0:0 \
+ -Wl,--version-script=${top_srcdir}/libopagent/opagent_symbols.ver
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libopagent/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign libopagent/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ test -z "$(pkglibdir)" || $(mkdir_p) "$(DESTDIR)$(pkglibdir)"
+ @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+ if test -f $$p; then \
+ f=$(am__strip_dir) \
+ echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \
+ $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \
+ else :; fi; \
+ done
+
+uninstall-pkglibLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @set -x; list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+ p=$(am__strip_dir) \
+ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \
+ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \
+ done
+
+clean-pkglibLTLIBRARIES:
+ -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+ @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" != "$$p" || dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libopagent.la: $(libopagent_la_OBJECTS) $(libopagent_la_DEPENDENCIES)
+ $(LINK) -rpath $(pkglibdir) $(libopagent_la_LDFLAGS) $(libopagent_la_OBJECTS) $(libopagent_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libopagent_la-opagent.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+libopagent_la-opagent.lo: opagent.c
+@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopagent_la_CFLAGS) $(CFLAGS) -MT libopagent_la-opagent.lo -MD -MP -MF "$(DEPDIR)/libopagent_la-opagent.Tpo" -c -o libopagent_la-opagent.lo `test -f 'opagent.c' || echo '$(srcdir)/'`opagent.c; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libopagent_la-opagent.Tpo" "$(DEPDIR)/libopagent_la-opagent.Plo"; else rm -f "$(DEPDIR)/libopagent_la-opagent.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='opagent.c' object='libopagent_la-opagent.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libopagent_la_CFLAGS) $(CFLAGS) -c -o libopagent_la-opagent.lo `test -f 'opagent.c' || echo '$(srcdir)/'`opagent.c
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+install-includeHEADERS: $(include_HEADERS)
+ @$(NORMAL_INSTALL)
+ test -z "$(includedir)" || $(mkdir_p) "$(DESTDIR)$(includedir)"
+ @list='$(include_HEADERS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \
+ $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \
+ done
+
+uninstall-includeHEADERS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(include_HEADERS)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \
+ rm -f "$(DESTDIR)$(includedir)/$$f"; \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(HEADERS)
+installdirs:
+ for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(includedir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-includeHEADERS
+
+install-exec-am: install-pkglibLTLIBRARIES
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-includeHEADERS uninstall-info-am \
+ uninstall-pkglibLTLIBRARIES
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-pkglibLTLIBRARIES ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-exec \
+ install-exec-am install-includeHEADERS install-info \
+ install-info-am install-man install-pkglibLTLIBRARIES \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am tags uninstall uninstall-am \
+ uninstall-includeHEADERS uninstall-info-am \
+ uninstall-pkglibLTLIBRARIES
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/libopagent/jitdump.h b/libopagent/jitdump.h
new file mode 100644
index 0000000..3fe8d41
--- /dev/null
+++ b/libopagent/jitdump.h
@@ -0,0 +1,101 @@
+/**
+ * @file jitdump.h
+ * Header structure of a JIT-dump file.
+ *
+ * @remark Copyright 2007 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Jens Wilke
+ * @Modifications Daniel Hansel
+ *
+ * Copyright IBM Corporation 2007
+ *
+ */
+
+#include <sys/time.h>
+#include <time.h>
+#include <stdint.h>
+
+#include "op_types.h"
+
+#ifndef JITDUMP_H
+#define JITDUMP_H
+
+ /**
+ * Magic to do a sanity check that this is a dump file
+ * characters "jItO" */
+#define JITHEADER_MAGIC 0x4F74496A
+
+/**
+ * Macro to calculate count of padding bytes
+ * to extend a size to be 8-byte aligned. */
+#define PADDING_8ALIGNED(x) ((((x) + 7) & 7) ^ 7)
+
+/**
+ * Version number to avoid conflicts, increase
+ * this whenever the header is changed */
+#define JITHEADER_VERSION 1
+
+struct jitheader {
+ /* characters "jItO" */
+ u32 magic;
+ /* version of the dump */
+ u32 version;
+ u32 totalsize;
+ u32 bfd_arch;
+ u32 bfd_mach;
+ u64 timestamp;
+ char bfd_target[0];
+};
+
+enum jit_record_type {
+ JIT_CODE_LOAD=0,
+ JIT_CODE_UNLOAD=1,
+ JIT_CODE_CLOSE=2,
+ JIT_CODE_DEBUG_INFO=3
+};
+
+/* each record starts always with a id and a total_size */
+struct jr_prefix {
+ u32 id;
+ u32 total_size;
+};
+
+/* record0 (id=0) logs a jitted code */
+struct jr_code_load {
+ u32 id;
+ u32 total_size;
+ u64 timestamp;
+ u64 vma;
+ u64 code_addr;
+ u32 code_size;
+ u32 align;
+};
+
+/* record1 (id=1) logs a code unload */
+struct jr_code_unload {
+ u32 id;
+ u32 total_size;
+ u64 timestamp;
+ u64 vma;
+};
+
+/* record2 (id=2) logs end of JVM livetime */
+struct jr_code_close {
+ u32 id;
+ u32 total_size;
+ u64 timestamp;
+};
+
+/* record3 (id=3) logs debug line information. */
+struct jr_code_debug_info {
+ u32 id;
+ u32 total_size;
+ u64 timestamp;
+ u64 code_addr;
+ u32 nr_entry;
+ u32 align;
+};
+
+#endif /* !JITDUMP_H */
+
diff --git a/libopagent/opagent.c b/libopagent/opagent.c
new file mode 100644
index 0000000..2db1477
--- /dev/null
+++ b/libopagent/opagent.c
@@ -0,0 +1,389 @@
+/**
+ * @file opagent.c
+ * Interface to report symbol names and dynamically generated code to Oprofile
+ *
+ * @remark Copyright 2007 OProfile authors
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @author Jens Wilke
+ * @Modifications Daniel Hansel
+ *
+ * Copyright IBM Corporation 2007
+ *
+ */
+
+/******************************************************************
+ * ATTENTION:
+ * When adding new functions to this interface, you MUST update
+ * opagent_symbols.ver.
+ *
+ * If a change is made to an existing exported function, perform the
+ * the following steps. As an example, assume op_open_agent()
+ * is being updated to include a 'dump_code' parameter.
+ * 1. Update the opagent.ver file with a new version node, and
+ * add the op_open_agent to it. Note that op_open_agent
+ * is also still declared in the original version node.
+ * 2. Add '__asm__(".symver <blah>") directives to this .c source file.
+ * For this example, the directives would be as follows:
+ * __asm__(".symver op_open_agent_1_0,op_open_agent@OPAGENT_1.0");
+ * __asm__(".symver op_open_agent_2_0,op_open_agent@@OPAGENT_2.0");
+ * 3. Update the declaration of op_open_agent in the header file with
+ * the additional parameter.
+ * 4. Change the name of the original op_open_agent to "op_open_agent_1_0"
+ * in this .c source file.
+ * 5. Add the new op_open_agent_2_0(int dump_code) function in this
+ * .c source file.
+ *
+ * See libopagent/Makefile.am for more information.
+ *******************************************************************/
+
+#include <stdio.h>
+#include <errno.h>
+#include <string.h>
+#include <stdint.h>
+#include <limits.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <time.h>
+#include <bfd.h>
+
+#include "opagent.h"
+#include "op_config.h"
+#include "jitdump.h"
+
+// Declare BFD-related global variables.
+static char * _bfd_target_name;
+static int _bfd_arch;
+static unsigned int _bfd_mach;
+
+// Define BFD-related global variables.
+static int define_bfd_vars(void)
+{
+ bfd * bfd;
+ bfd_boolean r;
+ int len;
+#define MAX_PATHLENGTH 2048
+ char mypath[MAX_PATHLENGTH];
+
+ len = readlink("/proc/self/exe", mypath, sizeof(mypath));
+
+ if (len < 0) {
+ fprintf(stderr, "libopagent: readlink /proc/self/exe failed\n");
+ return -1;
+ }
+ if (len >= MAX_PATHLENGTH) {
+ fprintf(stderr, "libopagent: readlink /proc/self/exe returned"
+ " path length longer than %d.\n", MAX_PATHLENGTH);
+
+ return -1;
+ }
+ mypath[len] = '\0';
+
+ bfd_init();
+ bfd = bfd_openr(mypath, NULL);
+ if (bfd == NULL) {
+ bfd_perror("bfd_openr error. Cannot get required BFD info");
+ return -1;
+ }
+ r = bfd_check_format(bfd, bfd_object);
+ if (!r) {
+ bfd_perror("bfd_get_arch error. Cannot get required BFD info");
+ return -1;
+ }
+ _bfd_target_name = bfd->xvec->name;
+ _bfd_arch = bfd_get_arch(bfd);
+ _bfd_mach = bfd_get_mach(bfd);
+
+ return 0;
+}
+/**
+ * Define the version of the opagent library.
+ */
+#define OP_MAJOR_VERSION 1
+#define OP_MINOR_VERSION 0
+
+#define AGENT_DIR OP_SESSION_DIR_DEFAULT "jitdump"
+
+#define MSG_MAXLEN 20
+
+op_agent_t op_open_agent(void)
+{
+ char pad_bytes[7] = {0, 0, 0, 0, 0, 0, 0};
+ int pad_cnt;
+ char dump_path[PATH_MAX];
+ char err_msg[PATH_MAX + 16];
+ struct stat dirstat;
+ int rc;
+ struct jitheader header;
+ int fd;
+ struct timeval tv;
+ FILE * dumpfile = NULL;
+
+ rc = stat(AGENT_DIR, &dirstat);
+ if (rc || !S_ISDIR(dirstat.st_mode)) {
+ if (!rc)
+ errno = ENOTDIR;
+ fprintf(stderr,"libopagent: Jitdump agent directory %s "
+ "missing\n", AGENT_DIR);
+ fprintf(stderr,"libopagent: do opcontrol --setup or "
+ "opcontrol --reset, first\n");
+ return NULL;
+ }
+ snprintf(dump_path, PATH_MAX, "%s/%i.dump", AGENT_DIR, getpid());
+ snprintf(err_msg, PATH_MAX + 16, "Error opening %s\n", dump_path);
+ // make the dump file only accessible for the user for security reason.
+ fd = creat(dump_path, S_IRUSR|S_IWUSR);
+ if (fd == -1) {
+ fprintf(stderr, "%s\n", err_msg);
+ return NULL;
+ }
+ dumpfile = fdopen(fd, "w");
+ if (!dumpfile) {
+ fprintf(stderr, "%s\n", err_msg);
+ return NULL;
+ }
+ if (define_bfd_vars())
+ return NULL;
+ header.magic = JITHEADER_MAGIC;
+ header.version = JITHEADER_VERSION;
+ header.totalsize = sizeof(header) + strlen(_bfd_target_name) + 1;
+ /* calculate amount of padding '\0' */
+ pad_cnt = PADDING_8ALIGNED(header.totalsize);
+ header.totalsize += pad_cnt;
+ header.bfd_arch = _bfd_arch;
+ header.bfd_mach = _bfd_mach;
+ if (gettimeofday(&tv, NULL)) {
+ fprintf(stderr, "gettimeofday failed\n");
+ return NULL;
+ }
+
+ header.timestamp = tv.tv_sec;
+ snprintf(err_msg, PATH_MAX + 16, "Error writing to %s", dump_path);
+ if (!fwrite(&header, sizeof(header), 1, dumpfile)) {
+ fprintf(stderr, "%s\n", err_msg);
+ return NULL;
+ }
+ if (!fwrite(_bfd_target_name, strlen(_bfd_target_name) + 1, 1,
+ dumpfile)) {
+ fprintf(stderr, "%s\n", err_msg);
+ return NULL;
+ }
+ /* write padding '\0' if necessary */
+ if (pad_cnt && !fwrite(pad_bytes, pad_cnt, 1, dumpfile)) {
+ fprintf(stderr, "%s\n", err_msg);
+ return NULL;
+ }
+ fflush(dumpfile);
+ return (op_agent_t)dumpfile;
+}
+
+
+int op_close_agent(op_agent_t hdl)
+{
+ struct jr_code_close rec;
+ struct timeval tv;
+ FILE * dumpfile = (FILE *) hdl;
+ if (!dumpfile) {
+ errno = EINVAL;
+ return -1;
+ }
+ rec.id = JIT_CODE_CLOSE;
+ rec.total_size = sizeof(rec);
+ if (gettimeofday(&tv, NULL)) {
+ fprintf(stderr, "gettimeofday failed\n");
+ return -1;
+ }
+ rec.timestamp = tv.tv_sec;
+
+ if (!fwrite(&rec, sizeof(rec), 1, dumpfile))
+ return -1;
+ fclose(dumpfile);
+ dumpfile = NULL;
+ return 0;
+}
+
+
+int op_write_native_code(op_agent_t hdl, char const * symbol_name,
+ uint64_t vma, void const * code, unsigned int const size)
+{
+ struct jr_code_load rec;
+ struct timeval tv;
+ size_t sz_symb_name;
+ char pad_bytes[7] = { 0, 0, 0, 0, 0, 0, 0 };
+ size_t padding_count;
+ FILE * dumpfile = (FILE *) hdl;
+
+ if (!dumpfile) {
+ errno = EINVAL;
+ fprintf(stderr, "Invalid hdl argument\n");
+ return -1;
+ }
+ sz_symb_name = strlen(symbol_name) + 1;
+
+ rec.id = JIT_CODE_LOAD;
+ rec.code_size = size;
+ rec.vma = vma;
+ rec.code_addr = (u64) (uintptr_t) code;
+ rec.total_size = code ? sizeof(rec) + sz_symb_name + size :
+ sizeof(rec) + sz_symb_name;
+ /* calculate amount of padding '\0' */
+ padding_count = PADDING_8ALIGNED(rec.total_size);
+ rec.total_size += padding_count;
+ if (gettimeofday(&tv, NULL)) {
+ fprintf(stderr, "gettimeofday failed\n");
+ return -1;
+ }
+
+ rec.timestamp = tv.tv_sec;
+
+ /* locking makes sure that we continuously write this record, if
+ * we are called within a multi-threaded context */
+ flockfile(dumpfile);
+ /* Write record, symbol name, code (optionally), and (if necessary)
+ * additonal padding \0 bytes.
+ */
+ if (fwrite_unlocked(&rec, sizeof(rec), 1, dumpfile) &&
+ fwrite_unlocked(symbol_name, sz_symb_name, 1, dumpfile)) {
+ if (code)
+ fwrite_unlocked(code, size, 1, dumpfile);
+ if (padding_count)
+ fwrite_unlocked(pad_bytes, padding_count, 1, dumpfile);
+ /* Always flush to ensure conversion code to elf will see
+ * data as soon as possible */
+ fflush_unlocked(dumpfile);
+ funlockfile(dumpfile);
+ return 0;
+ }
+ fflush_unlocked(dumpfile);
+ funlockfile(dumpfile);
+ return -1;
+}
+
+
+int op_write_debug_line_info(op_agent_t hdl, void const * code,
+ size_t nr_entry,
+ struct debug_line_info const * compile_map)
+{
+ struct jr_code_debug_info rec;
+ long cur_pos, last_pos;
+ struct timeval tv;
+ size_t i;
+ size_t padding_count;
+ char padd_bytes[7] = {0, 0, 0, 0, 0, 0, 0};
+ int rc = -1;
+ FILE * dumpfile = (FILE *) hdl;
+
+ if (!dumpfile) {
+ errno = EINVAL;
+ fprintf(stderr, "Invalid hdl argument\n");
+ return -1;
+ }
+
+ /* write nothing if no entries are provided */
+ if (nr_entry == 0)
+ return 0;
+
+ rec.id = JIT_CODE_DEBUG_INFO;
+ rec.code_addr = (uint64_t)(uintptr_t)code;
+ /* will be fixed after writing debug line info */
+ rec.total_size = 0;
+ rec.nr_entry = nr_entry;
+ if (gettimeofday(&tv, NULL)) {
+ fprintf(stderr, "gettimeofday failed\n");
+ return -1;
+ }
+
+ rec.timestamp = tv.tv_sec;
+
+ flockfile(dumpfile);
+
+ if ((cur_pos = ftell(dumpfile)) == -1l)
+ goto error;
+ if (!fwrite_unlocked(&rec, sizeof(rec), 1, dumpfile))
+ goto error;
+ for (i = 0; i < nr_entry; ++i) {
+ if (!fwrite_unlocked(&compile_map[i].vma,
+ sizeof(compile_map[i].vma), 1,
+ dumpfile) ||
+ !fwrite_unlocked(&compile_map[i].lineno,
+ sizeof(compile_map[i].lineno), 1,
+ dumpfile) ||
+ !fwrite_unlocked(compile_map[i].filename,
+ strlen(compile_map[i].filename) + 1, 1,
+ dumpfile))
+ goto error;
+ }
+
+ if ((last_pos = ftell(dumpfile)) == -1l)
+ goto error;
+ rec.total_size = last_pos - cur_pos;
+ padding_count = PADDING_8ALIGNED(rec.total_size);
+ rec.total_size += padding_count;
+ if (padding_count && !fwrite(padd_bytes, padding_count, 1, dumpfile))
+ goto error;
+ if (fseek(dumpfile, cur_pos, SEEK_SET) == -1l)
+ goto error;
+ if (!fwrite_unlocked(&rec, sizeof(rec), 1, dumpfile))
+ goto error;
+ if (fseek(dumpfile, last_pos + padding_count, SEEK_SET) == -1)
+ goto error;
+
+ rc = 0;
+error:
+ fflush_unlocked(dumpfile);
+ funlockfile(dumpfile);
+ return rc;
+}
+
+
+int op_unload_native_code(op_agent_t hdl, uint64_t vma)
+{
+ struct jr_code_unload rec;
+ struct timeval tv;
+ FILE * dumpfile = (FILE *) hdl;
+
+ if (!dumpfile) {
+ errno = EINVAL;
+ fprintf(stderr, "Invalid hdl argument\n");
+ return -1;
+ }
+
+ rec.id = JIT_CODE_UNLOAD;
+ rec.vma = vma;
+ rec.total_size = sizeof(rec);
+ if (gettimeofday(&tv, NULL)) {
+ fprintf(stderr, "gettimeofday failed\n");
+ return -1;
+ }
+ rec.timestamp = tv.tv_sec;
+
+ if (!fwrite(&rec, sizeof(rec), 1, dumpfile))
+ return -1;
+ fflush(dumpfile);
+ return 0;
+}
+
+int op_major_version(void)
+{
+ return OP_MAJOR_VERSION;
+}
+
+int op_minor_version(void)
+{
+ return OP_MINOR_VERSION;
+}
diff --git a/libopagent/opagent.h b/libopagent/opagent.h
new file mode 100644
index 0000000..920e399
--- /dev/null
+++ b/libopagent/opagent.h
@@ -0,0 +1,145 @@
+/**
+ * @file opagent.h
+ * Interface to report symbol names and dynamically generated code to Oprofile
+ *
+ * @remark Copyright 2007 OProfile authors
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * @author Jens Wilke
+ * @Modifications Daniel Hansel
+ *
+ * Copyright IBM Corporation 2007
+ *
+ */
+
+#ifndef _LIB_OPAGENT_H
+#define _LIB_OPAGENT_H
+
+#include <sys/types.h>
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+struct debug_line_info {
+ unsigned long vma;
+ unsigned int lineno;
+ /* The filename format is unspecified, absolute path, relative etc. */
+ char const * filename;
+};
+
+typedef void * op_agent_t;
+
+/**
+ * This function must be called by agents before any other function.
+ * Creates and opens a JIT dump file in /var/lib/oprofile/jitdump
+ * using the naming convention <process_id>.dump.
+ *
+ * Returns a valid op_agent_t handle or NULL. If NULL is returned, errno
+ * is set to indicate the nature of the error.
+ **/
+op_agent_t op_open_agent(void);
+
+/**
+ * Frees all resources and closes open file handles.
+ *
+ * hdl: Handle returned from an earlier call to op_open_agent()
+ *
+ * Returns 0 on success; -1 otherwise. If -1 is returned, errno is
+ * set to indicate the nature of the error.
+ **/
+int op_close_agent(op_agent_t hdl);
+
+/**
+ * Signal the dynamic generation of native code from a virtual machine.
+ * Writes a JIT dump record to the open JIT dump file using
+ * the passed information.
+ *
+ * hdl: Handle returned from an earlier call to op_open_agent()
+ * symbol_name: The name of the symbol being dynamically compiled.
+ * This name can (and should) contain all necessary
+ * information to disambiguate it from symbols of the
+ * same name; e.g., class, method signature.
+ * vma: The virtual memory address of the executable code.
+ * code: Pointer to the location of the compiled code.
+ * Theoretically, this may be a different location from
+ * that given by the vma argument. For some JIT compilers,
+ * obtaining the code may be impractical. For this (or any other)
+ * reason, the agent can choose to pass NULL for this paraemter.
+ * If NULL is passed, no code will be copied into the JIT dump
+ * file.
+ * code_size: Size of the compiled code.
+ *
+ * Returns 0 on success; -1 otherwise. If -1 is returned, errno is
+ * set to indicate the nature of the error.
+ **/
+int op_write_native_code(op_agent_t hdl, char const * symbol_name,
+ uint64_t vma, void const * code,
+ const unsigned int code_size);
+
+/**
+ * Add debug line information to a piece of code. An op_write_native_code()
+ * with the same code pointer should have occurred before this call. It's not
+ * necessary to provide one lineno information entry per machine instruction;
+ * the array can contain hole.
+ *
+ * hdl: Handle returned from an earlier call to op_open_agent()
+ * code: Pointer to the location of the code with debug info
+ * nr_entry: Number of entries in compile_map
+ * compile_map: Array of struct debug_line_info. See the JVMTI agent
+ * library implementation for an example of what information
+ * should be retrieved from a VM to fill out this data structure.
+ *
+ * Returns 0 on success; -1 otherwise. If -1 is returned, errno is
+ * set to indicate the nature of the error.
+ **/
+int op_write_debug_line_info(op_agent_t hdl, void const * code,
+ size_t nr_entry,
+ struct debug_line_info const * compile_map);
+
+/**
+ * Signal the invalidation of native code from a virtual machine.
+ *
+ * hdl: Handle returned from an earlier call to op_open_agent()
+ * vma: The virtual memory address of the compiled code being unloaded.
+ * An op_write_native_code() with the same vma should have
+ * occurred before this call.
+ *
+ * Returns 0 on success; -1 otherwise. If -1 is returned, errno is
+ * set to indicate the nature of the error.
+ **/
+int op_unload_native_code(op_agent_t hdl, uint64_t vma);
+
+/**
+ * Returns the major version number of the libopagent library that will be used.
+ **/
+int op_major_version(void);
+
+/**
+ * Returns the minor version number of the libopagent library that will be used.
+ **/
+int op_minor_version(void);
+
+/* idea how to post additional information for a piece of code.
+ we use the code address as reference
+int op_write_loader_name(const void* code_addr, char const * loader_name);
+*/
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif
diff --git a/libopagent/opagent_symbols.ver b/libopagent/opagent_symbols.ver
new file mode 100644
index 0000000..3a7ddc8
--- /dev/null
+++ b/libopagent/opagent_symbols.ver
@@ -0,0 +1,14 @@
+OPAGENT_1.0 {
+ global:
+ op_open_agent;
+ op_close_agent;
+ op_write_native_code;
+ op_write_debug_line_info;
+ op_unload_native_code;
+ op_major_version;
+ op_minor_version;
+
+ local:
+ *;
+};
+
diff --git a/libopt++/Makefile.am b/libopt++/Makefile.am
new file mode 100644
index 0000000..f175ce7
--- /dev/null
+++ b/libopt++/Makefile.am
@@ -0,0 +1,5 @@
+AM_CPPFLAGS=-I ${top_srcdir}/libutil++ -I ${top_srcdir}/libutil
+AM_CXXFLAGS = @OP_CXXFLAGS@
+
+noinst_LIBRARIES = libopt++.a
+libopt___a_SOURCES = popt_options.cpp popt_options.h
diff --git a/libopt++/Makefile.in b/libopt++/Makefile.in
new file mode 100644
index 0000000..5cbdcfc
--- /dev/null
+++ b/libopt++/Makefile.in
@@ -0,0 +1,484 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = libopt++
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/binutils.m4 \
+ $(top_srcdir)/m4/builtinexpect.m4 \
+ $(top_srcdir)/m4/cellspubfdsupport.m4 \
+ $(top_srcdir)/m4/compileroption.m4 \
+ $(top_srcdir)/m4/configmodule.m4 \
+ $(top_srcdir)/m4/copyifchange.m4 $(top_srcdir)/m4/docbook.m4 \
+ $(top_srcdir)/m4/extradirs.m4 $(top_srcdir)/m4/findkernel.m4 \
+ $(top_srcdir)/m4/kerneloption.m4 \
+ $(top_srcdir)/m4/kernelversion.m4 \
+ $(top_srcdir)/m4/mallocattribute.m4 \
+ $(top_srcdir)/m4/poptconst.m4 \
+ $(top_srcdir)/m4/precompiledheader.m4 $(top_srcdir)/m4/qt.m4 \
+ $(top_srcdir)/m4/resultyn.m4 $(top_srcdir)/m4/sstream.m4 \
+ $(top_srcdir)/m4/typedef.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+ARFLAGS = cru
+libopt___a_AR = $(AR) $(ARFLAGS)
+libopt___a_LIBADD =
+am_libopt___a_OBJECTS = popt_options.$(OBJEXT)
+libopt___a_OBJECTS = $(am_libopt___a_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libopt___a_SOURCES)
+DIST_SOURCES = $(libopt___a_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFD_LIBS = @BFD_LIBS@
+BUILD_JVMPI_AGENT_FALSE = @BUILD_JVMPI_AGENT_FALSE@
+BUILD_JVMPI_AGENT_TRUE = @BUILD_JVMPI_AGENT_TRUE@
+BUILD_JVMTI_AGENT_FALSE = @BUILD_JVMTI_AGENT_FALSE@
+BUILD_JVMTI_AGENT_TRUE = @BUILD_JVMTI_AGENT_TRUE@
+CAT_ENTRY_END = @CAT_ENTRY_END@
+CAT_ENTRY_START = @CAT_ENTRY_START@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOCBOOK_ROOT = @DOCBOOK_ROOT@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+EXTRA_CFLAGS_MODULE = @EXTRA_CFLAGS_MODULE@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAVA_HOMEDIR = @JAVA_HOMEDIR@
+KINC = @KINC@
+KSRC = @KSRC@
+KVERS = @KVERS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBERTY_LIBS = @LIBERTY_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MOC = @MOC@
+MODINSTALLDIR = @MODINSTALLDIR@
+OBJEXT = @OBJEXT@
+OPROFILE_DIR = @OPROFILE_DIR@
+OPROFILE_MODULE_ARCH = @OPROFILE_MODULE_ARCH@
+OP_CFLAGS = @OP_CFLAGS@
+OP_CXXFLAGS = @OP_CXXFLAGS@
+OP_DOCDIR = @OP_DOCDIR@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POPT_LIBS = @POPT_LIBS@
+PTRDIFF_T_TYPE = @PTRDIFF_T_TYPE@
+QT_INCLUDES = @QT_INCLUDES@
+QT_LDFLAGS = @QT_LDFLAGS@
+QT_LIB = @QT_LIB@
+QT_VERSION = @QT_VERSION@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIZE_T_TYPE = @SIZE_T_TYPE@
+STRIP = @STRIP@
+UIC = @UIC@
+VERSION = @VERSION@
+XML_CATALOG = @XML_CATALOG@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+have_qt_FALSE = @have_qt_FALSE@
+have_qt_TRUE = @have_qt_TRUE@
+have_xsltproc_FALSE = @have_xsltproc_FALSE@
+have_xsltproc_TRUE = @have_xsltproc_TRUE@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+kernel_support_FALSE = @kernel_support_FALSE@
+kernel_support_TRUE = @kernel_support_TRUE@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+topdir = @topdir@
+AM_CPPFLAGS = -I ${top_srcdir}/libutil++ -I ${top_srcdir}/libutil
+AM_CXXFLAGS = @OP_CXXFLAGS@
+noinst_LIBRARIES = libopt++.a
+libopt___a_SOURCES = popt_options.cpp popt_options.h
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libopt++/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign libopt++/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLIBRARIES:
+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+libopt++.a: $(libopt___a_OBJECTS) $(libopt___a_DEPENDENCIES)
+ -rm -f libopt++.a
+ $(libopt___a_AR) libopt++.a $(libopt___a_OBJECTS) $(libopt___a_LIBADD)
+ $(RANLIB) libopt++.a
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/popt_options.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LIBRARIES)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstLIBRARIES ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-exec \
+ install-exec-am install-info install-info-am install-man \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am tags uninstall uninstall-am \
+ uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/libopt++/popt_options.cpp b/libopt++/popt_options.cpp
new file mode 100644
index 0000000..53a8c80
--- /dev/null
+++ b/libopt++/popt_options.cpp
@@ -0,0 +1,327 @@
+/**
+ * @file popt_options.cpp
+ * option parsing
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#include <iostream>
+
+#include "op_popt.h"
+#include "op_version.h"
+
+#include "popt_options.h"
+#include "string_manip.h"
+
+using namespace std;
+
+namespace popt {
+
+/**
+ * option_base - base class for implementation of a command line option
+ *
+ * Every command line option added before calling parse_options()
+ * is of this type.
+ */
+class option_base {
+public:
+ /**
+ * option_base - construct an option with the given options.
+ * @param option_name name part of long form e.g. --option
+ * @param short_name short form name e.g. -o
+ * @param help_str short description of the option
+ * @param arg_help_str short description of the argument (if any)
+ * @param data a pointer to the data to fill in
+ * @param popt_flags the popt library data type
+ */
+ option_base(char const * option_name, char short_name,
+ char const * help_str, char const * arg_help_str,
+ void * data, int popt_flags);
+
+ virtual ~option_base() {}
+
+ /**
+ * post_process - perform any necessary post-processing
+ */
+ virtual void post_process() {}
+
+protected:
+ char const * option_name;
+};
+
+
+/** the popt array singleton options */
+static vector<poptOption> & popt_options(void)
+{
+ static vector<poptOption> *x = new(vector<poptOption>);
+ return *x;
+}
+
+static vector<option_base *> & options_list(void)
+{
+ static vector<option_base *> *x = new(vector<option_base *>);
+ return *x;
+}
+
+static int showvers;
+
+static struct poptOption appended_options[] = {
+ { "version", 'v', POPT_ARG_NONE, &showvers, 0, "show version", NULL, },
+ POPT_AUTOHELP
+ POPT_TABLEEND
+ };
+
+
+/* options parameter can't be a local variable because caller can use the
+ * returned poptContext which contains pointer inside the options array */
+static poptContext do_parse_options(int argc, char const ** argv,
+ vector<poptOption> & options,
+ vector<string> & additional_params)
+{
+ options = popt_options();
+
+ int const nr_appended_options =
+ sizeof(appended_options) / sizeof(appended_options[0]);
+
+ options.insert(options.end(), appended_options,
+ appended_options + nr_appended_options);
+
+ poptContext con = op_poptGetContext(NULL, argc, argv, &options[0], 0);
+
+ if (showvers)
+ show_version(argv[0]);
+
+ char const * file;
+ while ((file = poptGetArg(con)) != 0)
+ additional_params.push_back(file);
+
+ for (size_t i = 0 ; i < options_list().size() ; ++i)
+ options_list()[i]->post_process();
+
+ return con;
+}
+
+
+void parse_options(int argc, char const ** argv,
+ vector<string> & additional_params)
+{
+ vector<poptOption> options;
+
+ poptContext con =
+ do_parse_options(argc, argv, options, additional_params);
+
+ poptFreeContext(con);
+}
+
+
+template <typename T> class option_imp;
+
+
+/**
+ * option<void> - a binary option
+ *
+ * Use this option type for constructing specified / not-specified
+ * options e.g. --frob
+ */
+template <> class option_imp<void> : public option_base {
+public:
+ option_imp(bool & value, char const * option_name, char short_name,
+ char const * help_str);
+
+ ~option_imp() {}
+
+ void post_process();
+
+private:
+ bool & value;
+ int popt_value;
+};
+
+
+/**
+ * option<int> - a integer option
+ *
+ * Use this for options taking an integer e.g. --frob 6
+ */
+template <> class option_imp<int> : public option_base {
+public:
+ option_imp(int & value, char const * option_name, char short_name,
+ char const * help_str, char const * arg_help_str);
+
+ ~option_imp() {}
+};
+
+
+/**
+ * option<string> - a string option
+ *
+ * Use this for options taking a string e.g. --frob parsley
+ */
+template <> class option_imp<string> : public option_base {
+public:
+ option_imp(string & value, char const * option_name,
+ char short_name, char const * help_str,
+ char const * arg_help_str);
+
+ void post_process();
+
+ ~option_imp() {}
+
+private:
+ // we need an intermediate char array to pass to popt libs
+ char * popt_value;
+ string & value;
+};
+
+
+/**
+ * option< vector<string> > - a string vector option
+ *
+ * Use this for options taking a number of string arguments,
+ * separated by the given separator.
+ */
+template <> class option_imp< vector<string> > : public option_base {
+public:
+ option_imp(vector<string> & value,
+ char const * option_name, char short_name,
+ char const * help_str, char const * arg_help_str,
+ char separator = ',');
+
+ void post_process();
+
+ ~option_imp() {}
+
+private:
+ vector<string> & value;
+ // we need an intermediate char array to pass to popt libs
+ char * popt_value;
+ char const separator;
+};
+
+
+option::~option()
+{
+ delete the_option;
+}
+
+
+/// non templatized ctor for boolean option
+option::option(bool & value, char const * name, char short_name, char const * help)
+ : the_option(new option_imp<void>(value, name, short_name, help))
+{
+}
+
+
+/// specialization of option ctor for integer option
+template <>
+option::option(int & value, char const * name, char short_name,
+ char const * help, char const * arg_help)
+ : the_option(new option_imp<int>
+ (value, name, short_name, help, arg_help))
+{
+}
+
+
+/// specialization of option ctor for string option
+template <>
+option::option(string & value, char const * name, char short_name,
+ char const * help, char const * arg_help)
+ : the_option(new option_imp<string>
+ (value, name, short_name, help, arg_help))
+{
+}
+
+
+/// specialization of option ctor for vector<string> option
+template <>
+option::option(vector<string> & value, char const * name, char short_name,
+ char const * help, char const * arg_help)
+ : the_option(new option_imp< vector<string> >
+ (value, name, short_name, help, arg_help))
+{
+}
+
+
+option_base::option_base(char const * name, char short_name,
+ char const * help, char const * arg_help,
+ void * data, int popt_flags)
+ : option_name(name)
+{
+ poptOption const opt = { name, short_name, popt_flags,
+ data, 0, help, arg_help };
+
+ popt_options().push_back(opt);
+
+ options_list().push_back(this);
+}
+
+
+option_imp<void>::option_imp(bool & val, char const * name, char short_name,
+ char const * help)
+ : option_base(name, short_name, help, 0, &popt_value, POPT_ARG_NONE),
+ value(val), popt_value(0)
+{
+}
+
+
+void option_imp<void>::post_process()
+{
+ if (popt_value) {
+ if (is_prefix(option_name, "no-"))
+ value = !popt_value;
+ else
+ value = popt_value;
+ }
+}
+
+
+option_imp<int>::option_imp(int & value, char const * name, char short_name,
+ char const * help, char const * arg_help)
+ : option_base(name, short_name, help, arg_help, &value, POPT_ARG_INT)
+{
+}
+
+
+option_imp<string>::option_imp(string & val, char const * name, char short_name,
+ char const * help, char const * arg_help)
+ : option_base(name, short_name, help, arg_help,
+ &popt_value, POPT_ARG_STRING),
+ popt_value(0), value(val)
+{
+}
+
+
+void option_imp<string>::post_process()
+{
+ if (popt_value) {
+ value = popt_value;
+ popt_value = 0;
+ }
+}
+
+
+option_imp< vector<string> >::option_imp(vector<string> & val,
+ char const * name, char short_name,
+ char const * help,
+ char const * arg_help, char sepchar)
+ : option_base(name, short_name, help, arg_help,
+ &popt_value, POPT_ARG_STRING),
+ value(val), popt_value(0), separator(sepchar)
+{
+}
+
+
+void option_imp< vector<string> >::post_process()
+{
+ if (popt_value) {
+ value = separate_token(popt_value, separator);
+
+ popt_value = 0;
+ }
+}
+
+} // namespace popt
diff --git a/libopt++/popt_options.h b/libopt++/popt_options.h
new file mode 100644
index 0000000..7f72aa6
--- /dev/null
+++ b/libopt++/popt_options.h
@@ -0,0 +1,123 @@
+/**
+ * @file popt_options.h
+ * option parsing
+ *
+ * This provides a simple facility for adding command-line
+ * options, and parsing them.
+ *
+ * You can add a number of options and then call parse_options()
+ * to process them, for example :
+ *
+ * \code
+ * bool allow_frob;
+ * string frob;
+ * static popt::option allow_frob_opt(allow_frob, "allow-frob", 'a', "allow frobs");
+ * static popt::option frob_opt(frob, "frob", 'f', "what to frob", "name");
+ *
+ * ...
+ * popt::parse_options(argc, argv, add_params);
+ * \endcode
+ *
+ * Note than if you try to implement an option for an unsupported type like :
+ * \code
+ * static unsigned int i;
+ * static popt::option i_opt(i, ....);
+ * \endcode
+ * you don't get a compile time error but a link time error.
+ *
+ * The call to parse_options() will fill in allow_frob and frob, if they
+ * are passed to the program (myfrobber --allow-frob --frob foo), and place
+ * any left over command line arguments in the add_params vector. Note
+ * that the template parameter denotes the type of the option argument.
+ *
+ * When the template parameter type is bool, option starting with "no-" prefix
+ * are implicitely considered as negated before writing the associated bool so
+ * this will work as expected:
+ * \code
+ * bool demangle;
+ * popt::option(demangle, "demangle", 'd', "demangle C++ symbols"),
+ * popt::option(demangle, "no-demangle", '\0', "don't demangle C++ symbols"),
+ * \endcode
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#ifndef POPT_OPTIONS_H
+#define POPT_OPTIONS_H
+
+#include <string>
+#include <vector>
+
+namespace popt {
+
+/**
+ * parse_options - parse command line options
+ * @param argc like the parameter of main()
+ * @param argv like the parameter of main()
+ * @param additional_params additional options are stored here
+ *
+ * Parse the given command line with the previous
+ * options created. Multiple additional arguments
+ * that are not recognised will be added to the additional_params
+ * vector.
+ */
+void parse_options(int argc, char const ** argv,
+ std::vector<std::string> & additional_params);
+
+class option_base;
+
+/**
+ * option - base class for a command line option
+ *
+ * Every command line option added before calling parse_options()
+ * is of this type.
+ */
+class option {
+public:
+ /**
+ * Templatized constructor for an option. This adds the option
+ * to the option list on construction. This is specialized for
+ * each recognised option value type below.
+ */
+ template <class T> option(T &, char const * option_name,
+ char short_name, char const * help_str,
+ char const * arg_help_str);
+
+ /**
+ * boolean operations don't get the same set of parameters as other
+ * option, as there is no argument to give help for.
+ * Due to a bug in gcc 2.95 we can't use a default parameter
+ * in the templatized ctor above because 2.95 is unable to match
+ * the right ctor. So on we add a non-templatized ctor with an exact
+ * match for boolean option.
+ */
+ option(bool &, char const * option_name,
+ char short_name, char const * help_str);
+
+ ~option();
+
+private:
+ option_base * the_option;
+};
+
+
+/**
+ * The supported option type, boolean option are matched by a non templatized
+ * ctor above.
+ */
+template <> option::option(int &, char const * option_name, char short_name,
+ char const * help_str, char const * arg_help_str);
+template <> option::option(std::string &, char const * option_name,
+ char short_name, char const * help_str,
+ char const * arg_help_str);
+template <> option::option(std::vector<std::string> &,
+ char const * option_name, char short_name,
+ char const * help_str, char const * arg_help_str);
+
+} // namespace popt
+
+#endif // POPT_OPTIONS_H
diff --git a/libpp/Makefile.am b/libpp/Makefile.am
new file mode 100644
index 0000000..3244d98
--- /dev/null
+++ b/libpp/Makefile.am
@@ -0,0 +1,57 @@
+AM_CPPFLAGS = \
+ -I ${top_srcdir}/libop \
+ -I ${top_srcdir}/libutil \
+ -I ${top_srcdir}/libdb \
+ -I ${top_srcdir}/libopt++ \
+ -I ${top_srcdir}/libutil++ \
+ -I ${top_srcdir}/libop++ \
+ -I ${top_srcdir}/libregex
+
+AM_CXXFLAGS = @OP_CXXFLAGS@
+
+noinst_LIBRARIES = libpp.a
+libpp_a_SOURCES = \
+ arrange_profiles.cpp \
+ arrange_profiles.h \
+ callgraph_container.h \
+ callgraph_container.cpp \
+ diff_container.cpp \
+ diff_container.h \
+ filename_spec.cpp \
+ filename_spec.h \
+ format_flags.h \
+ format_output.cpp \
+ format_output.h \
+ image_errors.h \
+ image_errors.cpp \
+ locate_images.cpp \
+ locate_images.h \
+ name_storage.cpp \
+ name_storage.h \
+ op_header.cpp \
+ op_header.h \
+ symbol.cpp \
+ symbol.h \
+ parse_filename.cpp \
+ parse_filename.h \
+ populate.h \
+ populate.cpp \
+ profile.cpp \
+ profile.h \
+ profile_container.cpp \
+ profile_container.h \
+ profile_spec.cpp \
+ profile_spec.h \
+ sample_container.cpp \
+ sample_container.h \
+ symbol_container.cpp \
+ symbol_container.h \
+ symbol_functors.cpp \
+ symbol_functors.h \
+ symbol_sort.cpp \
+ symbol_sort.h \
+ xml_utils.h \
+ xml_utils.cpp \
+ populate_for_spu.cpp \
+ populate_for_spu.h
+
diff --git a/libpp/Makefile.in b/libpp/Makefile.in
new file mode 100644
index 0000000..a079813
--- /dev/null
+++ b/libpp/Makefile.in
@@ -0,0 +1,565 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = libpp
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/binutils.m4 \
+ $(top_srcdir)/m4/builtinexpect.m4 \
+ $(top_srcdir)/m4/cellspubfdsupport.m4 \
+ $(top_srcdir)/m4/compileroption.m4 \
+ $(top_srcdir)/m4/configmodule.m4 \
+ $(top_srcdir)/m4/copyifchange.m4 $(top_srcdir)/m4/docbook.m4 \
+ $(top_srcdir)/m4/extradirs.m4 $(top_srcdir)/m4/findkernel.m4 \
+ $(top_srcdir)/m4/kerneloption.m4 \
+ $(top_srcdir)/m4/kernelversion.m4 \
+ $(top_srcdir)/m4/mallocattribute.m4 \
+ $(top_srcdir)/m4/poptconst.m4 \
+ $(top_srcdir)/m4/precompiledheader.m4 $(top_srcdir)/m4/qt.m4 \
+ $(top_srcdir)/m4/resultyn.m4 $(top_srcdir)/m4/sstream.m4 \
+ $(top_srcdir)/m4/typedef.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+ARFLAGS = cru
+libpp_a_AR = $(AR) $(ARFLAGS)
+libpp_a_LIBADD =
+am_libpp_a_OBJECTS = arrange_profiles.$(OBJEXT) \
+ callgraph_container.$(OBJEXT) diff_container.$(OBJEXT) \
+ filename_spec.$(OBJEXT) format_output.$(OBJEXT) \
+ image_errors.$(OBJEXT) locate_images.$(OBJEXT) \
+ name_storage.$(OBJEXT) op_header.$(OBJEXT) symbol.$(OBJEXT) \
+ parse_filename.$(OBJEXT) populate.$(OBJEXT) profile.$(OBJEXT) \
+ profile_container.$(OBJEXT) profile_spec.$(OBJEXT) \
+ sample_container.$(OBJEXT) symbol_container.$(OBJEXT) \
+ symbol_functors.$(OBJEXT) symbol_sort.$(OBJEXT) \
+ xml_utils.$(OBJEXT) populate_for_spu.$(OBJEXT)
+libpp_a_OBJECTS = $(am_libpp_a_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libpp_a_SOURCES)
+DIST_SOURCES = $(libpp_a_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFD_LIBS = @BFD_LIBS@
+BUILD_JVMPI_AGENT_FALSE = @BUILD_JVMPI_AGENT_FALSE@
+BUILD_JVMPI_AGENT_TRUE = @BUILD_JVMPI_AGENT_TRUE@
+BUILD_JVMTI_AGENT_FALSE = @BUILD_JVMTI_AGENT_FALSE@
+BUILD_JVMTI_AGENT_TRUE = @BUILD_JVMTI_AGENT_TRUE@
+CAT_ENTRY_END = @CAT_ENTRY_END@
+CAT_ENTRY_START = @CAT_ENTRY_START@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOCBOOK_ROOT = @DOCBOOK_ROOT@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+EXTRA_CFLAGS_MODULE = @EXTRA_CFLAGS_MODULE@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAVA_HOMEDIR = @JAVA_HOMEDIR@
+KINC = @KINC@
+KSRC = @KSRC@
+KVERS = @KVERS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBERTY_LIBS = @LIBERTY_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MOC = @MOC@
+MODINSTALLDIR = @MODINSTALLDIR@
+OBJEXT = @OBJEXT@
+OPROFILE_DIR = @OPROFILE_DIR@
+OPROFILE_MODULE_ARCH = @OPROFILE_MODULE_ARCH@
+OP_CFLAGS = @OP_CFLAGS@
+OP_CXXFLAGS = @OP_CXXFLAGS@
+OP_DOCDIR = @OP_DOCDIR@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POPT_LIBS = @POPT_LIBS@
+PTRDIFF_T_TYPE = @PTRDIFF_T_TYPE@
+QT_INCLUDES = @QT_INCLUDES@
+QT_LDFLAGS = @QT_LDFLAGS@
+QT_LIB = @QT_LIB@
+QT_VERSION = @QT_VERSION@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIZE_T_TYPE = @SIZE_T_TYPE@
+STRIP = @STRIP@
+UIC = @UIC@
+VERSION = @VERSION@
+XML_CATALOG = @XML_CATALOG@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+have_qt_FALSE = @have_qt_FALSE@
+have_qt_TRUE = @have_qt_TRUE@
+have_xsltproc_FALSE = @have_xsltproc_FALSE@
+have_xsltproc_TRUE = @have_xsltproc_TRUE@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+kernel_support_FALSE = @kernel_support_FALSE@
+kernel_support_TRUE = @kernel_support_TRUE@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+topdir = @topdir@
+AM_CPPFLAGS = \
+ -I ${top_srcdir}/libop \
+ -I ${top_srcdir}/libutil \
+ -I ${top_srcdir}/libdb \
+ -I ${top_srcdir}/libopt++ \
+ -I ${top_srcdir}/libutil++ \
+ -I ${top_srcdir}/libop++ \
+ -I ${top_srcdir}/libregex
+
+AM_CXXFLAGS = @OP_CXXFLAGS@
+noinst_LIBRARIES = libpp.a
+libpp_a_SOURCES = \
+ arrange_profiles.cpp \
+ arrange_profiles.h \
+ callgraph_container.h \
+ callgraph_container.cpp \
+ diff_container.cpp \
+ diff_container.h \
+ filename_spec.cpp \
+ filename_spec.h \
+ format_flags.h \
+ format_output.cpp \
+ format_output.h \
+ image_errors.h \
+ image_errors.cpp \
+ locate_images.cpp \
+ locate_images.h \
+ name_storage.cpp \
+ name_storage.h \
+ op_header.cpp \
+ op_header.h \
+ symbol.cpp \
+ symbol.h \
+ parse_filename.cpp \
+ parse_filename.h \
+ populate.h \
+ populate.cpp \
+ profile.cpp \
+ profile.h \
+ profile_container.cpp \
+ profile_container.h \
+ profile_spec.cpp \
+ profile_spec.h \
+ sample_container.cpp \
+ sample_container.h \
+ symbol_container.cpp \
+ symbol_container.h \
+ symbol_functors.cpp \
+ symbol_functors.h \
+ symbol_sort.cpp \
+ symbol_sort.h \
+ xml_utils.h \
+ xml_utils.cpp \
+ populate_for_spu.cpp \
+ populate_for_spu.h
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libpp/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign libpp/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLIBRARIES:
+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+libpp.a: $(libpp_a_OBJECTS) $(libpp_a_DEPENDENCIES)
+ -rm -f libpp.a
+ $(libpp_a_AR) libpp.a $(libpp_a_OBJECTS) $(libpp_a_LIBADD)
+ $(RANLIB) libpp.a
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arrange_profiles.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/callgraph_container.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diff_container.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filename_spec.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/format_output.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image_errors.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/locate_images.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/name_storage.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/op_header.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_filename.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/populate.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/populate_for_spu.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/profile.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/profile_container.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/profile_spec.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sample_container.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symbol.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symbol_container.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symbol_functors.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symbol_sort.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xml_utils.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LIBRARIES)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstLIBRARIES ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-exec \
+ install-exec-am install-info install-info-am install-man \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am tags uninstall uninstall-am \
+ uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/libpp/arrange_profiles.cpp b/libpp/arrange_profiles.cpp
new file mode 100644
index 0000000..13e7feb
--- /dev/null
+++ b/libpp/arrange_profiles.cpp
@@ -0,0 +1,868 @@
+/**
+ * @file arrange_profiles.cpp
+ * Classify and process a list of candidate sample files
+ * into merged sets and classes.
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ */
+
+#include <algorithm>
+#include <cstdlib>
+#include <iostream>
+#include <iterator>
+#include <map>
+#include <set>
+
+#include "string_manip.h"
+#include "op_header.h"
+#include "op_exception.h"
+
+#include "arrange_profiles.h"
+#include "format_output.h"
+#include "xml_utils.h"
+#include "parse_filename.h"
+#include "locate_images.h"
+
+using namespace std;
+
+namespace {
+
+int numeric_compare(string const & lhs, string const & rhs)
+{
+ if (lhs == "all" && rhs == "all")
+ return 0;
+ // we choose an order arbitrarily
+ if (lhs == "all")
+ return 1;
+ if (rhs == "all")
+ return -1;
+ unsigned int lhsval = op_lexical_cast<unsigned int>(lhs);
+ unsigned int rhsval = op_lexical_cast<unsigned int>(rhs);
+ if (lhsval == rhsval)
+ return 0;
+ if (lhsval < rhsval)
+ return -1;
+ return 1;
+}
+
+
+} // anonymous namespace
+
+
+// global to fix some C++ obscure corner case.
+bool operator<(profile_class const & lhs,
+ profile_class const & rhs)
+{
+ profile_template const & lt = lhs.ptemplate;
+ profile_template const & rt = rhs.ptemplate;
+ int comp;
+
+ // The profile classes are used to traverse the sample data
+ // arrays. We create XML elements for <process> and <thread>
+ // that contain the sample data that can then be divided amongst
+ // CPU, event, mask axes so it is more convenient to have the
+ // process and thread classes be the outermost nesting level of
+ // the sample data arrays
+ if (!want_xml) {
+ comp = numeric_compare(lt.cpu, rt.cpu);
+ if (comp)
+ return comp < 0;
+ }
+
+ comp = numeric_compare(lt.tgid, rt.tgid);
+ if (comp)
+ return comp < 0;
+
+ comp = numeric_compare(lt.tid, rt.tid);
+ if (comp)
+ return comp < 0;
+
+ comp = numeric_compare(lt.unitmask, rt.unitmask);
+ if (comp)
+ return comp < 0;
+
+ if (want_xml) {
+ if (lt.event != rt.event)
+ return lt.event < rt.event;
+ if (lt.count != rt.count)
+ return lt.count < rt.count;
+
+ return numeric_compare(lt.cpu, rt.cpu) < 0;
+ } else {
+ if (lt.event == rt.event)
+ return lt.count < rt.count;
+ return lt.event < rt.event;
+ }
+}
+
+namespace {
+
+struct axis_t {
+ string name;
+ string suggestion;
+} axes[AXIS_MAX] = {
+ { "event", "specify event:, count: or unitmask: (see also --merge=unitmask)" },
+ { "tgid", "specify tgid: or --merge tgid" },
+ { "tid", "specify tid: or --merge tid" },
+ { "cpu", "specify cpu: or --merge cpu" },
+};
+
+} // anonymous namespace
+
+
+bool profile_classes::matches(profile_classes const & classes)
+{
+ if (v.size() != classes.v.size())
+ return false;
+
+ axis_types const axis2 = classes.axis;
+
+ switch (axis) {
+ case AXIS_EVENT:
+ break;
+ case AXIS_TGID:
+ case AXIS_TID:
+ return axis2 == AXIS_TID || axis2 == AXIS_TGID;
+ case AXIS_CPU:
+ return axis2 == AXIS_CPU;
+ case AXIS_MAX:
+ return false;
+ }
+
+ // check that the events match (same event, count)
+
+ vector<profile_class>::const_iterator it1 = v.begin();
+ vector<profile_class>::const_iterator end1 = v.end();
+ vector<profile_class>::const_iterator it2 = classes.v.begin();
+
+ while (it1 != end1) {
+ if (it1->ptemplate.event != it2->ptemplate.event)
+ return false;
+ if (it1->ptemplate.count != it2->ptemplate.count)
+ return false;
+ // differing unit mask is considered comparable
+ ++it1;
+ ++it2;
+ }
+
+ return true;
+}
+
+namespace {
+
+typedef growable_vector<string> event_array_t;
+typedef growable_vector<string>::size_type event_index_t;
+
+bool new_event_index(string event, event_array_t & events, event_index_t & index)
+{
+ event_index_t sz = events.size();
+ for (event_index_t i = 0; i != sz; ++i) {
+ if (events[i] == event) {
+ index = i;
+ return false;
+ }
+ }
+
+ index = sz;
+ events[sz] = event;
+ return true;
+}
+
+
+/// We have more than one axis of classification, tell the user.
+void report_error(profile_classes const & classes, axis_types newaxis)
+{
+ string str = "Already displaying results for parameter ";
+ str += axes[classes.axis].name;
+ str += " with values:\n";
+ vector<profile_class>::const_iterator it = classes.v.begin();
+ vector<profile_class>::const_iterator const end = classes.v.end();
+
+ // We show error for the first conflicting axis but on this
+ // axis we can get only a few different it->name, we display only
+ // these different name.
+ set <string> name_seen;
+ size_t i = 5;
+ for (; it != end && i; ++it) {
+ if (name_seen.find(it->name) == name_seen.end()) {
+ name_seen.insert(it->name);
+ str += it->name + ",";
+ --i;
+ }
+ }
+
+ if (!i) {
+ str += " and ";
+ str += op_lexical_cast<string>(classes.v.size() - 5);
+ str += " more,";
+ }
+
+ str += "\nwhich conflicts with parameter ";
+ str += axes[newaxis].name += ".\n";
+ str += "Suggestion: ";
+ str += axes[classes.axis].suggestion;
+ throw op_fatal_error(str);
+}
+
+
+/**
+ * check that two different axes are OK - this is only
+ * allowed if they are TGID,TID and for each class,
+ * tid == tgid
+ */
+bool allow_axes(profile_classes const & classes, axis_types newaxis)
+{
+ // No previous axis - OK
+ if (classes.axis == AXIS_MAX)
+ return true;
+
+ if (classes.axis != AXIS_TID && classes.axis != AXIS_TGID)
+ return false;
+
+ if (newaxis != AXIS_TID && newaxis != AXIS_TGID)
+ return false;
+
+ vector<profile_class>::const_iterator it = classes.v.begin();
+ vector<profile_class>::const_iterator const end = classes.v.end();
+
+ for (; it != end; ++it) {
+ if (it->ptemplate.tgid != it->ptemplate.tid)
+ return false;
+ }
+
+ return true;
+}
+
+
+/// find the first sample file header in the class
+opd_header const get_first_header(profile_class const & pclass)
+{
+ profile_set const & profile = *(pclass.profiles.begin());
+
+ string file;
+
+ // could be only one main app, with no samples for the main image
+ if (profile.files.empty()) {
+ profile_dep_set const & dep = *(profile.deps.begin());
+ list<profile_sample_files> const & files = dep.files;
+ profile_sample_files const & sample_files = *(files.begin());
+ if (!sample_files.sample_filename.empty())
+ file = sample_files.sample_filename;
+ else
+ file = *sample_files.cg_files.begin();
+ } else {
+ profile_sample_files const & sample_files
+ = *(profile.files.begin());
+ if (!sample_files.sample_filename.empty())
+ file = sample_files.sample_filename;
+ else
+ file = *sample_files.cg_files.begin();
+ }
+
+ return read_header(file);
+}
+
+/// merge sample file header in the profile_sample_files
+void merge_header(profile_sample_files const & files, opd_header & header)
+{
+ if (!files.sample_filename.empty()) {
+ opd_header const temp = read_header(files.sample_filename);
+ header.ctr_um |= temp.ctr_um;
+ }
+
+ list<string>::const_iterator it = files.cg_files.begin();
+ list<string>::const_iterator const end = files.cg_files.end();
+ for ( ; it != end; ++it) {
+ opd_header const temp = read_header(*it);
+ header.ctr_um |= temp.ctr_um;
+ }
+}
+
+/// merge sample file header in the class
+opd_header const get_header(profile_class const & pclass,
+ merge_option const & merge_by)
+{
+ opd_header header = get_first_header(pclass);
+
+ if (!merge_by.unitmask)
+ return header;
+
+ profile_set const & profile = *(pclass.profiles.begin());
+
+ typedef list<profile_sample_files>::const_iterator citerator;
+
+ citerator it = profile.files.begin();
+ citerator const end = profile.files.end();
+ for ( ; it != end; ++it)
+ merge_header(*it, header);
+
+ list<profile_dep_set>::const_iterator dep_it = profile.deps.begin();
+ list<profile_dep_set>::const_iterator dep_end = profile.deps.end();
+ for ( ; dep_it != dep_end; ++dep_it) {
+ citerator it = dep_it->files.begin();
+ citerator const end = dep_it->files.end();
+ for ( ; it != end; ++it)
+ merge_header(*it, header);
+ }
+
+ return header;
+}
+
+
+/// Give human-readable names to each class.
+void name_classes(profile_classes & classes, merge_option const & merge_by)
+{
+ opd_header header = get_header(classes.v[0], merge_by);
+
+ classes.event = describe_header(header);
+ classes.cpuinfo = describe_cpu(header);
+
+ // If we're splitting on event anyway, clear out the
+ // global event name
+ if (classes.axis == AXIS_EVENT)
+ classes.event.erase();
+
+ vector<profile_class>::iterator it = classes.v.begin();
+ vector<profile_class>::iterator const end = classes.v.end();
+
+ for (; it != end; ++it) {
+ it->name = axes[classes.axis].name + ":";
+ switch (classes.axis) {
+ case AXIS_EVENT:
+ it->name = it->ptemplate.event
+ + ":" + it->ptemplate.count;
+ header = get_header(*it, merge_by);
+ it->longname = describe_header(header);
+ break;
+ case AXIS_TGID:
+ it->name += it->ptemplate.tgid;
+ it->longname = "Processes with a thread group ID of ";
+ it->longname += it->ptemplate.tgid;
+ break;
+ case AXIS_TID:
+ it->name += it->ptemplate.tid;
+ it->longname = "Processes with a thread ID of ";
+ it->longname += it->ptemplate.tid;
+ break;
+ case AXIS_CPU:
+ it->name += it->ptemplate.cpu;
+ it->longname = "Samples on CPU " + it->ptemplate.cpu;
+ break;
+ case AXIS_MAX:;
+ }
+ }
+}
+
+
+/**
+ * Name and verify classes.
+ */
+void identify_classes(profile_classes & classes,
+ merge_option const & merge_by)
+{
+ profile_template & ptemplate = classes.v[0].ptemplate;
+ bool changed[AXIS_MAX] = { false, };
+
+ vector<profile_class>::iterator it = classes.v.begin();
+ ++it;
+ vector<profile_class>::iterator end = classes.v.end();
+
+ // only one class, name it after the event
+ if (it == end)
+ changed[AXIS_EVENT] = true;
+
+ for (; it != end; ++it) {
+ if (it->ptemplate.event != ptemplate.event
+ || it->ptemplate.count != ptemplate.count
+ // unit mask are mergeable
+ || (!merge_by.unitmask
+ && it->ptemplate.unitmask != ptemplate.unitmask))
+ changed[AXIS_EVENT] = true;
+
+ // we need the merge checks here because each
+ // template is filled in from the first non
+ // matching profile, so just because they differ
+ // doesn't mean it's the axis we care about
+ if (!merge_by.tgid && it->ptemplate.tgid != ptemplate.tgid)
+ changed[AXIS_TGID] = true;
+
+ if (!merge_by.tid && it->ptemplate.tid != ptemplate.tid)
+ changed[AXIS_TID] = true;
+
+ if (!merge_by.cpu && it->ptemplate.cpu != ptemplate.cpu)
+ changed[AXIS_CPU] = true;
+ }
+
+ classes.axis = AXIS_MAX;
+
+ for (size_t i = 0; i < AXIS_MAX; ++i) {
+ if (!changed[i])
+ continue;
+
+ if (!allow_axes(classes, axis_types(i)))
+ report_error(classes, axis_types(i));
+ classes.axis = axis_types(i);
+ /* do this early for report_error */
+ name_classes(classes, merge_by);
+ }
+
+ if (classes.axis == AXIS_MAX) {
+ cerr << "Internal error - no equivalence class axis" << endl;
+ abort();
+ }
+}
+
+void identify_xml_classes(profile_classes & classes, merge_option const & merge_by)
+{
+ opd_header header = get_header(classes.v[0], merge_by);
+
+ vector<profile_class>::iterator it = classes.v.begin();
+ vector<profile_class>::iterator end = classes.v.end();
+
+ event_index_t event_num;
+ event_index_t event_max = 0;
+ event_array_t event_array;
+ size_t nr_cpus = 0;
+ bool has_nonzero_mask = false;
+
+ ostringstream event_setup;
+
+ // fill in XML identifying each event, and replace event name by event_num
+ for (; it != end; ++it) {
+ string mask = it->ptemplate.unitmask;
+ if (mask.find_first_of("x123456789abcdefABCDEF") != string::npos)
+ has_nonzero_mask = true;
+ if (new_event_index(it->ptemplate.event, event_array, event_num)) {
+ // replace it->ptemplate.event with the event_num string
+ // this is the first time we've seen this event
+ header = get_header(*it, merge_by);
+ event_setup << describe_header(header);
+ event_max = event_num;
+ }
+ if (it->ptemplate.cpu != "all") {
+ size_t cpu = atoi(it->ptemplate.cpu.c_str());
+ if (cpu > nr_cpus) nr_cpus = cpu;
+ }
+
+ ostringstream str;
+ str << event_num;
+ it->ptemplate.event = str.str();
+ }
+ xml_utils::set_nr_cpus(++nr_cpus);
+ xml_utils::set_nr_events(event_max+1);
+ if (has_nonzero_mask)
+ xml_utils::set_has_nonzero_masks();
+ classes.event = event_setup.str();
+ classes.cpuinfo = describe_cpu(header);
+}
+
+/// construct a class template from a profile
+profile_template const
+template_from_profile(parsed_filename const & parsed,
+ merge_option const & merge_by)
+{
+ profile_template ptemplate;
+
+ ptemplate.event = parsed.event;
+ ptemplate.count = parsed.count;
+
+ if (!merge_by.unitmask)
+ ptemplate.unitmask = parsed.unitmask;
+ if (!merge_by.tgid)
+ ptemplate.tgid = parsed.tgid;
+ if (!merge_by.tid)
+ ptemplate.tid = parsed.tid;
+ if (!merge_by.cpu)
+ ptemplate.cpu = parsed.cpu;
+ return ptemplate;
+}
+
+
+/**
+ * Find a matching class the sample file could go in, or generate
+ * a new class if needed.
+ * This is the heart of the merging and classification process.
+ * The returned value is non-const reference but the ptemplate member
+ * must be considered as const
+ */
+profile_class & find_class(set<profile_class> & classes,
+ parsed_filename const & parsed,
+ merge_option const & merge_by)
+{
+ profile_class cls;
+ cls.ptemplate = template_from_profile(parsed, merge_by);
+
+ pair<set<profile_class>::iterator, bool> ret = classes.insert(cls);
+
+ return const_cast<profile_class &>(*ret.first);
+}
+
+/**
+ * Sanity check : we can't overwrite sample_filename, if we abort here it means
+ * we fail to detect that parsed sample filename for two distinct samples
+ * filename must go in two distinct profile_sample_files. This assumption is
+ * false for callgraph samples files so this function is only called for non cg
+ * files.
+ */
+void sanitize_profile_sample_files(profile_sample_files const & sample_files,
+ parsed_filename const & parsed)
+{
+ // We can't allow to overwrite sample_filename.
+ if (!sample_files.sample_filename.empty()) {
+ ostringstream out;
+ out << "sanitize_profile_sample_files(): sample file "
+ << "parsed twice ?\nsample_filename:\n"
+ << sample_files.sample_filename << endl
+ << parsed << endl;
+ throw op_fatal_error(out.str());
+ }
+}
+
+
+/**
+ * Add a sample filename (either cg or non cg files) to this profile.
+ */
+void
+add_to_profile_sample_files(profile_sample_files & sample_files,
+ parsed_filename const & parsed)
+{
+ if (parsed.cg_image.empty()) {
+ // We can't allow to overwrite sample_filename.
+ sanitize_profile_sample_files(sample_files, parsed);
+
+ sample_files.sample_filename = parsed.filename;
+ } else {
+ sample_files.cg_files.push_back(parsed.filename);
+ }
+}
+
+
+/**
+ * we need to fix cg filename: a callgraph filename can occur before the binary
+ * non callgraph samples filename occur so we must search.
+ */
+profile_sample_files &
+find_profile_sample_files(list<profile_sample_files> & files,
+ parsed_filename const & parsed,
+ extra_images const & extra)
+{
+ list<profile_sample_files>::iterator it;
+ list<profile_sample_files>::iterator const end = files.end();
+ for (it = files.begin(); it != end; ++it) {
+ if (!it->sample_filename.empty()) {
+ parsed_filename psample_filename =
+ parse_filename(it->sample_filename, extra);
+ if (psample_filename.lib_image == parsed.lib_image &&
+ psample_filename.image == parsed.image &&
+ psample_filename.profile_spec_equal(parsed))
+ return *it;
+ }
+
+ list<string>::const_iterator cit;
+ list<string>::const_iterator const cend = it->cg_files.end();
+ for (cit = it->cg_files.begin(); cit != cend; ++cit) {
+ parsed_filename pcg_filename =
+ parse_filename(*cit, extra);
+ if (pcg_filename.lib_image == parsed.lib_image &&
+ pcg_filename.image == parsed.image &&
+ pcg_filename.profile_spec_equal(parsed))
+ return *it;
+ }
+ }
+
+ // not found, create a new one
+ files.push_back(profile_sample_files());
+ return files.back();
+}
+
+
+/**
+ * Add a profile to particular profile set. If the new profile is
+ * a dependent image, it gets added to the dep list, or just placed
+ * on the normal list of profiles otherwise.
+ */
+void
+add_to_profile_set(profile_set & set, parsed_filename const & parsed,
+ bool merge_by_lib, extra_images const & extra)
+{
+ if (parsed.image == parsed.lib_image && !merge_by_lib) {
+ profile_sample_files & sample_files =
+ find_profile_sample_files(set.files, parsed, extra);
+ add_to_profile_sample_files(sample_files, parsed);
+ return;
+ }
+
+ list<profile_dep_set>::iterator it = set.deps.begin();
+ list<profile_dep_set>::iterator const end = set.deps.end();
+
+ for (; it != end; ++it) {
+ if (it->lib_image == parsed.lib_image && !merge_by_lib &&
+ parsed.jit_dumpfile_exists == false) {
+ profile_sample_files & sample_files =
+ find_profile_sample_files(it->files, parsed,
+ extra);
+ add_to_profile_sample_files(sample_files, parsed);
+ return;
+ }
+ }
+
+ profile_dep_set depset;
+ depset.lib_image = parsed.lib_image;
+ profile_sample_files & sample_files =
+ find_profile_sample_files(depset.files, parsed, extra);
+ add_to_profile_sample_files(sample_files, parsed);
+ set.deps.push_back(depset);
+}
+
+
+/**
+ * Add a profile to a particular equivalence class. The previous matching
+ * will have ensured the profile "fits", so now it's just a matter of
+ * finding which sample file list it needs to go on.
+ */
+void add_profile(profile_class & pclass, parsed_filename const & parsed,
+ bool merge_by_lib, extra_images const & extra)
+{
+ list<profile_set>::iterator it = pclass.profiles.begin();
+ list<profile_set>::iterator const end = pclass.profiles.end();
+
+ for (; it != end; ++it) {
+ if (it->image == parsed.image) {
+ add_to_profile_set(*it, parsed, merge_by_lib, extra);
+ return;
+ }
+ }
+
+ profile_set set;
+ set.image = parsed.image;
+ add_to_profile_set(set, parsed, merge_by_lib, extra);
+ pclass.profiles.push_back(set);
+}
+
+} // anon namespace
+
+
+profile_classes const
+arrange_profiles(list<string> const & files, merge_option const & merge_by,
+ extra_images const & extra)
+{
+ set<profile_class> temp_classes;
+
+ list<string>::const_iterator it = files.begin();
+ list<string>::const_iterator const end = files.end();
+
+ for (; it != end; ++it) {
+ parsed_filename parsed = parse_filename(*it, extra);
+
+ if (parsed.lib_image.empty())
+ parsed.lib_image = parsed.image;
+
+ // This simplifies the add of the profile later,
+ // if we're lib-merging, then the app_image cannot
+ // matter. After this, any non-dependent has
+ // image == lib_image
+ if (merge_by.lib)
+ parsed.image = parsed.lib_image;
+
+ profile_class & pclass =
+ find_class(temp_classes, parsed, merge_by);
+ add_profile(pclass, parsed, merge_by.lib, extra);
+ }
+
+ profile_classes classes;
+ copy(temp_classes.begin(), temp_classes.end(),
+ back_inserter(classes.v));
+
+ if (classes.v.empty())
+ return classes;
+
+ // sort by template for nicely ordered columns
+ stable_sort(classes.v.begin(), classes.v.end());
+
+ if (want_xml)
+ identify_xml_classes(classes, merge_by);
+ else
+ identify_classes(classes, merge_by);
+
+ classes.extra_found_images = extra;
+
+ return classes;
+}
+
+
+ostream & operator<<(ostream & out, profile_sample_files const & sample_files)
+{
+ out << "sample_filename: " << sample_files.sample_filename << endl;
+ out << "callgraph filenames:\n";
+ copy(sample_files.cg_files.begin(), sample_files.cg_files.end(),
+ ostream_iterator<string>(out, "\n"));
+ return out;
+}
+
+ostream & operator<<(ostream & out, profile_dep_set const & pdep_set)
+{
+ out << "lib_image: " << pdep_set.lib_image << endl;
+
+ list<profile_sample_files>::const_iterator it;
+ list<profile_sample_files>::const_iterator const end =
+ pdep_set.files.end();
+ size_t i = 0;
+ for (it = pdep_set.files.begin(); it != end; ++it)
+ out << "profile_sample_files #" << i++ << ":\n" << *it;
+
+ return out;
+}
+
+ostream & operator<<(ostream & out, profile_set const & pset)
+{
+ out << "image: " << pset.image << endl;
+
+ list<profile_sample_files>::const_iterator it;
+ list<profile_sample_files>::const_iterator const end =
+ pset.files.end();
+ size_t i = 0;
+ for (it = pset.files.begin(); it != end; ++it)
+ out << "profile_sample_files #" << i++ << ":\n" << *it;
+
+ list<profile_dep_set>::const_iterator cit;
+ list<profile_dep_set>::const_iterator const cend = pset.deps.end();
+ i = 0;
+ for (cit = pset.deps.begin(); cit != cend; ++cit)
+ out << "profile_dep_set #" << i++ << ":\n" << *cit;
+
+ return out;
+}
+
+ostream & operator<<(ostream & out, profile_template const & ptemplate)
+{
+ out << "event: " << ptemplate.event << endl
+ << "count: " << ptemplate.count << endl
+ << "unitmask: " << ptemplate.unitmask << endl
+ << "tgid: " << ptemplate.tgid << endl
+ << "tid: " << ptemplate.tid << endl
+ << "cpu: " << ptemplate.cpu << endl;
+ return out;
+}
+
+ostream & operator<<(ostream & out, profile_class const & pclass)
+{
+ out << "name: " << pclass.name << endl
+ << "longname: " << pclass.longname << endl
+ << "ptemplate:\n" << pclass.ptemplate;
+
+ size_t i = 0;
+ list<profile_set>::const_iterator it;
+ list<profile_set>::const_iterator const end = pclass.profiles.end();
+ for (it = pclass.profiles.begin(); it != end; ++it)
+ out << "profiles_set #" << i++ << ":\n" << *it;
+
+ return out;
+}
+
+ostream & operator<<(ostream & out, profile_classes const & pclasses)
+{
+ out << "event: " << pclasses.event << endl
+ << "cpuinfo: " << pclasses.cpuinfo << endl;
+
+ for (size_t i = 0; i < pclasses.v.size(); ++i)
+ out << "class #" << i << ":\n" << pclasses.v[i];
+
+ return out;
+}
+
+
+namespace {
+
+/// add the files to group of image sets
+void add_to_group(image_group_set & group, string const & app_image,
+ list<profile_sample_files> const & files)
+{
+ image_set set;
+ set.app_image = app_image;
+ set.files = files;
+ group.push_back(set);
+}
+
+
+typedef map<string, inverted_profile> app_map_t;
+
+
+inverted_profile &
+get_iprofile(app_map_t & app_map, string const & image, size_t nr_classes)
+{
+ app_map_t::iterator ait = app_map.find(image);
+ if (ait != app_map.end())
+ return ait->second;
+
+ inverted_profile ip;
+ ip.image = image;
+ ip.groups.resize(nr_classes);
+ app_map[image] = ip;
+ return app_map[image];
+}
+
+
+/// Pull out all the images, removing any we can't access.
+void
+verify_and_fill(app_map_t & app_map, list<inverted_profile> & plist,
+ extra_images const & extra)
+{
+ app_map_t::iterator it = app_map.begin();
+ app_map_t::iterator const end = app_map.end();
+
+ for (; it != end; ++it) {
+ plist.push_back(it->second);
+ inverted_profile & ip = plist.back();
+ extra.find_image_path(ip.image, ip.error, false);
+ }
+}
+
+} // anon namespace
+
+
+list<inverted_profile> const
+invert_profiles(profile_classes const & classes)
+{
+ app_map_t app_map;
+
+ size_t nr_classes = classes.v.size();
+
+ for (size_t i = 0; i < nr_classes; ++i) {
+ list<profile_set>::const_iterator pit
+ = classes.v[i].profiles.begin();
+ list<profile_set>::const_iterator pend
+ = classes.v[i].profiles.end();
+
+ for (; pit != pend; ++pit) {
+ // files can be empty if samples for a lib image
+ // but none for the main image. Deal with it here
+ // rather than later.
+ if (pit->files.size()) {
+ inverted_profile & ip = get_iprofile(app_map,
+ pit->image, nr_classes);
+ add_to_group(ip.groups[i], pit->image, pit->files);
+ }
+
+ list<profile_dep_set>::const_iterator dit
+ = pit->deps.begin();
+ list<profile_dep_set>::const_iterator const dend
+ = pit->deps.end();
+
+ for (; dit != dend; ++dit) {
+ inverted_profile & ip = get_iprofile(app_map,
+ dit->lib_image, nr_classes);
+ add_to_group(ip.groups[i], pit->image,
+ dit->files);
+ }
+ }
+ }
+
+ list<inverted_profile> inverted_list;
+
+ verify_and_fill(app_map, inverted_list, classes.extra_found_images);
+
+ return inverted_list;
+}
diff --git a/libpp/arrange_profiles.h b/libpp/arrange_profiles.h
new file mode 100644
index 0000000..8057c67
--- /dev/null
+++ b/libpp/arrange_profiles.h
@@ -0,0 +1,246 @@
+/**
+ * @file arrange_profiles.h
+ * Classify and process a list of candidate sample files
+ * into merged sets and classes.
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ */
+
+#ifndef ARRANGE_PROFILES_H
+#define ARRANGE_PROFILES_H
+
+#include <string>
+#include <list>
+#include <vector>
+#include <iosfwd>
+
+#include "image_errors.h"
+#include "locate_images.h"
+
+/**
+ * store merging options options used to classify profiles
+ */
+struct merge_option {
+ bool cpu;
+ bool lib;
+ bool tid;
+ bool tgid;
+ bool unitmask;
+};
+
+
+/**
+ * This describes which parameters are set for each
+ * equivalence class.
+ */
+struct profile_template {
+ std::string event;
+ std::string count;
+ std::string unitmask;
+ std::string tgid;
+ std::string tid;
+ std::string cpu;
+};
+
+
+/**
+ * A samples filename + its associated callgraph sample filename.
+ */
+struct profile_sample_files {
+ /**
+ * This member can be empty since it is possible to get callgraph
+ * w/o any samples to the binary. e.g an application which defer all
+ * works to shared library but if arrange_profiles receive a sample
+ * file list filtered from cg file sample_filename can't be empty
+ */
+ std::string sample_filename;
+ /**
+ * List of callgraph sample filename. If the {dep} part of
+ * cg_filename != {cg} part it's a cross binary samples file.
+ */
+ std::list<std::string> cg_files;
+};
+
+
+/**
+ * A number of profiles files that are all dependent on
+ * the same main (application) profile, for the same
+ * dependent image.
+ */
+struct profile_dep_set {
+ /// which dependent image is this set for
+ std::string lib_image;
+
+ /// the actual sample files optionnaly including callgraph sample files
+ std::list<profile_sample_files> files;
+};
+
+/**
+ * A number of profile files all for the same binary with the same
+ * profile specification (after merging). Includes the set of dependent
+ * profile files, if any.
+ *
+ * For example, we could have image == "/bin/bash", where files
+ * contains all profiles against /bin/bash, and deps contains
+ * the sample file list for /lib/libc.so, /lib/ld.so etc.
+ */
+struct profile_set {
+ std::string image;
+
+ /// the actual sample files for the main image and the asociated
+ /// callgraph files
+ std::list<profile_sample_files> files;
+
+ /// all profile files dependent on the main image
+ std::list<profile_dep_set> deps;
+};
+
+
+/**
+ * A class collection of profiles. This is an equivalence class and
+ * will correspond to columnar output of opreport.
+ */
+struct profile_class {
+ std::list<profile_set> profiles;
+
+ /// human-readable column name
+ std::string name;
+
+ /// human-readable long name
+ std::string longname;
+
+ /// merging matches against this
+ profile_template ptemplate;
+};
+
+
+/**
+ * The "axis" says what we've used to split the sample
+ * files into the classes. Only one is allowed.
+ */
+enum axis_types {
+ AXIS_EVENT,
+ AXIS_TGID,
+ AXIS_TID,
+ AXIS_CPU,
+ AXIS_MAX
+};
+
+
+struct profile_classes {
+ /**
+ * This is only set if we're not classifying on event/count
+ * anyway - if we're classifying on event/count, then we'll
+ * already output the details of each class's event/count.
+ *
+ * It's only used when classifying by CPU, tgid etc. so the
+ * user can still see what perfctr event was used.
+ */
+ std::string event;
+
+ /// CPU info
+ std::string cpuinfo;
+
+ /// the actual classes
+ std::vector<profile_class> v;
+
+ /// the axis of the classes
+ axis_types axis;
+
+ /// the extra images to consider for this profile_classes
+ extra_images extra_found_images;
+
+ /// is this class set comparable with another?
+ bool matches(profile_classes const & classes);
+};
+
+
+std::ostream & operator<<(std::ostream &, profile_sample_files const &);
+std::ostream & operator<<(std::ostream &, profile_dep_set const &);
+std::ostream & operator<<(std::ostream &, profile_set const &);
+std::ostream & operator<<(std::ostream &, profile_template const &);
+std::ostream & operator<<(std::ostream &, profile_class const &);
+std::ostream & operator<<(std::ostream &, profile_classes const &);
+
+
+/**
+ * Take a list of sample filenames, and process them into a set of
+ * classes containing profile_sets. Merging is done at this stage
+ * as well as attaching dependent profiles to the main image.
+ *
+ * The classes correspond to the columns you'll get in opreport:
+ * this can be a number of events, or different CPUs, etc.
+ */
+profile_classes const
+arrange_profiles(std::list<std::string> const & files,
+ merge_option const & merge_by, extra_images const & extra);
+
+
+/**
+ * A set of sample files where the image binary to open
+ * are all the same.
+ */
+struct image_set {
+ /// this is main app image, *not* necessarily
+ /// the one we need to open
+ std::string app_image;
+
+ /// the sample files
+ std::list<profile_sample_files> files;
+};
+
+typedef std::list<image_set> image_group_set;
+
+/**
+ * All sample files where the binary image to open is
+ * the same.
+ *
+ * This is the "inverse" to some degree of profile_set.
+ * For example, here we might have image = "/lib/libc.so",
+ * with groups being the profile classifications
+ * tgid:404, tgid:301, etc.
+ *
+ * Within each group there's a number of image_sets.
+ * All the sample files listed within the image_sets
+ * are still for /lib/libc.so, but they may have
+ * different app_image values, e.g. /bin/bash.
+ * We need to keep track of the app_image values to
+ * make opreport give the right info in the "app"
+ * column.
+ */
+struct inverted_profile {
+ inverted_profile() : error(image_ok) {}
+ /// the image to open
+ std::string image;
+
+ /// an error found in reading the image
+ mutable image_error error;
+
+ /// all sample files with data for the above image
+ std::vector<image_group_set> groups;
+};
+
+
+/**
+ * Invert the profile set. For opreport -l, opannotate etc.,
+ * processing the profile_classes directly is slow, because
+ * we end up opening BFDs multiple times (for each class,
+ * dependent images etc.). This function returns an inverted
+ * set of sample files, where the primary sort is on the binary
+ * image to open.
+ *
+ * Thus each element in the returned list is for exactly one
+ * binary file that we're going to bfd_openr(). Attached to that
+ * is the actual sample files we need to process for that binary
+ * file. In order to get the output right, these have to be
+ * marked with the profile class they're from (hence the groups
+ * vector), and the app image that owned the sample file, if
+ * applicable (hence image_set).
+ */
+std::list<inverted_profile> const
+invert_profiles(profile_classes const & classes);
+
+#endif /* !ARRANGE_PROFILES_H */
diff --git a/libpp/callgraph_container.cpp b/libpp/callgraph_container.cpp
new file mode 100644
index 0000000..1d42ee4
--- /dev/null
+++ b/libpp/callgraph_container.cpp
@@ -0,0 +1,606 @@
+/**
+ * @file callgraph_container.cpp
+ * Container associating symbols and caller/caller symbols
+ *
+ * @remark Copyright 2004 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#include <cstdlib>
+
+#include <map>
+#include <set>
+#include <algorithm>
+#include <iterator>
+#include <string>
+#include <iostream>
+#include <numeric>
+
+#include "callgraph_container.h"
+#include "cverb.h"
+#include "parse_filename.h"
+#include "profile_container.h"
+#include "arrange_profiles.h"
+#include "populate.h"
+#include "string_filter.h"
+#include "op_bfd.h"
+#include "op_sample_file.h"
+#include "locate_images.h"
+
+using namespace std;
+
+namespace {
+
+bool operator==(cg_symbol const & lhs, cg_symbol const & rhs)
+{
+ less_symbol cmp_symb;
+ return !cmp_symb(lhs, rhs) && !cmp_symb(rhs, lhs);
+}
+
+
+// we store {caller,callee} inside a single u64
+odb_key_t caller_to_key(u32 value)
+{
+ return odb_key_t(value) << 32;
+}
+
+
+u32 key_to_callee(odb_key_t key)
+{
+ return key & 0xffffffff;
+}
+
+
+bool compare_by_callee_vma(pair<odb_key_t, count_type> const & lhs,
+ pair<odb_key_t, count_type> const & rhs)
+{
+ return (key_to_callee(lhs.first)) < (key_to_callee(rhs.first));
+}
+
+
+/*
+ * We need 2 comparators for callgraph to get the desired output:
+ *
+ * caller_with_few_samples
+ * caller_with_many_samples
+ * function_with_many_samples
+ * callee_with_many_samples
+ * callee_with_few_samples
+ */
+
+bool
+compare_arc_count(symbol_entry const & lhs, symbol_entry const & rhs)
+{
+ return lhs.sample.counts[0] < rhs.sample.counts[0];
+}
+
+
+bool
+compare_arc_count_reverse(symbol_entry const & lhs, symbol_entry const & rhs)
+{
+ return rhs.sample.counts[0] < lhs.sample.counts[0];
+}
+
+
+// find the nearest bfd symbol for the given file offset and check it's
+// in range
+op_bfd_symbol const *
+get_symbol_by_filepos(op_bfd const & bfd, u32 bfd_offset,
+ vma_t offset, symbol_index_t & i)
+{
+ offset += bfd_offset;
+ op_bfd_symbol tmpsym(offset, 0, string());
+
+ // sorted by filepos so this will find the nearest
+ vector<op_bfd_symbol>::const_iterator it =
+ upper_bound(bfd.syms.begin(), bfd.syms.end(), tmpsym);
+
+ if (it != bfd.syms.begin())
+ --it;
+
+ if (it == bfd.syms.end()) {
+ cerr << "get_symbol_by_filepos: no symbols at all?" << endl;
+ abort();
+ }
+
+ // if the offset is past the end of the symbol, we didn't find one
+ u32 const end_offset = it->size() + it->filepos();
+
+ if (offset >= end_offset) {
+ // let's be verbose for now
+ cerr << "warning: dropping hyperspace sample at offset "
+ << hex << offset << " >= " << end_offset
+ << " for binary " << bfd.get_filename() << dec << endl;
+ return NULL;
+ }
+
+ i = distance(bfd.syms.begin(), it);
+ return &(*it);
+}
+
+
+/// temporary caller and callee data held during processing
+class call_data {
+public:
+ call_data(profile_container const & p, profile_t const & pr,
+ op_bfd const & bfd, u32 boff, image_name_id iid,
+ image_name_id aid, bool debug_info)
+ : pc(p), profile(pr), b(bfd), boffset(boff), image(iid),
+ app(aid), debug(debug_info) {}
+
+ /// point to a caller symbol
+ void caller_sym(symbol_index_t i) {
+ sym = symbol_entry();
+
+ unsigned long long start;
+ unsigned long long end;
+ b.get_symbol_range(i, start, end);
+
+ samples.clear();
+
+ // see profile_t::samples_range() for why we need this check
+ if (start > boffset) {
+ profile_t::iterator_pair p_it = profile.samples_range(
+ caller_to_key(start - boffset),
+ caller_to_key(end - boffset));
+
+ // Our odb_key_t contain (from_eip << 32 | to_eip),
+ // the range of keys we selected above contains one
+ // caller but different callees, and due to the
+ // ordering callee offsets are not consecutive: so
+ // we must sort them first.
+
+ for (; p_it.first != p_it.second; ++p_it.first) {
+ samples.push_back(make_pair(p_it.first.vma(),
+ p_it.first.count()));
+ }
+
+ sort(samples.begin(), samples.end(),
+ compare_by_callee_vma);
+ }
+
+ sym.size = end - start;
+ sym.name = symbol_names.create(b.syms[i].name());
+ sym.sample.vma = b.syms[i].vma();
+
+ finish_sym(i, start);
+
+ if (cverb << vdebug) {
+ cverb << vdebug << hex << "Caller sym: "
+ << b.syms[i].name() << " filepos " << start
+ << "-" << end << dec << endl;
+ }
+ }
+
+ /// point to a callee symbol
+ bool callee_sym(u32 off) {
+ sym = symbol_entry();
+
+ symbol_index_t i = 0;
+ op_bfd_symbol const * bfdsym =
+ get_symbol_by_filepos(b, boffset, off, i);
+
+ if (!bfdsym)
+ return false;
+
+ callee_end = bfdsym->size() + bfdsym->filepos() - boffset;
+
+ sym.size = bfdsym->size();
+ sym.name = symbol_names.create(bfdsym->name());
+ sym.sample.vma = bfdsym->vma();
+
+ finish_sym(i, bfdsym->filepos());
+
+ if (cverb << vdebug) {
+ cverb << vdebug << hex << "Callee sym: "
+ << bfdsym->name() << " filepos "
+ << bfdsym->filepos() << "-"
+ << (bfdsym->filepos() + bfdsym->size())
+ << dec << endl;
+ }
+ return true;
+ }
+
+ void verbose_bfd(string const & prefix) const {
+ cverb << vdebug << prefix << " " << b.get_filename()
+ << " offset " << boffset << " app "
+ << image_names.name(app) << endl;
+ }
+
+ typedef vector<pair<odb_key_t, count_type> > samples_t;
+
+ typedef samples_t::const_iterator const_iterator;
+
+ samples_t samples;
+ symbol_entry sym;
+ u32 callee_end;
+
+private:
+ /// fill in the rest of the sym
+ void finish_sym(symbol_index_t i, unsigned long start) {
+ sym.image_name = image;
+ sym.app_name = app;
+ symbol_entry const * self = pc.find(sym);
+ if (self)
+ sym.sample.counts = self->sample.counts;
+
+ if (debug) {
+ string filename;
+ file_location & loc = sym.sample.file_loc;
+ if (b.get_linenr(i, start, filename, loc.linenr))
+ loc.filename = debug_names.create(filename);
+ }
+ }
+
+ profile_container const & pc;
+ profile_t const & profile;
+ op_bfd const & b;
+ u32 boffset;
+ image_name_id image;
+ image_name_id app;
+ bool debug;
+};
+
+
+/// accumulate all samples for a given caller/callee pair
+count_type
+accumulate_callee(call_data::const_iterator & it, call_data::const_iterator end,
+ u32 callee_end)
+{
+ count_type count = 0;
+ call_data::const_iterator const start = it;
+
+ while (it != end) {
+ u32 offset = key_to_callee(it->first);
+
+ if (cverb << (vdebug & vlevel1)) {
+ cverb << (vdebug & vlevel1) << hex << "offset: "
+ << offset << dec << endl;
+ }
+
+ // stop if we pass the end of the callee
+ if (offset >= callee_end)
+ break;
+
+ count += it->second;
+ ++it;
+ }
+
+ // If we haven't advanced at all, then we'll get
+ // an infinite loop, so we must abort.
+ if (it == start) {
+ cerr << "failure to advance iterator\n";
+ abort();
+ }
+
+ return count;
+}
+
+
+} // anonymous namespace
+
+
+void arc_recorder::
+add(symbol_entry const & caller, symbol_entry const * callee,
+ count_array_t const & arc_count)
+{
+ cg_data & data = sym_map[caller];
+
+ // If we have a callee, add it to the caller's list, then
+ // add the caller to the callee's list.
+ if (callee) {
+ data.callees[*callee] += arc_count;
+
+ cg_data & callee_data = sym_map[*callee];
+
+ callee_data.callers[caller] += arc_count;
+ }
+}
+
+
+void arc_recorder::process_children(cg_symbol & sym, double threshold)
+{
+ // generate the synthetic self entry for the symbol
+ symbol_entry self = sym;
+
+ self.name = symbol_names.create(symbol_names.demangle(self.name)
+ + " [self]");
+
+ sym.total_callee_count += self.sample.counts;
+ sym.callees.push_back(self);
+
+ sort(sym.callers.begin(), sym.callers.end(), compare_arc_count);
+ sort(sym.callees.begin(), sym.callees.end(), compare_arc_count_reverse);
+
+ // FIXME: this relies on sort always being sample count
+
+ cg_symbol::children::iterator cit = sym.callers.begin();
+ cg_symbol::children::iterator cend = sym.callers.end();
+
+ while (cit != cend && op_ratio(cit->sample.counts[0],
+ sym.total_caller_count[0]) < threshold)
+ ++cit;
+
+ if (cit != cend)
+ sym.callers.erase(sym.callers.begin(), cit);
+
+ cit = sym.callees.begin();
+ cend = sym.callees.end();
+
+ while (cit != cend && op_ratio(cit->sample.counts[0],
+ sym.total_callee_count[0]) >= threshold)
+ ++cit;
+
+ if (cit != cend)
+ sym.callees.erase(cit, sym.callees.end());
+}
+
+
+void arc_recorder::
+process(count_array_t total, double threshold,
+ string_filter const & sym_filter)
+{
+ map_t::const_iterator it;
+ map_t::const_iterator end = sym_map.end();
+
+ for (it = sym_map.begin(); it != end; ++it) {
+ cg_symbol sym((*it).first);
+ cg_data const & data = (*it).second;
+
+ // threshold out the main symbol if needed
+ if (op_ratio(sym.sample.counts[0], total[0]) < threshold)
+ continue;
+
+ // FIXME: slow?
+ if (!sym_filter.match(symbol_names.demangle(sym.name)))
+ continue;
+
+ cg_data::children::const_iterator cit;
+ cg_data::children::const_iterator cend = data.callers.end();
+
+ for (cit = data.callers.begin(); cit != cend; ++cit) {
+ symbol_entry csym = cit->first;
+ csym.sample.counts = cit->second;
+ sym.callers.push_back(csym);
+ sym.total_caller_count += cit->second;
+ }
+
+ cend = data.callees.end();
+
+ for (cit = data.callees.begin(); cit != cend; ++cit) {
+ symbol_entry csym = cit->first;
+ csym.sample.counts = cit->second;
+ sym.callees.push_back(csym);
+ sym.total_callee_count += cit->second;
+ }
+
+ process_children(sym, threshold);
+
+ // insert sym into cg_syms_objs
+ // then store pointer to sym in cg_syms
+ cg_syms.push_back(&(*cg_syms_objs.insert(cg_syms_objs.end(), sym)));
+ }
+}
+
+
+symbol_collection const & arc_recorder::get_symbols() const
+{
+ return cg_syms;
+}
+
+
+void callgraph_container::populate(list<inverted_profile> const & iprofiles,
+ extra_images const & extra, bool debug_info, double threshold,
+ bool merge_lib, string_filter const & sym_filter)
+{
+ this->extra_found_images = extra;
+ // non callgraph samples container, we record sample at symbol level
+ // not at vma level.
+ profile_container pc(debug_info, false, extra_found_images);
+
+ list<inverted_profile>::const_iterator it;
+ list<inverted_profile>::const_iterator const end = iprofiles.end();
+ for (it = iprofiles.begin(); it != end; ++it) {
+ // populate_caller_image take care about empty sample filename
+ populate_for_image(pc, *it, sym_filter, 0);
+ }
+
+ add_symbols(pc);
+
+ total_count = pc.samples_count();
+
+ for (it = iprofiles.begin(); it != end; ++it) {
+ for (size_t i = 0; i < it->groups.size(); ++i) {
+ populate(it->groups[i], it->image,
+ i, pc, debug_info, merge_lib);
+ }
+ }
+
+ recorder.process(total_count, threshold / 100.0, sym_filter);
+}
+
+
+void callgraph_container::populate(list<image_set> const & lset,
+ string const & app_image, size_t pclass,
+ profile_container const & pc, bool debug_info, bool merge_lib)
+{
+ list<image_set>::const_iterator lit;
+ list<image_set>::const_iterator const lend = lset.end();
+ for (lit = lset.begin(); lit != lend; ++lit) {
+ list<profile_sample_files>::const_iterator pit;
+ list<profile_sample_files>::const_iterator pend
+ = lit->files.end();
+ for (pit = lit->files.begin(); pit != pend; ++pit) {
+ populate(pit->cg_files, app_image,
+ pclass, pc, debug_info, merge_lib);
+ }
+ }
+}
+
+
+void callgraph_container::populate(list<string> const & cg_files,
+ string const & app_image, size_t pclass,
+ profile_container const & pc, bool debug_info, bool merge_lib)
+{
+ list<string>::const_iterator it;
+ list<string>::const_iterator const end = cg_files.end();
+ for (it = cg_files.begin(); it != end; ++it) {
+ cverb << vdebug << "samples file : " << *it << endl;
+
+ parsed_filename caller_file =
+ parse_filename(*it, extra_found_images);
+ string const app_name = caller_file.image;
+
+ image_error error;
+ extra_found_images.find_image_path(caller_file.lib_image,
+ error, false);
+
+ if (error != image_ok)
+ report_image_error(caller_file.lib_image,
+ error, false, extra_found_images);
+
+ bool caller_bfd_ok = true;
+ op_bfd caller_bfd(caller_file.lib_image,
+ string_filter(), extra_found_images, caller_bfd_ok);
+ if (!caller_bfd_ok)
+ report_image_error(caller_file.lib_image,
+ image_format_failure, false,
+ extra_found_images);
+
+ parsed_filename callee_file =
+ parse_filename(*it, extra_found_images);
+
+ extra_found_images.find_image_path(callee_file.cg_image,
+ error, false);
+ if (error != image_ok)
+ report_image_error(callee_file.cg_image,
+ error, false, extra_found_images);
+
+ bool callee_bfd_ok = true;
+ op_bfd callee_bfd(callee_file.cg_image,
+ string_filter(), extra_found_images, callee_bfd_ok);
+ if (!callee_bfd_ok)
+ report_image_error(callee_file.cg_image,
+ image_format_failure, false,
+ extra_found_images);
+
+ profile_t profile;
+ // We can't use start_offset support in profile_t, give
+ // it a zero offset and we will fix that in add()
+ profile.add_sample_file(*it);
+ add(profile, caller_bfd, caller_bfd_ok, callee_bfd,
+ merge_lib ? app_image : app_name, pc,
+ debug_info, pclass);
+ }
+}
+
+
+void callgraph_container::
+add(profile_t const & profile, op_bfd const & caller_bfd, bool caller_bfd_ok,
+ op_bfd const & callee_bfd, string const & app_name,
+ profile_container const & pc, bool debug_info, size_t pclass)
+{
+ string const image_name = caller_bfd.get_filename();
+
+ opd_header const & header = profile.get_header();
+
+ // We can't use kernel sample file w/o the binary else we will
+ // use it with a zero offset, the code below will abort because
+ // we will get incorrect callee sub-range and out of range
+ // callee vma. FIXME
+ if (header.is_kernel && !caller_bfd_ok)
+ return;
+
+ // We must handle start_offset, this offset can be different for the
+ // caller and the callee: kernel sample traversing the syscall barrier.
+ u32 caller_offset;
+ if (header.is_kernel)
+ caller_offset = caller_bfd.get_start_offset(0);
+ else
+ caller_offset = header.anon_start;
+
+ u32 callee_offset;
+ if (header.cg_to_is_kernel)
+ callee_offset = callee_bfd.get_start_offset(0);
+ else
+ callee_offset = header.cg_to_anon_start;
+
+ image_name_id image_id = image_names.create(image_name);
+ image_name_id callee_image_id = image_names.create(callee_bfd.get_filename());
+ image_name_id app_id = image_names.create(app_name);
+
+ call_data caller(pc, profile, caller_bfd, caller_offset, image_id,
+ app_id, debug_info);
+ call_data callee(pc, profile, callee_bfd, callee_offset,
+ callee_image_id, app_id, debug_info);
+
+ if (cverb << vdebug) {
+ caller.verbose_bfd("Caller:");
+ callee.verbose_bfd("Callee:");
+ }
+
+ // For each symbol in the caller bfd, process all arcs to
+ // callee bfd symbols
+
+ for (symbol_index_t i = 0; i < caller_bfd.syms.size(); ++i) {
+
+ caller.caller_sym(i);
+
+ call_data::const_iterator dit = caller.samples.begin();
+ call_data::const_iterator dend = caller.samples.end();
+ while (dit != dend) {
+ // if we can't find the callee, skip an arc
+ if (!callee.callee_sym(key_to_callee(dit->first))) {
+ ++dit;
+ continue;
+ }
+
+ count_array_t arc_count;
+ arc_count[pclass] =
+ accumulate_callee(dit, dend, callee.callee_end);
+
+ recorder.add(caller.sym, &callee.sym, arc_count);
+ }
+ }
+}
+
+
+void callgraph_container::add_symbols(profile_container const & pc)
+{
+ symbol_container::symbols_t::iterator it;
+ symbol_container::symbols_t::iterator const end = pc.end_symbol();
+
+ for (it = pc.begin_symbol(); it != end; ++it)
+ recorder.add(*it, 0, count_array_t());
+}
+
+
+column_flags callgraph_container::output_hint() const
+{
+ column_flags output_hints = cf_none;
+
+ // FIXME: costly: must we access directly recorder map ?
+ symbol_collection syms = recorder.get_symbols();
+
+ symbol_collection::iterator it;
+ symbol_collection::iterator const end = syms.end();
+ for (it = syms.begin(); it != end; ++it)
+ output_hints = (*it)->output_hint(output_hints);
+
+ return output_hints;
+}
+
+
+count_array_t callgraph_container::samples_count() const
+{
+ return total_count;
+}
+
+
+symbol_collection const & callgraph_container::get_symbols() const
+{
+ return recorder.get_symbols();
+}
diff --git a/libpp/callgraph_container.h b/libpp/callgraph_container.h
new file mode 100644
index 0000000..f99a0aa
--- /dev/null
+++ b/libpp/callgraph_container.h
@@ -0,0 +1,171 @@
+/**
+ * @file callgraph_container.h
+ * Container associating symbols and caller/caller symbols
+ *
+ * @remark Copyright 2004 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#ifndef CALLGRAPH_CONTAINER_H
+#define CALLGRAPH_CONTAINER_H
+
+#include <set>
+#include <vector>
+#include <string>
+
+#include "symbol.h"
+#include "symbol_functors.h"
+#include "string_filter.h"
+#include "locate_images.h"
+
+class profile_container;
+class inverted_profile;
+class profile_t;
+class image_set;
+class op_bfd;
+
+
+/**
+ * During building a callgraph_container we store all caller/callee
+ * relationship in this container.
+ *
+ * An "arc" is simply a description of a call from one function to
+ * another.
+ */
+class arc_recorder {
+public:
+ ~arc_recorder() {}
+
+ /**
+ * Add a symbol arc.
+ * @param caller The calling symbol
+ * @param callee The called symbol
+ * @param arc_count profile data for the arcs
+ *
+ * If the callee is NULL, only the caller is added to the main
+ * list. This is used to initially populate the recorder with
+ * the symbols.
+ */
+ void add(symbol_entry const & caller, symbol_entry const * callee,
+ count_array_t const & arc_count);
+
+ /// return all the cg symbols
+ symbol_collection const & get_symbols() const;
+
+ /**
+ * After population, build the final output, and do
+ * thresholding.
+ */
+ void process(count_array_t total, double threshold,
+ string_filter const & filter);
+
+private:
+ /**
+ * Internal structure used during collation. We use a map to
+ * allow quick lookup of children (we'll do this several times
+ * if we have more than one profile class). Each child maps from
+ * the symbol to the relevant arc data.
+ */
+ struct cg_data {
+ cg_data() {}
+
+ typedef std::map<symbol_entry, count_array_t, less_symbol> children;
+
+ /// callers of this symbol
+ children callers;
+ /// callees of this symbol
+ children callees;
+ };
+
+ /**
+ * Sort and threshold callers and callees.
+ */
+ void process_children(cg_symbol & sym, double threshold);
+
+ typedef std::map<symbol_entry, cg_data, less_symbol> map_t;
+
+ /// all the symbols (used during processing)
+ map_t sym_map;
+
+ /// symbol objects pointed to by pointers in vector cg_syms
+ cg_collection_objs cg_syms_objs;
+
+ /// final output data
+ symbol_collection cg_syms;
+};
+
+
+/**
+ * Store all callgraph information for the given profiles
+ */
+class callgraph_container {
+public:
+ /**
+ * Populate the container, must be called once only.
+ * @param iprofiles sample file list including callgraph files.
+ * @param extra extra image list to fixup binary name.
+ * @param debug_info true if we must record linenr information
+ * @param threshold ignore sample percent below this threshold
+ * @param merge_lib merge library samples
+ * @param sym_filter symbol filter
+ *
+ * Currently all errors core dump.
+ * FIXME: consider if this should be a ctor
+ */
+ void populate(std::list<inverted_profile> const & iprofiles,
+ extra_images const & extra, bool debug_info,
+ double threshold, bool merge_lib,
+ string_filter const & sym_filter);
+
+ /// return hint on how data must be displayed.
+ column_flags output_hint() const;
+
+ /// return the total number of samples.
+ count_array_t samples_count() const;
+
+ // return all the cg symbols
+ symbol_collection const & get_symbols() const;
+
+private:
+ /**
+ * Record caller/callee for one cg file
+ * @param profile one callgraph file stored in a profile_t
+ * @param caller_bfd the caller bfd
+ * @param bfd_caller_ok true if we succefully open the binary
+ * @param callee_bfd the callee bfd
+ * @param app_name the owning application
+ * @param pc the profile_container holding all non cg samples.
+ * @param debug_info record linenr debug information
+ * @param pclass profile class nr
+ */
+ void add(profile_t const & profile, op_bfd const & caller_bfd,
+ bool bfd_caller_ok, op_bfd const & callee_bfd,
+ std::string const & app_name, profile_container const & pc,
+ bool debug_info, size_t pclass);
+
+ void populate(std::list<image_set> const & lset,
+ std::string const & app_image,
+ size_t pclass, profile_container const & pc,
+ bool debug_info, bool merge_lib);
+ void populate(std::list<std::string> const & cg_files,
+ std::string const & app_image,
+ size_t pclass, profile_container const & pc,
+ bool debug_info, bool merge_lib);
+
+ /// record all main symbols
+ void add_symbols(profile_container const & pc);
+
+ /// Cached value of samples count.
+ count_array_t total_count;
+
+ /// A structured representation of the callgraph.
+ arc_recorder recorder;
+
+public: // FIXME
+ extra_images extra_found_images;
+};
+
+#endif /* !CALLGRAPH_CONTAINER_H */
diff --git a/libpp/diff_container.cpp b/libpp/diff_container.cpp
new file mode 100644
index 0000000..7762916
--- /dev/null
+++ b/libpp/diff_container.cpp
@@ -0,0 +1,159 @@
+/**
+ * @file diff_container.cpp
+ * Container for diffed symbols
+ *
+ * @remark Copyright 2005 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+/* older glibc has C99 INFINITY in _GNU_SOURCE */
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+
+#include "diff_container.h"
+
+#include <cmath>
+
+using namespace std;
+
+
+namespace {
+
+
+/// a comparator suitable for diffing symbols
+bool rough_less(symbol_entry const & lhs, symbol_entry const & rhs)
+{
+ if (lhs.image_name != rhs.image_name)
+ return lhs.image_name < rhs.image_name;
+
+ if (lhs.app_name != rhs.app_name)
+ return lhs.app_name < rhs.app_name;
+
+ if (lhs.name != rhs.name)
+ return lhs.name < rhs.name;
+
+ return false;
+}
+
+
+/// possibly add a diff sym
+void
+add_sym(diff_collection & syms, diff_symbol const & sym,
+ profile_container::symbol_choice & choice)
+{
+ if (choice.match_image
+ && (image_names.name(sym.image_name) != choice.image_name))
+ return;
+
+ if (fabs(sym.diffs[0]) < choice.threshold)
+ return;
+
+ choice.hints = sym.output_hint(choice.hints);
+ syms.push_back(sym);
+}
+
+
+/// add a symbol not present in the new profile
+void
+symbol_old(diff_collection & syms, symbol_entry const & sym,
+ profile_container::symbol_choice & choice)
+{
+ diff_symbol symbol(sym);
+ symbol.diffs.fill(sym.sample.counts.size(), -INFINITY);
+ add_sym(syms, symbol, choice);
+}
+
+
+/// add a symbol not present in the old profile
+void
+symbol_new(diff_collection & syms, symbol_entry const & sym,
+ profile_container::symbol_choice & choice)
+{
+ diff_symbol symbol(sym);
+ symbol.diffs.fill(sym.sample.counts.size(), INFINITY);
+ add_sym(syms, symbol, choice);
+}
+
+
+/// add a diffed symbol
+void symbol_diff(diff_collection & syms,
+ symbol_entry const & sym1, count_array_t const & total1,
+ symbol_entry const & sym2, count_array_t const & total2,
+ profile_container::symbol_choice & choice)
+{
+ diff_symbol symbol(sym2);
+
+ size_t size = sym2.sample.counts.size();
+ for (size_t i = 0; i != size; ++i) {
+ double percent1;
+ double percent2;
+ percent1 = op_ratio(sym1.sample.counts[i], total1[i]);
+ percent2 = op_ratio(sym2.sample.counts[i], total2[i]);
+ symbol.diffs[i] = op_ratio(percent2 - percent1, percent1);
+ symbol.diffs[i] *= 100.0;
+ }
+
+ add_sym(syms, symbol, choice);
+}
+
+
+}; // namespace anon
+
+
+diff_container::diff_container(profile_container const & c1,
+ profile_container const & c2)
+ : pc1(c1), pc2(c2),
+ total1(pc1.samples_count()), total2(pc2.samples_count())
+{
+}
+
+
+diff_collection const
+diff_container::get_symbols(profile_container::symbol_choice & choice) const
+{
+ diff_collection syms;
+
+ /*
+ * Do a pairwise comparison of the two symbol sets. We're
+ * relying here on the symbol container being sorted such
+ * that rough_less() is suitable for iterating through the
+ * two lists (see less_symbol).
+ */
+
+ symbol_container::symbols_t::iterator it1 = pc1.begin_symbol();
+ symbol_container::symbols_t::iterator end1 = pc1.end_symbol();
+ symbol_container::symbols_t::iterator it2 = pc2.begin_symbol();
+ symbol_container::symbols_t::iterator end2 = pc2.end_symbol();
+
+ while (it1 != end1 && it2 != end2) {
+ if (rough_less(*it1, *it2)) {
+ symbol_old(syms, *it1, choice);
+ ++it1;
+ } else if (rough_less(*it2, *it1)) {
+ symbol_new(syms, *it2, choice);
+ ++it2;
+ } else {
+ symbol_diff(syms, *it1, total1, *it2, total2, choice);
+ ++it1;
+ ++it2;
+ }
+ }
+
+ for (; it1 != end1; ++it1)
+ symbol_old(syms, *it1, choice);
+
+ for (; it2 != end2; ++it2)
+ symbol_new(syms, *it2, choice);
+
+ return syms;
+}
+
+
+count_array_t const diff_container::samples_count() const
+{
+ return total2;
+}
diff --git a/libpp/diff_container.h b/libpp/diff_container.h
new file mode 100644
index 0000000..14b431d
--- /dev/null
+++ b/libpp/diff_container.h
@@ -0,0 +1,50 @@
+/**
+ * @file diff_container.h
+ * Container for diffed symbols
+ *
+ * @remark Copyright 2005 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#ifndef DIFF_CONTAINER_H
+#define DIFF_CONTAINER_H
+
+#include "profile_container.h"
+
+
+/**
+ * Store two profiles for diffing.
+ */
+class diff_container : noncopyable {
+public:
+ /// populate the collection of diffed symbols
+ diff_container(profile_container const & pc1,
+ profile_container const & pc2);
+
+ ~diff_container() {}
+
+ /// return a collection of diffed symbols
+ diff_collection const
+ get_symbols(profile_container::symbol_choice & choice) const;
+
+ /// total count for 'new' profile
+ count_array_t const samples_count() const;
+
+private:
+ /// first profile
+ profile_container const & pc1;
+
+ /// second profile
+ profile_container const & pc2;
+
+ /// samples count for pc1
+ count_array_t total1;
+
+ /// samples count for pc2
+ count_array_t total2;
+};
+
+#endif /* !DIFF_CONTAINER_H */
diff --git a/libpp/filename_spec.cpp b/libpp/filename_spec.cpp
new file mode 100644
index 0000000..9ba74db
--- /dev/null
+++ b/libpp/filename_spec.cpp
@@ -0,0 +1,81 @@
+/**
+ * @file filename_spec.cpp
+ * Container holding a sample filename split into its components
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ */
+
+#include <string>
+
+#include "filename_spec.h"
+#include "parse_filename.h"
+#include "generic_spec.h"
+#include "locate_images.h"
+
+
+using namespace std;
+
+
+filename_spec::filename_spec(string const & filename,
+ extra_images const & extra)
+{
+ set_sample_filename(filename, extra);
+}
+
+
+filename_spec::filename_spec()
+ : image("*"), lib_image("*")
+{
+}
+
+
+bool filename_spec::match(filename_spec const & rhs,
+ string const & binary) const
+{
+ if (!tid.match(rhs.tid) || !cpu.match(rhs.cpu) ||
+ !tgid.match(rhs.tgid) || count != rhs.count ||
+ unitmask != rhs.unitmask || event != rhs.event) {
+ return false;
+ }
+
+ if (binary.empty())
+ return image == rhs.image && lib_image == rhs.lib_image;
+
+ // PP:3.3 if binary is not empty we must match either the
+ // lib_name if present or the image name
+ if (!rhs.lib_image.empty()) {
+ // FIXME: use fnmatch ?
+ return rhs.lib_image == binary;
+ }
+
+ // FIXME: use fnmatch ?
+ return rhs.image == binary;
+}
+
+
+void filename_spec::set_sample_filename(string const & filename,
+ extra_images const & extra)
+{
+ parsed_filename parsed = parse_filename(filename, extra);
+
+ image = parsed.image;
+ lib_image = parsed.lib_image;
+ cg_image = parsed.cg_image;
+ event = parsed.event;
+ count = op_lexical_cast<int>(parsed.count);
+ unitmask = op_lexical_cast<unsigned int>(parsed.unitmask);
+ tgid.set(parsed.tgid);
+ tid.set(parsed.tid);
+ cpu.set(parsed.cpu);
+}
+
+
+bool filename_spec::is_dependent() const
+{
+ if (cg_image.empty())
+ return image != lib_image;
+ return cg_image != image || cg_image != lib_image;
+}
diff --git a/libpp/filename_spec.h b/libpp/filename_spec.h
new file mode 100644
index 0000000..9c50c60
--- /dev/null
+++ b/libpp/filename_spec.h
@@ -0,0 +1,84 @@
+/**
+ * @file filename_spec.h
+ * Container holding a sample filename split into its components
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ */
+
+#ifndef FILENAME_SPEC_H
+#define FILENAME_SPEC_H
+
+#include <unistd.h>
+#include <string>
+
+#include "generic_spec.h"
+
+class profile_spec;
+class extra_images;
+
+/**
+ * A class to split and store components of a sample filename.
+ * These derived values are then used to match against a
+ * profile_spec as given by the user.
+ */
+class filename_spec
+{
+ friend class profile_spec;
+
+public:
+ /**
+ * @param filename the samples filename
+ * @param extra extra binary image location
+ *
+ * build a filename_spec from a samples filename
+ */
+ filename_spec(std::string const & filename,
+ extra_images const & extra);
+
+ filename_spec();
+
+ /**
+ * @param filename a sample filename
+ * @param extra extra binary image location
+ *
+ * setup filename spec according to the samples filename. PP:3.19 to
+ * 3.25
+ */
+ void set_sample_filename(std::string const & filename,
+ extra_images const & extra);
+
+ /**
+ * @param rhs right hand side of the match operator
+ * @param binary if binary is non-empty, and matches
+ * the binary or lib name, use it rather than the
+ * one in rhs.
+ *
+ * return true if *this match rhs, matching if:
+ * - image_name are identical
+ * - lib_name are identical
+ * - event_spec match
+ *
+ * This operation is not commutative. First part of PP:3.24
+ */
+ bool match(filename_spec const & rhs,
+ std::string const & binary) const;
+
+ bool is_dependent() const;
+
+private:
+ std::string image;
+ std::string lib_image;
+ std::string cg_image;
+ std::string event;
+ int count;
+ unsigned int unitmask;
+ generic_spec<pid_t> tgid;
+ generic_spec<pid_t> tid;
+ generic_spec<int> cpu;
+};
+
+
+#endif /* !FILENAME_SPEC_H */
diff --git a/libpp/format_flags.h b/libpp/format_flags.h
new file mode 100644
index 0000000..6268ae1
--- /dev/null
+++ b/libpp/format_flags.h
@@ -0,0 +1,69 @@
+/**
+ * @file format_flags.h
+ * output options
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#ifndef FORMAT_FLAGS_H
+#define FORMAT_FLAGS_H
+
+/**
+ * flags passed to the ctor of an output_symbol object.
+ *
+ * \sa format_output::formatter
+ */
+enum format_flags {
+ ff_none = 0,
+ /// a formatted memory address
+ ff_vma = 1 << 0,
+ /// output debug filename and line nr.
+ ff_linenr_info = 1 << 1,
+ /// output the image name for this line
+ ff_image_name = 1 << 3,
+ /// output owning application name
+ ff_app_name = 1 << 4,
+ /// output the (demangled) symbol name
+ ff_symb_name = 1 << 5,
+
+ /** @name subset of flags used by opreport_formatter */
+ //@{
+ /// number of samples
+ ff_nr_samples = 1 << 6,
+ /// number of samples accumulated
+ ff_nr_samples_cumulated = 1 << 7,
+ /// relative percentage of samples
+ ff_percent = 1 << 8,
+ /// relative percentage of samples accumulated
+ ff_percent_cumulated = 1 << 9,
+ /**
+ * Output percentage for details, not relative
+ * to symbol but relative to the total nr of samples
+ */
+ ff_percent_details = 1 << 10,
+ /**
+ * Output percentage for details, not relative
+ * to symbol but relative to the total nr of samples,
+ * accumulated
+ */
+ ff_percent_cumulated_details = 1 << 11,
+ /// output diff value
+ ff_diff = 1 << 12,
+ //@}
+};
+
+
+/**
+ * General hints about formatting of the columnar output.
+ */
+enum column_flags {
+ cf_none = 0,
+ cf_64bit_vma = 1 << 0,
+ cf_image_name = 1 << 1
+};
+
+#endif // FORMAT_FLAGS_H
diff --git a/libpp/format_output.cpp b/libpp/format_output.cpp
new file mode 100644
index 0000000..de42dc8
--- /dev/null
+++ b/libpp/format_output.cpp
@@ -0,0 +1,1049 @@
+/**
+ * @file format_output.cpp
+ * outputting format for symbol lists
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+/* older glibc has C99 INFINITY in _GNU_SOURCE */
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+
+#include <cassert>
+#include <sstream>
+#include <iomanip>
+#include <iostream>
+#include <cmath>
+
+#include "string_manip.h"
+#include "string_filter.h"
+
+#include "format_output.h"
+#include "profile_container.h"
+#include "callgraph_container.h"
+#include "diff_container.h"
+#include "arrange_profiles.h"
+#include "xml_output.h"
+#include "xml_utils.h"
+#include "cverb.h"
+
+using namespace std;
+
+namespace {
+
+
+string const get_linenr_info(file_location const floc, bool lf)
+{
+ ostringstream out;
+
+ string const & filename = lf
+ ? debug_names.name(floc.filename)
+ : debug_names.basename(floc.filename);
+
+ if (!filename.empty())
+ out << filename << ":" << floc.linenr;
+ else
+ out << "(no location information)";
+
+ return out.str();
+}
+
+string get_vma(bfd_vma vma, bool vma_64)
+{
+ ostringstream out;
+ int width = vma_64 ? 16 : 8;
+
+ out << hex << setw(width) << setfill('0') << vma;
+
+ return out.str();
+}
+
+string get_percent(count_type dividend, count_type divisor)
+{
+ double ratio = op_ratio(dividend, divisor);
+
+ return ::format_percent(ratio * 100, percent_int_width,
+ percent_fract_width);
+}
+
+bool extract_linenr_info(string const & info, string & file, size_t & line)
+{
+ line = 0;
+ file = "";
+ string::size_type colon_pos = info.find(":");
+
+ if (colon_pos == string::npos)
+ return false;
+
+ file = info.substr(0, colon_pos);
+ istringstream is_info(info.substr(colon_pos+1));
+ is_info >> line;
+ return true;
+}
+
+
+} // anonymous namespace
+
+namespace format_output {
+
+formatter::formatter(extra_images const & extra)
+ :
+ nr_classes(1),
+ flags(ff_none),
+ vma_64(false),
+ long_filenames(false),
+ need_header(true),
+ extra_found_images(extra)
+{
+ format_map[ff_vma] = field_description(9, "vma", &formatter::format_vma);
+ format_map[ff_nr_samples] = field_description(9, "samples", &formatter::format_nr_samples);
+ format_map[ff_nr_samples_cumulated] = field_description(14, "cum. samples", &formatter::format_nr_cumulated_samples);
+ format_map[ff_percent] = field_description(9, "%", &formatter::format_percent);
+ format_map[ff_percent_cumulated] = field_description(11, "cum. %", &formatter::format_cumulated_percent);
+ format_map[ff_linenr_info] = field_description(28, "linenr info", &formatter::format_linenr_info);
+ format_map[ff_image_name] = field_description(25, "image name", &formatter::format_image_name);
+ format_map[ff_app_name] = field_description(25, "app name", &formatter::format_app_name);
+ format_map[ff_symb_name] = field_description(30, "symbol name", &formatter::format_symb_name);
+ format_map[ff_percent_details] = field_description(9, "%", &formatter::format_percent_details);
+ format_map[ff_percent_cumulated_details] = field_description(10, "cum. %", &formatter::format_cumulated_percent_details);
+ format_map[ff_diff] = field_description(10, "diff %", &formatter::format_diff);
+}
+
+
+formatter::~formatter()
+{
+}
+
+
+void formatter::set_nr_classes(size_t nr)
+{
+ nr_classes = nr;
+}
+
+
+void formatter::add_format(format_flags flag)
+{
+ flags = static_cast<format_flags>(flags | flag);
+}
+
+
+void formatter::show_header(bool on_off)
+{
+ need_header = on_off;
+}
+
+
+void formatter::vma_format_64bit(bool on_off)
+{
+ vma_64 = on_off;
+}
+
+
+void formatter::show_long_filenames(bool on_off)
+{
+ long_filenames = on_off;
+}
+
+
+void formatter::show_global_percent(bool on_off)
+{
+ global_percent = on_off;
+}
+
+
+void formatter::output_header(ostream & out)
+{
+ if (!need_header)
+ return;
+
+ size_t padding = 0;
+
+ // first output the vma field
+ if (flags & ff_vma)
+ padding = output_header_field(out, ff_vma, padding);
+
+ // the field repeated for each profile class
+ for (size_t pclass = 0 ; pclass < nr_classes; ++pclass) {
+ if (flags & ff_nr_samples)
+ padding = output_header_field(out,
+ ff_nr_samples, padding);
+
+ if (flags & ff_nr_samples_cumulated)
+ padding = output_header_field(out,
+ ff_nr_samples_cumulated, padding);
+
+ if (flags & ff_percent)
+ padding = output_header_field(out,
+ ff_percent, padding);
+
+ if (flags & ff_percent_cumulated)
+ padding = output_header_field(out,
+ ff_percent_cumulated, padding);
+
+ if (flags & ff_diff)
+ padding = output_header_field(out,
+ ff_diff, padding);
+
+ if (flags & ff_percent_details)
+ padding = output_header_field(out,
+ ff_percent_details, padding);
+
+ if (flags & ff_percent_cumulated_details)
+ padding = output_header_field(out,
+ ff_percent_cumulated_details, padding);
+ }
+
+ // now the remaining field
+ if (flags & ff_linenr_info)
+ padding = output_header_field(out, ff_linenr_info, padding);
+
+ if (flags & ff_image_name)
+ padding = output_header_field(out, ff_image_name, padding);
+
+ if (flags & ff_app_name)
+ padding = output_header_field(out, ff_app_name, padding);
+
+ if (flags & ff_symb_name)
+ padding = output_header_field(out, ff_symb_name, padding);
+
+ out << "\n";
+}
+
+
+/// describe each possible field of colummned output.
+// FIXME: use % of the screen width here. sum of % equal to 100, then calculate
+// ratio between 100 and the selected % to grow non fixed field use also
+// lib[n?]curses to get the console width (look info source) (so on add a fixed
+// field flags)
+size_t formatter::
+output_field(ostream & out, field_datum const & datum,
+ format_flags fl, size_t padding, bool hide_immutable)
+{
+ if (!hide_immutable) {
+ out << string(padding, ' ');
+
+ field_description const & field(format_map[fl]);
+ string str = (this->*field.formatter)(datum);
+ out << str;
+
+ // at least one separator char
+ padding = 1;
+ if (str.length() < field.width)
+ padding = field.width - str.length();
+ } else {
+ field_description const & field(format_map[fl]);
+ padding += field.width;
+ }
+
+ return padding;
+}
+
+
+size_t formatter::
+output_header_field(ostream & out, format_flags fl, size_t padding)
+{
+ out << string(padding, ' ');
+
+ field_description const & field(format_map[fl]);
+ out << field.header_name;
+
+ // at least one separator char
+ padding = 1;
+ if (field.header_name.length() < field.width)
+ padding = field.width - field.header_name.length();
+
+ return padding;
+}
+
+
+string formatter::format_vma(field_datum const & f)
+{
+ return get_vma(f.sample.vma, vma_64);
+}
+
+
+string formatter::format_symb_name(field_datum const & f)
+{
+ return symbol_names.demangle(f.symbol.name);
+}
+
+
+string formatter::format_image_name(field_datum const & f)
+{
+ return get_image_name(f.symbol.image_name,
+ long_filenames
+ ? image_name_storage::int_real_filename
+ : image_name_storage::int_real_basename,
+ extra_found_images);
+}
+
+
+string formatter::format_app_name(field_datum const & f)
+{
+ return get_image_name(f.symbol.app_name,
+ long_filenames
+ ? image_name_storage::int_real_filename
+ : image_name_storage::int_real_basename,
+ extra_found_images);
+}
+
+
+string formatter::format_linenr_info(field_datum const & f)
+{
+ return get_linenr_info(f.sample.file_loc, long_filenames);
+}
+
+
+string formatter::format_nr_samples(field_datum const & f)
+{
+ ostringstream out;
+ out << f.sample.counts[f.pclass];
+ return out.str();
+}
+
+
+string formatter::format_nr_cumulated_samples(field_datum const & f)
+{
+ if (f.diff == -INFINITY)
+ return "---";
+ ostringstream out;
+ f.counts.cumulated_samples[f.pclass] += f.sample.counts[f.pclass];
+ out << f.counts.cumulated_samples[f.pclass];
+ return out.str();
+}
+
+
+string formatter::format_percent(field_datum const & f)
+{
+ if (f.diff == -INFINITY)
+ return "---";
+ return get_percent(f.sample.counts[f.pclass], f.counts.total[f.pclass]);
+}
+
+
+string formatter::format_cumulated_percent(field_datum const & f)
+{
+ if (f.diff == -INFINITY)
+ return "---";
+ f.counts.cumulated_percent[f.pclass] += f.sample.counts[f.pclass];
+
+ return get_percent(f.counts.cumulated_percent[f.pclass],
+ f.counts.total[f.pclass]);
+}
+
+
+string formatter::format_percent_details(field_datum const & f)
+{
+ return get_percent(f.sample.counts[f.pclass],
+ f.counts.total[f.pclass]);
+}
+
+
+string formatter::format_cumulated_percent_details(field_datum const & f)
+{
+ f.counts.cumulated_percent_details[f.pclass] += f.sample.counts[f.pclass];
+
+ return get_percent(f.counts.cumulated_percent_details[f.pclass],
+ f.counts.total[f.pclass]);
+}
+
+
+string formatter::format_diff(field_datum const & f)
+{
+ if (f.diff == INFINITY)
+ return "+++";
+ else if (f.diff == -INFINITY)
+ return "---";
+
+ return ::format_percent(f.diff, percent_int_width,
+ percent_fract_width, true);
+}
+
+
+void formatter::
+do_output(ostream & out, symbol_entry const & symb, sample_entry const & sample,
+ counts_t & c, diff_array_t const & diffs, bool hide_immutable)
+{
+ size_t padding = 0;
+
+ // first output the vma field
+ field_datum datum(symb, sample, 0, c, extra_found_images);
+ if (flags & ff_vma)
+ padding = output_field(out, datum, ff_vma, padding, false);
+
+ // repeated fields for each profile class
+ for (size_t pclass = 0 ; pclass < nr_classes; ++pclass) {
+ field_datum datum(symb, sample, pclass, c,
+ extra_found_images, diffs[pclass]);
+
+ if (flags & ff_nr_samples)
+ padding = output_field(out, datum,
+ ff_nr_samples, padding, false);
+
+ if (flags & ff_nr_samples_cumulated)
+ padding = output_field(out, datum,
+ ff_nr_samples_cumulated, padding, false);
+
+ if (flags & ff_percent)
+ padding = output_field(out, datum,
+ ff_percent, padding, false);
+
+ if (flags & ff_percent_cumulated)
+ padding = output_field(out, datum,
+ ff_percent_cumulated, padding, false);
+
+ if (flags & ff_diff)
+ padding = output_field(out, datum,
+ ff_diff, padding, false);
+
+ if (flags & ff_percent_details)
+ padding = output_field(out, datum,
+ ff_percent_details, padding, false);
+
+ if (flags & ff_percent_cumulated_details)
+ padding = output_field(out, datum,
+ ff_percent_cumulated_details, padding, false);
+ }
+
+ // now the remaining field
+ if (flags & ff_linenr_info)
+ padding = output_field(out, datum, ff_linenr_info,
+ padding, false);
+
+ if (flags & ff_image_name)
+ padding = output_field(out, datum, ff_image_name,
+ padding, hide_immutable);
+
+ if (flags & ff_app_name)
+ padding = output_field(out, datum, ff_app_name,
+ padding, hide_immutable);
+
+ if (flags & ff_symb_name)
+ padding = output_field(out, datum, ff_symb_name,
+ padding, hide_immutable);
+
+ out << "\n";
+}
+
+
+opreport_formatter::opreport_formatter(profile_container const & p)
+ :
+ formatter(p.extra_found_images),
+ profile(p),
+ need_details(false)
+{
+ counts.total = profile.samples_count();
+}
+
+
+void opreport_formatter::show_details(bool on_off)
+{
+ need_details = on_off;
+}
+
+
+void opreport_formatter::output(ostream & out, symbol_entry const * symb)
+{
+ do_output(out, *symb, symb->sample, counts);
+
+ if (need_details)
+ output_details(out, symb);
+}
+
+
+void opreport_formatter::
+output(ostream & out, symbol_collection const & syms)
+{
+ output_header(out);
+
+ symbol_collection::const_iterator it = syms.begin();
+ symbol_collection::const_iterator end = syms.end();
+ for (; it != end; ++it)
+ output(out, *it);
+}
+
+
+void opreport_formatter::
+output_details(ostream & out, symbol_entry const * symb)
+{
+ counts_t c = counts;
+
+ if (!global_percent)
+ c.total = symb->sample.counts;
+
+ // cumulated percent are relative to current symbol.
+ c.cumulated_samples = count_array_t();
+ c.cumulated_percent = count_array_t();
+
+ sample_container::samples_iterator it = profile.begin(symb);
+ sample_container::samples_iterator end = profile.end(symb);
+ for (; it != end; ++it) {
+ out << " ";
+ do_output(out, *symb, it->second, c, diff_array_t(), true);
+ }
+}
+
+
+cg_formatter::cg_formatter(callgraph_container const & profile)
+ :
+ formatter(profile.extra_found_images)
+{
+ counts.total = profile.samples_count();
+}
+
+
+void cg_formatter::output(ostream & out, symbol_collection const & syms)
+{
+ // amount of spacing prefixing child and parent lines
+ string const child_parent_prefix(" ");
+
+ output_header(out);
+
+ out << string(79, '-') << endl;
+
+ symbol_collection::const_iterator it;
+ symbol_collection::const_iterator end = syms.end();
+
+ for (it = syms.begin(); it < end; ++it) {
+ cg_symbol const * sym = dynamic_cast<cg_symbol const *>(*it);
+
+ cg_symbol::children::const_iterator cit;
+ cg_symbol::children::const_iterator cend = sym->callers.end();
+
+ counts_t c;
+ if (global_percent)
+ c.total = counts.total;
+ else
+ c.total = sym->total_caller_count;
+
+ for (cit = sym->callers.begin(); cit != cend; ++cit) {
+ out << child_parent_prefix;
+ do_output(out, *cit, cit->sample, c);
+ }
+
+ do_output(out, *sym, sym->sample, counts);
+
+ c = counts_t();
+ if (global_percent)
+ c.total = counts.total;
+ else
+ c.total = sym->total_callee_count;
+
+ cend = sym->callees.end();
+
+ for (cit = sym->callees.begin(); cit != cend; ++cit) {
+ out << child_parent_prefix;
+ do_output(out, *cit, cit->sample, c);
+ }
+
+ out << string(79, '-') << endl;
+ }
+}
+
+
+diff_formatter::diff_formatter(diff_container const & profile,
+ extra_images const & extra)
+ :
+ formatter(extra)
+{
+ counts.total = profile.samples_count();
+}
+
+
+void diff_formatter::output(ostream & out, diff_collection const & syms)
+{
+ output_header(out);
+
+ diff_collection::const_iterator it = syms.begin();
+ diff_collection::const_iterator end = syms.end();
+ for (; it != end; ++it)
+ do_output(out, *it, it->sample, counts, it->diffs);
+}
+
+// local variables used in generation of XML
+// buffer details for output later
+ostringstream bytes_out;
+
+// module+symbol table for detecting duplicate symbols
+map<string, size_t> symbol_data_table;
+size_t symbol_data_index = 0;
+
+/* Return any existing index or add to the table */
+size_t xml_get_symbol_index(string const & name)
+{
+ size_t index = symbol_data_index;
+ map<string, size_t>::iterator it = symbol_data_table.find(name);
+
+ if (it == symbol_data_table.end()) {
+ symbol_data_table[name] = symbol_data_index++;
+ return index;
+ }
+
+ return it->second;
+}
+
+
+class symbol_details_t {
+public:
+ symbol_details_t() { size = index = 0; id = -1; }
+ int id;
+ size_t size;
+ size_t index;
+ string details;
+};
+
+typedef growable_vector<symbol_details_t> symbol_details_array_t;
+symbol_details_array_t symbol_details;
+size_t detail_table_index = 0;
+
+xml_formatter::
+xml_formatter(profile_container const * p,
+ symbol_collection & s, extra_images const & extra,
+ string_filter const & sf)
+ :
+ formatter(extra),
+ profile(p),
+ symbols(s),
+ need_details(false),
+ symbol_filter(sf)
+{
+ if (profile)
+ counts.total = profile->samples_count();
+}
+
+
+void xml_formatter::
+show_details(bool on_off)
+{
+ need_details = on_off;
+}
+
+
+void xml_formatter::output(ostream & out)
+{
+ xml_support->build_subclasses(out);
+
+ xml_support->output_program_structure(out);
+ output_symbol_data(out);
+ if (need_details) {
+ out << open_element(DETAIL_TABLE);
+ for (size_t i = 0; i < symbol_details.size(); ++i) {
+ int id = symbol_details[i].id;
+
+ if (id >= 0) {
+ out << open_element(SYMBOL_DETAILS, true);
+ out << init_attr(TABLE_ID, (size_t)id);
+ out << close_element(NONE, true);
+ out << symbol_details[i].details;
+ out << close_element(SYMBOL_DETAILS);
+ }
+ }
+ out << close_element(DETAIL_TABLE);
+
+ // output bytesTable
+ out << open_element(BYTES_TABLE);
+ out << bytes_out.str();
+ out << close_element(BYTES_TABLE);
+ }
+
+ out << close_element(PROFILE);
+}
+
+bool
+xml_formatter::get_bfd_object(symbol_entry const * symb, op_bfd * & abfd) const
+{
+ bool ok = true;
+
+ string const & image_name = get_image_name(symb->image_name,
+ image_name_storage::int_filename, extra_found_images);
+ if (symb->spu_offset) {
+ // FIXME: what about archive:tmp, actually it's not supported
+ // for spu since oparchive doesn't archive the real file but
+ // in future it would work ?
+ string tmp = get_image_name(symb->embedding_filename,
+ image_name_storage::int_filename, extra_found_images);
+ if (abfd && abfd->get_filename() == tmp)
+ return true;
+ delete abfd;
+ abfd = new op_bfd(symb->spu_offset, tmp,
+ symbol_filter, extra_found_images, ok);
+ } else {
+ if (abfd && abfd->get_filename() == image_name)
+ return true;
+ delete abfd;
+ abfd = new op_bfd(image_name, symbol_filter,
+ extra_found_images, ok);
+
+ }
+
+ if (!ok) {
+ report_image_error(image_name, image_format_failure,
+ false, extra_found_images);
+ delete abfd;
+ abfd = 0;
+ return false;
+ }
+
+ return true;
+}
+
+void xml_formatter::
+output_the_symbol_data(ostream & out, symbol_entry const * symb, op_bfd * & abfd)
+{
+ string const name = symbol_names.name(symb->name);
+ assert(name.size() > 0);
+
+ string const image = get_image_name(symb->image_name,
+ image_name_storage::int_filename, extra_found_images);
+ string const qname = image + ":" + name;
+ map<string, size_t>::iterator sd_it = symbol_data_table.find(qname);
+
+ if (sd_it != symbol_data_table.end()) {
+ // first time we've seen this symbol
+ out << open_element(SYMBOL_DATA, true);
+ out << init_attr(TABLE_ID, sd_it->second);
+
+ field_datum datum(*symb, symb->sample, 0, counts,
+ extra_found_images);
+
+ output_attribute(out, datum, ff_symb_name, NAME);
+
+ if (flags & ff_linenr_info) {
+ output_attribute(out, datum, ff_linenr_info, SOURCE_FILE);
+ output_attribute(out, datum, ff_linenr_info, SOURCE_LINE);
+ }
+
+ if (name.size() > 0 && name[0] != '?') {
+ output_attribute(out, datum, ff_vma, STARTING_ADDR);
+
+ if (need_details) {
+ get_bfd_object(symb, abfd);
+ if (abfd && abfd->symbol_has_contents(symb->sym_index))
+ xml_support->output_symbol_bytes(bytes_out, symb, sd_it->second, *abfd);
+ }
+ }
+ out << close_element();
+
+ // seen so remove (otherwise get several "no symbols")
+ symbol_data_table.erase(qname);
+ }
+}
+
+void xml_formatter::output_cg_children(ostream & out,
+ cg_symbol::children const cg_symb, op_bfd * & abfd)
+{
+ cg_symbol::children::const_iterator cit;
+ cg_symbol::children::const_iterator cend = cg_symb.end();
+
+ for (cit = cg_symb.begin(); cit != cend; ++cit) {
+ string const name = symbol_names.name(cit->name);
+ string const image = get_image_name(cit->image_name,
+ image_name_storage::int_filename, extra_found_images);
+ string const qname = image + ":" + name;
+ map<string, size_t>::iterator sd_it = symbol_data_table.find(qname);
+
+ if (sd_it != symbol_data_table.end()) {
+ symbol_entry const * child = &(*cit);
+ output_the_symbol_data(out, child, abfd);
+ }
+ }
+}
+
+void xml_formatter::output_symbol_data(ostream & out)
+{
+ op_bfd * abfd = NULL;
+ sym_iterator it = symbols.begin();
+ sym_iterator end = symbols.end();
+
+ out << open_element(SYMBOL_TABLE);
+ for ( ; it != end; ++it) {
+ symbol_entry const * symb = *it;
+ cg_symbol const * cg_symb = dynamic_cast<cg_symbol const *>(symb);
+ output_the_symbol_data(out, symb, abfd);
+ if (cg_symb) {
+ /* make sure callers/callees are included in SYMBOL_TABLE */
+ output_cg_children(out, cg_symb->callers, abfd);
+ output_cg_children(out, cg_symb->callees, abfd);
+ }
+ }
+ out << close_element(SYMBOL_TABLE);
+
+ delete abfd;
+}
+
+string xml_formatter::
+output_symbol_details(symbol_entry const * symb,
+ size_t & detail_index, size_t const lo, size_t const hi)
+{
+ if (!has_sample_counts(symb->sample.counts, lo, hi))
+ return "";
+
+ sample_container::samples_iterator it = profile->begin(symb);
+ sample_container::samples_iterator end = profile->end(symb);
+
+ ostringstream str;
+ for (; it != end; ++it) {
+ counts_t c;
+
+ for (size_t p = lo; p <= hi; ++p) {
+ size_t count = it->second.counts[p];
+
+ if (count == 0) continue;
+
+ str << open_element(DETAIL_DATA, true);
+ str << init_attr(TABLE_ID, detail_index++);
+
+ // first output the vma field
+ field_datum datum(*symb, it->second, 0, c,
+ extra_found_images, 0.0);
+ output_attribute(str, datum, ff_vma, VMA);
+ if (ff_linenr_info) {
+ string sym_file;
+ size_t sym_line;
+ string samp_file;
+ size_t samp_line;
+ string sym_info = get_linenr_info(symb->sample.file_loc, true);
+ string samp_info = get_linenr_info(it->second.file_loc, true);
+
+ if (extract_linenr_info(samp_info, samp_file, samp_line)) {
+ if (extract_linenr_info(sym_info, sym_file, sym_line)) {
+ // only output source_file if it is different than the symbol's
+ // source file. this can happen with inlined functions in
+ // #included header files
+ if (sym_file != samp_file)
+ str << init_attr(SOURCE_FILE, samp_file);
+ }
+ str << init_attr(SOURCE_LINE, samp_line);
+ }
+ }
+ str << close_element(NONE, true);
+
+ // output buffered sample data
+ output_sample_data(str, it->second, p);
+
+ str << close_element(DETAIL_DATA);
+ }
+ }
+ return str.str();
+}
+
+void xml_formatter::
+output_symbol(ostream & out,
+ symbol_entry const * symb, size_t lo, size_t hi, bool is_module)
+{
+ ostringstream str;
+ // 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;
+
+ for (size_t p = lo; p <= hi; ++p) {
+ got_samples |= xml_support->output_summary_data(str,
+ symb->sample.counts, p);
+ }
+
+ if (!got_samples)
+ return;
+
+ if (cverb << vxml)
+ out << "<!-- symbol_ref=" << symbol_names.name(symb->name) <<
+ " -->" << endl;
+
+ out << open_element(SYMBOL, true);
+
+ string const name = symbol_names.name(symb->name);
+ assert(name.size() > 0);
+
+ string const image = get_image_name(symb->image_name,
+ image_name_storage::int_filename, extra_found_images);
+ string const qname = image + ":" + name;
+
+ indx = xml_get_symbol_index(qname);
+
+ out << init_attr(ID_REF, indx);
+
+ if (need_details) {
+ ostringstream details;
+ symbol_details_t & sd = symbol_details[indx];
+ size_t const detail_lo = sd.index;
+
+ string detail_str = output_symbol_details(symb, sd.index, lo, hi);
+
+ if (detail_str.size() > 0) {
+ if (sd.id < 0)
+ sd.id = indx;
+ details << detail_str;
+ }
+
+ if (sd.index > detail_lo) {
+ sd.details = sd.details + details.str();
+ out << init_attr(DETAIL_LO, detail_lo);
+ out << init_attr(DETAIL_HI, sd.index-1);
+ }
+ }
+ out << close_element(NONE, true);
+ // output summary
+ out << str.str();
+ out << close_element(SYMBOL);
+}
+
+
+void xml_formatter::
+output_sample_data(ostream & out, sample_entry const & sample, size_t pclass)
+{
+ out << open_element(COUNT, true);
+ out << init_attr(CLASS, classes.v[pclass].name);
+ out << close_element(NONE, true);
+ out << sample.counts[pclass];
+ out << close_element(COUNT);
+}
+
+
+void xml_formatter::
+output_attribute(ostream & out, field_datum const & datum,
+ format_flags fl, tag_t tag)
+{
+ field_description const & field(format_map[fl]);
+
+ string str = (this->*field.formatter)(datum);
+
+ if (!str.empty()) {
+ if (fl == ff_linenr_info && (tag == SOURCE_LINE || tag == SOURCE_FILE)) {
+ string file;
+ size_t line;
+
+ if (extract_linenr_info(str, file, line)) {
+ if (tag == SOURCE_LINE)
+ out << init_attr(tag, line);
+ else
+ out << init_attr(tag, file);
+ }
+ } else
+ out << " " << init_attr(tag, str);
+ }
+}
+
+xml_cg_formatter::
+xml_cg_formatter(callgraph_container const & cg, symbol_collection & s,
+ string_filter const & sf)
+ :
+ xml_formatter(0, s, cg.extra_found_images, sf),
+ callgraph(cg)
+{
+ counts.total = callgraph.samples_count();
+}
+
+void xml_cg_formatter::
+output_symbol_core(ostream & out, cg_symbol::children const cg_symb,
+ string const selfname, string const qname,
+ size_t lo, size_t hi, bool is_module, tag_t tag)
+{
+ cg_symbol::children::const_iterator cit;
+ cg_symbol::children::const_iterator cend = cg_symb.end();
+
+ for (cit = cg_symb.begin(); cit != cend; ++cit) {
+ string const & module = get_image_name((cit)->image_name,
+ image_name_storage::int_filename, extra_found_images);
+ bool self = false;
+ ostringstream str;
+ size_t indx;
+
+ // output symbol's summary data for each profile class
+ for (size_t p = lo; p <= hi; ++p)
+ xml_support->output_summary_data(str, cit->sample.counts, p);
+
+ if (cverb << vxml)
+ out << "<!-- 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 symname = symbol_names.name(cit->name);
+ assert(symname.size() > 0);
+
+ string const symqname = module + ":" + symname;
+
+ // Find any self references and handle
+ if ((symname == selfname) && (tag == CALLEES)) {
+ self = true;
+ indx = xml_get_symbol_index(qname);
+ } else {
+ indx = xml_get_symbol_index(symqname);
+ }
+
+ out << init_attr(ID_REF, indx);
+
+ if (self)
+ out << init_attr(SELFREF, "true");
+
+ out << close_element(NONE, true);
+ out << str.str();
+ out << close_element(SYMBOL);
+
+ if (is_module)
+ out << close_element(MODULE);
+ }
+}
+
+
+void xml_cg_formatter::
+output_symbol(ostream & out,
+ symbol_entry const * symb, size_t lo, size_t hi, bool is_module)
+{
+ cg_symbol const * cg_symb = dynamic_cast<cg_symbol const *>(symb);
+ ostringstream str;
+ size_t indx;
+
+ // output symbol's summary data for each profile class
+ for (size_t p = lo; p <= hi; ++p)
+ xml_support->output_summary_data(str, symb->sample.counts, p);
+
+ if (cverb << vxml)
+ out << "<!-- symbol_ref=" << symbol_names.name(symb->name) <<
+ " -->" << endl;
+
+ out << open_element(SYMBOL, true);
+
+ string const name = symbol_names.name(symb->name);
+ assert(name.size() > 0);
+
+ string const image = get_image_name(symb->image_name,
+ image_name_storage::int_filename, extra_found_images);
+ string const qname = image + ":" + name;
+
+ string const selfname = symbol_names.demangle(symb->name) + " [self]";
+
+ indx = xml_get_symbol_index(qname);
+
+ out << init_attr(ID_REF, indx);
+
+ out << close_element(NONE, true);
+
+ out << open_element(CALLERS);
+ if (cg_symb)
+ output_symbol_core(out, cg_symb->callers, selfname, qname, lo, hi, is_module, CALLERS);
+ out << close_element(CALLERS);
+
+ out << open_element(CALLEES);
+ if (cg_symb)
+ output_symbol_core(out, cg_symb->callees, selfname, qname, lo, hi, is_module, CALLEES);
+
+ out << close_element(CALLEES);
+
+ // output summary
+ out << str.str();
+ out << close_element(SYMBOL);
+}
+
+} // namespace format_output
diff --git a/libpp/format_output.h b/libpp/format_output.h
new file mode 100644
index 0000000..b6c4592
--- /dev/null
+++ b/libpp/format_output.h
@@ -0,0 +1,324 @@
+/**
+ * @file format_output.h
+ * outputting format for symbol lists
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#ifndef FORMAT_OUTPUT_H
+#define FORMAT_OUTPUT_H
+
+#include "config.h"
+
+#include <string>
+#include <map>
+#include <iosfwd>
+
+#include "format_flags.h"
+#include "symbol.h"
+#include "string_filter.h"
+#include "xml_output.h"
+
+class symbol_entry;
+class sample_entry;
+class callgraph_container;
+class profile_container;
+class diff_container;
+class extra_images;
+class op_bfd;
+
+struct profile_classes;
+// FIXME: should be passed to the derived class formatter ctor
+extern profile_classes classes;
+
+namespace format_output {
+
+/// base class for formatter, handle common options to formatter
+class formatter {
+public:
+ formatter(extra_images const & extra);
+ virtual ~formatter();
+
+ /// add a given column
+ void add_format(format_flags flag);
+
+ /// set the need_header boolean to false
+ void show_header(bool);
+ /// format for 64 bit wide VMAs
+ void vma_format_64bit(bool);
+ /// show long (full path) filenames
+ void show_long_filenames(bool);
+ /// use global count rather symbol count for details percent
+ void show_global_percent(bool);
+
+ /**
+ * Set the number of collected profile classes. Each class
+ * will output sample count and percentage in extra columns.
+ *
+ * This class assumes that the profile information has been
+ * populated with the right number of classes.
+ */
+ void set_nr_classes(size_t nr_classes);
+
+ /// output table header, implemented by calling the virtual function
+ /// output_header_field()
+ void output_header(std::ostream & out);
+
+protected:
+ struct counts_t {
+ /// total sample count
+ count_array_t total;
+ /// samples so far
+ count_array_t cumulated_samples;
+ /// percentage so far
+ count_array_t cumulated_percent;
+ /// detailed percentage so far
+ count_array_t cumulated_percent_details;
+ };
+
+ /// data passed for output
+ struct field_datum {
+ field_datum(symbol_entry const & sym,
+ sample_entry const & s,
+ size_t pc, counts_t & c,
+ extra_images const & extra, double d = 0.0)
+ : symbol(sym), sample(s), pclass(pc),
+ counts(c), extra(extra), diff(d) {}
+ symbol_entry const & symbol;
+ sample_entry const & sample;
+ size_t pclass;
+ mutable counts_t & counts;
+ extra_images const & extra;
+ double diff;
+ };
+
+ /// format callback type
+ typedef std::string (formatter::*fct_format)(field_datum const &);
+
+ /** @name format functions.
+ * The set of formatting functions, used internally by output().
+ */
+ //@{
+ std::string format_vma(field_datum const &);
+ std::string format_symb_name(field_datum const &);
+ std::string format_image_name(field_datum const &);
+ std::string format_app_name(field_datum const &);
+ std::string format_linenr_info(field_datum const &);
+ std::string format_nr_samples(field_datum const &);
+ std::string format_nr_cumulated_samples(field_datum const &);
+ std::string format_percent(field_datum const &);
+ std::string format_cumulated_percent(field_datum const &);
+ std::string format_percent_details(field_datum const &);
+ std::string format_cumulated_percent_details(field_datum const &);
+ std::string format_diff(field_datum const &);
+ //@}
+
+ /// decribe one field of the colummned output.
+ struct field_description {
+ field_description() {}
+ field_description(std::size_t w, std::string h,
+ fct_format f)
+ : width(w), header_name(h), formatter(f) {}
+
+ std::size_t width;
+ std::string header_name;
+ fct_format formatter;
+ };
+
+ typedef std::map<format_flags, field_description> format_map_t;
+
+ /// actually do output
+ void do_output(std::ostream & out, symbol_entry const & symbol,
+ sample_entry const & sample, counts_t & c,
+ diff_array_t const & = diff_array_t(),
+ bool hide_immutable_field = false);
+
+ /// returns the nr of char needed to pad this field
+ size_t output_header_field(std::ostream & out, format_flags fl,
+ size_t padding);
+
+ /// returns the nr of char needed to pad this field
+ size_t output_field(std::ostream & out, field_datum const & datum,
+ format_flags fl, size_t padding,
+ bool hide_immutable);
+
+ /// stores functors for doing actual formatting
+ format_map_t format_map;
+
+ /// number of profile classes
+ size_t nr_classes;
+
+ /// total counts
+ counts_t counts;
+
+ /// formatting flags set
+ format_flags flags;
+ /// true if we need to format as 64 bits quantities
+ bool vma_64;
+ /// false if we use basename(filename) in output rather filename
+ bool long_filenames;
+ /// true if we need to show header before the first output
+ bool need_header;
+ /// bool if details percentage are relative to total count rather to
+ /// symbol count
+ bool global_percent;
+
+ /// To retrieve the real image location, usefull when acting on
+ /// an archive and for 2.6 kernel modules
+ extra_images const & extra_found_images;
+};
+
+
+/// class to output in a columned format symbols and associated samples
+class opreport_formatter : public formatter {
+public:
+ /// build a ready to use formatter
+ opreport_formatter(profile_container const & profile);
+
+ /** output a vector of symbols to out according to the output format
+ * specifier previously set by call(s) to add_format() */
+ void output(std::ostream & out, symbol_collection const & syms);
+
+ /// set the output_details boolean
+ void show_details(bool);
+
+private:
+
+ /** output one symbol symb to out according to the output format
+ * specifier previously set by call(s) to add_format() */
+ void output(std::ostream & out, symbol_entry const * symb);
+
+ /// output details for the symbol
+ void output_details(std::ostream & out, symbol_entry const * symb);
+
+ /// container we work from
+ profile_container const & profile;
+
+ /// true if we need to show details for each symbols
+ bool need_details;
+};
+
+
+/// class to output in a columned format caller/callee and associated samples
+class cg_formatter : public formatter {
+public:
+ /// build a ready to use formatter
+ cg_formatter(callgraph_container const & profile);
+
+ /** output callgraph information according to the previously format
+ * specifier set by call(s) to add_format() */
+ void output(std::ostream & out, symbol_collection const & syms);
+};
+
+/// class to output a columned format symbols plus diff values
+class diff_formatter : public formatter {
+public:
+ /// build a ready to use formatter
+ diff_formatter(diff_container const & profile,
+ extra_images const & extra);
+
+ /**
+ * Output a vector of symbols to out according to the output
+ * format specifier previously set by call(s) to add_format()
+ */
+ void output(std::ostream & out, diff_collection const & syms);
+
+private:
+ /// output a single symbol
+ void output(std::ostream & out, diff_symbol const & sym);
+
+};
+
+
+/// class to output in XML format
+class xml_formatter : public formatter {
+public:
+ /// build a ready to use formatter
+ xml_formatter(profile_container const * profile,
+ symbol_collection & symbols, extra_images const & extra,
+ string_filter const & symbol_filter);
+
+ // output body of XML output
+ void output(std::ostream & out);
+
+ /** 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,
+ bool is_module);
+
+ /// output details for the symbol
+ std::string output_symbol_details(symbol_entry const * symb,
+ size_t & detail_index, size_t const lo, size_t const hi);
+
+ /// set the output_details boolean
+ void show_details(bool);
+
+ // output SymbolData XML elements
+ void output_symbol_data(std::ostream & out);
+
+private:
+ /// container we work from
+ profile_container const * profile;
+
+ // ordered collection of symbols associated with this profile
+ symbol_collection & symbols;
+
+ /// true if we need to show details for each symbols
+ bool need_details;
+
+ // count of DetailData items output so far
+ size_t detail_count;
+
+ /// with --details we need to reopen the bfd object for each symb to
+ /// get it's contents, hence we store the filter used by the bfd ctor.
+ string_filter const & symbol_filter;
+
+ void output_sample_data(std::ostream & out,
+ sample_entry const & sample, size_t count);
+
+ /// output attribute in XML
+ void output_attribute(std::ostream & out, field_datum const & datum,
+ format_flags fl, tag_t tag);
+
+ /// Retrieve a bfd object for this symbol, reopening a new bfd object
+ /// only if necessary
+ bool get_bfd_object(symbol_entry const * symb, op_bfd * & abfd) const;
+
+ void output_the_symbol_data(std::ostream & out,
+ symbol_entry const * symb, op_bfd * & abfd);
+
+ void output_cg_children(std::ostream & out,
+ cg_symbol::children const cg_symb, op_bfd * & abfd);
+};
+
+// callgraph XML output version
+class xml_cg_formatter : public xml_formatter {
+public:
+ /// build a ready to use formatter
+ xml_cg_formatter(callgraph_container const & callgraph,
+ symbol_collection & symbols, string_filter const & sf);
+
+ /** 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, bool is_module);
+
+private:
+ /// container we work from
+ callgraph_container const & callgraph;
+
+ void output_symbol_core(std::ostream & out,
+ cg_symbol::children const cg_symb,
+ std::string const selfname, std::string const qname,
+ size_t lo, size_t hi, bool is_module, tag_t tag);
+};
+
+} // namespace format_output
+
+
+#endif /* !FORMAT_OUTPUT_H */
diff --git a/libpp/image_errors.cpp b/libpp/image_errors.cpp
new file mode 100644
index 0000000..09d211e
--- /dev/null
+++ b/libpp/image_errors.cpp
@@ -0,0 +1,87 @@
+/**
+ * @file image_errors.cpp
+ * Report errors in images
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ */
+
+#include "image_errors.h"
+
+#include "arrange_profiles.h"
+#include "string_manip.h"
+#include "locate_images.h"
+
+#include <iostream>
+#include <set>
+
+using namespace std;
+
+namespace {
+
+set<string> reported_images_error;
+
+}
+
+void report_image_error(string const & image, image_error error, bool fatal,
+ extra_images const & extra)
+{
+ if (error == image_ok)
+ return;
+
+ string image_name = extra.get_archive_path() + image;
+
+ if (reported_images_error.find(image_name) ==
+ reported_images_error.end()) {
+ reported_images_error.insert(image_name);
+
+ // FIXME: hacky
+ if (error == image_not_found && is_prefix(image, "anon "))
+ return;
+
+ cerr << (fatal ? "error: " : "warning: ");
+ cerr << image_name << ' ';
+
+ switch (error) {
+ case image_not_found:
+ cerr << "could not be found.\n";
+ break;
+
+ case image_unreadable:
+ cerr << "could not be read.\n";
+ break;
+
+ case image_multiple_match:
+ cerr << "matches more than one file: "
+ "detailed profile will not be provided.\n";
+ break;
+
+ case image_format_failure:
+ cerr << "is not in a usable binary format.\n";
+ break;
+
+ case image_ok:
+ break;
+ }
+ }
+}
+
+
+void report_image_error(inverted_profile const & profile, bool fatal,
+ extra_images const & extra)
+{
+ report_image_error(profile.image, profile.error, fatal, extra);
+}
+
+
+void report_image_errors(list<inverted_profile> const & plist,
+ extra_images const & extra)
+{
+ list<inverted_profile>::const_iterator it = plist.begin();
+ list<inverted_profile>::const_iterator const end = plist.end();
+
+ for (; it != end; ++it)
+ report_image_error(*it, false, extra);
+}
diff --git a/libpp/image_errors.h b/libpp/image_errors.h
new file mode 100644
index 0000000..4aa697c
--- /dev/null
+++ b/libpp/image_errors.h
@@ -0,0 +1,43 @@
+/**
+ * @file image_errors.h
+ * Report errors in images
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ */
+
+#ifndef IMAGE_ERRORS_H
+#define IMAGE_ERRORS_H
+
+#include <list>
+#include <string>
+
+class inverted_profile;
+class extra_images;
+
+/// possible reasons why we can't read a binary image
+enum image_error {
+ image_ok = 0,
+ image_not_found,
+ image_unreadable,
+ image_format_failure,
+ image_multiple_match
+};
+
+/// output why the image passed can't be read to stderr, we warranty only one
+/// error report by image name.
+void
+report_image_error(std::string const & image, image_error error, bool fatal,
+ extra_images const & extra);
+
+/// output why the image passed can't be read to stderr
+void report_image_error(inverted_profile const & profile, bool fatal,
+ extra_images const & extra);
+
+/// output why any bad images can't be read to stderr
+void report_image_errors(std::list<inverted_profile> const & plist,
+ extra_images const & extra);
+
+#endif /* IMAGE_ERRORS_H */
diff --git a/libpp/locate_images.cpp b/libpp/locate_images.cpp
new file mode 100644
index 0000000..426adfd
--- /dev/null
+++ b/libpp/locate_images.cpp
@@ -0,0 +1,225 @@
+/**
+ * @file locate_images.cpp
+ * Command-line helper
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#include "file_manip.h"
+#include "locate_images.h"
+#include "string_manip.h"
+
+#include <cerrno>
+#include <iostream>
+#include <sstream>
+#include <cstdlib>
+
+using namespace std;
+
+
+int extra_images::suid;
+
+extra_images::extra_images()
+ :
+ uid(++suid)
+{
+}
+
+
+void extra_images::populate(vector<string> const & paths,
+ string const & prefix_path)
+{
+ vector<string>::const_iterator cit = paths.begin();
+ vector<string>::const_iterator end = paths.end();
+ for (; cit != end; ++cit) {
+ string const path = op_realpath(prefix_path + *cit);
+ list<string> file_list;
+ create_file_list(file_list, path, "*", true);
+ list<string>::const_iterator lit = file_list.begin();
+ list<string>::const_iterator lend = file_list.end();
+ for (; lit != lend; ++lit) {
+ value_type v(op_basename(*lit), op_dirname(*lit));
+ images.insert(v);
+ }
+ }
+}
+
+
+void extra_images::populate(vector<string> const & paths,
+ string const & archive_path_,
+ string const & root_path_)
+{
+ archive_path = archive_path_;
+ if (!archive_path.empty())
+ archive_path = op_realpath(archive_path);
+
+ root_path = op_realpath(root_path_);
+ if (!root_path.empty())
+ root_path = op_realpath(root_path);
+
+ if (root_path.empty() && archive_path.empty())
+ populate(paths, "");
+ if (!archive_path.empty())
+ populate(paths, archive_path);
+ if (!root_path.empty() && root_path != archive_path)
+ populate(paths, root_path);
+}
+
+
+vector<string> const extra_images::find(string const & name) const
+{
+ extra_images::matcher match(name);
+ return find(match);
+}
+
+
+vector<string> const
+extra_images::find(extra_images::matcher const & match) const
+{
+ vector<string> matches;
+
+ const_iterator cit = images.begin();
+ const_iterator end = images.end();
+
+ for (; cit != end; ++cit) {
+ if (match(cit->first))
+ matches.push_back(cit->second + '/' + cit->first);
+ }
+
+ return matches;
+}
+
+
+namespace {
+
+/**
+ * Function object for matching a module filename, which
+ * has its own special mangling rules in 2.6 kernels.
+ */
+struct module_matcher : public extra_images::matcher {
+public:
+ explicit module_matcher(string const & s)
+ : extra_images::matcher(s) {}
+
+ virtual bool operator()(string const & candidate) const {
+ if (candidate.length() != value.length())
+ return false;
+
+ for (string::size_type i = 0 ; i < value.length() ; ++i) {
+ if (value[i] == candidate[i])
+ continue;
+ if (value[i] == '_' &&
+ (candidate[i] == ',' || candidate[i] == '-'))
+ continue;
+ return false;
+ }
+
+ return true;
+ }
+};
+
+} // anon namespace
+
+string const extra_images::locate_image(string const & image_name,
+ image_error & error, bool fixup) const
+{
+ // Skip search since root_path can be non empty and we want
+ // to lookup only in root_path in this case.
+ if (!archive_path.empty()) {
+ string image = op_realpath(archive_path + image_name);
+ if (op_file_readable(image)) {
+ error = image_ok;
+ return fixup ? image : image_name;
+ }
+
+ if (errno == EACCES) {
+ error = image_unreadable;
+ return image_name;
+ }
+ }
+
+ // We catch a case where root_path.empty() since we skipped a
+ // search in "/" above when archive_path is empty. The case where
+ // root_path.empty() && archive_path.empty() is the normal one, none
+ // of --root or archive: as been given on command line.
+ if (!root_path.empty() || archive_path.empty()) {
+ string image = op_realpath(root_path + image_name);
+ if (op_file_readable(image)) {
+ error = image_ok;
+ return fixup ? image : image_name;
+ }
+ }
+
+ error = image_not_found;
+ return image_name;
+}
+
+string const extra_images::find_image_path(string const & image_name,
+ image_error & error, bool fixup) const
+{
+ error = image_ok;
+
+ string const image = locate_image(image_name, error, fixup);
+ if (error != image_not_found)
+ return image;
+
+ string const base = op_basename(image);
+
+ vector<string> result = find(base);
+
+ // not found, try a module search
+ if (result.empty())
+ result = find(module_matcher(base + ".ko"));
+
+ if (result.empty()) {
+ error = image_not_found;
+ return image_name;
+ }
+
+ if (result.size() == 1) {
+ error = image_ok;
+ return fixup ? result[0] : image_name;
+ }
+
+ // We can't get multiple result except if only one result is prefixed
+ // by archive_path or by root_path.
+ size_t count = 0;
+ size_t index = 0;
+ for (size_t i = 0; i < result.size() && count < 2; ++i) {
+ if (is_prefix(result[i], archive_path)) {
+ index = i;
+ ++count;
+ }
+ }
+
+ if (count == 0) {
+ for (size_t i = 0; i < result.size() && count < 2; ++i) {
+ if (is_prefix(result[i], root_path)) {
+ index = i;
+ ++count;
+ }
+ }
+ }
+
+ if (count == 1) {
+ error = image_ok;
+ return fixup ? result[index] : image_name;
+ }
+
+ error = image_multiple_match;
+ return image_name;
+}
+
+
+string extra_images::strip_path_prefix(string const & image) const
+{
+ if (archive_path.length() && is_prefix(image, archive_path))
+ return image.substr(archive_path.size());
+ if (root_path.length() && is_prefix(image, root_path))
+ return image.substr(root_path.size());
+ return image;
+}
diff --git a/libpp/locate_images.h b/libpp/locate_images.h
new file mode 100644
index 0000000..ac72989
--- /dev/null
+++ b/libpp/locate_images.h
@@ -0,0 +1,107 @@
+/**
+ * @file locate_images.h
+ * Location of binary images
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#ifndef LOCATE_IMAGES_H
+#define LOCATE_IMAGES_H
+
+#include <string>
+#include <map>
+#include <vector>
+
+#include "image_errors.h"
+
+/**
+ * A class containing mappings from an image basename,
+ * such as 'floppy.ko', to locations in the paths passed
+ * in to populate().
+ *
+ * The name may exist multiple times; all locations are recorded
+ * in this container.
+ */
+class extra_images {
+public:
+ extra_images();
+
+ /// add all filenames found in the given paths prefixed by the
+ /// archive path or the root path, recursively
+ void populate(std::vector<std::string> const & paths,
+ std::string const & archive_path,
+ std::string const & root_path);
+
+ /// base class for matcher functors object
+ struct matcher {
+ std::string const & value;
+ public:
+ explicit matcher(std::string const & v) : value(v) {}
+ virtual ~matcher() {}
+ /// default functor allowing trivial match
+ virtual bool operator()(std::string const & str) const {
+ return str == value;
+ }
+ };
+
+ /**
+ * return a vector of all directories that match the functor
+ */
+ std::vector<std::string> const find(matcher const & match) const;
+
+ /// return a vector of all directories that match the given name
+ std::vector<std::string> const find(std::string const & name) const;
+
+ /**
+ * @param image_name binary image name
+ * @param error errors are flagged in this passed enum ref
+ * @param fixup if true return the fixed image name else always return
+ * image_name and update error
+ *
+ * Locate a (number of) matching absolute paths to the given image
+ * name. If we fail to find the file we fill in error and return the
+ * original string.
+ */
+ std::string const find_image_path(std::string const & image_name,
+ image_error & error, bool fixup) const;
+
+ /// return the archive path used to populate the images name map
+ std::string get_archive_path() const { return archive_path; }
+
+ /// Given an image name returned by find_image_path() return
+ /// a filename with the archive_path or root_path stripped.
+ std::string strip_path_prefix(std::string const & image) const;
+
+ /// return the uid for this extra_images, first valid uid is 1
+ int get_uid() const { return uid; }
+
+private:
+ void populate(std::vector<std::string> const & paths,
+ std::string const & prefix_path);
+
+ std::string const locate_image(std::string const & image_name,
+ image_error & error, bool fixup) const;
+
+ typedef std::multimap<std::string, std::string> images_t;
+ typedef images_t::value_type value_type;
+ typedef images_t::const_iterator const_iterator;
+
+ /// map from image basename to owning directory
+ images_t images;
+ /// the archive path passed to populate the images name map.
+ std::string archive_path;
+ /// A prefix added to locate binaries if they can't be found
+ /// through the archive path
+ std::string root_path;
+
+ /// unique identifier, first valid uid is 1
+ int uid;
+ /// unique uid generator
+ static int suid;
+};
+
+#endif /* LOCATE_IMAGES_H */
diff --git a/libpp/name_storage.cpp b/libpp/name_storage.cpp
new file mode 100644
index 0000000..3664573
--- /dev/null
+++ b/libpp/name_storage.cpp
@@ -0,0 +1,102 @@
+/**
+ * @file name_storage.cpp
+ * Storage of global names (filenames and symbols)
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#include "name_storage.h"
+#include "demangle_symbol.h"
+#include "file_manip.h"
+#include "string_manip.h"
+#include "locate_images.h"
+#include "op_exception.h"
+
+using namespace std;
+
+image_name_storage image_names;
+debug_name_storage debug_names;
+symbol_name_storage symbol_names;
+
+
+string const & image_name_storage::basename(image_name_id id) const
+{
+ stored_filename const & n = get(id);
+ if (n.base_filename.empty())
+ n.base_filename = op_basename(n.filename);
+ return n.base_filename;
+}
+
+
+string const & image_name_storage::get_name(image_name_id id,
+ image_name_type type,
+ extra_images const & extra) const
+{
+ stored_filename const & n = get(id);
+ if (type == int_filename) {
+ return n.filename;
+ } else if (type == int_basename) {
+ return basename(id);
+ } else if (type == int_real_basename) {
+ if (n.extra_images_uid == 0) {
+ // recursive call to init real_filename.
+ get_name(id, int_real_filename, extra);
+ n.real_base_filename = op_basename(n.real_filename);
+ }
+ return n.real_base_filename;
+ } else if (type == int_real_filename) {
+ if (n.extra_images_uid == 0) {
+ // We ignore error here, the real path will be
+ // identical to the name derived from the sample
+ // filename in this case. FIXME: this mean than the
+ // archive path will be ignored if an error occur.
+ image_error error;
+ n.real_filename = extra.find_image_path(name(id),
+ error, true);
+ n.extra_images_uid = extra.get_uid();
+ }
+
+ if (n.extra_images_uid == extra.get_uid())
+ return n.real_filename;
+ throw op_runtime_error("image_name_storage::get_name() called"
+ " with different extra parameter");
+ }
+
+ throw op_runtime_error("invalid parameter to"
+ " image_name_storage;;get_name()");
+}
+
+
+string const & debug_name_storage::basename(debug_name_id id) const
+{
+ stored_name const & n = get(id);
+ if (n.name_processed.empty())
+ n.name_processed = op_basename(n.name);
+ return n.name_processed;
+}
+
+
+string const & symbol_name_storage::demangle(symbol_name_id id) const
+{
+ stored_name const & n = get(id);
+ if (!n.name_processed.empty() || n.name.empty())
+ return n.name_processed;
+
+ if (n.name[0] != '?') {
+ n.name_processed = demangle_symbol(n.name);
+ return n.name_processed;
+ }
+
+ if (n.name.length() < 2 || n.name[1] != '?') {
+ n.name_processed = "(no symbols)";
+ return n.name_processed;
+ }
+
+ n.name_processed = "anonymous symbol from section ";
+ n.name_processed += ltrim(n.name, "?");
+ return n.name_processed;
+}
diff --git a/libpp/name_storage.h b/libpp/name_storage.h
new file mode 100644
index 0000000..711fbe8
--- /dev/null
+++ b/libpp/name_storage.h
@@ -0,0 +1,159 @@
+/**
+ * @file name_storage.h
+ * Type-safe unique storage of global names (filenames and symbols)
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#ifndef NAME_STORAGE_H
+#define NAME_STORAGE_H
+
+#include <string>
+
+#include "unique_storage.h"
+
+class extra_images;
+
+/// store original name and processed name
+struct stored_name {
+ stored_name(std::string const & n = std::string())
+ : name(n) {}
+
+ bool operator<(stored_name const & rhs) const {
+ return name < rhs.name;
+ }
+
+ std::string name;
+ mutable std::string name_processed;
+};
+
+
+/// partial specialization for unique storage of names
+template <typename I> struct name_storage : unique_storage<I, stored_name> {
+
+ typedef typename unique_storage<I, stored_name>::id_value id_value;
+
+ std::string const & name(id_value const & id) const {
+ return unique_storage<I, stored_name>::get(id).name;
+ }
+};
+
+
+class debug_name_tag;
+/// a debug filename
+typedef name_storage<debug_name_tag>::id_value debug_name_id;
+
+/// class storing a set of shared debug name (source filename)
+struct debug_name_storage : name_storage<debug_name_tag> {
+ /// return the basename for the given ID
+ std::string const & basename(debug_name_id id) const;
+};
+
+/// store original name and processed name
+struct stored_filename {
+ stored_filename(std::string const & n = std::string())
+ : filename(n), extra_images_uid(0) {}
+
+ bool operator<(stored_filename const & rhs) const {
+ return filename < rhs.filename;
+ }
+
+ std::string filename;
+ mutable std::string base_filename;
+ mutable std::string real_filename;
+ mutable std::string real_base_filename;
+ mutable int extra_images_uid;
+};
+
+/// partial specialization for unique storage of filenames
+template <typename I>
+struct filename_storage : unique_storage<I, stored_filename> {
+
+ typedef typename unique_storage<I, stored_filename>::id_value id_value;
+
+ std::string const & name(id_value const & id) const {
+ return unique_storage<I, stored_filename>::get(id).filename;
+ }
+};
+
+class image_name_tag;
+/// an image name
+typedef filename_storage<image_name_tag>::id_value image_name_id;
+
+/// class storing a set of shared image name
+struct image_name_storage : filename_storage<image_name_tag> {
+ enum image_name_type {
+ /// image name based on the sample filename w/o path
+ int_basename,
+ /// image name based on the sample filename
+ int_filename,
+ /// real image name, can be different for module.
+ int_real_basename,
+ /// same as int_real_basename + the complete path, including an
+ /// optionnal archive_path passed trough profile_spec
+ int_real_filename,
+ };
+
+ /**
+ * @param id the image name id
+ * @param type the image name type
+ * @param extra extra locations where the image can be found
+ *
+ * If type == int_real_name (resp. int_real_filename) and the image
+ * can't be located the return value is the same as if get_name()
+ * was called with int_name (resp. int_filename).
+ *
+ * multiple call with the image_name_id and different extra parameter
+ * will throw a runtime error, multiple extra_images are possible
+ * with differential profile but the name. FIXME
+ */
+ std::string const & get_name(image_name_id id,
+ image_name_type type,
+ extra_images const & extra) const;
+
+ /// return the basename name for the given ID
+ std::string const & basename(image_name_id) const;
+};
+
+
+class symbol_name_tag;
+/// a (demangled) symbol
+typedef name_storage<symbol_name_tag>::id_value symbol_name_id;
+
+/// class storing a set of shared symbol name
+struct symbol_name_storage : name_storage<symbol_name_tag> {
+ /// return the demangled name for the given ID
+ std::string const & demangle(symbol_name_id id) const;
+};
+
+
+/// for images
+extern image_name_storage image_names;
+
+/// for debug filenames i.e. source filename
+extern debug_name_storage debug_names;
+
+/// for symbols
+extern symbol_name_storage symbol_names;
+
+
+/**
+ * debug name specialisation for comparison.
+ *
+ * We compare by name rather by id since what user will see are
+ * filename and when the criteria "samples count" give identical
+ * result it's better to obtain result sorted by the user visible
+ * property filename rather than by an obscure, invisible from user
+ * point of view, file identifier property
+ */
+template<> inline bool
+debug_name_id::operator<(debug_name_id const & rhs) const
+{
+ return debug_names.name(*this) < debug_names.name(rhs);
+}
+
+#endif /* !NAME_STORAGE_H */
diff --git a/libpp/op_header.cpp b/libpp/op_header.cpp
new file mode 100644
index 0000000..041a1e8
--- /dev/null
+++ b/libpp/op_header.cpp
@@ -0,0 +1,264 @@
+/**
+ * @file op_header.cpp
+ * various free function acting on a sample file header
+ *
+ * @remark Copyright 2004 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ * @Modifications Daniel Hansel
+ */
+
+#include <cstring>
+#include <iostream>
+#include <cstdlib>
+#include <iomanip>
+#include <set>
+#include <sstream>
+#include <cstring>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#include "op_config.h"
+#include "op_exception.h"
+#include "odb.h"
+#include "op_cpu_type.h"
+#include "op_file.h"
+#include "op_header.h"
+#include "op_events.h"
+#include "string_manip.h"
+#include "format_output.h"
+#include "xml_utils.h"
+#include "cverb.h"
+
+using namespace std;
+
+extern verbose vbfd;
+
+void op_check_header(opd_header const & h1, opd_header const & h2,
+ string const & filename)
+{
+ if (h1.mtime != h2.mtime) {
+ ostringstream os;
+ os << "header timestamps are different ("
+ << h1.mtime << ", " << h2.mtime << ") for "
+ << filename << "\n";
+ throw op_fatal_error(os.str());
+ }
+
+ if (h1.is_kernel != h2.is_kernel) {
+ ostringstream os;
+ os << "header is_kernel flags are different for "
+ << filename << "\n";
+ throw op_fatal_error(os.str());
+ }
+
+ // Note that in the generated ELF file for anonymous code the vma
+ // of the symbol is exaclty the same vma as the code had during sampling.
+
+ // Note that we don't check CPU speed since that can vary
+ // freely on the same machine
+}
+
+
+namespace {
+
+set<string> warned_files;
+
+}
+
+bool is_jit_sample(string const & filename)
+{
+ // suffix for JIT sample files (see FIXME in check_mtime() below)
+ string suf = ".jo";
+
+ string::size_type pos;
+ pos = filename.rfind(suf);
+ // for JIT sample files do not output the warning to stderr.
+ if (pos != string::npos && pos == filename.size() - suf.size())
+ return true;
+ else
+ return false;
+}
+
+void check_mtime(string const & file, opd_header const & header)
+{
+ time_t const newmtime = op_get_mtime(file.c_str());
+
+ if (newmtime == header.mtime)
+ return;
+
+ if (warned_files.find(file) != warned_files.end())
+ return;
+
+ warned_files.insert(file);
+
+ // Files we couldn't get mtime of have zero mtime
+ if (!header.mtime) {
+ // FIXME: header.mtime for JIT sample files is 0. The problem could be that
+ // in opd_mangling.c:opd_open_sample_file() the call of fill_header()
+ // think that the JIT sample file is not a binary file.
+ if (is_jit_sample(file)) {
+ cverb << vbfd << "warning: could not check that the binary file "
+ << file << " has not been modified since "
+ "the profile was taken. Results may be inaccurate.\n";
+ } else {
+ cerr << "warning: could not check that the binary file "
+ << file << " has not been modified since "
+ "the profile was taken. Results may be inaccurate.\n";
+ }
+ } else {
+ static bool warned_already = false;
+
+ cerr << "warning: the last modified time of the binary file "
+ "does not match that of the sample file for " << file
+ << "\n";
+
+ if (!warned_already) {
+ cerr << "Either this is the wrong binary or the binary "
+ "has been modified since the sample file was created.\n";
+ warned_already = true;
+ }
+ }
+}
+
+
+opd_header const read_header(string const & sample_filename)
+{
+ int fd = open(sample_filename.c_str(), O_RDONLY);
+ if (fd < 0)
+ throw op_fatal_error("Can't open sample file:" +
+ sample_filename);
+
+ opd_header header;
+ if (read(fd, &header, sizeof(header)) != sizeof(header)) {
+ close(fd);
+ throw op_fatal_error("Can't read sample file header:" +
+ sample_filename);
+ }
+
+ if (memcmp(header.magic, OPD_MAGIC, sizeof(header.magic))) {
+ throw op_fatal_error("Invalid sample file, "
+ "bad magic number: " +
+ sample_filename);
+ close(fd);
+ }
+
+ close(fd);
+
+ return header;
+}
+
+
+namespace {
+
+string const op_print_event(op_cpu cpu_type, u32 type, u32 um, u32 count)
+{
+ string str;
+
+ if (cpu_type == CPU_TIMER_INT) {
+ str += "Profiling through timer interrupt";
+ return str;
+ }
+
+ struct op_event * event = op_find_event(cpu_type, type, um);
+
+ if (!event) {
+ event = op_find_event_any(cpu_type, type);
+ if (!event) {
+ cerr << "Could not locate event " << int(type) << endl;
+ str = "Unknown event";
+ return str;
+ }
+ }
+
+ char const * um_desc = 0;
+
+ for (size_t i = 0; i < event->unit->num; ++i) {
+ if (event->unit->um[i].value == um)
+ um_desc = event->unit->um[i].desc;
+ }
+
+ str += string("Counted ") + event->name;
+ str += string(" events (") + event->desc + ")";
+
+ if (cpu_type != CPU_RTC) {
+ str += " with a unit mask of 0x";
+
+ ostringstream ss;
+ ss << hex << setw(2) << setfill('0') << unsigned(um);
+ str += ss.str();
+
+ str += " (";
+ str += um_desc ? um_desc : "multiple flags";
+ str += ")";
+ }
+
+ str += " count " + op_lexical_cast<string>(count);
+ return str;
+}
+
+string const op_xml_print_event(op_cpu cpu_type, u32 type, u32 um, u32 count)
+{
+ string unit_mask;
+
+ if (cpu_type == CPU_TIMER_INT || cpu_type == CPU_RTC)
+ return xml_utils::get_timer_setup((size_t)count);
+
+ struct op_event * event = op_find_event(cpu_type, type, um);
+ if (!event) {
+ event = op_find_event_any(cpu_type, type);
+ if (!event) {
+ cerr << "Could not locate event " << int(type) << endl;
+ return "";
+ }
+ }
+
+ if (cpu_type != CPU_RTC) {
+ ostringstream str_out;
+ str_out << um;
+ unit_mask = str_out.str();
+ }
+
+ return xml_utils::get_event_setup(string(event->name),
+ (size_t)count, unit_mask);
+}
+
+}
+
+string const describe_header(opd_header const & header)
+{
+ op_cpu cpu = static_cast<op_cpu>(header.cpu_type);
+
+ if (want_xml)
+ return op_xml_print_event(cpu, header.ctr_event,
+ header.ctr_um, header.ctr_count);
+ else
+ return op_print_event(cpu, header.ctr_event,
+ header.ctr_um, header.ctr_count);
+}
+
+
+string const describe_cpu(opd_header const & header)
+{
+ op_cpu cpu = static_cast<op_cpu>(header.cpu_type);
+
+ string str;
+ if (want_xml) {
+ string cpu_name = op_get_cpu_name(cpu);
+
+ str = xml_utils::get_profile_header(cpu_name, header.cpu_speed);
+ } else {
+ str += string("CPU: ") + op_get_cpu_type_str(cpu);
+ str += ", speed ";
+
+ ostringstream ss;
+ ss << header.cpu_speed;
+ str += ss.str() + " MHz (estimated)";
+ }
+ return str;
+}
diff --git a/libpp/op_header.h b/libpp/op_header.h
new file mode 100644
index 0000000..b0fc48f
--- /dev/null
+++ b/libpp/op_header.h
@@ -0,0 +1,56 @@
+/**
+ * @file op_header.h
+ * various free function acting on a sample file header
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#ifndef OP_HEADER_H
+#define OP_HEADER_H
+
+#include <iosfwd>
+#include <string>
+
+#include "op_sample_file.h"
+
+/**
+ * @param h1 sample file header
+ * @param h2 sample file header
+ * @param filename sample filename
+ *
+ * check that the h1 and h2 are coherent (same size, same mtime etc.)
+ * all error are fatal
+ */
+void op_check_header(opd_header const & h1, opd_header const & h2,
+ std::string const & filename);
+
+bool is_jit_sample(std::string const & filename);
+
+/**
+ * check mtime of samples file header against file
+ * all error are fatal
+ */
+void check_mtime(std::string const & file, opd_header const & header);
+
+/**
+ * @param sample_filename the sample to open
+ *
+ * Return the header of this sample file. Only the magic number is checked
+ * the version number is not checked. All error are fatal
+ */
+opd_header const read_header(std::string const & sample_filename);
+
+/**
+ * output a readable form of header, this don't include the cpu type
+ * and speed
+ */
+std::string const describe_header(opd_header const & header);
+
+/// output a readable form of cpu type and speed
+std::string const describe_cpu(opd_header const & header);
+
+#endif // OP_HEADER_H
diff --git a/libpp/parse_filename.cpp b/libpp/parse_filename.cpp
new file mode 100644
index 0000000..65422cb
--- /dev/null
+++ b/libpp/parse_filename.cpp
@@ -0,0 +1,245 @@
+/**
+ * @file parse_filename.cpp
+ * Split a sample filename into its constituent parts
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ */
+
+#include <stdexcept>
+#include <vector>
+#include <string>
+#include <iostream>
+#include <sys/stat.h>
+
+#include "parse_filename.h"
+#include "file_manip.h"
+#include "string_manip.h"
+#include "locate_images.h"
+
+using namespace std;
+
+namespace {
+
+// PP:3.19 event_name.count.unitmask.tgid.tid.cpu
+parsed_filename parse_event_spec(string const & event_spec)
+{
+ typedef vector<string> parts_type;
+ typedef parts_type::size_type size_type;
+
+ size_type const nr_parts = 6;
+
+ parts_type parts = separate_token(event_spec, '.');
+
+ if (parts.size() != nr_parts) {
+ throw invalid_argument("parse_event_spec(): bad event specification: " + event_spec);
+ }
+
+ for (size_type i = 0; i < nr_parts ; ++i) {
+ if (parts[i].empty()) {
+ throw invalid_argument("parse_event_spec(): bad event specification: " + event_spec);
+ }
+ }
+
+ parsed_filename result;
+
+ size_type i = 0;
+ result.event = parts[i++];
+ result.count = parts[i++];
+ result.unitmask = parts[i++];
+ result.tgid = parts[i++];
+ result.tid = parts[i++];
+ result.cpu = parts[i++];
+
+ return result;
+}
+
+
+/**
+ * @param component path component
+ *
+ * remove from path_component all directory left to {root}, {kern} or {anon}
+ */
+void remove_base_dir(vector<string> & path)
+{
+ vector<string>::iterator it;
+ for (it = path.begin(); it != path.end(); ++it) {
+ if (*it == "{root}" || *it == "{kern}" || *it == "{anon}")
+ break;
+ }
+
+ path.erase(path.begin(), it);
+}
+
+
+/// Handle an anon region. Pretty print the details.
+/// The second argument is the anon portion of the path which will
+/// contain extra details such as the anon region name (unknown, vdso, heap etc.)
+string const parse_anon(string const & str, string const & str2)
+{
+ string name = str2;
+ // Get rid of "{anon:
+ name.erase(0, 6);
+ // Get rid of the trailing '}'
+ name.erase(name.size() - 1, 1);
+ vector<string> parts = separate_token(str, '.');
+ if (parts.size() != 3)
+ throw invalid_argument("parse_anon() invalid name: " + str);
+
+ string ret = name +" (tgid:";
+ ret += parts[0] + " range:" + parts[1] + "-" + parts[2] + ")";
+ return ret;
+}
+
+
+} // anonymous namespace
+
+
+/*
+ * valid filename are variations on:
+ *
+ * {kern}/name/event_spec
+ * {root}/path/to/bin/{dep}/{root}/path/to/bin/event_spec
+ * {root}/path/to/bin/{dep}/{anon:anon}/pid.start.end/event_spec
+ * {root}/path/to/bin/{dep}/{anon:[vdso]}/pid.start.end/event_spec
+ * {root}/path/to/bin/{dep}/{kern}/name/event_spec
+ * {root}/path/to/bin/{dep}/{root}/path/to/bin/{cg}/{root}/path/to/bin/event_spec
+
+ *
+ * where /name/ denote a unique path component
+ */
+parsed_filename parse_filename(string const & filename,
+ extra_images const & extra_found_images)
+{
+ struct stat st;
+
+ string::size_type pos = filename.find_last_of('/');
+ if (pos == string::npos) {
+ throw invalid_argument("parse_filename() invalid filename: " +
+ filename);
+ }
+ string event_spec = filename.substr(pos + 1);
+ string filename_spec = filename.substr(0, pos);
+
+ parsed_filename result = parse_event_spec(event_spec);
+
+ result.filename = filename;
+
+ vector<string> path = separate_token(filename_spec, '/');
+
+ remove_base_dir(path);
+
+ // pp_interface PP:3.19 to PP:3.23 path must start either with {root}
+ // or {kern} and we must found at least 2 component, remove_base_dir()
+ // return an empty path if {root} or {kern} are not found
+ if (path.size() < 2) {
+ throw invalid_argument("parse_filename() invalid filename: " +
+ filename);
+ }
+
+ size_t i;
+ for (i = 1 ; i < path.size() ; ++i) {
+ if (path[i] == "{dep}")
+ break;
+
+ result.image += "/" + path[i];
+ }
+
+ if (i == path.size()) {
+ throw invalid_argument("parse_filename() invalid filename: " +
+ filename);
+ }
+
+ // skip "{dep}"
+ ++i;
+
+ // PP:3.19 {dep}/ must be followed by {kern}/, {root}/ or {anon}/
+ if (path[i] != "{kern}" && path[i] != "{root}" &&
+ path[i].find("{anon", 0) != 0) {
+ throw invalid_argument("parse_filename() invalid filename: " +
+ filename);
+ }
+
+ bool anon = path[i].find("{anon:", 0) == 0;
+
+ // skip "{root}", "{kern}" or "{anon:.*}"
+ ++i;
+
+ for (; i < path.size(); ++i) {
+ if (path[i] == "{cg}")
+ break;
+
+ if (anon) {
+ pos = filename_spec.rfind('.');
+ pos = filename_spec.rfind('.', pos-1);
+ if (pos == string::npos) {
+ throw invalid_argument("parse_filename() pid.addr.addr name expected: " +
+ filename_spec);
+ }
+ string jitdump = filename_spec.substr(0, pos) + ".jo";
+ // if a jitdump file exists, we point to this file
+ if (!stat(jitdump.c_str(), &st)) {
+ // later code assumes an optional prefix path
+ // is stripped from the lib_image.
+ result.lib_image =
+ extra_found_images.strip_path_prefix(jitdump);
+ result.jit_dumpfile_exists = true;
+ } else {
+ result.lib_image = parse_anon(path[i], path[i - 1]);
+ }
+ i++;
+ break;
+ } else {
+ result.lib_image += "/" + path[i];
+ }
+ }
+
+ if (i == path.size())
+ return result;
+
+ // skip "{cg}"
+ ++i;
+ if (i == path.size() ||
+ (path[i] != "{kern}" && path[i] != "{root}" &&
+ path[i].find("{anon", 0) != 0)) {
+ throw invalid_argument("parse_filename() invalid filename: "
+ + filename);
+ }
+
+ // skip "{root}", "{kern}" or "{anon}"
+ anon = (path[i].find("{anon", 0) == 0);
+ ++i;
+
+ if (anon) {
+ result.cg_image = parse_anon(path[i], path[i - 1]);
+ i++;
+ } else {
+ for (; i < path.size(); ++i)
+ result.cg_image += "/" + path[i];
+ }
+
+ return result;
+}
+
+bool parsed_filename::profile_spec_equal(parsed_filename const & parsed)
+{
+ return event == parsed.event &&
+ count == parsed.count &&
+ unitmask == parsed.unitmask &&
+ tgid == parsed.tgid &&
+ tid == parsed.tid &&
+ cpu == parsed.tid;
+}
+
+ostream & operator<<(ostream & out, parsed_filename const & data)
+{
+ out << data.filename << endl;
+ out << data.image << " " << data.lib_image << " "
+ << data.event << " " << data.count << " "
+ << data.unitmask << " " << data.tgid << " "
+ << data.tid << " " << data.cpu << endl;
+
+ return out;
+}
diff --git a/libpp/parse_filename.h b/libpp/parse_filename.h
new file mode 100644
index 0000000..d024f9b
--- /dev/null
+++ b/libpp/parse_filename.h
@@ -0,0 +1,65 @@
+/**
+ * @file parse_filename.h
+ * Split a sample filename into its constituent parts
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ */
+
+#ifndef PARSE_FILENAME_H
+#define PARSE_FILENAME_H
+
+#include <string>
+
+class extra_images;
+
+/**
+ * a convenience class to store result of parse_filename()
+ */
+struct parsed_filename
+{
+ std::string image;
+ std::string lib_image;
+ /// destination image for call graph file, empty if this sample
+ /// file is not a callgraph file.
+ std::string cg_image;
+ std::string event;
+ std::string count;
+ std::string unitmask;
+ std::string tgid;
+ std::string tid;
+ std::string cpu;
+
+ /// return true if the profile specification are identical.
+ bool profile_spec_equal(parsed_filename const & parsed);
+
+ /**
+ * the original sample filename from which the
+ * above components are built
+ */
+ std::string filename;
+ bool jit_dumpfile_exists;
+};
+
+
+/// debugging helper
+std::ostream & operator<<(std::ostream &, parsed_filename const &);
+
+
+/**
+ * parse a sample filename
+ * @param filename in: a sample filename
+ * @param extra_found_images binary image location
+ *
+ * filename is split into constituent parts, the lib_image is optional
+ * and can be empty on successfull call. All other error are fatal.
+ * Filenames are encoded as according to PP:3.19 to PP:3.25
+ *
+ * all errors throw an std::invalid_argument exception
+ */
+parsed_filename parse_filename(std::string const & filename,
+ extra_images const & extra_found_images);
+
+#endif /* !PARSE_FILENAME_H */
diff --git a/libpp/populate.cpp b/libpp/populate.cpp
new file mode 100644
index 0000000..7183531
--- /dev/null
+++ b/libpp/populate.cpp
@@ -0,0 +1,110 @@
+/**
+ * @file populate.cpp
+ * Fill up a profile_container from inverted profiles
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ *
+ * Modified by Maynard Johnson <maynardj@us.ibm.com>
+ * (C) Copyright IBM Corporation 2007
+ */
+
+#include "profile.h"
+#include "profile_container.h"
+#include "arrange_profiles.h"
+#include "op_bfd.h"
+#include "op_header.h"
+#include "populate.h"
+#include "populate_for_spu.h"
+
+#include "image_errors.h"
+
+#include <iostream>
+
+using namespace std;
+
+namespace {
+
+/// load merged files for one set of sample files
+bool
+populate_from_files(profile_t & profile, op_bfd const & abfd,
+ list<profile_sample_files> const & files)
+{
+ list<profile_sample_files>::const_iterator it = files.begin();
+ list<profile_sample_files>::const_iterator const end = files.end();
+
+ bool found = false;
+ // we can't handle cg files here obviously
+ for (; it != end; ++it) {
+ // A bit ugly but we must accept silently empty sample filename
+ // since we can create a profile_sample_files for cg file only
+ // (i.e no sample to the binary)
+ if (!it->sample_filename.empty()) {
+ profile.add_sample_file(it->sample_filename);
+ profile.set_offset(abfd);
+ found = true;
+ }
+ }
+
+ return found;
+}
+
+} // anon namespace
+
+
+void
+populate_for_image(profile_container & samples, inverted_profile const & ip,
+ string_filter const & symbol_filter, bool * has_debug_info)
+{
+ if (is_spu_profile(ip)) {
+ populate_for_spu_image(samples, ip, symbol_filter,
+ has_debug_info);
+ return;
+ }
+
+ bool ok = ip.error == image_ok;
+ op_bfd abfd(ip.image, symbol_filter,
+ samples.extra_found_images, ok);
+ if (!ok && ip.error == image_ok)
+ ip.error = image_format_failure;
+
+ if (ip.error == image_format_failure)
+ report_image_error(ip, false, samples.extra_found_images);
+
+ opd_header header;
+
+ bool found = false;
+ for (size_t i = 0; i < ip.groups.size(); ++i) {
+ list<image_set>::const_iterator it
+ = ip.groups[i].begin();
+ list<image_set>::const_iterator const end
+ = ip.groups[i].end();
+
+ // we can only share a profile_t amongst each
+ // image_set's files - this is because it->app_image
+ // changes, and the .add() would mis-attribute
+ // to the wrong app_image otherwise
+ for (; it != end; ++it) {
+ profile_t profile;
+ if (populate_from_files(profile, abfd, it->files)) {
+ header = profile.get_header();
+ samples.add(profile, abfd, it->app_image, i);
+ found = true;
+ }
+ }
+ }
+
+ if (found == true && ip.error == image_ok) {
+ image_error error;
+ string filename =
+ samples.extra_found_images.find_image_path(
+ ip.image, error, true);
+ check_mtime(filename, header);
+ }
+
+ if (has_debug_info)
+ *has_debug_info = abfd.has_debug_info();
+}
diff --git a/libpp/populate.h b/libpp/populate.h
new file mode 100644
index 0000000..0f13e09
--- /dev/null
+++ b/libpp/populate.h
@@ -0,0 +1,25 @@
+/**
+ * @file populate.h
+ * Fill up a profile_container from inverted profiles
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#ifndef POPULATE_H
+#define POPULATE_H
+
+class profile_container;
+class inverted_profile;
+class string_filter;
+
+
+/// Load all sample file information for exactly one binary image.
+void
+populate_for_image(profile_container & samples, inverted_profile const & ip,
+ string_filter const & symbol_filter, bool * has_debug_info);
+
+#endif /* POPULATE_H */
diff --git a/libpp/populate_for_spu.cpp b/libpp/populate_for_spu.cpp
new file mode 100644
index 0000000..0f4606b
--- /dev/null
+++ b/libpp/populate_for_spu.cpp
@@ -0,0 +1,166 @@
+/**
+ * @file libpp/populate_for_spu.cpp
+ * Fill up a profile_container from inverted profiles for
+ * a Cell BE SPU profile
+ *
+ * @remark Copyright 2007 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Maynard Johnson
+ * (C) Copyright IBM Corporation 2007
+ */
+
+#include "profile.h"
+#include "profile_container.h"
+#include "arrange_profiles.h"
+#include "op_bfd.h"
+#include "op_header.h"
+#include "populate.h"
+#include "populate_for_spu.h"
+
+#include "image_errors.h"
+
+#include <iostream>
+
+using namespace std;
+
+namespace {
+
+static int spu_profile = unknown_profile;
+
+/*
+ * On Cell Broadband Engine, an application executing on an SPE may
+ * have been loaded from a separate SPU executable binary file or may
+ * have been loaded from an embedded section of a PPE application or
+ * shared library. In the embedded case, the embedding file may actually
+ * contain multiple SPU images, resulting in different SPU images being loaded
+ * onto different SPUs. Thus, the SPUs may be executing different code, even
+ * though the application of the parent PPE process is the same. Therefore,
+ * we must be sure to create a separate op_bfd object for each SPU. When doing
+ * so below, we examine header.embedded_offset. If embedded_offset is > 0, it's
+ * interpreted as the offset of an SPU image embedded in the containing file,
+ * so the filename to do the check_mtime on is the containing file, ip.image;
+ * otherwise, the filename to do the check_mtime on is the separate backing
+ * file of the SPU image, abfd->filename.
+ */
+void
+populate_spu_profile_from_files(list<profile_sample_files> const & files,
+ string const app_image,
+ profile_container & samples,
+ inverted_profile const & ip,
+ string_filter const & symbol_filter,
+ size_t ip_grp_num, bool * has_debug_info)
+{
+ string archive_path = samples.extra_found_images.get_archive_path();
+ bool ok = ip.error == image_ok;
+ op_bfd * abfd = NULL;
+ string fname_to_check;
+ list<profile_sample_files>::const_iterator it = files.begin();
+ list<profile_sample_files>::const_iterator const end = files.end();
+ for (; it != end; ++it) {
+ profile_t profile;
+ if (it->sample_filename.empty())
+ continue;
+
+ profile.add_sample_file(it->sample_filename);
+ opd_header header = profile.get_header();
+ if (header.embedded_offset) {
+ abfd = new op_bfd(header.embedded_offset,
+ ip.image,
+ symbol_filter,
+ samples.extra_found_images,
+ ok);
+ fname_to_check = ip.image;
+ } else {
+ abfd = new op_bfd(ip.image,
+ symbol_filter,
+ samples.extra_found_images,
+ ok);
+ fname_to_check = abfd->get_filename();
+ }
+ profile.set_offset(*abfd);
+ if (!ok && ip.error == image_ok)
+ ip.error = image_format_failure;
+
+ if (ip.error == image_format_failure)
+ report_image_error(ip, false,
+ samples.extra_found_images);
+
+ samples.add(profile, *abfd, app_image, ip_grp_num);
+ if (ip.error == image_ok) {
+ image_error error;
+ string filename =
+ samples.extra_found_images.find_image_path(
+ fname_to_check, error, true);
+ check_mtime(filename, profile.get_header());
+ }
+
+ if (has_debug_info && !*has_debug_info)
+ *has_debug_info = abfd->has_debug_info();
+ delete abfd;
+ }
+}
+} // anon namespace
+
+void
+populate_for_spu_image(profile_container & samples,
+ inverted_profile const & ip,
+ string_filter const & symbol_filter,
+ bool * has_debug_info)
+{
+
+ for (size_t i = 0; i < ip.groups.size(); ++i) {
+ list < image_set >::const_iterator it=
+ ip.groups[i].begin();
+ list < image_set >::const_iterator const end
+ = ip.groups[i].end();
+
+ for (; it != end; ++it)
+ populate_spu_profile_from_files(it->files,
+ it->app_image, samples, ip,
+ symbol_filter, i, has_debug_info);
+ }
+}
+
+bool is_spu_profile(inverted_profile const & ip)
+{
+ bool retval = false;
+ string sfname = "";
+ if (spu_profile != unknown_profile)
+ return spu_profile;
+
+ if (!ip.groups.size())
+ return false;
+
+ for (size_t i = 0; i < ip.groups.size(); ++i) {
+ list<image_set>::const_iterator grp_it
+ = ip.groups[i].begin();
+ list<image_set>::const_iterator const grp_end
+ = ip.groups[i].end();
+
+ for (; grp_it != grp_end; ++grp_it) {
+ list<profile_sample_files>::const_iterator sfiles_it =
+ grp_it->files.begin();
+ list<profile_sample_files>::const_iterator sfiles_end =
+ grp_it->files.end();
+ for (; sfiles_it != sfiles_end; ++sfiles_it) {
+ if (!sfiles_it->sample_filename.empty()) {
+ sfname = sfiles_it->sample_filename;
+ goto do_check;
+ }
+ }
+ }
+ }
+ goto out;
+
+do_check:
+ spu_profile = profile_t::is_spu_sample_file(sfname);
+
+ if (spu_profile == cell_spu_profile)
+ retval = true;
+
+out:
+ return retval;
+}
+
+
diff --git a/libpp/populate_for_spu.h b/libpp/populate_for_spu.h
new file mode 100644
index 0000000..ec48099
--- /dev/null
+++ b/libpp/populate_for_spu.h
@@ -0,0 +1,42 @@
+/**
+ * @file libpp/populate_for_spu.h
+ * Fill up a profile_container from inverted profiles for
+ * a Cell BE SPU profile
+ *
+ * @remark Copyright 2007 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Maynard Johnson
+ * (C) Copyright IBM Corporation 2007
+ */
+
+#ifndef POPULATE_FOR_SPU_H
+#define POPULATE_FOR_SPU_H
+
+class profile_container;
+class inverted_profile;
+class string_filter;
+
+/*
+ * When profiling SPUs on Cell Broadband Engine, all sample file
+ * headers get a flag set indicating "spu_profile". This function
+ * checks the first sample file for this indicator.
+ */
+bool is_spu_profile(inverted_profile const & ip);
+
+/*
+ * This is a special-purpose function for CELL BE SPU profiling.
+ * See populate_spu_profile_from_files prologue for more details.
+ */
+void populate_for_spu_image(profile_container & samples,
+ inverted_profile const & ip,
+ string_filter const & symbol_filter,
+ bool * has_debug_info);
+
+enum profile_type {
+ unknown_profile = -1,
+ normal_profile,
+ cell_spu_profile
+};
+
+#endif /* POPULATE_FOR_SPU_H */
diff --git a/libpp/profile.cpp b/libpp/profile.cpp
new file mode 100644
index 0000000..f117508
--- /dev/null
+++ b/libpp/profile.cpp
@@ -0,0 +1,187 @@
+/**
+ * @file profile.cpp
+ * Encapsulation for samples files over all profile classes
+ * belonging to the same binary image
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#include <unistd.h>
+#include <cstring>
+
+#include <iostream>
+#include <string>
+#include <sstream>
+#include <cstring>
+
+#include <cerrno>
+
+#include "op_exception.h"
+#include "op_header.h"
+#include "op_config.h"
+#include "op_sample_file.h"
+#include "profile.h"
+#include "op_bfd.h"
+#include "cverb.h"
+#include "populate_for_spu.h"
+
+using namespace std;
+
+profile_t::profile_t()
+ : start_offset(0)
+{
+}
+
+
+// static member
+count_type profile_t::sample_count(string const & filename)
+{
+ odb_t samples_db;
+
+ open_sample_file(filename, samples_db);
+
+ count_type count = 0;
+
+ odb_node_nr_t node_nr, pos;
+ odb_node_t * node = odb_get_iterator(&samples_db, &node_nr);
+ for (pos = 0; pos < node_nr; ++pos)
+ count += node[pos].value;
+
+ odb_close(&samples_db);
+
+ return count;
+}
+
+//static member
+enum profile_type profile_t::is_spu_sample_file(string const & filename)
+{
+ profile_type retval;
+ odb_t samples_db;
+ open_sample_file(filename, samples_db);
+ opd_header const & hdr =
+ *static_cast<opd_header *>(odb_get_data(&samples_db));
+ retval = hdr.spu_profile ? cell_spu_profile: normal_profile;
+ odb_close(&samples_db);
+ return retval;
+}
+
+//static member
+void profile_t::open_sample_file(string const & filename, odb_t & db)
+{
+ // Check first if the sample file version is ok else odb_open() can
+ // fail and the error message will be obscure.
+ opd_header head = read_header(filename);
+
+ if (head.version != OPD_VERSION) {
+ ostringstream os;
+ os << "oprofpp: samples files version mismatch, are you "
+ << "running a daemon and post-profile tools with version "
+ << "mismatch ?\n";
+ throw op_fatal_error(os.str());
+ }
+
+ int rc = odb_open(&db, filename.c_str(), ODB_RDONLY,
+ sizeof(struct opd_header));
+
+ if (rc)
+ throw op_fatal_error(filename + ": " + strerror(rc));
+}
+
+void profile_t::add_sample_file(string const & filename)
+{
+ odb_t samples_db;
+
+ open_sample_file(filename, samples_db);
+
+ opd_header const & head =
+ *static_cast<opd_header *>(odb_get_data(&samples_db));
+
+ // if we already read a sample file header pointer is non null
+ if (file_header.get())
+ op_check_header(head, *file_header, filename);
+ else
+ file_header.reset(new opd_header(head));
+
+ odb_node_nr_t node_nr, pos;
+ odb_node_t * node = odb_get_iterator(&samples_db, &node_nr);
+
+ for (pos = 0; pos < node_nr; ++pos) {
+ ordered_samples_t::iterator it =
+ ordered_samples.find(node[pos].key);
+ if (it != ordered_samples.end()) {
+ it->second += node[pos].value;
+ } else {
+ ordered_samples_t::value_type
+ val(node[pos].key, node[pos].value);
+ ordered_samples.insert(val);
+ }
+ }
+
+ odb_close(&samples_db);
+}
+
+
+void profile_t::set_offset(op_bfd const & abfd)
+{
+ // if no bfd file has been located for this samples file, we can't
+ // shift sample because abfd.get_symbol_range() return the whole
+ // address space and setting a non zero start_offset will overflow
+ // in get_symbol_range() caller.
+ if (abfd.valid()) {
+ opd_header const & header = get_header();
+ if (header.anon_start) {
+ start_offset = header.anon_start;
+ } else if (header.is_kernel) {
+ start_offset = abfd.get_start_offset(0);
+ }
+ }
+ cverb << (vdebug) << "start_offset is now " << start_offset << endl;
+}
+
+
+profile_t::iterator_pair
+profile_t::samples_range(odb_key_t start, odb_key_t end) const
+{
+ // Check the start position isn't before start_offset:
+ // this avoids wrapping/underflowing start/end.
+ // This can happen on e.g. ARM kernels, where .init is
+ // mapped before .text - we just have to skip any such
+ // .init symbols.
+ if (start < start_offset) {
+ return make_pair(const_iterator(ordered_samples.end(), 0),
+ const_iterator(ordered_samples.end(), 0));
+ }
+
+ start -= start_offset;
+ end -= start_offset;
+
+ // sanity check if start > end caller will enter into an infinite loop
+ if (start > end) {
+ throw op_fatal_error("profile_t::samples_range(): start > end"
+ " something wrong with kernel or module layout ?\n"
+ "please report problem to "
+ "oprofile-list@lists.sourceforge.net");
+ }
+
+ ordered_samples_t::const_iterator first =
+ ordered_samples.lower_bound(start);
+ ordered_samples_t::const_iterator last =
+ ordered_samples.lower_bound(end);
+
+ return make_pair(const_iterator(first, start_offset),
+ const_iterator(last, start_offset));
+}
+
+
+profile_t::iterator_pair profile_t::samples_range() const
+{
+ ordered_samples_t::const_iterator first = ordered_samples.begin();
+ ordered_samples_t::const_iterator last = ordered_samples.end();
+
+ return make_pair(const_iterator(first, start_offset),
+ const_iterator(last, start_offset));
+}
diff --git a/libpp/profile.h b/libpp/profile.h
new file mode 100644
index 0000000..163355d
--- /dev/null
+++ b/libpp/profile.h
@@ -0,0 +1,187 @@
+/**
+ * @file profile.h
+ * Encapsulation for samples files over all profile classes
+ * belonging to the same binary image
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#ifndef PROFILE_H
+#define PROFILE_H
+
+#include <string>
+#include <map>
+#include <iterator>
+
+#include "odb.h"
+#include "op_types.h"
+#include "utility.h"
+#include "populate_for_spu.h"
+
+class opd_header;
+class op_bfd;
+
+/**
+ * Class containing a single sample file contents.
+ * i.e. set of count values for VMA offsets for
+ * a particular binary.
+ */
+class profile_t : noncopyable {
+public:
+ /**
+ * profile_t - construct an empty profile_t object
+ */
+ profile_t();
+
+ /// return true if no sample file has been loaded
+ bool empty() const { return !file_header.get(); }
+
+ /// return the header of the last opened samples file
+ opd_header const & get_header() const {
+ return *file_header;
+ }
+
+ /**
+ * count samples count w/o recording them
+ * @param filename sample filename
+ *
+ * convenience interface for raw access to sample count w/o recording
+ * them. It's placed here so all access to samples files go through
+ * profile_t static or non static member.
+ */
+ static count_type sample_count(std::string const & filename);
+
+ /**
+ * Indicate if given sample file is from a Cell Broadband Engine
+ * SPU profile
+ * @param filename sample filename
+ *
+ * Convenience interface put here so all access to samples files
+ * go through profile_t static or non static member.
+ */
+ static enum profile_type is_spu_sample_file(std::string const & filename);
+
+ /**
+ * cumulate sample file to our container of samples
+ * @param filename sample file name
+ *
+ * store samples for one sample file, sample file header is sanitized.
+ *
+ * all error are fatal
+ */
+ void add_sample_file(std::string const & filename);
+
+ /// Set an appropriate start offset, see comments below.
+ void set_offset(op_bfd const & abfd);
+
+ class const_iterator;
+ typedef std::pair<const_iterator, const_iterator> iterator_pair;
+
+ /**
+ * @param start start offset
+ * @param end end offset
+ *
+ * return an iterator pair to [start, end) range
+ */
+ iterator_pair
+ samples_range(odb_key_t start, odb_key_t end) const;
+
+ /// return a pair of iterator for all samples
+ iterator_pair samples_range() const;
+
+private:
+ /// helper for sample_count() and add_sample_file(). All error launch
+ /// an exception.
+ static void
+ open_sample_file(std::string const & filename, odb_t &);
+
+ /// copy of the samples file header
+ scoped_ptr<opd_header> file_header;
+
+ /// storage type for samples sorted by eip
+ typedef std::map<odb_key_t, count_type> ordered_samples_t;
+
+ /**
+ * Samples are stored in hash table, iterating over hash table don't
+ * provide any ordering, the above count() interface rely on samples
+ * ordered by eip. This map is only a temporary storage where samples
+ * are ordered by eip.
+ */
+ ordered_samples_t ordered_samples;
+
+ /**
+ * For certain profiles, such as kernel/modules, and anon
+ * regions with a matching binary, this value is non-zero,
+ * and represents the file offset of the relevant section.
+ *
+ * For kernel profiles, this is done because we use the information
+ * provided in /proc/ksyms, which only gives the mapped position of
+ * .text, and the symbol _text from vmlinux. This value is used to fix
+ * up the sample offsets for kernel code as a result of this difference
+ *
+ * In user-space samples, the sample offset is from the start of the
+ * mapped file, as seen in /proc/pid/maps. This is fine for
+ * mappings of permanent files, but with anon mappings, we need
+ * to adjust the key values to be a file offset against the
+ * *binary* (if there is one). This can obviously be different.
+ * So we pass our anon mapping start VMA to op_bfd, which looks
+ * for a section with that VMA, then returns the section's
+ * filepos. So all is good.
+ *
+ * Finally, note that for cg we can't use this inside the
+ * profile_t, as we're storing two offsets in the key value. So
+ * we do it later in that case.
+ *
+ * Phew.
+ */
+ u64 start_offset;
+};
+
+
+// It will be easier to derive profile_t::const_iterator from
+// std::iterator<std::input_iterator_tag, unsigned int> but this doesn't
+// work for gcc <= 2.95 so we provide the neccessary typedef in the hard way.
+// See ISO C++ 17.4.3.1 § 1 and 14.7.3 § 9.
+namespace std {
+ template <>
+ struct iterator_traits<profile_t::const_iterator> {
+ typedef ptrdiff_t difference_type;
+ typedef count_type value_type;
+ typedef count_type * pointer;
+ typedef count_type & reference;
+ typedef input_iterator_tag iterator_category;
+ };
+}
+
+
+class profile_t::const_iterator
+{
+ typedef ordered_samples_t::const_iterator iterator_t;
+public:
+ const_iterator() : start_offset(0) {}
+ const_iterator(iterator_t it_, u64 start_offset_)
+ : it(it_), start_offset(start_offset_) {}
+
+ count_type operator*() const { return it->second; }
+ const_iterator & operator++() { ++it; return *this; }
+
+ odb_key_t vma() const { return it->first + start_offset; }
+ count_type count() const { return **this; }
+
+ bool operator!=(const_iterator const & rhs) const {
+ return it != rhs.it;
+ }
+ bool operator==(const_iterator const & rhs) const {
+ return it == rhs.it;
+ }
+
+private:
+ iterator_t it;
+ u64 start_offset;
+};
+
+#endif /* !PROFILE_H */
diff --git a/libpp/profile_container.cpp b/libpp/profile_container.cpp
new file mode 100644
index 0000000..b83d6c8
--- /dev/null
+++ b/libpp/profile_container.cpp
@@ -0,0 +1,333 @@
+/**
+ * @file profile_container.cpp
+ * profile file container
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#include <set>
+#include <vector>
+#include <string>
+#include <iostream>
+#include <sstream>
+#include <algorithm>
+#include <numeric>
+
+#include "symbol.h"
+#include "op_header.h"
+#include "profile.h"
+#include "symbol_functors.h"
+#include "profile_container.h"
+#include "sample_container.h"
+#include "symbol_container.h"
+#include "populate_for_spu.h"
+
+using namespace std;
+
+namespace {
+
+struct filename_by_samples {
+ filename_by_samples(debug_name_id id, double percent_)
+ : filename(id), percent(percent_)
+ {}
+
+ bool operator<(filename_by_samples const & lhs) const {
+ if (percent != lhs.percent)
+ return percent < lhs.percent;
+ return filename < lhs.filename;
+ }
+
+ debug_name_id filename;
+ // ratio of samples which belongs to this filename.
+ double percent;
+};
+
+} // anon namespace
+
+
+profile_container::profile_container(bool debug_info_, bool need_details_,
+ extra_images const & extra_)
+ :
+ symbols(new symbol_container),
+ samples(new sample_container),
+ debug_info(debug_info_),
+ need_details(need_details_),
+ extra_found_images(extra_)
+{
+}
+
+
+profile_container::~profile_container()
+{
+}
+
+
+// Post condition:
+// the symbols/samples are sorted by increasing vma.
+// the range of sample_entry inside each symbol entry are valid
+// the samples_by_file_loc member var is correctly setup.
+void profile_container::add(profile_t const & profile,
+ op_bfd const & abfd, string const & app_name,
+ size_t pclass)
+{
+ string const image_name = abfd.get_filename();
+ opd_header header = profile.get_header();
+
+ for (symbol_index_t i = 0; i < abfd.syms.size(); ++i) {
+
+ unsigned long long start = 0, end = 0;
+ symbol_entry symb_entry;
+
+ abfd.get_symbol_range(i, start, end);
+
+ profile_t::iterator_pair p_it =
+ profile.samples_range(start, end);
+ count_type count = accumulate(p_it.first, p_it.second, 0ull);
+
+ // skip entries with no samples
+ if (count == 0)
+ continue;
+
+ symb_entry.sample.counts[pclass] = count;
+ total_count[pclass] += count;
+
+ symb_entry.size = end - start;
+
+ symb_entry.name = symbol_names.create(abfd.syms[i].name());
+ symb_entry.sym_index = i;
+
+ symb_entry.sample.file_loc.linenr = 0;
+ if (debug_info) {
+ string filename;
+ if (abfd.get_linenr(i, start, filename,
+ symb_entry.sample.file_loc.linenr)) {
+ symb_entry.sample.file_loc.filename =
+ debug_names.create(filename);
+ }
+ }
+
+ symb_entry.image_name = image_names.create(image_name);
+ symb_entry.app_name = image_names.create(app_name);
+
+ symb_entry.sample.vma = abfd.syms[i].vma();
+ if ((header.spu_profile == cell_spu_profile) &&
+ header.embedded_offset) {
+ symb_entry.spu_offset = header.embedded_offset;
+ symb_entry.embedding_filename =
+ image_names.create(abfd.get_embedding_filename());
+ } else {
+ symb_entry.spu_offset = 0;
+ }
+ symbol_entry const * symbol = symbols->insert(symb_entry);
+
+ if (need_details)
+ add_samples(abfd, i, p_it, symbol, pclass, start);
+ }
+}
+
+
+void
+profile_container::add_samples(op_bfd const & abfd, symbol_index_t sym_index,
+ profile_t::iterator_pair const & p_it,
+ symbol_entry const * symbol, size_t pclass,
+ unsigned long start)
+{
+ bfd_vma base_vma = abfd.syms[sym_index].vma();
+
+ profile_t::const_iterator it;
+ for (it = p_it.first; it != p_it.second ; ++it) {
+ sample_entry sample;
+
+ sample.counts[pclass] = it.count();
+
+ sample.file_loc.linenr = 0;
+ if (debug_info) {
+ string filename;
+ if (abfd.get_linenr(sym_index, it.vma(), filename,
+ sample.file_loc.linenr)) {
+ sample.file_loc.filename =
+ debug_names.create(filename);
+ }
+ }
+
+ sample.vma = (it.vma() - start) + base_vma;
+
+ samples->insert(symbol, sample);
+ }
+}
+
+
+symbol_collection const
+profile_container::select_symbols(symbol_choice & choice) const
+{
+ symbol_collection result;
+
+ double const threshold = choice.threshold / 100.0;
+
+ symbol_container::symbols_t::iterator it = symbols->begin();
+ symbol_container::symbols_t::iterator const end = symbols->end();
+
+ for (; it != end; ++it) {
+ if (choice.match_image
+ && (image_names.name(it->image_name) != choice.image_name))
+ continue;
+
+ double const percent =
+ op_ratio(it->sample.counts[0], total_count[0]);
+
+ if (percent >= threshold) {
+ result.push_back(&*it);
+
+ choice.hints = it->output_hint(choice.hints);
+ }
+ }
+
+ return result;
+}
+
+
+vector<debug_name_id> const
+profile_container::select_filename(double threshold) const
+{
+ set<debug_name_id> filename_set;
+
+ threshold /= 100.0;
+
+ // Trying to iterate on symbols to create the set of filenames which
+ // contain sample does not work: a symbol can contain samples and this
+ // symbol is in a source file that contain zero sample because only
+ // inline function in this source file contains samples.
+ sample_container::samples_iterator sit = samples->begin();
+ sample_container::samples_iterator const send = samples->end();
+
+ for (; sit != send; ++sit) {
+ debug_name_id name_id = sit->second.file_loc.filename;
+ if (name_id.set())
+ filename_set.insert(name_id);
+ }
+
+ // Give a sort order on filename for the selected pclass.
+ vector<filename_by_samples> file_by_samples;
+
+ set<debug_name_id>::const_iterator it = filename_set.begin();
+ set<debug_name_id>::const_iterator const end = filename_set.end();
+ for (; it != end; ++it) {
+ // FIXME: is samples_count() the right interface now ?
+ count_array_t counts = samples_count(*it);
+
+ double const ratio = op_ratio(counts[0], total_count[0]);
+ filename_by_samples const f(*it, ratio);
+
+ file_by_samples.push_back(f);
+ }
+
+ // now sort the file_by_samples entry.
+ sort(file_by_samples.begin(), file_by_samples.end());
+
+ // 2.91.66 doesn't like const_reverse_iterator in this context
+ vector<filename_by_samples>::reverse_iterator cit
+ = file_by_samples.rbegin();
+ vector<filename_by_samples>::reverse_iterator const cend
+ = file_by_samples.rend();
+
+ vector<debug_name_id> result;
+ for (; cit != cend; ++cit) {
+ if (cit->percent >= threshold)
+ result.push_back(cit->filename);
+ }
+
+ return result;
+}
+
+
+count_array_t profile_container::samples_count() const
+{
+ return total_count;
+}
+
+
+// Rest here are delegated to our private implementation.
+
+symbol_entry const *
+profile_container::find_symbol(string const & image_name, bfd_vma vma) const
+{
+ return symbols->find_by_vma(image_name, vma);
+}
+
+
+symbol_collection const
+profile_container::find_symbol(debug_name_id filename, size_t linenr) const
+{
+ return symbols->find(filename, linenr);
+}
+
+
+symbol_collection const
+profile_container::select_symbols(debug_name_id filename) const
+{
+ return symbols->find(filename);
+}
+
+sample_entry const *
+profile_container::find_sample(symbol_entry const * symbol, bfd_vma vma) const
+{
+ return samples->find_by_vma(symbol, vma);
+}
+
+
+count_array_t profile_container::samples_count(debug_name_id filename_id) const
+{
+ return samples->accumulate_samples(filename_id);
+}
+
+
+count_array_t profile_container::samples_count(debug_name_id filename,
+ size_t linenr) const
+{
+ return samples->accumulate_samples(filename, linenr);
+}
+
+
+sample_container::samples_iterator
+profile_container::begin(symbol_entry const * symbol) const
+{
+ return samples->begin(symbol);
+}
+
+
+sample_container::samples_iterator
+profile_container::end(symbol_entry const * symbol) const
+{
+ return samples->end(symbol);
+}
+
+
+sample_container::samples_iterator profile_container::begin() const
+{
+ return samples->begin();
+}
+
+
+sample_container::samples_iterator profile_container::end() const
+{
+ return samples->end();
+}
+
+symbol_entry const * profile_container::find(symbol_entry const & symbol) const
+{
+ return symbols->find(symbol);
+}
+
+symbol_container::symbols_t::iterator profile_container::begin_symbol() const
+{
+ return symbols->begin();
+}
+
+symbol_container::symbols_t::iterator profile_container::end_symbol() const
+{
+ return symbols->end();
+}
diff --git a/libpp/profile_container.h b/libpp/profile_container.h
new file mode 100644
index 0000000..c22f5d3
--- /dev/null
+++ b/libpp/profile_container.h
@@ -0,0 +1,188 @@
+/**
+ * @file profile_container.h
+ * Container associating symbols and samples
+ *
+ * @remark Copyright 2002, 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#ifndef PROFILE_CONTAINER_H
+#define PROFILE_CONTAINER_H
+
+#include <string>
+#include <vector>
+
+#include "profile.h"
+#include "utility.h"
+#include "op_bfd.h"
+#include "sample_container.h"
+#include "symbol_container.h"
+#include "format_flags.h"
+#include "locate_images.h"
+
+class string_filter;
+class symbol_entry;
+class sample_entry;
+
+/**
+ * Store multiple samples files belonging to the same profiling session.
+ * This is the main container capable of holding the profiles for arbitrary
+ * binary images and arbitrary profile classes.
+ */
+class profile_container : noncopyable {
+public:
+ /**
+ * Build an object to store information on samples. All parameters
+ * acts as hint for what you will request after recording samples and
+ * so allow optimizations during recording the information.
+ *
+ * @param debug_info If true line numbers and source files are
+ * recorded.
+ * @param need_details If true if we need to record all samples or to
+ * to record them at symbol level.
+ * @param extra extra images location
+ */
+ profile_container(bool debug_info, bool need_details,
+ extra_images const & extra);
+
+ ~profile_container();
+
+ /**
+ * add() - record symbols/samples in the underlying container
+ *
+ * @param profile the samples files container
+ * @param abfd the associated bfd object
+ * @param app_name the owning application name of sample
+ * @param pclass the profile class to add results for
+ *
+ * add() is an helper for delayed ctor. Take care you can't safely
+ * make any call to add after any other member function call.
+ * Obviously you can add only samples files which are coherent (same
+ * sampling rate, same events etc.)
+ */
+ void add(profile_t const & profile, op_bfd const & abfd,
+ std::string const & app_name, size_t pclass);
+
+ /// Find a symbol from its image_name, vma, return zero if no symbol
+ /// for this image at this vma
+ symbol_entry const * find_symbol(std::string const & image_name,
+ bfd_vma vma) const;
+
+ /// Find the symbols from its filename, linenr, return an empty
+ /// symbol_collection if no symbol at this location
+ symbol_collection const find_symbol(debug_name_id filename,
+ size_t linenr) const;
+
+ /// Find a sample by its symbol, vma, return zero if there is no sample
+ /// at this vma
+ sample_entry const * find_sample(symbol_entry const * symbol,
+ bfd_vma vma) const;
+
+ /// Find a symbol. Return NULL if not found.
+ symbol_entry const * find(symbol_entry const & symbol) const;
+
+ /// used for select_symbols()
+ struct symbol_choice {
+ symbol_choice()
+ : hints(cf_none), threshold(0.0), match_image(false) {}
+
+ /// hints filled in
+ column_flags hints;
+ /// percentage threshold
+ double threshold;
+ /// match the image name only
+ bool match_image;
+ /// owning image name
+ std::string image_name;
+ };
+
+ /**
+ * select_symbols - create a set of symbols sorted by sample count
+ * @param choice parameters to use/fill in when selecting
+ */
+ symbol_collection const select_symbols(symbol_choice & choice) const;
+
+ /**
+ * select_symbols - create a set of symbols belonging to a given source
+ * @param filename source file where are defined the returned symbols
+ */
+ symbol_collection const select_symbols(debug_name_id filename) const;
+
+ /// Like select_symbols for filename without allowing sort by vma.
+ std::vector<debug_name_id> const select_filename(double threshold) const;
+
+ /// return the total number of samples
+ count_array_t samples_count() const;
+
+ /// Get the samples count which belongs to filename. Return 0 if
+ /// no samples found.
+ count_array_t samples_count(debug_name_id filename_id) const;
+ /// Get the samples count which belongs to filename, linenr. Return
+ /// 0 if no samples found.
+ count_array_t samples_count(debug_name_id filename,
+ size_t linenr) const;
+
+ /// return an iterator to the first symbol
+ symbol_container::symbols_t::iterator begin_symbol() const;
+ /// return an iterator to the last symbol
+ symbol_container::symbols_t::iterator end_symbol() const;
+
+ /// return iterator to the first samples
+ sample_container::samples_iterator begin() const;
+ /// return iterator to the last samples
+ sample_container::samples_iterator end() const;
+
+ /// return iterator to the first samples for this symbol
+ sample_container::samples_iterator begin(symbol_entry const *) const;
+ /// return iterator to the last samples for this symbol
+ sample_container::samples_iterator end(symbol_entry const *) const;
+
+private:
+ /// helper for add()
+ void add_samples(op_bfd const & abfd, symbol_index_t sym_index,
+ profile_t::iterator_pair const &,
+ symbol_entry const * symbol, size_t pclass,
+ unsigned long start);
+
+ /**
+ * create an unique artificial symbol for an offset range. The range
+ * is only a hint of the maximum size of the created symbol. We
+ * give to the symbol an unique name as ?image_file_name#order and
+ * a range up to the nearest of syms or for the whole range if no
+ * syms exist after the start offset. the end parameter is updated
+ * to reflect the symbol range.
+ *
+ * The rationale here is to try to create symbols for alignment between
+ * function as little as possible and to create meaningfull symbols
+ * for special case such image w/o symbol.
+ */
+ std::string create_artificial_symbol(op_bfd const & abfd, u32 start,
+ u32 & end, size_t & order);
+
+ /// The symbols collected by pp tools sorted by increased vma, provide
+ /// also a sort order on samples count for each profile class
+ scoped_ptr<symbol_container> symbols;
+ /// The samples count collected by pp tools sorted by increased vma,
+ /// provide also a sort order on (filename, linenr)
+ scoped_ptr<sample_container> samples;
+ /// build() must count samples count for each profile class so cache it
+ /// here since user of profile_container often need it later.
+ count_array_t total_count;
+
+ /**
+ * Optimization hints for what information we are going to need,
+ * see the explanation in profile_container()
+ */
+ //@{
+ bool debug_info;
+ bool need_details;
+ //@}
+
+public: // FIXME
+ extra_images extra_found_images;
+};
+
+#endif /* !PROFILE_CONTAINER_H */
diff --git a/libpp/profile_spec.cpp b/libpp/profile_spec.cpp
new file mode 100644
index 0000000..f75327e
--- /dev/null
+++ b/libpp/profile_spec.cpp
@@ -0,0 +1,576 @@
+/**
+ * @file profile_spec.cpp
+ * Contains a PP profile specification
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ */
+
+#include <algorithm>
+#include <set>
+#include <sstream>
+#include <iterator>
+#include <iostream>
+#include <dirent.h>
+
+#include "file_manip.h"
+#include "op_config.h"
+#include "profile_spec.h"
+#include "string_manip.h"
+#include "glob_filter.h"
+#include "locate_images.h"
+#include "op_exception.h"
+#include "op_header.h"
+#include "op_fileio.h"
+
+using namespace std;
+
+namespace {
+
+// PP:3.7, full path, or relative path. If we can't find it,
+// we should maintain the original to maintain the wordexp etc.
+string const fixup_image_spec(string const & str, extra_images const & extra)
+{
+ // On error find_image_path() return str, so if an occur we will
+ // use the provided image_name not the fixed one.
+ image_error error;
+ return extra.find_image_path(str, error, true);
+}
+
+void fixup_image_spec(vector<string> & images, extra_images const & extra)
+{
+ vector<string>::iterator it = images.begin();
+ vector<string>::iterator const end = images.end();
+
+ for (; it != end; ++it)
+ *it = fixup_image_spec(*it, extra);
+}
+
+} // anon namespace
+
+
+profile_spec::profile_spec()
+ :
+ extra_found_images()
+{
+ parse_table["archive"] = &profile_spec::parse_archive_path;
+ parse_table["session"] = &profile_spec::parse_session;
+ parse_table["session-exclude"] =
+ &profile_spec::parse_session_exclude;
+ parse_table["image"] = &profile_spec::parse_image;
+ parse_table["image-exclude"] = &profile_spec::parse_image_exclude;
+ parse_table["lib-image"] = &profile_spec::parse_lib_image;
+ parse_table["event"] = &profile_spec::parse_event;
+ parse_table["count"] = &profile_spec::parse_count;
+ parse_table["unit-mask"] = &profile_spec::parse_unitmask;
+ parse_table["tid"] = &profile_spec::parse_tid;
+ parse_table["tgid"] = &profile_spec::parse_tgid;
+ parse_table["cpu"] = &profile_spec::parse_cpu;
+}
+
+
+void profile_spec::parse(string const & tag_value)
+{
+ string value;
+ action_t action = get_handler(tag_value, value);
+ if (!action) {
+ throw invalid_argument("profile_spec::parse(): not "
+ "a valid tag \"" + tag_value + "\"");
+ }
+
+ (this->*action)(value);
+}
+
+
+bool profile_spec::is_valid_tag(string const & tag_value)
+{
+ string value;
+ return get_handler(tag_value, value);
+}
+
+
+void profile_spec::set_image_or_lib_name(string const & str)
+{
+ /* FIXME: what does spec say about this being allowed to be
+ * a comma list or not ? */
+ image_or_lib_image.push_back(fixup_image_spec(str, extra_found_images));
+}
+
+
+void profile_spec::parse_archive_path(string const & str)
+{
+ archive_path = op_realpath(str);
+}
+
+
+string profile_spec::get_archive_path() const
+{
+ return archive_path;
+}
+
+
+void profile_spec::parse_session(string const & str)
+{
+ session = separate_token(str, ',');
+}
+
+
+void profile_spec::parse_session_exclude(string const & str)
+{
+ session_exclude = separate_token(str, ',');
+}
+
+
+void profile_spec::parse_image(string const & str)
+{
+ image = separate_token(str, ',');
+ fixup_image_spec(image, extra_found_images);
+}
+
+
+void profile_spec::parse_image_exclude(string const & str)
+{
+ image_exclude = separate_token(str, ',');
+ fixup_image_spec(image_exclude, extra_found_images);
+}
+
+
+void profile_spec::parse_lib_image(string const & str)
+{
+ lib_image = separate_token(str, ',');
+ fixup_image_spec(lib_image, extra_found_images);
+}
+
+
+void profile_spec::parse_event(string const & str)
+{
+ event.set(str);
+}
+
+
+void profile_spec::parse_count(string const & str)
+{
+ count.set(str);
+}
+
+
+void profile_spec::parse_unitmask(string const & str)
+{
+ unitmask.set(str);
+}
+
+
+void profile_spec::parse_tid(string const & str)
+{
+ tid.set(str);
+}
+
+
+void profile_spec::parse_tgid(string const & str)
+{
+ tgid.set(str);
+}
+
+
+void profile_spec::parse_cpu(string const & str)
+{
+ cpu.set(str);
+}
+
+
+profile_spec::action_t
+profile_spec::get_handler(string const & tag_value, string & value)
+{
+ string::size_type pos = tag_value.find_first_of(':');
+ if (pos == string::npos)
+ return 0;
+
+ string tag(tag_value.substr(0, pos));
+ value = tag_value.substr(pos + 1);
+
+ parse_table_t::const_iterator it = parse_table.find(tag);
+ if (it == parse_table.end())
+ return 0;
+
+ return it->second;
+}
+
+
+namespace {
+
+/// return true if the value from the profile spec may match the comma
+/// list
+template<typename T>
+bool comma_match(comma_list<T> const & cl, generic_spec<T> const & value)
+{
+ // if the profile spec is "all" we match the sample file
+ if (!cl.is_set())
+ return true;
+
+ // an "all" sample file should never match specified profile
+ // spec values
+ if (!value.is_set())
+ return false;
+
+ // now match each profile spec value against the sample file
+ return cl.match(value.value());
+}
+
+}
+
+
+bool profile_spec::match(filename_spec const & spec) const
+{
+ bool matched_by_image_or_lib_image = false;
+
+ // We need the true image name not the one based on the sample
+ // filename for the benefit of module which have /oprofile in their
+ // sample filename. This allow to specify profile spec based on the
+ // real name of the image, e.g. 'binary:*oprofile.ko'
+ string simage = fixup_image_spec(spec.image, extra_found_images);
+ string slib_image = fixup_image_spec(spec.lib_image,
+ extra_found_images);
+
+ // PP:3.19
+ if (!image_or_lib_image.empty()) {
+ glob_filter filter(image_or_lib_image, image_exclude);
+ if (filter.match(simage) || filter.match(slib_image))
+ matched_by_image_or_lib_image = true;
+ }
+
+ if (!matched_by_image_or_lib_image) {
+ // PP:3.7 3.8
+ if (!image.empty()) {
+ glob_filter filter(image, image_exclude);
+ if (!filter.match(simage))
+ return false;
+ } else if (!image_or_lib_image.empty()) {
+ // image.empty() means match all except if user
+ // specified image_or_lib_image
+ return false;
+ }
+
+ // PP:3.9 3.10
+ if (!lib_image.empty()) {
+ glob_filter filter(lib_image, image_exclude);
+ if (!filter.match(slib_image))
+ return false;
+ } else if (image.empty() && !image_or_lib_image.empty()) {
+ // lib_image empty means match all except if user
+ // specified image_or_lib_image *or* we already
+ // matched this spec through image
+ return false;
+ }
+ }
+
+ if (!matched_by_image_or_lib_image) {
+ // if we don't match by image_or_lib_image we must try to
+ // exclude from spec, exclusion from image_or_lib_image has
+ // been handled above
+ vector<string> empty;
+ glob_filter filter(empty, image_exclude);
+ if (!filter.match(simage))
+ return false;
+ if (!spec.lib_image.empty() && !filter.match(slib_image))
+ return false;
+ }
+
+ if (!event.match(spec.event))
+ return false;
+
+ if (!count.match(spec.count))
+ return false;
+
+ if (!unitmask.match(spec.unitmask))
+ return false;
+
+ if (!comma_match(cpu, spec.cpu))
+ return false;
+
+ if (!comma_match(tid, spec.tid))
+ return false;
+
+ if (!comma_match(tgid, spec.tgid))
+ return false;
+
+ return true;
+}
+
+
+profile_spec profile_spec::create(list<string> const & args,
+ vector<string> const & image_path,
+ string const & root_path)
+{
+ profile_spec spec;
+ set<string> tag_seen;
+ vector<string> temp_image_or_lib;
+
+ list<string>::const_iterator it = args.begin();
+ list<string>::const_iterator end = args.end();
+
+ for (; it != end; ++it) {
+ if (spec.is_valid_tag(*it)) {
+ if (tag_seen.find(*it) != tag_seen.end()) {
+ throw op_runtime_error("tag specified "
+ "more than once: " + *it);
+ }
+ tag_seen.insert(*it);
+ spec.parse(*it);
+ } else {
+ string const file = op_realpath(*it);
+ temp_image_or_lib.push_back(file);
+ }
+ }
+
+ // PP:3.5 no session given means use the current session.
+ if (spec.session.empty())
+ spec.session.push_back("current");
+
+ bool ok = true;
+ vector<string>::const_iterator ip_it = image_path.begin();
+ for ( ; ip_it != image_path.end(); ++ip_it) {
+ if (!is_directory(spec.get_archive_path() + "/" + *ip_it)) {
+ cerr << spec.get_archive_path() + "/" + *ip_it << " isn't a valid directory\n";
+ ok = false;
+ }
+ }
+ if (!ok)
+ throw op_runtime_error("invalid --image-path= options");
+
+ spec.extra_found_images.populate(image_path, spec.get_archive_path(),
+ root_path);
+ vector<string>::const_iterator im = temp_image_or_lib.begin();
+ vector<string>::const_iterator last = temp_image_or_lib.end();
+ for (; im != last; ++im)
+ spec.set_image_or_lib_name(*im);
+
+ return spec;
+}
+
+namespace {
+
+vector<string> filter_session(vector<string> const & session,
+ vector<string> const & session_exclude)
+{
+ vector<string> result(session);
+
+ if (result.empty())
+ result.push_back("current");
+
+ for (size_t i = 0 ; i < session_exclude.size() ; ++i) {
+ // FIXME: would we use fnmatch on each item, are we allowed
+ // to --session=current* ?
+ vector<string>::iterator it =
+ find(result.begin(), result.end(), session_exclude[i]);
+
+ if (it != result.end())
+ result.erase(it);
+ }
+
+ return result;
+}
+
+static bool invalid_sample_file;
+bool valid_candidate(string const & base_dir, string const & filename,
+ profile_spec const & spec, bool exclude_dependent,
+ bool exclude_cg)
+{
+ if (exclude_cg && filename.find("{cg}") != string::npos)
+ return false;
+
+ // strip out non sample files
+ string const & sub = filename.substr(base_dir.size(), string::npos);
+ if (!is_prefix(sub, "/{root}/") && !is_prefix(sub, "/{kern}/"))
+ return false;
+
+ /* When overflows occur in the oprofile kernel driver's sample
+ * buffers (caused by too high of a sampling rate), it's possible
+ * for samples to be mis-attributed. A common scenario is that,
+ * while profiling process 'abc' running binary 'xzy', the task
+ * switch for 'abc' gets dropped somehow. Then, samples are taken
+ * for the 'xyz' binary. In the attempt to attribute the samples to
+ * the associated binary, the oprofile kernel code examines the
+ * the memory mappings for the last process for which it recorded
+ * a task switch. When profiling at a very high rate, the oprofile
+ * daemon is often the process that is mistakenly examined. Then the
+ * sample from binary 'xyz' is matched to some file that's open in
+ * oprofiled's memory space. Because oprofiled has many sample files
+ * open at any given time, there's a good chance the sample's VMA is
+ * contained within one of those sample files. So, once finding this
+ * bogus match, the oprofile kernel records a cookie switch for the
+ * sample file. This scenario is made even more likely if a high
+ * sampling rate (e.g., profiling on several events) is paired with
+ * callgraph data collection.
+ *
+ * When the daemon processes this sample data from the kernel, it
+ * creates a sample file for the sample file, resulting in something
+ * of the form:
+ * <session-dir>/[blah]<session-dir>/[blah]
+ *
+ * When the sample data is post-processed, the sample file is parsed to
+ * try to determine the name of the binary, but it gets horribly confused.
+ * At best, the post-processing tool will spit out some warning messages,
+ * such as:
+ * warning:
+ * /lib64/libdl-2.9.so/CYCLES.10000.0.all.all.all/{dep}/{root}/var/lib/oprofile/samples/current/{root}/lib64/libdl-2.9.so/{dep}/{root}/lib64/libdl-2.9.so/PM_RUN_CYC_GRP12.10000.0.all.all.all
+ * could not be found.
+ *
+ * At worst, the parsing may result in an "invalid argument" runtime error
+ * because of the inability to parse a sample file whose name contains that
+ * of another sample file. This typically seems to happen when callgraph
+ * data is being collected.
+ *
+ * The next several lines of code checks if the passed filename
+ * contains <session-dir>/samples; if so, we discard it as an
+ * invalid sample file.
+ */
+
+ unsigned int j = base_dir.rfind('/');
+ string session_samples_dir = base_dir.substr(0, j);
+ if (sub.find(session_samples_dir) != string::npos) {
+ invalid_sample_file = true;
+ return false;
+ }
+
+ // strip out generated JIT object files for samples of anonymous regions
+ if (is_jit_sample(sub))
+ return false;
+
+ filename_spec file_spec(filename, spec.extra_found_images);
+ if (spec.match(file_spec)) {
+ if (exclude_dependent && file_spec.is_dependent())
+ return false;
+ return true;
+ }
+
+ return false;
+}
+
+
+/**
+ * Print a warning message if we detect any sample buffer overflows
+ * occurred in the kernel driver.
+ */
+void warn_if_kern_buffs_overflow(string const & session_samples_dir)
+{
+ DIR * dir;
+ struct dirent * dirent;
+ string stats_path;
+ int ret = 0;
+
+ stats_path = session_samples_dir + "stats/";
+ ret = op_read_int_from_file((stats_path + "event_lost_overflow").
+ c_str(), 0);
+
+ if (!(dir = opendir(stats_path.c_str()))) {
+ ret = -1;
+ goto done;
+ }
+
+ while ((dirent = readdir(dir)) && !ret) {
+ int cpu_nr;
+ string path;
+ if (sscanf(dirent->d_name, "cpu%d", &cpu_nr) != 1)
+ continue;
+ path = stats_path + dirent->d_name + "/";
+ ret = op_read_int_from_file((path + "sample_lost_overflow").
+ c_str(), 0);
+ }
+ closedir(dir);
+
+ done:
+ if (ret == -1) {
+ cerr << "Overflow stats not available" << endl;
+ }
+ else if (ret > 0) {
+ cerr << "WARNING! The OProfile kernel driver reports sample "
+ << "buffer overflows." << endl;
+ cerr << "Such overflows can result in incorrect sample attribution"
+ << ", invalid sample" << endl
+ << "files and other symptoms. "
+ << "See the oprofiled.log for details." << endl;
+ cerr << "You should adjust your sampling frequency to eliminate"
+ << " (or at least minimize)" << endl
+ << "these overflows." << endl;
+ }
+}
+
+
+} // anonymous namespace
+
+
+list<string> profile_spec::generate_file_list(bool exclude_dependent,
+ bool exclude_cg) const
+{
+ // FIXME: isn't remove_duplicates faster than doing this, then copy() ?
+ set<string> unique_files;
+
+ vector<string> sessions = filter_session(session, session_exclude);
+
+ if (sessions.empty()) {
+ ostringstream os;
+ os << "No session given\n"
+ << "included session was:\n";
+ copy(session.begin(), session.end(),
+ ostream_iterator<string>(os, "\n"));
+ os << "excluded session was:\n";
+ copy(session_exclude.begin(), session_exclude.end(),
+ ostream_iterator<string>(os, "\n"));
+ throw invalid_argument(os.str());
+ }
+
+ bool found_file = false;
+
+ vector<string>::const_iterator cit = sessions.begin();
+ vector<string>::const_iterator end = sessions.end();
+
+ for (; cit != end; ++cit) {
+ if (cit->empty())
+ continue;
+
+ string base_dir;
+ invalid_sample_file = false;
+ if ((*cit)[0] != '.' && (*cit)[0] != '/')
+ base_dir = archive_path + op_samples_dir;
+ base_dir += *cit;
+
+ base_dir = op_realpath(base_dir);
+
+ list<string> files;
+ create_file_list(files, base_dir, "*", true);
+
+ if (!files.empty()) {
+ found_file = true;
+ warn_if_kern_buffs_overflow(base_dir + "/");
+ }
+
+ list<string>::const_iterator it = files.begin();
+ list<string>::const_iterator fend = files.end();
+ for (; it != fend; ++it) {
+ if (valid_candidate(base_dir, *it, *this,
+ exclude_dependent, exclude_cg)) {
+ unique_files.insert(*it);
+ }
+ }
+ if (invalid_sample_file) {
+ cerr << "Warning: Invalid sample files found in "
+ << base_dir << endl;
+ cerr << "This problem can be caused by too high of a sampling rate."
+ << endl;
+ }
+ }
+
+ if (!found_file) {
+ ostringstream os;
+ os << "No sample file found: try running opcontrol --dump\n"
+ << "or specify a session containing sample files\n";
+ throw op_fatal_error(os.str());
+ }
+
+ list<string> result;
+ copy(unique_files.begin(), unique_files.end(), back_inserter(result));
+
+ return result;
+}
diff --git a/libpp/profile_spec.h b/libpp/profile_spec.h
new file mode 100644
index 0000000..58b34c4
--- /dev/null
+++ b/libpp/profile_spec.h
@@ -0,0 +1,143 @@
+/**
+ * @file profile_spec.h
+ * Contains a PP profile specification
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ */
+
+#ifndef PROFILE_SPEC_H
+#define PROFILE_SPEC_H
+
+#include <map>
+#include <vector>
+#include <list>
+
+#include "filename_spec.h"
+#include "comma_list.h"
+#include "locate_images.h"
+
+/**
+ * Holds a parsed profile spec composed of tag:value pairs, as given in
+ * pp_interface documentation.
+ *
+ * @internal implemented through a map of string, pointer to function member
+ * indexed by tag_name.
+ */
+class profile_spec
+{
+public:
+ /**
+ * @param args a vector of non options strings
+ * @param extra extra image paths to search
+ *
+ * Factory returning a profile_spec instance storing all valid
+ * tag:value contained in args vector doing also alias
+ * substitution, non-valid tag:value options are considered
+ * as image:value
+ */
+ static profile_spec create(std::list<std::string> const & args,
+ std::vector<std::string> const & image_path,
+ std::string const & root_path);
+
+ /**
+ * @param exclude_dependent whether to exclude dependent sub-images
+ * @param exclude_cg whether to exclude call graph file
+ *
+ * Use the spec to generate the list of candidate sample files.
+ */
+ std::list<std::string>
+ generate_file_list(bool exclude_dependent, bool exclude_cg) const;
+
+ /**
+ * @param file_spec the filename specification to check
+ *
+ * return true if filename match the spec. PP:3.24 internal loop
+ */
+ bool match(filename_spec const & file_spec) const;
+
+ /**
+ * return archive name
+ * returns an empty string if not using an archive.
+ */
+ std::string get_archive_path() const;
+
+private:
+ profile_spec();
+
+ /**
+ * @param tag_value a "tag:value" to interpret, all error throw an
+ * invalid_argument exception.
+ */
+ void parse(std::string const & tag_value);
+
+ /**
+ * @param image an image or a libray name given on command line
+ *
+ * Used for e.g. "opreport /bin/mybinary". We don't know yet
+ * if this is an application or a dependent image.
+ */
+ void set_image_or_lib_name(std::string const & image);
+
+ /**
+ * @param str a "tag:value"
+ *
+ * return true if tag is a valid tag
+ */
+ bool is_valid_tag(std::string const & str);
+
+ /**
+ * implement tag parsing: PP:3.3 to 3.16
+ */
+ void parse_archive_path(std::string const &);
+ void parse_session(std::string const &);
+ void parse_session_exclude(std::string const &);
+ void parse_image(std::string const &);
+ void parse_image_exclude(std::string const &);
+ void parse_lib_image(std::string const &);
+ void parse_event(std::string const &);
+ void parse_count(std::string const &);
+ void parse_unitmask(std::string const &);
+ void parse_tid(std::string const &);
+ void parse_tgid(std::string const &);
+ void parse_cpu(std::string const &);
+
+ typedef void (profile_spec::*action_t)(std::string const &);
+ typedef std::map<std::string, action_t> parse_table_t;
+ parse_table_t parse_table;
+
+ /**
+ * @param tag_value input "tag:value" string
+ * @param value if success return the value part of tag_value
+ * helper for set/is_valid_tag public interface
+ *
+ * return null if tag is not valid, else return the pointer to member
+ * function to apply and the value in value parameter
+ */
+ action_t get_handler(std::string const & tag_value,
+ std::string & value);
+
+ std::string archive_path;
+ std::string binary;
+ std::vector<std::string> session;
+ std::vector<std::string> session_exclude;
+ std::vector<std::string> image;
+ std::vector<std::string> image_exclude;
+ std::vector<std::string> lib_image;
+ comma_list<std::string> event;
+ comma_list<int> count;
+ comma_list<unsigned int> unitmask;
+ comma_list<pid_t> tid;
+ comma_list<pid_t> tgid;
+ comma_list<int> cpu;
+ // specified by user on command like opreport image1 image2 ...
+ std::vector<std::string> image_or_lib_image;
+
+public: // FIXME
+ /// extra search path for images
+ extra_images extra_found_images;
+};
+
+#endif /* !PROFILE_SPEC_H */
diff --git a/libpp/sample_container.cpp b/libpp/sample_container.cpp
new file mode 100644
index 0000000..890bb74
--- /dev/null
+++ b/libpp/sample_container.cpp
@@ -0,0 +1,141 @@
+/**
+ * @file sample_container.cpp
+ * Internal container for samples
+ *
+ * @remark Copyright 2002, 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#include <climits>
+#include <set>
+#include <numeric>
+#include <algorithm>
+#include <vector>
+
+#include "sample_container.h"
+
+using namespace std;
+
+namespace {
+
+// FIXME: efficiency ?
+count_array_t add_counts(count_array_t const & counts,
+ sample_entry const * s)
+{
+ count_array_t temp(counts);
+ temp += s->counts;
+ return temp;
+}
+
+} // namespace anon
+
+
+sample_container::samples_iterator sample_container::begin() const
+{
+ return samples.begin();
+}
+
+
+sample_container::samples_iterator sample_container::end() const
+{
+ return samples.end();
+}
+
+
+sample_container::samples_iterator
+sample_container::begin(symbol_entry const * symbol) const
+{
+ samples_storage::key_type key(symbol, 0);
+
+ return samples.lower_bound(key);
+}
+
+
+sample_container::samples_iterator
+sample_container::end(symbol_entry const * symbol) const
+{
+ samples_storage::key_type key(symbol, ~bfd_vma(0));
+
+ return samples.upper_bound(key);
+}
+
+
+void sample_container::insert(symbol_entry const * symbol,
+ sample_entry const & sample)
+{
+ samples_storage::key_type key(symbol, sample.vma);
+
+ samples_storage::iterator it = samples.find(key);
+ if (it != samples.end()) {
+ it->second.counts += sample.counts;
+ } else {
+ samples[key] = sample;
+ }
+}
+
+
+count_array_t
+sample_container::accumulate_samples(debug_name_id filename_id) const
+{
+ build_by_loc();
+
+ sample_entry lower, upper;
+
+ lower.file_loc.filename = upper.file_loc.filename = filename_id;
+ lower.file_loc.linenr = 0;
+ upper.file_loc.linenr = INT_MAX;
+
+ typedef samples_by_loc_t::const_iterator iterator;
+
+ iterator it1 = samples_by_loc.lower_bound(&lower);
+ iterator it2 = samples_by_loc.upper_bound(&upper);
+
+ return accumulate(it1, it2, count_array_t(), add_counts);
+}
+
+
+sample_entry const *
+sample_container::find_by_vma(symbol_entry const * symbol, bfd_vma vma) const
+{
+ sample_index_t key(symbol, vma);
+ samples_iterator it = samples.find(key);
+ if (it != samples.end())
+ return &it->second;
+
+ return 0;
+}
+
+
+count_array_t
+sample_container::accumulate_samples(debug_name_id filename,
+ size_t linenr) const
+{
+ build_by_loc();
+
+ sample_entry sample;
+
+ sample.file_loc.filename = filename;
+ sample.file_loc.linenr = linenr;
+
+ typedef pair<samples_by_loc_t::const_iterator,
+ samples_by_loc_t::const_iterator> it_pair;
+
+ it_pair itp = samples_by_loc.equal_range(&sample);
+
+ return accumulate(itp.first, itp.second, count_array_t(), add_counts);
+}
+
+
+void sample_container::build_by_loc() const
+{
+ if (!samples_by_loc.empty())
+ return;
+
+ samples_iterator cit = samples.begin();
+ samples_iterator end = samples.end();
+ for (; cit != end; ++cit)
+ samples_by_loc.insert(&cit->second);
+}
diff --git a/libpp/sample_container.h b/libpp/sample_container.h
new file mode 100644
index 0000000..74c9ab0
--- /dev/null
+++ b/libpp/sample_container.h
@@ -0,0 +1,77 @@
+/**
+ * @file sample_container.h
+ * Internal implementation of sample container
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#ifndef SAMPLE_CONTAINER_H
+#define SAMPLE_CONTAINER_H
+
+#include <map>
+#include <set>
+#include <string>
+
+#include "symbol.h"
+#include "symbol_functors.h"
+
+/**
+ * Arbitrary container of sample entries. Can return
+ * number of samples for a file or line number and
+ * return the particular sample information for a VMA.
+ */
+class sample_container {
+ typedef std::pair<symbol_entry const *, bfd_vma> sample_index_t;
+public:
+ typedef std::map<sample_index_t, sample_entry> samples_storage;
+ typedef samples_storage::const_iterator samples_iterator;
+
+ /// return iterator to the first samples for this symbol
+ samples_iterator begin(symbol_entry const *) const;
+ /// return iterator to the last samples for this symbol
+ samples_iterator end(symbol_entry const *) const;
+
+ /// return iterator to the first samples
+ samples_iterator begin() const;
+ /// return iterator to the last samples
+ samples_iterator end() const;
+
+ /// insert a sample entry by creating a new entry or by cumulating
+ /// samples into an existing one. Can only be done before any lookups
+ void insert(symbol_entry const * symbol, sample_entry const &);
+
+ /// return nr of samples in the given filename
+ count_array_t accumulate_samples(debug_name_id filename_id) const;
+
+ /// return nr of samples at the given line nr in the given file
+ count_array_t accumulate_samples(debug_name_id, size_t linenr) const;
+
+ /// return the sample entry for the given image_name and vma if any
+ sample_entry const * find_by_vma(symbol_entry const * symbol,
+ bfd_vma vma) const;
+
+private:
+ /// build the symbol by file-location cache
+ void build_by_loc() const;
+
+ /// main sample entry container
+ samples_storage samples;
+
+ typedef std::multiset<sample_entry const *, less_by_file_loc>
+ samples_by_loc_t;
+
+ // must be declared after the samples_storage to ensure a
+ // correct life-time.
+
+ /**
+ * Sample entries by file location. Lazily built when necessary,
+ * so mutable.
+ */
+ mutable samples_by_loc_t samples_by_loc;
+};
+
+#endif /* SAMPLE_CONTAINER_H */
diff --git a/libpp/symbol.cpp b/libpp/symbol.cpp
new file mode 100644
index 0000000..cb39571
--- /dev/null
+++ b/libpp/symbol.cpp
@@ -0,0 +1,49 @@
+/**
+ * @file symbol.cpp
+ * Symbol containers
+ *
+ * @remark Copyright 2002, 2004 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+
+#include "symbol.h"
+#include "locate_images.h"
+
+#include <iostream>
+#include <string>
+
+using namespace std;
+
+column_flags symbol_entry::output_hint(column_flags fl) const
+{
+ if (app_name != image_name)
+ fl = column_flags(fl | cf_image_name);
+
+ // FIXME: see comment in symbol.h: why we don't use sample.vma + size ?
+ if (sample.vma & ~0xffffffffLLU)
+ fl = column_flags(fl | cf_64bit_vma);
+
+ return fl;
+}
+
+
+
+bool has_sample_counts(count_array_t const & counts, size_t lo, size_t hi)
+{
+ for (size_t i = lo; i <= hi; ++i)
+ if (counts[i] != 0)
+ return true;
+ return false;
+}
+
+
+string const & get_image_name(image_name_id id,
+ image_name_storage::image_name_type type,
+ extra_images const & extra)
+{
+ return image_names.get_name(id, type, extra);
+}
diff --git a/libpp/symbol.h b/libpp/symbol.h
new file mode 100644
index 0000000..ea2724d
--- /dev/null
+++ b/libpp/symbol.h
@@ -0,0 +1,148 @@
+/**
+ * @file symbol.h
+ * Symbol containers
+ *
+ * @remark Copyright 2002, 2004 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#ifndef SYMBOL_H
+#define SYMBOL_H
+
+#include "name_storage.h"
+#include "growable_vector.h"
+#include "sparse_array.h"
+#include "format_flags.h"
+#include "op_types.h"
+
+#include <bfd.h>
+#include <stdint.h>
+
+#include <list>
+
+class extra_images;
+
+
+/// for storing sample counts
+typedef sparse_array<u32, count_type> count_array_t;
+
+
+/// A simple container for a fileno:linenr location.
+struct file_location {
+ file_location() : linenr(0) {}
+ /// empty if not valid.
+ debug_name_id filename;
+ /// 0 means invalid or code is generated internally by the compiler
+ unsigned int linenr;
+
+ bool operator<(file_location const & rhs) const {
+ // Note we sort on filename id not on string
+ return filename < rhs.filename ||
+ (filename == rhs.filename && linenr < rhs.linenr);
+ }
+};
+
+
+/// associate vma address with a file location and a samples count
+struct sample_entry {
+ sample_entry() : vma(0) {}
+ /// From where file location comes the samples
+ file_location file_loc;
+ /// From where virtual memory address comes the samples
+ bfd_vma vma;
+ /// the samples count
+ count_array_t counts;
+};
+
+
+/// associate a symbol with a file location, samples count and vma address
+class symbol_entry {
+public:
+ symbol_entry() : size(0) {}
+ virtual ~symbol_entry() {}
+
+ /// which image this symbol belongs to
+ image_name_id image_name;
+ /// owning application name: identical to image name if profiling
+ /// session did not separate samples for shared libs or if image_name
+ /// is not a shared lib
+ image_name_id app_name;
+ // index into the op_bfd symbol table
+ size_t sym_index;
+ /// file location, vma and cumulated samples count for this symbol
+ sample_entry sample;
+ /// name of symbol
+ symbol_name_id name;
+ /// symbol size as calculated by op_bfd, start of symbol is sample.vma
+ size_t size;
+
+ /**
+ * @param fl input hint
+ *
+ * combine fl with the calculated hint. It's theoretically possible
+ * that we get a symbol where its samples pass the border line, but
+ * the start is below it, but the the hint is only used for formatting
+ */
+ column_flags output_hint(column_flags fl) const;
+ uint64_t spu_offset;
+ image_name_id embedding_filename;
+};
+
+
+/// a collection of sorted symbols
+typedef std::vector<symbol_entry const *> symbol_collection;
+
+
+/**
+ * The public data for call-graph symbols. Each caller/callee has
+ * the sample counts replaced with the relevant arc counts, whilst
+ * the cg_symbol retains its self count.
+ */
+class cg_symbol : public symbol_entry {
+public:
+ cg_symbol(symbol_entry const & sym) : symbol_entry(sym) {}
+
+ typedef std::vector<symbol_entry> children;
+
+ /// all callers of this symbol
+ children callers;
+ /// total count of callers
+ count_array_t total_caller_count;
+
+ /// all symbols called by this symbol
+ children callees;
+ /// total count of callees
+ count_array_t total_callee_count;
+};
+
+/// a collection of sorted callgraph symbol objects
+typedef std::list<cg_symbol> cg_collection_objs;
+
+/// for storing diff %ages
+typedef growable_vector<double> diff_array_t;
+
+
+/**
+ * Data for a diffed symbol.
+ */
+struct diff_symbol : public symbol_entry {
+ diff_symbol(symbol_entry const & sym) : symbol_entry(sym) {}
+
+ /// diff %age values for each profile class
+ diff_array_t diffs;
+};
+
+
+/// a collection of diffed symbols
+typedef std::vector<diff_symbol> diff_collection;
+
+bool has_sample_counts(count_array_t const & counts, size_t lo, size_t hi);
+std::string const & get_image_name(image_name_id id,
+ image_name_storage::image_name_type type,
+ extra_images const & extra);
+
+
+#endif /* !SYMBOL_H */
diff --git a/libpp/symbol_container.cpp b/libpp/symbol_container.cpp
new file mode 100644
index 0000000..55aa76f
--- /dev/null
+++ b/libpp/symbol_container.cpp
@@ -0,0 +1,124 @@
+/**
+ * @file symbol_container.cpp
+ * Internal container for symbols
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#include <string>
+#include <algorithm>
+#include <set>
+#include <vector>
+
+#include "symbol_container.h"
+
+using namespace std;
+
+symbol_container::size_type symbol_container::size() const
+{
+ return symbols.size();
+}
+
+
+symbol_entry const * symbol_container::insert(symbol_entry const & symb)
+{
+ pair<symbols_t::iterator, bool> p = symbols.insert(symb);
+ if (!p.second) {
+ // safe: count is not used by sorting criteria
+ symbol_entry * symbol = const_cast<symbol_entry*>(&*p.first);
+ symbol->sample.counts += symb.sample.counts;
+ }
+
+ return &*p.first;
+}
+
+
+symbol_collection const
+symbol_container::find(debug_name_id filename, size_t linenr) const
+{
+ build_by_loc();
+
+ symbol_entry symbol;
+ symbol.sample.file_loc.filename = filename;
+ symbol.sample.file_loc.linenr = linenr;
+
+ symbol_collection result;
+
+ typedef symbols_by_loc_t::const_iterator it;
+ pair<it, it> p_it = symbols_by_loc.equal_range(&symbol);
+ for ( ; p_it.first != p_it.second; ++p_it.first)
+ result.push_back(*p_it.first);
+
+ return result;
+}
+
+
+symbol_collection const
+symbol_container::find(debug_name_id filename) const
+{
+ build_by_loc();
+
+ symbol_entry symbol;
+ symbol.sample.file_loc.filename = filename;
+ symbol.sample.file_loc.linenr = 0;
+
+ typedef symbols_by_loc_t::const_iterator it;
+ it first = symbols_by_loc.lower_bound(&symbol);
+ symbol.sample.file_loc.linenr = (unsigned int)size_t(-1);
+ it last = symbols_by_loc.upper_bound(&symbol);
+
+ symbol_collection result;
+ for ( ; first != last ; ++first)
+ result.push_back(*first);
+
+ return result;
+}
+
+
+void symbol_container::build_by_loc() const
+{
+ if (!symbols_by_loc.empty())
+ return;
+
+ symbols_t::const_iterator cit = symbols.begin();
+ symbols_t::const_iterator end = symbols.end();
+ for (; cit != end; ++cit)
+ symbols_by_loc.insert(&*cit);
+}
+
+
+symbol_entry const * symbol_container::find_by_vma(string const & image_name,
+ bfd_vma vma) const
+{
+ // FIXME: this is too inefficient probably
+ symbols_t::const_iterator it;
+ for (it = symbols.begin(); it != symbols.end(); ++it) {
+ if (it->sample.vma == vma &&
+ image_names.name(it->image_name) == image_name)
+ return &*it;
+ }
+
+ return 0;
+}
+
+
+symbol_container::symbols_t::iterator symbol_container::begin()
+{
+ return symbols.begin();
+}
+
+
+symbol_container::symbols_t::iterator symbol_container::end()
+{
+ return symbols.end();
+}
+
+symbol_entry const * symbol_container::find(symbol_entry const & symbol) const
+{
+ symbols_t::const_iterator it = symbols.find(symbol);
+ return it == symbols.end() ? 0 : &*it;
+}
diff --git a/libpp/symbol_container.h b/libpp/symbol_container.h
new file mode 100644
index 0000000..4c764e1
--- /dev/null
+++ b/libpp/symbol_container.h
@@ -0,0 +1,94 @@
+/**
+ * @file symbol_container.h
+ * Internal container for symbols
+ *
+ * @remark Copyright 2002, 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#ifndef SYMBOL_CONTAINER_H
+#define SYMBOL_CONTAINER_H
+
+#include <string>
+#include <set>
+
+#include "symbol.h"
+#include "symbol_functors.h"
+
+/**
+ * An arbitrary container of symbols. Supports lookup
+ * by name, by VMA, and by file location.
+ *
+ * Lookup by name or by VMA is O(n). Lookup by file location
+ * is O(log(n)).
+ */
+class symbol_container {
+public:
+ /// container type
+ typedef std::set<symbol_entry, less_symbol> symbols_t;
+
+ typedef symbols_t::size_type size_type;
+
+ /// return the number of symbols stored
+ size_type size() const;
+
+ /**
+ * Insert a new symbol. If the symbol already exists in the container,
+ * then the sample counts are accumulated.
+ * Returns the newly created symbol or the existing one. This pointer
+ * remains valid during the whole life time of a symbol_container
+ * object and is warranted unique according to less_symbol comparator.
+ * Can only be done before any file-location based lookups, since the
+ * two lookup methods are not synchronised.
+ */
+ symbol_entry const * insert(symbol_entry const &);
+
+ /// find the symbols at the given filename and line number, if any
+ symbol_collection const find(debug_name_id filename, size_t linenr) const;
+
+ /// find the symbols defined in the given filename, if any
+ symbol_collection const find(debug_name_id filename) const;
+
+ /// find the symbol with the given image_name vma if any
+ symbol_entry const * find_by_vma(std::string const & image_name,
+ bfd_vma vma) const;
+
+ /// Search a symbol. Return NULL if not found.
+ symbol_entry const * find(symbol_entry const & symbol) const;
+
+ /// return start of symbols
+ symbols_t::iterator begin();
+
+ /// return end of symbols
+ symbols_t::iterator end();
+
+private:
+ /// build the symbol by file-location cache
+ void build_by_loc() const;
+
+ /**
+ * The main container of symbols. Multiple symbols with the same
+ * name are allowed.
+ */
+ symbols_t symbols;
+
+ /**
+ * Differently-named symbol at same file location are allowed e.g.
+ * template instantiation.
+ */
+ typedef std::multiset<symbol_entry const *, less_by_file_loc>
+ symbols_by_loc_t;
+
+ // must be declared after the set to ensure a correct life-time.
+
+ /**
+ * Symbols sorted by location order. Lazily built on request,
+ * so mutable.
+ */
+ mutable symbols_by_loc_t symbols_by_loc;
+};
+
+#endif /* SYMBOL_CONTAINER_H */
diff --git a/libpp/symbol_functors.cpp b/libpp/symbol_functors.cpp
new file mode 100644
index 0000000..a4107c3
--- /dev/null
+++ b/libpp/symbol_functors.cpp
@@ -0,0 +1,30 @@
+/**
+ * @file symbol_functors.cpp
+ * Functors for symbol/sample comparison
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#include "symbol_functors.h"
+
+bool less_symbol::operator()(symbol_entry const & lhs,
+ symbol_entry const & rhs) const
+{
+ if (lhs.image_name != rhs.image_name)
+ return lhs.image_name < rhs.image_name;
+
+ if (lhs.app_name != rhs.app_name)
+ return lhs.app_name < rhs.app_name;
+
+ if (lhs.name != rhs.name)
+ return lhs.name < rhs.name;
+
+ if (lhs.sample.vma != rhs.sample.vma)
+ return lhs.sample.vma < rhs.sample.vma;
+
+ return lhs.size < rhs.size;
+}
diff --git a/libpp/symbol_functors.h b/libpp/symbol_functors.h
new file mode 100644
index 0000000..53a7253
--- /dev/null
+++ b/libpp/symbol_functors.h
@@ -0,0 +1,38 @@
+/**
+ * @file symbol_functors.h
+ * Functors for symbol/sample comparison
+ *
+ * @remark Copyright 2002, 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#ifndef SYMBOL_FUNCTORS_H
+#define SYMBOL_FUNCTORS_H
+
+#include "symbol.h"
+
+/// compare based on file location
+struct less_by_file_loc {
+ bool operator()(sample_entry const * lhs,
+ sample_entry const * rhs) const {
+ return lhs->file_loc < rhs->file_loc;
+ }
+
+ bool operator()(symbol_entry const * lhs,
+ symbol_entry const * rhs) const {
+ return lhs->sample.file_loc < rhs->sample.file_loc;
+ }
+};
+
+
+/// compare based on symbol contents
+struct less_symbol {
+ // implementation compare by id rather than by string
+ bool operator()(symbol_entry const & lhs,
+ symbol_entry const & rhs) const;
+};
+
+#endif /* SYMBOL_FUNCTORS_H */
diff --git a/libpp/symbol_sort.cpp b/libpp/symbol_sort.cpp
new file mode 100644
index 0000000..451fe28
--- /dev/null
+++ b/libpp/symbol_sort.cpp
@@ -0,0 +1,190 @@
+/**
+ * @file symbol_sort.cpp
+ * Sorting symbols
+ *
+ * @remark Copyright 2002, 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#include "symbol_sort.h"
+#include "symbol_functors.h"
+
+#include "name_storage.h"
+#include "op_exception.h"
+
+#include <algorithm>
+#include <sstream>
+
+using namespace std;
+
+namespace {
+
+bool long_filenames;
+
+int image_compare(image_name_id l, image_name_id r)
+{
+ if (long_filenames)
+ return image_names.name(l).compare(image_names.name(r));
+ return image_names.basename(l).compare(image_names.basename(r));
+}
+
+
+int debug_compare(debug_name_id l, debug_name_id r)
+{
+ if (long_filenames)
+ return debug_names.name(l).compare(debug_names.name(r));
+ return debug_names.basename(l).compare(debug_names.basename(r));
+}
+
+
+int compare_by(sort_options::sort_order order,
+ symbol_entry const & lhs, symbol_entry const & rhs)
+{
+ switch (order) {
+ case sort_options::sample:
+ if (lhs.sample.counts[0] < rhs.sample.counts[0])
+ return 1;
+ if (lhs.sample.counts[0] > rhs.sample.counts[0])
+ return -1;
+ return 0;
+
+ case sort_options::symbol:
+ return symbol_names.demangle(lhs.name).compare(
+ symbol_names.demangle(rhs.name));
+
+ case sort_options::image:
+ return image_compare(lhs.image_name, rhs.image_name);
+
+ case sort_options::app_name:
+ return image_compare(lhs.app_name, rhs.app_name);
+
+ case sort_options::vma:
+ if (lhs.sample.vma < rhs.sample.vma)
+ return -1;
+ if (lhs.sample.vma > rhs.sample.vma)
+ return 1;
+ return 0;
+
+ case sort_options::debug: {
+ file_location const & f1 = lhs.sample.file_loc;
+ file_location const & f2 = rhs.sample.file_loc;
+ int ret = debug_compare(f1.filename, f2.filename);
+ if (ret == 0)
+ ret = f1.linenr - f2.linenr;
+ return ret;
+ }
+
+ default: {
+ // static_cast<> to shut up g++ 2.91.66 which warn
+ // about ambiguity between <<(int) and <<(long int)
+ ostringstream os;
+ os << "compare_by(): unknown sort option: "
+ << static_cast<int>(order) << endl;
+ throw op_fatal_error(os.str());
+ }
+ }
+
+ return 0;
+}
+
+
+struct symbol_compare {
+ symbol_compare(vector<sort_options::sort_order> const & order,
+ bool reverse)
+ : compare_order(order), reverse_sort(reverse) {}
+
+ bool operator()(symbol_entry const * lhs,
+ symbol_entry const * rhs) const {
+ return operator()(*lhs, *rhs);
+ }
+
+ bool operator()(symbol_entry const & lhs,
+ symbol_entry const & rhs) const;
+
+protected:
+ vector<sort_options::sort_order> const & compare_order;
+ bool reverse_sort;
+};
+
+
+bool symbol_compare::operator()(symbol_entry const & lhs,
+ symbol_entry const & rhs) const
+{
+ for (size_t i = 0; i < compare_order.size(); ++i) {
+ int ret = compare_by(compare_order[i], lhs, rhs);
+
+ if (reverse_sort)
+ ret = -ret;
+ if (ret != 0)
+ return ret < 0;
+ }
+ return false;
+}
+
+
+} // anonymous namespace
+
+
+void sort_options::
+sort(symbol_collection & syms, bool reverse_sort, bool lf) const
+{
+ long_filenames = lf;
+
+ vector<sort_order> sort_option(options);
+ for (sort_order cur = first; cur != last; cur = sort_order(cur + 1)) {
+ if (find(sort_option.begin(), sort_option.end(), cur) ==
+ sort_option.end())
+ sort_option.push_back(cur);
+ }
+
+ stable_sort(syms.begin(), syms.end(),
+ symbol_compare(sort_option, reverse_sort));
+}
+
+
+void sort_options::
+sort(diff_collection & syms, bool reverse_sort, bool lf) const
+{
+ long_filenames = lf;
+
+ vector<sort_order> sort_option(options);
+ for (sort_order cur = first; cur != last; cur = sort_order(cur + 1)) {
+ if (find(sort_option.begin(), sort_option.end(), cur) ==
+ sort_option.end())
+ sort_option.push_back(cur);
+ }
+
+ stable_sort(syms.begin(), syms.end(),
+ symbol_compare(sort_option, reverse_sort));
+}
+
+
+void sort_options::add_sort_option(string const & name)
+{
+ if (name == "vma") {
+ options.push_back(vma);
+ } else if (name == "sample") {
+ options.push_back(sample);
+ } else if (name == "symbol") {
+ options.push_back(symbol);
+ } else if (name == "debug") {
+ options.push_back(debug);
+ } else if (name == "image") {
+ options.push_back(image);
+ } else if (name == "app-name") {
+ options.push_back(app_name);
+ } else {
+ ostringstream os;
+ os << "unknown sort option: " << name << endl;
+ throw op_fatal_error(os.str());
+ }
+}
+
+
+void sort_options::add_sort_option(sort_options::sort_order order)
+{
+ options.push_back(order);
+}
diff --git a/libpp/symbol_sort.h b/libpp/symbol_sort.h
new file mode 100644
index 0000000..aadc928
--- /dev/null
+++ b/libpp/symbol_sort.h
@@ -0,0 +1,53 @@
+/**
+ * @file symbol_sort.h
+ * Sorting symbols
+ *
+ * @remark Copyright 2002, 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#ifndef SYMBOL_SORT_H
+#define SYMBOL_SORT_H
+
+#include "symbol.h"
+
+#include <vector>
+#include <string>
+
+struct sort_options {
+ enum sort_order {
+ // order give sort order if caller doesn't specify one
+ first,
+ sample = first,
+ image,
+ app_name,
+ symbol,
+ debug,
+ vma,
+ last
+ };
+
+ sort_options() {}
+
+ void add_sort_option(std::string const & name);
+ void add_sort_option(sort_order order);
+
+ /**
+ * Sort the given container by the given criteria.
+ */
+ void sort(symbol_collection & syms, bool reverse_sort,
+ bool long_filenames) const;
+
+ /**
+ * Sort the given container by the given criteria.
+ */
+ void sort(diff_collection & syms, bool reverse_sort,
+ bool long_filenames) const;
+
+ std::vector<sort_order> options;
+};
+
+#endif // SYMBOL_SORT_H
diff --git a/libpp/xml_utils.cpp b/libpp/xml_utils.cpp
new file mode 100644
index 0000000..2e189f8
--- /dev/null
+++ b/libpp/xml_utils.cpp
@@ -0,0 +1,1038 @@
+/**
+ * @file xml_utils.cpp
+ * utility routines for generating XML
+ *
+ * @remark Copyright 2006 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Dave Nomura
+ */
+
+#include <iostream>
+#include <sstream>
+
+#include "xml_utils.h"
+#include "format_output.h"
+#include "arrange_profiles.h"
+#include "op_bfd.h"
+#include "cverb.h"
+
+using namespace std;
+
+bool want_xml = false;
+
+size_t nr_classes = 0;
+size_t nr_cpus = 0;
+size_t nr_events = 0;
+sym_iterator symbols_begin;
+sym_iterator symbols_end;
+// handle on xml_formatter object
+format_output::xml_formatter * xml_out;
+xml_utils * xml_support;
+size_t xml_utils::events_index = 0;
+bool xml_utils::has_nonzero_masks = false;
+ostringstream xml_options;
+
+
+
+namespace {
+
+bool has_separated_cpu_info()
+{
+ return classes.v[0].ptemplate.cpu != "all";
+}
+
+
+string get_event_num(size_t pclass)
+{
+ return classes.v[pclass].ptemplate.event;
+}
+
+
+size_t get_next_event_num_pclass(size_t start)
+{
+ string cur_event = get_event_num(start);
+ size_t i;
+ for (i = start;
+ i < nr_classes && get_event_num(i) == cur_event;
+ ++i) ;
+ return i;
+}
+
+
+void dump_symbol(string const & prefix, sym_iterator it, bool want_nl = true)
+{
+ if (it == symbols_end)
+ cverb << vxml << prefix << "END";
+ else
+ cverb << vxml << prefix << symbol_names.name((*it)->name);
+ if (want_nl)
+ cverb << vxml << endl;
+}
+
+
+void dump_symbols(string const & prefix, sym_iterator b, sym_iterator e)
+{
+ if (b == (sym_iterator)0)
+ return;
+
+ for (sym_iterator it = b; it != e; ++it)
+ dump_symbol(prefix, it, true);
+}
+
+
+
+void dump_classes()
+{
+ cverb << vxml << "<!-- classes dump" << endl;
+ cverb << vxml << classes.event;
+ cverb << vxml << "classes.size= " << classes.v.size() << endl;
+ for (size_t i = 0; i < classes.v.size(); ++i) {
+ cverb << vxml << "--- class " << i << ":" << classes.v[i].name << " ---" << endl;
+ cverb << vxml << classes.v[i].ptemplate;
+ }
+ cverb << vxml << "-->" << endl;
+}
+
+
+bool has_separated_thread_info()
+{
+ return classes.v[0].ptemplate.tid != "all";
+}
+
+
+string get_cpu_num(size_t pclass)
+{
+ return classes.v[pclass].ptemplate.cpu;
+}
+
+
+}; // anonymous namespace
+
+xml_utils::xml_utils(format_output::xml_formatter * xo,
+ symbol_collection const & s, size_t nc,
+ extra_images const & extra)
+ :
+ has_subclasses(false),
+ bytes_index(0),
+ extra_found_images(extra)
+{
+ xml_out = xo;
+ nr_classes = nc;
+ symbols_begin = s.begin();
+ symbols_end = s.end();
+ multiple_events = get_next_event_num_pclass(0) != nr_classes;
+
+ if (has_separated_cpu_info()) {
+ size_t cpus = 0;
+ // count number of cpus
+ for (size_t p = 0; p < nr_classes; ++p) {
+ size_t cpu = atoi(classes.v[p].ptemplate.cpu.c_str());
+ if (cpu > cpus) cpus = cpu;
+ }
+ // cpus names start with 0
+ nr_cpus = cpus + 1;
+ }
+}
+
+
+string xml_utils::get_timer_setup(size_t count)
+{
+ return open_element(TIMER_SETUP, true) +
+ init_attr(RTC_INTERRUPTS, count) + close_element();
+}
+
+
+string xml_utils::get_event_setup(string event, size_t count,
+ string unit_mask)
+{
+ ostringstream str;
+
+ str << open_element(EVENT_SETUP, true);
+ str << init_attr(TABLE_ID, events_index++);
+ str << init_attr(EVENT_NAME, event);
+ if (unit_mask.size() != 0) str << init_attr(UNIT_MASK, unit_mask);
+ str << init_attr(SETUP_COUNT, (size_t)count) + close_element();
+ return str.str();
+}
+
+
+string xml_utils::get_profile_header(string cpu_name, double const speed)
+{
+ ostringstream str;
+ string cpu_type;
+ string processor;
+ string::size_type slash_pos = cpu_name.find("/");
+
+ if (slash_pos == string::npos) {
+ cpu_type = cpu_name;
+ processor = "";
+ } else {
+ cpu_type = cpu_name.substr(0, slash_pos);
+ processor = cpu_name.substr(slash_pos+1);
+ }
+
+ str << init_attr(CPU_NAME, cpu_type) << endl;
+ if (processor.size() > 0)
+ str << init_attr(PROCESSOR, string(processor)) << endl;
+ if (nr_cpus > 1) str << init_attr(SEPARATED_CPUS, nr_cpus) << endl;
+ str << init_attr(MHZ, speed) << endl;
+
+ return str.str();
+}
+
+
+void xml_utils::set_nr_cpus(size_t cpus)
+{
+ nr_cpus = cpus;
+}
+
+void xml_utils::set_nr_events(size_t events)
+{
+ nr_events = events;
+}
+
+void xml_utils::set_has_nonzero_masks()
+{
+ has_nonzero_masks = true;
+}
+
+
+void xml_utils::add_option(tag_t tag, string const & value)
+{
+ xml_options << init_attr(tag, value);
+}
+
+
+void xml_utils::add_option(tag_t tag, list<string> const & value)
+{
+ list<string>::const_iterator begin = value.begin();
+ list<string>::const_iterator end = value.end();
+ list<string>::const_iterator cit = begin;
+ ostringstream str;
+
+ for (; cit != end; ++cit) {
+ if (cit != begin)
+ str << ",";
+ str << *cit;
+ }
+ xml_options << init_attr(tag, str.str());
+}
+
+
+void xml_utils::add_option(tag_t tag, vector<string> const & value)
+{
+ vector<string>::const_iterator begin = value.begin();
+ vector<string>::const_iterator end = value.end();
+ vector<string>::const_iterator cit = begin;
+ ostringstream str;
+
+ for (; cit != end; ++cit) {
+ if (cit != begin)
+ str << ",";
+ str << *cit;
+ }
+ xml_options << init_attr(tag, str.str());
+}
+
+
+void xml_utils::add_option(tag_t tag, bool value)
+{
+ xml_options << init_attr(tag, (value ? "true" : "false"));
+}
+
+
+void xml_utils::output_xml_header(string const & command_options,
+ string const & cpu_info, string const & events)
+{
+ // the integer portion indicates the schema version and should change
+ // both here and in the schema file when major changes are made to
+ // the schema. changes to opreport, or minor changes to the schema
+ // can be indicated by changes to the fraction part.
+ string const schema_version = "3.0";
+
+ // This is the XML version, not schema version.
+ string const xml_header = "<?xml version=\"1.0\" ?>";
+
+ cout << xml_header << endl;
+ cout << open_element(PROFILE, true);
+ cout << init_attr(SCHEMA_VERSION, schema_version);
+
+ cout << cpu_info;
+ cout << init_attr(TITLE, "opreport " + command_options);
+ cout << close_element(NONE, true);
+
+ cout << open_element(OPTIONS, true) << xml_options.str();
+ cout << close_element();
+
+ cout << open_element(SETUP) << events;
+ cout << close_element(SETUP) << endl;
+}
+
+class subclass_info_t {
+public:
+ string unitmask;
+ string subclass_name;
+};
+
+typedef growable_vector<subclass_info_t> subclass_array_t;
+typedef growable_vector<subclass_array_t> event_subclass_t;
+typedef growable_vector<event_subclass_t> cpu_subclass_t;
+
+void xml_utils::build_subclasses(ostream & out)
+{
+ size_t subclasses = 0;
+ string subclass_name;
+ // when --separate=cpu we will have an event_subclass array for each cpu
+ cpu_subclass_t cpu_subclasses;
+
+ event_subclass_t event_subclasses;
+
+ if (nr_cpus <= 1 && nr_events <= 1 && !has_nonzero_masks)
+ return;
+
+ out << open_element(CLASSES);
+ for (size_t i = 0; i < classes.v.size(); ++i) {
+ profile_class & pclass = classes.v[i];
+ size_t event = atoi(pclass.ptemplate.event.c_str());
+
+ subclass_array_t * sc_ptr;
+
+ // select the right subclass array
+ if (nr_cpus == 1) {
+ sc_ptr = &event_subclasses[event];
+ } else {
+ size_t cpu = atoi(pclass.ptemplate.cpu.c_str());
+ sc_ptr = &cpu_subclasses[cpu][event];
+ }
+
+ // search for an existing unitmask
+ subclass_name = "";
+ for (size_t j = 0; j < sc_ptr->size(); ++j) {
+ if ((*sc_ptr)[j].unitmask == pclass.ptemplate.unitmask) {
+ subclass_name = (*sc_ptr)[j].subclass_name;
+ break;
+ }
+ }
+
+ if (subclass_name.size() == 0) {
+ ostringstream str;
+ size_t new_index = sc_ptr->size();
+
+ // no match found, create a new entry
+ str << "c" << subclasses++;
+ subclass_name = str.str();
+ (*sc_ptr)[new_index].unitmask = pclass.ptemplate.unitmask;
+ (*sc_ptr)[new_index].subclass_name = subclass_name;
+ out << open_element(CLASS, true);
+ out << init_attr(NAME, subclass_name);
+ if (nr_cpus > 1)
+ out << init_attr(CPU_NUM, pclass.ptemplate.cpu);
+ if (nr_events > 1)
+ out << init_attr(EVENT_NUM, event);
+ if (has_nonzero_masks)
+ out << init_attr(EVENT_MASK, pclass.ptemplate.unitmask);
+ out << close_element();
+ }
+
+ pclass.name = subclass_name;
+ }
+ out << close_element(CLASSES);
+ has_subclasses = true;
+}
+
+
+string
+get_counts_string(count_array_t const & counts, size_t begin, size_t end)
+{
+ ostringstream str;
+ bool got_count = false;
+
+ // if no cpu separation then return a simple count, omit zero counts
+ if (nr_cpus == 1) {
+ size_t count = counts[begin];
+ if (count == 0)
+ return "";
+ str << count;
+ return str.str();
+ }
+
+ for (size_t p = begin; p != end; ++p) {
+ size_t count = counts[p];
+ if (p != begin) str << ",";
+ if (count != 0) {
+ got_count = true;
+ str << count;
+ }
+ }
+ return got_count ? str.str() : "";
+}
+
+
+void
+xml_utils::output_symbol_bytes(ostream & out, symbol_entry const * symb,
+ size_t sym_id, op_bfd const & abfd)
+{
+ size_t size = symb->size;
+ scoped_array<unsigned char> contents(new unsigned char[size]);
+ if (abfd.get_symbol_contents(symb->sym_index, contents.get())) {
+ string const name = symbol_names.name(symb->name);
+ out << open_element(BYTES, true) << init_attr(TABLE_ID, sym_id);
+ out << close_element(NONE, true);
+ for (size_t i = 0; i < size; ++i) {
+ char hex_map[] = "0123456789ABCDEF";
+ char hex[2];
+ hex[0] = hex_map[(contents[i] >> 4) & 0xf];
+ hex[1] = hex_map[contents[i] & 0xf];
+ out << hex[0] << hex[1];
+ }
+ out << close_element(BYTES);
+ }
+}
+
+
+bool
+xml_utils::output_summary_data(ostream & out, count_array_t const & summary, size_t pclass)
+{
+ size_t const count = summary[pclass];
+
+ if (count == 0)
+ return false;
+
+ out << open_element(COUNT, has_subclasses);
+ if (has_subclasses) {
+ out << init_attr(CLASS, classes.v[pclass].name);
+ out << close_element(NONE, true);
+ }
+ out << count;
+ out << close_element(COUNT);
+ return true;
+}
+
+class module_info {
+public:
+ module_info()
+ { lo = hi = 0; name = ""; begin = end = (sym_iterator)0;}
+ void dump();
+ void build_module(string const & n, sym_iterator it,
+ size_t l, size_t h);
+ string get_name() { return name; }
+ void set_lo(size_t l) { lo = l; }
+ void set_hi(size_t h) { hi = h; }
+ count_array_t const & get_summary() { return summary; }
+ void set_begin(sym_iterator b);
+ void set_end(sym_iterator e);
+ void add_to_summary(count_array_t const & counts);
+ void output(ostream & out);
+ bool is_closed(string const & n);
+protected:
+ void output_summary(ostream & out);
+ void output_symbols(ostream & out, bool is_module);
+
+ string name;
+ sym_iterator begin;
+ sym_iterator end;
+
+ // summary sample data
+ count_array_t summary;
+
+ // range of profile classes approprate for this module
+ size_t lo;
+ size_t hi;
+};
+
+class thread_info : public module_info {
+public:
+ thread_info() { nr_modules = 0; }
+
+ void build_thread(string const & tid, size_t l, size_t h);
+ bool add_modules(string const & module, sym_iterator it);
+ void add_module_symbol(string const & n, sym_iterator it);
+ void summarize();
+ void set_end(sym_iterator end);
+ string const get_tid() { return thread_id; }
+ void output(ostream & out);
+ void dump();
+private:
+ // indices into the classes array applicable to this process
+ size_t nr_modules;
+ string thread_id;
+ growable_vector<module_info> my_modules;
+};
+
+class process_info : public module_info {
+public:
+ process_info() { nr_threads = 0; }
+ void build_process(string const & pid, size_t l, size_t h);
+ void add_thread(string const & tid, size_t l, size_t h);
+ void add_modules(string const & module,
+ string const & app_name, sym_iterator it);
+ void summarize();
+ void set_end(sym_iterator end);
+ void output(ostream & out);
+ void dump();
+private:
+ size_t nr_threads;
+ string process_id;
+ growable_vector<thread_info> my_threads;
+
+};
+class process_root_info {
+public:
+ process_root_info() { nr_processes = 0; }
+ process_info * add_process(string const & pid, size_t lo, size_t hi);
+ void add_modules(string const & module, string const & app_name,
+ sym_iterator it);
+ void summarize();
+ void summarize_processes(extra_images const & extra_found_images);
+ void set_process_end();
+ void output_process_symbols(ostream & out);
+ void dump_processes();
+private:
+ size_t nr_processes;
+
+ growable_vector<process_info> processes;
+};
+
+class binary_info : public module_info {
+public:
+ binary_info() { nr_modules = 0; }
+ void output(ostream & out);
+ binary_info * build_binary(string const & n);
+ void add_module_symbol(string const & module, string const & app,
+ sym_iterator it);
+ void close_binary(sym_iterator it);
+ void dump();
+private:
+ size_t nr_modules;
+
+ growable_vector<module_info> my_modules;
+};
+
+
+class binary_root_info {
+public:
+ binary_root_info() { nr_binaries = 0; }
+ binary_info * add_binary(string const & n, sym_iterator it);
+ void summarize_binaries(extra_images const & extra_found_images);
+ void output_binary_symbols(ostream & out);
+ void dump_binaries();
+private:
+ size_t nr_binaries;
+
+ growable_vector<binary_info> binaries;
+};
+
+static process_root_info processes_root;
+static binary_root_info binaries_root;
+
+
+void module_info::
+build_module(string const & n, sym_iterator it, size_t l, size_t h)
+{
+ name = n;
+ begin = it;
+ lo = l;
+ hi = h;
+}
+
+
+void module_info::add_to_summary(count_array_t const & counts)
+{
+ for (size_t pclass = lo ; pclass <= hi; ++pclass)
+ summary[pclass] += counts[pclass];
+}
+
+
+void module_info::set_begin(sym_iterator b)
+{
+ if (begin == (sym_iterator)0)
+ begin = b;
+}
+
+
+void module_info::set_end(sym_iterator e)
+{
+ if (end == (sym_iterator)0)
+ end = e;
+}
+
+
+bool module_info::is_closed(string const & n)
+{
+ return (name == n) && end != (sym_iterator)0;
+}
+
+
+void module_info::dump()
+{
+ cverb << vxml << " module:class(" << lo << "," << hi << ")=";
+ cverb << vxml << name << endl;
+ dump_symbols(" ", begin, end);
+}
+
+
+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, true);
+ out << close_element(MODULE);
+}
+
+
+void module_info::output_summary(ostream & out)
+{
+ for (size_t p = lo; p <= hi; ++p)
+ (void)xml_support->output_summary_data(out, summary, p);
+}
+
+
+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, is_module);
+}
+
+
+void binary_info::close_binary(sym_iterator it)
+{
+ set_end(it);
+ if (nr_modules > 0) {
+ module_info & m = my_modules[nr_modules-1];
+ m.set_end(it);
+ }
+}
+
+
+void binary_info::dump()
+{
+ cverb << vxml << "app_name=" << name << endl;
+ if (begin != (sym_iterator)0)
+ dump_symbols(" ", begin, end);
+
+ for (size_t i = 0; i < nr_modules; ++i)
+ my_modules[i].dump();
+}
+
+
+void binary_info::
+add_module_symbol(string const & module, string const & app,
+ sym_iterator it)
+{
+ size_t m = nr_modules;
+
+ if (module == app) {
+ // set begin symbol for binary if not set
+ set_begin(it);
+
+ if (m > 0) {
+ // close out current module
+ module_info & mod = my_modules[m-1];
+ mod.set_end(it);
+ }
+
+ // add symbol count to binary count
+ add_to_summary((*it)->sample.counts);
+ return;
+ }
+
+ string current_module_name = (m == 0 ? "" : my_modules[m-1].get_name());
+ if (module != current_module_name) {
+ // we have a module distinct from it's binary: --separate=lib
+ // and this is the first symbol for this module
+ if (m != 0) {
+ // close out current module
+ module_info & mod = my_modules[m-1];
+ mod.set_end(it);
+ add_to_summary(mod.get_summary());
+ }
+
+ // mark end of enclosing binary symbols if there have been any
+ // NOTE: it is possible for the binary's symbols to follow its
+ // module symbols
+ if (begin != (sym_iterator)0 && end == (sym_iterator)0)
+ set_end(it);
+
+ // build the new module
+ nr_modules++;
+ my_modules[m].build_module(module, it, 0, nr_classes-1);
+ }
+
+ // propagate this symbols counts to the module
+ my_modules[nr_modules-1].add_to_summary((*it)->sample.counts);
+}
+
+
+void binary_root_info::
+summarize_binaries(extra_images const & extra_found_images)
+{
+ binary_info * current_binary = 0;
+ string current_binary_name = "";
+
+ for (sym_iterator it = symbols_begin ; it != symbols_end; ++it) {
+ string binary = get_image_name((*it)->app_name,
+ image_name_storage::int_filename, extra_found_images);
+ string module = get_image_name((*it)->image_name,
+ image_name_storage::int_filename, extra_found_images);
+
+ if (binary != current_binary_name) {
+ current_binary = binaries_root.add_binary(binary, it);
+ current_binary_name = binary;
+ }
+
+ current_binary->add_module_symbol(module, binary, it);
+ }
+
+ // close out last binary and module
+ current_binary->close_binary(symbols_end);
+}
+
+
+process_info *
+process_root_info::add_process(string const & pid, size_t lo, size_t hi)
+{
+ processes[nr_processes].build_process(pid, lo, hi);
+ return &processes[nr_processes++];
+}
+
+
+void process_root_info::
+add_modules(string const & module, string const & app_name,
+ sym_iterator it)
+{
+ for (size_t p = 0; p < nr_processes; ++p)
+ processes[p].add_modules(module, app_name, it);
+}
+
+
+
+void process_root_info::summarize()
+{
+ for (size_t p = 0; p < nr_processes; ++p)
+ processes[p].summarize();
+}
+
+
+void process_root_info::
+summarize_processes(extra_images const & extra_found_images)
+{
+ // add modules to the appropriate threads in the process hierarchy
+ for (sym_iterator it = symbols_begin ; it != symbols_end; ++it) {
+ string binary = get_image_name((*it)->app_name,
+ image_name_storage::int_filename, extra_found_images);
+ string module = get_image_name((*it)->image_name,
+ image_name_storage::int_filename, extra_found_images);
+
+ processes_root.add_modules(module, binary, it);
+ }
+
+ // set end symbol boundary for all modules in all threads
+ processes_root.set_process_end();
+
+ // propagate summaries to process/thread
+ processes_root.summarize();
+}
+
+
+void process_root_info::set_process_end()
+{
+ for (size_t p = 0; p < nr_processes; ++p)
+ processes[p].set_end(symbols_end);
+}
+
+void process_root_info::output_process_symbols(ostream & out)
+{
+ for (size_t p = 0; p < nr_processes; ++p)
+ processes[p].output(out);
+}
+
+
+void process_root_info::dump_processes()
+{
+ cverb << vxml << "<!-- processes_dump:" << endl;
+ for (size_t p = 0; p < nr_processes; ++p)
+ processes[p].dump();
+ cverb << vxml << "end processes_dump -->" << endl;
+}
+
+binary_info *
+binary_info::build_binary(string const & n)
+{
+ name = n;
+ lo = 0;
+ hi = nr_classes-1;
+ return this;
+}
+
+
+void binary_info::output(ostream & out)
+{
+ out << open_element(BINARY, true);
+ out << init_attr(NAME, name) << close_element(NONE, true);
+
+ output_summary(out);
+ output_symbols(out, false);
+ for (size_t a = 0; a < nr_modules; ++a)
+ my_modules[a].output(out);
+
+ out << close_element(BINARY);
+}
+
+
+binary_info *
+binary_root_info::add_binary(string const & n, sym_iterator it)
+{
+ size_t a = nr_binaries++;
+
+ // close out previous binary and module
+ if (a > 0) binaries[a-1].close_binary(it);
+ return binaries[a].build_binary(n);
+}
+
+
+void binary_root_info::output_binary_symbols(ostream & out)
+{
+ for (size_t a = 0; a < nr_binaries; ++a)
+ binaries[a].output(out);
+}
+
+
+void binary_root_info::dump_binaries()
+{
+ cverb << vxml << "<!-- binaries_dump:" << endl;
+ for (size_t p = 0; p < nr_binaries; ++p)
+ binaries[p].dump();
+ cverb << vxml << "end processes_dump -->" << endl;
+}
+
+
+void process_info::build_process(string const & pid, size_t l, size_t h)
+{
+ process_id = pid;
+ lo = l;
+ hi = h;
+}
+
+
+void process_info::add_thread(string const & tid, size_t l, size_t h)
+{
+ my_threads[nr_threads++].build_thread(tid, l, h);
+}
+
+
+void process_info::add_modules(string const & module,
+ string const & app_name, sym_iterator it)
+{
+ bool added = false;
+ for (size_t t = 0; t < nr_threads; ++t)
+ added |= my_threads[t].add_modules(module, it);
+ if (added && name.size() == 0) name = app_name;
+}
+
+
+void process_info::summarize()
+{
+ for (size_t t = 0; t < nr_threads; ++t) {
+ thread_info & thr = my_threads[t];
+ thr.summarize();
+ add_to_summary(thr.get_summary());
+ }
+}
+
+
+void thread_info::build_thread(string const & tid, size_t l, size_t h)
+{
+ thread_id = tid;
+ lo = l;
+ hi = h;
+}
+
+
+void thread_info::summarize()
+{
+ for (size_t m = 0; m < nr_modules; ++m)
+ add_to_summary(my_modules[m].get_summary());
+}
+
+
+void thread_info::set_end(sym_iterator end)
+{
+ for (size_t m = 0; m < nr_modules; ++m)
+ my_modules[m].set_end(end);
+}
+
+
+void thread_info::add_module_symbol(string const & n, sym_iterator it)
+{
+ module_info & m = my_modules[nr_modules++];
+ m.build_module(n, it, lo, hi);
+ m.add_to_summary((*it)->sample.counts);
+}
+
+void thread_info::output(ostream & out)
+{
+ ostringstream thread_summary;
+ ostringstream modules_output;
+
+ output_summary(thread_summary);
+
+ for (size_t m = 0; m < nr_modules; ++m)
+ my_modules[m].output(modules_output);
+
+ // ignore threads with no sample data
+ if (modules_output.str().size() == 0 && thread_summary.str().size() == 0)
+ return;
+
+ out << open_element(THREAD, true);
+ out << init_attr(THREAD_ID, thread_id) << close_element(NONE, true);
+ out << thread_summary.str();
+ out << modules_output.str();
+ out << close_element(THREAD);
+}
+
+
+bool thread_info::add_modules(string const & module, sym_iterator it)
+{
+ string old_name =
+ (nr_modules == 0 ? "" : my_modules[nr_modules-1].get_name());
+ if (nr_modules > 0 && old_name != module) {
+ module_info & m = my_modules[nr_modules-1];
+ // close out previous module if it hasn't already been closed out
+ if (!m.is_closed(old_name))
+ m.set_end(it);
+ }
+
+ // add a new module for this symbol if it has a non-zero count
+ if (nr_modules == 0 || module != old_name) {
+ if (has_sample_counts((*it)->sample.counts, lo, hi)) {
+ add_module_symbol(module, it);
+ return true;
+ }
+ } else {
+ // propagate symbols count to module
+ my_modules[nr_modules-1].add_to_summary((*it)->sample.counts);
+ }
+ return false;
+}
+
+
+void thread_info::dump()
+{
+ cverb << vxml << "tid=" << thread_id << endl;
+ for (size_t i = 0; i < nr_modules; ++i)
+ my_modules[i].dump();
+}
+
+
+void process_info::set_end(sym_iterator end)
+{
+ for (size_t t = 0; t < nr_threads; ++t)
+ my_threads[t].set_end(end);
+}
+
+
+void process_info::output(ostream & out)
+{
+ ostringstream process_summary;
+ ostringstream thread_output;
+
+ output_summary(process_summary);
+
+ for (size_t t = 0; t < nr_threads; ++t)
+ my_threads[t].output(thread_output);
+
+ // ignore processes with no sample data
+ if (thread_output.str().size() == 0 && process_summary.str().size() == 0)
+ return;
+
+ out << open_element(PROCESS, true);
+ out << init_attr(PROC_ID, process_id);
+ out << init_attr(NAME, name) << close_element(NONE, true);
+ out << process_summary.str();
+ out << thread_output.str();
+ out << close_element(PROCESS);
+}
+
+
+void process_info::dump()
+{
+ cverb << vxml << "pid=" << process_id << " app=" << name << endl;
+ for (size_t i = 0; i < nr_threads; ++i)
+ my_threads[i].dump();
+}
+
+size_t get_next_tgid_pclass(size_t start)
+{
+ string cur_tgid = classes.v[start].ptemplate.tgid;
+ size_t i = start;
+ for (i = start;
+ i < nr_classes && classes.v[i].ptemplate.tgid == cur_tgid;
+ ++i) ;
+ return i;
+}
+
+
+size_t get_next_tid_pclass(size_t start)
+{
+ string cur_tid = classes.v[start].ptemplate.tid;
+ size_t i;
+ for (i = start;
+ i < nr_classes && classes.v[i].ptemplate.tid == cur_tid;
+ ++i) ;
+ return i;
+}
+
+
+// build the process/thread/module hierarchy that will allow us later
+// to collect the summary sample data at each level and then
+// traverse the hierarchy to intersperse the summary data for the
+// symbols
+void build_process_tree()
+{
+ size_t tgid = 0;
+ size_t tid = 0;
+
+ // build the structure representing the process/thread/module hierarchy
+ // for holding the summary data associated with each level and to be
+ // traversed when outputting the body of the XML
+ do {
+ size_t next_tgid = get_next_tgid_pclass(tgid);
+ string const tgid_str = classes.v[tgid].ptemplate.tgid;
+
+ process_info * p = processes_root.add_process(tgid_str, tgid, next_tgid-1);
+
+ do {
+ size_t next_tid = get_next_tid_pclass(tid);
+
+ // build array of threads associated with this process
+ p->add_thread(classes.v[tid].ptemplate.tid, tid, next_tid-1);
+ tid = next_tid;
+ } while (tid != next_tgid);
+ tgid = next_tgid;
+ } while (tgid != nr_classes);
+}
+
+void xml_utils::output_program_structure(ostream & out)
+{
+
+ if (cverb << vxml)
+ dump_classes();
+
+ if (has_separated_thread_info()) {
+ build_process_tree();
+ processes_root.summarize_processes(extra_found_images);
+ if (cverb << vxml)
+ processes_root.dump_processes();
+ processes_root.output_process_symbols(out);
+ } else {
+ binaries_root.summarize_binaries(extra_found_images);
+ if (cverb << vxml)
+ binaries_root.dump_binaries();
+ binaries_root.output_binary_symbols(out);
+ }
+}
diff --git a/libpp/xml_utils.h b/libpp/xml_utils.h
new file mode 100644
index 0000000..668e943
--- /dev/null
+++ b/libpp/xml_utils.h
@@ -0,0 +1,65 @@
+/**
+ * @file xml_utils.h
+ * utility routines for generating XML
+ *
+ * @remark Copyright 2006 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Dave Nomura
+ */
+
+#ifndef XML_UTILS_H
+#define XML_UTILS_H
+
+#include "symbol.h"
+#include "format_output.h"
+#include "xml_output.h"
+
+typedef symbol_collection::const_iterator sym_iterator;
+extern bool want_xml;
+
+class extra_images;
+class op_bfd;
+
+class xml_utils {
+public:
+ xml_utils(format_output::xml_formatter * xo,
+ symbol_collection const & s, size_t nc,
+ extra_images const & extra);
+ // these members are static because they are invoked before
+ // the xml_utils object has been created
+ static std::string get_timer_setup(size_t count);
+ static std::string get_event_setup(std::string event, size_t count,
+ std::string unit_mask);
+ static std::string get_profile_header(std::string cpu_name,
+ double const speed);
+ static void set_nr_cpus(size_t cpus);
+ static void set_nr_events(size_t events);
+ static void set_has_nonzero_masks();
+ static void add_option(tag_t tag, bool value);
+ static void add_option(tag_t tag, std::string const & value);
+ static void add_option(tag_t tag, std::vector<std::string> const & value);
+ static void add_option(tag_t tag, std::list<std::string> const & value);
+
+ static void output_xml_header(std::string const & command_options,
+ std::string const & cpu_info,
+ std::string const & events);
+ void output_symbol_bytes(std::ostream & out, symbol_entry const * symb,
+ size_t sym_id, op_bfd const & abfd);
+ bool output_summary_data(std::ostream & out, count_array_t const & summary,
+ size_t pclass);
+ size_t get_symbol_index(sym_iterator const it);
+ void output_program_structure(std::ostream & out);
+ void build_subclasses(std::ostream & out);
+private:
+ bool multiple_events;
+ bool has_subclasses;
+ size_t bytes_index;
+ extra_images const & extra_found_images;
+ static bool has_nonzero_masks;
+ static size_t events_index;
+};
+
+extern xml_utils * xml_support;
+
+#endif /* !XML_UTILS_H */
diff --git a/libregex/Makefile.am b/libregex/Makefile.am
new file mode 100644
index 0000000..012d307
--- /dev/null
+++ b/libregex/Makefile.am
@@ -0,0 +1,17 @@
+SUBDIRS = . tests
+
+AM_CPPFLAGS = -I ${top_srcdir}/libutil++
+AM_CXXFLAGS = @OP_CXXFLAGS@
+
+noinst_LIBRARIES = libop_regex.a
+
+libop_regex_a_SOURCES = \
+ op_regex.cpp \
+ op_regex.h \
+ demangle_symbol.h \
+ demangle_symbol.cpp \
+ demangle_java_symbol.h \
+ demangle_java_symbol.cpp
+
+datadir = $(prefix)/share/oprofile
+nodist_data_DATA = stl.pat
diff --git a/libregex/Makefile.in b/libregex/Makefile.in
new file mode 100644
index 0000000..1c0038c
--- /dev/null
+++ b/libregex/Makefile.in
@@ -0,0 +1,641 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = libregex
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(srcdir)/stl.pat.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/binutils.m4 \
+ $(top_srcdir)/m4/builtinexpect.m4 \
+ $(top_srcdir)/m4/cellspubfdsupport.m4 \
+ $(top_srcdir)/m4/compileroption.m4 \
+ $(top_srcdir)/m4/configmodule.m4 \
+ $(top_srcdir)/m4/copyifchange.m4 $(top_srcdir)/m4/docbook.m4 \
+ $(top_srcdir)/m4/extradirs.m4 $(top_srcdir)/m4/findkernel.m4 \
+ $(top_srcdir)/m4/kerneloption.m4 \
+ $(top_srcdir)/m4/kernelversion.m4 \
+ $(top_srcdir)/m4/mallocattribute.m4 \
+ $(top_srcdir)/m4/poptconst.m4 \
+ $(top_srcdir)/m4/precompiledheader.m4 $(top_srcdir)/m4/qt.m4 \
+ $(top_srcdir)/m4/resultyn.m4 $(top_srcdir)/m4/sstream.m4 \
+ $(top_srcdir)/m4/typedef.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES = stl.pat
+LIBRARIES = $(noinst_LIBRARIES)
+ARFLAGS = cru
+libop_regex_a_AR = $(AR) $(ARFLAGS)
+libop_regex_a_LIBADD =
+am_libop_regex_a_OBJECTS = op_regex.$(OBJEXT) \
+ demangle_symbol.$(OBJEXT) demangle_java_symbol.$(OBJEXT)
+libop_regex_a_OBJECTS = $(am_libop_regex_a_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libop_regex_a_SOURCES)
+DIST_SOURCES = $(libop_regex_a_SOURCES)
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-exec-recursive install-info-recursive \
+ install-recursive installcheck-recursive installdirs-recursive \
+ pdf-recursive ps-recursive uninstall-info-recursive \
+ uninstall-recursive
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(datadir)"
+nodist_dataDATA_INSTALL = $(INSTALL_DATA)
+DATA = $(nodist_data_DATA)
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFD_LIBS = @BFD_LIBS@
+BUILD_JVMPI_AGENT_FALSE = @BUILD_JVMPI_AGENT_FALSE@
+BUILD_JVMPI_AGENT_TRUE = @BUILD_JVMPI_AGENT_TRUE@
+BUILD_JVMTI_AGENT_FALSE = @BUILD_JVMTI_AGENT_FALSE@
+BUILD_JVMTI_AGENT_TRUE = @BUILD_JVMTI_AGENT_TRUE@
+CAT_ENTRY_END = @CAT_ENTRY_END@
+CAT_ENTRY_START = @CAT_ENTRY_START@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOCBOOK_ROOT = @DOCBOOK_ROOT@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+EXTRA_CFLAGS_MODULE = @EXTRA_CFLAGS_MODULE@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAVA_HOMEDIR = @JAVA_HOMEDIR@
+KINC = @KINC@
+KSRC = @KSRC@
+KVERS = @KVERS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBERTY_LIBS = @LIBERTY_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MOC = @MOC@
+MODINSTALLDIR = @MODINSTALLDIR@
+OBJEXT = @OBJEXT@
+OPROFILE_DIR = @OPROFILE_DIR@
+OPROFILE_MODULE_ARCH = @OPROFILE_MODULE_ARCH@
+OP_CFLAGS = @OP_CFLAGS@
+OP_CXXFLAGS = @OP_CXXFLAGS@
+OP_DOCDIR = @OP_DOCDIR@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POPT_LIBS = @POPT_LIBS@
+PTRDIFF_T_TYPE = @PTRDIFF_T_TYPE@
+QT_INCLUDES = @QT_INCLUDES@
+QT_LDFLAGS = @QT_LDFLAGS@
+QT_LIB = @QT_LIB@
+QT_VERSION = @QT_VERSION@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIZE_T_TYPE = @SIZE_T_TYPE@
+STRIP = @STRIP@
+UIC = @UIC@
+VERSION = @VERSION@
+XML_CATALOG = @XML_CATALOG@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = $(prefix)/share/oprofile
+exec_prefix = @exec_prefix@
+have_qt_FALSE = @have_qt_FALSE@
+have_qt_TRUE = @have_qt_TRUE@
+have_xsltproc_FALSE = @have_xsltproc_FALSE@
+have_xsltproc_TRUE = @have_xsltproc_TRUE@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+kernel_support_FALSE = @kernel_support_FALSE@
+kernel_support_TRUE = @kernel_support_TRUE@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+topdir = @topdir@
+SUBDIRS = . tests
+AM_CPPFLAGS = -I ${top_srcdir}/libutil++
+AM_CXXFLAGS = @OP_CXXFLAGS@
+noinst_LIBRARIES = libop_regex.a
+libop_regex_a_SOURCES = \
+ op_regex.cpp \
+ op_regex.h \
+ demangle_symbol.h \
+ demangle_symbol.cpp \
+ demangle_java_symbol.h \
+ demangle_java_symbol.cpp
+
+nodist_data_DATA = stl.pat
+all: all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libregex/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign libregex/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+stl.pat: $(top_builddir)/config.status $(srcdir)/stl.pat.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+
+clean-noinstLIBRARIES:
+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+libop_regex.a: $(libop_regex_a_OBJECTS) $(libop_regex_a_DEPENDENCIES)
+ -rm -f libop_regex.a
+ $(libop_regex_a_AR) libop_regex.a $(libop_regex_a_OBJECTS) $(libop_regex_a_LIBADD)
+ $(RANLIB) libop_regex.a
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demangle_java_symbol.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/demangle_symbol.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/op_regex.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+install-nodist_dataDATA: $(nodist_data_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(datadir)" || $(mkdir_p) "$(DESTDIR)$(datadir)"
+ @list='$(nodist_data_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(nodist_dataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(datadir)/$$f'"; \
+ $(nodist_dataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(datadir)/$$f"; \
+ done
+
+uninstall-nodist_dataDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(nodist_data_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(datadir)/$$f'"; \
+ rm -f "$(DESTDIR)$(datadir)/$$f"; \
+ done
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(mkdir_p) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(LIBRARIES) $(DATA)
+installdirs: installdirs-recursive
+installdirs-am:
+ for dir in "$(DESTDIR)$(datadir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-nodist_dataDATA
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am uninstall-nodist_dataDATA
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+ clean clean-generic clean-libtool clean-noinstLIBRARIES \
+ clean-recursive ctags ctags-recursive distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-recursive distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-exec install-exec-am install-info \
+ install-info-am install-man install-nodist_dataDATA \
+ install-strip installcheck installcheck-am installdirs \
+ installdirs-am maintainer-clean maintainer-clean-generic \
+ maintainer-clean-recursive mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \
+ pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
+ uninstall-info-am uninstall-nodist_dataDATA
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/libregex/demangle_java_symbol.cpp b/libregex/demangle_java_symbol.cpp
new file mode 100644
index 0000000..ab75e6c
--- /dev/null
+++ b/libregex/demangle_java_symbol.cpp
@@ -0,0 +1,238 @@
+/**
+ * @file demangle_java_symbol.cpp
+ * Demangle a java symbol
+ *
+ * @remark Copyright 2007 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ */
+
+#include "demangle_java_symbol.h"
+
+#include <algorithm>
+
+using namespace std;
+
+namespace {
+
+/**
+ * The grammar we implement:
+ *
+ * field_type:
+ * base_type | object_type | array_type
+ * base_type:
+ * B | C | D | F | I | J | S | Z
+ * object_type:
+ * L<classname>;
+ * array_type:
+ * [field_type
+ * method_descriptor:
+ * ( field_type* ) return_descriptor
+ * return_descriptor:
+ * field_type | V
+ * method_signature:
+ * object_type method_name method_descriptor
+ *
+ */
+
+bool array_type(string & result,
+ string::const_iterator & begin, string::const_iterator end);
+bool object_type(string & result,
+ string::const_iterator & begin, string::const_iterator end);
+
+
+bool base_type(string & result,
+ string::const_iterator & begin, string::const_iterator end)
+{
+ bool ret = true;
+
+ if (begin == end)
+ return false;
+
+ switch (*begin) {
+ case 'B': result += "byte"; break;
+ case 'C': result += "char"; break;
+ case 'D': result += "double"; break;
+ case 'F': result += "float"; break;
+ case 'I': result += "int"; break;
+ case 'J': result += "long"; break;
+ case 'S': result += "short"; break;
+ case 'Z': result += "boolean"; break;
+ default: ret = false; break;
+ }
+
+ if (ret)
+ ++begin;
+ return ret;
+}
+
+
+bool field_type(string & result,
+ string::const_iterator & begin, string::const_iterator end)
+{
+ if (base_type(result, begin, end))
+ return true;
+
+ if (object_type(result, begin, end))
+ return true;
+
+ if (array_type(result, begin, end))
+ return true;
+
+ return false;
+}
+
+
+bool array_type(string & result,
+ string::const_iterator & begin, string::const_iterator end)
+{
+ if (begin == end || *begin != '[')
+ return false;
+
+ ++begin;
+ if (field_type(result, begin, end)) {
+ result += "[]";
+ return true;
+ }
+
+ return false;
+}
+
+
+bool list_of_field_type(string & result,
+ string::const_iterator & begin, string::const_iterator end)
+{
+ bool first = false;
+ while (begin != end) {
+ if (first)
+ result += ", ";
+
+ if (!field_type(result, begin, end))
+ return false;
+
+ first = true;
+ }
+
+ return true;
+}
+
+
+bool return_descriptor(string & result,
+ string::const_iterator & begin, string::const_iterator end)
+{
+ if (begin == end)
+ return false;
+ if (*begin == 'V') {
+ ++begin;
+ result = "void " + result;
+ return true;
+ }
+
+ string temp;
+ if (!field_type(temp, begin, end))
+ return false;
+ result = temp + " " + result;
+
+ return true;
+}
+
+
+bool method_descriptor(string & result,
+ string::const_iterator & begin, string::const_iterator end)
+{
+ if (begin == end || *begin != '(')
+ return false;
+ ++begin;
+ string::const_iterator pos = find(begin, end, ')');
+ if (pos == end)
+ return false;
+
+ result += "(";
+
+ if (!list_of_field_type(result, begin, pos))
+ return false;
+
+ if (begin == end || *begin != ')')
+ return false;
+
+ ++begin;
+
+ if (!return_descriptor(result, begin, end))
+ return false;
+
+ result += ')';
+
+ return true;
+}
+
+
+bool methode_name(string & result,
+ string::const_iterator & begin, string::const_iterator end)
+{
+ if (begin == end)
+ return false;
+
+ string::const_iterator pos = find(begin, end, '(');
+ if (pos == end)
+ return false;
+
+ result += '.' + string(begin, pos);
+ begin = pos;
+
+ return true;
+}
+
+
+bool object_type(string & result,
+ string::const_iterator & begin, string::const_iterator end)
+{
+ if (begin == end || *begin != 'L')
+ return false;
+ string::const_iterator pos = find(begin, end, ';');
+ if (pos == end)
+ return false;
+
+ string temp = string(begin + 1, pos);
+ replace(temp.begin(), temp.end(), '/', '.');
+ result += temp;
+
+ begin = pos + 1;
+
+ return true;
+}
+
+
+string demangle_symbol(string::const_iterator begin,
+ string::const_iterator end)
+{
+ string result;
+
+ if (!object_type(result, begin, end))
+ return string();
+
+ if (!methode_name(result, begin, end))
+ return string();
+
+ if (!method_descriptor(result, begin, end))
+ return string();
+
+ if (begin != end) {
+ if (*begin == '~') {
+ // special case for disambiguated symbol.
+ result += string(begin, end);
+ } else {
+ return string();
+ }
+ }
+
+ return result;
+}
+
+} // anonymous namespace
+
+
+string const demangle_java_symbol(string const & name)
+{
+ return demangle_symbol(name.begin(), name.end());
+}
diff --git a/libregex/demangle_java_symbol.h b/libregex/demangle_java_symbol.h
new file mode 100644
index 0000000..3ab9836
--- /dev/null
+++ b/libregex/demangle_java_symbol.h
@@ -0,0 +1,19 @@
+/**
+ * @file demangle_java_symbol.h
+ * Demangle a java symbol
+ *
+ * @remark Copyright 2007 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ */
+
+#ifndef DEMANGLE_JAVA_SYMBOL_H
+#define DEMANGLE_JAVA_SYMBOL_H
+
+#include <string>
+
+/// Return an empty string on error
+std::string const demangle_java_symbol(std::string const & name);
+
+#endif // DEMANGLE_JAVA_SYMBOL_H
diff --git a/libregex/demangle_symbol.cpp b/libregex/demangle_symbol.cpp
new file mode 100644
index 0000000..7471fc5
--- /dev/null
+++ b/libregex/demangle_symbol.cpp
@@ -0,0 +1,70 @@
+/**
+ * @file demangle_symbol.cpp
+ * Demangle a C++ symbol
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ */
+
+#include <cstdlib>
+
+#include "config.h"
+
+#include "demangle_symbol.h"
+#include "demangle_java_symbol.h"
+#include "op_regex.h"
+
+// from libiberty
+/*@{\name demangle option parameter */
+#ifndef DMGL_PARAMS
+# define DMGL_PARAMS (1 << 0) /**< Include function args */
+#endif
+#ifndef DMGL_ANSI
+# define DMGL_ANSI (1 << 1) /**< Include const, volatile, etc */
+#endif
+/*@}*/
+extern "C" char * cplus_demangle(char const * mangled, int options);
+
+using namespace std;
+
+namespace options {
+ extern demangle_type demangle;
+}
+
+string const demangle_symbol(string const & name)
+{
+ if (options::demangle == dmt_none)
+ return name;
+
+ // Do not try to strip leading underscore, as this leads to many
+ // C++ demangling failures. However we strip off a leading '.'
+ // as generated on PPC64
+ string const & tmp = (name[0] == '.' ? name.substr(1) : name);
+ char * unmangled = cplus_demangle(tmp.c_str(), DMGL_PARAMS | DMGL_ANSI);
+
+ if (!unmangled) {
+ string result = demangle_java_symbol(name);
+ if (!result.empty())
+ return result;
+ return name;
+ }
+
+ string result(unmangled);
+ free(unmangled);
+
+ if (options::demangle == dmt_smart) {
+ static bool init = false;
+ static regular_expression_replace regex;
+ if (init == false) {
+ setup_regex(regex, OP_DATADIR "/stl.pat");
+ init = true;
+ }
+ // we don't protect against exception here, pattern must be
+ // right and user can easily work-around by using -d
+ regex.execute(result);
+ }
+
+ return result;
+}
diff --git a/libregex/demangle_symbol.h b/libregex/demangle_symbol.h
new file mode 100644
index 0000000..e2cefa3
--- /dev/null
+++ b/libregex/demangle_symbol.h
@@ -0,0 +1,40 @@
+/**
+ * @file demangle_symbol.h
+ * Demangle a C++ symbol
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ */
+
+#ifndef DEMANGLE_SYMBOL_H
+#define DEMANGLE_SYMBOL_H
+
+#include <string>
+
+/// demangle type: specify what demangling we use
+enum demangle_type {
+ /// no demangling.
+ dmt_none,
+ /// use cplus_demangle()
+ dmt_normal,
+ /// normal plus a pass through the regular expression to simplify
+ /// the mangled name
+ dmt_smart
+};
+
+/**
+ * demangle_symbol - demangle a symbol
+ * @param name the mangled symbol name
+ * @return the demangled name
+ *
+ * Demangle the symbol name, if the global
+ * variable demangle is true.
+ *
+ * The demangled name lists the parameters and type
+ * qualifiers such as "const".
+ */
+std::string const demangle_symbol(std::string const & name);
+
+#endif // DEMANGLE_SYMBOL_H
diff --git a/libregex/op_regex.cpp b/libregex/op_regex.cpp
new file mode 100644
index 0000000..d5ffa12
--- /dev/null
+++ b/libregex/op_regex.cpp
@@ -0,0 +1,309 @@
+/**
+ * @file op_regex.cpp
+ * This file contains implementation for a lightweight wrapper around
+ * libc regex, providing regular expression match and replace facility.
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ * @remark Idea comes from TextFilt project <http://textfilt.sourceforge.net>
+ *
+ * @author Philippe Elie
+ */
+
+#include <cerrno>
+
+#include <iostream>
+#include <fstream>
+
+#include "string_manip.h"
+
+#include "op_regex.h"
+
+using namespace std;
+
+namespace {
+
+string op_regerror(int err, regex_t const & regexp)
+{
+ size_t needed_size = regerror(err, &regexp, 0, 0);
+ char * buffer = new char[needed_size];
+ regerror(err, &regexp, buffer, needed_size);
+
+ return buffer;
+}
+
+
+void op_regcomp(regex_t & regexp, string const & pattern)
+{
+ int err = regcomp(&regexp, pattern.c_str(), REG_EXTENDED);
+ if (err) {
+ throw bad_regex("regcomp error: " + op_regerror(err, regexp)
+ + " for pattern : " + pattern);
+ }
+}
+
+
+bool op_regexec(regex_t const & regex, string const & str, regmatch_t * match,
+ size_t nmatch)
+{
+ return regexec(&regex, str.c_str(), nmatch, match, 0) != REG_NOMATCH;
+}
+
+
+void op_regfree(regex_t & regexp)
+{
+ regfree(&regexp);
+}
+
+
+// return the index number associated with a char seen in a "\x".
+// Allowed range are for x is [0-9a-z] return size_t(-1) if x is not in
+// these ranges.
+size_t subexpr_index(char ch)
+{
+ if (isdigit(ch))
+ return ch - '0';
+ if (ch >= 'a' && ch <= 'z')
+ return ch - 'a' + 10;
+ return size_t(-1);
+}
+
+} // anonymous namespace
+
+
+bad_regex::bad_regex(string const & pattern)
+ : op_exception(pattern)
+{
+}
+
+
+regular_expression_replace::regular_expression_replace(size_t limit_,
+ size_t limit_defs)
+ :
+ limit(limit_),
+ limit_defs_expansion(limit_defs)
+{
+}
+
+
+regular_expression_replace::~regular_expression_replace()
+{
+ for (size_t i = 0 ; i < regex_replace.size() ; ++i)
+ op_regfree(regex_replace[i].regexp);
+}
+
+
+void regular_expression_replace::add_definition(string const & name,
+ string const & definition)
+{
+ defs[name] = expand_string(definition);
+}
+
+
+void regular_expression_replace::add_pattern(string const & pattern,
+ string const & replace)
+{
+ string expanded_pattern = expand_string(pattern);
+
+ regex_t regexp;
+ op_regcomp(regexp, expanded_pattern);
+ replace_t regex = { regexp, replace };
+ regex_replace.push_back(regex);
+}
+
+
+string regular_expression_replace::expand_string(string const & input)
+{
+ string last, expanded(input);
+ size_t i = 0;
+ for (i = 0 ; i < limit_defs_expansion ; ++i) {
+ last = expanded;
+ expanded = substitute_definition(last);
+ if (expanded == last)
+ break;
+ }
+
+ if (i == limit_defs_expansion)
+ throw bad_regex("too many substitution for: + input");
+
+ return last;
+}
+
+
+string regular_expression_replace::substitute_definition(string const & pattern)
+{
+ string result;
+ bool previous_is_escape = false;
+
+ for (size_t i = 0 ; i < pattern.length() ; ++i) {
+ if (pattern[i] == '$' && !previous_is_escape) {
+ size_t pos = pattern.find('{', i);
+ if (pos != i + 1) {
+ throw bad_regex("invalid $ in pattern: " + pattern);
+ }
+ size_t end = pattern.find('}', i);
+ if (end == string::npos) {
+ throw bad_regex("no matching '}' in pattern: " + pattern);
+ }
+ string def_name = pattern.substr(pos+1, (end-pos) - 1);
+ if (defs.find(def_name) == defs.end()) {
+ throw bad_regex("definition not found and used in pattern: ("
+ + def_name + ") " + pattern);
+ }
+ result += defs[def_name];
+ i = end;
+ } else {
+ if (pattern[i] == '\\' && !previous_is_escape)
+ previous_is_escape = true;
+ else
+ previous_is_escape = false;
+ result += pattern[i];
+ }
+ }
+
+ return result;
+}
+
+
+// FIXME limit output string size ? (cause we can have exponential growing
+// of output string through a rule "a" = "aa")
+bool regular_expression_replace::execute(string & str) const
+{
+ bool changed = true;
+ for (size_t nr_iter = 0; changed && nr_iter < limit ; ++nr_iter) {
+ changed = false;
+ for (size_t i = 0 ; i < regex_replace.size() ; ++i) {
+ if (do_execute(str, regex_replace[i]))
+ changed = true;
+ }
+ }
+
+ // this don't return if the input string has been changed but if
+ // we reach the limit number of iteration.
+ return changed == false;
+}
+
+
+bool regular_expression_replace::do_execute(string & str,
+ replace_t const & regexp) const
+{
+ bool changed = false;
+
+ regmatch_t match[max_match];
+ for (size_t iter = 0;
+ op_regexec(regexp.regexp, str, match, max_match) && iter < limit;
+ iter++) {
+ changed = true;
+ do_replace(str, regexp.replace, match);
+ }
+
+ return changed;
+}
+
+
+regmatch_t const &
+regular_expression_replace::get_match(regmatch_t const * match, char idx) const
+{
+ size_t sub_expr = subexpr_index(idx);
+ if (sub_expr == size_t(-1))
+ throw bad_regex("expect group index: " + idx);
+ if (sub_expr >= max_match)
+ throw bad_regex("illegal group index :" + idx);
+ return match[sub_expr];
+}
+
+void regular_expression_replace::do_replace
+(string & str, string const & replace, regmatch_t const * match) const
+{
+ string inserted;
+ for (size_t i = 0 ; i < replace.length() ; ++i) {
+ if (replace[i] == '\\') {
+ if (i == replace.length() - 1) {
+ throw bad_regex("illegal \\ trailer: " +
+ replace);
+ }
+ ++i;
+ if (replace[i] == '\\') {
+ inserted += '\\';
+ } else {
+ regmatch_t const & matched = get_match(match,
+ replace[i]);
+ if (matched.rm_so == -1 &&
+ matched.rm_eo == -1) {
+ // empty match: nothing todo
+ } else if (matched.rm_so == -1 ||
+ matched.rm_eo == -1) {
+ throw bad_regex("illegal match: " +
+ replace);
+ } else {
+ inserted += str.substr(matched.rm_so,
+ matched.rm_eo - matched.rm_so);
+ }
+ }
+ } else {
+ inserted += replace[i];
+ }
+ }
+
+ size_t first = match[0].rm_so;
+ size_t count = match[0].rm_eo - match[0].rm_so;
+
+ str.replace(first, count, inserted);
+}
+
+
+void setup_regex(regular_expression_replace & regex,
+ string const & filename)
+{
+ ifstream in(filename.c_str());
+ if (!in) {
+ throw op_runtime_error("Can't open file " + filename +
+ " for reading", errno);
+ }
+
+ regular_expression_replace var_name_rule;
+ var_name_rule.add_pattern("^\\$([_a-zA-Z][_a-zA-Z0-9]*)[ ]*=.*", "\\1");
+ regular_expression_replace var_value_rule;
+ var_value_rule.add_pattern(".*=[ ]*\"(.*)\"", "\\1");
+
+ regular_expression_replace left_rule;
+ left_rule.add_pattern("[ ]*\"(.*)\"[ ]*=.*", "\\1");
+ regular_expression_replace right_rule;
+ right_rule.add_pattern(".*=[ ]*\"(.*)\"", "\\1");
+
+ string line;
+ while (getline(in, line)) {
+ line = trim(line);
+ if (line.empty() || line[0] == '#')
+ continue;
+
+ string temp = line;
+ var_name_rule.execute(temp);
+ if (temp == line) {
+ string left = line;
+ left_rule.execute(left);
+ if (left == line) {
+ throw bad_regex("invalid input file: \"" + line + '"');
+ }
+
+ string right = line;
+ right_rule.execute(right);
+ if (right == line) {
+ throw bad_regex("invalid input file: \"" + line + '"');
+ }
+
+ regex.add_pattern(left, right);
+ } else {
+ // temp != line ==> var_name_rule succeed to substitute
+ // into temp the var_name present in line
+ string var_name = temp;
+ string var_value = line;
+ var_value_rule.execute(var_value);
+ if (var_value == line) {
+ throw bad_regex("invalid input file: \"" + line + '"');
+ }
+
+ regex.add_definition(var_name, var_value);
+ }
+ }
+}
diff --git a/libregex/op_regex.h b/libregex/op_regex.h
new file mode 100644
index 0000000..423b980
--- /dev/null
+++ b/libregex/op_regex.h
@@ -0,0 +1,130 @@
+/**
+ * @file op_regex.h
+ * This file contains various definitions and interface for a
+ * lightweight wrapper around libc regex, providing match
+ * and replace facility.
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ * @remark Idea comes from TextFilt project <http://textfilt.sourceforge.net>
+ *
+ * @author Philippe Elie
+ */
+
+#ifndef OP_REGEX_H
+#define OP_REGEX_H
+
+// required by posix before including regex.h
+#include <sys/types.h>
+#include <regex.h>
+
+#include <string>
+#include <vector>
+#include <map>
+
+#include "op_exception.h"
+
+/**
+ * ill formed regular expression or expression throw such exception
+ */
+struct bad_regex : op_exception {
+ bad_regex(std::string const & pattern);
+};
+
+/**
+ * lightweight encapsulation of regex lib search and replace
+ *
+ * See stl.pat for further details and examples of used syntax.
+ */
+class regular_expression_replace {
+public:
+ /**
+ * @param limit limit on number of search and replace done
+ * @param limit_defs_expansion limit on number of expansion done
+ * during replacement of regular definition name by their expansion
+ *
+ * build an object holding regular defintion and regular expression
+ * & replace, preparing it for substitution ala sed
+ */
+ regular_expression_replace(size_t limit = 100,
+ size_t limit_defs_expansion = 100);
+ ~regular_expression_replace();
+
+ /**
+ * @param name a regular definition name
+ * @param replace the string to subsitute in other regular definition
+ * or regular exepression when this regular defintion name is
+ * encoutered.
+ */
+ void add_definition(std::string const & name,
+ std::string const & replace);
+ /**
+ * @param pattern a regular expression pattern, POSIX extended notation
+ * @param replace the replace string to use when this regular
+ * expression is matched
+ *
+ * You can imbed regular definition in pattern but not in replace.
+ */
+ void add_pattern(std::string const & pattern,
+ std::string const & replace);
+
+ /**
+ * @param str the input/output string where we search pattern and
+ * replace them.
+ *
+ * Execute loop at max limit time on the set of regular expression
+ *
+ * Return true if too many match occur and replacing has been stopped
+ * due to reach limit_defs_expansion. You can test if some pattern has
+ * been matched by saving the input string and comparing it to the new
+ * value. There is no way to detect s/a/a because the output string
+ * will be identical to the input string.
+ */
+ bool execute(std::string & str) const;
+private:
+ struct replace_t {
+ // when this regexp is matched
+ regex_t regexp;
+ // replace the matched part with this string
+ std::string replace;
+ };
+
+ // helper to execute
+ bool do_execute(std::string & str, replace_t const & regexp) const;
+ void do_replace(std::string & str, std::string const & replace,
+ regmatch_t const * match) const;
+
+ // helper to add_definition() and add_pattern()
+ std::string expand_string(std::string const & input);
+
+ // helper to add_pattern
+ std::string substitute_definition(std::string const & pattern);
+
+ // return the match of throw if idx is invalid
+ regmatch_t const & get_match(regmatch_t const * match, char idx) const;
+
+ // don't increase too, it have direct impact on performance. This limit
+ // the number of grouping expression allowed in a regular expression
+ // Note than you can use grouping match operator > 9 only in the
+ // replace rule not in match regular expression since POSIX don't allow
+ // more than \9 in matching sequence.
+ static const size_t max_match = 16;
+
+ size_t limit;
+ size_t limit_defs_expansion;
+ std::vector<replace_t> regex_replace;
+ /// dictionary of regular definition
+ typedef std::map<std::string, std::string> defs_dict;
+ defs_dict defs;
+};
+
+/**
+ * @param regex the regular_expression_replace to fill
+ * @param filename the filename from where the deifnition and pattern are read
+ *
+ * add to regex pattern and regular definition read from the given file
+ */
+void setup_regex(regular_expression_replace& regex,
+ std::string const & filename);
+
+#endif /* !OP_REGEX_H */
diff --git a/libregex/stl.pat.in b/libregex/stl.pat.in
new file mode 100644
index 0000000..64aeaf9
--- /dev/null
+++ b/libregex/stl.pat.in
@@ -0,0 +1,160 @@
+# format :
+# $name = "regular_definition"
+# "pattern" = "substitued_pattern"
+# pattern can contain reference to regular definition with ${name}
+# this occurence are substitued in pattern by their definition
+
+# regular_definition containing other regular_definition refer always to a
+# previously defined regular definition so they can look like recursive but are
+# not. op_regex.cpp do sucessive apply of pattern whilst change occur (with a
+# hard limit on number of subsitutions) so you can apply successive change to
+# translate first to an intermediate simplified form then continue substitution
+# in another pattern (see iosfwd section). The number of grouping regexp is
+# limited, see static const size_t max_match; in op_regex.h. Note than mangled
+# name produce can be illegal as I choose to output like vector<type<T>> rather
+# than vector<type<T> >
+
+# man regex is a friend, is it your ?
+
+$integer = "\<[0-9]+"
+$identifier = "\<[_a-zA-Z][_a-zA-Z0-9]*"
+$typename = "${identifier}(::${identifier})*"
+$typename = "${typename}(<${typename}(, ${typename})*>)*"
+# adding more substitution allow more nested templated type but we run out of
+# \digit which is a wall. Indeed if you add more () grouping you need to
+# rename all relevant \digit in pattern which use this regular definition
+# $typename = "${typename}(<${typename}(, ${typename})*>)*"
+# finally add standard C type not recognized by above patterns, the way to add
+# pointer is ugly but we can't add any grouping to not overrun 9 max group
+# in left pattern rules side..
+$typename = "(${typename}[ ]*\**|unsigned short[ ]**\**|unsigned int[ ]*\**|unsigned long[ ]*\**|unsigned char[ ]*\**|signed char[ ]*\**|long long[ ]*\**|unsigned long long[ ]*\**|long double[ ]*\**)"
+
+# FIXME: really discussable but simplify output and the next pattern.
+"\<std::" = ""
+" >" = ">"
+# for these two we can't match begin of word.
+"\{anonymous\}::" = ""
+"\(anonymous namespace\)::" = ""
+
+# specific to gcc 2.95
+"\<basic_string<char, string_char_traits<char>, __default_alloc_template<true, 0>>" = "string"
+# two pass, first shrink allocator<> then less<> allowing map with user defined
+# comparator
+"\<(multi)?map<${typename}, ${typename}, ${typename}, allocator<\8>>" = "\1map<\2, \8, \e>"
+"\<(multi)?map<${typename}, ${typename}, less<\2>>" = "\1map<\2, \8>"
+
+"\<bitset<(${integer}), unsigned long>" = "bitset<\1>"
+"\<([io]stream_iterator)<char, @PTRDIFF_T_TYPE@>" = "\1<char>"
+
+# common to all supported gcc version.
+"\<deque<${typename}, allocator<\1>, 0>" = "deque<\1>"
+"\<(stack|queue)<${typename}, deque<\2>>" = "\1<\2>"
+"\<(vector|list|deque)<${typename}, allocator<\2>>" = "\1<\2>"
+# strictly speaking 3rd parameters is less<ContainerType::value_type>
+"\<priority_queue<${typename}, vector<\1>, less<\1>>" = "priority_queue<\1>"
+# two pass, first shrink allocator<> then less<> allowing map with user defined
+# comparator
+"\<(multi)?set<${typename}, ${typename}, allocator<\2>>" = "\1set<\2, \8>"
+"\<(multi)?set<${typename}, less<\2>>" = "\1set<\2>"
+
+# get ride of _Rb_tree iterator typedef, these are also mapped by map/set but
+# we can't distinguish a set<pair<int, int>>::iterator and a
+# map<int, int>::iterator as they decay to an identical typedef so we don't try
+# to be clever here.
+"\<_Rb_tree_iterator<${typename}, \1 const[ ]*&, \1 const[ ]*\*>" = "_Rb_tree<\1>::const_iterator"
+"\<_Rb_tree_iterator<${typename}, \1[ ]*&, \1[ ]*\*>" = "_Rb_tree<\1>::iterator"
+# important special case for map/multimap iterator
+"\<_Rb_tree_iterator<(pair<${typename} const, ${typename}>), \1 const[ ]*&, \1 const[ ]*\*>" = "_Rb_tree<\1>::const_iterator"
+"\<_Rb_tree_iterator<(pair<${typename} const, ${typename}>), \1[ ]*&, \1[ ]*\*>" = "_Rb_tree<\1>::iterator"
+# 2.95/3.2 set/multiset implementation
+"\<_Rb_tree<${typename}, \1, _Identity<\1>, ${typename}, allocator<\1>>" = "_Rb_tree<\1, \1, _Identity<\1>, \7>"
+"_Rb_tree<${typename}, \1, _Identity<\1>, less<\1>>" = "_Rb_tree<\1, \1, _Identity<\1>>"
+# 2.95 map/multimap implementation
+"\<_Rb_tree<${typename}, pair<\1 const, (${typename}( const)?)>, _Select1st<pair<\1 const, \7>>, less<\1>, allocator<\7>>" = "_Rb_tree<\1, pair<\1 const, \7>, _Select1st<pair<\1 const, \7>>, less<\1>>"
+# 3.2 map/multimap implementation
+"\<_Rb_tree<${typename}, pair<\1 const, ${typename}>, _Select1st<pair<\1 const, \7>>, less<\1>, allocator<pair<\1 const, \7>>>" = "_Rb_tree<\1, pair<\1 const, \7>, _Select1st<pair<\1 const, \7>>, less<\1>>"
+# now we can shrink default comparator.
+"\<_Rb_tree<${typename}, pair<\1 const, (${typename}( const)?)>, _Select1st<pair<\1 const, \7>>, less<\1>>" = "_Rb_tree<\1, pair<\1 const, \7>, _Select1st<pair<\1 const, \7>>>"
+# get rid of _Select1st and _Identity
+# FIXME: the presence od _Identity<> and _Select1st<> allowed to quickly
+# differentiate a set or a map, the rule now to differentiate them is:
+# second parameter to _Rb_tree* is a pair<> ==> map else set<>. Either we need
+# to document this or remove _Identity and _Select1st pattern
+"\<_Identity<${typename}>" = "\1"
+"\<_Select1st<pair<${typename} const, ${typename}( const)?>>" = "\1 const"
+
+"\<_List_base<${typename}, allocator<\1>>" = "_List_base<\1>"
+
+# 2.95 templatized operator<< and >> exist only for std::string
+"\<ostream & operator<<<char, string_char_traits<char>, __default_alloc_template<true, 0>>\(ostream &, string const &\)" = "ostream & operator<<(ostream &, string const &)"
+"\<istream & (operator>>|getline)<char, string_char_traits<char>, __default_alloc_template<true, 0>>\(istream &, string &\)" = "istream & \1(istream &, string &)"
+
+# 3.0 templatized operator<< and >> exist only for std::string
+"\<ostream& operator<< <char, char_traits<char>, allocator<char>>\(ostream&, string const&\)" = "ostream & operator<<(ostream &, string const &)"
+"\<istream& (operator>>|getline) <char, char_traits<char>, allocator<char>>\(istream&, string&\)" = "istream & \1(istream &, string &)"
+
+# 2.95/3.2 algorithm
+"\<(${typename}( const)?) \* find<\1 \*, ${typename}>\(\1 \*, \1 \*, \9 const &, ${typename}\)" = "\1 * find(\1 *, \1 *, \9 const &, \f)"
+
+"\<(${typename}( const)?) \* find_if<\1 \*, ${typename}>\(\1 \*, \1 \*, \9, random_access_iterator_tag)" = "\1 * find_if(\1 *, \1 *, \9, random_access_iterator_tag)"
+
+# gcc 3.2, not tested on 3.0, 3.1 but probably work.
+# FIXME: there is a potential problem here with map<int const, long>
+# the pair become pair<\2, \8> not pair<\2 const, \8>, who use the above,
+# is it legal ?
+# two pass, first shrink allocator<> then less<> allowing map with user defined
+# comparator
+"\<(multi)?map<${typename}, ${typename}, ${typename}, allocator<pair<\2 const, \8>>>" = "\1map<\2, \8, \e>"
+# this one exist already for 2.95 the first transformation giving a common
+# form for 2.95/3.2
+# "\<(multi)?map<${typename}, ${typename}, less<\2>>" = "\1map<\2, \8>"
+
+"\<bitset<\(@SIZE_T_TYPE@\)(${integer})>" = "bitset<\1>"
+
+# iterator
+"\<iterator<(input|output|forward|bidirectional|random)_iterator_tag, ${typename}, (@PTRDIFF_T_TYPE@), \8\*, \8&>" = "iterator<\1_iterator_tag, \2>"
+"\<([io]stream_iterator)<${typename}, char, char_traits<char>, @PTRDIFF_T_TYPE@>" = "\1<\2>"
+
+# __gnu_cxx::__normal_iterator are used in two context: basic_string<> and
+# vector<T> we decay them to string::iterator, vector<T>::iterator
+"\<__gnu_cxx::__normal_iterator<char const\*, string>" = "string::const_iterator"
+"\<__gnu_cxx::__normal_iterator<char\*, string>" = "string::iterator"
+"\<__gnu_cxx::__normal_iterator<wchar_t const\*, wstring>" = "wstring::const_iterator"
+"\<__gnu_cxx::__normal_iterator<wchar_t\*, wstring>" = "wstring::iterator"
+"\<__gnu_cxx::__normal_iterator<${typename} const\*, vector<\1>>" = "vector<\1>::const_iterator"
+"\<__gnu_cxx::__normal_iterator<${typename}\*, vector<\1>>" = "vector<\1>::iterator"
+
+# 2.95 use only _List_iterator, 3.2 use also _List_iterator_base but since
+# list::iterator is a typedef to _List_iterator we don't need to deal with
+# _List_iterator_base
+"\<_List_iterator<${typename}, \1[ ]*&, \1[ ]*\*>" = "list<\1>::iterator"
+"\<_List_iterator<${typename}, \1 const[ ]*&, \1 const[ ]*\*>" = "list<\1>::const_iterator"
+
+# iosfwd, std::string and std::wstring
+# first translate from "basic_xxx<T, char_traits<T>>" to "basic_xxx<T>"
+"\<([io]streambuf_iterator|basic_(ios|streambuf|([io]|io)stream|filebuf|[io]?fstream))<${typename}, char_traits<\4>>" = "\1<\4>"
+# as above translate from "basic_xxx<T, char_traits<T>, ...>" to "basic_xxx<T>"
+"\<basic_(string(buf)?|[io]?stringstream)?<${typename}, char_traits<\3>, allocator<\3>>" = "basic_\1<\3>"
+# now we can translate the two above for char, wchar_t to standardese typedef
+$iosfwd_name = "\<basic_(string|ios|(stream|file|string)buf|(i|o|io)stream|[io]?(fstream|stringstream))"
+"\<${iosfwd_name}<char>" = "\1"
+"\<${iosfwd_name}<wchar_t>" = "w\1"
+
+# streampos and wstreampos decay to the same type, they are undistingushable
+# in mangled name so substitute for the most probable, not a big deal
+"\<fpos<__mbstate_t>" = "streampos"
+
+# locale
+# strictly speaking this accept num_put<..., istream_iterator<...> > or
+# num_get<..., ostream_iterator<...> > but this can't compile so no big deal
+"\<(money|time|num)_(put|get)<${typename}, (i|o)streambuf_iterator<\3>>" = "\1_\2<\3>"
+"\<moneypunct(_byname)?<${typename}, \(bool\)0>" = "moneypunct\1<\2>"
+
+# 3.2 algorithm
+"\<(vector<${typename}>::(const_)?iterator) find<\1, ${typename}>\(\1, \1, \9 const&, ${typename}\)" = "\1 find(\1, \1, \9 const&, \f)"
+
+"\<((string|wstring)::(const_)?iterator) find<\1, ${typename}>\(\1, \1, \4 const&, ${typename}\)" = "\1 find(\1, \1, \4 const&, \a)"
+
+"\<(vector<${typename}>::(const_)?iterator) find_if<\1, ${typename}>\(\1, \1, \9, random_access_iterator_tag\)" = "\1 find_if(\1, \1, \9, random_access_iterator_tag)"
+
+"\<((string|wstring)::(const_)?iterator) find_if<\1, ${typename}>\(\1, \1, \4, random_access_iterator_tag\)" = "\1 find_if(\1, \1, \4, random_access_iterator_tag)"
diff --git a/libregex/tests/Makefile.am b/libregex/tests/Makefile.am
new file mode 100644
index 0000000..6f19838
--- /dev/null
+++ b/libregex/tests/Makefile.am
@@ -0,0 +1,21 @@
+AM_CPPFLAGS = \
+ -I ${top_srcdir}/libutil++ \
+ -I ${top_srcdir}/libregex
+
+AM_CXXFLAGS = @OP_CXXFLAGS@
+
+check_PROGRAMS = regex_test java_test
+
+regex_test_SOURCES = regex_test.cpp
+regex_test_LDADD = \
+ ../libop_regex.a \
+ ../../libutil++/libutil++.a
+
+java_test_SOURCES = java_test.cpp
+java_test_LDADD = \
+ ../libop_regex.a \
+ ../../libutil++/libutil++.a
+
+EXTRA_DIST = mangled-name.in
+
+TESTS = ${check_PROGRAMS}
diff --git a/libregex/tests/Makefile.in b/libregex/tests/Makefile.in
new file mode 100644
index 0000000..7a0f251
--- /dev/null
+++ b/libregex/tests/Makefile.in
@@ -0,0 +1,574 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+check_PROGRAMS = regex_test$(EXEEXT) java_test$(EXEEXT)
+subdir = libregex/tests
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(srcdir)/mangled-name.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/binutils.m4 \
+ $(top_srcdir)/m4/builtinexpect.m4 \
+ $(top_srcdir)/m4/cellspubfdsupport.m4 \
+ $(top_srcdir)/m4/compileroption.m4 \
+ $(top_srcdir)/m4/configmodule.m4 \
+ $(top_srcdir)/m4/copyifchange.m4 $(top_srcdir)/m4/docbook.m4 \
+ $(top_srcdir)/m4/extradirs.m4 $(top_srcdir)/m4/findkernel.m4 \
+ $(top_srcdir)/m4/kerneloption.m4 \
+ $(top_srcdir)/m4/kernelversion.m4 \
+ $(top_srcdir)/m4/mallocattribute.m4 \
+ $(top_srcdir)/m4/poptconst.m4 \
+ $(top_srcdir)/m4/precompiledheader.m4 $(top_srcdir)/m4/qt.m4 \
+ $(top_srcdir)/m4/resultyn.m4 $(top_srcdir)/m4/sstream.m4 \
+ $(top_srcdir)/m4/typedef.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES = mangled-name
+am_java_test_OBJECTS = java_test.$(OBJEXT)
+java_test_OBJECTS = $(am_java_test_OBJECTS)
+java_test_DEPENDENCIES = ../libop_regex.a ../../libutil++/libutil++.a
+am_regex_test_OBJECTS = regex_test.$(OBJEXT)
+regex_test_OBJECTS = $(am_regex_test_OBJECTS)
+regex_test_DEPENDENCIES = ../libop_regex.a ../../libutil++/libutil++.a
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(java_test_SOURCES) $(regex_test_SOURCES)
+DIST_SOURCES = $(java_test_SOURCES) $(regex_test_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFD_LIBS = @BFD_LIBS@
+BUILD_JVMPI_AGENT_FALSE = @BUILD_JVMPI_AGENT_FALSE@
+BUILD_JVMPI_AGENT_TRUE = @BUILD_JVMPI_AGENT_TRUE@
+BUILD_JVMTI_AGENT_FALSE = @BUILD_JVMTI_AGENT_FALSE@
+BUILD_JVMTI_AGENT_TRUE = @BUILD_JVMTI_AGENT_TRUE@
+CAT_ENTRY_END = @CAT_ENTRY_END@
+CAT_ENTRY_START = @CAT_ENTRY_START@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOCBOOK_ROOT = @DOCBOOK_ROOT@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+EXTRA_CFLAGS_MODULE = @EXTRA_CFLAGS_MODULE@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAVA_HOMEDIR = @JAVA_HOMEDIR@
+KINC = @KINC@
+KSRC = @KSRC@
+KVERS = @KVERS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBERTY_LIBS = @LIBERTY_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MOC = @MOC@
+MODINSTALLDIR = @MODINSTALLDIR@
+OBJEXT = @OBJEXT@
+OPROFILE_DIR = @OPROFILE_DIR@
+OPROFILE_MODULE_ARCH = @OPROFILE_MODULE_ARCH@
+OP_CFLAGS = @OP_CFLAGS@
+OP_CXXFLAGS = @OP_CXXFLAGS@
+OP_DOCDIR = @OP_DOCDIR@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POPT_LIBS = @POPT_LIBS@
+PTRDIFF_T_TYPE = @PTRDIFF_T_TYPE@
+QT_INCLUDES = @QT_INCLUDES@
+QT_LDFLAGS = @QT_LDFLAGS@
+QT_LIB = @QT_LIB@
+QT_VERSION = @QT_VERSION@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIZE_T_TYPE = @SIZE_T_TYPE@
+STRIP = @STRIP@
+UIC = @UIC@
+VERSION = @VERSION@
+XML_CATALOG = @XML_CATALOG@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+have_qt_FALSE = @have_qt_FALSE@
+have_qt_TRUE = @have_qt_TRUE@
+have_xsltproc_FALSE = @have_xsltproc_FALSE@
+have_xsltproc_TRUE = @have_xsltproc_TRUE@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+kernel_support_FALSE = @kernel_support_FALSE@
+kernel_support_TRUE = @kernel_support_TRUE@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+topdir = @topdir@
+AM_CPPFLAGS = \
+ -I ${top_srcdir}/libutil++ \
+ -I ${top_srcdir}/libregex
+
+AM_CXXFLAGS = @OP_CXXFLAGS@
+regex_test_SOURCES = regex_test.cpp
+regex_test_LDADD = \
+ ../libop_regex.a \
+ ../../libutil++/libutil++.a
+
+java_test_SOURCES = java_test.cpp
+java_test_LDADD = \
+ ../libop_regex.a \
+ ../../libutil++/libutil++.a
+
+EXTRA_DIST = mangled-name.in
+TESTS = ${check_PROGRAMS}
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libregex/tests/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign libregex/tests/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+mangled-name: $(top_builddir)/config.status $(srcdir)/mangled-name.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+
+clean-checkPROGRAMS:
+ @list='$(check_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+java_test$(EXEEXT): $(java_test_OBJECTS) $(java_test_DEPENDENCIES)
+ @rm -f java_test$(EXEEXT)
+ $(CXXLINK) $(java_test_LDFLAGS) $(java_test_OBJECTS) $(java_test_LDADD) $(LIBS)
+regex_test$(EXEEXT): $(regex_test_OBJECTS) $(regex_test_DEPENDENCIES)
+ @rm -f regex_test$(EXEEXT)
+ $(CXXLINK) $(regex_test_LDFLAGS) $(regex_test_OBJECTS) $(regex_test_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/java_test.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regex_test.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+check-TESTS: $(TESTS)
+ @failed=0; all=0; xfail=0; xpass=0; skip=0; \
+ srcdir=$(srcdir); export srcdir; \
+ list='$(TESTS)'; \
+ if test -n "$$list"; then \
+ for tst in $$list; do \
+ if test -f ./$$tst; then dir=./; \
+ elif test -f $$tst; then dir=; \
+ else dir="$(srcdir)/"; fi; \
+ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *" $$tst "*) \
+ xpass=`expr $$xpass + 1`; \
+ failed=`expr $$failed + 1`; \
+ echo "XPASS: $$tst"; \
+ ;; \
+ *) \
+ echo "PASS: $$tst"; \
+ ;; \
+ esac; \
+ elif test $$? -ne 77; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *" $$tst "*) \
+ xfail=`expr $$xfail + 1`; \
+ echo "XFAIL: $$tst"; \
+ ;; \
+ *) \
+ failed=`expr $$failed + 1`; \
+ echo "FAIL: $$tst"; \
+ ;; \
+ esac; \
+ else \
+ skip=`expr $$skip + 1`; \
+ echo "SKIP: $$tst"; \
+ fi; \
+ done; \
+ if test "$$failed" -eq 0; then \
+ if test "$$xfail" -eq 0; then \
+ banner="All $$all tests passed"; \
+ else \
+ banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
+ fi; \
+ else \
+ if test "$$xpass" -eq 0; then \
+ banner="$$failed of $$all tests failed"; \
+ else \
+ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
+ fi; \
+ fi; \
+ dashes="$$banner"; \
+ skipped=""; \
+ if test "$$skip" -ne 0; then \
+ skipped="($$skip tests were not run)"; \
+ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$skipped"; \
+ fi; \
+ report=""; \
+ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+ report="Please report to $(PACKAGE_BUGREPORT)"; \
+ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$report"; \
+ fi; \
+ dashes=`echo "$$dashes" | sed s/./=/g`; \
+ echo "$$dashes"; \
+ echo "$$banner"; \
+ test -z "$$skipped" || echo "$$skipped"; \
+ test -z "$$report" || echo "$$report"; \
+ echo "$$dashes"; \
+ test "$$failed" -eq 0; \
+ else :; fi
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
+ clean-checkPROGRAMS clean-generic clean-libtool ctags \
+ distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-exec install-exec-am install-info \
+ install-info-am install-man install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/libregex/tests/java_test.cpp b/libregex/tests/java_test.cpp
new file mode 100644
index 0000000..c5b4130
--- /dev/null
+++ b/libregex/tests/java_test.cpp
@@ -0,0 +1,65 @@
+/**
+ * @file java_test.cpp
+ *
+ * A simple test for java demangling. Run it through:
+ * $ java_test
+ *
+ * @remark Copyright 2007 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ */
+
+#include "demangle_java_symbol.h"
+
+#include "op_regex.h"
+
+#include <iostream>
+#include <fstream>
+
+#include <cstdlib>
+
+using namespace std;
+
+namespace {
+
+void check_result(string const & input, string const & output,
+ string const & result)
+{
+ if (result != output) {
+ cerr << "for:\n\"" << input << "\"\n"
+ << "expect:\n\"" << output << "\"\n"
+ << "found:\n\"" << result << "\"\n";
+ exit(EXIT_FAILURE);
+ }
+}
+
+struct input_output {
+ char const * mangled;
+ char const * expect;
+};
+
+input_output mangle_tests[] = {
+ { "Ltest$test_1;f2(I)V", "void test$test_1.f2(int)" },
+ { "Ltest;f4()V", "void test.f4()" },
+ { "Ltest;f2(II)V", "void test.f2(int, int)" },
+ { "Ltest$HelloThread;run()V~1", "void test$HelloThread.run()~1" },
+ { "Lsun/security/provider/SHA;implCompress([BI)V", "void sun.security.provider.SHA.implCompress(byte[], int)" },
+ { "Ljava/lang/String;equals(Ljava/lang/Object;)Z", "boolean java.lang.String.equals(java.lang.Object)" },
+ { "Lorg/eclipse/swt/graphics/ImageData;blit(I[BIIIIIIIIIII[BIII[BIIIIIIIIIIZZ)V", "void org.eclipse.swt.graphics.ImageData.blit(int, byte[], int, int, int, int, int, int, int, int, int, int, int, byte[], int, int, int, byte[], int, int, int, int, int, int, int, int, int, int, boolean, boolean)" },
+ { 0, 0 }
+};
+
+} // anonymous namespace
+
+int main(void)
+{
+ input_output const * cur;
+ for (cur = mangle_tests; cur->mangled; ++cur) {
+ string result = demangle_java_symbol(cur->mangled);
+ check_result(cur->mangled, cur->expect, result);
+ }
+
+ return 0;
+}
+
diff --git a/libregex/tests/mangled-name.in b/libregex/tests/mangled-name.in
new file mode 100644
index 0000000..cee4bc8
--- /dev/null
+++ b/libregex/tests/mangled-name.in
@@ -0,0 +1,453 @@
+# test for stl beautifier, do op_regex_test < mangled-name.txt
+# line go by couple mangled name then expected name after run, line
+# starting by # and blank line are ignored. The test must output nothing if
+# successfull
+
+# before removing tests think it take time to write them. This is intended
+# to be a coverage test of all pattern in stl.pat.
+
+# g++ 2.95 stl mangled name
+
+basic_string<char, string_char_traits<char>, __default_alloc_template<true, 0> >
+string
+
+prefix_basic_string<char, string_char_traits<char>, __default_alloc_template<true, 0> >
+prefix_basic_string<char, string_char_traits<char>, __default_alloc_template<true, 0>>
+
+vector<basic_string<char, string_char_traits<char>, __default_alloc_template<true, 0> >, allocator<basic_string<char, string_char_traits<char>, __default_alloc_template<true, 0> > > >
+vector<string>
+
+map<int, image_name, less<int>, allocator<image_name> >
+map<int, image_name>
+
+map<basic_string<char, string_char_traits<char>, __default_alloc_template<true, 0> >, image_name, less<basic_string<char, string_char_traits<char>, __default_alloc_template<true, 0> > >, allocator<image_name> >
+map<string, image_name>
+
+multimap<int, long, less<int>, allocator<long> >
+multimap<int, long>
+
+prefix_multimap<int, long, less<int>, allocator<long> >
+prefix_multimap<int, long, less<int>, allocator<long>>
+
+map<int, long, compare, allocator<long> >
+map<int, long, compare>
+
+bitset<33, unsigned long>
+bitset<33>
+
+istream_iterator<char, @PTRDIFF_T_TYPE@>
+istream_iterator<char>
+
+ostream_iterator<char, @PTRDIFF_T_TYPE@>
+ostream_iterator<char>
+
+# shared between all supported gcc version
+deque<int, allocator<int>, 0>
+deque<int>
+
+std::deque<int, std::allocator<int>, 0>
+deque<int>
+
+prefix_deque<int, allocator<int>, 0>
+prefix_deque<int, allocator<int>, 0>
+
+list<int, allocator<int> >
+list<int>
+
+list<op_bfd_symbol, allocator<op_bfd_symbol> >
+list<op_bfd_symbol>
+
+_List_iterator<int, int const &, int const *>
+list<int>::const_iterator
+
+_List_iterator<int, int &, int *>
+list<int>::iterator
+
+prefix_list<int, allocator<int> >
+prefix_list<int, allocator<int>>
+
+std::list<int, std::allocator<int> >
+list<int>
+
+queue<int, deque<int, allocator<int>, 0> >
+queue<int>
+
+prefix_queue<int, deque<int, allocator<int>, 0> >
+prefix_queue<int, deque<int>>
+
+std::queue<int, std::deque<int, allocator<int>, 0> >
+queue<int>
+
+# get ride of _Rb_tree typedef, these are also mapped by map/set but we can't
+# distinguish a set<pair<int, int>>::iterator and a map<int, int>::iterator
+# as they decay to an identical typedef so we don't try to be clever here.
+_Rb_tree_iterator<T, T const &, T const *>
+_Rb_tree<T>::const_iterator
+
+_Rb_tree_iterator<T, T &, T *>
+_Rb_tree<T>::iterator
+
+# this run through special case pattern
+_Rb_tree_iterator<pair<string const, image_name>, pair<string const, image_name> const &, pair<string const, image_name> const *>
+_Rb_tree<pair<string const, image_name>>::const_iterator
+
+_Rb_tree_iterator<pair<string const, image_name>, pair<string const, image_name> &, pair<string const, image_name> *>
+_Rb_tree<pair<string const, image_name>>::iterator
+
+_Rb_tree<int, int, _Identity<int>, less<int>, allocator<int> >
+_Rb_tree<int, int, int>
+
+_Rb_tree<string, pair<string const, int const>, _Select1st<pair<string const, int const>>, less<string>, allocator<int const>>
+_Rb_tree<string, pair<string const, int const>, string const>
+
+_Select1st<pair<int const, long> >
+int const
+
+_Select1st<pair<int const, long const> >
+int const
+
+_Select1st<pair<string const, split_sample_filename const>>
+string const
+
+_Identity<int>
+int
+
+# this test fail since pair<> is not recognized as a type
+# _Select1st<pair<pair<symbol_entry const *, unsigned long long> const, sample_entry>>
+# pair<symbol_entry const *, unsigned long long> const
+
+# 2.95 map/multimap
+_Rb_tree<int, pair<int const, long>, _Select1st<pair<int const, long> >, less<int>, allocator<long> >
+_Rb_tree<int, pair<int const, long>, int const>
+# 3.2 map/multimap
+_Rb_tree<int, pair<int const, long>, _Select1st<pair<int const, long> >, less<int>, allocator<pair<int const, long> > >
+_Rb_tree<int, pair<int const, long>, int const>
+
+_List_base<string, allocator<string>>
+_List_base<string>
+
+# strictly speaking 3rd parameters is less<ContainerType::value_type>
+priority_queue<int, vector<int, allocator<int> >, less<int> >
+priority_queue<int>
+
+prefix_priority_queue<int, vector<int, allocator<int> >, less<int> >
+prefix_priority_queue<int, vector<int>, less<int>>
+
+std::priority_queue<int, std::vector<int, std::allocator<int> >, std::less<int> >
+priority_queue<int>
+
+vector<int, allocator<int> >
+vector<int>
+
+vector<bool, allocator<bool> >
+vector<bool>
+
+vector<block1::block2, allocator<block1::block2> >
+vector<block1::block2>
+
+stack<int, deque<int, allocator<int>, 0> >
+stack<int>
+
+prefix_stack<int, deque<int, allocator<int>, 0> >
+prefix_stack<int, deque<int>>
+
+std::stack<int, std::deque<int, std::allocator<int>, 0> >
+stack<int>
+
+# test complex typename, we don't support more than one level of nesting
+vector<list<int, allocator<int> >, allocator<list<int, allocator<int> > > >
+vector<list<int>>
+
+std::vector<std::list<int, std::allocator<int> >, std::allocator<list<int, std::allocator<int> > > >
+vector<list<int>>
+
+set<int, less<int>, allocator<int> >
+set<int>
+
+set<basic_string<char, string_char_traits<char>, __default_alloc_template<true, 0> >, less<basic_string<char, string_char_traits<char>, __default_alloc_template<true, 0> > >, allocator<basic_string<char, string_char_traits<char>, __default_alloc_template<true, 0> > > >
+set<string>
+
+set<int, less_by_file_loc, allocator<int> >
+set<int, less_by_file_loc>
+
+prefix_set<int, less<int>, allocator<int> >
+prefix_set<int, less<int>, allocator<int>>
+
+prefix_set<int, less<int>, allocator<int> >
+prefix_set<int, less<int>, allocator<int>>
+
+multiset<int, less<int>, allocator<int> >
+multiset<int>
+
+# test than pointer and reference to pointer are handled
+vector<int *, allocator<int *> >
+vector<int *>
+
+vector<unsigned int *, allocator<unsigned int *> >
+vector<unsigned int *>
+
+# algorithm, will work for 3.2 too.
+int * find<int *, int>(int *, int *, int const &, random_access_iterator_tag)
+int * find(int *, int *, int const &, random_access_iterator_tag)
+char const * find_if<char const *, compare>(char const *, char const *, compare, random_access_iterator_tag)
+char const * find_if(char const *, char const *, compare, random_access_iterator_tag)
+
+# gcc 3.2
+std::basic_string<char, std::char_traits<char>, std::allocator<char> >
+string
+
+std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >
+wstring
+
+# __normal_iterator are treated a part
+__gnu_cxx::__normal_iterator<char const*, string>
+string::const_iterator
+__gnu_cxx::__normal_iterator<char*, string>
+string::iterator
+__gnu_cxx::__normal_iterator<wchar_t*, wstring>
+wstring::iterator
+__gnu_cxx::__normal_iterator<wchar_t const*, wstring>
+wstring::const_iterator
+std::reverse_iterator<__gnu_cxx::__normal_iterator<char*, string>>
+reverse_iterator<string::iterator>
+
+__gnu_cxx::__normal_iterator<int const*, vector<int>>
+vector<int>::const_iterator
+__gnu_cxx::__normal_iterator<int*, vector<int>>
+vector<int>::iterator
+std::reverse_iterator<__gnu_cxx::__normal_iterator<int const*, vector<int>>
+reverse_iterator<vector<int>::const_iterator
+
+std::map<int, long, std::less<int>, std::allocator<std::pair<int const, long> > >
+map<int, long>
+
+std::multimap<int, long, std::less<int>, std::allocator<std::pair<int const, long> > >
+multimap<int, long>
+
+std::map<int, long, compare, std::allocator<std::pair<int const, long> > >
+map<int, long, compare>
+
+# parameter is size_t on x86 it's an unsigned
+bitset<(@SIZE_T_TYPE@)33>
+bitset<33>
+
+# 3, 4, 5th params are ptrdiff_t it's an int on x86
+std::iterator<std::input_iterator_tag, int, @PTRDIFF_T_TYPE@, @PTRDIFF_T_TYPE@*, @PTRDIFF_T_TYPE@&>
+iterator<input_iterator_tag, int>
+
+std::iterator<std::output_iterator_tag, int, @PTRDIFF_T_TYPE@, @PTRDIFF_T_TYPE@*, @PTRDIFF_T_TYPE@&>
+iterator<output_iterator_tag, int>
+
+std::iterator<std::forward_iterator_tag, int, @PTRDIFF_T_TYPE@, @PTRDIFF_T_TYPE@*, @PTRDIFF_T_TYPE@&>
+iterator<forward_iterator_tag, int>
+
+std::iterator<std::bidirectional_iterator_tag, int, @PTRDIFF_T_TYPE@, @PTRDIFF_T_TYPE@*, @PTRDIFF_T_TYPE@&>
+iterator<bidirectional_iterator_tag, int>
+
+std::iterator<std::random_iterator_tag, int, @PTRDIFF_T_TYPE@, @PTRDIFF_T_TYPE@*, @PTRDIFF_T_TYPE@&>
+iterator<random_iterator_tag, int>
+
+# 4th parms is ptrdiff_t
+std::istream_iterator<long, char, std::char_traits<char>, @PTRDIFF_T_TYPE@>
+istream_iterator<long>
+
+std::ostream_iterator<long, char, std::char_traits<char>, @PTRDIFF_T_TYPE@>
+ostream_iterator<long>
+
+# simple enough, it's just <iosfwd>
+std::basic_ios<int, std::char_traits<int> >
+basic_ios<int>
+
+std::basic_streambuf<int, std::char_traits<int> >
+basic_streambuf<int>
+
+std::basic_istream<int, std::char_traits<int> >
+basic_istream<int>
+
+std::basic_ostream<int, std::char_traits<int> >
+basic_ostream<int>
+
+std::basic_iostream<int, std::char_traits<int> >
+basic_iostream<int>
+
+std::basic_filebuf<int, std::char_traits<int> >
+basic_filebuf<int>
+
+std::basic_ifstream<int, std::char_traits<int> >
+basic_ifstream<int>
+
+std::basic_ofstream<int, std::char_traits<int> >
+basic_ofstream<int>
+
+std::basic_fstream<int, std::char_traits<int> >
+basic_fstream<int>
+
+std::istreambuf_iterator<long, std::char_traits<long> >
+istreambuf_iterator<long>
+
+std::ostreambuf_iterator<long, std::char_traits<long> >
+ostreambuf_iterator<long>
+
+std::basic_stringbuf<long, std::char_traits<long>, std::allocator<long> >
+basic_stringbuf<long>
+
+std::basic_istringstream<long, std::char_traits<long>, std::allocator<long> >
+basic_istringstream<long>
+
+std::basic_ostringstream<long, std::char_traits<long>, std::allocator<long> >
+basic_ostringstream<long>
+
+std::basic_stringstream<long, std::char_traits<long>, std::allocator<long> >
+basic_stringstream<long>
+
+# all the above intantiated with char and wchar_t fallback to standardised
+# typedef except istreambuf_iterator and ostreambuf_iterator
+
+std::basic_ios<char, std::char_traits<char> >
+ios
+std::basic_ios<wchar_t, std::char_traits<wchar_t> >
+wios
+
+std::basic_streambuf<char, std::char_traits<char> >
+streambuf
+std::basic_streambuf<wchar_t, std::char_traits<wchar_t> >
+wstreambuf
+
+std::basic_istream<char, std::char_traits<char> >
+istream
+std::basic_istream<wchar_t, std::char_traits<wchar_t> >
+wistream
+
+std::basic_ostream<char, std::char_traits<char> >
+ostream
+std::basic_ostream<wchar_t, std::char_traits<wchar_t> >
+wostream
+
+std::basic_iostream<char, std::char_traits<char> >
+iostream
+std::basic_iostream<wchar_t, std::char_traits<wchar_t> >
+wiostream
+
+std::basic_filebuf<char, std::char_traits<char> >
+filebuf
+std::basic_filebuf<wchar_t, std::char_traits<wchar_t> >
+wfilebuf
+
+std::basic_ifstream<char, std::char_traits<char> >
+ifstream
+std::basic_ifstream<wchar_t, std::char_traits<wchar_t> >
+wifstream
+
+std::basic_ofstream<char, std::char_traits<char> >
+ofstream
+std::basic_ofstream<wchar_t, std::char_traits<wchar_t> >
+wofstream
+
+std::basic_fstream<char, std::char_traits<char> >
+fstream
+std::basic_fstream<wchar_t, std::char_traits<wchar_t> >
+wfstream
+
+std::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >
+stringbuf
+std::basic_stringbuf<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >
+wstringbuf
+
+std::basic_istringstream<char, std::char_traits<char>, std::allocator<char> >
+istringstream
+std::basic_istringstream<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >
+wistringstream
+
+std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >
+ostringstream
+std::basic_ostringstream<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >
+wostringstream
+
+std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> >
+stringstream
+std::basic_stringstream<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >
+wstringstream
+
+# these two are also in iosfw, namely
+# typedef fpos<char_traits<char>::state_type> streampos;
+# typedef fpos<char_traits<wchar_t>::state_type> wstreampos;
+# but twice decay to fpos<__mbstate>, we choosed to translate to streampos
+std::fpos<__mbstate_t>
+streampos
+
+# locale
+std::num_put<char, std::ostreambuf_iterator<char> >
+num_put<char>
+std::num_put<wchar_t, std::ostreambuf_iterator<wchar_t> >
+num_put<wchar_t>
+std::num_get<char, std::istreambuf_iterator<char> >
+num_get<char>
+std::num_get<wchar_t, std::istreambuf_iterator<wchar_t> >
+num_get<wchar_t>
+
+std::time_put<char, std::ostreambuf_iterator<char> >
+time_put<char>
+std::time_put<wchar_t, std::ostreambuf_iterator<wchar_t> >
+time_put<wchar_t>
+std::time_get<char, std::istreambuf_iterator<char> >
+time_get<char>
+std::time_get<wchar_t, std::istreambuf_iterator<wchar_t> >
+time_get<wchar_t>
+
+std::money_put<char, std::ostreambuf_iterator<char> >
+money_put<char>
+std::money_put<wchar_t, std::ostreambuf_iterator<wchar_t> >
+money_put<wchar_t>
+std::money_get<char, std::istreambuf_iterator<char> >
+money_get<char>
+std::money_get<wchar_t, std::istreambuf_iterator<wchar_t> >
+money_get<wchar_t>
+
+std::moneypunct<char, (bool)0>
+moneypunct<char>
+std::moneypunct<wchar_t, (bool)0>
+moneypunct<wchar_t>
+std::moneypunct_byname<char, (bool)0>
+moneypunct_byname<char>
+std::moneypunct_byname<wchar_t, (bool)0>
+moneypunct_byname<wchar_t>
+
+# algorithm
+vector<string>::iterator find<vector<string>::iterator, string>(vector<string>::iterator, vector<string>::iterator, string const&, random_access_iterator_tag)
+vector<string>::iterator find(vector<string>::iterator, vector<string>::iterator, string const&, random_access_iterator_tag)
+
+string::iterator find<string::iterator, int>(string::iterator, string::iterator, int const&, random_access_iterator_tag)
+string::iterator find(string::iterator, string::iterator, int const&, random_access_iterator_tag)
+
+vector<int>::iterator find<vector<int>::iterator, int>(vector<int>::iterator, vector<int>::iterator, int const&, random_access_iterator_tag)
+vector<int>::iterator find(vector<int>::iterator, vector<int>::iterator, int const&, random_access_iterator_tag)
+
+char const * find<char const *, int>(char const *, char const *, int const &, random_access_iterator_tag)
+char const * find(char const *, char const *, int const &, random_access_iterator_tag)
+
+string::const_iterator find<string::const_iterator, int>(string::const_iterator, string::const_iterator, int const&, random_access_iterator_tag)
+string::const_iterator find(string::const_iterator, string::const_iterator, int const&, random_access_iterator_tag)
+
+string::const_iterator find_if<string::const_iterator, compare>(string::const_iterator, string::const_iterator, compare, random_access_iterator_tag)
+string::const_iterator find_if(string::const_iterator, string::const_iterator, compare, random_access_iterator_tag)
+
+vector<int>::iterator find_if<vector<int>::iterator, compare>(vector<int>::iterator, vector<int>::iterator, compare, random_access_iterator_tag)
+vector<int>::iterator find_if(vector<int>::iterator, vector<int>::iterator, compare, random_access_iterator_tag)
+
+ostream & operator<<<char, string_char_traits<char>, __default_alloc_template<true, 0>>(ostream &, string const &)
+ostream & operator<<(ostream &, string const &)
+
+istream & operator>><char, string_char_traits<char>, __default_alloc_template<true, 0>>(istream &, string &)
+istream & operator>>(istream &, string &)
+
+istream & getline<char, string_char_traits<char>, __default_alloc_template<true, 0>>(istream &, string &)
+istream & getline(istream &, string &)
+
+ostream& operator<< <char, char_traits<char>, allocator<char>>(ostream&, string const&)
+ostream & operator<<(ostream &, string const &)
+
+istream& operator>> <char, char_traits<char>, allocator<char>>(istream&, string&)
+istream & operator>>(istream &, string &)
+
+std::basic_ostream<char, std::char_traits<char> >::operator<<(long)
+ostream::operator<<(long)
diff --git a/libregex/tests/regex_test.cpp b/libregex/tests/regex_test.cpp
new file mode 100644
index 0000000..ec4f00f
--- /dev/null
+++ b/libregex/tests/regex_test.cpp
@@ -0,0 +1,94 @@
+/**
+ * @file regex_test.cpp
+ *
+ * A simple test for libregex. Run it through:
+ * $ regex_test
+ * or
+ * $ regex_test filename(s)
+ * when no argument is provided "mangled-name" is used,
+ * see it for the input file format
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ */
+
+#include "string_manip.h"
+
+#include "op_regex.h"
+
+#include <iostream>
+#include <fstream>
+
+#include <cstdlib>
+
+using namespace std;
+
+static int nr_error = 0;
+
+static void do_test(istream& fin)
+{
+ regular_expression_replace rep;
+
+ setup_regex(rep, "../stl.pat");
+
+ string test, expect, last;
+ bool first = true;
+ while (getline(fin, last)) {
+ last = trim(last);
+ if (last.length() == 0 || last[0] == '#')
+ continue;
+
+ if (first) {
+ test = last;
+ first = false;
+ } else {
+ expect = last;
+ first = true;
+ string str(test);
+ rep.execute(str);
+ if (str != expect) {
+ cerr << "mistmatch: test, expect, returned\n"
+ << '"' << test << '"' << endl
+ << '"' << expect << '"' << endl
+ << '"' << str << '"' << endl;
+ ++nr_error;
+ }
+ }
+ }
+
+ if (!first)
+ cerr << "input file ill formed\n";
+}
+
+int main(int argc, char * argv[])
+{
+ try {
+ if (argc > 1) {
+ for (int i = 1; i < argc; ++i) {
+ ifstream fin(argv[i]);
+ do_test(fin);
+ }
+ } else {
+ ifstream fin("mangled-name");
+ if (!fin) {
+ cerr << "Unable to open input test "
+ << "\"mangled_name\"\n" << endl;
+ exit(EXIT_FAILURE);
+ }
+ do_test(fin);
+ }
+ }
+ catch (bad_regex const & e) {
+ cerr << "bad_regex " << e.what() << endl;
+ return EXIT_FAILURE;
+ }
+ catch (exception const & e) {
+ cerr << "exception: " << e.what() << endl;
+ return EXIT_FAILURE;
+ }
+
+ return nr_error ? EXIT_FAILURE : EXIT_SUCCESS;
+}
+
diff --git a/libutil++/Makefile.am b/libutil++/Makefile.am
new file mode 100644
index 0000000..66fab2c
--- /dev/null
+++ b/libutil++/Makefile.am
@@ -0,0 +1,44 @@
+SUBDIRS = . tests
+
+AM_CPPFLAGS= \
+ -I ${top_srcdir}/libutil \
+ -I ${top_srcdir}/libop \
+ -I ${top_srcdir}/libpp
+
+AM_CXXFLAGS = @OP_CXXFLAGS@
+
+noinst_LIBRARIES = libutil++.a
+libutil___a_SOURCES = \
+ op_bfd.cpp \
+ op_bfd.h \
+ bfd_support.cpp \
+ bfd_support.h \
+ string_filter.cpp \
+ string_filter.h \
+ glob_filter.cpp \
+ glob_filter.h \
+ growable_vector.h \
+ path_filter.cpp \
+ path_filter.h \
+ file_manip.cpp \
+ file_manip.h \
+ sparse_array.h \
+ stream_util.cpp \
+ stream_util.h \
+ string_manip.cpp \
+ string_manip.h \
+ cverb.cpp \
+ cverb.h \
+ generic_spec.h \
+ op_exception.cpp \
+ op_exception.h \
+ child_reader.cpp \
+ child_reader.h \
+ unique_storage.h \
+ utility.h \
+ cached_value.h \
+ comma_list.h \
+ xml_output.h \
+ xml_output.cpp \
+ bfd_spu_support.cpp \
+ op_spu_bfd.cpp
diff --git a/libutil++/Makefile.in b/libutil++/Makefile.in
new file mode 100644
index 0000000..d38e1c9
--- /dev/null
+++ b/libutil++/Makefile.in
@@ -0,0 +1,653 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = libutil++
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/binutils.m4 \
+ $(top_srcdir)/m4/builtinexpect.m4 \
+ $(top_srcdir)/m4/cellspubfdsupport.m4 \
+ $(top_srcdir)/m4/compileroption.m4 \
+ $(top_srcdir)/m4/configmodule.m4 \
+ $(top_srcdir)/m4/copyifchange.m4 $(top_srcdir)/m4/docbook.m4 \
+ $(top_srcdir)/m4/extradirs.m4 $(top_srcdir)/m4/findkernel.m4 \
+ $(top_srcdir)/m4/kerneloption.m4 \
+ $(top_srcdir)/m4/kernelversion.m4 \
+ $(top_srcdir)/m4/mallocattribute.m4 \
+ $(top_srcdir)/m4/poptconst.m4 \
+ $(top_srcdir)/m4/precompiledheader.m4 $(top_srcdir)/m4/qt.m4 \
+ $(top_srcdir)/m4/resultyn.m4 $(top_srcdir)/m4/sstream.m4 \
+ $(top_srcdir)/m4/typedef.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+ARFLAGS = cru
+libutil___a_AR = $(AR) $(ARFLAGS)
+libutil___a_LIBADD =
+am_libutil___a_OBJECTS = op_bfd.$(OBJEXT) bfd_support.$(OBJEXT) \
+ string_filter.$(OBJEXT) glob_filter.$(OBJEXT) \
+ path_filter.$(OBJEXT) file_manip.$(OBJEXT) \
+ stream_util.$(OBJEXT) string_manip.$(OBJEXT) cverb.$(OBJEXT) \
+ op_exception.$(OBJEXT) child_reader.$(OBJEXT) \
+ xml_output.$(OBJEXT) bfd_spu_support.$(OBJEXT) \
+ op_spu_bfd.$(OBJEXT)
+libutil___a_OBJECTS = $(am_libutil___a_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libutil___a_SOURCES)
+DIST_SOURCES = $(libutil___a_SOURCES)
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-exec-recursive install-info-recursive \
+ install-recursive installcheck-recursive installdirs-recursive \
+ pdf-recursive ps-recursive uninstall-info-recursive \
+ uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFD_LIBS = @BFD_LIBS@
+BUILD_JVMPI_AGENT_FALSE = @BUILD_JVMPI_AGENT_FALSE@
+BUILD_JVMPI_AGENT_TRUE = @BUILD_JVMPI_AGENT_TRUE@
+BUILD_JVMTI_AGENT_FALSE = @BUILD_JVMTI_AGENT_FALSE@
+BUILD_JVMTI_AGENT_TRUE = @BUILD_JVMTI_AGENT_TRUE@
+CAT_ENTRY_END = @CAT_ENTRY_END@
+CAT_ENTRY_START = @CAT_ENTRY_START@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOCBOOK_ROOT = @DOCBOOK_ROOT@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+EXTRA_CFLAGS_MODULE = @EXTRA_CFLAGS_MODULE@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAVA_HOMEDIR = @JAVA_HOMEDIR@
+KINC = @KINC@
+KSRC = @KSRC@
+KVERS = @KVERS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBERTY_LIBS = @LIBERTY_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MOC = @MOC@
+MODINSTALLDIR = @MODINSTALLDIR@
+OBJEXT = @OBJEXT@
+OPROFILE_DIR = @OPROFILE_DIR@
+OPROFILE_MODULE_ARCH = @OPROFILE_MODULE_ARCH@
+OP_CFLAGS = @OP_CFLAGS@
+OP_CXXFLAGS = @OP_CXXFLAGS@
+OP_DOCDIR = @OP_DOCDIR@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POPT_LIBS = @POPT_LIBS@
+PTRDIFF_T_TYPE = @PTRDIFF_T_TYPE@
+QT_INCLUDES = @QT_INCLUDES@
+QT_LDFLAGS = @QT_LDFLAGS@
+QT_LIB = @QT_LIB@
+QT_VERSION = @QT_VERSION@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIZE_T_TYPE = @SIZE_T_TYPE@
+STRIP = @STRIP@
+UIC = @UIC@
+VERSION = @VERSION@
+XML_CATALOG = @XML_CATALOG@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+have_qt_FALSE = @have_qt_FALSE@
+have_qt_TRUE = @have_qt_TRUE@
+have_xsltproc_FALSE = @have_xsltproc_FALSE@
+have_xsltproc_TRUE = @have_xsltproc_TRUE@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+kernel_support_FALSE = @kernel_support_FALSE@
+kernel_support_TRUE = @kernel_support_TRUE@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+topdir = @topdir@
+SUBDIRS = . tests
+AM_CPPFLAGS = \
+ -I ${top_srcdir}/libutil \
+ -I ${top_srcdir}/libop \
+ -I ${top_srcdir}/libpp
+
+AM_CXXFLAGS = @OP_CXXFLAGS@
+noinst_LIBRARIES = libutil++.a
+libutil___a_SOURCES = \
+ op_bfd.cpp \
+ op_bfd.h \
+ bfd_support.cpp \
+ bfd_support.h \
+ string_filter.cpp \
+ string_filter.h \
+ glob_filter.cpp \
+ glob_filter.h \
+ growable_vector.h \
+ path_filter.cpp \
+ path_filter.h \
+ file_manip.cpp \
+ file_manip.h \
+ sparse_array.h \
+ stream_util.cpp \
+ stream_util.h \
+ string_manip.cpp \
+ string_manip.h \
+ cverb.cpp \
+ cverb.h \
+ generic_spec.h \
+ op_exception.cpp \
+ op_exception.h \
+ child_reader.cpp \
+ child_reader.h \
+ unique_storage.h \
+ utility.h \
+ cached_value.h \
+ comma_list.h \
+ xml_output.h \
+ xml_output.cpp \
+ bfd_spu_support.cpp \
+ op_spu_bfd.cpp
+
+all: all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libutil++/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign libutil++/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLIBRARIES:
+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+libutil++.a: $(libutil___a_OBJECTS) $(libutil___a_DEPENDENCIES)
+ -rm -f libutil++.a
+ $(libutil___a_AR) libutil++.a $(libutil___a_OBJECTS) $(libutil___a_LIBADD)
+ $(RANLIB) libutil++.a
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bfd_spu_support.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bfd_support.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/child_reader.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cverb.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file_manip.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glob_filter.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/op_bfd.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/op_exception.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/op_spu_bfd.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/path_filter.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stream_util.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/string_filter.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/string_manip.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xml_output.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(mkdir_p) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(LIBRARIES)
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+ clean clean-generic clean-libtool clean-noinstLIBRARIES \
+ clean-recursive ctags ctags-recursive distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-recursive distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-exec install-exec-am install-info \
+ install-info-am install-man install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic maintainer-clean-recursive \
+ mostlyclean mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \
+ tags tags-recursive uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/libutil++/bfd_spu_support.cpp b/libutil++/bfd_spu_support.cpp
new file mode 100644
index 0000000..2dd497d
--- /dev/null
+++ b/libutil++/bfd_spu_support.cpp
@@ -0,0 +1,116 @@
+/**
+ * @file libutil++/bfd_spu_support.cpp
+ * Special BFD functions for processing a Cell BE SPU profile
+ *
+ * @remark Copyright 2007 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Maynard Johnson
+ * (C) Copyright IBM Corporation 2007
+ */
+
+#include "bfd_support.h"
+#include "op_bfd.h"
+#include "config.h"
+#include "cverb.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <iostream>
+#include <fstream>
+#include <sstream>
+#include <string>
+#include <cstring>
+#include <sys/types.h>
+
+struct spu_elf {
+ FILE * stream;
+ off_t spu_offset;
+};
+
+using namespace std;
+
+extern verbose vbfd;
+
+#ifdef HAVE_BFD_OPENR_IOVEC_WITH_7PARMS
+
+namespace {
+
+static void *
+spu_bfd_iovec_open(bfd * nbfd, void * open_closure)
+{
+ /* Checking nbfd isn't really necessary, except to silence
+ * compile warning. In fact, nbfd will always be non-NULL.
+ */
+ if (nbfd)
+ return open_closure;
+ else
+ return NULL;
+}
+
+static int
+spu_bfd_iovec_close(bfd * nbfd, void * stream)
+{
+ spu_elf * my_stream = (spu_elf *) stream;
+
+ fclose(my_stream->stream);
+ free(my_stream);
+ /* Checking nbfd isn't really necessary, except to silence
+ * compile warning. In fact, nbfd will always be non-NULL.
+ */
+ if (nbfd)
+ return 1;
+ else
+ return 0;
+}
+
+static file_ptr
+spu_bfd_iovec_pread(bfd * abfd, void * stream, void * buf,
+ file_ptr nbytes, file_ptr offset)
+{
+ spu_elf * my_stream = (spu_elf *) stream;
+ fseek(my_stream->stream, my_stream->spu_offset + offset,
+ SEEK_SET);
+ nbytes = fread(buf, sizeof(char), nbytes, my_stream->stream);
+ /* Checking abfd isn't really necessary, except to silence
+ * compile warning. In fact, abfd will always be non-NULL.
+ */
+ if (abfd)
+ return nbytes;
+ else
+ return 0;
+}
+} // namespace anon
+#endif
+
+bfd *
+spu_open_bfd(string const name, int fd, uint64_t offset_to_spu_elf)
+{
+
+ bfd * nbfd = NULL;
+ spu_elf * spu_elf_stream = (spu_elf *)malloc(sizeof(spu_elf));
+
+ FILE * fp = fdopen(fd, "r");
+ spu_elf_stream->stream = fp;
+ spu_elf_stream->spu_offset = offset_to_spu_elf;
+#ifdef HAVE_BFD_OPENR_IOVEC_WITH_7PARMS
+ nbfd = bfd_openr_iovec(strdup(name.c_str()), "elf32-spu",
+ spu_bfd_iovec_open, spu_elf_stream,
+ spu_bfd_iovec_pread, spu_bfd_iovec_close, NULL);
+#else
+ ostringstream os;
+ os << "Attempt to process a Cell Broadband Engine SPU profile without"
+ << "proper BFD support.\n"
+ << "Rebuild the opreport utility with the correct BFD library.\n"
+ << "See the OProfile user manual for more information.\n";
+ throw op_runtime_error(os.str());
+#endif
+ if (!nbfd) {
+ cverb << vbfd << "spu_open_bfd failed for " << name << endl;
+ return NULL;
+ }
+
+ bfd_check_format(nbfd, bfd_object);
+
+ return nbfd;
+}
diff --git a/libutil++/bfd_support.cpp b/libutil++/bfd_support.cpp
new file mode 100644
index 0000000..4a83172
--- /dev/null
+++ b/libutil++/bfd_support.cpp
@@ -0,0 +1,637 @@
+/**
+ * @file bfd_support.cpp
+ * BFD muck we have to deal with.
+ *
+ * @remark Copyright 2005 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ */
+
+#include "bfd_support.h"
+
+#include "op_bfd.h"
+#include "op_fileio.h"
+#include "op_config.h"
+#include "string_manip.h"
+#include "file_manip.h"
+#include "cverb.h"
+#include "locate_images.h"
+
+#include <cstdlib>
+#include <cstring>
+
+#include <iostream>
+#include <fstream>
+#include <sstream>
+#include <string>
+#include <cstring>
+#include <cstdlib>
+
+using namespace std;
+
+extern verbose vbfd;
+
+namespace {
+
+
+void check_format(string const & file, bfd ** ibfd)
+{
+ if (!bfd_check_format_matches(*ibfd, bfd_object, NULL)) {
+ cverb << vbfd << "BFD format failure for " << file << endl;
+ bfd_close(*ibfd);
+ *ibfd = NULL;
+ }
+}
+
+
+bool separate_debug_file_exists(string & name, unsigned long const crc,
+ extra_images const & extra)
+{
+ unsigned long file_crc = 0;
+ // The size of 2 * 1024 elements for the buffer is arbitrary.
+ char buffer[2 * 1024];
+
+ image_error img_ok;
+ string const image_path = extra.find_image_path(name, img_ok, true);
+
+ if (img_ok != image_ok)
+ return false;
+
+ name = image_path;
+
+ ifstream file(image_path.c_str());
+ if (!file)
+ return false;
+
+ cverb << vbfd << "found " << name;
+ while (file) {
+ file.read(buffer, sizeof(buffer));
+ file_crc = calc_crc32(file_crc,
+ reinterpret_cast<unsigned char *>(&buffer[0]),
+ file.gcount());
+ }
+ cverb << vbfd << " with crc32 = " << hex << file_crc << endl;
+ return crc == file_crc;
+}
+
+
+bool get_debug_link_info(bfd * ibfd, string & filename, unsigned long & crc32)
+{
+ asection * sect;
+
+ cverb << vbfd << "fetching .gnu_debuglink section" << endl;
+ sect = bfd_get_section_by_name(ibfd, ".gnu_debuglink");
+
+ if (sect == NULL)
+ return false;
+
+ bfd_size_type debuglink_size = bfd_section_size(ibfd, sect);
+ char contents[debuglink_size];
+ cverb << vbfd
+ << ".gnu_debuglink section has size " << debuglink_size << endl;
+
+ if (!bfd_get_section_contents(ibfd, sect,
+ reinterpret_cast<unsigned char *>(contents),
+ static_cast<file_ptr>(0), debuglink_size)) {
+ bfd_perror("bfd_get_section_contents:get_debug:");
+ exit(2);
+ }
+
+ /* CRC value is stored after the filename, aligned up to 4 bytes. */
+ size_t filename_len = strlen(contents);
+ size_t crc_offset = filename_len + 1;
+ crc_offset = (crc_offset + 3) & ~3;
+
+ crc32 = bfd_get_32(ibfd,
+ reinterpret_cast<bfd_byte *>(contents + crc_offset));
+ filename = string(contents, filename_len);
+ cverb << vbfd << ".gnu_debuglink filename is " << filename << endl;
+ return true;
+}
+
+
+/**
+ * With Objective C, we'll get strings like:
+ *
+ * _i_GSUnicodeString__rangeOfCharacterSetFromSet_options_range
+ *
+ * for the symbol name, and:
+ * -[GSUnicodeString rangeOfCharacterFromSet:options:range:]
+ *
+ * for the function name, so we have to do some looser matching
+ * than for other languages (unfortunately, it's not possible
+ * to demangle Objective C symbols).
+ */
+bool objc_match(string const & sym, string const & method)
+{
+ if (method.length() < 3)
+ return false;
+
+ string mangled;
+
+ if (is_prefix(method, "-[")) {
+ mangled += "_i_";
+ } else if (is_prefix(method, "+[")) {
+ mangled += "_c_";
+ } else {
+ return false;
+ }
+
+ string::const_iterator it = method.begin() + 2;
+ string::const_iterator const end = method.end();
+
+ bool found_paren = false;
+
+ for (; it != end; ++it) {
+ switch (*it) {
+ case ' ':
+ mangled += '_';
+ if (!found_paren)
+ mangled += '_';
+ break;
+ case ':':
+ mangled += '_';
+ break;
+ case ')':
+ case ']':
+ break;
+ case '(':
+ found_paren = true;
+ mangled += '_';
+ break;
+ default:
+ mangled += *it;
+ }
+ }
+
+ return sym == mangled;
+}
+
+
+/*
+ * With a binary image where some objects are missing debug
+ * info, we can end up attributing to a completely different
+ * function (#484660): bfd_nearest_line() will happily move from one
+ * symbol to the nearest one it can find with debug information.
+ * To mitigate this problem, we check that the symbol name
+ * matches the returned function name.
+ *
+ * However, this check fails in some cases it shouldn't:
+ * Objective C, and C++ static inline functions (as discussed in
+ * GCC bugzilla #11774). So, we have a looser check that
+ * accepts merely a substring, plus some magic for Objective C.
+ *
+ * If even the loose check fails, then we give up.
+ */
+bool is_correct_function(string const & function, string const & name)
+{
+ if (name == function)
+ return true;
+
+ if (objc_match(name, function))
+ return true;
+
+ // warn the user if we had to use the loose check
+ if (name.find(function) != string::npos) {
+ static bool warned = false;
+ if (!warned) {
+ cerr << "warning: some functions compiled without "
+ << "debug information may have incorrect source "
+ << "line attributions" << endl;
+ warned = true;
+ }
+ cverb << vbfd << "is_correct_function(" << function << ", "
+ << name << ") fuzzy match." << endl;
+ return true;
+ }
+
+ return false;
+}
+
+
+/*
+ * binutils 2.12 and below have a small bug where functions without a
+ * debug entry at the prologue start do not give a useful line number
+ * from bfd_find_nearest_line(). This can happen with certain gcc
+ * versions such as 2.95.
+ *
+ * We work around this problem by scanning forward for a vma with valid
+ * linenr info, if we can't get a valid line number. Problem uncovered
+ * by Norbert Kaufmann. The work-around decreases, on the tincas
+ * application, the number of failure to retrieve linenr info from 835
+ * to 173. Most of the remaining are c++ inline functions mainly from
+ * the STL library. Fix #529622
+ */
+void fixup_linenr(bfd * abfd, asection * section, asymbol ** syms,
+ string const & name, bfd_vma pc,
+ char const ** filename, unsigned int * line)
+{
+ char const * cfilename;
+ char const * function;
+ unsigned int linenr;
+
+ // FIXME: looking at debug info for all gcc version shows than
+ // the same problems can -perhaps- occur for epilog code: find a
+ // samples files with samples in epilog and try opreport -l -g
+ // on it, check it also with opannotate.
+
+ // first restrict the search on a sensible range of vma, 16 is
+ // an intuitive value based on epilog code look
+ size_t max_search = 16;
+ size_t section_size = bfd_section_size(abfd, section);
+ if (pc + max_search > section_size)
+ max_search = section_size - pc;
+
+ for (size_t i = 1; i < max_search; ++i) {
+ bool ret = bfd_find_nearest_line(abfd, section, syms, pc + i,
+ &cfilename, &function,
+ &linenr);
+
+ if (ret && cfilename && function && linenr != 0
+ && is_correct_function(function, name)) {
+ *filename = cfilename;
+ *line = linenr;
+ return;
+ }
+ }
+}
+
+
+} // namespace anon
+
+
+bfd * open_bfd(string const & file)
+{
+ /* bfd keeps its own reference to the filename char *,
+ * so it must have a lifetime longer than the ibfd */
+ bfd * ibfd = bfd_openr(file.c_str(), NULL);
+ if (!ibfd) {
+ cverb << vbfd << "bfd_openr failed for " << file << endl;
+ return NULL;
+ }
+
+ check_format(file, &ibfd);
+
+ return ibfd;
+}
+
+
+bfd * fdopen_bfd(string const & file, int fd)
+{
+ /* bfd keeps its own reference to the filename char *,
+ * so it must have a lifetime longer than the ibfd */
+ bfd * ibfd = bfd_fdopenr(file.c_str(), NULL, fd);
+ if (!ibfd) {
+ cverb << vbfd << "bfd_openr failed for " << file << endl;
+ return NULL;
+ }
+
+ check_format(file, &ibfd);
+
+ return ibfd;
+}
+
+
+bool find_separate_debug_file(bfd * ibfd, string const & filepath_in,
+ string & debug_filename, extra_images const & extra)
+{
+ string filepath(filepath_in);
+ string basename;
+ unsigned long crc32;
+
+ if (!get_debug_link_info(ibfd, basename, crc32))
+ return false;
+
+ // Work out the image file's directory prefix
+ string filedir = op_dirname(filepath);
+ // Make sure it starts with /
+ if (filedir.size() > 0 && filedir.at(filedir.size() - 1) != '/')
+ filedir += '/';
+
+ string first_try(filedir + ".debug/" + basename);
+ string second_try(DEBUGDIR + filedir + basename);
+ string third_try(filedir + basename);
+
+ cverb << vbfd << "looking for debugging file " << basename
+ << " with crc32 = " << hex << crc32 << endl;
+
+ if (separate_debug_file_exists(first_try, crc32, extra))
+ debug_filename = first_try;
+ else if (separate_debug_file_exists(second_try, crc32, extra))
+ debug_filename = second_try;
+ else if (separate_debug_file_exists(third_try, crc32, extra))
+ debug_filename = third_try;
+ else
+ return false;
+
+ return true;
+}
+
+
+bool interesting_symbol(asymbol * sym)
+{
+ // #717720 some binutils are miscompiled by gcc 2.95, one of the
+ // typical symptom can be catched here.
+ if (!sym->section) {
+ ostringstream os;
+ os << "Your version of binutils seems to have a bug.\n"
+ << "Read http://oprofile.sf.net/faq/#binutilsbug\n";
+ throw op_runtime_error(os.str());
+ }
+
+ if (!(sym->section->flags & SEC_CODE))
+ return false;
+
+ // returning true for fix up in op_bfd_symbol()
+ if (!sym->name || sym->name[0] == '\0')
+ return true;
+ /* ARM assembler internal mapping symbols aren't interesting */
+ if ((strcmp("$a", sym->name) == 0) ||
+ (strcmp("$t", sym->name) == 0) ||
+ (strcmp("$d", sym->name) == 0))
+ return false;
+
+ // C++ exception stuff
+ if (sym->name[0] == '.' && sym->name[1] == 'L')
+ return false;
+
+ /* This case cannot be moved to boring_symbol(),
+ * because that's only used for duplicate VMAs,
+ * and sometimes this symbol appears at an address
+ * different from all other symbols.
+ */
+ if (!strcmp("gcc2_compiled.", sym->name))
+ return false;
+
+ if (sym->flags & BSF_SECTION_SYM)
+ return false;
+
+ if (!(sym->section->flags & SEC_LOAD))
+ return false;
+
+ return true;
+}
+
+
+bool boring_symbol(op_bfd_symbol const & first, op_bfd_symbol const & second)
+{
+ if (first.name() == "Letext")
+ return true;
+ else if (second.name() == "Letext")
+ return false;
+
+ if (first.name().substr(0, 2) == "??")
+ return true;
+ else if (second.name().substr(0, 2) == "??")
+ return false;
+
+ if (first.hidden() && !second.hidden())
+ return true;
+ else if (!first.hidden() && second.hidden())
+ return false;
+
+ if (first.name()[0] == '_' && second.name()[0] != '_')
+ return true;
+ else if (first.name()[0] != '_' && second.name()[0] == '_')
+ return false;
+
+ if (first.weak() && !second.weak())
+ return true;
+ else if (!first.weak() && second.weak())
+ return false;
+
+ return false;
+}
+
+
+bool bfd_info::has_debug_info() const
+{
+ if (!valid())
+ return false;
+
+ for (asection const * sect = abfd->sections; sect; sect = sect->next) {
+ if (sect->flags & SEC_DEBUGGING)
+ return true;
+ }
+
+ return false;
+}
+
+
+bfd_info::~bfd_info()
+{
+ free(synth_syms);
+ close();
+}
+
+
+void bfd_info::close()
+{
+ if (abfd)
+ bfd_close(abfd);
+}
+
+void bfd_info::translate_debuginfo_syms(asymbol ** dbg_syms, long nr_dbg_syms)
+{
+ bfd_section ** image_sect;
+ unsigned int img_sect_cnt = 0;
+ bfd * image_bfd = image_bfd_info->abfd;
+
+ image_sect = (bfd_section **) malloc(image_bfd->section_count * (sizeof(bfd_section *)));
+
+ for (bfd_section * sect = image_bfd->sections;
+ sect && img_sect_cnt < image_bfd->section_count;
+ sect = sect->next) {
+ // A comment section marks the end of the needed sections
+ if (strstr(sect->name, ".comment") == sect->name)
+ break;
+ image_sect[sect->index] = sect;
+ img_sect_cnt++;
+ }
+
+ asymbol * sym = dbg_syms[0];
+ for (int i = 0; i < nr_dbg_syms; sym = dbg_syms[++i]) {
+ if (sym->section->owner && sym->section->owner == abfd) {
+ if ((unsigned int)sym->section->index < img_sect_cnt) {
+ sym->section = image_sect[sym->section->index];
+ sym->the_bfd = image_bfd;
+ }
+ }
+ }
+ free(image_sect);
+}
+
+#if SYNTHESIZE_SYMBOLS
+bool bfd_info::get_synth_symbols()
+{
+ extern const bfd_target bfd_elf64_powerpc_vec;
+ extern const bfd_target bfd_elf64_powerpcle_vec;
+ bool is_elf64_powerpc_target = (abfd->xvec == &bfd_elf64_powerpc_vec)
+ || (abfd->xvec == &bfd_elf64_powerpcle_vec);
+
+ if (!is_elf64_powerpc_target)
+ return false;
+
+ void * buf;
+ uint tmp;
+ long nr_mini_syms = bfd_read_minisymbols(abfd, 0, &buf, &tmp);
+ if (nr_mini_syms < 1)
+ return false;
+
+ asymbol ** mini_syms = (asymbol **)buf;
+ buf = NULL;
+ bfd * synth_bfd;
+
+ /* For ppc64, a debuginfo file by itself does not hold enough symbol
+ * information for us to properly attribute samples to symbols. If
+ * the image file's bfd has no symbols (as in a super-stripped library),
+ * then we need to do the extra processing in translate_debuginfo_syms.
+ */
+ if (image_bfd_info && image_bfd_info->nr_syms == 0) {
+ translate_debuginfo_syms(mini_syms, nr_mini_syms);
+ synth_bfd = image_bfd_info->abfd;
+ } else
+ synth_bfd = abfd;
+
+ long nr_synth_syms = bfd_get_synthetic_symtab(synth_bfd,
+ nr_mini_syms,
+ mini_syms, 0,
+ NULL, &synth_syms);
+
+ if (nr_synth_syms < 0) {
+ free(mini_syms);
+ return false;
+ }
+
+ cverb << vbfd << "mini_syms: " << dec << nr_mini_syms << hex << endl;
+ cverb << vbfd << "synth_syms: " << dec << nr_synth_syms << hex << endl;
+
+ nr_syms = nr_mini_syms + nr_synth_syms;
+ syms.reset(new asymbol *[nr_syms + 1]);
+
+ for (size_t i = 0; i < (size_t)nr_mini_syms; ++i)
+ syms[i] = mini_syms[i];
+
+
+ for (size_t i = 0; i < (size_t)nr_synth_syms; ++i)
+ syms[nr_mini_syms + i] = synth_syms + i;
+
+
+ free(mini_syms);
+
+ // bfd_canonicalize_symtab does this, so shall we
+ syms[nr_syms] = NULL;
+
+ return true;
+}
+#else
+bool bfd_info::get_synth_symbols()
+{
+ return false;
+}
+#endif /* SYNTHESIZE_SYMBOLS */
+
+
+void bfd_info::get_symbols()
+{
+ if (!abfd)
+ return;
+
+ cverb << vbfd << "bfd_info::get_symbols() for "
+ << bfd_get_filename(abfd) << endl;
+
+ if (get_synth_symbols())
+ return;
+
+ if (bfd_get_file_flags(abfd) & HAS_SYMS)
+ nr_syms = bfd_get_symtab_upper_bound(abfd);
+
+ cverb << vbfd << "bfd_get_symtab_upper_bound: " << dec
+ << nr_syms << hex << endl;
+
+ nr_syms /= sizeof(asymbol *);
+
+ if (nr_syms < 1)
+ return;
+
+ syms.reset(new asymbol *[nr_syms]);
+
+ nr_syms = bfd_canonicalize_symtab(abfd, syms.get());
+
+ if (image_bfd_info)
+ translate_debuginfo_syms(syms.get(), nr_syms);
+
+ cverb << vbfd << "bfd_canonicalize_symtab: " << dec
+ << nr_syms << hex << endl;
+}
+
+
+linenr_info const
+find_nearest_line(bfd_info const & b, op_bfd_symbol const & sym,
+ bfd_vma offset, bool anon_obj)
+{
+ char const * function = "";
+ char const * cfilename = "";
+ unsigned int linenr = 0;
+ linenr_info info;
+ bfd * abfd;
+ asymbol ** syms;
+ asection * section;
+ bfd_vma pc;
+ bool ret;
+
+ if (!b.valid())
+ goto fail;
+
+ // take care about artificial symbol
+ if (!sym.symbol())
+ goto fail;
+
+ abfd = b.abfd;
+ syms = b.syms.get();
+ if (!syms)
+ goto fail;
+ section = sym.symbol()->section;
+ if (anon_obj)
+ pc = offset - sym.symbol()->section->vma;
+ else
+ pc = (sym.value() + offset) - sym.filepos();
+
+ if ((bfd_get_section_flags(abfd, section) & SEC_ALLOC) == 0)
+ goto fail;
+
+ if (pc >= bfd_section_size(abfd, section))
+ goto fail;
+
+ ret = bfd_find_nearest_line(abfd, section, syms, pc, &cfilename,
+ &function, &linenr);
+
+ if (!ret || !cfilename || !function)
+ goto fail;
+
+ /*
+ * is_correct_function does not handle the case of static inlines,
+ * but if the linenr is non-zero in the inline case, it is the correct
+ * line number.
+ */
+ if (linenr == 0 && !is_correct_function(function, sym.name()))
+ goto fail;
+
+ if (linenr == 0) {
+ fixup_linenr(abfd, section, syms, sym.name(), pc, &cfilename,
+ &linenr);
+ }
+
+ info.found = true;
+ info.filename = cfilename;
+ info.line = linenr;
+ return info;
+
+fail:
+ info.found = false;
+ // some stl lacks string::clear()
+ info.filename.erase(info.filename.begin(), info.filename.end());
+ info.line = 0;
+ return info;
+}
diff --git a/libutil++/bfd_support.h b/libutil++/bfd_support.h
new file mode 100644
index 0000000..4f6a369
--- /dev/null
+++ b/libutil++/bfd_support.h
@@ -0,0 +1,156 @@
+/**
+ * @file bfd_support.h
+ * BFD muck we have to deal with.
+ *
+ * @remark Copyright 2005 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ */
+
+#ifndef BFD_SUPPORT_H
+#define BFD_SUPPORT_H
+
+#include "utility.h"
+#include "op_types.h"
+#include "locate_images.h"
+
+#include <bfd.h>
+#include <stdint.h>
+
+#include <string>
+
+class op_bfd_symbol;
+
+/// holder for BFD state we must keep
+struct bfd_info {
+ bfd_info() : abfd(0), nr_syms(0), synth_syms(0), image_bfd_info(0) {}
+
+ ~bfd_info();
+
+ /// close the BFD, setting abfd to NULL
+ void close();
+
+ /// return true if BFD is readable
+ bool valid() const { return abfd; }
+
+ /// return true if BFD has debug info
+ bool has_debug_info() const;
+
+ /// pick out the symbols from the bfd, if we can
+ void get_symbols();
+
+ /// the actual BFD
+ bfd * abfd;
+ /// normal symbols (includes synthesized symbols)
+ scoped_array<asymbol *> syms;
+ /// nr. symbols
+ size_t nr_syms;
+
+ void set_image_bfd_info(bfd_info * ibfd) { image_bfd_info = ibfd; }
+
+private:
+ /**
+ * Acquire the synthetic symbols if we need to.
+ */
+ bool get_synth_symbols();
+
+ /**
+ * On PPC64, synth_syms points to an array of synthetic asymbol
+ * structs returned from bfd_get_synthetic_symtab. The syms
+ * member points into this array, so we have to keep it around
+ * until ~bfd_info time.
+ */
+ asymbol * synth_syms;
+
+ /**
+ * Under certain circumstances, correct handling of the bfd for a
+ * debuginfo file is not possible without access to the bfd for
+ * the actual image file. The image_bfd_info field provides access to
+ * that bfd when this bfd_info is for a debuginfo file; otherwise
+ * image_bfd_info is NULL.
+ */
+ bfd_info * image_bfd_info;
+
+ /* To address a different issue, we discard symbols whose section
+ * flag does not contain SEC_LOAD. But since this is true for symbols
+ * found in debuginfo files, we must run those debuginfo symbols
+ * through the function below to prevent them from being inadvertently
+ * discarded. This function maps the sections from the symbols in
+ * the debuginfo bfd to those of the real image bfd. Then, when
+ * we later do symbol filtering, we see the sections from the real
+ * bfd, which do contain SEC_LOAD in the section flag.
+ */
+ void translate_debuginfo_syms(asymbol ** dbg_syms, long nr_dbg_syms);
+
+};
+
+
+/*
+ * find_separate_debug_file - return true if a valid separate debug file found
+ * @param ibfd binary file
+ * @param dir_in directory holding the binary file
+ * @param global_in
+ * @param filename path to valid debug file
+ *
+ * Search order for debug file and use first one found:
+ * 1) dir_in directory
+ * 2) dir_in/.debug directory
+ * 3) global_in/dir_in directory
+ *
+ * Newer binutils and Linux distributions (e.g. Fedora) allow the
+ * creation of debug files that are separate from the binary. The
+ * debugging information is stripped out of the binary file, placed in
+ * this separate file, and a link to the new file is placed in the
+ * binary. The debug files hold the information needed by the debugger
+ * (and OProfile) to map machine instructions back to source code.
+ */
+extern bool
+find_separate_debug_file(bfd * ibfd,
+ std::string const & filepath_in,
+ std::string & debug_filename,
+ extra_images const & extra);
+
+/// open the given BFD
+bfd * open_bfd(std::string const & file);
+
+/// open the given BFD from the fd
+bfd * fdopen_bfd(std::string const & file, int fd);
+
+/// Return a BFD for an SPU ELF embedded in PPE binary file
+bfd * spu_open_bfd(std::string const name, int fd, uint64_t offset_to_spu_elf);
+
+/// Return true if the symbol is worth looking at
+bool interesting_symbol(asymbol * sym);
+
+/**
+ * return true if the first symbol is less interesting than the second symbol
+ * boring symbol are eliminated when multiple symbol exist at the same vma
+ */
+bool boring_symbol(op_bfd_symbol const & first, op_bfd_symbol const & second);
+
+/// debug info for a given pc
+struct linenr_info {
+ /// did we find something?
+ bool found;
+ /// filename
+ std::string filename;
+ /// line number
+ unsigned int line;
+};
+
+/**
+ * Attempt to locate a filename + line number for the given symbol and
+ * offset.
+ *
+ * The bfd object is either the object associated with the binary or the
+ * once associated with the separated debug info file so find_nearest_line()
+ * can't lookup the section contents of code section etc. The filepos of
+ * debuginfo symbols are different from the original file but we fixed symbol
+ * filepos earlier.
+ */
+linenr_info const
+find_nearest_line(bfd_info const & ibfd, op_bfd_symbol const & sym,
+ bfd_vma offset, bool anon_obj);
+
+#endif /* !BFD_SUPPORT_H */
diff --git a/libutil++/cached_value.h b/libutil++/cached_value.h
new file mode 100644
index 0000000..362e16a
--- /dev/null
+++ b/libutil++/cached_value.h
@@ -0,0 +1,52 @@
+/**
+ * @file cached_value.h
+ * Hold a cached value.
+ *
+ * @remark Copyright 2005 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ */
+
+#ifndef CACHED_VALUE_H
+#define CACHED_VALUE_H
+
+#include "op_exception.h"
+
+/**
+ * Hold a single value, returning a cached value if there is one.
+ */
+template <class T>
+class cached_value
+{
+public:
+ cached_value() : set(false) {}
+
+ typedef T value_type;
+
+ /// return the cached value
+ value_type const get() const {
+ if (!set)
+ throw op_fatal_error("cached value not set");
+ return value;
+ }
+
+ /// return true if a value is cached
+ bool cached() const { return set; }
+
+ /// set the contained value
+ value_type const reset(value_type const & val) {
+ value = val;
+ set = true;
+ return value;
+ }
+
+private:
+ /// the cached value
+ value_type value;
+ /// is the value valid?
+ bool set;
+};
+
+
+#endif /* !CACHED_VALUE_H */
diff --git a/libutil++/child_reader.cpp b/libutil++/child_reader.cpp
new file mode 100644
index 0000000..b14c60c
--- /dev/null
+++ b/libutil++/child_reader.cpp
@@ -0,0 +1,276 @@
+/**
+ * @file child_reader.cpp
+ * Facility for reading from child processes
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#include <unistd.h>
+#include <sys/wait.h>
+#include <limits.h>
+
+#include <cerrno>
+#include <sstream>
+#include <iostream>
+#include <cstring>
+#include <cstdlib>
+
+#include "op_libiberty.h"
+#include "child_reader.h"
+
+using namespace std;
+
+child_reader::child_reader(string const & cmd, vector<string> const & args)
+ :
+ fd1(-1), fd2(-1),
+ pos1(0), end1(0),
+ pos2(0), end2(0),
+ pid(0),
+ first_error(0),
+ buf2(0), sz_buf2(0),
+ buf1(new char[PIPE_BUF]),
+ process_name(cmd),
+ is_terminated(true),
+ terminate_on_exception(false),
+ forked(false)
+{
+ exec_command(cmd, args);
+}
+
+
+child_reader::~child_reader()
+{
+ terminate_process();
+ delete [] buf1;
+ if (buf2) {
+ // allocated through C alloc
+ free(buf2);
+ }
+}
+
+
+void child_reader::exec_command(string const & cmd, vector<string> const & args)
+{
+ int pstdout[2];
+ int pstderr[2];
+
+ if (pipe(pstdout) == -1 || pipe(pstderr) == -1) {
+ first_error = errno;
+ return;
+ }
+
+ pid = fork();
+ switch (pid) {
+ case -1:
+ first_error = errno;
+ return;
+
+ case 0: {
+ char const ** argv = new char const *[args.size() + 2];
+ size_t i;
+ argv[0] = cmd.c_str();
+
+ for (i = 1 ; i <= args.size() ; ++i)
+ argv[i] = args[i - 1].c_str();
+
+ argv[i] = 0;
+
+ // child: we can cleanup a few fd
+ close(pstdout[0]);
+ dup2(pstdout[1], STDOUT_FILENO);
+ close(pstdout[1]);
+ close(pstderr[0]);
+ dup2(pstderr[1], STDERR_FILENO);
+ close(pstderr[1]);
+
+ execvp(cmd.c_str(), (char * const *)argv);
+
+ int ret_code = errno;
+
+ // we can communicate with parent by writing to stderr
+ // and by returning a non zero error code. Setting
+ // first_error in the child is a non-sense
+
+ // we are in the child process: so this error message
+ // is redirect to the parent process
+ cerr << "Couldn't exec \"" << cmd << "\" : "
+ << strerror(errno) << endl;
+ exit(ret_code);
+ }
+
+ default:;
+ // parent: we do not write on these fd.
+ close(pstdout[1]);
+ close(pstderr[1]);
+ forked = true;
+ break;
+ }
+
+ fd1 = pstdout[0];
+ fd2 = pstderr[0];
+
+ is_terminated = false;
+
+ return;
+}
+
+
+bool child_reader::block_read()
+{
+ fd_set read_fs;
+
+ FD_ZERO(&read_fs);
+ FD_SET(fd1, &read_fs);
+ FD_SET(fd2, &read_fs);
+
+ if (select(max(fd1, fd2) + 1, &read_fs, 0, 0, 0) >= 0) {
+ if (FD_ISSET(fd1, &read_fs)) {
+ ssize_t temp = read(fd1, buf1, PIPE_BUF);
+ if (temp >= 0)
+ end1 = temp;
+ else
+ end1 = 0;
+ }
+
+ if (FD_ISSET(fd2, &read_fs)) {
+ if (end2 >= sz_buf2) {
+ sz_buf2 = sz_buf2 ? sz_buf2 * 2 : PIPE_BUF;
+ buf2 = (char *)xrealloc(buf2, sz_buf2);
+ }
+
+ ssize_t temp = read(fd2, buf2 + end2, sz_buf2 - end2);
+ if (temp > 0)
+ end2 += temp;
+ }
+ }
+
+ bool ret = !(end1 == 0 && end2 == 0);
+
+ if (end1 == -1)
+ end1 = 0;
+ if (end2 == -1)
+ end2 = 0;
+
+ return ret;
+}
+
+
+bool child_reader::getline(string & result)
+{
+ // some stl lacks string::clear()
+ result.erase(result.begin(), result.end());
+
+ bool ok = true;
+ bool ret = true;
+ bool can_stop = false;
+ do {
+ int temp = end2;
+ if (pos1 >= end1) {
+ pos1 = 0;
+ ret = block_read();
+ }
+
+ // for efficiency try to copy as much as we can of data
+ ssize_t temp_pos = pos1;
+ while (temp_pos < end1 && ok) {
+ char ch = buf1[temp_pos++];
+ if (ch == '\n')
+ ok = false;
+ }
+
+ // !ok ==> endl has been read so do not copy it.
+ result.append(&buf1[pos1], (temp_pos - pos1) - !ok);
+
+ if (!ok || !end1)
+ can_stop = true;
+
+ // reading zero byte from stdout don't mean than we exhausted
+ // all stdout output, we must continue to try until reading
+ // stdout and stderr return zero byte.
+ if (ok && temp != end2)
+ can_stop = false;
+
+ pos1 = temp_pos;
+ } while (!can_stop);
+
+ // Is this correct ?
+ return end1 != 0 || result.length() != 0;
+}
+
+
+bool child_reader::get_data(ostream & out, ostream & err)
+{
+ bool ret = true;
+ while (ret) {
+ ret = block_read();
+
+ out.write(buf1, end1);
+ err.write(buf2, end2);
+
+ end1 = end2 = 0;
+ }
+
+ return first_error == 0;
+}
+
+
+int child_reader::terminate_process()
+{
+ // can be called explicitely or by dtor,
+ // we must protect against multiple call
+ if (!is_terminated) {
+ int ret;
+ waitpid(pid, &ret, 0);
+
+ is_terminated = true;
+
+ if (WIFEXITED(ret)) {
+ first_error = WEXITSTATUS(ret) | WIFSIGNALED(ret);
+ } else if (WIFSIGNALED(ret)) {
+ terminate_on_exception = true;
+ first_error = WTERMSIG(ret);
+ } else {
+ // FIXME: this seems impossible, waitpid *must* wait
+ // and either the process terminate normally or through
+ // a signal.
+ first_error = -1;
+ }
+ }
+
+ if (fd1 != -1) {
+ close(fd1);
+ fd1 = -1;
+ }
+ if (fd2 != -1) {
+ close(fd2);
+ fd2 = -1;
+ }
+
+ return first_error;
+}
+
+
+string child_reader::error_str() const
+{
+ ostringstream err;
+ if (!forked) {
+ err << string("unable to fork, error: ")
+ << strerror(first_error);
+ } else if (is_terminated) {
+ if (first_error) {
+ if (terminate_on_exception) {
+ err << process_name << " terminated by signal "
+ << first_error;
+ } else {
+ err << process_name << " return "
+ << first_error;
+ }
+ }
+ }
+
+ return err.str();
+}
diff --git a/libutil++/child_reader.h b/libutil++/child_reader.h
new file mode 100644
index 0000000..f3bf71a
--- /dev/null
+++ b/libutil++/child_reader.h
@@ -0,0 +1,111 @@
+/**
+ * @file child_reader.h
+ * Facility for reading from child processes
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#ifndef CHILD_READER_H
+#define CHILD_READER_H
+
+#include <sys/types.h>
+
+#include <vector>
+#include <string>
+
+/**
+ * a class to read stdout / stderr from a child process.
+ *
+ * two interfaces are provided. read line by line: getline() or read all data
+ * in one : get_data(). In all case get_data() must be called once to flush the
+ * stderr child output
+ */
+/*
+ * FIXME: code review is needed:
+ * - check the getline()/get_data()/block_read() interface.
+ * the expected behavior is:
+ * caller can call getline until nothing is available from the stdout of the
+ * child. in this case child stderr is acumulated in buf2 and can be read
+ * through get_data(). get_data() is blocking until the child close stderr /
+ * stdout (even if the child die by a signal ?). The following corner case must
+ * work but I'm unsure if the code reflect this behavior: the last line of the
+ * child stdout have not necessarilly a LF terminator. the child can output any
+ * size of data in stderr.
+ */
+class child_reader {
+public:
+ /** fork a process. use error() to get error code. Do not try to
+ * use other public member interface if error() return non-zero */
+ child_reader(std::string const & cmd,
+ std::vector<std::string> const & args);
+
+ /** wait for the termination of the child process if this have not
+ * already occur. In this case return code of the child process is not
+ * available. */
+ ~child_reader();
+
+ /** fill result from on line of stdout of the child process.
+ * must be used as:
+ * child_reader reader(...);
+ * while (reader.getline(line)) .... */
+ bool getline(std::string & result);
+
+ /** fill out / err with the stdout / stderr of the child process.
+ * You can call this after calling one or more time getline(...). This
+ * call is blocking until the child die and so on all subsequent
+ * call will fail */
+ bool get_data(std::ostream & out, std::ostream & err);
+
+ /** rather to rely on dtor to wait for the termination of the child you
+ * can use terminate_process() to get the return code of the child
+ * process */
+ int terminate_process();
+
+ /** return the status of the first error encoutered
+ * != 0 : something feel wrong, use error_str() to get an error
+ * message */
+ int error() const { return first_error; }
+
+ /**
+ * return an error message if appropriate, if the process has
+ * been successfully exec'ed and is not terminate the error message
+ * is always empty. Error message is also empty if the child process
+ * terminate successfully. Else three type of error message exist:
+ * - "unable to fork" followed by sterror(errno)
+ * - "process_name return xxx" xxx is return code
+ * - "process_name terminated by signal xxx" xxx is signal number
+ */
+ std::string error_str() const;
+
+private:
+ // ctor helper: create the child process.
+ void exec_command(std::string const & cmd,
+ std::vector<std::string> const & args);
+ // return false when eof condition is reached on fd1. fd2 can have
+ // already input in the pipe buffer or in buf2.
+ bool block_read();
+
+ int fd1;
+ int fd2;
+ ssize_t pos1;
+ ssize_t end1;
+ ssize_t pos2;
+ ssize_t end2;
+ pid_t pid;
+ int first_error;
+ // child stderr is handled especially, we need to retain data even
+ // if caller read only stdout of the child.
+ char * buf2;
+ ssize_t sz_buf2;
+ char * buf1;
+ std::string process_name;
+ bool is_terminated;
+ bool terminate_on_exception;
+ bool forked;
+};
+
+#endif // CHILD_READER_H
diff --git a/libutil++/comma_list.h b/libutil++/comma_list.h
new file mode 100644
index 0000000..1868ee0
--- /dev/null
+++ b/libutil++/comma_list.h
@@ -0,0 +1,102 @@
+/**
+ * @file comma_list.h
+ * Container holding items from a list of comma separated items
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ */
+
+#ifndef COMMA_LIST_H
+#define COMMA_LIST_H
+
+#include <string>
+#include <vector>
+
+#include "string_manip.h"
+
+/**
+ * hold a list of item of type T, tracking also if item has been set.
+ */
+template <class T>
+class comma_list
+{
+public:
+ comma_list();
+
+ /**
+ * @param str list of comma separated item
+ *
+ * setup items array according to str parameters. Implement PP:3.17
+ * w/o restriction on charset and with the special string all which
+ * match anything.
+ */
+ void set(std::string const & str);
+
+ /// return true if a specific value is held by this container
+ bool is_set() const {
+ return !is_all;
+ }
+
+ /**
+ * @param value the value to test
+ *
+ * return true if value match one the stored value in items
+ */
+ bool match(T const & value) const;
+
+private:
+ typedef T value_type;
+ typedef std::vector<value_type> container_type;
+ typedef typename container_type::const_iterator const_iterator;
+ bool is_all;
+ container_type items;
+};
+
+
+template <class T>
+comma_list<T>::comma_list()
+ : is_all(true)
+{
+}
+
+
+template <class T>
+void comma_list<T>::set(std::string const & str)
+{
+ items.clear();
+
+ is_all = false;
+
+ std::vector<std::string> result = separate_token(str, ',');
+ for (size_t i = 0 ; i < result.size() ; ++i) {
+ if (result[i] == "all") {
+ is_all = true;
+ items.clear();
+ break;
+ }
+ items.push_back(op_lexical_cast<T>(result[i]));
+ }
+}
+
+
+template <class T>
+bool comma_list<T>::match(T const & value) const
+{
+ if (is_all)
+ return true;
+
+ const_iterator cit = items.begin();
+ const_iterator const end = items.end();
+
+ for (; cit != end; ++cit) {
+ if (value == *cit)
+ return true;
+ }
+
+ return false;
+}
+
+
+#endif /* !COMMA_LIST_H */
diff --git a/libutil++/cverb.cpp b/libutil++/cverb.cpp
new file mode 100644
index 0000000..150aa55
--- /dev/null
+++ b/libutil++/cverb.cpp
@@ -0,0 +1,123 @@
+/**
+ * @file cverb.cpp
+ * verbose output stream
+ *
+ * @remark Copyright 2002, 2004 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#include <cstring>
+
+#include <fstream>
+#include <iostream>
+#include <map>
+#include <string>
+#include <cstring>
+
+#include "cverb.h"
+
+using namespace std;
+
+cverb_object cverb;
+verbose vlevel1("level1");
+verbose vdebug("debug");
+verbose vstats("stats");
+verbose vsfile("sfile");
+verbose vxml("xml");
+
+namespace {
+
+// The right way is to use: ofstream fout; but cverb(fout.rdbuf()) receive
+// a null pointer and stl shipped with 2.91 segfault.
+ofstream fout("/dev/null");
+ostream null_stream(fout.rdbuf());
+
+// Used to setup the bad bit in our null stream so output will fail earlier
+// and overhead will be smaller.
+struct setup_stream {
+ setup_stream();
+};
+
+setup_stream::setup_stream()
+{
+ null_stream.clear(ios::badbit);
+}
+
+setup_stream setup;
+
+// We use a multimap because user can create multiple verbose object with
+// the same name, these are synonymous, setting up one to true will setup
+// all with the same name to true.
+typedef multimap<string, verbose *> recorder_t;
+// The recorder is lazilly created by verbose object ctor
+static recorder_t * object_map;
+
+} // anonymous namespace
+
+
+verbose::verbose(char const * name)
+ :
+ set(false)
+{
+ // all params is treated a part, there is no need to create a
+ // verbose all("all"); it's meaningless. "all" verbose named object is
+ // reserved.
+ if (strcmp(name, "all") == 0)
+ return;
+ if (!object_map)
+ object_map = new recorder_t;
+ object_map->insert(recorder_t::value_type(name, this));
+}
+
+
+verbose verbose::operator|(verbose const & rhs)
+{
+ verbose result(*this);
+ result.set = result.set || rhs.set;
+ return result;
+}
+
+
+verbose verbose::operator&(verbose const & rhs)
+{
+ verbose result(*this);
+ result.set = result.set && rhs.set;
+ return result;
+}
+
+
+bool verbose::setup(string const & name)
+{
+ if (name == "all") {
+ null_stream.rdbuf(cout.rdbuf());
+ null_stream.clear();
+ return true;
+ }
+ if (!object_map)
+ object_map = new recorder_t;
+ pair<recorder_t::iterator, recorder_t::iterator> p_it =
+ object_map->equal_range(name);
+ if (p_it.first == p_it.second)
+ return false;
+ for (; p_it.first != p_it.second; ++p_it.first)
+ p_it.first->second->set = true;
+ return true;
+}
+
+
+bool verbose::setup(vector<string> const & names)
+{
+ for (size_t i = 0; i < names.size(); ++i)
+ if (!setup(names[i]))
+ return false;
+ return true;
+}
+
+
+ostream& operator<<(cverb_object &, verbose const & v)
+{
+ return v.set ? cout : null_stream;
+}
diff --git a/libutil++/cverb.h b/libutil++/cverb.h
new file mode 100644
index 0000000..905c528
--- /dev/null
+++ b/libutil++/cverb.h
@@ -0,0 +1,83 @@
+/**
+ * @file cverb.h
+ * verbose output stream
+ *
+ * @remark Copyright 2002, 2004 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#ifndef CVERB_H
+#define CVERB_H
+
+#include <iosfwd>
+#include <string>
+#include <vector>
+
+struct cverb_object { };
+
+/**
+ * verbose object, all output through this stream are made only
+ * if a verbose object with a true state is injected in the stream.
+ */
+extern cverb_object cverb;
+
+/**
+ * typical use:
+ * declare some verbose global object:
+ * verbose debug("debug");
+ * verbose stats("stats");
+ * verbose level2("level2");
+ *
+ * setup from command line the state of these objects
+ *
+ * verbose::setup(command_line_args_to'--verbose=');
+ *
+ * cverb << stats << "stats\n";
+ * cverb << (stats&level2) << "very verbose stats\n"
+ * cverb << (stats|debug) << "bar\n";
+ * these will give a compile time error
+ * cverb << stats << "foo" << debug << "bar";
+ * cout << stats << "foo";
+ *
+ * In critical code path cverb can be used in the more efficient way:
+ * if (cverb << vdebug)
+ * cverb << vdebug << "foo" << "bar";
+ * the condition test the fails bit for the returned stream while the later
+ * build a sentry object for each << (more efficient even with one level of <<)
+ */
+class verbose {
+ /// The returned stream is either a null stream or cout.
+ friend std::ostream & operator<<(cverb_object &, verbose const &);
+public:
+ /**
+ * create a verbose object named name, the ctor auto-register name
+ * as a verbose object, the set state can be intialized through
+ * verbose::setup(name)
+ */
+ verbose(char const * name);
+
+ verbose operator|(verbose const &);
+ verbose operator&(verbose const &);
+
+ /// Return false if this named verbose object has not be registred.
+ static bool setup(std::string const &);
+ /// convenient interface calling the above for string in args
+ static bool setup(std::vector<std::string> const & args);
+private:
+ bool set;
+};
+
+/**
+ * predefined general purpose verbose object, comment give their names
+ */
+extern verbose vlevel1; /**< named "level1" */
+extern verbose vdebug; /**< named "debug" */
+extern verbose vstats; /**< named "stats" */
+// all sample filename manipulation.
+extern verbose vsfile; /**< named "sfile" */
+extern verbose vxml; /**< named "xml" */
+
+#endif /* !CVERB_H */
diff --git a/libutil++/file_manip.cpp b/libutil++/file_manip.cpp
new file mode 100644
index 0000000..7ec7473
--- /dev/null
+++ b/libutil++/file_manip.cpp
@@ -0,0 +1,181 @@
+/**
+ * @file file_manip.cpp
+ * Useful file management helpers
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#include <unistd.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <utime.h>
+#include <limits.h>
+#include <stdlib.h>
+
+#include <cstdio>
+#include <cerrno>
+#include <iostream>
+#include <fstream>
+#include <vector>
+
+#include "op_file.h"
+
+#include "file_manip.h"
+#include "string_manip.h"
+
+using namespace std;
+
+
+bool copy_file(string const & source, string const & destination)
+{
+ int retval;
+ struct stat buf;
+ if (stat(source.c_str(), &buf))
+ return false;
+
+ if (!op_file_readable(source))
+ return false;
+
+ ifstream in(source.c_str());
+ if (!in)
+ return false;
+
+ mode_t mode = buf.st_mode & ~S_IFMT;
+ if (!(mode & S_IWUSR))
+ mode |= S_IWUSR;
+
+ int fd = open(destination.c_str(), O_RDWR|O_CREAT, mode);
+ if (fd < 0)
+ return false;
+ close(fd);
+
+
+ // ignore error here: a simple user can copy a root.root 744 file
+ // but can't chown the copied file to root.
+ retval = chown(destination.c_str(), buf.st_uid, buf.st_gid);
+
+ // a scope to ensure out is closed before changing is mtime/atime
+ {
+ ofstream out(destination.c_str(), ios::trunc);
+ if (!out)
+ return false;
+ out << in.rdbuf();
+ }
+
+ struct utimbuf utim;
+ utim.actime = buf.st_atime;
+ utim.modtime = buf.st_mtime;
+ if (utime(destination.c_str(), &utim))
+ return false;
+
+ return true;
+}
+
+
+bool is_directory(string const & dirname)
+{
+ struct stat st;
+ return !stat(dirname.c_str(), &st) && S_ISDIR(st.st_mode);
+}
+
+
+bool is_files_identical(string const & file1, string const & file2)
+{
+ struct stat st1;
+ struct stat st2;
+
+ if (stat(file1.c_str(), &st1) == 0 && stat(file2.c_str(), &st2) == 0) {
+ if (st1.st_dev == st2.st_dev && st1.st_ino == st2.st_ino)
+ return true;
+ }
+
+ return false;
+}
+
+
+string const op_realpath(string const & name)
+{
+ static char tmp[PATH_MAX];
+ if (!realpath(name.c_str(), tmp))
+ return name;
+ return string(tmp);
+}
+
+
+bool op_file_readable(string const & file)
+{
+ return op_file_readable(file.c_str());
+}
+
+static void get_pathname(const char * pathname, void * name_list)
+{
+ list<string> * file_list = (list<string> *)name_list;
+ file_list->push_back(pathname);
+}
+
+bool create_file_list(list<string> & file_list, string const & base_dir,
+ string const & filter, bool recursive)
+{
+ return !get_matching_pathnames(&file_list, get_pathname,
+ base_dir.c_str(), filter.c_str(),
+ recursive ? MATCH_ANY_ENTRY_RECURSION :
+ NO_RECURSION) ? true : false;
+
+}
+
+
+/**
+ * @param path_name the path where we remove trailing '/'
+ *
+ * erase all trailing '/' in path_name except if the last '/' is at pos 0
+ */
+static string erase_trailing_path_separator(string const & path_name)
+{
+ string result(path_name);
+
+ while (result.length() > 1) {
+ if (result[result.length() - 1] != '/')
+ break;
+ result.erase(result.length() - 1, 1);
+ }
+
+ return result;
+}
+
+string op_dirname(string const & file_name)
+{
+ string result = erase_trailing_path_separator(file_name);
+ if (result.find_first_of('/') == string::npos)
+ return ".";
+
+ // catch result == "/"
+ if (result.length() == 1)
+ return result;
+
+ size_t pos = result.find_last_of('/');
+
+ // "/usr" must return "/"
+ if (pos == 0)
+ pos = 1;
+
+ result.erase(pos, result.length() - pos);
+
+ // "////usr" must return "/"
+ return erase_trailing_path_separator(result);
+}
+
+
+string op_basename(string const & path_name)
+{
+ string result = erase_trailing_path_separator(path_name);
+
+ // catch result == "/"
+ if (result.length() == 1)
+ return result;
+
+ return erase_to_last_of(result, '/');
+}
diff --git a/libutil++/file_manip.h b/libutil++/file_manip.h
new file mode 100644
index 0000000..57f7cd7
--- /dev/null
+++ b/libutil++/file_manip.h
@@ -0,0 +1,89 @@
+/**
+ * @file file_manip.h
+ * Useful file management helpers
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#ifndef FILE_MANIP_H
+#define FILE_MANIP_H
+
+#include <string>
+#include <list>
+
+
+/**
+ * copy_file - copy a file.
+ * @param source filename to copy from
+ * @param destination filename to copy into
+ *
+ * the last modification time of the source file is preserved, file attribute
+ * and owner are preserved if possible. Return true if copying successful.
+ */
+bool copy_file(std::string const & source, std::string const & destination);
+
+/// return true if dir is an existing directory
+bool is_directory(std::string const & dirname);
+
+/**
+ * is_file_identical - check for identical files
+ * @param file1 first filename
+ * @param file2 second filename
+ *
+ * return true if the two filenames belong to the same file
+ */
+bool is_files_identical(std::string const & file1, std::string const & file2);
+
+/**
+ * op_realpath - resolve symlinks etc.
+ * Resolve a path as much as possible. Accounts for relative
+ * paths (from cwd), ".." and ".". For success, the target
+ * file must exist !
+ *
+ * Resolve a symbolic link as far as possible.
+ * Returns the original string on failure.
+ */
+std::string const op_realpath(std::string const & name);
+
+/// return true if the given file is readable
+bool op_file_readable(std::string const & file);
+
+/**
+ * @param file_list where to store result
+ * @param base_dir directory from where lookup start
+ * @param filter a filename filter
+ * @param recursive if true lookup in sub-directory
+ *
+ * create a filelist under base_dir, filtered by filter and optionally
+ * looking in sub-directory. If we look in sub-directory only sub-directory
+ * which match filter are traversed.
+ */
+bool create_file_list(std::list<std::string> & file_list,
+ std::string const & base_dir,
+ std::string const & filter = "*",
+ bool recursive = false);
+
+/**
+ * op_dirname - get the path component of a filename
+ * @param file_name filename
+ *
+ * Returns the path name of a filename with trailing '/' removed.
+ */
+std::string op_dirname(std::string const & file_name);
+
+/**
+ * op_basename - get the basename of a path
+ * @param path_name path
+ *
+ * Returns the basename of a path with trailing '/' removed.
+ *
+ * Always use this instead of the C basename() - header order
+ * can affect behaviour for basename("/")
+ */
+std::string op_basename(std::string const & path_name);
+
+#endif /* !FILE_MANIP_H */
diff --git a/libutil++/generic_spec.h b/libutil++/generic_spec.h
new file mode 100644
index 0000000..18bff51
--- /dev/null
+++ b/libutil++/generic_spec.h
@@ -0,0 +1,97 @@
+/**
+ * @file generic_spec.h
+ * Container holding an item or a special "match all" item
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#ifndef GENERIC_SPEC_H
+#define GENERIC_SPEC_H
+
+#include <stdexcept>
+#include <string>
+#include <sstream>
+
+#include "string_manip.h"
+
+
+/**
+ * used to hold something like { int cpu_nr, bool is_all };
+ * to store a sub part of a samples filename see PP:3.21.
+ */
+template <class T>
+class generic_spec
+{
+public:
+ /**
+ * build a default spec which match anything
+ */
+ generic_spec();
+
+ /// build a spec from a string, valid argument are "all"
+ /// or a string convertible to T through istringtream(str) >> data
+ /// conversion is strict, no space are allowed at begin or end of str
+ void set(std::string const &);
+
+ /// return true if a specific value is held by this container
+ bool is_set() const {
+ return !is_all;
+ }
+
+ /// return the specific value (only if is_set() == true)
+ T const value() const {
+ if (!is_all)
+ return data;
+ throw std::out_of_range("generic_spec holds no value");
+ }
+
+ /// return true if rhs match this spec. Sub part of PP:3.24
+ bool match(T const & rhs) const {
+ return rhs == data;
+ }
+
+ /// return true if rhs match this spec. Sub part of PP:3.24
+ bool match(generic_spec<T> const & rhs) const {
+ return is_all || rhs.is_all || rhs.data == data;
+ }
+
+private:
+ T data;
+ bool is_all;
+};
+
+
+template <class T>
+generic_spec<T>::generic_spec()
+ :
+ data(T()),
+ is_all(true)
+{
+}
+
+
+template <class T>
+void generic_spec<T>::set(std::string const & str)
+{
+ if (str == "all") {
+ is_all = true;
+ return;
+ }
+
+ is_all = false;
+ data = op_lexical_cast<T>(str);
+}
+
+
+/// We don't use generic_spec<string>, since it's probably an error to try
+/// to use generic_spec<string> we specialize but don't define it to get a
+/// link error (using generic_spec<string> is problematic because g.set("all")
+/// is ambiguous)
+template <>
+void generic_spec<std::string>::set(std::string const & str);
+
+#endif /* !GENERIC_SPEC_H */
diff --git a/libutil++/glob_filter.cpp b/libutil++/glob_filter.cpp
new file mode 100644
index 0000000..e44549f
--- /dev/null
+++ b/libutil++/glob_filter.cpp
@@ -0,0 +1,39 @@
+/**
+ * @file glob_filter.cpp
+ * Filter strings based on globbed exclude/include list
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#include <fnmatch.h>
+
+#include <algorithm>
+
+#include "glob_filter.h"
+#include "string_manip.h"
+
+using namespace std;
+
+bool glob_filter::fnmatcher::operator()(string const & s)
+{
+ return fnmatch(s.c_str(), str_.c_str(), 0) != FNM_NOMATCH;
+}
+
+
+bool glob_filter::match(string const & str) const
+{
+ vector<string>::const_iterator cit;
+ cit = find_if(exclude.begin(), exclude.end(), fnmatcher(str));
+ if (cit != exclude.end())
+ return false;
+
+ cit = find_if(include.begin(), include.end(), fnmatcher(str));
+ if (include.empty() || cit != include.end())
+ return true;
+
+ return false;
+}
diff --git a/libutil++/glob_filter.h b/libutil++/glob_filter.h
new file mode 100644
index 0000000..6887cbf
--- /dev/null
+++ b/libutil++/glob_filter.h
@@ -0,0 +1,57 @@
+/**
+ * @file glob_filter.h
+ * Filter strings based on globbed exclude/include list
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#ifndef GLOB_FILTER_H
+#define GLOB_FILTER_H
+
+#include "string_filter.h"
+
+/**
+ * glob_filter - filtering of a string based on globbed include/exclude list
+ *
+ * This class is an oracle on whether a particular string matches
+ * the given list of included and excluded strings.
+ *
+ * This class gives glob-based matches on each pattern, as with fnmatch(3)
+ */
+class glob_filter : public string_filter {
+public:
+ /**
+ * Initialise the filter with the include and exclude list,
+ * comma-separated.
+ */
+ glob_filter(std::string const & include_patterns,
+ std::string const & exclude_patterns)
+ : string_filter(include_patterns, exclude_patterns) {}
+
+ /**
+ * Initialise the filter with the include and exclude list.
+ */
+ glob_filter(std::vector<std::string> const & include_patterns,
+ std::vector<std::string> const & exclude_patterns)
+ : string_filter(include_patterns, exclude_patterns) {}
+
+ /// Returns true if the given string matches
+ virtual bool match(std::string const & str) const;
+
+protected:
+
+ /// function object for fnmatching
+ struct fnmatcher {
+ fnmatcher(std::string const & str) : str_(str) {}
+
+ bool operator()(std::string const & s);
+
+ std::string const & str_;
+ };
+};
+
+#endif /* GLOB_FILTER_H */
diff --git a/libutil++/growable_vector.h b/libutil++/growable_vector.h
new file mode 100644
index 0000000..350246a
--- /dev/null
+++ b/libutil++/growable_vector.h
@@ -0,0 +1,105 @@
+/**
+ * @file growable_vector.h
+ * Auto-expanding vector type
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#ifndef GROWABLE_VECTOR_H
+#define GROWABLE_VECTOR_H
+
+#include <vector>
+#include <algorithm>
+#include <functional>
+
+/**
+ * A simple growable vector template.
+ */
+template <typename T> class growable_vector {
+public:
+ typedef std::vector<T> container_type;
+ typedef typename container_type::size_type size_type;
+
+
+ /**
+ * Index into the vector for a value. An out of
+ * bounds index will return a default-constructed value.
+ */
+ T operator[](size_type index) const {
+ if (index >= container.size())
+ return T();
+ return container[index];
+ }
+
+
+ /**
+ * Index into the vector for a value. If the index is larger than
+ * the current max index, the array is expanded, default-filling
+ * any intermediary gaps.
+ */
+ T & operator[](size_type index) {
+ if (index >= container.size())
+ container.resize(index + 1);
+ return container[index];
+ }
+
+
+ /**
+ * vectorized += operator
+ */
+ growable_vector<T> & operator+=(growable_vector<T> const & rhs) {
+ if (rhs.container.size() > container.size())
+ container.resize(rhs.container.size());
+
+ size_type min_size = min(container.size(), rhs.container.size());
+ for (size_type i = 0 ; i < min_size; ++i)
+ container[i] += rhs.container[i];
+
+ return *this;
+ }
+
+
+ /**
+ * vectorized -= operator, overflow shouldn't occur during substraction
+ * (iow: for each components lhs[i] >= rhs[i]
+ */
+ growable_vector<T> & operator-=(growable_vector<T> const & rhs) {
+ if (rhs.container.size() > container.size())
+ container.resize(rhs.container.size());
+
+ size_type min_size = min(container.size(), rhs.container.size());
+ for (size_type i = 0 ; i < min_size; ++i)
+ container[i] -= rhs.container[i];
+
+ return *this;
+ }
+
+
+ /// return current size of vector
+ size_type size() const {
+ return container.size();
+ }
+
+
+ /// fill container with given value
+ void fill(size_type size, T const & value) {
+ container.resize(size, value);
+ }
+
+
+ /// return true if all elements have the default constructed value
+ bool zero() const {
+ return std::find_if(container.begin(), container.end(),
+ std::bind2nd(std::not_equal_to<T>(), T()))
+ == container.end();
+ }
+
+private:
+ container_type container;
+};
+
+#endif // GROWABLE_VECTOR_H
diff --git a/libutil++/op_bfd.cpp b/libutil++/op_bfd.cpp
new file mode 100644
index 0000000..2d966da
--- /dev/null
+++ b/libutil++/op_bfd.cpp
@@ -0,0 +1,472 @@
+/**
+ * @file op_bfd.cpp
+ * Encapsulation of bfd objects
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#include "op_file.h"
+#include "op_config.h"
+#include "config.h"
+
+#include <fcntl.h>
+#include <cstring>
+
+#include <sys/stat.h>
+
+#include <cstdlib>
+
+#include <algorithm>
+#include <iostream>
+#include <iomanip>
+#include <sstream>
+
+#include "op_bfd.h"
+#include "locate_images.h"
+#include "string_filter.h"
+#include "stream_util.h"
+#include "cverb.h"
+
+using namespace std;
+
+
+verbose vbfd("bfd");
+
+
+namespace {
+
+/// function object for filtering symbols to remove
+struct remove_filter {
+ remove_filter(string_filter const & filter)
+ : filter_(filter) {}
+
+ bool operator()(op_bfd_symbol const & symbol) {
+ return !filter_.match(symbol.name());
+ }
+
+ string_filter filter_;
+};
+
+
+} // namespace anon
+
+
+op_bfd_symbol::op_bfd_symbol(asymbol const * a)
+ : bfd_symbol(a), symb_value(a->value),
+ section_filepos(a->section->filepos),
+ section_vma(a->section->vma),
+ symb_size(0), symb_hidden(false), symb_weak(false),
+ symb_artificial(false)
+{
+ // Some sections have unnamed symbols in them. If
+ // we just ignore them then we end up sticking
+ // things like .plt hits inside of _init. So instead
+ // we name the symbol after the section.
+ if (a->name && a->name[0] != '\0') {
+ symb_name = a->name;
+ symb_weak = a->flags & BSF_WEAK;
+ symb_hidden = (a->flags & BSF_LOCAL)
+ && !(a->flags & BSF_GLOBAL);
+ } else {
+ symb_name = string("??") + a->section->name;
+ }
+}
+
+
+op_bfd_symbol::op_bfd_symbol(bfd_vma vma, size_t size, string const & name)
+ : bfd_symbol(0), symb_value(vma),
+ section_filepos(0), section_vma(0),
+ symb_size(size), symb_name(name),
+ symb_artificial(true)
+{
+}
+
+
+bool op_bfd_symbol::operator<(op_bfd_symbol const & rhs) const
+{
+ return filepos() < rhs.filepos();
+}
+
+unsigned long op_bfd_symbol::symbol_endpos(void) const
+{
+ return bfd_symbol->section->filepos + bfd_symbol->section->size;
+}
+
+
+op_bfd::op_bfd(string const & fname, string_filter const & symbol_filter,
+ extra_images const & extra_images, bool & ok)
+ :
+ filename(fname),
+ archive_path(extra_images.get_archive_path()),
+ extra_found_images(extra_images),
+ file_size(-1),
+ anon_obj(false)
+{
+ int fd;
+ struct stat st;
+ // after creating all symbol it's convenient for user code to access
+ // symbols through a vector. We use an intermediate list to avoid a
+ // O(N²) behavior when we will filter vector element below
+ symbols_found_t symbols;
+ asection const * sect;
+ string suf = ".jo";
+
+ image_error img_ok;
+ string const image_path =
+ extra_images.find_image_path(filename, img_ok, true);
+
+ cverb << vbfd << "op_bfd ctor for " << image_path << endl;
+
+ // if there's a problem already, don't try to open it
+ if (!ok || img_ok != image_ok) {
+ cverb << vbfd << "can't locate " << image_path << endl;
+ goto out_fail;
+ }
+
+ fd = open(image_path.c_str(), O_RDONLY);
+ if (fd == -1) {
+ cverb << vbfd << "open failed for " << image_path << endl;
+ ok = false;
+ goto out_fail;
+ }
+
+ if (fstat(fd, &st)) {
+ cverb << vbfd << "stat failed for " << image_path << endl;
+ ok = false;
+ goto out_fail;
+ }
+
+ file_size = st.st_size;
+
+ ibfd.abfd = fdopen_bfd(image_path, fd);
+
+ if (!ibfd.valid()) {
+ cverb << vbfd << "fdopen_bfd failed for " << image_path << endl;
+ ok = false;
+ goto out_fail;
+ }
+
+ string::size_type pos;
+ pos = filename.rfind(suf);
+ if (pos != string::npos && pos == filename.size() - suf.size())
+ anon_obj = true;
+
+
+ // find .text and use it
+ for (sect = ibfd.abfd->sections; sect; sect = sect->next) {
+ if (sect->flags & SEC_CODE) {
+ if (filepos_map[sect->name] != 0) {
+ cerr << "Found section \"" << sect->name
+ << "\" twice for " << get_filename()
+ << endl;
+ abort();
+ }
+
+ filepos_map[sect->name] = sect->filepos;
+
+ if (sect->vma == 0 && strcmp(sect->name, ".text"))
+ filtered_section.push_back(sect);
+ }
+ }
+
+ get_symbols(symbols);
+
+out:
+ add_symbols(symbols, symbol_filter);
+ return;
+out_fail:
+ ibfd.close();
+ dbfd.close();
+ // make the fake symbol fit within the fake file
+ file_size = -1;
+ goto out;
+}
+
+
+op_bfd::~op_bfd()
+{
+}
+
+
+unsigned long op_bfd::get_start_offset(bfd_vma vma) const
+{
+ if (!vma || !ibfd.valid()) {
+ filepos_map_t::const_iterator it = filepos_map.find(".text");
+ if (it != filepos_map.end())
+ return it->second;
+ return 0;
+ }
+
+ return 0;
+}
+
+
+void op_bfd::get_symbols(op_bfd::symbols_found_t & symbols)
+{
+ ibfd.get_symbols();
+
+ // On separate debug file systems, the main bfd has no symbols,
+ // so even for non -g reports, we want to process the dbfd.
+ // This hurts us pretty badly (the CRC), but we really don't
+ // have much choice at the moment.
+ has_debug_info();
+
+ dbfd.set_image_bfd_info(&ibfd);
+ dbfd.get_symbols();
+
+ size_t i;
+ for (i = 0; i < ibfd.nr_syms; ++i) {
+ if (!interesting_symbol(ibfd.syms[i]))
+ continue;
+ if (find(filtered_section.begin(), filtered_section.end(),
+ ibfd.syms[i]->section) != filtered_section.end())
+ continue;
+ symbols.push_back(op_bfd_symbol(ibfd.syms[i]));
+ }
+
+ for (i = 0; i < dbfd.nr_syms; ++i) {
+ if (!interesting_symbol(dbfd.syms[i]))
+ continue;
+
+ // need to use filepos of original file's section for
+ // debug file symbols. We probably need to be more
+ // careful for special symbols which have ->section from
+ // .rodata like *ABS*
+ u32 filepos = filepos_map[dbfd.syms[i]->section->name];
+ if (filepos != 0)
+ dbfd.syms[i]->section->filepos = filepos;
+ symbols.push_back(op_bfd_symbol(dbfd.syms[i]));
+ }
+
+ symbols.sort();
+
+ symbols_found_t::iterator it = symbols.begin();
+
+ // we need to ensure than for a given vma only one symbol exist else
+ // we read more than one time some samples. Fix #526098
+ while (it != symbols.end()) {
+ symbols_found_t::iterator temp = it;
+ ++temp;
+ if (temp != symbols.end() && (it->vma() == temp->vma()) &&
+ (it->filepos() == temp->filepos())) {
+ if (boring_symbol(*it, *temp)) {
+ it = symbols.erase(it);
+ } else {
+ symbols.erase(temp);
+ }
+ } else {
+ ++it;
+ }
+ }
+
+ // now we can calculate the symbol size, we can't first include/exclude
+ // symbols because the size of symbol is calculated from the difference
+ // between the vma of a symbol and the next one.
+ for (it = symbols.begin() ; it != symbols.end(); ++it) {
+ op_bfd_symbol const * next = 0;
+ symbols_found_t::iterator temp = it;
+ ++temp;
+ if (temp != symbols.end())
+ next = &*temp;
+ it->size(symbol_size(*it, next));
+ }
+}
+
+
+void op_bfd::add_symbols(op_bfd::symbols_found_t & symbols,
+ string_filter const & symbol_filter)
+{
+ // images with no symbols debug info available get a placeholder symbol
+ if (symbols.empty())
+ symbols.push_back(create_artificial_symbol());
+
+ cverb << vbfd << "number of symbols before filtering "
+ << dec << symbols.size() << hex << endl;
+
+ symbols_found_t::iterator it;
+ it = remove_if(symbols.begin(), symbols.end(),
+ remove_filter(symbol_filter));
+
+ copy(symbols.begin(), it, back_inserter(syms));
+
+ cverb << vbfd << "number of symbols now "
+ << dec << syms.size() << hex << endl;
+}
+
+
+bfd_vma op_bfd::offset_to_pc(bfd_vma offset) const
+{
+ asection const * sect = ibfd.abfd->sections;
+
+ for (; sect; sect = sect->next) {
+ if (offset >= bfd_vma(sect->filepos) &&
+ (!sect->next || offset < bfd_vma(sect->next->filepos))) {
+ return sect->vma + (offset - sect->filepos);
+ }
+ }
+
+ return 0;
+}
+
+bool op_bfd::
+symbol_has_contents(symbol_index_t sym_idx)
+{
+ op_bfd_symbol const & bfd_sym = syms[sym_idx];
+ string const name = bfd_sym.name();
+ if (name.size() == 0 || bfd_sym.artificial() || !ibfd.valid())
+ return false;
+ else
+ return true;
+}
+
+bool op_bfd::
+get_symbol_contents(symbol_index_t sym_index, unsigned char * contents) const
+{
+ op_bfd_symbol const & bfd_sym = syms[sym_index];
+ size_t size = bfd_sym.size();
+
+ if (!bfd_get_section_contents(ibfd.abfd, bfd_sym.symbol()->section,
+ contents,
+ static_cast<file_ptr>(bfd_sym.value()), size)) {
+ return false;
+ }
+ return true;
+}
+
+bool op_bfd::has_debug_info() const
+{
+ if (debug_info.cached())
+ return debug_info.get();
+
+ if (!ibfd.valid())
+ return debug_info.reset(false);
+
+ if (ibfd.has_debug_info())
+ return debug_info.reset(true);
+
+ // check to see if there is an .debug file
+
+ if (find_separate_debug_file(ibfd.abfd, filename, debug_filename, extra_found_images)) {
+ cverb << vbfd << "now loading: " << debug_filename << endl;
+ dbfd.abfd = open_bfd(debug_filename);
+ if (dbfd.has_debug_info())
+ return debug_info.reset(true);
+ }
+
+ // .debug is optional, so will not fail if there's a problem
+ cverb << vbfd << "failed to process separate debug file "
+ << debug_filename << endl;
+
+ return debug_info.reset(false);
+}
+
+
+bool op_bfd::get_linenr(symbol_index_t sym_idx, bfd_vma offset,
+ string & source_filename, unsigned int & linenr) const
+{
+ if (!has_debug_info())
+ return false;
+
+ bfd_info const & b = dbfd.valid() ? dbfd : ibfd;
+ op_bfd_symbol const & sym = syms[sym_idx];
+
+ linenr_info const info = find_nearest_line(b, sym, offset, anon_obj);
+
+ if (!info.found)
+ return false;
+
+ source_filename = info.filename;
+ linenr = info.line;
+ return true;
+}
+
+
+size_t op_bfd::symbol_size(op_bfd_symbol const & sym,
+ op_bfd_symbol const * next) const
+{
+ unsigned long long start = sym.filepos();
+ unsigned long long end;
+
+ if (next && (sym.section() != next->section()))
+ end = sym.symbol_endpos();
+ else
+ end = next ? next->filepos() : file_size;
+
+ return end - start;
+}
+
+
+void op_bfd::get_symbol_range(symbol_index_t sym_idx,
+ unsigned long long & start, unsigned long long & end) const
+{
+ op_bfd_symbol const & sym = syms[sym_idx];
+
+ bool const verbose = cverb << (vbfd & vlevel1);
+
+ if (anon_obj)
+ start = sym.vma();
+ else
+ start = sym.filepos();
+ end = start + sym.size();
+
+ if (!verbose)
+ return;
+
+ io_state state(cverb << (vbfd & vlevel1));
+
+ cverb << (vbfd & vlevel1) << "symbol " << sym.name()
+ << ", value " << hex << sym.value() << endl;
+ cverb << (vbfd & vlevel1)
+ << "start " << hex << start << ", end " << end << endl;
+
+ if (sym.symbol()) {
+ cverb << (vbfd & vlevel1) << "in section "
+ << sym.symbol()->section->name << ", filepos "
+ << hex << sym.symbol()->section->filepos << endl;
+ }
+}
+
+
+void op_bfd::get_vma_range(bfd_vma & start, bfd_vma & end) const
+{
+ if (!syms.empty()) {
+ // syms are sorted by vma so vma of the first symbol and vma +
+ // size of the last symbol give the vma range for gprof output
+ op_bfd_symbol const & last_symb = syms[syms.size() - 1];
+ start = syms[0].vma();
+ // end is excluded from range so + 1 *if* last_symb.size() != 0
+ end = last_symb.vma() + last_symb.size() + (last_symb.size() != 0);
+ } else {
+ start = 0;
+ end = file_size;
+ }
+}
+
+
+op_bfd_symbol const op_bfd::create_artificial_symbol()
+{
+
+ bfd_vma start, end;
+ get_vma_range(start, end);
+ return op_bfd_symbol(start, end - start, get_filename());
+}
+
+
+string op_bfd::get_filename() const
+{
+ return filename;
+}
+
+
+size_t op_bfd::bfd_arch_bits_per_address() const
+{
+ if (ibfd.valid())
+ return ::bfd_arch_bits_per_address(ibfd.abfd);
+ // FIXME: this function should be called only if the underlined ibfd
+ // is ok, must we throw ?
+ return sizeof(bfd_vma);
+}
diff --git a/libutil++/op_bfd.h b/libutil++/op_bfd.h
new file mode 100644
index 0000000..ff5022c
--- /dev/null
+++ b/libutil++/op_bfd.h
@@ -0,0 +1,305 @@
+/**
+ * @file op_bfd.h
+ * Encapsulation of bfd objects
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#ifndef OP_BFD_H
+#define OP_BFD_H
+
+#include "config.h"
+
+#include <vector>
+#include <string>
+#include <list>
+#include <map>
+#include <set>
+
+#include "bfd_support.h"
+#include "locate_images.h"
+#include "utility.h"
+#include "cached_value.h"
+#include "op_types.h"
+
+class op_bfd;
+class string_filter;
+class extra_images;
+
+/// all symbol vector indexing uses this type
+typedef size_t symbol_index_t;
+
+/**
+ * A symbol description from a bfd point of view. This duplicate
+ * information pointed by an asymbol, we need this duplication in case
+ * the symbol is an artificial symbol
+ */
+class op_bfd_symbol {
+public:
+
+ /// ctor for real symbols
+ op_bfd_symbol(asymbol const * a);
+
+ /// ctor for artificial symbols
+ op_bfd_symbol(bfd_vma vma, size_t size, std::string const & name);
+
+ bfd_vma vma() const { return symb_value + section_vma; }
+ unsigned long value() const { return symb_value; }
+ unsigned long filepos() const { return symb_value + section_filepos; }
+ unsigned long symbol_endpos(void) const;
+ asection const * section(void) const { return bfd_symbol->section; }
+ std::string const & name() const { return symb_name; }
+ asymbol const * symbol() const { return bfd_symbol; }
+ size_t size() const { return symb_size; }
+ void size(size_t s) { symb_size = s; }
+ bool hidden() const { return symb_hidden; }
+ bool weak() const { return symb_weak; }
+ bool artificial() const { return symb_artificial; }
+
+ /// compare two symbols by their filepos()
+ bool operator<(op_bfd_symbol const & lhs) const;
+
+private:
+ /// the original bfd symbol, this can be null if the symbol is an
+ /// artificial symbol
+ asymbol const * bfd_symbol;
+ /// the offset of this symbol relative to the begin of the section's
+ /// symbol
+ unsigned long symb_value;
+ /// the section filepos for this symbol
+ unsigned long section_filepos;
+ /// the section vma for this symbol
+ bfd_vma section_vma;
+ /// the size of this symbol
+ size_t symb_size;
+ /// the name of the symbol
+ std::string symb_name;
+ /// normally not externally visible symbol
+ bool symb_hidden;
+ /// whether other symbols can override it
+ bool symb_weak;
+ /// symbol is artificially created
+ bool symb_artificial;
+ /// code bytes corresponding to symbol -- used for XML generation
+ std::string symb_bytes;
+};
+
+/**
+ * Encapsulation of a bfd object. Simplifies open/close of bfd, enumerating
+ * symbols and retrieving informations for symbols or vma.
+ *
+ * Use of this class relies on a std::ostream cverb
+ */
+class op_bfd {
+public:
+ /**
+ * @param filename the name of the image file
+ * @param symbol_filter filter to apply to symbols
+ * @param extra_images container where all extra candidate filenames
+ * are stored
+ * @param ok in-out parameter: on in, if not set, don't
+ * open the bfd (because it's not there or whatever). On out,
+ * it's set to false if the bfd couldn't be loaded.
+ */
+ op_bfd(std::string const & filename,
+ string_filter const & symbol_filter,
+ extra_images const & extra_images,
+ bool & ok);
+
+ /**
+ * This constructor is used when processing an SPU profile
+ * where the SPU ELF is embedded within the PPE binary.
+ */
+ op_bfd(uint64_t spu_offset,
+ std::string const & filename,
+ string_filter const & symbol_filter,
+ extra_images const & extra_images,
+ bool & ok);
+
+ std::string get_embedding_filename() const { return embedding_filename; }
+
+ /// close an opened bfd image and free all related resources
+ ~op_bfd();
+
+ /**
+ * @param sym_idx index of the symbol
+ * @param offset fentry number
+ * @param filename output parameter to store filename
+ * @param linenr output parameter to store linenr.
+ *
+ * Retrieve the relevant finename:linenr information for the sym_idx
+ * at offset. If the lookup fails, return false. In some cases this
+ * function can retrieve the filename and return true but fail to
+ * retrieve the linenr and so can return zero in linenr
+ */
+ bool get_linenr(symbol_index_t sym_idx, bfd_vma offset,
+ std::string & filename, unsigned int & linenr) const;
+
+ /**
+ * @param sym_idx symbol index
+ * @param start reference to start var
+ * @param end reference to end var
+ *
+ * Calculates the range of sample file entries covered by sym. start
+ * and end will be filled in appropriately. If index is the last entry
+ * in symbol table, all entries up to the end of the sample file will
+ * be used. After calculating start and end they are sanitized
+ *
+ * All errors are fatal.
+ */
+ void get_symbol_range(symbol_index_t sym_idx,
+ unsigned long long & start, unsigned long long & end) const;
+
+ /**
+ * @param start reference to the start vma
+ * @param end reference to the end vma
+ *
+ * return in start, end the vma range for this binary object.
+ */
+ void get_vma_range(bfd_vma & start, bfd_vma & end) const;
+
+ /** return the relocated PC value for the given file offset */
+ bfd_vma offset_to_pc(bfd_vma offset) const;
+
+ /**
+ * If passed 0, return the file position of the .text section.
+ * Otherwise, return the filepos of a section with a matching
+ * vma.
+ */
+ unsigned long get_start_offset(bfd_vma vma = 0) const;
+
+ /**
+ * Return the image name of the underlying binary image. For an
+ * archive, this returns the path *within* the archive, not the
+ * full path of the file.
+ */
+ std::string get_filename() const;
+
+ /// sorted vector by vma of interesting symbol.
+ std::vector<op_bfd_symbol> syms;
+
+ /// return in bits the bfd_vma size for this binary. This is needed
+ /// because gprof output depend on the bfd_vma for *this* binary
+ /// and do not depend on sizeof(bfd_vma)
+ size_t bfd_arch_bits_per_address() const;
+
+ /// return true if binary contain some debug information
+ bool has_debug_info() const;
+
+ /**
+ * @param sym_idx symbol index
+ *
+ * Return true or false, indicating whether or not the
+ * symbol referenced by the passed sym_idx has code available.
+ * Some symbols have no code associated with them; for example,
+ * artificial symbols created for anonymous memory samples or for
+ * stripped binaries with no symbol debug info. Additionally,
+ * if the bfd object associated with the symbol is not valid,
+ * this function will also return false.
+ *
+ * NOTE: This call should be made prior to invoking
+ * get_symbol_contents to avoid unnecessarily allocating
+ * memory for the symbol contents.
+ */
+ bool symbol_has_contents(symbol_index_t sym_idx);
+
+ bool get_symbol_contents(symbol_index_t sym_index,
+ unsigned char * contents) const;
+
+ bool valid() const { return ibfd.valid(); }
+
+private:
+ /// temporary container type for getting symbols
+ typedef std::list<op_bfd_symbol> symbols_found_t;
+
+ /**
+ * Parse and sort in ascending order all symbols
+ * in the file pointed to by abfd that reside in
+ * a %SEC_CODE section.
+ *
+ * The symbols are filtered through
+ * the interesting_symbol() predicate and sorted
+ * with op_bfd_symbol::operator<() comparator.
+ */
+ void get_symbols(symbols_found_t & symbols);
+
+ /**
+ * Helper function for get_symbols.
+ * Populates bfd_syms and extracts the "interesting_symbol"s.
+ */
+ void get_symbols_from_file(bfd_info & bfd, size_t start,
+ op_bfd::symbols_found_t & symbols,
+ bool debug_file);
+
+ /**
+ * Add the symbols in the binary, applying filtering,
+ * and handling artificial symbols.
+ */
+ void add_symbols(symbols_found_t & symbols,
+ string_filter const & symbol_filter);
+
+ /**
+ * symbol_size - return the size of a symbol
+ * @param sym symbol to get size
+ * @param next next symbol in vma order if any
+ */
+ size_t symbol_size(op_bfd_symbol const & sym,
+ op_bfd_symbol const * next) const;
+
+ /// create an artificial symbol for a symbolless binary
+ op_bfd_symbol const create_artificial_symbol();
+
+ /* Generate symbols using bfd functions for
+ * the image file associated with the ibfd arg.
+ */
+ uint process_symtab(bfd_info * bfd, uint start);
+
+ /// filename we open (not including archive path)
+ std::string filename;
+
+ /// path to archive
+ std::string archive_path;
+
+ /// reference to extra_images
+ extra_images const & extra_found_images;
+
+ /// file size in bytes
+ off_t file_size;
+
+ /// corresponding debug file name
+ mutable std::string debug_filename;
+
+ /// true if at least one section has (flags & SEC_DEBUGGING) != 0
+ mutable cached_value<bool> debug_info;
+
+ /// our main bfd object: .bfd may be NULL
+ bfd_info ibfd;
+
+ // corresponding debug bfd object, if one is found
+ mutable bfd_info dbfd;
+
+ /// sections we will avoid to use symbol from, this is needed
+ /// because elf file allows sections with identical vma and we can't
+ /// allow overlapping symbols. Such elf layout is used actually by
+ /// kernel modules where all code section vma are set to 0.
+ std::vector<asection const *> filtered_section;
+
+ typedef std::map<std::string, u32> filepos_map_t;
+ // mapping of section names to filepos in the original binary
+ filepos_map_t filepos_map;
+
+ /**
+ * If spu_offset is non-zero, embedding_filename is the file containing
+ * the embedded SPU image.
+ */
+ std::string embedding_filename;
+
+ bool anon_obj;
+};
+
+
+#endif /* !OP_BFD_H */
diff --git a/libutil++/op_exception.cpp b/libutil++/op_exception.cpp
new file mode 100644
index 0000000..235b9bc
--- /dev/null
+++ b/libutil++/op_exception.cpp
@@ -0,0 +1,55 @@
+/**
+ * @file op_exception.cpp
+ * exception base class
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#include <cstring>
+
+#include "op_exception.h"
+
+using namespace std;
+
+op_exception::op_exception(string const & msg)
+ :
+ message(msg)
+{
+}
+
+op_exception::~op_exception() throw()
+{
+}
+
+char const * op_exception::what() const throw()
+{
+ return message.c_str();
+}
+
+
+op_fatal_error::op_fatal_error(string const & msg)
+ :
+ op_exception(msg)
+{
+}
+
+
+op_runtime_error::op_runtime_error(string const & msg)
+ :
+ runtime_error(msg)
+{
+}
+
+op_runtime_error::op_runtime_error(string const & msg, int cerrno)
+ :
+ runtime_error(msg + "\ncause: " + strerror(cerrno))
+{
+}
+
+op_runtime_error::~op_runtime_error() throw()
+{
+}
diff --git a/libutil++/op_exception.h b/libutil++/op_exception.h
new file mode 100644
index 0000000..af344ed
--- /dev/null
+++ b/libutil++/op_exception.h
@@ -0,0 +1,60 @@
+/**
+ * @file op_exception.h
+ * exception base class
+ *
+ * This provide simple base class for exception object. All
+ * exception are derived from directly or indirectly from
+ * std::exception. This class are not itended to be catched
+ * in your code except at top level, derive what you want
+ * and catch derived class rather.
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#ifndef OP_EXCEPTION_H
+#define OP_EXCEPTION_H
+
+#include <stdexcept>
+#include <string>
+
+
+/**
+ * exception abstract base class
+ */
+class op_exception : public std::exception {
+public:
+ explicit op_exception(std::string const& msg);
+ ~op_exception() throw() = 0;
+
+ char const * what() const throw();
+private:
+ std::string message;
+};
+
+
+/**
+ * fatal exception, never catch it except at top level (likely main or
+ * gui). Intended to replace cerr << "blah"; exit(EXIT_FAILURE); by a
+ * throw op_fatal_error("blah") when returning error code is not an option
+ */
+struct op_fatal_error : op_exception
+{
+ explicit op_fatal_error(std::string const & msg);
+};
+
+/**
+ * Encapsulate a runtime error with or w/o a valid errno
+ */
+struct op_runtime_error : std::runtime_error
+{
+ explicit op_runtime_error(std::string const & err);
+ op_runtime_error(std::string const & err, int cerrno);
+ ~op_runtime_error() throw();
+};
+
+
+#endif /* !OP_EXCEPTION_H */
diff --git a/libutil++/op_spu_bfd.cpp b/libutil++/op_spu_bfd.cpp
new file mode 100644
index 0000000..42949e7
--- /dev/null
+++ b/libutil++/op_spu_bfd.cpp
@@ -0,0 +1,185 @@
+/**
+ * @file libutil++/op_spu_bfd.cpp
+ * Encapsulation of bfd objects for Cell BE SPU
+ *
+ * @remark Copyright 2007 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Maynard Johnson
+ * (C) Copyright IBM Corporation 2007
+ */
+
+
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <cstdlib>
+#include <cstring>
+
+#include <iostream>
+#include <cstring>
+#include <cstdlib>
+
+#include "op_bfd.h"
+#include "locate_images.h"
+#include "op_libiberty.h"
+#include "string_filter.h"
+#include "cverb.h"
+
+#define OP_SPU_DYN_FLAG 0x10000000 /* kernel module adds this offset */
+ /* to SPU code it can't find in the map */
+#define OP_SPU_MEMSIZE 0x3ffff /* Physical memory size on an SPU */
+
+using namespace std;
+
+extern verbose vbfd;
+
+/*
+ * This overload of the op_bfd constructor is patterned after the
+ * constructor in libutil++/op_bfd.cpp, with the additional processing
+ * needed to handle an embedded spu offset.
+ */
+op_bfd::op_bfd(uint64_t spu_offset, string const & fname,
+ string_filter const & symbol_filter,
+ extra_images const & extra_images, bool & ok)
+ :
+ archive_path(extra_images.get_archive_path()),
+ extra_found_images(extra_images),
+ file_size(-1),
+ embedding_filename(fname),
+ anon_obj(false)
+{
+ int fd;
+ struct stat st;
+ int notes_remaining;
+ bool spu_note_found = false;
+ size_t sec_size = 0;
+ unsigned int oct_per_byte;
+ asection * note = NULL;
+
+ symbols_found_t symbols;
+ asection const * sect;
+
+ image_error image_ok;
+ string const image_path =
+ extra_images.find_image_path(fname, image_ok, true);
+
+ cverb << vbfd << "op_bfd ctor for " << image_path << endl;
+ if (!ok)
+ goto out_fail;
+
+ fd = open(image_path.c_str(), O_RDONLY);
+ if (fd == -1) {
+ cverb << vbfd << "open failed for " << image_path << endl;
+ ok = false;
+ goto out_fail;
+ }
+
+ if (fstat(fd, &st)) {
+ cverb << vbfd << "stat failed for " << image_path << endl;
+ ok = false;
+ goto out_fail;
+ }
+
+ file_size = st.st_size;
+ ibfd.abfd = spu_open_bfd(image_path, fd, spu_offset);
+
+ if (!ibfd.valid()) {
+ cverb << vbfd << "fdopen_bfd failed for " << image_path << endl;
+ ok = false;
+ goto out_fail;
+ }
+
+ /* For embedded SPU ELF, a note section named '.note.spu_name'
+ * contains the name of the SPU binary image in the description
+ * field.
+ */
+ note = bfd_get_section_by_name(ibfd.abfd, ".note.spu_name");
+ if (!note) {
+ cverb << vbfd << "No .note.spu-name section found" << endl;
+ goto find_sec_code;
+ }
+ cverb << vbfd << "found .note.spu_name section" << endl;
+
+ bfd_byte * sec_contents;
+ oct_per_byte = bfd_octets_per_byte(ibfd.abfd);
+ sec_size = bfd_section_size(ibfd.abfd, note)/oct_per_byte;
+
+ sec_contents = (bfd_byte *) xmalloc(sec_size);
+ if (!bfd_get_section_contents(ibfd.abfd, note, sec_contents,
+ 0, sec_size)) {
+ cverb << vbfd << "bfd_get_section_contents with size "
+ << sec_size << " returned an error" << endl;
+ ok = false;
+ goto out_fail;
+ }
+ notes_remaining = sec_size;
+ while (notes_remaining && !spu_note_found) {
+ unsigned int nsize, dsize, type;
+ nsize = *((unsigned int *) sec_contents);
+ dsize = *((unsigned int *) sec_contents +1);
+ type = *((unsigned int *) sec_contents +2);
+ int remainder, desc_start, name_pad_length, desc_pad_length;
+ name_pad_length = desc_pad_length = 0;
+ /* Calculate padding for 4-byte alignment */
+ remainder = nsize % 4;
+ if (remainder != 0)
+ name_pad_length = 4 - remainder;
+ desc_start = 12 + nsize + name_pad_length;
+ if (type != 1) {
+ int note_record_length;
+ if ((remainder = (dsize % 4)) != 0)
+ desc_pad_length = 4 - remainder;
+ note_record_length = 12 + nsize +
+ name_pad_length + dsize + desc_pad_length;
+ notes_remaining -= note_record_length;
+ sec_contents += note_record_length;
+ continue;
+ } else {
+ spu_note_found = true;
+ /* Must memcpy the data from sec_contents to a
+ * 'char *' first, then stringify it, since
+ * the type of sec_contents (bfd_byte *) cannot be
+ * used as input for creating a string.
+ */
+ char * description = (char *) xmalloc(dsize);
+ memcpy(description, sec_contents + desc_start, dsize);
+ filename = description;
+ free(description);
+ }
+ }
+ free(sec_contents);
+ /* Default to app name for the image name */
+ if (spu_note_found == false)
+ filename = fname;
+
+find_sec_code:
+ for (sect = ibfd.abfd->sections; sect; sect = sect->next) {
+ if (sect->flags & SEC_CODE) {
+ if (filepos_map[sect->name] != 0) {
+ cerr << "Found section \"" << sect->name
+ << "\" twice for " << get_filename()
+ << endl;
+ abort();
+ }
+
+ filepos_map[sect->name] = sect->filepos;
+ }
+ }
+
+ get_symbols(symbols);
+
+ /* In some cases the SPU library code generates code stubs on the stack. */
+ /* The kernel module remaps those addresses so add an entry to catch/report them. */
+ symbols.push_back(op_bfd_symbol(OP_SPU_DYN_FLAG, OP_SPU_MEMSIZE,
+ "__send_to_ppe(stack)"));
+
+out:
+ add_symbols(symbols, symbol_filter);
+ return;
+out_fail:
+ ibfd.close();
+ dbfd.close();
+ file_size = -1;
+ goto out;
+}
+
diff --git a/libutil++/path_filter.cpp b/libutil++/path_filter.cpp
new file mode 100644
index 0000000..94db94e
--- /dev/null
+++ b/libutil++/path_filter.cpp
@@ -0,0 +1,68 @@
+/**
+ * @file path_filter.cpp
+ * Filter paths based on globbed exclude/include list
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#include <fnmatch.h>
+
+#include <algorithm>
+
+#include "path_filter.h"
+#include "string_manip.h"
+#include "file_manip.h"
+
+using namespace std;
+
+bool path_filter::match(string const & str) const
+{
+ vector<string>::const_iterator cit;
+
+ // first, if any component of the dir is listed in exclude -> no
+ string comp = op_dirname(str);
+ while (!comp.empty() && comp != "/") {
+ cit = find_if(exclude.begin(), exclude.end(),
+ fnmatcher(op_basename(comp)));
+ if (cit != exclude.end())
+ return false;
+
+ // dirname("foo") == "foo"
+ if (comp == op_dirname(comp))
+ break;
+ comp = op_dirname(comp);
+ }
+
+ string const base = op_basename(str);
+
+ // now if the file name is specifically excluded -> no
+ cit = find_if(exclude.begin(), exclude.end(), fnmatcher(base));
+ if (cit != exclude.end())
+ return false;
+
+ // now if the file name is specifically included -> yes
+ cit = find_if(include.begin(), include.end(), fnmatcher(base));
+ if (cit != include.end())
+ return true;
+
+ // now if any component of the path is included -> yes
+ // note that the include pattern defaults to '*'
+ string compi = op_dirname(str);
+ while (!compi.empty() && compi != "/") {
+ cit = find_if(include.begin(), include.end(),
+ fnmatcher(op_basename(compi)));
+ if (cit != include.end())
+ return true;
+
+ // dirname("foo") == "foo"
+ if (compi == op_dirname(compi))
+ break;
+ compi = op_dirname(compi);
+ }
+
+ return include.empty();
+}
diff --git a/libutil++/path_filter.h b/libutil++/path_filter.h
new file mode 100644
index 0000000..21203fb
--- /dev/null
+++ b/libutil++/path_filter.h
@@ -0,0 +1,48 @@
+/**
+ * @file path_filter.h
+ * Filter paths based on globbed exclude/include list
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#ifndef PATH_FILTER_H
+#define PATH_FILTER_H
+
+#include "glob_filter.h"
+
+/**
+ * path_filter - filtering of a string based on globbed include/exclude list
+ *
+ * This class is an oracle on whether a particular string matches
+ * the given list of included and excluded strings.
+ *
+ * This class gives glob-based matches on each pattern, as with fnmatch(3),
+ * where each component of the candidate path is considered separately.
+ */
+class path_filter : public glob_filter {
+public:
+ /**
+ * Initialise the filter with the include and exclude list,
+ * comma-separated.
+ */
+ path_filter(std::string const & include_patterns = std::string(),
+ std::string const & exclude_patterns = std::string())
+ : glob_filter(include_patterns, exclude_patterns) {}
+
+ /**
+ * Initialise the filter with the include and exclude list.
+ */
+ path_filter(std::vector<std::string> const & include_patterns,
+ std::vector<std::string> const & exclude_patterns)
+ : glob_filter(include_patterns, exclude_patterns) {}
+
+
+ /// Returns true if the given string matches
+ virtual bool match(std::string const & str) const;
+};
+
+#endif /* PATH_FILTER_H */
diff --git a/libutil++/sparse_array.h b/libutil++/sparse_array.h
new file mode 100644
index 0000000..c81fd31
--- /dev/null
+++ b/libutil++/sparse_array.h
@@ -0,0 +1,100 @@
+/**
+ * @file sparse_array.h
+ * Auto-expanding sparse array type
+ *
+ * @remark Copyright 2007 OProfile authors
+ * @remark Copyright (c) International Business Machines, 2007.
+ * @remark Read the file COPYING
+ *
+ * @author Dave Nomura <dcnltc@us.ibm.com>
+ */
+
+#ifndef SPARSE_ARRAY_H
+#define SPARSE_ARRAY_H
+
+template <typename I, typename T> class sparse_array {
+public:
+ typedef std::map<I, T> container_type;
+ typedef typename container_type::size_type size_type;
+
+ /**
+ * Index into the map for a value.
+ * NOTE: since std::map does/can not have a const member function for
+ * operator[], this const member function simply returns 0 for
+ * profile classes that aren't represented in the map.
+ * This member function will only be invoked for queries of the
+ * sparse array.
+ */
+ T operator[](size_type index) const {
+ typename container_type::const_iterator it = container.find(index);
+ if (it != container.end())
+ return it->second;
+ else
+ return 0;
+ }
+
+
+ /**
+ * Index into the vector for a value. If the index is larger than
+ * the current max index, a new array entry is created.
+ */
+ T & operator[](size_type index) {
+ return container[index];
+ }
+
+
+ /**
+ * vectorized += operator
+ */
+ sparse_array & operator+=(sparse_array const & rhs) {
+ typename container_type::const_iterator it = rhs.container.begin();
+ typename container_type::const_iterator it_end = rhs.container.end();
+ for ( ; it != it_end; it++)
+ container[it->first] += it->second;
+
+ return *this;
+ }
+
+
+ /**
+ * vectorized -= operator, overflow shouldn't occur during substraction
+ * (iow: for each components lhs[i] >= rhs[i]
+ */
+ sparse_array & operator-=(sparse_array const & rhs) {
+ typename container_type::const_iterator it = rhs.container.begin();
+ typename container_type::const_iterator it_end = rhs.container.end();
+ for ( ; it != it_end; it++)
+ container[it->first] -= it->second;
+
+ return *this;
+ }
+
+
+ /**
+ * return the maximum index of the array + 1 or 0 if the array
+ * is empty.
+ */
+ size_type size() const {
+ if (container.size() == 0)
+ return 0;
+ typename container_type::const_iterator last = container.end();
+ --last;
+ return last->first + 1;
+ }
+
+
+ /// return true if all elements have the default constructed value
+ bool zero() const {
+ typename container_type::const_iterator it = container.begin();
+ typename container_type::const_iterator it_end = container.end();
+ for ( ; it != it_end; it++)
+ if (it->second != 0)
+ return false;
+ return true;
+ }
+
+private:
+ container_type container;
+};
+
+#endif // SPARSE_ARRAY_H
diff --git a/libutil++/stream_util.cpp b/libutil++/stream_util.cpp
new file mode 100644
index 0000000..750b0d3
--- /dev/null
+++ b/libutil++/stream_util.cpp
@@ -0,0 +1,31 @@
+/**
+ * @file stream_util.cpp
+ * C++ stream utility
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#include "stream_util.h"
+
+using namespace std;
+
+io_state::io_state(ios & stream_)
+ :
+ stream(stream_),
+ format(stream.flags()),
+ precision(stream.precision()),
+ fill(stream.fill())
+{
+}
+
+
+io_state::~io_state()
+{
+ stream.flags(format);
+ stream.precision(precision);
+ stream.fill(fill);
+}
diff --git a/libutil++/stream_util.h b/libutil++/stream_util.h
new file mode 100644
index 0000000..0ccee9a
--- /dev/null
+++ b/libutil++/stream_util.h
@@ -0,0 +1,39 @@
+/**
+ * @file stream_util.h
+ * C++ stream utility
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#ifndef STREAM_UTIL_H
+#define STREAM_UTIL_H
+
+#include <iostream>
+
+/// class which save a stream state and restore it at dtor time
+class io_state {
+public:
+ /**
+ * save the stream flags, precision and fill char.
+ *
+ * width is restored at end of expression, there is no need to save it.
+ * tie and locale are not saved currently
+ *
+ * error state shouldn't be saved.
+ */
+ io_state(std::ios & stream);
+ /// restore the stream state
+ ~io_state();
+private:
+ std::ios & stream;
+
+ std::ios::fmtflags format;
+ std::streamsize precision;
+ char fill;
+};
+
+#endif /* !STREAM_UTIL_H */
diff --git a/libutil++/string_filter.cpp b/libutil++/string_filter.cpp
new file mode 100644
index 0000000..2a10cc6
--- /dev/null
+++ b/libutil++/string_filter.cpp
@@ -0,0 +1,49 @@
+/**
+ * @file string_filter.cpp
+ * Filter strings based on exclude/include list
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#include <algorithm>
+
+#include "string_filter.h"
+#include "string_manip.h"
+
+using namespace std;
+
+
+string_filter::string_filter(string const & include_patterns,
+ string const & exclude_patterns)
+ : include(separate_token(include_patterns, ',')),
+ exclude(separate_token(exclude_patterns, ','))
+{
+}
+
+
+string_filter::string_filter(vector<string> const & include_patterns,
+ vector<string> const & exclude_patterns)
+ : include(include_patterns),
+ exclude(exclude_patterns)
+{
+}
+
+
+// FIXME: PP reference
+bool string_filter::match(string const & str) const
+{
+ vector<string>::const_iterator cit;
+ cit = find(exclude.begin(), exclude.end(), str);
+ if (cit != exclude.end())
+ return false;
+
+ cit = find(include.begin(), include.end(), str);
+ if (include.empty() || cit != include.end())
+ return true;
+
+ return false;
+}
diff --git a/libutil++/string_filter.h b/libutil++/string_filter.h
new file mode 100644
index 0000000..c008fe3
--- /dev/null
+++ b/libutil++/string_filter.h
@@ -0,0 +1,55 @@
+/**
+ * @file string_filter.h
+ * Filter strings based on exclude/include list
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#ifndef STRING_FILTER_H
+#define STRING_FILTER_H
+
+#include <string>
+#include <vector>
+
+/**
+ * string_filter - filtering of a string based on include/exclude list
+ *
+ * This class is an oracle on whether a particular string matches
+ * the given list of included and excluded strings.
+ *
+ * This base class gives a default exact-match semantics.
+ */
+class string_filter {
+public:
+ string_filter() {}
+
+ /**
+ * Initialise the filter with the include and exclude list,
+ * comma-separated.
+ */
+ string_filter(std::string const & include_patterns,
+ std::string const & exclude_patterns);
+
+ /**
+ * Initialise the filter with the include and exclude list.
+ */
+ string_filter(std::vector<std::string> const & include_patterns,
+ std::vector<std::string> const & exclude_patterns);
+
+ virtual ~string_filter() {}
+
+ /// Returns true if the given string matches
+ virtual bool match(std::string const & str) const;
+
+protected:
+ /// include patterns
+ std::vector<std::string> include;
+ /// exclude patterns
+ std::vector<std::string> exclude;
+};
+
+#endif /* STRING_FILTER_H */
diff --git a/libutil++/string_manip.cpp b/libutil++/string_manip.cpp
new file mode 100644
index 0000000..3a836b1
--- /dev/null
+++ b/libutil++/string_manip.cpp
@@ -0,0 +1,148 @@
+/**
+ * @file string_manip.cpp
+ * std::string helpers
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#include <sstream>
+#include <iomanip>
+
+#include <cstdlib>
+#include <cmath>
+
+#include "string_manip.h"
+
+using namespace std;
+
+
+string erase_to_last_of(string const & str, char ch)
+{
+ string result = str;
+ string::size_type pos = result.find_last_of(ch);
+ if (pos != string::npos)
+ result.erase(0, pos + 1);
+
+ return result;
+}
+
+
+string split(string & s, char c)
+{
+ string::size_type i = s.find_first_of(c);
+ if (i == string::npos)
+ return string();
+
+ string const tail = s.substr(i + 1);
+ s = s.substr(0, i);
+ return tail;
+}
+
+
+bool is_prefix(string const & s, string const & prefix)
+{
+ // gcc 2.95 and below don't have this
+ // return s.compare(0, prefix.length(), prefix) == 0;
+ return s.find(prefix) == 0;
+}
+
+
+vector<string> separate_token(string const & str, char sep)
+{
+ vector<string> result;
+ string next;
+
+ for (size_t pos = 0 ; pos != str.length() ; ++pos) {
+ char ch = str[pos];
+ if (ch == '\\') {
+ if (pos < str.length() - 1 && str[pos + 1] == sep) {
+ ++pos;
+ next += sep;
+ } else {
+ next += '\\';
+ }
+ } else if (ch == sep) {
+ result.push_back(next);
+ // some stl lacks string::clear()
+ next.erase(next.begin(), next.end());
+ } else {
+ next += ch;
+ }
+ }
+
+ if (!next.empty())
+ result.push_back(next);
+
+ return result;
+}
+
+
+string ltrim(string const & str, string const & totrim)
+{
+ string result(str);
+
+ return result.erase(0, result.find_first_not_of(totrim));
+}
+
+
+string rtrim(string const & str, string const & totrim)
+{
+ string result(str);
+
+ return result.erase(result.find_last_not_of(totrim) + 1);
+}
+
+
+string trim(string const & str, string const & totrim)
+{
+ return rtrim(ltrim(str, totrim), totrim);
+}
+
+
+string const
+format_percent(double value, size_t int_width, size_t fract_width, bool showpos)
+{
+ ostringstream os;
+
+ if (value == 0.0)
+ return string(int_width + fract_width, ' ') + "0";
+
+ if (showpos)
+ os.setf(ios::showpos);
+
+ if (fabs(value) > .001) {
+ // os << fixed << value unsupported by gcc 2.95
+ os.setf(ios::fixed, ios::floatfield);
+ os << setw(int_width + fract_width + 1)
+ << setprecision(fract_width) << value;
+ } else {
+ // os << scientific << value unsupported by gcc 2.95
+ os.setf(ios::scientific, ios::floatfield);
+ os << setw(int_width + fract_width + 1)
+ // - 3 to count exponent part
+ << setprecision(fract_width - 3) << value;
+ }
+
+ string formatted = os.str();
+ if (is_prefix(formatted, "100."))
+ formatted.erase(formatted.size() - 1);
+ return formatted;
+}
+
+
+template <>
+unsigned int op_lexical_cast<unsigned int, string>(string const & str)
+{
+ char* endptr;
+
+ // 2.91.66 fix
+ unsigned long ret = 0;
+ ret = strtoul(str.c_str(), &endptr, 0);
+ if (*endptr)
+ throw invalid_argument("op_lexical_cast(\""+ str +"\")");
+ return ret;
+}
diff --git a/libutil++/string_manip.h b/libutil++/string_manip.h
new file mode 100644
index 0000000..a5759f3
--- /dev/null
+++ b/libutil++/string_manip.h
@@ -0,0 +1,107 @@
+/**
+ * @file string_manip.h
+ * std::string helpers
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#ifndef STRING_MANIP_H
+#define STRING_MANIP_H
+
+#include <string>
+#include <vector>
+#include <sstream>
+#include <stdexcept>
+
+/**
+ * @param str string
+ * @param ch the characterto search
+ *
+ * erase char from the begin of str to the last
+ * occurence of ch from and return the string
+ */
+std::string erase_to_last_of(std::string const & str, char ch);
+
+/// split string s by first occurence of char c, returning the second part.
+/// s is set to the first part. Neither include the split character
+std::string split(std::string & s, char c);
+
+/// return true if "prefix" is a prefix of "s", behavior is undefined
+/// if prefix is an empty string
+bool is_prefix(std::string const & s, std::string const & prefix);
+
+/**
+ * @param str the string to tokenize
+ * @param sep the separator_char
+ *
+ * separate fields in a string in a list of token; field are
+ * separated by the sep character, sep char can be escaped
+ * by '\\' to specify a sep char in a token, '\\' not followed
+ * by a sep is taken as it e.g. "\,\a" --> ",\a"
+ */
+std::vector<std::string> separate_token(std::string const & str, char sep);
+
+/// remove trim chars from start of input string return the new string
+std::string ltrim(std::string const & str, std::string const & totrim = "\t ");
+/// remove trim chars from end of input string return the new string
+std::string rtrim(std::string const & str, std::string const & totrim = "\t ");
+/// ltrim(rtrim(str))
+std::string trim(std::string const & str, std::string const & totrim = "\t ");
+
+/**
+ * format_percent - smart format of double percentage value
+ * @param value - the value
+ * @param int_width - the maximum integer integer width default to 2
+ * @param frac_width - the fractionnary width default to 4
+ * @param showpos - show + sign for positive values
+ *
+ * This formats a percentage into exactly the given width and returns
+ * it. If the integer part is larger than the given int_width, the
+ * returned string will be wider. The returned string is never
+ * shorter than (fract_with + int_width + 1)
+ *
+ */
+std::string const
+format_percent(double value, size_t int_width,
+ size_t frac_width, bool showpos = false);
+
+/// prefered width to format percentage
+static unsigned int const percent_int_width = 2;
+static unsigned int const percent_fract_width = 4;
+static unsigned int const percent_width = percent_int_width + percent_fract_width + 1;
+
+
+/**
+ * @param src input parameter
+ * convert From src to a T through an istringstream.
+ *
+ * Throws invalid_argument if conversion fail.
+ *
+ * Note that this is not as foolproof as boost's lexical_cast
+ */
+template <typename To, typename From>
+To op_lexical_cast(From const & src)
+{
+ std::ostringstream in;
+ if (!(in << src))
+ throw std::invalid_argument("op_lexical_cast<T>()");
+ std::istringstream out(in.str());
+ To value;
+ if (!(out >> value)) {
+ throw std::invalid_argument("op_lexical_cast<T>(\"" +
+ in.str() +"\")");
+ }
+ return value;
+}
+
+// specialization accepting hexadecimal and octal number in input. Note that
+// op_lexical_cast<unsigned int>("0x23"); will fail because it call the
+// non specialized template.
+template <>
+unsigned int op_lexical_cast<unsigned int>(std::string const & str);
+
+#endif /* !STRING_MANIP_H */
diff --git a/libutil++/tests/Makefile.am b/libutil++/tests/Makefile.am
new file mode 100644
index 0000000..fcc9a7d
--- /dev/null
+++ b/libutil++/tests/Makefile.am
@@ -0,0 +1,49 @@
+
+REALPATH= readlink -f
+
+SRCDIR := $(shell $(REALPATH) $(topdir)/libutil++/tests/ )
+
+AM_CPPFLAGS = \
+ -I ${top_srcdir}/libutil++ -D SRCDIR="\"$(SRCDIR)/\""
+
+COMMON_LIBS = ../libutil++.a ../../libutil/libutil.a
+
+LIBS = @LIBERTY_LIBS@
+
+AM_CXXFLAGS = @OP_CXXFLAGS@
+
+check_PROGRAMS = \
+ string_manip_tests \
+ string_filter_tests \
+ comma_list_tests \
+ file_manip_tests \
+ glob_filter_tests \
+ path_filter_tests \
+ cached_value_tests \
+ utility_tests
+
+string_manip_tests_SOURCES = string_manip_tests.cpp
+string_manip_tests_LDADD = ${COMMON_LIBS}
+
+string_filter_tests_SOURCES = string_filter_tests.cpp
+string_filter_tests_LDADD = ${COMMON_LIBS}
+
+glob_filter_tests_SOURCES = glob_filter_tests.cpp
+glob_filter_tests_LDADD = ${COMMON_LIBS}
+
+path_filter_tests_SOURCES = path_filter_tests.cpp
+path_filter_tests_LDADD = ${COMMON_LIBS}
+
+comma_list_tests_SOURCES = comma_list_tests.cpp
+comma_list_tests_LDADD = ${COMMON_LIBS}
+
+file_manip_tests_SOURCES = file_manip_tests.cpp
+file_manip_tests_LDADD = ${COMMON_LIBS}
+
+cached_value_tests_SOURCES = cached_value_tests.cpp
+cached_value_tests_LDADD = ${COMMON_LIBS}
+
+utility_tests_SOURCES = utility_tests.cpp
+utility_tests_LDADD = ${COMMON_LIBS}
+
+TESTS = ${check_PROGRAMS}
diff --git a/libutil++/tests/Makefile.in b/libutil++/tests/Makefile.in
new file mode 100644
index 0000000..b7bf8da
--- /dev/null
+++ b/libutil++/tests/Makefile.in
@@ -0,0 +1,632 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+check_PROGRAMS = string_manip_tests$(EXEEXT) \
+ string_filter_tests$(EXEEXT) comma_list_tests$(EXEEXT) \
+ file_manip_tests$(EXEEXT) glob_filter_tests$(EXEEXT) \
+ path_filter_tests$(EXEEXT) cached_value_tests$(EXEEXT) \
+ utility_tests$(EXEEXT)
+subdir = libutil++/tests
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/binutils.m4 \
+ $(top_srcdir)/m4/builtinexpect.m4 \
+ $(top_srcdir)/m4/cellspubfdsupport.m4 \
+ $(top_srcdir)/m4/compileroption.m4 \
+ $(top_srcdir)/m4/configmodule.m4 \
+ $(top_srcdir)/m4/copyifchange.m4 $(top_srcdir)/m4/docbook.m4 \
+ $(top_srcdir)/m4/extradirs.m4 $(top_srcdir)/m4/findkernel.m4 \
+ $(top_srcdir)/m4/kerneloption.m4 \
+ $(top_srcdir)/m4/kernelversion.m4 \
+ $(top_srcdir)/m4/mallocattribute.m4 \
+ $(top_srcdir)/m4/poptconst.m4 \
+ $(top_srcdir)/m4/precompiledheader.m4 $(top_srcdir)/m4/qt.m4 \
+ $(top_srcdir)/m4/resultyn.m4 $(top_srcdir)/m4/sstream.m4 \
+ $(top_srcdir)/m4/typedef.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am_cached_value_tests_OBJECTS = cached_value_tests.$(OBJEXT)
+cached_value_tests_OBJECTS = $(am_cached_value_tests_OBJECTS)
+am__DEPENDENCIES_1 = ../libutil++.a ../../libutil/libutil.a
+cached_value_tests_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_comma_list_tests_OBJECTS = comma_list_tests.$(OBJEXT)
+comma_list_tests_OBJECTS = $(am_comma_list_tests_OBJECTS)
+comma_list_tests_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_file_manip_tests_OBJECTS = file_manip_tests.$(OBJEXT)
+file_manip_tests_OBJECTS = $(am_file_manip_tests_OBJECTS)
+file_manip_tests_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_glob_filter_tests_OBJECTS = glob_filter_tests.$(OBJEXT)
+glob_filter_tests_OBJECTS = $(am_glob_filter_tests_OBJECTS)
+glob_filter_tests_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_path_filter_tests_OBJECTS = path_filter_tests.$(OBJEXT)
+path_filter_tests_OBJECTS = $(am_path_filter_tests_OBJECTS)
+path_filter_tests_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_string_filter_tests_OBJECTS = string_filter_tests.$(OBJEXT)
+string_filter_tests_OBJECTS = $(am_string_filter_tests_OBJECTS)
+string_filter_tests_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_string_manip_tests_OBJECTS = string_manip_tests.$(OBJEXT)
+string_manip_tests_OBJECTS = $(am_string_manip_tests_OBJECTS)
+string_manip_tests_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_utility_tests_OBJECTS = utility_tests.$(OBJEXT)
+utility_tests_OBJECTS = $(am_utility_tests_OBJECTS)
+utility_tests_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(cached_value_tests_SOURCES) $(comma_list_tests_SOURCES) \
+ $(file_manip_tests_SOURCES) $(glob_filter_tests_SOURCES) \
+ $(path_filter_tests_SOURCES) $(string_filter_tests_SOURCES) \
+ $(string_manip_tests_SOURCES) $(utility_tests_SOURCES)
+DIST_SOURCES = $(cached_value_tests_SOURCES) \
+ $(comma_list_tests_SOURCES) $(file_manip_tests_SOURCES) \
+ $(glob_filter_tests_SOURCES) $(path_filter_tests_SOURCES) \
+ $(string_filter_tests_SOURCES) $(string_manip_tests_SOURCES) \
+ $(utility_tests_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFD_LIBS = @BFD_LIBS@
+BUILD_JVMPI_AGENT_FALSE = @BUILD_JVMPI_AGENT_FALSE@
+BUILD_JVMPI_AGENT_TRUE = @BUILD_JVMPI_AGENT_TRUE@
+BUILD_JVMTI_AGENT_FALSE = @BUILD_JVMTI_AGENT_FALSE@
+BUILD_JVMTI_AGENT_TRUE = @BUILD_JVMTI_AGENT_TRUE@
+CAT_ENTRY_END = @CAT_ENTRY_END@
+CAT_ENTRY_START = @CAT_ENTRY_START@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOCBOOK_ROOT = @DOCBOOK_ROOT@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+EXTRA_CFLAGS_MODULE = @EXTRA_CFLAGS_MODULE@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAVA_HOMEDIR = @JAVA_HOMEDIR@
+KINC = @KINC@
+KSRC = @KSRC@
+KVERS = @KVERS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBERTY_LIBS = @LIBERTY_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBERTY_LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MOC = @MOC@
+MODINSTALLDIR = @MODINSTALLDIR@
+OBJEXT = @OBJEXT@
+OPROFILE_DIR = @OPROFILE_DIR@
+OPROFILE_MODULE_ARCH = @OPROFILE_MODULE_ARCH@
+OP_CFLAGS = @OP_CFLAGS@
+OP_CXXFLAGS = @OP_CXXFLAGS@
+OP_DOCDIR = @OP_DOCDIR@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POPT_LIBS = @POPT_LIBS@
+PTRDIFF_T_TYPE = @PTRDIFF_T_TYPE@
+QT_INCLUDES = @QT_INCLUDES@
+QT_LDFLAGS = @QT_LDFLAGS@
+QT_LIB = @QT_LIB@
+QT_VERSION = @QT_VERSION@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIZE_T_TYPE = @SIZE_T_TYPE@
+STRIP = @STRIP@
+UIC = @UIC@
+VERSION = @VERSION@
+XML_CATALOG = @XML_CATALOG@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+have_qt_FALSE = @have_qt_FALSE@
+have_qt_TRUE = @have_qt_TRUE@
+have_xsltproc_FALSE = @have_xsltproc_FALSE@
+have_xsltproc_TRUE = @have_xsltproc_TRUE@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+kernel_support_FALSE = @kernel_support_FALSE@
+kernel_support_TRUE = @kernel_support_TRUE@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+topdir = @topdir@
+REALPATH = readlink -f
+SRCDIR := $(shell $(REALPATH) $(topdir)/libutil++/tests/ )
+AM_CPPFLAGS = \
+ -I ${top_srcdir}/libutil++ -D SRCDIR="\"$(SRCDIR)/\""
+
+COMMON_LIBS = ../libutil++.a ../../libutil/libutil.a
+AM_CXXFLAGS = @OP_CXXFLAGS@
+string_manip_tests_SOURCES = string_manip_tests.cpp
+string_manip_tests_LDADD = ${COMMON_LIBS}
+string_filter_tests_SOURCES = string_filter_tests.cpp
+string_filter_tests_LDADD = ${COMMON_LIBS}
+glob_filter_tests_SOURCES = glob_filter_tests.cpp
+glob_filter_tests_LDADD = ${COMMON_LIBS}
+path_filter_tests_SOURCES = path_filter_tests.cpp
+path_filter_tests_LDADD = ${COMMON_LIBS}
+comma_list_tests_SOURCES = comma_list_tests.cpp
+comma_list_tests_LDADD = ${COMMON_LIBS}
+file_manip_tests_SOURCES = file_manip_tests.cpp
+file_manip_tests_LDADD = ${COMMON_LIBS}
+cached_value_tests_SOURCES = cached_value_tests.cpp
+cached_value_tests_LDADD = ${COMMON_LIBS}
+utility_tests_SOURCES = utility_tests.cpp
+utility_tests_LDADD = ${COMMON_LIBS}
+TESTS = ${check_PROGRAMS}
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libutil++/tests/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign libutil++/tests/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-checkPROGRAMS:
+ @list='$(check_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+cached_value_tests$(EXEEXT): $(cached_value_tests_OBJECTS) $(cached_value_tests_DEPENDENCIES)
+ @rm -f cached_value_tests$(EXEEXT)
+ $(CXXLINK) $(cached_value_tests_LDFLAGS) $(cached_value_tests_OBJECTS) $(cached_value_tests_LDADD) $(LIBS)
+comma_list_tests$(EXEEXT): $(comma_list_tests_OBJECTS) $(comma_list_tests_DEPENDENCIES)
+ @rm -f comma_list_tests$(EXEEXT)
+ $(CXXLINK) $(comma_list_tests_LDFLAGS) $(comma_list_tests_OBJECTS) $(comma_list_tests_LDADD) $(LIBS)
+file_manip_tests$(EXEEXT): $(file_manip_tests_OBJECTS) $(file_manip_tests_DEPENDENCIES)
+ @rm -f file_manip_tests$(EXEEXT)
+ $(CXXLINK) $(file_manip_tests_LDFLAGS) $(file_manip_tests_OBJECTS) $(file_manip_tests_LDADD) $(LIBS)
+glob_filter_tests$(EXEEXT): $(glob_filter_tests_OBJECTS) $(glob_filter_tests_DEPENDENCIES)
+ @rm -f glob_filter_tests$(EXEEXT)
+ $(CXXLINK) $(glob_filter_tests_LDFLAGS) $(glob_filter_tests_OBJECTS) $(glob_filter_tests_LDADD) $(LIBS)
+path_filter_tests$(EXEEXT): $(path_filter_tests_OBJECTS) $(path_filter_tests_DEPENDENCIES)
+ @rm -f path_filter_tests$(EXEEXT)
+ $(CXXLINK) $(path_filter_tests_LDFLAGS) $(path_filter_tests_OBJECTS) $(path_filter_tests_LDADD) $(LIBS)
+string_filter_tests$(EXEEXT): $(string_filter_tests_OBJECTS) $(string_filter_tests_DEPENDENCIES)
+ @rm -f string_filter_tests$(EXEEXT)
+ $(CXXLINK) $(string_filter_tests_LDFLAGS) $(string_filter_tests_OBJECTS) $(string_filter_tests_LDADD) $(LIBS)
+string_manip_tests$(EXEEXT): $(string_manip_tests_OBJECTS) $(string_manip_tests_DEPENDENCIES)
+ @rm -f string_manip_tests$(EXEEXT)
+ $(CXXLINK) $(string_manip_tests_LDFLAGS) $(string_manip_tests_OBJECTS) $(string_manip_tests_LDADD) $(LIBS)
+utility_tests$(EXEEXT): $(utility_tests_OBJECTS) $(utility_tests_DEPENDENCIES)
+ @rm -f utility_tests$(EXEEXT)
+ $(CXXLINK) $(utility_tests_LDFLAGS) $(utility_tests_OBJECTS) $(utility_tests_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cached_value_tests.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/comma_list_tests.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file_manip_tests.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glob_filter_tests.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/path_filter_tests.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/string_filter_tests.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/string_manip_tests.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utility_tests.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+check-TESTS: $(TESTS)
+ @failed=0; all=0; xfail=0; xpass=0; skip=0; \
+ srcdir=$(srcdir); export srcdir; \
+ list='$(TESTS)'; \
+ if test -n "$$list"; then \
+ for tst in $$list; do \
+ if test -f ./$$tst; then dir=./; \
+ elif test -f $$tst; then dir=; \
+ else dir="$(srcdir)/"; fi; \
+ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *" $$tst "*) \
+ xpass=`expr $$xpass + 1`; \
+ failed=`expr $$failed + 1`; \
+ echo "XPASS: $$tst"; \
+ ;; \
+ *) \
+ echo "PASS: $$tst"; \
+ ;; \
+ esac; \
+ elif test $$? -ne 77; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *" $$tst "*) \
+ xfail=`expr $$xfail + 1`; \
+ echo "XFAIL: $$tst"; \
+ ;; \
+ *) \
+ failed=`expr $$failed + 1`; \
+ echo "FAIL: $$tst"; \
+ ;; \
+ esac; \
+ else \
+ skip=`expr $$skip + 1`; \
+ echo "SKIP: $$tst"; \
+ fi; \
+ done; \
+ if test "$$failed" -eq 0; then \
+ if test "$$xfail" -eq 0; then \
+ banner="All $$all tests passed"; \
+ else \
+ banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
+ fi; \
+ else \
+ if test "$$xpass" -eq 0; then \
+ banner="$$failed of $$all tests failed"; \
+ else \
+ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
+ fi; \
+ fi; \
+ dashes="$$banner"; \
+ skipped=""; \
+ if test "$$skip" -ne 0; then \
+ skipped="($$skip tests were not run)"; \
+ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$skipped"; \
+ fi; \
+ report=""; \
+ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+ report="Please report to $(PACKAGE_BUGREPORT)"; \
+ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$report"; \
+ fi; \
+ dashes=`echo "$$dashes" | sed s/./=/g`; \
+ echo "$$dashes"; \
+ echo "$$banner"; \
+ test -z "$$skipped" || echo "$$skipped"; \
+ test -z "$$report" || echo "$$report"; \
+ echo "$$dashes"; \
+ test "$$failed" -eq 0; \
+ else :; fi
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
+ clean-checkPROGRAMS clean-generic clean-libtool ctags \
+ distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-exec install-exec-am install-info \
+ install-info-am install-man install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/libutil++/tests/cached_value_tests.cpp b/libutil++/tests/cached_value_tests.cpp
new file mode 100644
index 0000000..b50c5d4
--- /dev/null
+++ b/libutil++/tests/cached_value_tests.cpp
@@ -0,0 +1,80 @@
+/**
+ * @file cached_value_tests.cpp
+ * tests cached_value.h
+ *
+ * @remark Copyright 2005 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ */
+
+#include <cstdlib>
+#include <iostream>
+#include <string>
+
+#include "cached_value.h"
+
+using namespace std;
+
+namespace {
+
+
+bool check_throw(cached_value<bool> const & boolval)
+{
+ try {
+ bool foo = boolval.get();
+ foo = false;
+ } catch (op_fatal_error const & e) {
+ return true;
+ }
+ return false;
+}
+
+
+int check_cached(void)
+{
+ cached_value<bool> boolval;
+ cached_value<string> strval;
+
+ if (!check_throw(boolval)) {
+ cerr << "get() on no value didn't throw\n";
+ return EXIT_FAILURE;
+ }
+
+ if (boolval.reset(false) != false || boolval.get() != false) {
+ cerr << "reset() of cached value \"false\" didn't work\n";
+ return EXIT_FAILURE;
+ }
+
+ if (boolval.reset(true) != true || boolval.get() != true) {
+ cerr << "reset() of cached value \"true\" didn't work\n";
+ return EXIT_FAILURE;
+ }
+
+ if (strval.reset("foo") != "foo" || strval.get() != "foo") {
+ cerr << "reset() of cached value \"foo\" didn't work\n";
+ return EXIT_FAILURE;
+ }
+
+ if (strval.reset("") != "" || strval.get() != "") {
+ cerr << "reset() of cached value \"\" didn't work\n";
+ return EXIT_FAILURE;
+ }
+
+ return EXIT_SUCCESS;
+}
+
+};
+
+int main()
+{
+ try {
+ check_cached();
+ }
+ catch (...) {
+ cerr << "unknown exception\n";
+ return EXIT_FAILURE;
+ }
+
+ return EXIT_SUCCESS;
+}
diff --git a/libutil++/tests/comma_list_tests.cpp b/libutil++/tests/comma_list_tests.cpp
new file mode 100644
index 0000000..b30feef
--- /dev/null
+++ b/libutil++/tests/comma_list_tests.cpp
@@ -0,0 +1,70 @@
+/**
+ * @file comma_list_tests.cpp
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include <stdlib.h>
+
+#include <iostream>
+
+#include "comma_list.h"
+
+using namespace std;
+
+#define check(clist, val, result) \
+ if (clist.match(val) != result) { \
+ cerr << "\"" << #val << "\" matched with " #clist \
+ << " did not return " #result << endl; \
+ exit(EXIT_FAILURE); \
+ }
+
+int main()
+{
+ comma_list<int> c1;
+
+ check(c1, 1, true);
+
+ c1.set("2");
+
+ check(c1, 2, true);
+ check(c1, 3, false);
+
+ c1.set("3");
+
+ check(c1, 2, false);
+ check(c1, 3, true);
+
+ c1.set("2,3");
+
+ check(c1, 2, true);
+ check(c1, 3, true);
+ check(c1, 4, false);
+
+ c1.set("all");
+
+ check(c1, 2, true);
+ check(c1, 4, true);
+ check(c1, 5, true);
+
+ comma_list<int> c2;
+
+ c2.set("6,all");
+
+ check(c2, 4, true);
+ check(c2, 0, true);
+
+ c2.set("all,6");
+
+ check(c2, 4, true);
+ check(c2, 0, true);
+
+ c2.set("10");
+ check(c2, 10, true);
+ check(c2, 11, false);
+ return EXIT_SUCCESS;
+}
diff --git a/libutil++/tests/file_manip_tests.cpp b/libutil++/tests/file_manip_tests.cpp
new file mode 100644
index 0000000..dfe161b
--- /dev/null
+++ b/libutil++/tests/file_manip_tests.cpp
@@ -0,0 +1,241 @@
+/**
+ * @file file_manip_tests.cpp
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include <unistd.h>
+#include <stdlib.h>
+
+#include <string>
+#include <iostream>
+#include <list>
+
+#include "file_manip.h"
+
+using namespace std;
+
+template <typename Input, typename Output>
+struct input_output {
+ Input input;
+ Output output;
+};
+
+
+template <typename Input, typename Output, typename Result>
+static void check_result(char const * fct_name, Input const & input,
+ Output const & output, Result const & result)
+{
+ if (result != output) {
+ cerr << fct_name << " "
+ << "for:\n\"" << input << "\"\n"
+ << "expect:\n\"" << output << "\"\n"
+ << "found:\n\"" << result << "\"\n";
+ exit(EXIT_FAILURE);
+ }
+}
+
+template <typename Input, typename Output, typename Result>
+static void check_result(char const * fct_name, Input const & input1,
+ Input input2, Output const & output, Result const & result)
+{
+ if (result != output) {
+ cerr << fct_name << ": \n"
+ << "for:\n\"" << input1 << "\"\n"
+ << "\"" << input2 << "\"\n"
+ << "expect:\n\"" << output << "\"\n"
+ << "found:\n\"" << result << "\"\n";
+ exit(EXIT_FAILURE);
+ }
+}
+
+
+static input_output<char const *, char const *> expect_dirname[] =
+{
+ { "/", "/" },
+ { "//////", "/" },
+ { "/usr", "/" },
+ { "///usr", "/" },
+ // suprising but conform to dirname(1)
+ { "///usr/dir", "///usr" },
+ { "usr/dir", "usr" },
+ { "usr", "." },
+ { "n", "." },
+ { "../..", ".." },
+ { "/../..", "/.." },
+ { "./..", "." },
+ { "./.", "." },
+ { "..", "." },
+ { ".", "." },
+ { "", "." },
+ { 0, 0 }
+};
+
+static void dirname_tests()
+{
+ input_output<char const *, char const *> const * cur;
+ for (cur = expect_dirname; cur->input; ++cur) {
+ string result = op_dirname(cur->input);
+ check_result("dirname", cur->input, cur->output, result);
+ }
+}
+
+
+static input_output<char const *, char const*> expect_basename[] =
+{
+ { "/", "/" },
+ { "//////", "/" },
+ { "/usr", "usr" },
+ { "///usr", "usr" },
+ { "///usr/dir", "dir" },
+ { "///usr//dir", "dir" },
+ { "usr/dir", "dir" },
+ { "usr", "usr" },
+ { "../..", ".." },
+ { "/../..", ".." },
+ { "./..", ".." },
+ { "./.", "." },
+ { ".", "." },
+ { 0, 0 }
+};
+
+static void basename_tests()
+{
+ input_output<char const *, char const *> const * cur;
+ for (cur = expect_basename; cur->input; ++cur) {
+ string result = op_basename(cur->input);
+ check_result("basename", cur->input, cur->output, result);
+ }
+}
+
+
+static input_output<char const *, bool> expect_is_directory[] =
+{
+ { ".", true },
+ { "/.", true },
+ { "./", true },
+ { "/", true },
+ { "../", true },
+ { "../.", true },
+ { "non_existing_dir", false },
+ { 0, 0 }
+};
+
+static void is_directory_tests()
+{
+ input_output<char const *, bool> const * cur;
+ for (cur = expect_is_directory; cur->input; ++cur) {
+ bool result = is_directory(cur->input);
+ check_result("is_directory", cur->input, cur->output, result);
+ }
+}
+
+
+static input_output<pair<string, string>, bool>
+expect_is_files_identical[] = {
+#define MAKE_PAIR(a, b) make_pair(string(a), string(b))
+ { MAKE_PAIR(__FILE__, __FILE__), true },
+ { MAKE_PAIR(__FILE__, "not_existing"), false },
+ { MAKE_PAIR("not_exisiting", __FILE__), false },
+ { MAKE_PAIR("not_exisiting", "not_existing"), false },
+ { MAKE_PAIR("", ""), false }
+#undef MAKE_PAIR
+};
+
+void is_files_identical_tests(char const * prog_name)
+{
+ check_result("is_files_identical", prog_name, prog_name,
+ is_files_identical(prog_name, prog_name), true);
+
+ input_output<pair<string, string>, bool> const * cur;
+ for (cur = expect_is_files_identical; !cur->input.first.empty(); ++cur) {
+ bool result = is_files_identical(cur->input.first,
+ cur->input.second);
+ check_result("is_files_identical", cur->input.first,
+ cur->input.second, cur->output, result);
+ }
+}
+
+
+static input_output<char const *, bool> expect_op_file_readable[] =
+{
+ { __FILE__, true },
+ { "./" __FILE__, true },
+ { ".", false },
+ { "/.", false },
+ { "./", false },
+ { "/", false },
+ { "../", false },
+ { "../.", false },
+ { "non_existing_file", false },
+ { 0, 0 }
+};
+
+static void op_file_readable_tests()
+{
+ input_output<char const *, bool> const * cur;
+ for (cur = expect_op_file_readable; cur->input; ++cur) {
+ bool result = op_file_readable(cur->input);
+ check_result("op_file_readable", cur->input, cur->output, result);
+ }
+}
+
+
+static input_output<string, string> expect_realpath[] =
+{
+ // realpath() file argument must exists.
+ { "file_manip_tests.o", "file_manip_tests.o" },
+ { "../tests/" "file_manip_tests.o", "file_manip_tests.o" },
+ { ".//.//" "file_manip_tests.o", "file_manip_tests.o" },
+ // POSIX namespaces ignored by realpath(3)
+ { "//", "/" },
+ { "//usr", "/usr" },
+ { "///", "/" },
+ { "", "" }
+};
+
+
+// FIXME: useful to test symlinks too
+static void realpath_tests()
+{
+ input_output<string, string> const * cur;
+ for (cur = expect_realpath; !cur->input.empty(); ++cur) {
+ string result = op_realpath(cur->input);
+ string expect = cur->output;
+ if (cur->input[0] != '/')
+ expect = SRCDIR + expect;
+ check_result("op_realpath", cur->input,
+ expect, result);
+ }
+}
+
+
+void create_file_list_tests()
+{
+ list<string> result;
+ if (!create_file_list(result, ".")) {
+ cerr << "create_file_list() fail\n";
+ exit(EXIT_FAILURE);
+ }
+ if (result.empty()) {
+ cerr << "create_file_list(); empty result\n";
+ exit(EXIT_FAILURE);
+ }
+}
+
+
+int main(int, char * argv[])
+{
+ dirname_tests();
+ basename_tests();
+ is_directory_tests();
+ is_files_identical_tests(argv[0]);
+ op_file_readable_tests();
+ realpath_tests();
+ create_file_list_tests();
+ return EXIT_SUCCESS;
+}
diff --git a/libutil++/tests/glob_filter_tests.cpp b/libutil++/tests/glob_filter_tests.cpp
new file mode 100644
index 0000000..e88a3ed
--- /dev/null
+++ b/libutil++/tests/glob_filter_tests.cpp
@@ -0,0 +1,53 @@
+/**
+ * @file glob_filter_tests.cpp
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include <stdlib.h>
+
+#include <iostream>
+
+#include "glob_filter.h"
+
+using namespace std;
+
+#define check(filter, str, result) \
+ if (filter.match(str) != result) { \
+ cerr << "\"" << str << "\" matched with " #filter \
+ << " did not return " #result << endl; \
+ exit(EXIT_FAILURE); \
+ }
+
+int main()
+{
+ glob_filter f1("foo,*bar", "foobar");
+ check(f1, "foo/barfoobar", true);
+ check(f1, "foo/bar", true);
+ check(f1, "/foo/foobar/foo", false);
+ check(f1, "fooobar1", false);
+ check(f1, "foo1", false);
+ check(f1, "foobar", false);
+ check(f1, "bar1", false);
+
+ glob_filter f2("foo", "");
+ check(f2, "foo", true);
+ check(f2, "foo1", false);
+ check(f2, "foo/foo", false);
+
+ glob_filter f3("", "foo");
+ check(f3, "foo", false);
+ check(f3, "foo1", true);
+ check(f3, "foo/foo", true);
+
+ glob_filter f4("foo", "foo");
+ check(f4, "foo", false);
+ check(f4, "foo1", false);
+ check(f4, "foo/foo", false);
+
+ return EXIT_SUCCESS;
+}
diff --git a/libutil++/tests/path_filter_tests.cpp b/libutil++/tests/path_filter_tests.cpp
new file mode 100644
index 0000000..e664d0f
--- /dev/null
+++ b/libutil++/tests/path_filter_tests.cpp
@@ -0,0 +1,78 @@
+/**
+ * @file path_filter_tests.cpp
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include <stdlib.h>
+
+#include <iostream>
+
+#include "path_filter.h"
+
+using namespace std;
+
+#define check(filter, str, result) \
+ if (filter.match(str) != result) { \
+ cerr << "\"" << str << "\" matched with " #filter \
+ << " did not return " #result << endl; \
+ exit(EXIT_FAILURE); \
+ }
+
+int main()
+{
+ path_filter f1("foo,*bar", "foobar");
+ check(f1, "foo/barfoobar", true);
+ check(f1, "foo/bar", true);
+ check(f1, "/foo/foobar/foo", false);
+ check(f1, "fooobar1", false);
+ check(f1, "foo1", false);
+ check(f1, "foobar", false);
+ check(f1, "bar1", false);
+
+ path_filter f2("foo", "");
+ check(f2, "foo", true);
+ check(f2, "foo1", false);
+ check(f2, "foo/foo", true);
+
+ path_filter f3("", "foo");
+ check(f3, "foo", false);
+ check(f3, "foo1", true);
+ check(f3, "foo/foo", false);
+
+ path_filter f4("foo", "foo");
+ check(f4, "foo", false);
+ check(f4, "foo1", false);
+ check(f4, "foo/foo", false);
+
+ path_filter f5("*foo*", "*bar*");
+ check(f5, "foo", true);
+ check(f5, "bar", false);
+ check(f5, "foobar", false);
+ check(f5, "barfoo", false);
+ check(f5, "foo/bar", false);
+
+ path_filter f6(" foo,bar", "bar ");
+ check(f6, "foo", false);
+ check(f6, "foo ", false);
+ check(f6, " foo", true);
+ check(f6, "bar", true);
+ check(f6, "bar ", false);
+ check(f6, " bar", false);
+ check(f6, "foo ", false);
+ check(f6, "foo/ bar", false);
+
+ path_filter f7(".", "");
+ check(f7, ".", true);
+ // a bit surprising but right IMHO, our implementation use successive
+ // dirname(input) to check vs the included path and
+ // dirname("foo") == "." so all relative path input match a "."
+ // included filter
+ check(f7, "foo", true);
+
+ return EXIT_SUCCESS;
+}
diff --git a/libutil++/tests/string_filter_tests.cpp b/libutil++/tests/string_filter_tests.cpp
new file mode 100644
index 0000000..7d06039
--- /dev/null
+++ b/libutil++/tests/string_filter_tests.cpp
@@ -0,0 +1,90 @@
+/**
+ * @file string_filter_tests.cpp
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include <stdlib.h>
+
+#include <iostream>
+
+#include "string_filter.h"
+
+using namespace std;
+
+#define check(filter, str, result) \
+ if (filter.match(str) != result) { \
+ cerr << "\"" << str << "\" matched with " #filter \
+ << " did not return " #result << endl; \
+ exit(EXIT_FAILURE); \
+ }
+
+int main()
+{
+ string_filter f1;
+ check(f1, "", true);
+ check(f1, "ok", true);
+
+ string_filter f2("ok", "");
+ check(f2, "ok", true);
+ check(f2, "no", false);
+
+ string_filter f3("", "no");
+ check(f3, "ok", true);
+ check(f3, "no", false);
+
+ string_filter f4("ok,ok2,", "");
+ check(f4, "ok", true);
+ check(f4, "ok2", true);
+ check(f4, "no", false);
+
+ string_filter f5("ok,ok2", "no,no2");
+ check(f5, "ok", true);
+ check(f5, "ok2", true);
+ check(f5, "no", false);
+ check(f5, "no2", false);
+
+ vector<string> v1;
+ vector<string> v2;
+
+ string_filter f6(v1, v2);
+ check(f6, "", true);
+ check(f6, "ok", true);
+
+ v1.push_back("ok");
+ v1.push_back("ok2");
+
+ string_filter f7(v1, v2);
+ check(f7, "ok", true);
+ check(f7, "ok2", true);
+ check(f7, "no", false);
+
+ v1.clear();
+
+ v2.push_back("no");
+ v2.push_back("no2");
+
+ string_filter f8(v1, v2);
+ check(f8, "ok", true);
+ check(f8, "no", false);
+ check(f8, "no", false);
+
+ v1.push_back("ok");
+ v1.push_back("ok2");
+
+ string_filter f9(v1, v2);
+ check(f9, "ok", true);
+ check(f9, "no2", false);
+
+ string_filter f10(" foo ", "");
+ check(f10, " foo ", true);
+ check(f10, " foo", false);
+ check(f10, "foo ", false);
+ check(f10, "foo", false);
+
+ return EXIT_SUCCESS;
+}
diff --git a/libutil++/tests/string_manip_tests.cpp b/libutil++/tests/string_manip_tests.cpp
new file mode 100644
index 0000000..1cb07df
--- /dev/null
+++ b/libutil++/tests/string_manip_tests.cpp
@@ -0,0 +1,325 @@
+/**
+ * @file string_manip_tests.cpp
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include <stdlib.h>
+
+#include <algorithm>
+#include <iterator>
+#include <iostream>
+#include <utility>
+
+#include "string_manip.h"
+
+using namespace std;
+
+template <typename Input, typename Output>
+struct input_output {
+ Input input;
+ Output output;
+};
+
+
+template <typename Input, typename Output, typename Result>
+static void check_result(char const * fct_name, Input const & input,
+ Output const & output, Result const & result)
+{
+ if (result != output) {
+ cerr << fct_name << ": \n"
+ << "for:\n\"" << input << "\"\n"
+ << "expect:\n\"" << output << "\"\n"
+ << "found:\n\"" << result << "\"\n";
+ exit(EXIT_FAILURE);
+ }
+}
+
+
+static input_output<char const*, char const*> expect_erase[] =
+{
+ { "", "" },
+ { ";;;", "" },
+ { "ab;;;cd", "cd" },
+ { ";;;cd", "cd" },
+ { "ab;;;", "" },
+ { 0, 0 }
+};
+
+static void erase_to_last_of_tests()
+{
+ input_output<char const *, char const*> const * cur;
+ for (cur = expect_erase; cur->input; ++cur) {
+ string result = erase_to_last_of(cur->input, ';');
+ check_result("erase_to_last_of()", cur->input, cur->output,
+ result);
+ }
+}
+
+
+static input_output<char const *, pair<string, string> > expect_split[] =
+{
+#define MAKE_PAIR(a, b) make_pair(string(a), string(b))
+ { "ab;cd", MAKE_PAIR("ab", "cd") },
+ { ";cd", MAKE_PAIR("", "cd") },
+ { "ab;", MAKE_PAIR("ab", "") },
+ { "b;d", MAKE_PAIR("b", "d") },
+ { ";d", MAKE_PAIR("", "d") },
+ { "a;", MAKE_PAIR("a", "") },
+ { ";", MAKE_PAIR("", "") },
+ { "", MAKE_PAIR("", "") },
+ { 0, MAKE_PAIR("", "") }
+#undef MAKE_PAIR
+};
+
+static void split_tests()
+{
+ input_output<char const *, pair<string, string> > const * cur;
+ for (cur = expect_split; cur->input; ++cur) {
+ string temp = cur->input;
+ string result = split(temp, ';');
+ check_result("split()", cur->input, cur->output.first, temp);
+ check_result("split()", cur->input, cur->output.second, result);
+ }
+}
+
+static input_output<char const *, pair<string, bool> > expect_is_prefix[] =
+{
+#define MAKE_PAIR(a, b) make_pair(string(a), b)
+ { "abcd", MAKE_PAIR("abc", true) },
+ { "abcd", MAKE_PAIR("ac", false) },
+ { "babcd", MAKE_PAIR("abc", false) },
+ // these invoke undefined behavior from is_prefix, we keep them
+ // for the record.
+// { "babcd", MAKE_PAIR("", false) },
+// { "", MAKE_PAIR("", false) },
+ { 0, MAKE_PAIR("", true) }
+#undef MAKE_PAIR
+};
+
+static void is_prefix_tests()
+{
+ input_output<char const *, pair<string, bool> > const * cur;
+ for (cur = expect_is_prefix; cur->input; ++cur) {
+ bool result = is_prefix(cur->input, cur->output.first);
+ if (result != cur->output.second) {
+ cerr << "is_prefix(" << cur->input << ", "
+ << cur->output.first << ") "
+ << "return " << result << endl;
+ exit(EXIT_FAILURE);
+ }
+ }
+}
+
+
+static const size_t max_token = 8;
+static input_output<char const *, char const *[max_token]> expect_separate_token[] =
+{
+ { "aa", { "aa" } },
+ { "a\\c", { "a\\c" } },
+ { "a\\\\c", { "a\\\\c" } },
+ { "a\\\\c\\", { "a\\\\c\\" } },
+ { "ab;cd;ef;gh", { "ab", "cd", "ef", "gh" } },
+ { "ab\\;cd", { "ab;cd" } },
+ { "a;a", { "a", "a" } },
+ { ";a", { "", "a" } },
+ { ";", { "", "" } },
+ { ";;", { "", "", "" } },
+ { 0, { 0, } }
+};
+
+
+static void separate_token_tests()
+{
+ input_output<char const *, char const *[max_token]> const * cur;
+ for (cur = expect_separate_token; cur->input; ++cur) {
+ vector<string> result = separate_token(cur->input, ';');
+ if (result.size() > max_token) {
+ cerr << "separate_token(): too many token\n"
+ << "input:\n"
+ << '"' << cur->input << "\"\n"
+ << "output\n";
+ copy(result.begin(), result.end(),
+ ostream_iterator<string>(cerr, "\n"));
+ exit(EXIT_FAILURE);
+ }
+ for (size_t i = 0; i < result.size(); ++i) {
+ if (result[i] != cur->output[i]) {
+ cerr << "separate_token():\n"
+ << "input:\n"
+ << cur->input << endl;
+ cerr << "expect:\n";
+ for (size_t i = 0; i < max_token; ++i) {
+ if (!cur->output[i])
+ break;
+ cerr << cur->output[i] << endl;
+ }
+ cerr << "output:\n";
+ copy(result.begin(), result.end(),
+ ostream_iterator<string>(cerr, "\n"));
+ exit(EXIT_FAILURE);
+ }
+ }
+ }
+}
+
+
+static input_output<char const *, char const *> expect_rtrim[] =
+{
+ { "abc", "abc" },
+ { "abc ", "abc" },
+ { " abc ", " abc" },
+ { " abc \t \t", " abc" },
+ { " ", "" },
+ { "\t \t", "" },
+ { "", "" },
+ { 0, 0 }
+};
+
+static void rtrim_tests()
+{
+ input_output<char const *, char const*> const * cur;
+ for (cur = expect_rtrim; cur->input; ++cur) {
+ string result = rtrim(cur->input);
+ check_result("rtrim()", cur->input, cur->output, result);
+ }
+}
+
+
+static input_output<char const *, char const *> expect_ltrim[] =
+{
+ { "abc", "abc" },
+ { "abc ", "abc " },
+ { " abc ", "abc " },
+ { "\t \tabc ", "abc " },
+ { " ", "" },
+ { "\t \t", "" },
+ { "", "" },
+ { 0, 0 }
+};
+
+static void ltrim_tests()
+{
+ input_output<char const *, char const*> const * cur;
+ for (cur = expect_ltrim; cur->input; ++cur) {
+ string result = ltrim(cur->input);
+ check_result("ltrim()", cur->input, cur->output, result);
+ }
+}
+
+
+static input_output<char const *, char const *> expect_trim[] =
+{
+ { "abc", "abc" },
+ { "abc ", "abc" },
+ { " abc ", "abc" },
+ { "\t \tabc \t", "abc" },
+ { " ", "" },
+ { "\t \t", "" },
+ { "", "" },
+ { 0, 0 }
+};
+
+static void trim_tests()
+{
+ input_output<char const *, char const*> const * cur;
+ for (cur = expect_trim; cur->input; ++cur) {
+ string result = trim(cur->input);
+ check_result("trim()", cur->input, cur->output, result);
+ }
+}
+
+
+static input_output<double, char const *> expect_format_percent[] =
+{
+ { 2.2, " 2.2000" },
+ { 0, " 0" },
+ { 100.00, "100.000" },
+ { 99.99999, "100.000" },
+ { 0.00000344, "3.4e-06" },
+ // FIXME, must be 3.e-124 but output is 3.4e-124
+// { 0.34e-123, "3.e-124" },
+ { -1.0, 0 }
+};
+
+static void format_percent_tests()
+{
+ input_output<double, char const*> const * cur;
+ for (cur = expect_format_percent; cur->input != -1.0; ++cur) {
+ string result = format_percent(cur->input, percent_int_width,
+ percent_fract_width);
+ check_result("format_percent()", cur->input, cur->output,
+ result);
+ }
+}
+
+
+static input_output<unsigned int, char const *> expect_from_str_to_uint[] =
+{
+ { 123, "123" },
+ { 33, "33" },
+ { 0, "0" },
+ { 0, 0 }
+};
+
+static void tostr_tests()
+{
+ input_output<unsigned int, char const *> const * cur;
+ for (cur = expect_from_str_to_uint; cur->output; ++cur) {
+ string result = op_lexical_cast<string>(cur->input);
+ check_result("op_lexical_cast()", cur->input,
+ cur->output, result);
+ }
+}
+
+static void touint_tests()
+{
+ // reversed input/output of the previous tests
+ input_output<unsigned int, char const *> const * cur;
+ for (cur = expect_from_str_to_uint; cur->output; ++cur) {
+ unsigned int result =
+ op_lexical_cast<unsigned int>(cur->output);
+ check_result("op_lexical_cast()", cur->output, cur->input,
+ result);
+ }
+}
+
+
+static input_output<char const*, bool> expect_from_str_to_bool[] =
+{
+ { "0", false },
+ { "1", true },
+ { 0, 0 }
+};
+
+static void tobool_tests()
+{
+ input_output<char const *, bool> const * cur;
+ for (cur = expect_from_str_to_bool; cur->input; ++cur) {
+ bool result = op_lexical_cast<bool>(cur->input);
+ check_result("op_lexical_cast()", cur->input, cur->output,
+ result);
+ }
+}
+
+// FIXME: more op_lexical_cast<> tests
+
+int main()
+{
+ erase_to_last_of_tests();
+ tostr_tests();
+ touint_tests();
+ tobool_tests();
+ split_tests();
+ is_prefix_tests();
+ separate_token_tests();
+ rtrim_tests();
+ ltrim_tests();
+ trim_tests();
+ format_percent_tests();
+ return EXIT_SUCCESS;
+}
diff --git a/libutil++/tests/utility_tests.cpp b/libutil++/tests/utility_tests.cpp
new file mode 100644
index 0000000..8de000f
--- /dev/null
+++ b/libutil++/tests/utility_tests.cpp
@@ -0,0 +1,118 @@
+/**
+ * @file utility_tests.cpp
+ * tests utility.h and op_exception.h
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include <stdlib.h>
+#include <new>
+#include <iostream>
+
+#include "utility.h"
+#include "op_exception.h"
+
+using namespace std;
+
+static int nb_new;
+static int nb_new_array;
+
+void* operator new(size_t size) throw(bad_alloc)
+{
+ nb_new++;
+ return malloc(size);
+}
+
+void* operator new[](size_t size) throw(bad_alloc)
+{
+ nb_new_array++;
+ return malloc(size);
+}
+
+void operator delete(void * p) throw()
+{
+ nb_new--;
+ if (p)
+ free(p);
+}
+
+void operator delete[](void * p) throw()
+{
+ nb_new_array--;
+ if (p)
+ free(p);
+}
+
+
+void check_alloc()
+{
+ if (nb_new) {
+ cerr << "new(size_t) leak\n";
+ exit(EXIT_FAILURE);
+ }
+
+ if (nb_new_array) {
+ cerr << "new[](size_t) leak\n";
+ exit(EXIT_FAILURE);
+ }
+}
+
+
+struct A {};
+
+template <typename Throw, typename Catch>
+void throw_tests()
+{
+ scoped_ptr<A> a(new A);
+ try {
+ scoped_ptr<A> a(new A);
+ throw Throw("");
+ }
+ catch (Catch const &) {
+ }
+}
+
+
+template <typename Throw, typename Catch>
+void throw_tests(bool)
+{
+ scoped_array<A> b(new A[10]);
+ try {
+ scoped_array<A> a(new A[10]);
+ throw Throw("");
+ }
+ catch (Catch const &) {
+ }
+}
+
+
+void tests_new()
+{
+ throw_tests<op_fatal_error, op_fatal_error>();
+ throw_tests<op_fatal_error, op_exception>();
+ throw_tests<op_runtime_error, op_runtime_error>();
+ throw_tests<op_runtime_error, runtime_error>();
+ throw_tests<op_fatal_error, op_fatal_error>(true);
+ throw_tests<op_fatal_error, op_exception>(true);
+ throw_tests<op_runtime_error, op_runtime_error>(true);
+ throw_tests<op_runtime_error, runtime_error>(true);
+}
+
+
+int main()
+{
+ try {
+ tests_new();
+ check_alloc();
+ }
+ catch (...) {
+ cerr << "unknown exception\n";
+ return EXIT_FAILURE;
+ }
+
+ return EXIT_SUCCESS;
+}
diff --git a/libutil++/unique_storage.h b/libutil++/unique_storage.h
new file mode 100644
index 0000000..643c6ee
--- /dev/null
+++ b/libutil++/unique_storage.h
@@ -0,0 +1,110 @@
+/**
+ * @file unique_storage.h
+ * Unique storage of values
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#ifndef UNIQUE_STORAGE_H
+#define UNIQUE_STORAGE_H
+
+#include <vector>
+#include <map>
+#include <stdexcept>
+
+/**
+ * Store values such that only one copy of the value
+ * is ever stored.
+ *
+ * I is an arbitrary typename that's never
+ * used.
+ *
+ * It is a required parameter in order to enforce
+ * type-safety for a collection.
+ *
+ * The value type "V" must be default-constructible,
+ * and this is the value returned by a stored id_value
+ * where .set() is false
+ */
+template <typename I, typename V> class unique_storage {
+
+public:
+ unique_storage() {
+ // id 0
+ values.push_back(V());
+ }
+
+ virtual ~unique_storage() {}
+
+ typedef std::vector<V> stored_values;
+
+ /// the actual ID type
+ struct id_value {
+ /// id == 0 means "empty" / "undefined"
+ id_value() : id(0) {}
+
+ /// does this ID map to a non-default value ?
+ bool set() const {
+ return id;
+ }
+
+ bool operator<(id_value const & rhs) const {
+ return id < rhs.id;
+ }
+
+ bool operator==(id_value const & rhs) const {
+ return id == rhs.id;
+ }
+
+ bool operator!=(id_value const & rhs) const {
+ return !(id == rhs.id);
+ }
+
+ private:
+ friend class unique_storage<I, V>;
+
+ typedef typename stored_values::size_type size_type;
+
+ explicit id_value(size_type s) : id(s) {}
+
+ /// actual ID value
+ size_type id;
+ };
+
+
+ /// ensure this value is available
+ id_value const create(V const & value) {
+ typename id_map::value_type val(value, id_value(values.size()));
+ std::pair<typename id_map::iterator, bool>
+ inserted = ids.insert(val);
+ if (inserted.second)
+ values.push_back(value);
+
+ return inserted.first->second;
+ }
+
+
+ /// return the stored value for the given ID
+ V const & get(id_value const & id) const {
+ // some stl lack at(), so we emulate it
+ if (id.id < values.size())
+ return values[id.id];
+
+ throw std::out_of_range("unique_storage::get(): out of bounds");
+ }
+
+private:
+ typedef std::map<V, id_value> id_map;
+
+ /// the contained values
+ stored_values values;
+
+ /// map from ID to value
+ id_map ids;
+};
+
+#endif /* !UNIQUE_STORAGE_H */
diff --git a/libutil++/utility.h b/libutil++/utility.h
new file mode 100644
index 0000000..83c36ca
--- /dev/null
+++ b/libutil++/utility.h
@@ -0,0 +1,102 @@
+/**
+ * @file utility.h
+ * General purpose C++ utility
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#ifndef UTILITY_H
+#define UTILITY_H
+
+#include <cstddef>
+
+/** noncopyable : object of class derived from this class can't be copied
+ * and isn't copy-constructible */
+class noncopyable {
+protected:
+ noncopyable() {}
+ ~noncopyable() {}
+private:
+ noncopyable(noncopyable const &);
+ noncopyable const & operator=(noncopyable const &);
+};
+
+
+template<typename T> class scoped_ptr {
+public:
+ explicit scoped_ptr(T * p = 0) : p_(p) {}
+ ~scoped_ptr() { delete p_; }
+
+ void reset(T * p = 0) {
+ if (p == p_)
+ return;
+ delete p_;
+ p_ = p;
+ }
+
+ T & operator*() const { return *p_; }
+ T * operator->() const { return p_; }
+ T * get() const { return p_; }
+
+ void swap(scoped_ptr & sp) {
+ T * tmp = sp.p_;
+ sp.p_ = p_;
+ p_ = tmp;
+ }
+
+private:
+ scoped_ptr & operator=(scoped_ptr const &);
+ scoped_ptr(scoped_ptr const &);
+ T * p_;
+};
+
+template<typename T> class scoped_array {
+public:
+ explicit scoped_array(T * p = 0) : p_(p) {}
+ ~scoped_array() { delete [] p_; }
+
+ void reset(T * p = 0) {
+ if (p == p_)
+ return;
+ delete [] p_;
+ p_ = p;
+ }
+
+ T & operator[](std::ptrdiff_t i) const { return p_[i]; }
+ T * get() const { return p_; }
+
+ void swap(scoped_array & sp) {
+ T * tmp = sp.p_;
+ sp.p_ = p_;
+ p_ = tmp;
+ }
+
+private:
+ scoped_array & operator=(scoped_array const &);
+ scoped_array(scoped_array const &);
+ T * p_;
+};
+
+/**
+ * @param count
+ * @param total
+ *
+ * return total == 0 ? 1.0 : (count / total);
+ */
+inline double op_ratio(double count, double total)
+{
+ return total == 0 ? 0.0 : (count / total);
+}
+
+// Part copyright:
+// (C) Copyright boost.org 1999. Permission to copy, use, modify, sell
+// and distribute this software is granted provided this copyright
+// notice appears in all copies. This software is provided "as is" without
+// express or implied warranty, and with no claim as to its suitability for
+// any purpose.
+
+#endif /* !UTILITY_H */
diff --git a/libutil++/xml_output.cpp b/libutil++/xml_output.cpp
new file mode 100644
index 0000000..080c2a8
--- /dev/null
+++ b/libutil++/xml_output.cpp
@@ -0,0 +1,82 @@
+/**
+ * @file xml_output.cpp
+ * utility routines for writing XML
+ *
+ * @remark Copyright 2006 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Dave Nomura
+ */
+
+#include <sstream>
+#include <iostream>
+
+#include "op_xml_out.h"
+#include "xml_output.h"
+
+using namespace std;
+
+#define MAX_XML_BUF 16384
+static char buf[MAX_XML_BUF];
+
+string tag_name(tag_t tag)
+{
+ ostringstream out;
+ out << xml_tag_name(tag);
+ return out.str();
+}
+
+
+string open_element(tag_t tag, bool with_attrs)
+{
+ ostringstream out;
+
+ buf[0] = '\0';
+ open_xml_element(tag, with_attrs, buf, MAX_XML_BUF);
+ out << buf;
+ return out.str();
+}
+
+
+string close_element(tag_t tag, bool has_nested)
+{
+ ostringstream out;
+
+ buf[0] = '\0';
+ close_xml_element(tag, has_nested, buf, MAX_XML_BUF);
+ out << buf;
+ return out.str();
+}
+
+
+string init_attr(tag_t attr, size_t value)
+{
+ ostringstream out;
+
+ buf[0] = '\0';
+ init_xml_int_attr(attr, value, buf, MAX_XML_BUF);
+ out << buf;
+ return out.str();
+}
+
+
+string init_attr(tag_t attr, double value)
+{
+ ostringstream out;
+
+ buf[0] = '\0';
+ init_xml_dbl_attr(attr, value, buf, MAX_XML_BUF);
+ out << buf;
+ return out.str();
+}
+
+
+string init_attr(tag_t attr, string const & str)
+{
+ ostringstream out;
+
+ buf[0] = '\0';
+ init_xml_str_attr(attr, str.c_str(), buf, MAX_XML_BUF);
+ out << buf;
+ return out.str();
+}
diff --git a/libutil++/xml_output.h b/libutil++/xml_output.h
new file mode 100644
index 0000000..a8936cd
--- /dev/null
+++ b/libutil++/xml_output.h
@@ -0,0 +1,22 @@
+/**
+ * @file xml_output.h
+ * utility routines for writing XML
+ *
+ * @remark Copyright 2006 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Dave Nomura
+ */
+
+#ifndef XML_OUTPUT_H
+#define XML_OUTPUT_H
+#include "op_xml_out.h"
+
+std::string tag_name(tag_t tag);
+std::string open_element(tag_t tag, bool with_attrs = false);
+std::string close_element(tag_t tag = NONE, bool has_nested = false);
+std::string init_attr(tag_t attr, size_t value);
+std::string init_attr(tag_t attr, double value);
+std::string init_attr(tag_t attr, std::string const & str);
+
+#endif /* XML_OUTPUT_H */
diff --git a/libutil/Makefile.am b/libutil/Makefile.am
new file mode 100644
index 0000000..cf19f12
--- /dev/null
+++ b/libutil/Makefile.am
@@ -0,0 +1,31 @@
+SUBDIRS = . tests
+
+AM_CPPFLAGS=-I ${top_srcdir}/libop
+AM_CFLAGS = @OP_CFLAGS@
+
+noinst_LIBRARIES = libutil.a
+libutil_a_SOURCES = \
+ op_deviceio.c \
+ op_lockfile.c \
+ op_file.c \
+ op_fileio.c \
+ op_get_time.c \
+ op_libiberty.c \
+ op_popt.c \
+ op_string.c \
+ op_cpufreq.c \
+ op_deviceio.h \
+ op_fileio.h \
+ op_libiberty.h \
+ op_lockfile.h \
+ op_types.h \
+ op_file.h \
+ op_get_time.h \
+ op_list.h \
+ op_popt.h \
+ op_string.h \
+ op_cpufreq.h \
+ op_version.c \
+ op_version.h \
+ op_growable_buffer.c \
+ op_growable_buffer.h
diff --git a/libutil/Makefile.in b/libutil/Makefile.in
new file mode 100644
index 0000000..3f70971
--- /dev/null
+++ b/libutil/Makefile.in
@@ -0,0 +1,627 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = libutil
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/binutils.m4 \
+ $(top_srcdir)/m4/builtinexpect.m4 \
+ $(top_srcdir)/m4/cellspubfdsupport.m4 \
+ $(top_srcdir)/m4/compileroption.m4 \
+ $(top_srcdir)/m4/configmodule.m4 \
+ $(top_srcdir)/m4/copyifchange.m4 $(top_srcdir)/m4/docbook.m4 \
+ $(top_srcdir)/m4/extradirs.m4 $(top_srcdir)/m4/findkernel.m4 \
+ $(top_srcdir)/m4/kerneloption.m4 \
+ $(top_srcdir)/m4/kernelversion.m4 \
+ $(top_srcdir)/m4/mallocattribute.m4 \
+ $(top_srcdir)/m4/poptconst.m4 \
+ $(top_srcdir)/m4/precompiledheader.m4 $(top_srcdir)/m4/qt.m4 \
+ $(top_srcdir)/m4/resultyn.m4 $(top_srcdir)/m4/sstream.m4 \
+ $(top_srcdir)/m4/typedef.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+ARFLAGS = cru
+libutil_a_AR = $(AR) $(ARFLAGS)
+libutil_a_LIBADD =
+am_libutil_a_OBJECTS = op_deviceio.$(OBJEXT) op_lockfile.$(OBJEXT) \
+ op_file.$(OBJEXT) op_fileio.$(OBJEXT) op_get_time.$(OBJEXT) \
+ op_libiberty.$(OBJEXT) op_popt.$(OBJEXT) op_string.$(OBJEXT) \
+ op_cpufreq.$(OBJEXT) op_version.$(OBJEXT) \
+ op_growable_buffer.$(OBJEXT)
+libutil_a_OBJECTS = $(am_libutil_a_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libutil_a_SOURCES)
+DIST_SOURCES = $(libutil_a_SOURCES)
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-exec-recursive install-info-recursive \
+ install-recursive installcheck-recursive installdirs-recursive \
+ pdf-recursive ps-recursive uninstall-info-recursive \
+ uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFD_LIBS = @BFD_LIBS@
+BUILD_JVMPI_AGENT_FALSE = @BUILD_JVMPI_AGENT_FALSE@
+BUILD_JVMPI_AGENT_TRUE = @BUILD_JVMPI_AGENT_TRUE@
+BUILD_JVMTI_AGENT_FALSE = @BUILD_JVMTI_AGENT_FALSE@
+BUILD_JVMTI_AGENT_TRUE = @BUILD_JVMTI_AGENT_TRUE@
+CAT_ENTRY_END = @CAT_ENTRY_END@
+CAT_ENTRY_START = @CAT_ENTRY_START@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOCBOOK_ROOT = @DOCBOOK_ROOT@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+EXTRA_CFLAGS_MODULE = @EXTRA_CFLAGS_MODULE@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAVA_HOMEDIR = @JAVA_HOMEDIR@
+KINC = @KINC@
+KSRC = @KSRC@
+KVERS = @KVERS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBERTY_LIBS = @LIBERTY_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MOC = @MOC@
+MODINSTALLDIR = @MODINSTALLDIR@
+OBJEXT = @OBJEXT@
+OPROFILE_DIR = @OPROFILE_DIR@
+OPROFILE_MODULE_ARCH = @OPROFILE_MODULE_ARCH@
+OP_CFLAGS = @OP_CFLAGS@
+OP_CXXFLAGS = @OP_CXXFLAGS@
+OP_DOCDIR = @OP_DOCDIR@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POPT_LIBS = @POPT_LIBS@
+PTRDIFF_T_TYPE = @PTRDIFF_T_TYPE@
+QT_INCLUDES = @QT_INCLUDES@
+QT_LDFLAGS = @QT_LDFLAGS@
+QT_LIB = @QT_LIB@
+QT_VERSION = @QT_VERSION@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIZE_T_TYPE = @SIZE_T_TYPE@
+STRIP = @STRIP@
+UIC = @UIC@
+VERSION = @VERSION@
+XML_CATALOG = @XML_CATALOG@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+have_qt_FALSE = @have_qt_FALSE@
+have_qt_TRUE = @have_qt_TRUE@
+have_xsltproc_FALSE = @have_xsltproc_FALSE@
+have_xsltproc_TRUE = @have_xsltproc_TRUE@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+kernel_support_FALSE = @kernel_support_FALSE@
+kernel_support_TRUE = @kernel_support_TRUE@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+topdir = @topdir@
+SUBDIRS = . tests
+AM_CPPFLAGS = -I ${top_srcdir}/libop
+AM_CFLAGS = @OP_CFLAGS@
+noinst_LIBRARIES = libutil.a
+libutil_a_SOURCES = \
+ op_deviceio.c \
+ op_lockfile.c \
+ op_file.c \
+ op_fileio.c \
+ op_get_time.c \
+ op_libiberty.c \
+ op_popt.c \
+ op_string.c \
+ op_cpufreq.c \
+ op_deviceio.h \
+ op_fileio.h \
+ op_libiberty.h \
+ op_lockfile.h \
+ op_types.h \
+ op_file.h \
+ op_get_time.h \
+ op_list.h \
+ op_popt.h \
+ op_string.h \
+ op_cpufreq.h \
+ op_version.c \
+ op_version.h \
+ op_growable_buffer.c \
+ op_growable_buffer.h
+
+all: all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libutil/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign libutil/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLIBRARIES:
+ -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+libutil.a: $(libutil_a_OBJECTS) $(libutil_a_DEPENDENCIES)
+ -rm -f libutil.a
+ $(libutil_a_AR) libutil.a $(libutil_a_OBJECTS) $(libutil_a_LIBADD)
+ $(RANLIB) libutil.a
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/op_cpufreq.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/op_deviceio.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/op_file.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/op_fileio.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/op_get_time.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/op_growable_buffer.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/op_libiberty.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/op_lockfile.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/op_popt.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/op_string.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/op_version.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(mkdir_p) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(LIBRARIES)
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+ clean clean-generic clean-libtool clean-noinstLIBRARIES \
+ clean-recursive ctags ctags-recursive distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-recursive distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-exec install-exec-am install-info \
+ install-info-am install-man install-strip installcheck \
+ installcheck-am installdirs installdirs-am maintainer-clean \
+ maintainer-clean-generic maintainer-clean-recursive \
+ mostlyclean mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \
+ tags tags-recursive uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/libutil/op_cpufreq.c b/libutil/op_cpufreq.c
index c95cb58..78a6333 100644
--- a/libutil/op_cpufreq.c
+++ b/libutil/op_cpufreq.c
@@ -51,11 +51,6 @@ double op_cpu_frequency(void)
fval = uval / 1E6;
break;
}
- /* mips including loongson2 */
- if (sscanf(line, "BogoMIPS : %lu", &uval) == 1) {
- fval = uval * 3 / 2;
- break;
- }
/* s390 doesn't provide cpu freq, checked up to 2.6-test4 */
free(line);
diff --git a/libutil/tests/Makefile.am b/libutil/tests/Makefile.am
new file mode 100644
index 0000000..6fa360e
--- /dev/null
+++ b/libutil/tests/Makefile.am
@@ -0,0 +1,15 @@
+AM_CPPFLAGS = \
+ -I ${top_srcdir}/libutil
+
+AM_CFLAGS = @OP_CFLAGS@
+
+LIBS = @LIBERTY_LIBS@
+
+check_PROGRAMS = file_tests string_tests
+
+file_tests_SOURCES = file_tests.c
+file_tests_LDADD = ../libutil.a
+string_tests_SOURCES = string_tests.c
+string_tests_LDADD = ../libutil.a
+
+TESTS = ${check_PROGRAMS}
diff --git a/libutil/tests/Makefile.in b/libutil/tests/Makefile.in
new file mode 100644
index 0000000..c334a88
--- /dev/null
+++ b/libutil/tests/Makefile.in
@@ -0,0 +1,563 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+check_PROGRAMS = file_tests$(EXEEXT) string_tests$(EXEEXT)
+subdir = libutil/tests
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/binutils.m4 \
+ $(top_srcdir)/m4/builtinexpect.m4 \
+ $(top_srcdir)/m4/cellspubfdsupport.m4 \
+ $(top_srcdir)/m4/compileroption.m4 \
+ $(top_srcdir)/m4/configmodule.m4 \
+ $(top_srcdir)/m4/copyifchange.m4 $(top_srcdir)/m4/docbook.m4 \
+ $(top_srcdir)/m4/extradirs.m4 $(top_srcdir)/m4/findkernel.m4 \
+ $(top_srcdir)/m4/kerneloption.m4 \
+ $(top_srcdir)/m4/kernelversion.m4 \
+ $(top_srcdir)/m4/mallocattribute.m4 \
+ $(top_srcdir)/m4/poptconst.m4 \
+ $(top_srcdir)/m4/precompiledheader.m4 $(top_srcdir)/m4/qt.m4 \
+ $(top_srcdir)/m4/resultyn.m4 $(top_srcdir)/m4/sstream.m4 \
+ $(top_srcdir)/m4/typedef.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am_file_tests_OBJECTS = file_tests.$(OBJEXT)
+file_tests_OBJECTS = $(am_file_tests_OBJECTS)
+file_tests_DEPENDENCIES = ../libutil.a
+am_string_tests_OBJECTS = string_tests.$(OBJEXT)
+string_tests_OBJECTS = $(am_string_tests_OBJECTS)
+string_tests_DEPENDENCIES = ../libutil.a
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(file_tests_SOURCES) $(string_tests_SOURCES)
+DIST_SOURCES = $(file_tests_SOURCES) $(string_tests_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFD_LIBS = @BFD_LIBS@
+BUILD_JVMPI_AGENT_FALSE = @BUILD_JVMPI_AGENT_FALSE@
+BUILD_JVMPI_AGENT_TRUE = @BUILD_JVMPI_AGENT_TRUE@
+BUILD_JVMTI_AGENT_FALSE = @BUILD_JVMTI_AGENT_FALSE@
+BUILD_JVMTI_AGENT_TRUE = @BUILD_JVMTI_AGENT_TRUE@
+CAT_ENTRY_END = @CAT_ENTRY_END@
+CAT_ENTRY_START = @CAT_ENTRY_START@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOCBOOK_ROOT = @DOCBOOK_ROOT@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+EXTRA_CFLAGS_MODULE = @EXTRA_CFLAGS_MODULE@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAVA_HOMEDIR = @JAVA_HOMEDIR@
+KINC = @KINC@
+KSRC = @KSRC@
+KVERS = @KVERS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBERTY_LIBS = @LIBERTY_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBERTY_LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MOC = @MOC@
+MODINSTALLDIR = @MODINSTALLDIR@
+OBJEXT = @OBJEXT@
+OPROFILE_DIR = @OPROFILE_DIR@
+OPROFILE_MODULE_ARCH = @OPROFILE_MODULE_ARCH@
+OP_CFLAGS = @OP_CFLAGS@
+OP_CXXFLAGS = @OP_CXXFLAGS@
+OP_DOCDIR = @OP_DOCDIR@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POPT_LIBS = @POPT_LIBS@
+PTRDIFF_T_TYPE = @PTRDIFF_T_TYPE@
+QT_INCLUDES = @QT_INCLUDES@
+QT_LDFLAGS = @QT_LDFLAGS@
+QT_LIB = @QT_LIB@
+QT_VERSION = @QT_VERSION@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIZE_T_TYPE = @SIZE_T_TYPE@
+STRIP = @STRIP@
+UIC = @UIC@
+VERSION = @VERSION@
+XML_CATALOG = @XML_CATALOG@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+have_qt_FALSE = @have_qt_FALSE@
+have_qt_TRUE = @have_qt_TRUE@
+have_xsltproc_FALSE = @have_xsltproc_FALSE@
+have_xsltproc_TRUE = @have_xsltproc_TRUE@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+kernel_support_FALSE = @kernel_support_FALSE@
+kernel_support_TRUE = @kernel_support_TRUE@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+topdir = @topdir@
+AM_CPPFLAGS = \
+ -I ${top_srcdir}/libutil
+
+AM_CFLAGS = @OP_CFLAGS@
+file_tests_SOURCES = file_tests.c
+file_tests_LDADD = ../libutil.a
+string_tests_SOURCES = string_tests.c
+string_tests_LDADD = ../libutil.a
+TESTS = ${check_PROGRAMS}
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libutil/tests/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign libutil/tests/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-checkPROGRAMS:
+ @list='$(check_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+file_tests$(EXEEXT): $(file_tests_OBJECTS) $(file_tests_DEPENDENCIES)
+ @rm -f file_tests$(EXEEXT)
+ $(LINK) $(file_tests_LDFLAGS) $(file_tests_OBJECTS) $(file_tests_LDADD) $(LIBS)
+string_tests$(EXEEXT): $(string_tests_OBJECTS) $(string_tests_DEPENDENCIES)
+ @rm -f string_tests$(EXEEXT)
+ $(LINK) $(string_tests_LDFLAGS) $(string_tests_OBJECTS) $(string_tests_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file_tests.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/string_tests.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+check-TESTS: $(TESTS)
+ @failed=0; all=0; xfail=0; xpass=0; skip=0; \
+ srcdir=$(srcdir); export srcdir; \
+ list='$(TESTS)'; \
+ if test -n "$$list"; then \
+ for tst in $$list; do \
+ if test -f ./$$tst; then dir=./; \
+ elif test -f $$tst; then dir=; \
+ else dir="$(srcdir)/"; fi; \
+ if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *" $$tst "*) \
+ xpass=`expr $$xpass + 1`; \
+ failed=`expr $$failed + 1`; \
+ echo "XPASS: $$tst"; \
+ ;; \
+ *) \
+ echo "PASS: $$tst"; \
+ ;; \
+ esac; \
+ elif test $$? -ne 77; then \
+ all=`expr $$all + 1`; \
+ case " $(XFAIL_TESTS) " in \
+ *" $$tst "*) \
+ xfail=`expr $$xfail + 1`; \
+ echo "XFAIL: $$tst"; \
+ ;; \
+ *) \
+ failed=`expr $$failed + 1`; \
+ echo "FAIL: $$tst"; \
+ ;; \
+ esac; \
+ else \
+ skip=`expr $$skip + 1`; \
+ echo "SKIP: $$tst"; \
+ fi; \
+ done; \
+ if test "$$failed" -eq 0; then \
+ if test "$$xfail" -eq 0; then \
+ banner="All $$all tests passed"; \
+ else \
+ banner="All $$all tests behaved as expected ($$xfail expected failures)"; \
+ fi; \
+ else \
+ if test "$$xpass" -eq 0; then \
+ banner="$$failed of $$all tests failed"; \
+ else \
+ banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \
+ fi; \
+ fi; \
+ dashes="$$banner"; \
+ skipped=""; \
+ if test "$$skip" -ne 0; then \
+ skipped="($$skip tests were not run)"; \
+ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$skipped"; \
+ fi; \
+ report=""; \
+ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+ report="Please report to $(PACKAGE_BUGREPORT)"; \
+ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+ dashes="$$report"; \
+ fi; \
+ dashes=`echo "$$dashes" | sed s/./=/g`; \
+ echo "$$dashes"; \
+ echo "$$banner"; \
+ test -z "$$skipped" || echo "$$skipped"; \
+ test -z "$$report" || echo "$$report"; \
+ echo "$$dashes"; \
+ test "$$failed" -eq 0; \
+ else :; fi
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+ $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
+ $(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
+ clean-checkPROGRAMS clean-generic clean-libtool ctags \
+ distclean distclean-compile distclean-generic \
+ distclean-libtool distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-data \
+ install-data-am install-exec install-exec-am install-info \
+ install-info-am install-man install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/libutil/tests/file_tests.c b/libutil/tests/file_tests.c
new file mode 100644
index 0000000..052abdb
--- /dev/null
+++ b/libutil/tests/file_tests.c
@@ -0,0 +1,69 @@
+/**
+ * @file file_tests.c
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include "op_file.h"
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include <limits.h>
+
+static char * tests[][2] = {
+ { "/usr/bin/../bin", "/usr/bin" },
+ { "/../usr/bin/", "/usr/bin" },
+ { "/../../usr/bin/", "/usr/bin" },
+ { "/../../usr/bin/.", "/usr/bin" },
+ { "/../../usr/bin/./", "/usr/bin" },
+ { "/usr/./bin", "/usr/bin" },
+ { "/usr/././bin", "/usr/bin" },
+ { "/usr///", "/usr" },
+ { "../", "/" },
+ { "./", "/usr" },
+ { ".", "/usr" },
+ { "./../", "/" },
+ { "bin/../bin/../", "/usr" },
+ { "../../../../../", "/" },
+ { "/usr/bin/../../..", "/" },
+ { "/usr/bin/../../../", "/" },
+ { "././.", "/usr" },
+ /* POSIX namespace ignored by realpath(3) */
+ { "//", "/" },
+ { "//usr", "/usr" },
+ { "///", "/" },
+ { NULL, NULL },
+};
+
+int main(void)
+{
+ char tmp[PATH_MAX];
+ size_t i = 0;
+
+ if (chdir("/usr")) {
+ fprintf(stderr, "chdir(\"/usr\") failed for %s\n", tests[i][0]);
+ exit(EXIT_FAILURE);
+ }
+
+ while (tests[i][0]) {
+ if (!realpath(tests[i][0], tmp)) {
+ fprintf(stderr, "NULL return for %s\n", tests[i][0]);
+ exit(EXIT_FAILURE);
+ }
+
+ if (strcmp(tmp, tests[i][1])) {
+ fprintf(stderr, "%s does not match %s given %s\n",
+ tmp, tests[i][1], tests[i][0]);
+ exit(EXIT_FAILURE);
+ }
+ ++i;
+ }
+
+ return EXIT_SUCCESS;
+}
diff --git a/libutil/tests/string_tests.c b/libutil/tests/string_tests.c
new file mode 100644
index 0000000..b2132cf
--- /dev/null
+++ b/libutil/tests/string_tests.c
@@ -0,0 +1,91 @@
+/**
+ * @file string_tests.c
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include "op_string.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+void error(char const * str)
+{
+ fprintf(stderr, "%s\n", str);
+ exit(EXIT_FAILURE);
+}
+
+
+int main()
+{
+ if (!strisprefix("", ""))
+ error("\"\" is not a prefix of \"\"");
+ if (!strisprefix("a", ""))
+ error("\"\" is not a prefix of a");
+ if (!strisprefix("a", "a"))
+ error("a is not a prefix of a");
+ if (!strisprefix("aa", "a"))
+ error("a is not a prefix of aa");
+ if (strisprefix("a", "b"))
+ error("b is a prefix of a");
+
+ if (strcmp(skip_ws(""), ""))
+ error("skip_ws of \"\" is not \"\"");
+ if (strcmp(skip_ws("\na"), "a"))
+ error("skip_ws of \\na is not a");
+ if (strcmp(skip_ws("\n\na"), "a"))
+ error("skip_ws of \\n\\na is not a");
+ if (strcmp(skip_ws("\n a"), "a"))
+ error("skip_ws of \\n a is not a");
+ if (strcmp(skip_ws("\n \ta"), "a"))
+ error("skip_ws of \\n \\ta is not a");
+ if (strcmp(skip_ws("\n \t"), ""))
+ error("skip_ws of \\n \\t is not \"\"");
+ if (strcmp(skip_ws(" "), ""))
+ error("skip_ws of \" \" is not \"\"");
+
+ if (strcmp(skip_nonws(""), ""))
+ error("skip_nonws of \"\" is not \"\"");
+ if (strcmp(skip_nonws("a"), ""))
+ error("skip_nonws of a is not \"\"");
+ if (strcmp(skip_nonws("\n"), "\n"))
+ error("skip_nonws of \\n is not \\n");
+ if (strcmp(skip_nonws(" "), " "))
+ error("skip_nonws of \" \" is not \" \"");
+ if (strcmp(skip_nonws("\t"), "\t"))
+ error("skip_nonws of \\t is not \\t");
+ if (strcmp(skip_nonws("a\n"), "\n"))
+ error("skip_nonws of a\\n is not \\n");
+ if (strcmp(skip_nonws("ab"), ""))
+ error("skip_nonws of ab is not \"\"");
+
+ if (!empty_line(""))
+ error("empty_line is false for \"\"");
+ if (!empty_line("\n\t "))
+ error("empty_line is false for \"\\n\\n \"");
+ if (!empty_line(" "))
+ error("empty_line is false for \" \"");
+ if (empty_line("\r"))
+ error("empty_line is true for \\r");
+
+ if (comment_line(""))
+ error("comment_line is true for \"\"");
+ if (comment_line("\n"))
+ error("comment_line is true for \n");
+ if (!comment_line("#"))
+ error("comment_line is false for #");
+ if (!comment_line(" #"))
+ error("comment_line is false for \" #\"");
+ /* this is what the spec says */
+ if (!comment_line("\n#"))
+ error("comment_line is false for \\n#");
+ if (!comment_line("\t#"))
+ error("comment_line is false for \\t#");
+
+ return EXIT_SUCCESS;
+}
diff --git a/ltmain.sh b/ltmain.sh
new file mode 100644
index 0000000..27d498a
--- /dev/null
+++ b/ltmain.sh
@@ -0,0 +1,6956 @@
+# ltmain.sh - Provide generalized library-building support services.
+# NOTE: Changing this file will not affect anything until you rerun configure.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
+# 2007, 2008 Free Software Foundation, Inc.
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+basename="s,^.*/,,g"
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath="$0"
+
+# The name of this program:
+progname=`echo "$progpath" | $SED $basename`
+modename="$progname"
+
+# Global variables:
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+
+PROGRAM=ltmain.sh
+PACKAGE=libtool
+VERSION=1.5.26
+TIMESTAMP=" (1.1220.2.492 2008/01/30 06:40:56)"
+
+# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Check that we have a working $echo.
+if test "X$1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+elif test "X$1" = X--fallback-echo; then
+ # Avoid inline document here, it may be left over
+ :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
+ # Yippee, $echo works!
+ :
+else
+ # Restart under the correct shell, and then maybe $echo will work.
+ exec $SHELL "$progpath" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<EOF
+$*
+EOF
+ exit $EXIT_SUCCESS
+fi
+
+default_mode=
+help="Try \`$progname --help' for more information."
+magic="%%%MAGIC variable%%%"
+mkdir="mkdir"
+mv="mv -f"
+rm="rm -f"
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed="${SED}"' -e 1s/^X//'
+sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+ # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+ SP2NL='tr \040 \012'
+ NL2SP='tr \015\012 \040\040'
+ ;;
+ *) # EBCDIC based system
+ SP2NL='tr \100 \n'
+ NL2SP='tr \r\n \100\100'
+ ;;
+esac
+
+# NLS nuisances.
+# Only set LANG and LC_ALL to C if already set.
+# These must not be set unconditionally because not all systems understand
+# e.g. LANG=C (notably SCO).
+# We save the old values to restore during execute mode.
+lt_env=
+for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+do
+ eval "if test \"\${$lt_var+set}\" = set; then
+ save_$lt_var=\$$lt_var
+ lt_env=\"$lt_var=\$$lt_var \$lt_env\"
+ $lt_var=C
+ export $lt_var
+ fi"
+done
+
+if test -n "$lt_env"; then
+ lt_env="env $lt_env"
+fi
+
+# Make sure IFS has a sensible default
+lt_nl='
+'
+IFS=" $lt_nl"
+
+if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+ $echo "$modename: not configured to build any kind of library" 1>&2
+ $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
+ exit $EXIT_FAILURE
+fi
+
+# Global variables.
+mode=$default_mode
+nonopt=
+prev=
+prevopt=
+run=
+show="$echo"
+show_help=
+execute_dlfiles=
+duplicate_deps=no
+preserve_args=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+extracted_archives=
+extracted_serial=0
+
+#####################################
+# Shell function definitions:
+# This seems to be the best place for them
+
+# func_mktempdir [string]
+# Make a temporary directory that won't clash with other running
+# libtool processes, and avoids race conditions if possible. If
+# given, STRING is the basename for that directory.
+func_mktempdir ()
+{
+ my_template="${TMPDIR-/tmp}/${1-$progname}"
+
+ if test "$run" = ":"; then
+ # Return a directory name, but don't create it in dry-run mode
+ my_tmpdir="${my_template}-$$"
+ else
+
+ # If mktemp works, use that first and foremost
+ my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
+
+ if test ! -d "$my_tmpdir"; then
+ # Failing that, at least try and use $RANDOM to avoid a race
+ my_tmpdir="${my_template}-${RANDOM-0}$$"
+
+ save_mktempdir_umask=`umask`
+ umask 0077
+ $mkdir "$my_tmpdir"
+ umask $save_mktempdir_umask
+ fi
+
+ # If we're not in dry-run mode, bomb out on failure
+ test -d "$my_tmpdir" || {
+ $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2
+ exit $EXIT_FAILURE
+ }
+ fi
+
+ $echo "X$my_tmpdir" | $Xsed
+}
+
+
+# func_win32_libid arg
+# return the library type of file 'arg'
+#
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+func_win32_libid ()
+{
+ win32_libid_type="unknown"
+ win32_fileres=`file -L $1 2>/dev/null`
+ case $win32_fileres in
+ *ar\ archive\ import\ library*) # definitely import
+ win32_libid_type="x86 archive import"
+ ;;
+ *ar\ archive*) # could be an import, or static
+ if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
+ $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
+ win32_nmres=`eval $NM -f posix -A $1 | \
+ $SED -n -e '1,100{
+ / I /{
+ s,.*,import,
+ p
+ q
+ }
+ }'`
+ case $win32_nmres in
+ import*) win32_libid_type="x86 archive import";;
+ *) win32_libid_type="x86 archive static";;
+ esac
+ fi
+ ;;
+ *DLL*)
+ win32_libid_type="x86 DLL"
+ ;;
+ *executable*) # but shell scripts are "executable" too...
+ case $win32_fileres in
+ *MS\ Windows\ PE\ Intel*)
+ win32_libid_type="x86 DLL"
+ ;;
+ esac
+ ;;
+ esac
+ $echo $win32_libid_type
+}
+
+
+# func_infer_tag arg
+# Infer tagged configuration to use if any are available and
+# if one wasn't chosen via the "--tag" command line option.
+# Only attempt this if the compiler in the base compile
+# command doesn't match the default compiler.
+# arg is usually of the form 'gcc ...'
+func_infer_tag ()
+{
+ if test -n "$available_tags" && test -z "$tagname"; then
+ CC_quoted=
+ for arg in $CC; do
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ arg="\"$arg\""
+ ;;
+ esac
+ CC_quoted="$CC_quoted $arg"
+ done
+ case $@ in
+ # Blanks in the command may have been stripped by the calling shell,
+ # but not from the CC environment variable when configure was run.
+ " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;;
+ # Blanks at the start of $base_compile will cause this to fail
+ # if we don't check for them as well.
+ *)
+ for z in $available_tags; do
+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
+ # Evaluate the configuration.
+ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+ CC_quoted=
+ for arg in $CC; do
+ # Double-quote args containing other shell metacharacters.
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ arg="\"$arg\""
+ ;;
+ esac
+ CC_quoted="$CC_quoted $arg"
+ done
+ case "$@ " in
+ " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*)
+ # The compiler in the base compile command matches
+ # the one in the tagged configuration.
+ # Assume this is the tagged configuration we want.
+ tagname=$z
+ break
+ ;;
+ esac
+ fi
+ done
+ # If $tagname still isn't set, then no tagged configuration
+ # was found and let the user know that the "--tag" command
+ # line option must be used.
+ if test -z "$tagname"; then
+ $echo "$modename: unable to infer tagged configuration"
+ $echo "$modename: specify a tag with \`--tag'" 1>&2
+ exit $EXIT_FAILURE
+# else
+# $echo "$modename: using $tagname tagged configuration"
+ fi
+ ;;
+ esac
+ fi
+}
+
+
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+ f_ex_an_ar_dir="$1"; shift
+ f_ex_an_ar_oldlib="$1"
+
+ $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)"
+ $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $?
+ if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2
+ exit $EXIT_FAILURE
+ fi
+}
+
+# func_extract_archives gentop oldlib ...
+func_extract_archives ()
+{
+ my_gentop="$1"; shift
+ my_oldlibs=${1+"$@"}
+ my_oldobjs=""
+ my_xlib=""
+ my_xabs=""
+ my_xdir=""
+ my_status=""
+
+ $show "${rm}r $my_gentop"
+ $run ${rm}r "$my_gentop"
+ $show "$mkdir $my_gentop"
+ $run $mkdir "$my_gentop"
+ my_status=$?
+ if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then
+ exit $my_status
+ fi
+
+ for my_xlib in $my_oldlibs; do
+ # Extract the objects.
+ case $my_xlib in
+ [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+ *) my_xabs=`pwd`"/$my_xlib" ;;
+ esac
+ my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
+ my_xlib_u=$my_xlib
+ while :; do
+ case " $extracted_archives " in
+ *" $my_xlib_u "*)
+ extracted_serial=`expr $extracted_serial + 1`
+ my_xlib_u=lt$extracted_serial-$my_xlib ;;
+ *) break ;;
+ esac
+ done
+ extracted_archives="$extracted_archives $my_xlib_u"
+ my_xdir="$my_gentop/$my_xlib_u"
+
+ $show "${rm}r $my_xdir"
+ $run ${rm}r "$my_xdir"
+ $show "$mkdir $my_xdir"
+ $run $mkdir "$my_xdir"
+ exit_status=$?
+ if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then
+ exit $exit_status
+ fi
+ case $host in
+ *-darwin*)
+ $show "Extracting $my_xabs"
+ # Do not bother doing anything if just a dry run
+ if test -z "$run"; then
+ darwin_orig_dir=`pwd`
+ cd $my_xdir || exit $?
+ darwin_archive=$my_xabs
+ darwin_curdir=`pwd`
+ darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'`
+ darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null`
+ if test -n "$darwin_arches"; then
+ darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'`
+ darwin_arch=
+ $show "$darwin_base_archive has multiple architectures $darwin_arches"
+ for darwin_arch in $darwin_arches ; do
+ mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+ lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
+ cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+ func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+ cd "$darwin_curdir"
+ $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+ done # $darwin_arches
+ ## Okay now we have a bunch of thin objects, gotta fatten them up :)
+ darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP`
+ darwin_file=
+ darwin_files=
+ for darwin_file in $darwin_filelist; do
+ darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP`
+ lipo -create -output "$darwin_file" $darwin_files
+ done # $darwin_filelist
+ ${rm}r unfat-$$
+ cd "$darwin_orig_dir"
+ else
+ cd "$darwin_orig_dir"
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ fi # $darwin_arches
+ fi # $run
+ ;;
+ *)
+ func_extract_an_archive "$my_xdir" "$my_xabs"
+ ;;
+ esac
+ my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+ done
+ func_extract_archives_result="$my_oldobjs"
+}
+# End of Shell function definitions
+#####################################
+
+# Darwin sucks
+eval std_shrext=\"$shrext_cmds\"
+
+disable_libs=no
+
+# Parse our command line options once, thoroughly.
+while test "$#" -gt 0
+do
+ arg="$1"
+ shift
+
+ case $arg in
+ -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) optarg= ;;
+ esac
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$prev"; then
+ case $prev in
+ execute_dlfiles)
+ execute_dlfiles="$execute_dlfiles $arg"
+ ;;
+ tag)
+ tagname="$arg"
+ preserve_args="${preserve_args}=$arg"
+
+ # Check whether tagname contains only valid characters
+ case $tagname in
+ *[!-_A-Za-z0-9,/]*)
+ $echo "$progname: invalid tag name: $tagname" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ esac
+
+ case $tagname in
+ CC)
+ # Don't test for the "default" C tag, as we know, it's there, but
+ # not specially marked.
+ ;;
+ *)
+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then
+ taglist="$taglist $tagname"
+ # Evaluate the configuration.
+ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`"
+ else
+ $echo "$progname: ignoring unknown tag $tagname" 1>&2
+ fi
+ ;;
+ esac
+ ;;
+ *)
+ eval "$prev=\$arg"
+ ;;
+ esac
+
+ prev=
+ prevopt=
+ continue
+ fi
+
+ # Have we seen a non-optional argument yet?
+ case $arg in
+ --help)
+ show_help=yes
+ ;;
+
+ --version)
+ echo "\
+$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP
+
+Copyright (C) 2008 Free Software Foundation, Inc.
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+ exit $?
+ ;;
+
+ --config)
+ ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath
+ # Now print the configurations for the tags.
+ for tagname in $taglist; do
+ ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath"
+ done
+ exit $?
+ ;;
+
+ --debug)
+ $echo "$progname: enabling shell trace mode"
+ set -x
+ preserve_args="$preserve_args $arg"
+ ;;
+
+ --dry-run | -n)
+ run=:
+ ;;
+
+ --features)
+ $echo "host: $host"
+ if test "$build_libtool_libs" = yes; then
+ $echo "enable shared libraries"
+ else
+ $echo "disable shared libraries"
+ fi
+ if test "$build_old_libs" = yes; then
+ $echo "enable static libraries"
+ else
+ $echo "disable static libraries"
+ fi
+ exit $?
+ ;;
+
+ --finish) mode="finish" ;;
+
+ --mode) prevopt="--mode" prev=mode ;;
+ --mode=*) mode="$optarg" ;;
+
+ --preserve-dup-deps) duplicate_deps="yes" ;;
+
+ --quiet | --silent)
+ show=:
+ preserve_args="$preserve_args $arg"
+ ;;
+
+ --tag)
+ prevopt="--tag"
+ prev=tag
+ preserve_args="$preserve_args --tag"
+ ;;
+ --tag=*)
+ set tag "$optarg" ${1+"$@"}
+ shift
+ prev=tag
+ preserve_args="$preserve_args --tag"
+ ;;
+
+ -dlopen)
+ prevopt="-dlopen"
+ prev=execute_dlfiles
+ ;;
+
+ -*)
+ $echo "$modename: unrecognized option \`$arg'" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+
+ *)
+ nonopt="$arg"
+ break
+ ;;
+ esac
+done
+
+if test -n "$prevopt"; then
+ $echo "$modename: option \`$prevopt' requires an argument" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+fi
+
+case $disable_libs in
+no)
+ ;;
+shared)
+ build_libtool_libs=no
+ build_old_libs=yes
+ ;;
+static)
+ build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
+ ;;
+esac
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end. This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+if test -z "$show_help"; then
+
+ # Infer the operation mode.
+ if test -z "$mode"; then
+ $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
+ $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2
+ case $nonopt in
+ *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
+ mode=link
+ for arg
+ do
+ case $arg in
+ -c)
+ mode=compile
+ break
+ ;;
+ esac
+ done
+ ;;
+ *db | *dbx | *strace | *truss)
+ mode=execute
+ ;;
+ *install*|cp|mv)
+ mode=install
+ ;;
+ *rm)
+ mode=uninstall
+ ;;
+ *)
+ # If we have no mode, but dlfiles were specified, then do execute mode.
+ test -n "$execute_dlfiles" && mode=execute
+
+ # Just use the default operation mode.
+ if test -z "$mode"; then
+ if test -n "$nonopt"; then
+ $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
+ else
+ $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
+ fi
+ fi
+ ;;
+ esac
+ fi
+
+ # Only execute mode is allowed to have -dlopen flags.
+ if test -n "$execute_dlfiles" && test "$mode" != execute; then
+ $echo "$modename: unrecognized option \`-dlopen'" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # Change the help message to a mode-specific one.
+ generic_help="$help"
+ help="Try \`$modename --help --mode=$mode' for more information."
+
+ # These modes are in order of execution frequency so that they run quickly.
+ case $mode in
+ # libtool compile mode
+ compile)
+ modename="$modename: compile"
+ # Get the compilation command and the source file.
+ base_compile=
+ srcfile="$nonopt" # always keep a non-empty value in "srcfile"
+ suppress_opt=yes
+ suppress_output=
+ arg_mode=normal
+ libobj=
+ later=
+
+ for arg
+ do
+ case $arg_mode in
+ arg )
+ # do not "continue". Instead, add this to base_compile
+ lastarg="$arg"
+ arg_mode=normal
+ ;;
+
+ target )
+ libobj="$arg"
+ arg_mode=normal
+ continue
+ ;;
+
+ normal )
+ # Accept any command-line options.
+ case $arg in
+ -o)
+ if test -n "$libobj" ; then
+ $echo "$modename: you cannot specify \`-o' more than once" 1>&2
+ exit $EXIT_FAILURE
+ fi
+ arg_mode=target
+ continue
+ ;;
+
+ -static | -prefer-pic | -prefer-non-pic)
+ later="$later $arg"
+ continue
+ ;;
+
+ -no-suppress)
+ suppress_opt=no
+ continue
+ ;;
+
+ -Xcompiler)
+ arg_mode=arg # the next one goes into the "base_compile" arg list
+ continue # The current "srcfile" will either be retained or
+ ;; # replaced later. I would guess that would be a bug.
+
+ -Wc,*)
+ args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
+ lastarg=
+ save_ifs="$IFS"; IFS=','
+ for arg in $args; do
+ IFS="$save_ifs"
+
+ # Double-quote args containing other shell metacharacters.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ arg="\"$arg\""
+ ;;
+ esac
+ lastarg="$lastarg $arg"
+ done
+ IFS="$save_ifs"
+ lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
+
+ # Add the arguments to base_compile.
+ base_compile="$base_compile $lastarg"
+ continue
+ ;;
+
+ * )
+ # Accept the current argument as the source file.
+ # The previous "srcfile" becomes the current argument.
+ #
+ lastarg="$srcfile"
+ srcfile="$arg"
+ ;;
+ esac # case $arg
+ ;;
+ esac # case $arg_mode
+
+ # Aesthetically quote the previous argument.
+ lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
+
+ case $lastarg in
+ # Double-quote args containing other shell metacharacters.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, and some SunOS ksh mistreat backslash-escaping
+ # in scan sets (worked around with variable expansion),
+ # and furthermore cannot handle '|' '&' '(' ')' in scan sets
+ # at all, so we specify them separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ lastarg="\"$lastarg\""
+ ;;
+ esac
+
+ base_compile="$base_compile $lastarg"
+ done # for arg
+
+ case $arg_mode in
+ arg)
+ $echo "$modename: you must specify an argument for -Xcompile"
+ exit $EXIT_FAILURE
+ ;;
+ target)
+ $echo "$modename: you must specify a target with \`-o'" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ *)
+ # Get the name of the library object.
+ [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
+ ;;
+ esac
+
+ # Recognize several different file suffixes.
+ # If the user specifies -o file.o, it is replaced with file.lo
+ xform='[cCFSifmso]'
+ case $libobj in
+ *.ada) xform=ada ;;
+ *.adb) xform=adb ;;
+ *.ads) xform=ads ;;
+ *.asm) xform=asm ;;
+ *.c++) xform=c++ ;;
+ *.cc) xform=cc ;;
+ *.ii) xform=ii ;;
+ *.class) xform=class ;;
+ *.cpp) xform=cpp ;;
+ *.cxx) xform=cxx ;;
+ *.[fF][09]?) xform=[fF][09]. ;;
+ *.for) xform=for ;;
+ *.java) xform=java ;;
+ *.obj) xform=obj ;;
+ *.sx) xform=sx ;;
+ esac
+
+ libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
+
+ case $libobj in
+ *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
+ *)
+ $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ esac
+
+ func_infer_tag $base_compile
+
+ for arg in $later; do
+ case $arg in
+ -static)
+ build_old_libs=yes
+ continue
+ ;;
+
+ -prefer-pic)
+ pic_mode=yes
+ continue
+ ;;
+
+ -prefer-non-pic)
+ pic_mode=no
+ continue
+ ;;
+ esac
+ done
+
+ qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"`
+ case $qlibobj in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ qlibobj="\"$qlibobj\"" ;;
+ esac
+ test "X$libobj" != "X$qlibobj" \
+ && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \
+ && $echo "$modename: libobj name \`$libobj' may not contain shell special characters."
+ objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
+ xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$obj"; then
+ xdir=
+ else
+ xdir=$xdir/
+ fi
+ lobj=${xdir}$objdir/$objname
+
+ if test -z "$base_compile"; then
+ $echo "$modename: you must specify a compilation command" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # Delete any leftover library objects.
+ if test "$build_old_libs" = yes; then
+ removelist="$obj $lobj $libobj ${libobj}T"
+ else
+ removelist="$lobj $libobj ${libobj}T"
+ fi
+
+ $run $rm $removelist
+ trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
+
+ # On Cygwin there's no "real" PIC flag so we must build both object types
+ case $host_os in
+ cygwin* | mingw* | pw32* | os2*)
+ pic_mode=default
+ ;;
+ esac
+ if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+ # non-PIC code in shared libraries is not supported
+ pic_mode=default
+ fi
+
+ # Calculate the filename of the output object if compiler does
+ # not support -o with -c
+ if test "$compiler_c_o" = no; then
+ output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
+ lockfile="$output_obj.lock"
+ removelist="$removelist $output_obj $lockfile"
+ trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15
+ else
+ output_obj=
+ need_locks=no
+ lockfile=
+ fi
+
+ # Lock this critical section if it is needed
+ # We use this script file to make the link, it avoids creating a new file
+ if test "$need_locks" = yes; then
+ until $run ln "$progpath" "$lockfile" 2>/dev/null; do
+ $show "Waiting for $lockfile to be removed"
+ sleep 2
+ done
+ elif test "$need_locks" = warn; then
+ if test -f "$lockfile"; then
+ $echo "\
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $run $rm $removelist
+ exit $EXIT_FAILURE
+ fi
+ $echo "$srcfile" > "$lockfile"
+ fi
+
+ if test -n "$fix_srcfile_path"; then
+ eval srcfile=\"$fix_srcfile_path\"
+ fi
+ qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"`
+ case $qsrcfile in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ qsrcfile="\"$qsrcfile\"" ;;
+ esac
+
+ $run $rm "$libobj" "${libobj}T"
+
+ # Create a libtool object file (analogous to a ".la" file),
+ # but don't create it if we're doing a dry run.
+ test -z "$run" && cat > ${libobj}T <<EOF
+# $libobj - a libtool object file
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+EOF
+
+ # Only build a PIC object if we are building libtool libraries.
+ if test "$build_libtool_libs" = yes; then
+ # Without this assignment, base_compile gets emptied.
+ fbsd_hideous_sh_bug=$base_compile
+
+ if test "$pic_mode" != no; then
+ command="$base_compile $qsrcfile $pic_flag"
+ else
+ # Don't build PIC code
+ command="$base_compile $qsrcfile"
+ fi
+
+ if test ! -d "${xdir}$objdir"; then
+ $show "$mkdir ${xdir}$objdir"
+ $run $mkdir ${xdir}$objdir
+ exit_status=$?
+ if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then
+ exit $exit_status
+ fi
+ fi
+
+ if test -z "$output_obj"; then
+ # Place PIC objects in $objdir
+ command="$command -o $lobj"
+ fi
+
+ $run $rm "$lobj" "$output_obj"
+
+ $show "$command"
+ if $run eval $lt_env "$command"; then :
+ else
+ test -n "$output_obj" && $run $rm $removelist
+ exit $EXIT_FAILURE
+ fi
+
+ if test "$need_locks" = warn &&
+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ $echo "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $run $rm $removelist
+ exit $EXIT_FAILURE
+ fi
+
+ # Just move the object if needed, then go on to compile the next one
+ if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+ $show "$mv $output_obj $lobj"
+ if $run $mv $output_obj $lobj; then :
+ else
+ error=$?
+ $run $rm $removelist
+ exit $error
+ fi
+ fi
+
+ # Append the name of the PIC object to the libtool object file.
+ test -z "$run" && cat >> ${libobj}T <<EOF
+pic_object='$objdir/$objname'
+
+EOF
+
+ # Allow error messages only from the first compilation.
+ if test "$suppress_opt" = yes; then
+ suppress_output=' >/dev/null 2>&1'
+ fi
+ else
+ # No PIC object so indicate it doesn't exist in the libtool
+ # object file.
+ test -z "$run" && cat >> ${libobj}T <<EOF
+pic_object=none
+
+EOF
+ fi
+
+ # Only build a position-dependent object if we build old libraries.
+ if test "$build_old_libs" = yes; then
+ if test "$pic_mode" != yes; then
+ # Don't build PIC code
+ command="$base_compile $qsrcfile"
+ else
+ command="$base_compile $qsrcfile $pic_flag"
+ fi
+ if test "$compiler_c_o" = yes; then
+ command="$command -o $obj"
+ fi
+
+ # Suppress compiler output if we already did a PIC compilation.
+ command="$command$suppress_output"
+ $run $rm "$obj" "$output_obj"
+ $show "$command"
+ if $run eval $lt_env "$command"; then :
+ else
+ $run $rm $removelist
+ exit $EXIT_FAILURE
+ fi
+
+ if test "$need_locks" = warn &&
+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ $echo "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $run $rm $removelist
+ exit $EXIT_FAILURE
+ fi
+
+ # Just move the object if needed
+ if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
+ $show "$mv $output_obj $obj"
+ if $run $mv $output_obj $obj; then :
+ else
+ error=$?
+ $run $rm $removelist
+ exit $error
+ fi
+ fi
+
+ # Append the name of the non-PIC object the libtool object file.
+ # Only append if the libtool object file exists.
+ test -z "$run" && cat >> ${libobj}T <<EOF
+# Name of the non-PIC object.
+non_pic_object='$objname'
+
+EOF
+ else
+ # Append the name of the non-PIC object the libtool object file.
+ # Only append if the libtool object file exists.
+ test -z "$run" && cat >> ${libobj}T <<EOF
+# Name of the non-PIC object.
+non_pic_object=none
+
+EOF
+ fi
+
+ $run $mv "${libobj}T" "${libobj}"
+
+ # Unlock the critical section if it was locked
+ if test "$need_locks" != no; then
+ $run $rm "$lockfile"
+ fi
+
+ exit $EXIT_SUCCESS
+ ;;
+
+ # libtool link mode
+ link | relink)
+ modename="$modename: link"
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+ # It is impossible to link a dll without this setting, and
+ # we shouldn't force the makefile maintainer to figure out
+ # which system we are compiling for in order to pass an extra
+ # flag for every libtool invocation.
+ # allow_undefined=no
+
+ # FIXME: Unfortunately, there are problems with the above when trying
+ # to make a dll which has undefined symbols, in which case not
+ # even a static library is built. For now, we need to specify
+ # -no-undefined on the libtool link line when we can be certain
+ # that all symbols are satisfied, otherwise we get a static library.
+ allow_undefined=yes
+ ;;
+ *)
+ allow_undefined=yes
+ ;;
+ esac
+ libtool_args="$nonopt"
+ base_compile="$nonopt $@"
+ compile_command="$nonopt"
+ finalize_command="$nonopt"
+
+ compile_rpath=
+ finalize_rpath=
+ compile_shlibpath=
+ finalize_shlibpath=
+ convenience=
+ old_convenience=
+ deplibs=
+ old_deplibs=
+ compiler_flags=
+ linker_flags=
+ dllsearchpath=
+ lib_search_path=`pwd`
+ inst_prefix_dir=
+
+ avoid_version=no
+ dlfiles=
+ dlprefiles=
+ dlself=no
+ export_dynamic=no
+ export_symbols=
+ export_symbols_regex=
+ generated=
+ libobjs=
+ ltlibs=
+ module=no
+ no_install=no
+ objs=
+ non_pic_objects=
+ notinst_path= # paths that contain not-installed libtool libraries
+ precious_files_regex=
+ prefer_static_libs=no
+ preload=no
+ prev=
+ prevarg=
+ release=
+ rpath=
+ xrpath=
+ perm_rpath=
+ temp_rpath=
+ thread_safe=no
+ vinfo=
+ vinfo_number=no
+ single_module="${wl}-single_module"
+
+ func_infer_tag $base_compile
+
+ # We need to know -static, to get the right output filenames.
+ for arg
+ do
+ case $arg in
+ -all-static | -static | -static-libtool-libs)
+ case $arg in
+ -all-static)
+ if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+ $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
+ fi
+ if test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=yes
+ ;;
+ -static)
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=built
+ ;;
+ -static-libtool-libs)
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ prefer_static_libs=yes
+ ;;
+ esac
+ build_libtool_libs=no
+ build_old_libs=yes
+ break
+ ;;
+ esac
+ done
+
+ # See if our shared archives depend on static archives.
+ test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+ # Go through the arguments, transforming them on the way.
+ while test "$#" -gt 0; do
+ arg="$1"
+ shift
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
+ ;;
+ *) qarg=$arg ;;
+ esac
+ libtool_args="$libtool_args $qarg"
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$prev"; then
+ case $prev in
+ output)
+ compile_command="$compile_command @OUTPUT@"
+ finalize_command="$finalize_command @OUTPUT@"
+ ;;
+ esac
+
+ case $prev in
+ dlfiles|dlprefiles)
+ if test "$preload" = no; then
+ # Add the symbol object into the linking commands.
+ compile_command="$compile_command @SYMFILE@"
+ finalize_command="$finalize_command @SYMFILE@"
+ preload=yes
+ fi
+ case $arg in
+ *.la | *.lo) ;; # We handle these cases below.
+ force)
+ if test "$dlself" = no; then
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ self)
+ if test "$prev" = dlprefiles; then
+ dlself=yes
+ elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+ dlself=yes
+ else
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ *)
+ if test "$prev" = dlfiles; then
+ dlfiles="$dlfiles $arg"
+ else
+ dlprefiles="$dlprefiles $arg"
+ fi
+ prev=
+ continue
+ ;;
+ esac
+ ;;
+ expsyms)
+ export_symbols="$arg"
+ if test ! -f "$arg"; then
+ $echo "$modename: symbol file \`$arg' does not exist"
+ exit $EXIT_FAILURE
+ fi
+ prev=
+ continue
+ ;;
+ expsyms_regex)
+ export_symbols_regex="$arg"
+ prev=
+ continue
+ ;;
+ inst_prefix)
+ inst_prefix_dir="$arg"
+ prev=
+ continue
+ ;;
+ precious_regex)
+ precious_files_regex="$arg"
+ prev=
+ continue
+ ;;
+ release)
+ release="-$arg"
+ prev=
+ continue
+ ;;
+ objectlist)
+ if test -f "$arg"; then
+ save_arg=$arg
+ moreargs=
+ for fil in `cat $save_arg`
+ do
+# moreargs="$moreargs $fil"
+ arg=$fil
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ # If there is no directory component, then add one.
+ case $arg in
+ */* | *\\*) . $arg ;;
+ *) . ./$arg ;;
+ esac
+
+ if test -z "$pic_object" || \
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none && \
+ test "$non_pic_object" = none; then
+ $echo "$modename: cannot find name of object for \`$arg'" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # Extract subdirectory from the argument.
+ xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$arg"; then
+ xdir=
+ else
+ xdir="$xdir/"
+ fi
+
+ if test "$pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ pic_object="$xdir$pic_object"
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ dlfiles="$dlfiles $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ dlprefiles="$dlprefiles $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ libobjs="$libobjs $pic_object"
+ arg="$pic_object"
+ fi
+
+ # Non-PIC object.
+ if test "$non_pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object="$xdir$non_pic_object"
+
+ # A standard non-PIC object
+ non_pic_objects="$non_pic_objects $non_pic_object"
+ if test -z "$pic_object" || test "$pic_object" = none ; then
+ arg="$non_pic_object"
+ fi
+ else
+ # If the PIC object exists, use it instead.
+ # $xdir was prepended to $pic_object above.
+ non_pic_object="$pic_object"
+ non_pic_objects="$non_pic_objects $non_pic_object"
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if test -z "$run"; then
+ $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
+ exit $EXIT_FAILURE
+ else
+ # Dry-run case.
+
+ # Extract subdirectory from the argument.
+ xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$arg"; then
+ xdir=
+ else
+ xdir="$xdir/"
+ fi
+
+ pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
+ non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
+ libobjs="$libobjs $pic_object"
+ non_pic_objects="$non_pic_objects $non_pic_object"
+ fi
+ fi
+ done
+ else
+ $echo "$modename: link input file \`$save_arg' does not exist"
+ exit $EXIT_FAILURE
+ fi
+ arg=$save_arg
+ prev=
+ continue
+ ;;
+ rpath | xrpath)
+ # We need an absolute path.
+ case $arg in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ $echo "$modename: only absolute run-paths are allowed" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ esac
+ if test "$prev" = rpath; then
+ case "$rpath " in
+ *" $arg "*) ;;
+ *) rpath="$rpath $arg" ;;
+ esac
+ else
+ case "$xrpath " in
+ *" $arg "*) ;;
+ *) xrpath="$xrpath $arg" ;;
+ esac
+ fi
+ prev=
+ continue
+ ;;
+ xcompiler)
+ compiler_flags="$compiler_flags $qarg"
+ prev=
+ compile_command="$compile_command $qarg"
+ finalize_command="$finalize_command $qarg"
+ continue
+ ;;
+ xlinker)
+ linker_flags="$linker_flags $qarg"
+ compiler_flags="$compiler_flags $wl$qarg"
+ prev=
+ compile_command="$compile_command $wl$qarg"
+ finalize_command="$finalize_command $wl$qarg"
+ continue
+ ;;
+ xcclinker)
+ linker_flags="$linker_flags $qarg"
+ compiler_flags="$compiler_flags $qarg"
+ prev=
+ compile_command="$compile_command $qarg"
+ finalize_command="$finalize_command $qarg"
+ continue
+ ;;
+ shrext)
+ shrext_cmds="$arg"
+ prev=
+ continue
+ ;;
+ darwin_framework|darwin_framework_skip)
+ test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg"
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ prev=
+ continue
+ ;;
+ *)
+ eval "$prev=\"\$arg\""
+ prev=
+ continue
+ ;;
+ esac
+ fi # test -n "$prev"
+
+ prevarg="$arg"
+
+ case $arg in
+ -all-static)
+ if test -n "$link_static_flag"; then
+ compile_command="$compile_command $link_static_flag"
+ finalize_command="$finalize_command $link_static_flag"
+ fi
+ continue
+ ;;
+
+ -allow-undefined)
+ # FIXME: remove this flag sometime in the future.
+ $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
+ continue
+ ;;
+
+ -avoid-version)
+ avoid_version=yes
+ continue
+ ;;
+
+ -dlopen)
+ prev=dlfiles
+ continue
+ ;;
+
+ -dlpreopen)
+ prev=dlprefiles
+ continue
+ ;;
+
+ -export-dynamic)
+ export_dynamic=yes
+ continue
+ ;;
+
+ -export-symbols | -export-symbols-regex)
+ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+ $echo "$modename: more than one -exported-symbols argument is not allowed"
+ exit $EXIT_FAILURE
+ fi
+ if test "X$arg" = "X-export-symbols"; then
+ prev=expsyms
+ else
+ prev=expsyms_regex
+ fi
+ continue
+ ;;
+
+ -framework|-arch|-isysroot)
+ case " $CC " in
+ *" ${arg} ${1} "* | *" ${arg} ${1} "*)
+ prev=darwin_framework_skip ;;
+ *) compiler_flags="$compiler_flags $arg"
+ prev=darwin_framework ;;
+ esac
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ continue
+ ;;
+
+ -inst-prefix-dir)
+ prev=inst_prefix
+ continue
+ ;;
+
+ # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
+ # so, if we see these flags be careful not to treat them like -L
+ -L[A-Z][A-Z]*:*)
+ case $with_gcc/$host in
+ no/*-*-irix* | /*-*-irix*)
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ ;;
+ esac
+ continue
+ ;;
+
+ -L*)
+ dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ if test -z "$absdir"; then
+ $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
+ absdir="$dir"
+ notinst_path="$notinst_path $dir"
+ fi
+ dir="$absdir"
+ ;;
+ esac
+ case "$deplibs " in
+ *" -L$dir "*) ;;
+ *)
+ deplibs="$deplibs -L$dir"
+ lib_search_path="$lib_search_path $dir"
+ ;;
+ esac
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+ testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'`
+ case :$dllsearchpath: in
+ *":$dir:"*) ;;
+ *) dllsearchpath="$dllsearchpath:$dir";;
+ esac
+ case :$dllsearchpath: in
+ *":$testbindir:"*) ;;
+ *) dllsearchpath="$dllsearchpath:$testbindir";;
+ esac
+ ;;
+ esac
+ continue
+ ;;
+
+ -l*)
+ if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*)
+ # These systems don't actually have a C or math library (as such)
+ continue
+ ;;
+ *-*-os2*)
+ # These systems don't actually have a C library (as such)
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc due to us having libc/libc_r.
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C and math libraries are in the System framework
+ deplibs="$deplibs -framework System"
+ continue
+ ;;
+ *-*-sco3.2v5* | *-*-sco5v6*)
+ # Causes problems with __ctype
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+ # Compiler inserts libc in the correct place for threads to work
+ test "X$arg" = "X-lc" && continue
+ ;;
+ esac
+ elif test "X$arg" = "X-lc_r"; then
+ case $host in
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc_r directly, use -pthread flag.
+ continue
+ ;;
+ esac
+ fi
+ deplibs="$deplibs $arg"
+ continue
+ ;;
+
+ # Tru64 UNIX uses -model [arg] to determine the layout of C++
+ # classes, name mangling, and exception handling.
+ -model)
+ compile_command="$compile_command $arg"
+ compiler_flags="$compiler_flags $arg"
+ finalize_command="$finalize_command $arg"
+ prev=xcompiler
+ continue
+ ;;
+
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+ compiler_flags="$compiler_flags $arg"
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ continue
+ ;;
+
+ -multi_module)
+ single_module="${wl}-multi_module"
+ continue
+ ;;
+
+ -module)
+ module=yes
+ continue
+ ;;
+
+ # -64, -mips[0-9] enable 64-bit mode on the SGI compiler
+ # -r[0-9][0-9]* specifies the processor on the SGI compiler
+ # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler
+ # +DA*, +DD* enable 64-bit mode on the HP compiler
+ # -q* pass through compiler args for the IBM compiler
+ # -m* pass through architecture-specific compiler args for GCC
+ # -m*, -t[45]*, -txscale* pass through architecture-specific
+ # compiler args for GCC
+ # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC
+ # -F/path gives path to uninstalled frameworks, gcc on darwin
+ # @file GCC response files
+ -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*)
+
+ # Unknown arguments in both finalize_command and compile_command need
+ # to be aesthetically quoted because they are evaled later.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ arg="\"$arg\""
+ ;;
+ esac
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ compiler_flags="$compiler_flags $arg"
+ continue
+ ;;
+
+ -shrext)
+ prev=shrext
+ continue
+ ;;
+
+ -no-fast-install)
+ fast_install=no
+ continue
+ ;;
+
+ -no-install)
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*)
+ # The PATH hackery in wrapper scripts is required on Windows
+ # and Darwin in order for the loader to find any dlls it needs.
+ $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
+ $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
+ fast_install=no
+ ;;
+ *) no_install=yes ;;
+ esac
+ continue
+ ;;
+
+ -no-undefined)
+ allow_undefined=no
+ continue
+ ;;
+
+ -objectlist)
+ prev=objectlist
+ continue
+ ;;
+
+ -o) prev=output ;;
+
+ -precious-files-regex)
+ prev=precious_regex
+ continue
+ ;;
+
+ -release)
+ prev=release
+ continue
+ ;;
+
+ -rpath)
+ prev=rpath
+ continue
+ ;;
+
+ -R)
+ prev=xrpath
+ continue
+ ;;
+
+ -R*)
+ dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ $echo "$modename: only absolute run-paths are allowed" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ esac
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) xrpath="$xrpath $dir" ;;
+ esac
+ continue
+ ;;
+
+ -static | -static-libtool-libs)
+ # The effects of -static are defined in a previous loop.
+ # We used to do the same as -all-static on platforms that
+ # didn't have a PIC flag, but the assumption that the effects
+ # would be equivalent was wrong. It would break on at least
+ # Digital Unix and AIX.
+ continue
+ ;;
+
+ -thread-safe)
+ thread_safe=yes
+ continue
+ ;;
+
+ -version-info)
+ prev=vinfo
+ continue
+ ;;
+ -version-number)
+ prev=vinfo
+ vinfo_number=yes
+ continue
+ ;;
+
+ -Wc,*)
+ args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
+ arg=
+ save_ifs="$IFS"; IFS=','
+ for flag in $args; do
+ IFS="$save_ifs"
+ case $flag in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ flag="\"$flag\""
+ ;;
+ esac
+ arg="$arg $wl$flag"
+ compiler_flags="$compiler_flags $flag"
+ done
+ IFS="$save_ifs"
+ arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
+ ;;
+
+ -Wl,*)
+ args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
+ arg=
+ save_ifs="$IFS"; IFS=','
+ for flag in $args; do
+ IFS="$save_ifs"
+ case $flag in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ flag="\"$flag\""
+ ;;
+ esac
+ arg="$arg $wl$flag"
+ compiler_flags="$compiler_flags $wl$flag"
+ linker_flags="$linker_flags $flag"
+ done
+ IFS="$save_ifs"
+ arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
+ ;;
+
+ -Xcompiler)
+ prev=xcompiler
+ continue
+ ;;
+
+ -Xlinker)
+ prev=xlinker
+ continue
+ ;;
+
+ -XCClinker)
+ prev=xcclinker
+ continue
+ ;;
+
+ # Some other compiler flag.
+ -* | +*)
+ # Unknown arguments in both finalize_command and compile_command need
+ # to be aesthetically quoted because they are evaled later.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ arg="\"$arg\""
+ ;;
+ esac
+ ;;
+
+ *.$objext)
+ # A standard object.
+ objs="$objs $arg"
+ ;;
+
+ *.lo)
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ pic_object=
+ non_pic_object=
+
+ # Read the .lo file
+ # If there is no directory component, then add one.
+ case $arg in
+ */* | *\\*) . $arg ;;
+ *) . ./$arg ;;
+ esac
+
+ if test -z "$pic_object" || \
+ test -z "$non_pic_object" ||
+ test "$pic_object" = none && \
+ test "$non_pic_object" = none; then
+ $echo "$modename: cannot find name of object for \`$arg'" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # Extract subdirectory from the argument.
+ xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$arg"; then
+ xdir=
+ else
+ xdir="$xdir/"
+ fi
+
+ if test "$pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ pic_object="$xdir$pic_object"
+
+ if test "$prev" = dlfiles; then
+ if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ dlfiles="$dlfiles $pic_object"
+ prev=
+ continue
+ else
+ # If libtool objects are unsupported, then we need to preload.
+ prev=dlprefiles
+ fi
+ fi
+
+ # CHECK ME: I think I busted this. -Ossama
+ if test "$prev" = dlprefiles; then
+ # Preload the old-style object.
+ dlprefiles="$dlprefiles $pic_object"
+ prev=
+ fi
+
+ # A PIC object.
+ libobjs="$libobjs $pic_object"
+ arg="$pic_object"
+ fi
+
+ # Non-PIC object.
+ if test "$non_pic_object" != none; then
+ # Prepend the subdirectory the object is found in.
+ non_pic_object="$xdir$non_pic_object"
+
+ # A standard non-PIC object
+ non_pic_objects="$non_pic_objects $non_pic_object"
+ if test -z "$pic_object" || test "$pic_object" = none ; then
+ arg="$non_pic_object"
+ fi
+ else
+ # If the PIC object exists, use it instead.
+ # $xdir was prepended to $pic_object above.
+ non_pic_object="$pic_object"
+ non_pic_objects="$non_pic_objects $non_pic_object"
+ fi
+ else
+ # Only an error if not doing a dry-run.
+ if test -z "$run"; then
+ $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
+ exit $EXIT_FAILURE
+ else
+ # Dry-run case.
+
+ # Extract subdirectory from the argument.
+ xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$arg"; then
+ xdir=
+ else
+ xdir="$xdir/"
+ fi
+
+ pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
+ non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
+ libobjs="$libobjs $pic_object"
+ non_pic_objects="$non_pic_objects $non_pic_object"
+ fi
+ fi
+ ;;
+
+ *.$libext)
+ # An archive.
+ deplibs="$deplibs $arg"
+ old_deplibs="$old_deplibs $arg"
+ continue
+ ;;
+
+ *.la)
+ # A libtool-controlled library.
+
+ if test "$prev" = dlfiles; then
+ # This library was specified with -dlopen.
+ dlfiles="$dlfiles $arg"
+ prev=
+ elif test "$prev" = dlprefiles; then
+ # The library was specified with -dlpreopen.
+ dlprefiles="$dlprefiles $arg"
+ prev=
+ else
+ deplibs="$deplibs $arg"
+ fi
+ continue
+ ;;
+
+ # Some other compiler argument.
+ *)
+ # Unknown arguments in both finalize_command and compile_command need
+ # to be aesthetically quoted because they are evaled later.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ arg="\"$arg\""
+ ;;
+ esac
+ ;;
+ esac # arg
+
+ # Now actually substitute the argument into the commands.
+ if test -n "$arg"; then
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ fi
+ done # argument parsing loop
+
+ if test -n "$prev"; then
+ $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+ eval arg=\"$export_dynamic_flag_spec\"
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ fi
+
+ oldlibs=
+ # calculate the name of the file, without its directory
+ outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
+ libobjs_save="$libobjs"
+
+ if test -n "$shlibpath_var"; then
+ # get the directories listed in $shlibpath_var
+ eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
+ else
+ shlib_search_path=
+ fi
+ eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+ eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+ output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$output_objdir" = "X$output"; then
+ output_objdir="$objdir"
+ else
+ output_objdir="$output_objdir/$objdir"
+ fi
+ # Create the object directory.
+ if test ! -d "$output_objdir"; then
+ $show "$mkdir $output_objdir"
+ $run $mkdir $output_objdir
+ exit_status=$?
+ if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then
+ exit $exit_status
+ fi
+ fi
+
+ # Determine the type of output
+ case $output in
+ "")
+ $echo "$modename: you must specify an output file" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ *.$libext) linkmode=oldlib ;;
+ *.lo | *.$objext) linkmode=obj ;;
+ *.la) linkmode=lib ;;
+ *) linkmode=prog ;; # Anything else should be a program.
+ esac
+
+ case $host in
+ *cygwin* | *mingw* | *pw32*)
+ # don't eliminate duplications in $postdeps and $predeps
+ duplicate_compiler_generated_deps=yes
+ ;;
+ *)
+ duplicate_compiler_generated_deps=$duplicate_deps
+ ;;
+ esac
+ specialdeplibs=
+
+ libs=
+ # Find all interdependent deplibs by searching for libraries
+ # that are linked more than once (e.g. -la -lb -la)
+ for deplib in $deplibs; do
+ if test "X$duplicate_deps" = "Xyes" ; then
+ case "$libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
+ libs="$libs $deplib"
+ done
+
+ if test "$linkmode" = lib; then
+ libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+ # Compute libraries that are listed more than once in $predeps
+ # $postdeps and mark them as special (i.e., whose duplicates are
+ # not to be eliminated).
+ pre_post_deps=
+ if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
+ for pre_post_dep in $predeps $postdeps; do
+ case "$pre_post_deps " in
+ *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
+ esac
+ pre_post_deps="$pre_post_deps $pre_post_dep"
+ done
+ fi
+ pre_post_deps=
+ fi
+
+ deplibs=
+ newdependency_libs=
+ newlib_search_path=
+ need_relink=no # whether we're linking any uninstalled libtool libraries
+ notinst_deplibs= # not-installed libtool libraries
+ case $linkmode in
+ lib)
+ passes="conv link"
+ for file in $dlfiles $dlprefiles; do
+ case $file in
+ *.la) ;;
+ *)
+ $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ esac
+ done
+ ;;
+ prog)
+ compile_deplibs=
+ finalize_deplibs=
+ alldeplibs=no
+ newdlfiles=
+ newdlprefiles=
+ passes="conv scan dlopen dlpreopen link"
+ ;;
+ *) passes="conv"
+ ;;
+ esac
+ for pass in $passes; do
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan"; then
+ libs="$deplibs"
+ deplibs=
+ fi
+ if test "$linkmode" = prog; then
+ case $pass in
+ dlopen) libs="$dlfiles" ;;
+ dlpreopen) libs="$dlprefiles" ;;
+ link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+ esac
+ fi
+ if test "$pass" = dlopen; then
+ # Collect dlpreopened libraries
+ save_deplibs="$deplibs"
+ deplibs=
+ fi
+ for deplib in $libs; do
+ lib=
+ found=no
+ case $deplib in
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ compiler_flags="$compiler_flags $deplib"
+ fi
+ continue
+ ;;
+ -l*)
+ if test "$linkmode" != lib && test "$linkmode" != prog; then
+ $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
+ continue
+ fi
+ name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
+ if test "$linkmode" = lib; then
+ searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
+ else
+ searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
+ fi
+ for searchdir in $searchdirs; do
+ for search_ext in .la $std_shrext .so .a; do
+ # Search the libtool library
+ lib="$searchdir/lib${name}${search_ext}"
+ if test -f "$lib"; then
+ if test "$search_ext" = ".la"; then
+ found=yes
+ else
+ found=no
+ fi
+ break 2
+ fi
+ done
+ done
+ if test "$found" != yes; then
+ # deplib doesn't seem to be a libtool library
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ else # deplib is a libtool library
+ # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+ # We need to do some special things here, and not later.
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $deplib "*)
+ if (${SED} -e '2q' $lib |
+ grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ library_names=
+ old_library=
+ case $lib in
+ */* | *\\*) . $lib ;;
+ *) . ./$lib ;;
+ esac
+ for l in $old_library $library_names; do
+ ll="$l"
+ done
+ if test "X$ll" = "X$old_library" ; then # only static version available
+ found=no
+ ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$ladir" = "X$lib" && ladir="."
+ lib=$ladir/$old_library
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ fi
+ fi
+ ;;
+ *) ;;
+ esac
+ fi
+ fi
+ ;; # -l
+ -L*)
+ case $linkmode in
+ lib)
+ deplibs="$deplib $deplibs"
+ test "$pass" = conv && continue
+ newdependency_libs="$deplib $newdependency_libs"
+ newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+ ;;
+ prog)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ if test "$pass" = scan; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+ ;;
+ *)
+ $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
+ ;;
+ esac # linkmode
+ continue
+ ;; # -L
+ -R*)
+ if test "$pass" = link; then
+ dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
+ # Make sure the xrpath contains only unique directories.
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) xrpath="$xrpath $dir" ;;
+ esac
+ fi
+ deplibs="$deplib $deplibs"
+ continue
+ ;;
+ *.la) lib="$deplib" ;;
+ *.$libext)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ case $linkmode in
+ lib)
+ valid_a_lib=no
+ case $deplibs_check_method in
+ match_pattern*)
+ set dummy $deplibs_check_method
+ match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+ if eval $echo \"$deplib\" 2>/dev/null \
+ | $SED 10q \
+ | $EGREP "$match_pattern_regex" > /dev/null; then
+ valid_a_lib=yes
+ fi
+ ;;
+ pass_all)
+ valid_a_lib=yes
+ ;;
+ esac
+ if test "$valid_a_lib" != yes; then
+ $echo
+ $echo "*** Warning: Trying to link with static lib archive $deplib."
+ $echo "*** I have the capability to make that library automatically link in when"
+ $echo "*** you link to this library. But I can only do this if you have a"
+ $echo "*** shared version of the library, which you do not appear to have"
+ $echo "*** because the file extensions .$libext of this argument makes me believe"
+ $echo "*** that it is just a static archive that I should not used here."
+ else
+ $echo
+ $echo "*** Warning: Linking the shared library $output against the"
+ $echo "*** static library $deplib is not portable!"
+ deplibs="$deplib $deplibs"
+ fi
+ continue
+ ;;
+ prog)
+ if test "$pass" != link; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ continue
+ ;;
+ esac # linkmode
+ ;; # *.$libext
+ *.lo | *.$objext)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ elif test "$linkmode" = prog; then
+ if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+ # If there is no dlopen support or we're linking statically,
+ # we need to preload.
+ newdlprefiles="$newdlprefiles $deplib"
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ newdlfiles="$newdlfiles $deplib"
+ fi
+ fi
+ continue
+ ;;
+ %DEPLIBS%)
+ alldeplibs=yes
+ continue
+ ;;
+ esac # case $deplib
+ if test "$found" = yes || test -f "$lib"; then :
+ else
+ $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # Check to see that this really is a libtool archive.
+ if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$ladir" = "X$lib" && ladir="."
+
+ dlname=
+ dlopen=
+ dlpreopen=
+ libdir=
+ library_names=
+ old_library=
+ # If the library was installed with an old release of libtool,
+ # it will not redefine variables installed, or shouldnotlink
+ installed=yes
+ shouldnotlink=no
+ avoidtemprpath=
+
+
+ # Read the .la file
+ case $lib in
+ */* | *\\*) . $lib ;;
+ *) . ./$lib ;;
+ esac
+
+ if test "$linkmode,$pass" = "lib,link" ||
+ test "$linkmode,$pass" = "prog,scan" ||
+ { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+ test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
+ test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
+ fi
+
+ if test "$pass" = conv; then
+ # Only check for convenience libraries
+ deplibs="$lib $deplibs"
+ if test -z "$libdir"; then
+ if test -z "$old_library"; then
+ $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
+ exit $EXIT_FAILURE
+ fi
+ # It is a libtool convenience library, so add in its objects.
+ convenience="$convenience $ladir/$objdir/$old_library"
+ old_convenience="$old_convenience $ladir/$objdir/$old_library"
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ deplibs="$deplib $deplibs"
+ if test "X$duplicate_deps" = "Xyes" ; then
+ case "$tmp_libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
+ tmp_libs="$tmp_libs $deplib"
+ done
+ elif test "$linkmode" != prog && test "$linkmode" != lib; then
+ $echo "$modename: \`$lib' is not a convenience library" 1>&2
+ exit $EXIT_FAILURE
+ fi
+ continue
+ fi # $pass = conv
+
+
+ # Get the name of the library we link against.
+ linklib=
+ for l in $old_library $library_names; do
+ linklib="$l"
+ done
+ if test -z "$linklib"; then
+ $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # This library was specified with -dlopen.
+ if test "$pass" = dlopen; then
+ if test -z "$libdir"; then
+ $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
+ exit $EXIT_FAILURE
+ fi
+ if test -z "$dlname" ||
+ test "$dlopen_support" != yes ||
+ test "$build_libtool_libs" = no; then
+ # If there is no dlname, no dlopen support or we're linking
+ # statically, we need to preload. We also need to preload any
+ # dependent libraries so libltdl's deplib preloader doesn't
+ # bomb out in the load deplibs phase.
+ dlprefiles="$dlprefiles $lib $dependency_libs"
+ else
+ newdlfiles="$newdlfiles $lib"
+ fi
+ continue
+ fi # $pass = dlopen
+
+ # We need an absolute path.
+ case $ladir in
+ [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+ *)
+ abs_ladir=`cd "$ladir" && pwd`
+ if test -z "$abs_ladir"; then
+ $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
+ $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
+ abs_ladir="$ladir"
+ fi
+ ;;
+ esac
+ laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+
+ # Find the relevant object directory and library name.
+ if test "X$installed" = Xyes; then
+ if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ $echo "$modename: warning: library \`$lib' was moved." 1>&2
+ dir="$ladir"
+ absdir="$abs_ladir"
+ libdir="$abs_ladir"
+ else
+ dir="$libdir"
+ absdir="$libdir"
+ fi
+ test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+ else
+ if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ dir="$ladir"
+ absdir="$abs_ladir"
+ # Remove this search path later
+ notinst_path="$notinst_path $abs_ladir"
+ else
+ dir="$ladir/$objdir"
+ absdir="$abs_ladir/$objdir"
+ # Remove this search path later
+ notinst_path="$notinst_path $abs_ladir"
+ fi
+ fi # $installed = yes
+ name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+
+ # This library was specified with -dlpreopen.
+ if test "$pass" = dlpreopen; then
+ if test -z "$libdir"; then
+ $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
+ exit $EXIT_FAILURE
+ fi
+ # Prefer using a static library (so that no silly _DYNAMIC symbols
+ # are required to link).
+ if test -n "$old_library"; then
+ newdlprefiles="$newdlprefiles $dir/$old_library"
+ # Otherwise, use the dlname, so that lt_dlopen finds it.
+ elif test -n "$dlname"; then
+ newdlprefiles="$newdlprefiles $dir/$dlname"
+ else
+ newdlprefiles="$newdlprefiles $dir/$linklib"
+ fi
+ fi # $pass = dlpreopen
+
+ if test -z "$libdir"; then
+ # Link the convenience library
+ if test "$linkmode" = lib; then
+ deplibs="$dir/$old_library $deplibs"
+ elif test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$dir/$old_library $compile_deplibs"
+ finalize_deplibs="$dir/$old_library $finalize_deplibs"
+ else
+ deplibs="$lib $deplibs" # used for prog,scan pass
+ fi
+ continue
+ fi
+
+
+ if test "$linkmode" = prog && test "$pass" != link; then
+ newlib_search_path="$newlib_search_path $ladir"
+ deplibs="$lib $deplibs"
+
+ linkalldeplibs=no
+ if test "$link_all_deplibs" != no || test -z "$library_names" ||
+ test "$build_libtool_libs" = no; then
+ linkalldeplibs=yes
+ fi
+
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ case $deplib in
+ -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
+ esac
+ # Need to link against all dependency_libs?
+ if test "$linkalldeplibs" = yes; then
+ deplibs="$deplib $deplibs"
+ else
+ # Need to hardcode shared library paths
+ # or/and link against static libraries
+ newdependency_libs="$deplib $newdependency_libs"
+ fi
+ if test "X$duplicate_deps" = "Xyes" ; then
+ case "$tmp_libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
+ tmp_libs="$tmp_libs $deplib"
+ done # for deplib
+ continue
+ fi # $linkmode = prog...
+
+ if test "$linkmode,$pass" = "prog,link"; then
+ if test -n "$library_names" &&
+ { { test "$prefer_static_libs" = no ||
+ test "$prefer_static_libs,$installed" = "built,yes"; } ||
+ test -z "$old_library"; }; then
+ # We need to hardcode the library path
+ if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
+ # Make sure the rpath contains only unique directories.
+ case "$temp_rpath " in
+ *" $dir "*) ;;
+ *" $absdir "*) ;;
+ *) temp_rpath="$temp_rpath $absdir" ;;
+ esac
+ fi
+
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+ case " $sys_lib_dlsearch_path " in
+ *" $absdir "*) ;;
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+ *) compile_rpath="$compile_rpath $absdir"
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir"
+ esac
+ ;;
+ esac
+ fi # $linkmode,$pass = prog,link...
+
+ if test "$alldeplibs" = yes &&
+ { test "$deplibs_check_method" = pass_all ||
+ { test "$build_libtool_libs" = yes &&
+ test -n "$library_names"; }; }; then
+ # We only need to search for static libraries
+ continue
+ fi
+ fi
+
+ link_static=no # Whether the deplib will be linked statically
+ use_static_libs=$prefer_static_libs
+ if test "$use_static_libs" = built && test "$installed" = yes ; then
+ use_static_libs=no
+ fi
+ if test -n "$library_names" &&
+ { test "$use_static_libs" = no || test -z "$old_library"; }; then
+ if test "$installed" = no; then
+ notinst_deplibs="$notinst_deplibs $lib"
+ need_relink=yes
+ fi
+ # This is a shared library
+
+ # Warn about portability, can't link against -module's on
+ # some systems (darwin)
+ if test "$shouldnotlink" = yes && test "$pass" = link ; then
+ $echo
+ if test "$linkmode" = prog; then
+ $echo "*** Warning: Linking the executable $output against the loadable module"
+ else
+ $echo "*** Warning: Linking the shared library $output against the loadable module"
+ fi
+ $echo "*** $linklib is not portable!"
+ fi
+ if test "$linkmode" = lib &&
+ test "$hardcode_into_libs" = yes; then
+ # Hardcode the library path.
+ # Skip directories that are in the system default run-time
+ # search path.
+ case " $sys_lib_dlsearch_path " in
+ *" $absdir "*) ;;
+ *)
+ case "$compile_rpath " in
+ *" $absdir "*) ;;
+ *) compile_rpath="$compile_rpath $absdir"
+ esac
+ ;;
+ esac
+ case " $sys_lib_dlsearch_path " in
+ *" $libdir "*) ;;
+ *)
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir"
+ esac
+ ;;
+ esac
+ fi
+
+ if test -n "$old_archive_from_expsyms_cmds"; then
+ # figure out the soname
+ set dummy $library_names
+ realname="$2"
+ shift; shift
+ libname=`eval \\$echo \"$libname_spec\"`
+ # use dlname if we got it. it's perfectly good, no?
+ if test -n "$dlname"; then
+ soname="$dlname"
+ elif test -n "$soname_spec"; then
+ # bleh windows
+ case $host in
+ *cygwin* | mingw*)
+ major=`expr $current - $age`
+ versuffix="-$major"
+ ;;
+ esac
+ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+
+ # Make a new name for the extract_expsyms_cmds to use
+ soroot="$soname"
+ soname=`$echo $soroot | ${SED} -e 's/^.*\///'`
+ newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a"
+
+ # If the library has no export list, then create one now
+ if test -f "$output_objdir/$soname-def"; then :
+ else
+ $show "extracting exported symbol list from \`$soname'"
+ save_ifs="$IFS"; IFS='~'
+ cmds=$extract_expsyms_cmds
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ fi
+
+ # Create $newlib
+ if test -f "$output_objdir/$newlib"; then :; else
+ $show "generating import library for \`$soname'"
+ save_ifs="$IFS"; IFS='~'
+ cmds=$old_archive_from_expsyms_cmds
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ fi
+ # make sure the library variables are pointing to the new library
+ dir=$output_objdir
+ linklib=$newlib
+ fi # test -n "$old_archive_from_expsyms_cmds"
+
+ if test "$linkmode" = prog || test "$mode" != relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+ lib_linked=yes
+ case $hardcode_action in
+ immediate | unsupported)
+ if test "$hardcode_direct" = no; then
+ add="$dir/$linklib"
+ case $host in
+ *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
+ *-*-sysv4*uw2*) add_dir="-L$dir" ;;
+ *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
+ *-*-unixware7*) add_dir="-L$dir" ;;
+ *-*-darwin* )
+ # if the lib is a module then we can not link against
+ # it, someone is ignoring the new warnings I added
+ if /usr/bin/file -L $add 2> /dev/null |
+ $EGREP ": [^:]* bundle" >/dev/null ; then
+ $echo "** Warning, lib $linklib is a module, not a shared library"
+ if test -z "$old_library" ; then
+ $echo
+ $echo "** And there doesn't seem to be a static archive available"
+ $echo "** The link will probably fail, sorry"
+ else
+ add="$dir/$old_library"
+ fi
+ fi
+ esac
+ elif test "$hardcode_minus_L" = no; then
+ case $host in
+ *-*-sunos*) add_shlibpath="$dir" ;;
+ esac
+ add_dir="-L$dir"
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = no; then
+ add_shlibpath="$dir"
+ add="-l$name"
+ else
+ lib_linked=no
+ fi
+ ;;
+ relink)
+ if test "$hardcode_direct" = yes; then
+ add="$dir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ add_dir="-L$dir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case $libdir in
+ [\\/]*)
+ add_dir="$add_dir -L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ add_shlibpath="$dir"
+ add="-l$name"
+ else
+ lib_linked=no
+ fi
+ ;;
+ *) lib_linked=no ;;
+ esac
+
+ if test "$lib_linked" != yes; then
+ $echo "$modename: configuration error: unsupported hardcode properties"
+ exit $EXIT_FAILURE
+ fi
+
+ if test -n "$add_shlibpath"; then
+ case :$compile_shlibpath: in
+ *":$add_shlibpath:"*) ;;
+ *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
+ esac
+ fi
+ if test "$linkmode" = prog; then
+ test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+ test -n "$add" && compile_deplibs="$add $compile_deplibs"
+ else
+ test -n "$add_dir" && deplibs="$add_dir $deplibs"
+ test -n "$add" && deplibs="$add $deplibs"
+ if test "$hardcode_direct" != yes && \
+ test "$hardcode_minus_L" != yes && \
+ test "$hardcode_shlibpath_var" = yes; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+ *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+ esac
+ fi
+ fi
+ fi
+
+ if test "$linkmode" = prog || test "$mode" = relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+ # Finalize command for both is simple: just hardcode it.
+ if test "$hardcode_direct" = yes; then
+ add="$libdir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ add_dir="-L$libdir"
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+ *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+ esac
+ add="-l$name"
+ elif test "$hardcode_automatic" = yes; then
+ if test -n "$inst_prefix_dir" &&
+ test -f "$inst_prefix_dir$libdir/$linklib" ; then
+ add="$inst_prefix_dir$libdir/$linklib"
+ else
+ add="$libdir/$linklib"
+ fi
+ else
+ # We cannot seem to hardcode it, guess we'll fake it.
+ add_dir="-L$libdir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case $libdir in
+ [\\/]*)
+ add_dir="$add_dir -L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+ add="-l$name"
+ fi
+
+ if test "$linkmode" = prog; then
+ test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+ test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+ else
+ test -n "$add_dir" && deplibs="$add_dir $deplibs"
+ test -n "$add" && deplibs="$add $deplibs"
+ fi
+ fi
+ elif test "$linkmode" = prog; then
+ # Here we assume that one of hardcode_direct or hardcode_minus_L
+ # is not unsupported. This is valid on all known static and
+ # shared platforms.
+ if test "$hardcode_direct" != unsupported; then
+ test -n "$old_library" && linklib="$old_library"
+ compile_deplibs="$dir/$linklib $compile_deplibs"
+ finalize_deplibs="$dir/$linklib $finalize_deplibs"
+ else
+ compile_deplibs="-l$name -L$dir $compile_deplibs"
+ finalize_deplibs="-l$name -L$dir $finalize_deplibs"
+ fi
+ elif test "$build_libtool_libs" = yes; then
+ # Not a shared library
+ if test "$deplibs_check_method" != pass_all; then
+ # We're trying link a shared library against a static one
+ # but the system doesn't support it.
+
+ # Just print a warning and add the library to dependency_libs so
+ # that the program can be linked against the static library.
+ $echo
+ $echo "*** Warning: This system can not link to static lib archive $lib."
+ $echo "*** I have the capability to make that library automatically link in when"
+ $echo "*** you link to this library. But I can only do this if you have a"
+ $echo "*** shared version of the library, which you do not appear to have."
+ if test "$module" = yes; then
+ $echo "*** But as you try to build a module library, libtool will still create "
+ $echo "*** a static module, that should work as long as the dlopening application"
+ $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+ if test -z "$global_symbol_pipe"; then
+ $echo
+ $echo "*** However, this would only work if libtool was able to extract symbol"
+ $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ $echo "*** not find such a program. So, this module is probably useless."
+ $echo "*** \`nm' from GNU binutils and a full rebuild may help."
+ fi
+ if test "$build_old_libs" = no; then
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ fi
+ else
+ deplibs="$dir/$old_library $deplibs"
+ link_static=yes
+ fi
+ fi # link shared/static library?
+
+ if test "$linkmode" = lib; then
+ if test -n "$dependency_libs" &&
+ { test "$hardcode_into_libs" != yes ||
+ test "$build_old_libs" = yes ||
+ test "$link_static" = yes; }; then
+ # Extract -R from dependency_libs
+ temp_deplibs=
+ for libdir in $dependency_libs; do
+ case $libdir in
+ -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
+ case " $xrpath " in
+ *" $temp_xrpath "*) ;;
+ *) xrpath="$xrpath $temp_xrpath";;
+ esac;;
+ *) temp_deplibs="$temp_deplibs $libdir";;
+ esac
+ done
+ dependency_libs="$temp_deplibs"
+ fi
+
+ newlib_search_path="$newlib_search_path $absdir"
+ # Link against this library
+ test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+ # ... and its dependency_libs
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ newdependency_libs="$deplib $newdependency_libs"
+ if test "X$duplicate_deps" = "Xyes" ; then
+ case "$tmp_libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
+ tmp_libs="$tmp_libs $deplib"
+ done
+
+ if test "$link_all_deplibs" != no; then
+ # Add the search paths of all dependency libraries
+ for deplib in $dependency_libs; do
+ case $deplib in
+ -L*) path="$deplib" ;;
+ *.la)
+ dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$dir" = "X$deplib" && dir="."
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ if test -z "$absdir"; then
+ $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
+ absdir="$dir"
+ fi
+ ;;
+ esac
+ if grep "^installed=no" $deplib > /dev/null; then
+ path="$absdir/$objdir"
+ else
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ if test -z "$libdir"; then
+ $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
+ exit $EXIT_FAILURE
+ fi
+ if test "$absdir" != "$libdir"; then
+ $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
+ fi
+ path="$absdir"
+ fi
+ depdepl=
+ case $host in
+ *-*-darwin*)
+ # we do not want to link against static libs,
+ # but need to link against shared
+ eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+ eval deplibdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ if test -n "$deplibrary_names" ; then
+ for tmp in $deplibrary_names ; do
+ depdepl=$tmp
+ done
+ if test -f "$deplibdir/$depdepl" ; then
+ depdepl="$deplibdir/$depdepl"
+ elif test -f "$path/$depdepl" ; then
+ depdepl="$path/$depdepl"
+ else
+ # Can't find it, oh well...
+ depdepl=
+ fi
+ # do not add paths which are already there
+ case " $newlib_search_path " in
+ *" $path "*) ;;
+ *) newlib_search_path="$newlib_search_path $path";;
+ esac
+ fi
+ path=""
+ ;;
+ *)
+ path="-L$path"
+ ;;
+ esac
+ ;;
+ -l*)
+ case $host in
+ *-*-darwin*)
+ # Again, we only want to link against shared libraries
+ eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
+ for tmp in $newlib_search_path ; do
+ if test -f "$tmp/lib$tmp_libs.dylib" ; then
+ eval depdepl="$tmp/lib$tmp_libs.dylib"
+ break
+ fi
+ done
+ path=""
+ ;;
+ *) continue ;;
+ esac
+ ;;
+ *) continue ;;
+ esac
+ case " $deplibs " in
+ *" $path "*) ;;
+ *) deplibs="$path $deplibs" ;;
+ esac
+ case " $deplibs " in
+ *" $depdepl "*) ;;
+ *) deplibs="$depdepl $deplibs" ;;
+ esac
+ done
+ fi # link_all_deplibs != no
+ fi # linkmode = lib
+ done # for deplib in $libs
+ dependency_libs="$newdependency_libs"
+ if test "$pass" = dlpreopen; then
+ # Link the dlpreopened libraries before other libraries
+ for deplib in $save_deplibs; do
+ deplibs="$deplib $deplibs"
+ done
+ fi
+ if test "$pass" != dlopen; then
+ if test "$pass" != conv; then
+ # Make sure lib_search_path contains only unique directories.
+ lib_search_path=
+ for dir in $newlib_search_path; do
+ case "$lib_search_path " in
+ *" $dir "*) ;;
+ *) lib_search_path="$lib_search_path $dir" ;;
+ esac
+ done
+ newlib_search_path=
+ fi
+
+ if test "$linkmode,$pass" != "prog,link"; then
+ vars="deplibs"
+ else
+ vars="compile_deplibs finalize_deplibs"
+ fi
+ for var in $vars dependency_libs; do
+ # Add libraries to $var in reverse order
+ eval tmp_libs=\"\$$var\"
+ new_libs=
+ for deplib in $tmp_libs; do
+ # FIXME: Pedantically, this is the right thing to do, so
+ # that some nasty dependency loop isn't accidentally
+ # broken:
+ #new_libs="$deplib $new_libs"
+ # Pragmatically, this seems to cause very few problems in
+ # practice:
+ case $deplib in
+ -L*) new_libs="$deplib $new_libs" ;;
+ -R*) ;;
+ *)
+ # And here is the reason: when a library appears more
+ # than once as an explicit dependence of a library, or
+ # is implicitly linked in more than once by the
+ # compiler, it is considered special, and multiple
+ # occurrences thereof are not removed. Compare this
+ # with having the same library being listed as a
+ # dependency of multiple other libraries: in this case,
+ # we know (pedantically, we assume) the library does not
+ # need to be listed more than once, so we keep only the
+ # last copy. This is not always right, but it is rare
+ # enough that we require users that really mean to play
+ # such unportable linking tricks to link the library
+ # using -Wl,-lname, so that libtool does not consider it
+ # for duplicate removal.
+ case " $specialdeplibs " in
+ *" $deplib "*) new_libs="$deplib $new_libs" ;;
+ *)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) new_libs="$deplib $new_libs" ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+ done
+ tmp_libs=
+ for deplib in $new_libs; do
+ case $deplib in
+ -L*)
+ case " $tmp_libs " in
+ *" $deplib "*) ;;
+ *) tmp_libs="$tmp_libs $deplib" ;;
+ esac
+ ;;
+ *) tmp_libs="$tmp_libs $deplib" ;;
+ esac
+ done
+ eval $var=\"$tmp_libs\"
+ done # for var
+ fi
+ # Last step: remove runtime libs from dependency_libs
+ # (they stay in deplibs)
+ tmp_libs=
+ for i in $dependency_libs ; do
+ case " $predeps $postdeps $compiler_lib_search_path " in
+ *" $i "*)
+ i=""
+ ;;
+ esac
+ if test -n "$i" ; then
+ tmp_libs="$tmp_libs $i"
+ fi
+ done
+ dependency_libs=$tmp_libs
+ done # for pass
+ if test "$linkmode" = prog; then
+ dlfiles="$newdlfiles"
+ dlprefiles="$newdlprefiles"
+ fi
+
+ case $linkmode in
+ oldlib)
+ case " $deplibs" in
+ *\ -l* | *\ -L*)
+ $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 ;;
+ esac
+
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
+ fi
+
+ if test -n "$rpath"; then
+ $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
+ fi
+
+ if test -n "$xrpath"; then
+ $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
+ fi
+
+ if test -n "$vinfo"; then
+ $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
+ fi
+
+ if test -n "$release"; then
+ $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
+ fi
+
+ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+ $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
+ fi
+
+ # Now set the variables for building old libraries.
+ build_libtool_libs=no
+ oldlibs="$output"
+ objs="$objs$old_deplibs"
+ ;;
+
+ lib)
+ # Make sure we only generate libraries of the form `libNAME.la'.
+ case $outputname in
+ lib*)
+ name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+ eval shared_ext=\"$shrext_cmds\"
+ eval libname=\"$libname_spec\"
+ ;;
+ *)
+ if test "$module" = no; then
+ $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+ if test "$need_lib_prefix" != no; then
+ # Add the "lib" prefix for modules if required
+ name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
+ eval shared_ext=\"$shrext_cmds\"
+ eval libname=\"$libname_spec\"
+ else
+ libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
+ fi
+ ;;
+ esac
+
+ if test -n "$objs"; then
+ if test "$deplibs_check_method" != pass_all; then
+ $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
+ exit $EXIT_FAILURE
+ else
+ $echo
+ $echo "*** Warning: Linking the shared library $output against the non-libtool"
+ $echo "*** objects $objs is not portable!"
+ libobjs="$libobjs $objs"
+ fi
+ fi
+
+ if test "$dlself" != no; then
+ $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
+ fi
+
+ set dummy $rpath
+ if test "$#" -gt 2; then
+ $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
+ fi
+ install_libdir="$2"
+
+ oldlibs=
+ if test -z "$rpath"; then
+ if test "$build_libtool_libs" = yes; then
+ # Building a libtool convenience library.
+ # Some compilers have problems with a `.al' extension so
+ # convenience libraries should have the same extension an
+ # archive normally would.
+ oldlibs="$output_objdir/$libname.$libext $oldlibs"
+ build_libtool_libs=convenience
+ build_old_libs=yes
+ fi
+
+ if test -n "$vinfo"; then
+ $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
+ fi
+
+ if test -n "$release"; then
+ $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
+ fi
+ else
+
+ # Parse the version information argument.
+ save_ifs="$IFS"; IFS=':'
+ set dummy $vinfo 0 0 0
+ IFS="$save_ifs"
+
+ if test -n "$8"; then
+ $echo "$modename: too many parameters to \`-version-info'" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # convert absolute version numbers to libtool ages
+ # this retains compatibility with .la files and attempts
+ # to make the code below a bit more comprehensible
+
+ case $vinfo_number in
+ yes)
+ number_major="$2"
+ number_minor="$3"
+ number_revision="$4"
+ #
+ # There are really only two kinds -- those that
+ # use the current revision as the major version
+ # and those that subtract age and use age as
+ # a minor version. But, then there is irix
+ # which has an extra 1 added just for fun
+ #
+ case $version_type in
+ darwin|linux|osf|windows|none)
+ current=`expr $number_major + $number_minor`
+ age="$number_minor"
+ revision="$number_revision"
+ ;;
+ freebsd-aout|freebsd-elf|sunos)
+ current="$number_major"
+ revision="$number_minor"
+ age="0"
+ ;;
+ irix|nonstopux)
+ current=`expr $number_major + $number_minor`
+ age="$number_minor"
+ revision="$number_minor"
+ lt_irix_increment=no
+ ;;
+ esac
+ ;;
+ no)
+ current="$2"
+ revision="$3"
+ age="$4"
+ ;;
+ esac
+
+ # Check that each of the things are valid numbers.
+ case $current in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ esac
+
+ case $revision in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ esac
+
+ case $age in
+ 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+ *)
+ $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ esac
+
+ if test "$age" -gt "$current"; then
+ $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # Calculate the version variables.
+ major=
+ versuffix=
+ verstring=
+ case $version_type in
+ none) ;;
+
+ darwin)
+ # Like Linux, but with the current version available in
+ # verstring for coding it into the library header
+ major=.`expr $current - $age`
+ versuffix="$major.$age.$revision"
+ # Darwin ld doesn't like 0 for these options...
+ minor_current=`expr $current + 1`
+ xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+ verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+ ;;
+
+ freebsd-aout)
+ major=".$current"
+ versuffix=".$current.$revision";
+ ;;
+
+ freebsd-elf)
+ major=".$current"
+ versuffix=".$current";
+ ;;
+
+ irix | nonstopux)
+ if test "X$lt_irix_increment" = "Xno"; then
+ major=`expr $current - $age`
+ else
+ major=`expr $current - $age + 1`
+ fi
+ case $version_type in
+ nonstopux) verstring_prefix=nonstopux ;;
+ *) verstring_prefix=sgi ;;
+ esac
+ verstring="$verstring_prefix$major.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$revision
+ while test "$loop" -ne 0; do
+ iface=`expr $revision - $loop`
+ loop=`expr $loop - 1`
+ verstring="$verstring_prefix$major.$iface:$verstring"
+ done
+
+ # Before this point, $major must not contain `.'.
+ major=.$major
+ versuffix="$major.$revision"
+ ;;
+
+ linux)
+ major=.`expr $current - $age`
+ versuffix="$major.$age.$revision"
+ ;;
+
+ osf)
+ major=.`expr $current - $age`
+ versuffix=".$current.$age.$revision"
+ verstring="$current.$age.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$age
+ while test "$loop" -ne 0; do
+ iface=`expr $current - $loop`
+ loop=`expr $loop - 1`
+ verstring="$verstring:${iface}.0"
+ done
+
+ # Make executables depend on our current version.
+ verstring="$verstring:${current}.0"
+ ;;
+
+ sunos)
+ major=".$current"
+ versuffix=".$current.$revision"
+ ;;
+
+ windows)
+ # Use '-' rather than '.', since we only want one
+ # extension on DOS 8.3 filesystems.
+ major=`expr $current - $age`
+ versuffix="-$major"
+ ;;
+
+ *)
+ $echo "$modename: unknown library version type \`$version_type'" 1>&2
+ $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ esac
+
+ # Clear the version info if we defaulted, and they specified a release.
+ if test -z "$vinfo" && test -n "$release"; then
+ major=
+ case $version_type in
+ darwin)
+ # we can't check for "0.0" in archive_cmds due to quoting
+ # problems, so we reset it completely
+ verstring=
+ ;;
+ *)
+ verstring="0.0"
+ ;;
+ esac
+ if test "$need_version" = no; then
+ versuffix=
+ else
+ versuffix=".0.0"
+ fi
+ fi
+
+ # Remove version info from name if versioning should be avoided
+ if test "$avoid_version" = yes && test "$need_version" = no; then
+ major=
+ versuffix=
+ verstring=""
+ fi
+
+ # Check to see if the archive will have undefined symbols.
+ if test "$allow_undefined" = yes; then
+ if test "$allow_undefined_flag" = unsupported; then
+ $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
+ build_libtool_libs=no
+ build_old_libs=yes
+ fi
+ else
+ # Don't allow undefined symbols.
+ allow_undefined_flag="$no_undefined_flag"
+ fi
+ fi
+
+ if test "$mode" != relink; then
+ # Remove our outputs, but don't remove object files since they
+ # may have been created when compiling PIC objects.
+ removelist=
+ tempremovelist=`$echo "$output_objdir/*"`
+ for p in $tempremovelist; do
+ case $p in
+ *.$objext)
+ ;;
+ $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+ if test "X$precious_files_regex" != "X"; then
+ if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+ then
+ continue
+ fi
+ fi
+ removelist="$removelist $p"
+ ;;
+ *) ;;
+ esac
+ done
+ if test -n "$removelist"; then
+ $show "${rm}r $removelist"
+ $run ${rm}r $removelist
+ fi
+ fi
+
+ # Now set the variables for building old libraries.
+ if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+ oldlibs="$oldlibs $output_objdir/$libname.$libext"
+
+ # Transform .lo files to .o files.
+ oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
+ fi
+
+ # Eliminate all temporary directories.
+ #for path in $notinst_path; do
+ # lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
+ # deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
+ # dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
+ #done
+
+ if test -n "$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ temp_xrpath=
+ for libdir in $xrpath; do
+ temp_xrpath="$temp_xrpath -R$libdir"
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir" ;;
+ esac
+ done
+ if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+ dependency_libs="$temp_xrpath $dependency_libs"
+ fi
+ fi
+
+ # Make sure dlfiles contains only unique files that won't be dlpreopened
+ old_dlfiles="$dlfiles"
+ dlfiles=
+ for lib in $old_dlfiles; do
+ case " $dlprefiles $dlfiles " in
+ *" $lib "*) ;;
+ *) dlfiles="$dlfiles $lib" ;;
+ esac
+ done
+
+ # Make sure dlprefiles contains only unique files
+ old_dlprefiles="$dlprefiles"
+ dlprefiles=
+ for lib in $old_dlprefiles; do
+ case "$dlprefiles " in
+ *" $lib "*) ;;
+ *) dlprefiles="$dlprefiles $lib" ;;
+ esac
+ done
+
+ if test "$build_libtool_libs" = yes; then
+ if test -n "$rpath"; then
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
+ # these systems don't actually have a c library (as such)!
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C library is in the System framework
+ deplibs="$deplibs -framework System"
+ ;;
+ *-*-netbsd*)
+ # Don't link with libc until the a.out ld.so is fixed.
+ ;;
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ # Do not include libc due to us having libc/libc_r.
+ ;;
+ *-*-sco3.2v5* | *-*-sco5v6*)
+ # Causes problems with __ctype
+ ;;
+ *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+ # Compiler inserts libc in the correct place for threads to work
+ ;;
+ *)
+ # Add libc to deplibs on all other systems if necessary.
+ if test "$build_libtool_need_lc" = "yes"; then
+ deplibs="$deplibs -lc"
+ fi
+ ;;
+ esac
+ fi
+
+ # Transform deplibs into only deplibs that can be linked in shared.
+ name_save=$name
+ libname_save=$libname
+ release_save=$release
+ versuffix_save=$versuffix
+ major_save=$major
+ # I'm not sure if I'm treating the release correctly. I think
+ # release should show up in the -l (ie -lgmp5) so we don't want to
+ # add it in twice. Is that correct?
+ release=""
+ versuffix=""
+ major=""
+ newdeplibs=
+ droppeddeps=no
+ case $deplibs_check_method in
+ pass_all)
+ # Don't check for shared/static. Everything works.
+ # This might be a little naive. We might want to check
+ # whether the library exists or not. But this is on
+ # osf3 & osf4 and I'm not really sure... Just
+ # implementing what was already the behavior.
+ newdeplibs=$deplibs
+ ;;
+ test_compile)
+ # This code stresses the "libraries are programs" paradigm to its
+ # limits. Maybe even breaks it. We compile a program, linking it
+ # against the deplibs as a proxy for the library. Then we can check
+ # whether they linked in statically or dynamically with ldd.
+ $rm conftest.c
+ cat > conftest.c <<EOF
+ int main() { return 0; }
+EOF
+ $rm conftest
+ if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
+ ldd_output=`ldd conftest`
+ for i in $deplibs; do
+ name=`expr $i : '-l\(.*\)'`
+ # If $name is empty we are operating on a -L argument.
+ if test "$name" != "" && test "$name" != "0"; then
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ newdeplibs="$newdeplibs $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval \\$echo \"$libname_spec\"`
+ deplib_matches=`eval \\$echo \"$library_names_spec\"`
+ set dummy $deplib_matches
+ deplib_match=$2
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ newdeplibs="$newdeplibs $i"
+ else
+ droppeddeps=yes
+ $echo
+ $echo "*** Warning: dynamic linker does not accept needed library $i."
+ $echo "*** I have the capability to make that library automatically link in when"
+ $echo "*** you link to this library. But I can only do this if you have a"
+ $echo "*** shared version of the library, which I believe you do not have"
+ $echo "*** because a test_compile did reveal that the linker did not use it for"
+ $echo "*** its dynamic dependency list that programs get resolved with at runtime."
+ fi
+ fi
+ else
+ newdeplibs="$newdeplibs $i"
+ fi
+ done
+ else
+ # Error occurred in the first compile. Let's try to salvage
+ # the situation: Compile a separate program for each library.
+ for i in $deplibs; do
+ name=`expr $i : '-l\(.*\)'`
+ # If $name is empty we are operating on a -L argument.
+ if test "$name" != "" && test "$name" != "0"; then
+ $rm conftest
+ if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
+ ldd_output=`ldd conftest`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ newdeplibs="$newdeplibs $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval \\$echo \"$libname_spec\"`
+ deplib_matches=`eval \\$echo \"$library_names_spec\"`
+ set dummy $deplib_matches
+ deplib_match=$2
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ newdeplibs="$newdeplibs $i"
+ else
+ droppeddeps=yes
+ $echo
+ $echo "*** Warning: dynamic linker does not accept needed library $i."
+ $echo "*** I have the capability to make that library automatically link in when"
+ $echo "*** you link to this library. But I can only do this if you have a"
+ $echo "*** shared version of the library, which you do not appear to have"
+ $echo "*** because a test_compile did reveal that the linker did not use this one"
+ $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+ fi
+ fi
+ else
+ droppeddeps=yes
+ $echo
+ $echo "*** Warning! Library $i is needed by this library but I was not able to"
+ $echo "*** make it link in! You will probably need to install it or some"
+ $echo "*** library that it depends on before this library will be fully"
+ $echo "*** functional. Installing it before continuing would be even better."
+ fi
+ else
+ newdeplibs="$newdeplibs $i"
+ fi
+ done
+ fi
+ ;;
+ file_magic*)
+ set dummy $deplibs_check_method
+ file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+ for a_deplib in $deplibs; do
+ name=`expr $a_deplib : '-l\(.*\)'`
+ # If $name is empty we are operating on a -L argument.
+ if test "$name" != "" && test "$name" != "0"; then
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; then
+ libname=`eval \\$echo \"$libname_spec\"`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ for potent_lib in $potential_libs; do
+ # Follow soft links.
+ if ls -lLd "$potent_lib" 2>/dev/null \
+ | grep " -> " >/dev/null; then
+ continue
+ fi
+ # The statement above tries to avoid entering an
+ # endless loop below, in case of cyclic links.
+ # We might still enter an endless loop, since a link
+ # loop can be closed while we follow links,
+ # but so what?
+ potlib="$potent_lib"
+ while test -h "$potlib" 2>/dev/null; do
+ potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+ case $potliblink in
+ [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+ *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
+ esac
+ done
+ if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
+ | ${SED} 10q \
+ | $EGREP "$file_magic_regex" > /dev/null; then
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+ done
+ done
+ fi
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ $echo
+ $echo "*** Warning: linker path does not have real file for library $a_deplib."
+ $echo "*** I have the capability to make that library automatically link in when"
+ $echo "*** you link to this library. But I can only do this if you have a"
+ $echo "*** shared version of the library, which you do not appear to have"
+ $echo "*** because I did check the linker path looking for a file starting"
+ if test -z "$potlib" ; then
+ $echo "*** with $libname but no candidates were found. (...for file magic test)"
+ else
+ $echo "*** with $libname and none of the candidates passed a file format test"
+ $echo "*** using a file magic. Last file checked: $potlib"
+ fi
+ fi
+ else
+ # Add a -L argument.
+ newdeplibs="$newdeplibs $a_deplib"
+ fi
+ done # Gone through all deplibs.
+ ;;
+ match_pattern*)
+ set dummy $deplibs_check_method
+ match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+ for a_deplib in $deplibs; do
+ name=`expr $a_deplib : '-l\(.*\)'`
+ # If $name is empty we are operating on a -L argument.
+ if test -n "$name" && test "$name" != "0"; then
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; then
+ libname=`eval \\$echo \"$libname_spec\"`
+ for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ for potent_lib in $potential_libs; do
+ potlib="$potent_lib" # see symlink-check above in file_magic test
+ if eval $echo \"$potent_lib\" 2>/dev/null \
+ | ${SED} 10q \
+ | $EGREP "$match_pattern_regex" > /dev/null; then
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+ done
+ done
+ fi
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ $echo
+ $echo "*** Warning: linker path does not have real file for library $a_deplib."
+ $echo "*** I have the capability to make that library automatically link in when"
+ $echo "*** you link to this library. But I can only do this if you have a"
+ $echo "*** shared version of the library, which you do not appear to have"
+ $echo "*** because I did check the linker path looking for a file starting"
+ if test -z "$potlib" ; then
+ $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
+ else
+ $echo "*** with $libname and none of the candidates passed a file format test"
+ $echo "*** using a regex pattern. Last file checked: $potlib"
+ fi
+ fi
+ else
+ # Add a -L argument.
+ newdeplibs="$newdeplibs $a_deplib"
+ fi
+ done # Gone through all deplibs.
+ ;;
+ none | unknown | *)
+ newdeplibs=""
+ tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
+ -e 's/ -[LR][^ ]*//g'`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ for i in $predeps $postdeps ; do
+ # can't use Xsed below, because $i might contain '/'
+ tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
+ done
+ fi
+ if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
+ | grep . >/dev/null; then
+ $echo
+ if test "X$deplibs_check_method" = "Xnone"; then
+ $echo "*** Warning: inter-library dependencies are not supported in this platform."
+ else
+ $echo "*** Warning: inter-library dependencies are not known to be supported."
+ fi
+ $echo "*** All declared inter-library dependencies are being dropped."
+ droppeddeps=yes
+ fi
+ ;;
+ esac
+ versuffix=$versuffix_save
+ major=$major_save
+ release=$release_save
+ libname=$libname_save
+ name=$name_save
+
+ case $host in
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # On Rhapsody replace the C library is the System framework
+ newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'`
+ ;;
+ esac
+
+ if test "$droppeddeps" = yes; then
+ if test "$module" = yes; then
+ $echo
+ $echo "*** Warning: libtool could not satisfy all declared inter-library"
+ $echo "*** dependencies of module $libname. Therefore, libtool will create"
+ $echo "*** a static module, that should work as long as the dlopening"
+ $echo "*** application is linked with the -dlopen flag."
+ if test -z "$global_symbol_pipe"; then
+ $echo
+ $echo "*** However, this would only work if libtool was able to extract symbol"
+ $echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ $echo "*** not find such a program. So, this module is probably useless."
+ $echo "*** \`nm' from GNU binutils and a full rebuild may help."
+ fi
+ if test "$build_old_libs" = no; then
+ oldlibs="$output_objdir/$libname.$libext"
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ else
+ $echo "*** The inter-library dependencies that have been dropped here will be"
+ $echo "*** automatically added whenever a program is linked with this library"
+ $echo "*** or is declared to -dlopen it."
+
+ if test "$allow_undefined" = no; then
+ $echo
+ $echo "*** Since this library must not contain undefined symbols,"
+ $echo "*** because either the platform does not support them or"
+ $echo "*** it was explicitly requested with -no-undefined,"
+ $echo "*** libtool will only create a static version of it."
+ if test "$build_old_libs" = no; then
+ oldlibs="$output_objdir/$libname.$libext"
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ fi
+ fi
+ fi
+ # Done checking deplibs!
+ deplibs=$newdeplibs
+ fi
+
+
+ # move library search paths that coincide with paths to not yet
+ # installed libraries to the beginning of the library search list
+ new_libs=
+ for path in $notinst_path; do
+ case " $new_libs " in
+ *" -L$path/$objdir "*) ;;
+ *)
+ case " $deplibs " in
+ *" -L$path/$objdir "*)
+ new_libs="$new_libs -L$path/$objdir" ;;
+ esac
+ ;;
+ esac
+ done
+ for deplib in $deplibs; do
+ case $deplib in
+ -L*)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) new_libs="$new_libs $deplib" ;;
+ esac
+ ;;
+ *) new_libs="$new_libs $deplib" ;;
+ esac
+ done
+ deplibs="$new_libs"
+
+
+ # All the library-specific variables (install_libdir is set above).
+ library_names=
+ old_library=
+ dlname=
+
+ # Test again, we may have decided not to build it any more
+ if test "$build_libtool_libs" = yes; then
+ if test "$hardcode_into_libs" = yes; then
+ # Hardcode the library paths
+ hardcode_libdirs=
+ dep_rpath=
+ rpath="$finalize_rpath"
+ test "$mode" != relink && rpath="$compile_rpath$rpath"
+ for libdir in $rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ dep_rpath="$dep_rpath $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) perm_rpath="$perm_rpath $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ if test -n "$hardcode_libdir_flag_spec_ld"; then
+ case $archive_cmds in
+ *\$LD*) eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" ;;
+ *) eval dep_rpath=\"$hardcode_libdir_flag_spec\" ;;
+ esac
+ else
+ eval dep_rpath=\"$hardcode_libdir_flag_spec\"
+ fi
+ fi
+ if test -n "$runpath_var" && test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ rpath="$rpath$dir:"
+ done
+ eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+ fi
+ test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
+ fi
+
+ shlibpath="$finalize_shlibpath"
+ test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+ if test -n "$shlibpath"; then
+ eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+ fi
+
+ # Get the real and link names of the library.
+ eval shared_ext=\"$shrext_cmds\"
+ eval library_names=\"$library_names_spec\"
+ set dummy $library_names
+ realname="$2"
+ shift; shift
+
+ if test -n "$soname_spec"; then
+ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+ if test -z "$dlname"; then
+ dlname=$soname
+ fi
+
+ lib="$output_objdir/$realname"
+ linknames=
+ for link
+ do
+ linknames="$linknames $link"
+ done
+
+ # Use standard objects if they are pic
+ test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
+ $show "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $run $rm $export_symbols
+ cmds=$export_symbols_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ if len=`expr "X$cmd" : ".*"` &&
+ test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ skipped_export=false
+ else
+ # The command line is too long to execute in one step.
+ $show "using reloadable object file for export list..."
+ skipped_export=:
+ # Break out early, otherwise skipped_export may be
+ # set to false by a later but shorter cmd.
+ break
+ fi
+ done
+ IFS="$save_ifs"
+ if test -n "$export_symbols_regex"; then
+ $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
+ $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ $show "$mv \"${export_symbols}T\" \"$export_symbols\""
+ $run eval '$mv "${export_symbols}T" "$export_symbols"'
+ fi
+ fi
+ fi
+
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
+ fi
+
+ tmp_deplibs=
+ for test_deplib in $deplibs; do
+ case " $convenience " in
+ *" $test_deplib "*) ;;
+ *)
+ tmp_deplibs="$tmp_deplibs $test_deplib"
+ ;;
+ esac
+ done
+ deplibs="$tmp_deplibs"
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ else
+ gentop="$output_objdir/${outputname}x"
+ generated="$generated $gentop"
+
+ func_extract_archives $gentop $convenience
+ libobjs="$libobjs $func_extract_archives_result"
+ fi
+ fi
+
+ if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+ eval flag=\"$thread_safe_flag_spec\"
+ linker_flags="$linker_flags $flag"
+ fi
+
+ # Make a backup of the uninstalled library when relinking
+ if test "$mode" = relink; then
+ $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
+ fi
+
+ # Do each of the archive commands.
+ if test "$module" = yes && test -n "$module_cmds" ; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ eval test_cmds=\"$module_expsym_cmds\"
+ cmds=$module_expsym_cmds
+ else
+ eval test_cmds=\"$module_cmds\"
+ cmds=$module_cmds
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ eval test_cmds=\"$archive_expsym_cmds\"
+ cmds=$archive_expsym_cmds
+ else
+ eval test_cmds=\"$archive_cmds\"
+ cmds=$archive_cmds
+ fi
+ fi
+
+ if test "X$skipped_export" != "X:" &&
+ len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
+ test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ :
+ else
+ # The command line is too long to link in one step, link piecewise.
+ $echo "creating reloadable object files..."
+
+ # Save the value of $output and $libobjs because we want to
+ # use them later. If we have whole_archive_flag_spec, we
+ # want to use save_libobjs as it was before
+ # whole_archive_flag_spec was expanded, because we can't
+ # assume the linker understands whole_archive_flag_spec.
+ # This may have to be revisited, in case too many
+ # convenience libraries get linked in and end up exceeding
+ # the spec.
+ if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+ save_libobjs=$libobjs
+ fi
+ save_output=$output
+ output_la=`$echo "X$output" | $Xsed -e "$basename"`
+
+ # Clear the reloadable object creation command queue and
+ # initialize k to one.
+ test_cmds=
+ concat_cmds=
+ objlist=
+ delfiles=
+ last_robj=
+ k=1
+ output=$output_objdir/$output_la-${k}.$objext
+ # Loop over the list of objects to be linked.
+ for obj in $save_libobjs
+ do
+ eval test_cmds=\"$reload_cmds $objlist $last_robj\"
+ if test "X$objlist" = X ||
+ { len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
+ test "$len" -le "$max_cmd_len"; }; then
+ objlist="$objlist $obj"
+ else
+ # The command $test_cmds is almost too long, add a
+ # command to the queue.
+ if test "$k" -eq 1 ; then
+ # The first file doesn't have a previous command to add.
+ eval concat_cmds=\"$reload_cmds $objlist $last_robj\"
+ else
+ # All subsequent reloadable object files will link in
+ # the last one created.
+ eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\"
+ fi
+ last_robj=$output_objdir/$output_la-${k}.$objext
+ k=`expr $k + 1`
+ output=$output_objdir/$output_la-${k}.$objext
+ objlist=$obj
+ len=1
+ fi
+ done
+ # Handle the remaining objects by creating one last
+ # reloadable object file. All subsequent reloadable object
+ # files will link in the last one created.
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\"
+
+ if ${skipped_export-false}; then
+ $show "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $run $rm $export_symbols
+ libobjs=$output
+ # Append the command to create the export file.
+ eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
+ fi
+
+ # Set up a command to remove the reloadable object files
+ # after they are used.
+ i=0
+ while test "$i" -lt "$k"
+ do
+ i=`expr $i + 1`
+ delfiles="$delfiles $output_objdir/$output_la-${i}.$objext"
+ done
+
+ $echo "creating a temporary reloadable object file: $output"
+
+ # Loop through the commands generated above and execute them.
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $concat_cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+
+ libobjs=$output
+ # Restore the value of output.
+ output=$save_output
+
+ if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+ eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+ fi
+ # Expand the library linking commands again to reset the
+ # value of $libobjs for piecewise linking.
+
+ # Do each of the archive commands.
+ if test "$module" = yes && test -n "$module_cmds" ; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ cmds=$module_expsym_cmds
+ else
+ cmds=$module_cmds
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ cmds=$archive_expsym_cmds
+ else
+ cmds=$archive_cmds
+ fi
+ fi
+
+ # Append the command to remove the reloadable object files
+ # to the just-reset $cmds.
+ eval cmds=\"\$cmds~\$rm $delfiles\"
+ fi
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd" || {
+ lt_exit=$?
+
+ # Restore the uninstalled library and exit
+ if test "$mode" = relink; then
+ $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
+ fi
+
+ exit $lt_exit
+ }
+ done
+ IFS="$save_ifs"
+
+ # Restore the uninstalled library and exit
+ if test "$mode" = relink; then
+ $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
+
+ if test -n "$convenience"; then
+ if test -z "$whole_archive_flag_spec"; then
+ $show "${rm}r $gentop"
+ $run ${rm}r "$gentop"
+ fi
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ # Create links to the real library.
+ for linkname in $linknames; do
+ if test "$realname" != "$linkname"; then
+ $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
+ $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
+ fi
+ done
+
+ # If -module or -export-dynamic was specified, set the dlname.
+ if test "$module" = yes || test "$export_dynamic" = yes; then
+ # On all known operating systems, these are identical.
+ dlname="$soname"
+ fi
+ fi
+ ;;
+
+ obj)
+ case " $deplibs" in
+ *\ -l* | *\ -L*)
+ $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 ;;
+ esac
+
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
+ fi
+
+ if test -n "$rpath"; then
+ $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
+ fi
+
+ if test -n "$xrpath"; then
+ $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
+ fi
+
+ if test -n "$vinfo"; then
+ $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
+ fi
+
+ if test -n "$release"; then
+ $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
+ fi
+
+ case $output in
+ *.lo)
+ if test -n "$objs$old_deplibs"; then
+ $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
+ exit $EXIT_FAILURE
+ fi
+ libobj="$output"
+ obj=`$echo "X$output" | $Xsed -e "$lo2o"`
+ ;;
+ *)
+ libobj=
+ obj="$output"
+ ;;
+ esac
+
+ # Delete the old objects.
+ $run $rm $obj $libobj
+
+ # Objects from convenience libraries. This assumes
+ # single-version convenience libraries. Whenever we create
+ # different ones for PIC/non-PIC, this we'll have to duplicate
+ # the extraction.
+ reload_conv_objs=
+ gentop=
+ # reload_cmds runs $LD directly, so let us get rid of
+ # -Wl from whole_archive_flag_spec and hope we can get by with
+ # turning comma into space..
+ wl=
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec"; then
+ eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
+ reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
+ else
+ gentop="$output_objdir/${obj}x"
+ generated="$generated $gentop"
+
+ func_extract_archives $gentop $convenience
+ reload_conv_objs="$reload_objs $func_extract_archives_result"
+ fi
+ fi
+
+ # Create the old-style object.
+ reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+
+ output="$obj"
+ cmds=$reload_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+
+ # Exit if we aren't doing a library object file.
+ if test -z "$libobj"; then
+ if test -n "$gentop"; then
+ $show "${rm}r $gentop"
+ $run ${rm}r $gentop
+ fi
+
+ exit $EXIT_SUCCESS
+ fi
+
+ if test "$build_libtool_libs" != yes; then
+ if test -n "$gentop"; then
+ $show "${rm}r $gentop"
+ $run ${rm}r $gentop
+ fi
+
+ # Create an invalid libtool object if no PIC, so that we don't
+ # accidentally link it into a program.
+ # $show "echo timestamp > $libobj"
+ # $run eval "echo timestamp > $libobj" || exit $?
+ exit $EXIT_SUCCESS
+ fi
+
+ if test -n "$pic_flag" || test "$pic_mode" != default; then
+ # Only do commands if we really have different PIC objects.
+ reload_objs="$libobjs $reload_conv_objs"
+ output="$libobj"
+ cmds=$reload_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ fi
+
+ if test -n "$gentop"; then
+ $show "${rm}r $gentop"
+ $run ${rm}r $gentop
+ fi
+
+ exit $EXIT_SUCCESS
+ ;;
+
+ prog)
+ case $host in
+ *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;;
+ esac
+ if test -n "$vinfo"; then
+ $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
+ fi
+
+ if test -n "$release"; then
+ $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
+ fi
+
+ if test "$preload" = yes; then
+ if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
+ test "$dlopen_self_static" = unknown; then
+ $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
+ fi
+ fi
+
+ case $host in
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # On Rhapsody replace the C library is the System framework
+ compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
+ finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
+ ;;
+ esac
+
+ case $host in
+ *darwin*)
+ # Don't allow lazy linking, it breaks C++ global constructors
+ if test "$tagname" = CXX ; then
+ compile_command="$compile_command ${wl}-bind_at_load"
+ finalize_command="$finalize_command ${wl}-bind_at_load"
+ fi
+ ;;
+ esac
+
+
+ # move library search paths that coincide with paths to not yet
+ # installed libraries to the beginning of the library search list
+ new_libs=
+ for path in $notinst_path; do
+ case " $new_libs " in
+ *" -L$path/$objdir "*) ;;
+ *)
+ case " $compile_deplibs " in
+ *" -L$path/$objdir "*)
+ new_libs="$new_libs -L$path/$objdir" ;;
+ esac
+ ;;
+ esac
+ done
+ for deplib in $compile_deplibs; do
+ case $deplib in
+ -L*)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) new_libs="$new_libs $deplib" ;;
+ esac
+ ;;
+ *) new_libs="$new_libs $deplib" ;;
+ esac
+ done
+ compile_deplibs="$new_libs"
+
+
+ compile_command="$compile_command $compile_deplibs"
+ finalize_command="$finalize_command $finalize_deplibs"
+
+ if test -n "$rpath$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ for libdir in $rpath $xrpath; do
+ # This is the magic to use -rpath.
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir" ;;
+ esac
+ done
+ fi
+
+ # Now hardcode the library paths
+ rpath=
+ hardcode_libdirs=
+ for libdir in $compile_rpath $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ rpath="$rpath $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) perm_rpath="$perm_rpath $libdir" ;;
+ esac
+ fi
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+ testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'`
+ case :$dllsearchpath: in
+ *":$libdir:"*) ;;
+ *) dllsearchpath="$dllsearchpath:$libdir";;
+ esac
+ case :$dllsearchpath: in
+ *":$testbindir:"*) ;;
+ *) dllsearchpath="$dllsearchpath:$testbindir";;
+ esac
+ ;;
+ esac
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ compile_rpath="$rpath"
+
+ rpath=
+ hardcode_libdirs=
+ for libdir in $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ rpath="$rpath $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$finalize_perm_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ finalize_rpath="$rpath"
+
+ if test -n "$libobjs" && test "$build_old_libs" = yes; then
+ # Transform all the library objects into standard objects.
+ compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ fi
+
+ dlsyms=
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ if test -n "$NM" && test -n "$global_symbol_pipe"; then
+ dlsyms="${outputname}S.c"
+ else
+ $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
+ fi
+ fi
+
+ if test -n "$dlsyms"; then
+ case $dlsyms in
+ "") ;;
+ *.c)
+ # Discover the nlist of each of the dlfiles.
+ nlist="$output_objdir/${outputname}.nm"
+
+ $show "$rm $nlist ${nlist}S ${nlist}T"
+ $run $rm "$nlist" "${nlist}S" "${nlist}T"
+
+ # Parse the name list into a source file.
+ $show "creating $output_objdir/$dlsyms"
+
+ test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
+/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
+/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+/* Prevent the only kind of declaration conflicts we can make. */
+#define lt_preloaded_symbols some_other_symbol
+
+/* External symbol declarations for the compiler. */\
+"
+
+ if test "$dlself" = yes; then
+ $show "generating symbol list for \`$output'"
+
+ test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
+
+ # Add our own program objects to the symbol list.
+ progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ for arg in $progfiles; do
+ $show "extracting global C symbols from \`$arg'"
+ $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+ done
+
+ if test -n "$exclude_expsyms"; then
+ $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+ $run eval '$mv "$nlist"T "$nlist"'
+ fi
+
+ if test -n "$export_symbols_regex"; then
+ $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+ $run eval '$mv "$nlist"T "$nlist"'
+ fi
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ export_symbols="$output_objdir/$outputname.exp"
+ $run $rm $export_symbols
+ $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+ case $host in
+ *cygwin* | *mingw* )
+ $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+ $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+ ;;
+ esac
+ else
+ $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+ $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
+ $run eval 'mv "$nlist"T "$nlist"'
+ case $host in
+ *cygwin* | *mingw* )
+ $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+ $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+ ;;
+ esac
+ fi
+ fi
+
+ for arg in $dlprefiles; do
+ $show "extracting global C symbols from \`$arg'"
+ name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
+ $run eval '$echo ": $name " >> "$nlist"'
+ $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+ done
+
+ if test -z "$run"; then
+ # Make sure we have at least an empty file.
+ test -f "$nlist" || : > "$nlist"
+
+ if test -n "$exclude_expsyms"; then
+ $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+ $mv "$nlist"T "$nlist"
+ fi
+
+ # Try sorting and uniquifying the output.
+ if grep -v "^: " < "$nlist" |
+ if sort -k 3 </dev/null >/dev/null 2>&1; then
+ sort -k 3
+ else
+ sort +2
+ fi |
+ uniq > "$nlist"S; then
+ :
+ else
+ grep -v "^: " < "$nlist" > "$nlist"S
+ fi
+
+ if test -f "$nlist"S; then
+ eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
+ else
+ $echo '/* NONE */' >> "$output_objdir/$dlsyms"
+ fi
+
+ $echo >> "$output_objdir/$dlsyms" "\
+
+#undef lt_preloaded_symbols
+
+#if defined (__STDC__) && __STDC__
+# define lt_ptr void *
+#else
+# define lt_ptr char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+"
+
+ case $host in
+ *cygwin* | *mingw* )
+ $echo >> "$output_objdir/$dlsyms" "\
+/* DATA imports from DLLs on WIN32 can't be const, because
+ runtime relocations are performed -- see ld's documentation
+ on pseudo-relocs */
+struct {
+"
+ ;;
+ * )
+ $echo >> "$output_objdir/$dlsyms" "\
+const struct {
+"
+ ;;
+ esac
+
+
+ $echo >> "$output_objdir/$dlsyms" "\
+ const char *name;
+ lt_ptr address;
+}
+lt_preloaded_symbols[] =
+{\
+"
+
+ eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
+
+ $echo >> "$output_objdir/$dlsyms" "\
+ {0, (lt_ptr) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+ fi
+
+ pic_flag_for_symtable=
+ case $host in
+ # compiling the symbol table file with pic_flag works around
+ # a FreeBSD bug that causes programs to crash when -lm is
+ # linked before any other PIC object. But we must not use
+ # pic_flag when linking with -static. The problem exists in
+ # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+ *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+ case "$compile_command " in
+ *" -static "*) ;;
+ *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
+ esac;;
+ *-*-hpux*)
+ case "$compile_command " in
+ *" -static "*) ;;
+ *) pic_flag_for_symtable=" $pic_flag";;
+ esac
+ esac
+
+ # Now compile the dynamic symbol file.
+ $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
+ $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
+
+ # Clean up the generated files.
+ $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
+ $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
+
+ # Transform the symbol file into the correct name.
+ case $host in
+ *cygwin* | *mingw* )
+ if test -f "$output_objdir/${outputname}.def" ; then
+ compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
+ finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
+ else
+ compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
+ finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
+ fi
+ ;;
+ * )
+ compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
+ finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
+ ;;
+ esac
+ ;;
+ *)
+ $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ esac
+ else
+ # We keep going just in case the user didn't refer to
+ # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
+ # really was required.
+
+ # Nullify the symbol file.
+ compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
+ finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
+ fi
+
+ if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+ # Replace the output file specification.
+ compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP`
+ link_command="$compile_command$compile_rpath"
+
+ # We have no uninstalled library dependencies, so finalize right now.
+ $show "$link_command"
+ $run eval "$link_command"
+ exit_status=$?
+
+ # Delete the generated files.
+ if test -n "$dlsyms"; then
+ $show "$rm $output_objdir/${outputname}S.${objext}"
+ $run $rm "$output_objdir/${outputname}S.${objext}"
+ fi
+
+ exit $exit_status
+ fi
+
+ if test -n "$shlibpath_var"; then
+ # We should set the shlibpath_var
+ rpath=
+ for dir in $temp_rpath; do
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*)
+ # Absolute path.
+ rpath="$rpath$dir:"
+ ;;
+ *)
+ # Relative path: add a thisdir entry.
+ rpath="$rpath\$thisdir/$dir:"
+ ;;
+ esac
+ done
+ temp_rpath="$rpath"
+ fi
+
+ if test -n "$compile_shlibpath$finalize_shlibpath"; then
+ compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+ fi
+ if test -n "$finalize_shlibpath"; then
+ finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+ fi
+
+ compile_var=
+ finalize_var=
+ if test -n "$runpath_var"; then
+ if test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ rpath="$rpath$dir:"
+ done
+ compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ if test -n "$finalize_perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $finalize_perm_rpath; do
+ rpath="$rpath$dir:"
+ done
+ finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ fi
+
+ if test "$no_install" = yes; then
+ # We don't need to create a wrapper script.
+ link_command="$compile_var$compile_command$compile_rpath"
+ # Replace the output file specification.
+ link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+ # Delete the old output file.
+ $run $rm $output
+ # Link the executable and exit
+ $show "$link_command"
+ $run eval "$link_command" || exit $?
+ exit $EXIT_SUCCESS
+ fi
+
+ if test "$hardcode_action" = relink; then
+ # Fast installation is not supported
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+
+ $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
+ $echo "$modename: \`$output' will be relinked during installation" 1>&2
+ else
+ if test "$fast_install" != no; then
+ link_command="$finalize_var$compile_command$finalize_rpath"
+ if test "$fast_install" = yes; then
+ relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP`
+ else
+ # fast_install is set to needless
+ relink_command=
+ fi
+ else
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+ fi
+ fi
+
+ # Replace the output file specification.
+ link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+ # Delete the old output files.
+ $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+ $show "$link_command"
+ $run eval "$link_command" || exit $?
+
+ # Now create the wrapper script.
+ $show "creating $output"
+
+ # Quote the relink command for shipping.
+ if test -n "$relink_command"; then
+ # Preserve any variables that may affect compiler behavior
+ for var in $variables_saved_for_relink; do
+ if eval test -z \"\${$var+set}\"; then
+ relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
+ elif eval var_value=\$$var; test -z "$var_value"; then
+ relink_command="$var=; export $var; $relink_command"
+ else
+ var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
+ relink_command="$var=\"$var_value\"; export $var; $relink_command"
+ fi
+ done
+ relink_command="(cd `pwd`; $relink_command)"
+ relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
+ fi
+
+ # Quote $echo for shipping.
+ if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then
+ case $progpath in
+ [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";;
+ *) qecho="$SHELL `pwd`/$progpath --fallback-echo";;
+ esac
+ qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
+ else
+ qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
+ fi
+
+ # Only actually do things if our run command is non-null.
+ if test -z "$run"; then
+ # win32 will think the script is a binary if it has
+ # a .exe suffix, so we strip it off here.
+ case $output in
+ *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;;
+ esac
+ # test for cygwin because mv fails w/o .exe extensions
+ case $host in
+ *cygwin*)
+ exeext=.exe
+ outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
+ *) exeext= ;;
+ esac
+ case $host in
+ *cygwin* | *mingw* )
+ output_name=`basename $output`
+ output_path=`dirname $output`
+ cwrappersource="$output_path/$objdir/lt-$output_name.c"
+ cwrapper="$output_path/$output_name.exe"
+ $rm $cwrappersource $cwrapper
+ trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+
+ cat > $cwrappersource <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+ Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+
+ The $output program cannot be directly executed until all the libtool
+ libraries that it depends on are installed.
+
+ This wrapper executable should never be moved out of the build directory.
+ If it is, it will not operate correctly.
+
+ Currently, it simply execs the wrapper *script* "/bin/sh $output",
+ but could eventually absorb all of the scripts functionality and
+ exec $objdir/$outputname directly.
+*/
+EOF
+ cat >> $cwrappersource<<"EOF"
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <sys/stat.h>
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef DIR_SEPARATOR
+# define DIR_SEPARATOR '/'
+# define PATH_SEPARATOR ':'
+#endif
+
+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+ defined (__OS2__)
+# define HAVE_DOS_BASED_FILE_SYSTEM
+# ifndef DIR_SEPARATOR_2
+# define DIR_SEPARATOR_2 '\\'
+# endif
+# ifndef PATH_SEPARATOR_2
+# define PATH_SEPARATOR_2 ';'
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#ifndef PATH_SEPARATOR_2
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
+#else /* PATH_SEPARATOR_2 */
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
+#endif /* PATH_SEPARATOR_2 */
+
+#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+ if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+/* -DDEBUG is fairly common in CFLAGS. */
+#undef DEBUG
+#if defined DEBUGWRAPPER
+# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__)
+#else
+# define DEBUG(format, ...)
+#endif
+
+const char *program_name = NULL;
+
+void * xmalloc (size_t num);
+char * xstrdup (const char *string);
+const char * base_name (const char *name);
+char * find_executable(const char *wrapper);
+int check_executable(const char *path);
+char * strendzap(char *str, const char *pat);
+void lt_fatal (const char *message, ...);
+
+int
+main (int argc, char *argv[])
+{
+ char **newargz;
+ int i;
+
+ program_name = (char *) xstrdup (base_name (argv[0]));
+ DEBUG("(main) argv[0] : %s\n",argv[0]);
+ DEBUG("(main) program_name : %s\n",program_name);
+ newargz = XMALLOC(char *, argc+2);
+EOF
+
+ cat >> $cwrappersource <<EOF
+ newargz[0] = (char *) xstrdup("$SHELL");
+EOF
+
+ cat >> $cwrappersource <<"EOF"
+ newargz[1] = find_executable(argv[0]);
+ if (newargz[1] == NULL)
+ lt_fatal("Couldn't find %s", argv[0]);
+ DEBUG("(main) found exe at : %s\n",newargz[1]);
+ /* we know the script has the same name, without the .exe */
+ /* so make sure newargz[1] doesn't end in .exe */
+ strendzap(newargz[1],".exe");
+ for (i = 1; i < argc; i++)
+ newargz[i+1] = xstrdup(argv[i]);
+ newargz[argc+1] = NULL;
+
+ for (i=0; i<argc+1; i++)
+ {
+ DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]);
+ ;
+ }
+
+EOF
+
+ case $host_os in
+ mingw*)
+ cat >> $cwrappersource <<EOF
+ execv("$SHELL",(char const **)newargz);
+EOF
+ ;;
+ *)
+ cat >> $cwrappersource <<EOF
+ execv("$SHELL",newargz);
+EOF
+ ;;
+ esac
+
+ cat >> $cwrappersource <<"EOF"
+ return 127;
+}
+
+void *
+xmalloc (size_t num)
+{
+ void * p = (void *) malloc (num);
+ if (!p)
+ lt_fatal ("Memory exhausted");
+
+ return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+ return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
+;
+}
+
+const char *
+base_name (const char *name)
+{
+ const char *base;
+
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ /* Skip over the disk name in MSDOS pathnames. */
+ if (isalpha ((unsigned char)name[0]) && name[1] == ':')
+ name += 2;
+#endif
+
+ for (base = name; *name; name++)
+ if (IS_DIR_SEPARATOR (*name))
+ base = name + 1;
+ return base;
+}
+
+int
+check_executable(const char * path)
+{
+ struct stat st;
+
+ DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!");
+ if ((!path) || (!*path))
+ return 0;
+
+ if ((stat (path, &st) >= 0) &&
+ (
+ /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */
+#if defined (S_IXOTH)
+ ((st.st_mode & S_IXOTH) == S_IXOTH) ||
+#endif
+#if defined (S_IXGRP)
+ ((st.st_mode & S_IXGRP) == S_IXGRP) ||
+#endif
+ ((st.st_mode & S_IXUSR) == S_IXUSR))
+ )
+ return 1;
+ else
+ return 0;
+}
+
+/* Searches for the full path of the wrapper. Returns
+ newly allocated full path name if found, NULL otherwise */
+char *
+find_executable (const char* wrapper)
+{
+ int has_slash = 0;
+ const char* p;
+ const char* p_next;
+ /* static buffer for getcwd */
+ char tmp[LT_PATHMAX + 1];
+ int tmp_len;
+ char* concat_name;
+
+ DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!");
+
+ if ((wrapper == NULL) || (*wrapper == '\0'))
+ return NULL;
+
+ /* Absolute path? */
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':')
+ {
+ concat_name = xstrdup (wrapper);
+ if (check_executable(concat_name))
+ return concat_name;
+ XFREE(concat_name);
+ }
+ else
+ {
+#endif
+ if (IS_DIR_SEPARATOR (wrapper[0]))
+ {
+ concat_name = xstrdup (wrapper);
+ if (check_executable(concat_name))
+ return concat_name;
+ XFREE(concat_name);
+ }
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ }
+#endif
+
+ for (p = wrapper; *p; p++)
+ if (*p == '/')
+ {
+ has_slash = 1;
+ break;
+ }
+ if (!has_slash)
+ {
+ /* no slashes; search PATH */
+ const char* path = getenv ("PATH");
+ if (path != NULL)
+ {
+ for (p = path; *p; p = p_next)
+ {
+ const char* q;
+ size_t p_len;
+ for (q = p; *q; q++)
+ if (IS_PATH_SEPARATOR(*q))
+ break;
+ p_len = q - p;
+ p_next = (*q == '\0' ? q : q + 1);
+ if (p_len == 0)
+ {
+ /* empty path: current directory */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal ("getcwd failed");
+ tmp_len = strlen(tmp);
+ concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
+ memcpy (concat_name, tmp, tmp_len);
+ concat_name[tmp_len] = '/';
+ strcpy (concat_name + tmp_len + 1, wrapper);
+ }
+ else
+ {
+ concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1);
+ memcpy (concat_name, p, p_len);
+ concat_name[p_len] = '/';
+ strcpy (concat_name + p_len + 1, wrapper);
+ }
+ if (check_executable(concat_name))
+ return concat_name;
+ XFREE(concat_name);
+ }
+ }
+ /* not found in PATH; assume curdir */
+ }
+ /* Relative path | not found in path: prepend cwd */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal ("getcwd failed");
+ tmp_len = strlen(tmp);
+ concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1);
+ memcpy (concat_name, tmp, tmp_len);
+ concat_name[tmp_len] = '/';
+ strcpy (concat_name + tmp_len + 1, wrapper);
+
+ if (check_executable(concat_name))
+ return concat_name;
+ XFREE(concat_name);
+ return NULL;
+}
+
+char *
+strendzap(char *str, const char *pat)
+{
+ size_t len, patlen;
+
+ assert(str != NULL);
+ assert(pat != NULL);
+
+ len = strlen(str);
+ patlen = strlen(pat);
+
+ if (patlen <= len)
+ {
+ str += len - patlen;
+ if (strcmp(str, pat) == 0)
+ *str = '\0';
+ }
+ return str;
+}
+
+static void
+lt_error_core (int exit_status, const char * mode,
+ const char * message, va_list ap)
+{
+ fprintf (stderr, "%s: %s: ", program_name, mode);
+ vfprintf (stderr, message, ap);
+ fprintf (stderr, ".\n");
+
+ if (exit_status >= 0)
+ exit (exit_status);
+}
+
+void
+lt_fatal (const char *message, ...)
+{
+ va_list ap;
+ va_start (ap, message);
+ lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
+ va_end (ap);
+}
+EOF
+ # we should really use a build-platform specific compiler
+ # here, but OTOH, the wrappers (shell script and this C one)
+ # are only useful if you want to execute the "real" binary.
+ # Since the "real" binary is built for $host, then this
+ # wrapper might as well be built for $host, too.
+ $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource
+ ;;
+ esac
+ $rm $output
+ trap "$rm $output; exit $EXIT_FAILURE" 1 2 15
+
+ $echo > $output "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='${SED} -e 1s/^X//'
+sed_quote_subst='$sed_quote_subst'
+
+# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
+if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '\${1+\"\$@\"}'='\"\$@\"'
+ setopt NO_GLOB_SUBST
+else
+ case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+ # install mode needs the following variable:
+ notinst_deplibs='$notinst_deplibs'
+else
+ # When we are sourced in execute mode, \$file and \$echo are already set.
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ echo=\"$qecho\"
+ file=\"\$0\"
+ # Make sure echo works.
+ if test \"X\$1\" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+ elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
+ # Yippee, \$echo works!
+ :
+ else
+ # Restart under the correct shell, and then maybe \$echo will work.
+ exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
+ fi
+ fi\
+"
+ $echo >> $output "\
+
+ # Find the directory that this script lives in.
+ thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
+ test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+ # Follow symbolic links until we get to the real thisdir.
+ file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
+ while test -n \"\$file\"; do
+ destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
+
+ # If there was a directory component, then change thisdir.
+ if test \"x\$destdir\" != \"x\$file\"; then
+ case \"\$destdir\" in
+ [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+ *) thisdir=\"\$thisdir/\$destdir\" ;;
+ esac
+ fi
+
+ file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
+ file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
+ done
+
+ # Try to get the absolute directory name.
+ absdir=\`cd \"\$thisdir\" && pwd\`
+ test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+ if test "$fast_install" = yes; then
+ $echo >> $output "\
+ program=lt-'$outputname'$exeext
+ progdir=\"\$thisdir/$objdir\"
+
+ if test ! -f \"\$progdir/\$program\" || \\
+ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+ test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+ file=\"\$\$-\$program\"
+
+ if test ! -d \"\$progdir\"; then
+ $mkdir \"\$progdir\"
+ else
+ $rm \"\$progdir/\$file\"
+ fi"
+
+ $echo >> $output "\
+
+ # relink executable if necessary
+ if test -n \"\$relink_command\"; then
+ if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+ else
+ $echo \"\$relink_command_output\" >&2
+ $rm \"\$progdir/\$file\"
+ exit $EXIT_FAILURE
+ fi
+ fi
+
+ $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+ { $rm \"\$progdir/\$program\";
+ $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+ $rm \"\$progdir/\$file\"
+ fi"
+ else
+ $echo >> $output "\
+ program='$outputname'
+ progdir=\"\$thisdir/$objdir\"
+"
+ fi
+
+ $echo >> $output "\
+
+ if test -f \"\$progdir/\$program\"; then"
+
+ # Export our shlibpath_var if we have one.
+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ $echo >> $output "\
+ # Add our own library path to $shlibpath_var
+ $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+ # Some systems cannot cope with colon-terminated $shlibpath_var
+ # The second colon is a workaround for a bug in BeOS R4 sed
+ $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
+
+ export $shlibpath_var
+"
+ fi
+
+ # fixup the dll searchpath if we need to.
+ if test -n "$dllsearchpath"; then
+ $echo >> $output "\
+ # Add the dll search path components to the executable PATH
+ PATH=$dllsearchpath:\$PATH
+"
+ fi
+
+ $echo >> $output "\
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ # Run the actual program with our arguments.
+"
+ case $host in
+ # Backslashes separate directories on plain windows
+ *-*-mingw | *-*-os2*)
+ $echo >> $output "\
+ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+ ;;
+
+ *)
+ $echo >> $output "\
+ exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+ ;;
+ esac
+ $echo >> $output "\
+ \$echo \"\$0: cannot exec \$program \$*\"
+ exit $EXIT_FAILURE
+ fi
+ else
+ # The program doesn't exist.
+ \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
+ \$echo \"This script is just a wrapper for \$program.\" 1>&2
+ $echo \"See the $PACKAGE documentation for more information.\" 1>&2
+ exit $EXIT_FAILURE
+ fi
+fi\
+"
+ chmod +x $output
+ fi
+ exit $EXIT_SUCCESS
+ ;;
+ esac
+
+ # See if we need to build an old-fashioned archive.
+ for oldlib in $oldlibs; do
+
+ if test "$build_libtool_libs" = convenience; then
+ oldobjs="$libobjs_save"
+ addlibs="$convenience"
+ build_libtool_libs=no
+ else
+ if test "$build_libtool_libs" = module; then
+ oldobjs="$libobjs_save"
+ build_libtool_libs=no
+ else
+ oldobjs="$old_deplibs $non_pic_objects"
+ fi
+ addlibs="$old_convenience"
+ fi
+
+ if test -n "$addlibs"; then
+ gentop="$output_objdir/${outputname}x"
+ generated="$generated $gentop"
+
+ func_extract_archives $gentop $addlibs
+ oldobjs="$oldobjs $func_extract_archives_result"
+ fi
+
+ # Do each command in the archive commands.
+ if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+ cmds=$old_archive_from_new_cmds
+ else
+ # POSIX demands no paths to be encoded in archives. We have
+ # to avoid creating archives with duplicate basenames if we
+ # might have to extract them afterwards, e.g., when creating a
+ # static archive out of a convenience library, or when linking
+ # the entirety of a libtool archive into another (currently
+ # not supported by libtool).
+ if (for obj in $oldobjs
+ do
+ $echo "X$obj" | $Xsed -e 's%^.*/%%'
+ done | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ $echo "copying selected object files to avoid basename conflicts..."
+
+ if test -z "$gentop"; then
+ gentop="$output_objdir/${outputname}x"
+ generated="$generated $gentop"
+
+ $show "${rm}r $gentop"
+ $run ${rm}r "$gentop"
+ $show "$mkdir $gentop"
+ $run $mkdir "$gentop"
+ exit_status=$?
+ if test "$exit_status" -ne 0 && test ! -d "$gentop"; then
+ exit $exit_status
+ fi
+ fi
+
+ save_oldobjs=$oldobjs
+ oldobjs=
+ counter=1
+ for obj in $save_oldobjs
+ do
+ objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
+ case " $oldobjs " in
+ " ") oldobjs=$obj ;;
+ *[\ /]"$objbase "*)
+ while :; do
+ # Make sure we don't pick an alternate name that also
+ # overlaps.
+ newobj=lt$counter-$objbase
+ counter=`expr $counter + 1`
+ case " $oldobjs " in
+ *[\ /]"$newobj "*) ;;
+ *) if test ! -f "$gentop/$newobj"; then break; fi ;;
+ esac
+ done
+ $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+ $run ln "$obj" "$gentop/$newobj" ||
+ $run cp "$obj" "$gentop/$newobj"
+ oldobjs="$oldobjs $gentop/$newobj"
+ ;;
+ *) oldobjs="$oldobjs $obj" ;;
+ esac
+ done
+ fi
+
+ eval cmds=\"$old_archive_cmds\"
+
+ if len=`expr "X$cmds" : ".*"` &&
+ test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ cmds=$old_archive_cmds
+ else
+ # the command line is too long to link in one step, link in parts
+ $echo "using piecewise archive linking..."
+ save_RANLIB=$RANLIB
+ RANLIB=:
+ objlist=
+ concat_cmds=
+ save_oldobjs=$oldobjs
+
+ # Is there a better way of finding the last object in the list?
+ for obj in $save_oldobjs
+ do
+ last_oldobj=$obj
+ done
+ for obj in $save_oldobjs
+ do
+ oldobjs="$objlist $obj"
+ objlist="$objlist $obj"
+ eval test_cmds=\"$old_archive_cmds\"
+ if len=`expr "X$test_cmds" : ".*" 2>/dev/null` &&
+ test "$len" -le "$max_cmd_len"; then
+ :
+ else
+ # the above command should be used before it gets too long
+ oldobjs=$objlist
+ if test "$obj" = "$last_oldobj" ; then
+ RANLIB=$save_RANLIB
+ fi
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+ objlist=
+ fi
+ done
+ RANLIB=$save_RANLIB
+ oldobjs=$objlist
+ if test "X$oldobjs" = "X" ; then
+ eval cmds=\"\$concat_cmds\"
+ else
+ eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
+ fi
+ fi
+ fi
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ eval cmd=\"$cmd\"
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ done
+
+ if test -n "$generated"; then
+ $show "${rm}r$generated"
+ $run ${rm}r$generated
+ fi
+
+ # Now create the libtool archive.
+ case $output in
+ *.la)
+ old_library=
+ test "$build_old_libs" = yes && old_library="$libname.$libext"
+ $show "creating $output"
+
+ # Preserve any variables that may affect compiler behavior
+ for var in $variables_saved_for_relink; do
+ if eval test -z \"\${$var+set}\"; then
+ relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
+ elif eval var_value=\$$var; test -z "$var_value"; then
+ relink_command="$var=; export $var; $relink_command"
+ else
+ var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
+ relink_command="$var=\"$var_value\"; export $var; $relink_command"
+ fi
+ done
+ # Quote the link command for shipping.
+ relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+ relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
+ if test "$hardcode_automatic" = yes ; then
+ relink_command=
+ fi
+
+
+ # Only create the output if not a dry run.
+ if test -z "$run"; then
+ for installed in no yes; do
+ if test "$installed" = yes; then
+ if test -z "$install_libdir"; then
+ break
+ fi
+ output="$output_objdir/$outputname"i
+ # Replace all uninstalled libtool libraries with the installed ones
+ newdependency_libs=
+ for deplib in $dependency_libs; do
+ case $deplib in
+ *.la)
+ name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ if test -z "$libdir"; then
+ $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
+ exit $EXIT_FAILURE
+ fi
+ newdependency_libs="$newdependency_libs $libdir/$name"
+ ;;
+ *) newdependency_libs="$newdependency_libs $deplib" ;;
+ esac
+ done
+ dependency_libs="$newdependency_libs"
+ newdlfiles=
+ for lib in $dlfiles; do
+ name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ if test -z "$libdir"; then
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ exit $EXIT_FAILURE
+ fi
+ newdlfiles="$newdlfiles $libdir/$name"
+ done
+ dlfiles="$newdlfiles"
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ if test -z "$libdir"; then
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ exit $EXIT_FAILURE
+ fi
+ newdlprefiles="$newdlprefiles $libdir/$name"
+ done
+ dlprefiles="$newdlprefiles"
+ else
+ newdlfiles=
+ for lib in $dlfiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ newdlfiles="$newdlfiles $abs"
+ done
+ dlfiles="$newdlfiles"
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ newdlprefiles="$newdlprefiles $abs"
+ done
+ dlprefiles="$newdlprefiles"
+ fi
+ $rm $output
+ # place dlname in correct position for cygwin
+ tdlname=$dlname
+ case $host,$output,$installed,$module,$dlname in
+ *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
+ esac
+ $echo > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='$tdlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Is this an already installed library?
+installed=$installed
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
+
+# Files to dlopen/dlpreopen
+dlopen='$dlfiles'
+dlpreopen='$dlprefiles'
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'"
+ if test "$installed" = no && test "$need_relink" = yes; then
+ $echo >> $output "\
+relink_command=\"$relink_command\""
+ fi
+ done
+ fi
+
+ # Do a symbolic link so that the libtool archive can be found in
+ # LD_LIBRARY_PATH before the program is installed.
+ $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
+ $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
+ ;;
+ esac
+ exit $EXIT_SUCCESS
+ ;;
+
+ # libtool install mode
+ install)
+ modename="$modename: install"
+
+ # There may be an optional sh(1) argument at the beginning of
+ # install_prog (especially on Windows NT).
+ if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+ # Allow the use of GNU shtool's install command.
+ $echo "X$nonopt" | grep shtool > /dev/null; then
+ # Aesthetically quote it.
+ arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ arg="\"$arg\""
+ ;;
+ esac
+ install_prog="$arg "
+ arg="$1"
+ shift
+ else
+ install_prog=
+ arg=$nonopt
+ fi
+
+ # The real first argument should be the name of the installation program.
+ # Aesthetically quote it.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ arg="\"$arg\""
+ ;;
+ esac
+ install_prog="$install_prog$arg"
+
+ # We need to accept at least all the BSD install flags.
+ dest=
+ files=
+ opts=
+ prev=
+ install_type=
+ isdir=no
+ stripme=
+ for arg
+ do
+ if test -n "$dest"; then
+ files="$files $dest"
+ dest=$arg
+ continue
+ fi
+
+ case $arg in
+ -d) isdir=yes ;;
+ -f)
+ case " $install_prog " in
+ *[\\\ /]cp\ *) ;;
+ *) prev=$arg ;;
+ esac
+ ;;
+ -g | -m | -o) prev=$arg ;;
+ -s)
+ stripme=" -s"
+ continue
+ ;;
+ -*)
+ ;;
+ *)
+ # If the previous option needed an argument, then skip it.
+ if test -n "$prev"; then
+ prev=
+ else
+ dest=$arg
+ continue
+ fi
+ ;;
+ esac
+
+ # Aesthetically quote the argument.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ arg="\"$arg\""
+ ;;
+ esac
+ install_prog="$install_prog $arg"
+ done
+
+ if test -z "$install_prog"; then
+ $echo "$modename: you must specify an install program" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ if test -n "$prev"; then
+ $echo "$modename: the \`$prev' option requires an argument" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ if test -z "$files"; then
+ if test -z "$dest"; then
+ $echo "$modename: no file or destination specified" 1>&2
+ else
+ $echo "$modename: you must specify a destination" 1>&2
+ fi
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # Strip any trailing slash from the destination.
+ dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
+
+ # Check to see that the destination is a directory.
+ test -d "$dest" && isdir=yes
+ if test "$isdir" = yes; then
+ destdir="$dest"
+ destname=
+ else
+ destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$destdir" = "X$dest" && destdir=.
+ destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
+
+ # Not a directory, so check to see that there is only one file specified.
+ set dummy $files
+ if test "$#" -gt 2; then
+ $echo "$modename: \`$dest' is not a directory" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+ fi
+ case $destdir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ for file in $files; do
+ case $file in
+ *.lo) ;;
+ *)
+ $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic="$magic"
+
+ staticlibs=
+ future_libdirs=
+ current_libdirs=
+ for file in $files; do
+
+ # Do each installation.
+ case $file in
+ *.$libext)
+ # Do the static libraries later.
+ staticlibs="$staticlibs $file"
+ ;;
+
+ *.la)
+ # Check to see that this really is a libtool archive.
+ if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ library_names=
+ old_library=
+ relink_command=
+ # If there is no directory component, then add one.
+ case $file in
+ */* | *\\*) . $file ;;
+ *) . ./$file ;;
+ esac
+
+ # Add the libdir to current_libdirs if it is the destination.
+ if test "X$destdir" = "X$libdir"; then
+ case "$current_libdirs " in
+ *" $libdir "*) ;;
+ *) current_libdirs="$current_libdirs $libdir" ;;
+ esac
+ else
+ # Note the libdir as a future libdir.
+ case "$future_libdirs " in
+ *" $libdir "*) ;;
+ *) future_libdirs="$future_libdirs $libdir" ;;
+ esac
+ fi
+
+ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
+ test "X$dir" = "X$file/" && dir=
+ dir="$dir$objdir"
+
+ if test -n "$relink_command"; then
+ # Determine the prefix the user has applied to our future dir.
+ inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
+
+ # Don't allow the user to place us outside of our expected
+ # location b/c this prevents finding dependent libraries that
+ # are installed to the same prefix.
+ # At present, this check doesn't affect windows .dll's that
+ # are installed into $libdir/../bin (currently, that works fine)
+ # but it's something to keep an eye on.
+ if test "$inst_prefix_dir" = "$destdir"; then
+ $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ if test -n "$inst_prefix_dir"; then
+ # Stick the inst_prefix_dir data into the link command.
+ relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP`
+ else
+ relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP`
+ fi
+
+ $echo "$modename: warning: relinking \`$file'" 1>&2
+ $show "$relink_command"
+ if $run eval "$relink_command"; then :
+ else
+ $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
+ exit $EXIT_FAILURE
+ fi
+ fi
+
+ # See the names of the shared library.
+ set dummy $library_names
+ if test -n "$2"; then
+ realname="$2"
+ shift
+ shift
+
+ srcname="$realname"
+ test -n "$relink_command" && srcname="$realname"T
+
+ # Install the shared library and build the symlinks.
+ $show "$install_prog $dir/$srcname $destdir/$realname"
+ $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
+ if test -n "$stripme" && test -n "$striplib"; then
+ $show "$striplib $destdir/$realname"
+ $run eval "$striplib $destdir/$realname" || exit $?
+ fi
+
+ if test "$#" -gt 0; then
+ # Delete the old symlinks, and create new ones.
+ # Try `ln -sf' first, because the `ln' binary might depend on
+ # the symlink we replace! Solaris /bin/ln does not understand -f,
+ # so we also need to try rm && ln -s.
+ for linkname
+ do
+ if test "$linkname" != "$realname"; then
+ $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
+ $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })"
+ fi
+ done
+ fi
+
+ # Do each command in the postinstall commands.
+ lib="$destdir/$realname"
+ cmds=$postinstall_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd" || {
+ lt_exit=$?
+
+ # Restore the uninstalled library and exit
+ if test "$mode" = relink; then
+ $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)'
+ fi
+
+ exit $lt_exit
+ }
+ done
+ IFS="$save_ifs"
+ fi
+
+ # Install the pseudo-library for information purposes.
+ name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ instname="$dir/$name"i
+ $show "$install_prog $instname $destdir/$name"
+ $run eval "$install_prog $instname $destdir/$name" || exit $?
+
+ # Maybe install the static library, too.
+ test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
+ ;;
+
+ *.lo)
+ # Install (i.e. copy) a libtool object.
+
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ destfile="$destdir/$destfile"
+ fi
+
+ # Deduce the name of the destination old-style object file.
+ case $destfile in
+ *.lo)
+ staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
+ ;;
+ *.$objext)
+ staticdest="$destfile"
+ destfile=
+ ;;
+ *)
+ $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ esac
+
+ # Install the libtool object if requested.
+ if test -n "$destfile"; then
+ $show "$install_prog $file $destfile"
+ $run eval "$install_prog $file $destfile" || exit $?
+ fi
+
+ # Install the old object if enabled.
+ if test "$build_old_libs" = yes; then
+ # Deduce the name of the old-style object file.
+ staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
+
+ $show "$install_prog $staticobj $staticdest"
+ $run eval "$install_prog \$staticobj \$staticdest" || exit $?
+ fi
+ exit $EXIT_SUCCESS
+ ;;
+
+ *)
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ destfile="$destdir/$destfile"
+ fi
+
+ # If the file is missing, and there is a .exe on the end, strip it
+ # because it is most likely a libtool script we actually want to
+ # install
+ stripped_ext=""
+ case $file in
+ *.exe)
+ if test ! -f "$file"; then
+ file=`$echo $file|${SED} 's,.exe$,,'`
+ stripped_ext=".exe"
+ fi
+ ;;
+ esac
+
+ # Do a test to see if this is really a libtool program.
+ case $host in
+ *cygwin*|*mingw*)
+ wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
+ ;;
+ *)
+ wrapper=$file
+ ;;
+ esac
+ if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
+ notinst_deplibs=
+ relink_command=
+
+ # Note that it is not necessary on cygwin/mingw to append a dot to
+ # foo even if both foo and FILE.exe exist: automatic-append-.exe
+ # behavior happens only for exec(3), not for open(2)! Also, sourcing
+ # `FILE.' does not work on cygwin managed mounts.
+ #
+ # If there is no directory component, then add one.
+ case $wrapper in
+ */* | *\\*) . ${wrapper} ;;
+ *) . ./${wrapper} ;;
+ esac
+
+ # Check the variables that should have been set.
+ if test -z "$notinst_deplibs"; then
+ $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ finalize=yes
+ for lib in $notinst_deplibs; do
+ # Check to see that each library is installed.
+ libdir=
+ if test -f "$lib"; then
+ # If there is no directory component, then add one.
+ case $lib in
+ */* | *\\*) . $lib ;;
+ *) . ./$lib ;;
+ esac
+ fi
+ libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
+ if test -n "$libdir" && test ! -f "$libfile"; then
+ $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
+ finalize=no
+ fi
+ done
+
+ relink_command=
+ # Note that it is not necessary on cygwin/mingw to append a dot to
+ # foo even if both foo and FILE.exe exist: automatic-append-.exe
+ # behavior happens only for exec(3), not for open(2)! Also, sourcing
+ # `FILE.' does not work on cygwin managed mounts.
+ #
+ # If there is no directory component, then add one.
+ case $wrapper in
+ */* | *\\*) . ${wrapper} ;;
+ *) . ./${wrapper} ;;
+ esac
+
+ outputname=
+ if test "$fast_install" = no && test -n "$relink_command"; then
+ if test "$finalize" = yes && test -z "$run"; then
+ tmpdir=`func_mktempdir`
+ file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
+ outputname="$tmpdir/$file"
+ # Replace the output file specification.
+ relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP`
+
+ $show "$relink_command"
+ if $run eval "$relink_command"; then :
+ else
+ $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
+ ${rm}r "$tmpdir"
+ continue
+ fi
+ file="$outputname"
+ else
+ $echo "$modename: warning: cannot relink \`$file'" 1>&2
+ fi
+ else
+ # Install the binary that we compiled earlier.
+ file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
+ fi
+ fi
+
+ # remove .exe since cygwin /usr/bin/install will append another
+ # one anyway
+ case $install_prog,$host in
+ */usr/bin/install*,*cygwin*)
+ case $file:$destfile in
+ *.exe:*.exe)
+ # this is ok
+ ;;
+ *.exe:*)
+ destfile=$destfile.exe
+ ;;
+ *:*.exe)
+ destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'`
+ ;;
+ esac
+ ;;
+ esac
+ $show "$install_prog$stripme $file $destfile"
+ $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
+ test -n "$outputname" && ${rm}r "$tmpdir"
+ ;;
+ esac
+ done
+
+ for file in $staticlibs; do
+ name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+
+ # Set up the ranlib parameters.
+ oldlib="$destdir/$name"
+
+ $show "$install_prog $file $oldlib"
+ $run eval "$install_prog \$file \$oldlib" || exit $?
+
+ if test -n "$stripme" && test -n "$old_striplib"; then
+ $show "$old_striplib $oldlib"
+ $run eval "$old_striplib $oldlib" || exit $?
+ fi
+
+ # Do each command in the postinstall commands.
+ cmds=$old_postinstall_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ done
+
+ if test -n "$future_libdirs"; then
+ $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
+ fi
+
+ if test -n "$current_libdirs"; then
+ # Maybe just do a dry run.
+ test -n "$run" && current_libdirs=" -n$current_libdirs"
+ exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+ else
+ exit $EXIT_SUCCESS
+ fi
+ ;;
+
+ # libtool finish mode
+ finish)
+ modename="$modename: finish"
+ libdirs="$nonopt"
+ admincmds=
+
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ for dir
+ do
+ libdirs="$libdirs $dir"
+ done
+
+ for libdir in $libdirs; do
+ if test -n "$finish_cmds"; then
+ # Do each command in the finish commands.
+ cmds=$finish_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd" || admincmds="$admincmds
+ $cmd"
+ done
+ IFS="$save_ifs"
+ fi
+ if test -n "$finish_eval"; then
+ # Do the single finish_eval.
+ eval cmds=\"$finish_eval\"
+ $run eval "$cmds" || admincmds="$admincmds
+ $cmds"
+ fi
+ done
+ fi
+
+ # Exit here if they wanted silent mode.
+ test "$show" = : && exit $EXIT_SUCCESS
+
+ $echo "X----------------------------------------------------------------------" | $Xsed
+ $echo "Libraries have been installed in:"
+ for libdir in $libdirs; do
+ $echo " $libdir"
+ done
+ $echo
+ $echo "If you ever happen to want to link against installed libraries"
+ $echo "in a given directory, LIBDIR, you must either use libtool, and"
+ $echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+ $echo "flag during linking and do at least one of the following:"
+ if test -n "$shlibpath_var"; then
+ $echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
+ $echo " during execution"
+ fi
+ if test -n "$runpath_var"; then
+ $echo " - add LIBDIR to the \`$runpath_var' environment variable"
+ $echo " during linking"
+ fi
+ if test -n "$hardcode_libdir_flag_spec"; then
+ libdir=LIBDIR
+ eval flag=\"$hardcode_libdir_flag_spec\"
+
+ $echo " - use the \`$flag' linker flag"
+ fi
+ if test -n "$admincmds"; then
+ $echo " - have your system administrator run these commands:$admincmds"
+ fi
+ if test -f /etc/ld.so.conf; then
+ $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+ fi
+ $echo
+ $echo "See any operating system documentation about shared libraries for"
+ $echo "more information, such as the ld(1) and ld.so(8) manual pages."
+ $echo "X----------------------------------------------------------------------" | $Xsed
+ exit $EXIT_SUCCESS
+ ;;
+
+ # libtool execute mode
+ execute)
+ modename="$modename: execute"
+
+ # The first argument is the command name.
+ cmd="$nonopt"
+ if test -z "$cmd"; then
+ $echo "$modename: you must specify a COMMAND" 1>&2
+ $echo "$help"
+ exit $EXIT_FAILURE
+ fi
+
+ # Handle -dlopen flags immediately.
+ for file in $execute_dlfiles; do
+ if test ! -f "$file"; then
+ $echo "$modename: \`$file' is not a file" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ dir=
+ case $file in
+ *.la)
+ # Check to see that this really is a libtool archive.
+ if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # Read the libtool library.
+ dlname=
+ library_names=
+
+ # If there is no directory component, then add one.
+ case $file in
+ */* | *\\*) . $file ;;
+ *) . ./$file ;;
+ esac
+
+ # Skip this library if it cannot be dlopened.
+ if test -z "$dlname"; then
+ # Warn if it was a shared library.
+ test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
+ continue
+ fi
+
+ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$dir" = "X$file" && dir=.
+
+ if test -f "$dir/$objdir/$dlname"; then
+ dir="$dir/$objdir"
+ else
+ if test ! -f "$dir/$dlname"; then
+ $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
+ exit $EXIT_FAILURE
+ fi
+ fi
+ ;;
+
+ *.lo)
+ # Just add the directory containing the .lo file.
+ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$dir" = "X$file" && dir=.
+ ;;
+
+ *)
+ $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
+ continue
+ ;;
+ esac
+
+ # Get the absolute pathname.
+ absdir=`cd "$dir" && pwd`
+ test -n "$absdir" && dir="$absdir"
+
+ # Now add the directory to shlibpath_var.
+ if eval "test -z \"\$$shlibpath_var\""; then
+ eval "$shlibpath_var=\"\$dir\""
+ else
+ eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+ fi
+ done
+
+ # This variable tells wrapper scripts just to set shlibpath_var
+ # rather than running their programs.
+ libtool_execute_magic="$magic"
+
+ # Check if any of the arguments is a wrapper script.
+ args=
+ for file
+ do
+ case $file in
+ -*) ;;
+ *)
+ # Do a test to see if this is really a libtool program.
+ if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ # If there is no directory component, then add one.
+ case $file in
+ */* | *\\*) . $file ;;
+ *) . ./$file ;;
+ esac
+
+ # Transform arg to wrapped name.
+ file="$progdir/$program"
+ fi
+ ;;
+ esac
+ # Quote arguments (to preserve shell metacharacters).
+ file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
+ args="$args \"$file\""
+ done
+
+ if test -z "$run"; then
+ if test -n "$shlibpath_var"; then
+ # Export the shlibpath_var.
+ eval "export $shlibpath_var"
+ fi
+
+ # Restore saved environment variables
+ for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+ do
+ eval "if test \"\${save_$lt_var+set}\" = set; then
+ $lt_var=\$save_$lt_var; export $lt_var
+ fi"
+ done
+
+ # Now prepare to actually exec the command.
+ exec_cmd="\$cmd$args"
+ else
+ # Display what would be done.
+ if test -n "$shlibpath_var"; then
+ eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
+ $echo "export $shlibpath_var"
+ fi
+ $echo "$cmd$args"
+ exit $EXIT_SUCCESS
+ fi
+ ;;
+
+ # libtool clean and uninstall mode
+ clean | uninstall)
+ modename="$modename: $mode"
+ rm="$nonopt"
+ files=
+ rmforce=
+ exit_status=0
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic="$magic"
+
+ for arg
+ do
+ case $arg in
+ -f) rm="$rm $arg"; rmforce=yes ;;
+ -*) rm="$rm $arg" ;;
+ *) files="$files $arg" ;;
+ esac
+ done
+
+ if test -z "$rm"; then
+ $echo "$modename: you must specify an RM program" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ rmdirs=
+
+ origobjdir="$objdir"
+ for file in $files; do
+ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$dir" = "X$file"; then
+ dir=.
+ objdir="$origobjdir"
+ else
+ objdir="$dir/$origobjdir"
+ fi
+ name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ test "$mode" = uninstall && objdir="$dir"
+
+ # Remember objdir for removal later, being careful to avoid duplicates
+ if test "$mode" = clean; then
+ case " $rmdirs " in
+ *" $objdir "*) ;;
+ *) rmdirs="$rmdirs $objdir" ;;
+ esac
+ fi
+
+ # Don't error if the file doesn't exist and rm -f was used.
+ if (test -L "$file") >/dev/null 2>&1 \
+ || (test -h "$file") >/dev/null 2>&1 \
+ || test -f "$file"; then
+ :
+ elif test -d "$file"; then
+ exit_status=1
+ continue
+ elif test "$rmforce" = yes; then
+ continue
+ fi
+
+ rmfiles="$file"
+
+ case $name in
+ *.la)
+ # Possibly a libtool archive, so verify it.
+ if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ . $dir/$name
+
+ # Delete the libtool libraries and symlinks.
+ for n in $library_names; do
+ rmfiles="$rmfiles $objdir/$n"
+ done
+ test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
+
+ case "$mode" in
+ clean)
+ case " $library_names " in
+ # " " in the beginning catches empty $dlname
+ *" $dlname "*) ;;
+ *) rmfiles="$rmfiles $objdir/$dlname" ;;
+ esac
+ test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+ ;;
+ uninstall)
+ if test -n "$library_names"; then
+ # Do each command in the postuninstall commands.
+ cmds=$postuninstall_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd"
+ if test "$?" -ne 0 && test "$rmforce" != yes; then
+ exit_status=1
+ fi
+ done
+ IFS="$save_ifs"
+ fi
+
+ if test -n "$old_library"; then
+ # Do each command in the old_postuninstall commands.
+ cmds=$old_postuninstall_cmds
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ eval cmd=\"$cmd\"
+ $show "$cmd"
+ $run eval "$cmd"
+ if test "$?" -ne 0 && test "$rmforce" != yes; then
+ exit_status=1
+ fi
+ done
+ IFS="$save_ifs"
+ fi
+ # FIXME: should reinstall the best remaining shared library.
+ ;;
+ esac
+ fi
+ ;;
+
+ *.lo)
+ # Possibly a libtool object, so verify it.
+ if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+
+ # Read the .lo file
+ . $dir/$name
+
+ # Add PIC object to the list of files to remove.
+ if test -n "$pic_object" \
+ && test "$pic_object" != none; then
+ rmfiles="$rmfiles $dir/$pic_object"
+ fi
+
+ # Add non-PIC object to the list of files to remove.
+ if test -n "$non_pic_object" \
+ && test "$non_pic_object" != none; then
+ rmfiles="$rmfiles $dir/$non_pic_object"
+ fi
+ fi
+ ;;
+
+ *)
+ if test "$mode" = clean ; then
+ noexename=$name
+ case $file in
+ *.exe)
+ file=`$echo $file|${SED} 's,.exe$,,'`
+ noexename=`$echo $name|${SED} 's,.exe$,,'`
+ # $file with .exe has already been added to rmfiles,
+ # add $file without .exe
+ rmfiles="$rmfiles $file"
+ ;;
+ esac
+ # Do a test to see if this is a libtool program.
+ if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ relink_command=
+ . $dir/$noexename
+
+ # note $name still contains .exe if it was in $file originally
+ # as does the version of $file that was added into $rmfiles
+ rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
+ if test "$fast_install" = yes && test -n "$relink_command"; then
+ rmfiles="$rmfiles $objdir/lt-$name"
+ fi
+ if test "X$noexename" != "X$name" ; then
+ rmfiles="$rmfiles $objdir/lt-${noexename}.c"
+ fi
+ fi
+ fi
+ ;;
+ esac
+ $show "$rm $rmfiles"
+ $run $rm $rmfiles || exit_status=1
+ done
+ objdir="$origobjdir"
+
+ # Try to remove the ${objdir}s in the directories where we deleted files
+ for dir in $rmdirs; do
+ if test -d "$dir"; then
+ $show "rmdir $dir"
+ $run rmdir $dir >/dev/null 2>&1
+ fi
+ done
+
+ exit $exit_status
+ ;;
+
+ "")
+ $echo "$modename: you must specify a MODE" 1>&2
+ $echo "$generic_help" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+ esac
+
+ if test -z "$exec_cmd"; then
+ $echo "$modename: invalid operation mode \`$mode'" 1>&2
+ $echo "$generic_help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+fi # test -z "$show_help"
+
+if test -n "$exec_cmd"; then
+ eval exec $exec_cmd
+ exit $EXIT_FAILURE
+fi
+
+# We need to display help for each of the modes.
+case $mode in
+"") $echo \
+"Usage: $modename [OPTION]... [MODE-ARG]...
+
+Provide generalized library-building support services.
+
+ --config show all configuration variables
+ --debug enable verbose shell tracing
+-n, --dry-run display commands without modifying any files
+ --features display basic configuration information and exit
+ --finish same as \`--mode=finish'
+ --help display this help message and exit
+ --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
+ --quiet same as \`--silent'
+ --silent don't print informational messages
+ --tag=TAG use configuration variables from tag TAG
+ --version print version information
+
+MODE must be one of the following:
+
+ clean remove files from the build directory
+ compile compile a source file into a libtool object
+ execute automatically set library path, then run a program
+ finish complete the installation of libtool libraries
+ install install libraries or executables
+ link create a library or an executable
+ uninstall remove libraries from an installed directory
+
+MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
+a more detailed description of MODE.
+
+Report bugs to <bug-libtool@gnu.org>."
+ exit $EXIT_SUCCESS
+ ;;
+
+clean)
+ $echo \
+"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+
+Remove files from the build directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+compile)
+ $echo \
+"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+ -o OUTPUT-FILE set the output file name to OUTPUT-FILE
+ -prefer-pic try to building PIC objects only
+ -prefer-non-pic try to building non-PIC objects only
+ -static always build a \`.o' file suitable for static linking
+
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+ ;;
+
+execute)
+ $echo \
+"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+ -dlopen FILE add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+ ;;
+
+finish)
+ $echo \
+"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges. Use
+the \`--dry-run' option if you just want to see what would be executed."
+ ;;
+
+install)
+ $echo \
+"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command. The first component should be
+either the \`install' or \`cp' program.
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+ ;;
+
+link)
+ $echo \
+"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+ -all-static do not do any dynamic linking at all
+ -avoid-version do not add a version suffix if possible
+ -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
+ -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
+ -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+ -export-symbols SYMFILE
+ try to export only the symbols listed in SYMFILE
+ -export-symbols-regex REGEX
+ try to export only the symbols matching REGEX
+ -LLIBDIR search LIBDIR for required installed libraries
+ -lNAME OUTPUT-FILE requires the installed library libNAME
+ -module build a library that can dlopened
+ -no-fast-install disable the fast-install mode
+ -no-install link a not-installable executable
+ -no-undefined declare that a library does not refer to external symbols
+ -o OUTPUT-FILE create OUTPUT-FILE from the specified objects
+ -objectlist FILE Use a list of object files found in FILE to specify objects
+ -precious-files-regex REGEX
+ don't remove output files matching REGEX
+ -release RELEASE specify package release information
+ -rpath LIBDIR the created library will eventually be installed in LIBDIR
+ -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
+ -static do not do any dynamic linking of uninstalled libtool libraries
+ -static-libtool-libs
+ do not do any dynamic linking of libtool libraries
+ -version-info CURRENT[:REVISION[:AGE]]
+ specify library version info [each variable defaults to 0]
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename. Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+ ;;
+
+uninstall)
+ $echo \
+"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+*)
+ $echo "$modename: invalid operation mode \`$mode'" 1>&2
+ $echo "$help" 1>&2
+ exit $EXIT_FAILURE
+ ;;
+esac
+
+$echo
+$echo "Try \`$modename --help' for more information about other modes."
+
+exit $?
+
+# The TAGs below are defined such that we never get into a situation
+# in which we disable both kinds of libraries. Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them. This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration. But we'll never go from static-only to shared-only.
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+disable_libs=shared
+# ### END LIBTOOL TAG CONFIG: disable-shared
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-static
+disable_libs=static
+# ### END LIBTOOL TAG CONFIG: disable-static
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
diff --git a/m4/Makefile.am b/m4/Makefile.am
new file mode 100644
index 0000000..9ec59bf
--- /dev/null
+++ b/m4/Makefile.am
@@ -0,0 +1,21 @@
+
+# You will need to run autogen.sh after adding something here manually
+
+EXTRA_DIST = \
+ binutils.m4 \
+ builtinexpect.m4 \
+ compileroption.m4 \
+ configmodule.m4 \
+ copyifchange.m4 \
+ docbook.m4 \
+ extradirs.m4 \
+ findkernel.m4 \
+ kerneloption.m4 \
+ kernelversion.m4 \
+ mallocattribute.m4 \
+ poptconst.m4 \
+ precompiledheader.m4 \
+ qt.m4 \
+ resultyn.m4 \
+ sstream.m4 \
+ typedef.m4
diff --git a/m4/Makefile.in b/m4/Makefile.in
new file mode 100644
index 0000000..0c8d0b8
--- /dev/null
+++ b/m4/Makefile.in
@@ -0,0 +1,387 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# You will need to run autogen.sh after adding something here manually
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = m4
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/binutils.m4 \
+ $(top_srcdir)/m4/builtinexpect.m4 \
+ $(top_srcdir)/m4/cellspubfdsupport.m4 \
+ $(top_srcdir)/m4/compileroption.m4 \
+ $(top_srcdir)/m4/configmodule.m4 \
+ $(top_srcdir)/m4/copyifchange.m4 $(top_srcdir)/m4/docbook.m4 \
+ $(top_srcdir)/m4/extradirs.m4 $(top_srcdir)/m4/findkernel.m4 \
+ $(top_srcdir)/m4/kerneloption.m4 \
+ $(top_srcdir)/m4/kernelversion.m4 \
+ $(top_srcdir)/m4/mallocattribute.m4 \
+ $(top_srcdir)/m4/poptconst.m4 \
+ $(top_srcdir)/m4/precompiledheader.m4 $(top_srcdir)/m4/qt.m4 \
+ $(top_srcdir)/m4/resultyn.m4 $(top_srcdir)/m4/sstream.m4 \
+ $(top_srcdir)/m4/typedef.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFD_LIBS = @BFD_LIBS@
+BUILD_JVMPI_AGENT_FALSE = @BUILD_JVMPI_AGENT_FALSE@
+BUILD_JVMPI_AGENT_TRUE = @BUILD_JVMPI_AGENT_TRUE@
+BUILD_JVMTI_AGENT_FALSE = @BUILD_JVMTI_AGENT_FALSE@
+BUILD_JVMTI_AGENT_TRUE = @BUILD_JVMTI_AGENT_TRUE@
+CAT_ENTRY_END = @CAT_ENTRY_END@
+CAT_ENTRY_START = @CAT_ENTRY_START@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOCBOOK_ROOT = @DOCBOOK_ROOT@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+EXTRA_CFLAGS_MODULE = @EXTRA_CFLAGS_MODULE@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAVA_HOMEDIR = @JAVA_HOMEDIR@
+KINC = @KINC@
+KSRC = @KSRC@
+KVERS = @KVERS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBERTY_LIBS = @LIBERTY_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MOC = @MOC@
+MODINSTALLDIR = @MODINSTALLDIR@
+OBJEXT = @OBJEXT@
+OPROFILE_DIR = @OPROFILE_DIR@
+OPROFILE_MODULE_ARCH = @OPROFILE_MODULE_ARCH@
+OP_CFLAGS = @OP_CFLAGS@
+OP_CXXFLAGS = @OP_CXXFLAGS@
+OP_DOCDIR = @OP_DOCDIR@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POPT_LIBS = @POPT_LIBS@
+PTRDIFF_T_TYPE = @PTRDIFF_T_TYPE@
+QT_INCLUDES = @QT_INCLUDES@
+QT_LDFLAGS = @QT_LDFLAGS@
+QT_LIB = @QT_LIB@
+QT_VERSION = @QT_VERSION@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIZE_T_TYPE = @SIZE_T_TYPE@
+STRIP = @STRIP@
+UIC = @UIC@
+VERSION = @VERSION@
+XML_CATALOG = @XML_CATALOG@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+have_qt_FALSE = @have_qt_FALSE@
+have_qt_TRUE = @have_qt_TRUE@
+have_xsltproc_FALSE = @have_xsltproc_FALSE@
+have_xsltproc_TRUE = @have_xsltproc_TRUE@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+kernel_support_FALSE = @kernel_support_FALSE@
+kernel_support_TRUE = @kernel_support_TRUE@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+topdir = @topdir@
+EXTRA_DIST = \
+ binutils.m4 \
+ builtinexpect.m4 \
+ compileroption.m4 \
+ configmodule.m4 \
+ copyifchange.m4 \
+ docbook.m4 \
+ extradirs.m4 \
+ findkernel.m4 \
+ kerneloption.m4 \
+ kernelversion.m4 \
+ mallocattribute.m4 \
+ poptconst.m4 \
+ precompiledheader.m4 \
+ qt.m4 \
+ resultyn.m4 \
+ sstream.m4 \
+ typedef.m4
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign m4/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign m4/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ distclean distclean-generic distclean-libtool distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-exec install-exec-am \
+ install-info install-info-am install-man install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \
+ uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/m4/binutils.m4 b/m4/binutils.m4
new file mode 100644
index 0000000..25fb15a
--- /dev/null
+++ b/m4/binutils.m4
@@ -0,0 +1,53 @@
+dnl AX_BINUTILS - check for needed binutils stuff
+
+AC_DEFUN([AX_BINUTILS],
+[
+dnl some distro have a libiberty.a but does not have a libiberty.h
+AC_CHECK_HEADERS(libiberty.h)
+AC_CHECK_LIB(iberty, cplus_demangle,, AC_MSG_ERROR([liberty library not found]))
+AC_CHECK_FUNCS(xcalloc)
+AC_CHECK_FUNCS(xmemdup)
+AC_CHECK_LIB(dl, dlopen, LIBS="$LIBS -ldl"; DL_LIB="-ldl", DL_LIB="")
+AC_CHECK_LIB(intl, main, LIBS="$LIBS -lintl"; INTL_LIB="-lintl", INTL_LIB="")
+
+AC_CHECK_LIB(bfd, bfd_openr, LIBS="-lbfd $LIBS"; Z_LIB="",
+ [AC_CHECK_LIB(z, compress,
+dnl Use a different bfd function here so as not to use cached result from above
+ [AC_CHECK_LIB(bfd, bfd_fdopenr, LIBS="-lbfd -lz $LIBS"; Z_LIB="-lz",
+ [AC_MSG_ERROR([bfd library not found])], -lz)
+ ],
+ [AC_MSG_ERROR([libz library not found; required by libbfd])])
+ ]
+)
+
+AC_LANG_PUSH(C)
+# Determine if bfd_get_synthetic_symtab macro is available
+OS="`uname`"
+if test "$OS" = "Linux"; then
+ AC_MSG_CHECKING([whether bfd_get_synthetic_symtab() exists in BFD library])
+ rm -f test-for-synth
+ AC_LANG_CONFTEST(
+ [AC_LANG_PROGRAM([[#include <bfd.h>]],
+ [[asymbol * synthsyms; bfd * ibfd = 0;
+ long synth_count = bfd_get_synthetic_symtab(ibfd, 0, 0, 0, 0, &synthsyms);
+ extern const bfd_target bfd_elf64_powerpc_vec;
+ extern const bfd_target bfd_elf64_powerpcle_vec;
+ char * ppc_name = bfd_elf64_powerpc_vec.name;
+ char * ppcle_name = bfd_elf64_powerpcle_vec.name;
+ printf("%s %s\n", ppc_name, ppcle_name);]])
+ ])
+ $CC conftest.$ac_ext $CFLAGS $LDFLAGS $LIBS -o test-for-synth > /dev/null 2>&1
+ if test -f test-for-synth; then
+ echo "yes"
+ SYNTHESIZE_SYMBOLS='1'
+ else
+ echo "no"
+ SYNTHESIZE_SYMBOLS='0'
+ fi
+ AC_DEFINE_UNQUOTED(SYNTHESIZE_SYMBOLS, $SYNTHESIZE_SYMBOLS, [Synthesize special symbols when needed])
+ rm -f test-for-synth*
+
+fi
+AC_LANG_POP(C)
+]
+)
diff --git a/m4/builtinexpect.m4 b/m4/builtinexpect.m4
new file mode 100644
index 0000000..ba77640
--- /dev/null
+++ b/m4/builtinexpect.m4
@@ -0,0 +1,15 @@
+dnl builtin_expect is used in module we can't add that in config.h
+AC_DEFUN([AX_BUILTIN_EXPECT],
+[
+AC_MSG_CHECKING([whether __builtin_expect is understood])
+SAVE_CFLAGS=$CFLAGS
+CFLAGS="-Werror $CFLAGS"
+AC_TRY_LINK(,[
+int i;
+if (__builtin_expect(i, 0)) { }
+],
+AC_MSG_RESULT([yes]); EXTRA_CFLAGS_MODULE="$EXTRA_CFLAGS_MODULE -DEXPECT_OK",
+AC_MSG_RESULT([no]);)
+CFLAGS=$SAVE_CFLAGS
+]
+)
diff --git a/m4/cellspubfdsupport.m4 b/m4/cellspubfdsupport.m4
new file mode 100644
index 0000000..e04ee87
--- /dev/null
+++ b/m4/cellspubfdsupport.m4
@@ -0,0 +1,52 @@
+dnl AX_CELL_SPU - check for needed binutils stuff for Cell BE SPU
+AC_DEFUN([AX_CELL_SPU],
+[
+# On Cell BE architecture, OProfile uses bfd_openr_iovec when processing some
+# SPU profiles. To parse embedded SPU ELF on Cell BE, OProfile requires a
+# version of bfd_openr_iovec that supports the elf32-spu target.
+# This version of the function also has a 7th parameter that's been added.
+# First, we check for existence of the base bfd_openr_iovec. If it exists,
+# we then use a temporary test program below that passes 7 arguments to
+# bfd_openr_iovec; if it compiles OK, we assume we have the right BFD
+# library to support Cell BE SPU profiling.
+
+AC_LANG_PUSH(C)
+
+AC_CHECK_LIB(bfd, bfd_openr_iovec,
+ [bfd_openr_iovec_exists="yes"],
+ [bfd_openr_iovec_exists="no"]
+)
+
+if test "$bfd_openr_iovec_exists" = "yes"; then
+ AC_MSG_CHECKING([whether bfd_openr_iovec has seven parameters])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <bfd.h>
+ #include <stdlib.h>
+ ],
+ [[struct bfd *nbfd = bfd_openr_iovec("some-file", "elf32-spu",
+ NULL, NULL, NULL, NULL, NULL);
+ return 0;
+ ]])],
+ [AC_DEFINE([HAVE_BFD_OPENR_IOVEC_WITH_7PARMS],
+ [],
+ [Defined if you have the version of bfd_openr_iovec with 7 parameters])
+ bfd_open_iovec_7="yes"
+ AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])]
+ )
+fi
+
+AC_LANG_POP(C)
+
+arch="unknown"
+AC_ARG_WITH(target,
+[ --with-target=cell-be Check BFD support for Cell Broadband Engine SPU profiling], arch=$withval)
+
+if test "$arch" = "cell-be"; then
+ if test "$bfd_open_iovec_7" = "yes"; then
+ AC_MSG_NOTICE([BFD library has support for Cell Broadband Engine SPU profiling])
+ else
+ AC_ERROR([BFD library does not support elf32-spu target; SPU profiling is unsupported])
+ fi
+fi
+]
+)
diff --git a/m4/compileroption.m4 b/m4/compileroption.m4
new file mode 100644
index 0000000..2fec066
--- /dev/null
+++ b/m4/compileroption.m4
@@ -0,0 +1,26 @@
+dnl AX_CFLAGS_OPTIONS(var-name, option)
+dnl add option to var-name if $CC support it.
+AC_DEFUN([AX_CFLAGS_OPTION], [
+AC_MSG_CHECKING([whether ${CC} $2 is understood])
+AC_LANG_SAVE
+AC_LANG_C
+SAVE_CFLAGS=$CFLAGS
+CFLAGS=$2
+AC_TRY_COMPILE(,[;],AC_MSG_RESULT([yes]); $1="${$1} $2",AC_MSG_RESULT([no]))
+CFLAGS=$SAVE_CFLAGS
+AC_LANG_RESTORE
+])
+
+
+dnl AX_CXXFLAGS_OPTIONS(var-name, option)
+dnl add option to var-name if $CXX support it.
+AC_DEFUN([AX_CXXFLAGS_OPTION], [
+AC_MSG_CHECKING([whether ${CXX} $2 is understood])
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+SAVE_CXXFLAGS=$CXXFLAGS
+CXXFLAGS=$2
+AC_TRY_COMPILE(,[;],AC_MSG_RESULT([yes]); $1="${$1} $2",AC_MSG_RESULT([no]))
+CXXFLAGS=$SAVE_CXXFLAGS
+AC_LANG_RESTORE
+])
diff --git a/m4/configmodule.m4 b/m4/configmodule.m4
new file mode 100644
index 0000000..79fe34d
--- /dev/null
+++ b/m4/configmodule.m4
@@ -0,0 +1,80 @@
+dnl Handle the 2.4 module inside module/
+AC_DEFUN([AX_CONFIG_MODULE],
+[
+if test ! -f $KINC/linux/autoconf.h; then
+ AC_MSG_ERROR([no suitably configured kernel include tree found])
+fi
+
+dnl --- Get Linux kernel version and compile parameters ---
+
+AC_SUBST(KVERS)
+AC_MSG_CHECKING([for kernel version])
+dnl it's like this to handle mandrake's fubar version.h - bug #471448
+eval KVERS=`gcc -I$KINC -E -dM $KINC/linux/version.h | grep -w UTS_RELEASE | awk '{print $[]3}'`
+AC_MSG_RESULT([$KVERS])
+case "$KVERS" in
+2.2.*|2.4.*) ;;
+*) AC_MSG_ERROR([Unsupported kernel version])
+esac
+
+dnl Check for the minimal kernel version supported
+AC_MSG_CHECKING([kernel version])
+AX_KERNEL_VERSION(2, 2, 10, <=, AC_MSG_RESULT([ok]), AC_MSG_ERROR([check html documentation install section]))
+
+dnl linux/spinlock.h added at some point in past
+AC_MSG_CHECKING([for $KINC/linux/spinlock.h])
+if test -f $KINC/linux/spinlock.h; then
+ EXTRA_CFLAGS_MODULE="$EXTRA_CFLAGS_MODULE -DHAVE_LINUX_SPINLOCK_HEADER"
+ AC_MSG_RESULT([yes])
+else
+ AC_MSG_RESULT([no])
+fi
+
+AC_MSG_CHECKING([for rtc_lock])
+gcc -I$KINC -E $KINC/linux/mc146818rtc.h | grep rtc_lock >/dev/null
+if test "$?" -eq 0; then
+ EXTRA_CFLAGS_MODULE="$EXTRA_CFLAGS_MODULE -DRTC_LOCK"
+ AC_MSG_RESULT([yes])
+else
+ AC_MSG_RESULT([no])
+fi
+
+arch="unknown"
+AC_MSG_CHECKING(for x86 architecture)
+AX_KERNEL_OPTION(CONFIG_X86, x86=1, x86=0)
+AX_KERNEL_OPTION(CONFIG_X86_WP_WORKS_OK, x86=1, x86=$x86)
+AX_MSG_RESULT_YN($x86)
+test "$x86" = 1 && arch="x86"
+
+if test "$arch" = "unknown"; then
+ AC_MSG_CHECKING(for ia64 architecture)
+ AX_KERNEL_OPTION(CONFIG_IA64, ia64=1, ia64=0)
+ AX_MSG_RESULT_YN($ia64)
+ test "$ia64" = 1 && arch="ia64"
+fi
+
+test "$arch" = "unknown" && AC_MSG_ERROR(Unsupported architecture)
+
+dnl check to see if kernel verion appropriate for arch
+AC_MSG_CHECKING(arch/kernel version combination)
+case "$arch" in
+ia64)
+ AX_KERNEL_VERSION(2, 4, 18, <, AC_MSG_RESULT([ok]),
+ AC_MSG_ERROR([unsupported arch/kernel])) ;;
+*) AC_MSG_RESULT([ok])
+esac
+
+dnl for now we do not support PREEMPT patch
+AC_MSG_CHECKING([for preempt patch])
+AX_KERNEL_OPTION(CONFIG_PREEMPT,preempt=1,preempt=0)
+AX_MSG_RESULT_YN([$preempt])
+test "$preempt" = 0 || AC_MSG_ERROR([unsupported kernel configuration : CONFIG_PREEMPT])
+
+AC_SUBST(KINC)
+
+MODINSTALLDIR=/lib/modules/$KVERS
+
+OPROFILE_MODULE_ARCH=$arch
+AC_SUBST(OPROFILE_MODULE_ARCH)
+]
+)
diff --git a/m4/copyifchange.m4 b/m4/copyifchange.m4
new file mode 100644
index 0000000..0464de0
--- /dev/null
+++ b/m4/copyifchange.m4
@@ -0,0 +1,13 @@
+dnl AX_COPY_IF_CHANGE(source, dest)
+dnl copy source to dest if they don't compare equally or if dest doesn't exist
+AC_DEFUN([AX_COPY_IF_CHANGE], [
+if test -r $2; then
+ if cmp $1 $2 > /dev/null; then
+ echo $2 is unchanged
+ else
+ cp -f $1 $2
+ fi
+else
+ cp -f $1 $2
+fi
+])
diff --git a/m4/docbook.m4 b/m4/docbook.m4
new file mode 100644
index 0000000..513b0bd
--- /dev/null
+++ b/m4/docbook.m4
@@ -0,0 +1,53 @@
+dnl AX_CHECK_DOCBOOK
+AC_DEFUN([AX_CHECK_DOCBOOK], [
+# It's just rude to go over the net to build
+XSLTPROC_FLAGS=--nonet
+DOCBOOK_ROOT=
+if test ! -f /etc/xml/catalog; then
+ for i in /usr/share/sgml/docbook/stylesheet/xsl/nwalsh /usr/share/sgml/docbook/xsl-stylesheets/;
+ do
+ if test -d "$i"; then
+ DOCBOOK_ROOT=$i
+ fi
+ done
+
+ # Last resort - try net
+ if test -z "$DOCBOOK_ROOT"; then
+ XSLTPROC_FLAGS=
+ fi
+else
+ XML_CATALOG=/etc/xml/catalog
+ CAT_ENTRY_START='<!--'
+ CAT_ENTRY_END='-->'
+fi
+
+AC_CHECK_PROG(XSLTPROC,xsltproc,xsltproc,)
+XSLTPROC_WORKS=no
+if test -n "$XSLTPROC"; then
+ AC_MSG_CHECKING([whether xsltproc works])
+
+ if test -n "$XML_CATALOG"; then
+ DB_FILE="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"
+ else
+ DB_FILE="$DOCBOOK_ROOT/docbook.xsl"
+ fi
+
+ $XSLTPROC $XSLTPROC_FLAGS $DB_FILE >/dev/null 2>&1 << END
+<?xml version="1.0" encoding='ISO-8859-1'?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
+<book id="test">
+</book>
+END
+ if test "$?" = 0; then
+ XSLTPROC_WORKS=yes
+ fi
+ AC_MSG_RESULT($XSLTPROC_WORKS)
+fi
+AM_CONDITIONAL(have_xsltproc, test "$XSLTPROC_WORKS" = "yes")
+
+AC_SUBST(XML_CATALOG)
+AC_SUBST(XSLTPROC_FLAGS)
+AC_SUBST(DOCBOOK_ROOT)
+AC_SUBST(CAT_ENTRY_START)
+AC_SUBST(CAT_ENTRY_END)
+])
diff --git a/m4/extradirs.m4 b/m4/extradirs.m4
new file mode 100644
index 0000000..a12b03d
--- /dev/null
+++ b/m4/extradirs.m4
@@ -0,0 +1,36 @@
+dnl AX_EXTRA_DIRS - Let user specify extra dirs for include/libs
+AC_DEFUN([AX_EXTRA_DIRS],
+[
+AC_ARG_WITH(extra-includes,
+[ --with-extra-includes=DIR add extra include paths],
+ use_extra_includes="$withval",
+ use_extra_includes=NO
+)
+if test -n "$use_extra_includes" && \
+ test "$use_extra_includes" != "NO"; then
+ ac_save_ifs=$IFS
+ IFS=':'
+ for dir in $use_extra_includes; do
+ extra_includes="$extra_includes -I$dir"
+ done
+ IFS=$ac_save_ifs
+ CPPFLAGS="$CPPFLAGS $extra_includes"
+fi
+
+AC_ARG_WITH(extra-libs,
+[ --with-extra-libs=DIR add extra library paths],
+ use_extra_libs=$withval,
+ use_extra_libs=NO
+)
+if test -n "$use_extra_libs" && \
+ test "$use_extra_libs" != "NO"; then
+ ac_save_ifs=$IFS
+ IFS=':'
+ for dir in $use_extra_libs; do
+ extra_libraries="$extra_libraries -L$dir"
+ done
+ IFS=$ac_save_ifs
+ LDFLAGS="$LDFLAGS $extra_libraries"
+fi
+]
+)
diff --git a/m4/findkernel.m4 b/m4/findkernel.m4
new file mode 100644
index 0000000..4f66437
--- /dev/null
+++ b/m4/findkernel.m4
@@ -0,0 +1,27 @@
+dnl Find the kernel and handle 2.6 settings
+AC_DEFUN([AX_FIND_KERNEL],
+[
+AC_MSG_CHECKING([for kernel OProfile support])
+AC_ARG_WITH(kernel-support, [ --with-kernel-support Use 2.6 kernel (no kernel source tree required)],
+if test "$withval" = "yes"; then
+ OPROFILE_26=yes
+fi
+)
+
+if test "$OPROFILE_26" != "yes"; then
+ dnl --- Find the Linux kernel, at least the headers ---
+
+ AC_SUBST(KSRC)
+ KSRC=/lib/modules/`uname -r`/build
+ AC_ARG_WITH(linux, [ --with-linux=dir Path to Linux source tree], KSRC=$withval)
+ KINC=$KSRC/include
+ AC_SUBST(KINC)
+
+ AX_KERNEL_OPTION(CONFIG_OPROFILE, OPROFILE_26=yes, OPROFILE_26=no)
+ AX_KERNEL_OPTION(CONFIG_OPROFILE_MODULE, OPROFILE_26=yes, OPROFILE_26=$OPROFILE_26)
+fi
+AC_MSG_RESULT($OPROFILE_26)
+
+AM_CONDITIONAL(kernel_support, test "$OPROFILE_26" = yes)
+]
+)
diff --git a/m4/kerneloption.m4 b/m4/kerneloption.m4
new file mode 100644
index 0000000..79ce65f
--- /dev/null
+++ b/m4/kerneloption.m4
@@ -0,0 +1,13 @@
+dnl AX_KERNEL_OPTION(option, action-if-found, action-if-not-found)
+dnl see if autoconf.h defines the option
+AC_DEFUN([AX_KERNEL_OPTION], [
+SAVE_CFLAGS=$CFLAGS
+CFLAGS="-I$KINC -O2 -D__KERNEL__"
+AC_TRY_COMPILE( [#include <linux/autoconf.h>],
+[
+#ifndef $1
+break_me_hard(\\\);
+#endif
+],[$2],[$3],)
+CFLAGS=$SAVE_CFLAGS
+])
diff --git a/m4/kernelversion.m4 b/m4/kernelversion.m4
new file mode 100644
index 0000000..db4b805
--- /dev/null
+++ b/m4/kernelversion.m4
@@ -0,0 +1,16 @@
+dnl AX_KERNEL_VERSION(major, minor, level, comparison, action-if-true, action-if-false)
+AC_DEFUN([AX_KERNEL_VERSION], [
+SAVE_CFLAGS=$CFLAGS
+CFLAGS="-I$KINC -D__KERNEL__ -Werror"
+AC_TRY_COMPILE(
+ [
+ #include <linux/version.h>
+ ],
+ [
+ #if LINUX_VERSION_CODE $4 KERNEL_VERSION($1, $2, $3)
+ break_me_hard(\\\);
+ #endif
+ ],
+[$5],[$6],)
+CFLAGS=$SAVE_CFLAGS
+])
diff --git a/m4/mallocattribute.m4 b/m4/mallocattribute.m4
new file mode 100644
index 0000000..0bfe3a8
--- /dev/null
+++ b/m4/mallocattribute.m4
@@ -0,0 +1,12 @@
+dnl AX_MALLOC_ATTRIBUTE - see if gcc will take __attribute__((malloc))
+AC_DEFUN([AX_MALLOC_ATTRIBUTE],
+[
+AC_MSG_CHECKING([whether malloc attribute is understood])
+SAVE_CFLAGS=$CFLAGS
+CFLAGS="-Werror $CFLAGS"
+AC_TRY_COMPILE(,[
+void monkey() __attribute__((malloc));
+],AC_MSG_RESULT([yes]); AC_DEFINE(MALLOC_ATTRIBUTE_OK, 1, [whether malloc attribute is understood]), AC_MSG_RESULT([no]))
+CFLAGS=$SAVE_CFLAGS
+]
+)
diff --git a/m4/poptconst.m4 b/m4/poptconst.m4
new file mode 100644
index 0000000..2888e78
--- /dev/null
+++ b/m4/poptconst.m4
@@ -0,0 +1,16 @@
+dnl AX_POPT_CONST - check popt prototype
+AC_DEFUN([AX_POPT_CONST],
+[
+AC_MSG_CHECKING([popt prototype])
+SAVE_CXXFLAGS=$CXXFLAGS
+CXXFLAGS="-Werror $CXXFLAGS"
+AC_TRY_COMPILE([#include <popt.h>],
+[
+int c; char **v;
+poptGetContext(0, c, v, 0, 0);
+],
+AC_MSG_RESULT([takes char **]);,
+AC_MSG_RESULT([takes const char **]); AC_DEFINE(CONST_POPT, 1, [whether popt prototype takes a const char **]))
+CXXFLAGS="$SAVE_CXXFLAGS"
+]
+)
diff --git a/m4/precompiledheader.m4 b/m4/precompiledheader.m4
new file mode 100644
index 0000000..d19aacf
--- /dev/null
+++ b/m4/precompiledheader.m4
@@ -0,0 +1,15 @@
+dnl AX_CXXFLAGS_OPTIONS(var-name, option)
+dnl add option to var-name if $CXX support it.
+AC_DEFUN([AX_CHECK_PRECOMPILED_HEADER], [
+AC_MSG_CHECKING([whether ${CXX} support precompiled header])
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+SAVE_CXXFLAGS=$CXXFLAGS
+dnl we consider than if -Winvalid-pch is accepted pch will works ...
+CXXFLAGS=-Winvalid-pch
+dnl but we don't want -Winvalid-pch else compilation will fail due -Werror and
+dnl the fact than some pch will be invalid for the given compilation option
+AC_TRY_COMPILE(,[;],AC_MSG_RESULT([yes]); $1="${$1} -include bits/stdc++.h", AC_MSG_RESULT([no]))
+CXXFLAGS=$SAVE_CXXFLAGS
+AC_LANG_RESTORE
+])
diff --git a/m4/qt.m4 b/m4/qt.m4
new file mode 100644
index 0000000..b0e30ef
--- /dev/null
+++ b/m4/qt.m4
@@ -0,0 +1,217 @@
+dnl find a binary in the path
+AC_DEFUN([QT_FIND_PATH],
+[
+ AC_MSG_CHECKING([for $1])
+ AC_CACHE_VAL(qt_cv_path_$1,
+ [
+ qt_cv_path_$1="NONE"
+ if test -n "$$2"; then
+ qt_cv_path_$1="$$2";
+ else
+ dirs="$3"
+ qt_save_IFS=$IFS
+ IFS=':'
+ for dir in $PATH; do
+ dirs="$dirs $dir"
+ done
+ IFS=$qt_save_IFS
+
+ for dir in $dirs; do
+ if test -x "$dir/$1"; then
+ if test -n "$5"; then
+ evalstr="$dir/$1 $5 2>&1 "
+ if eval $evalstr; then
+ qt_cv_path_$1="$dir/$1"
+ break
+ fi
+ else
+ qt_cv_path_$1="$dir/$1"
+ break
+ fi
+ fi
+ done
+ fi
+ ])
+
+ if test -z "$qt_cv_path_$1" || test "$qt_cv_path_$1" = "NONE"; then
+ AC_MSG_RESULT(not found)
+ $4
+ else
+ AC_MSG_RESULT($qt_cv_path_$1)
+ $2=$qt_cv_path_$1
+ fi
+])
+
+dnl Find the uic compiler on the path or in qt_cv_dir
+AC_DEFUN([QT_FIND_UIC],
+[
+ QT_FIND_PATH(uic, ac_uic, $qt_cv_dir/bin)
+ if test -z "$ac_uic" -a "$FATAL" = 1; then
+ AC_MSG_ERROR([uic binary not found in \$PATH or $qt_cv_dir/bin !])
+ fi
+])
+
+dnl Find the right moc in path/qt_cv_dir
+AC_DEFUN([QT_FIND_MOC],
+[
+ QT_FIND_PATH(moc2, ac_moc2, $qt_cv_dir/bin)
+ QT_FIND_PATH(moc, ac_moc1, $qt_cv_dir/bin)
+
+ if test -n "$ac_moc1" -a -n "$ac_moc2"; then
+ dnl found both. Prefer Qt3's if it exists else moc2
+ $ac_moc1 -v 2>&1 | grep "Qt 3" >/dev/null
+ if test "$?" = 0; then
+ ac_moc=$ac_moc1;
+ else
+ ac_moc=$ac_moc2;
+ fi
+ else
+ if test -n "$ac_moc1"; then
+ ac_moc=$ac_moc1;
+ else
+ ac_moc=$ac_moc2;
+ fi
+ fi
+
+ if test -z "$ac_moc" -a "$FATAL" = 1; then
+ AC_MSG_ERROR([moc binary not found in \$PATH or $qt_cv_dir/bin !])
+ fi
+])
+
+dnl check a particular libname
+AC_DEFUN([QT_TRY_LINK],
+[
+ SAVE_LIBS="$LIBS"
+ LIBS="$LIBS $1"
+ AC_TRY_LINK([
+ #include <qglobal.h>
+ #include <qstring.h>
+ ],
+ [
+ QString s("mangle_failure");
+ #if (QT_VERSION < 221)
+ break_me_(\\\);
+ #endif
+ ],
+ qt_cv_libname=$1,
+ )
+ LIBS="$SAVE_LIBS"
+])
+
+dnl check we can do a compile
+AC_DEFUN([QT_CHECK_COMPILE],
+[
+ AC_MSG_CHECKING([for Qt library name])
+
+ AC_CACHE_VAL(qt_cv_libname,
+ [
+ AC_LANG_CPLUSPLUS
+ SAVE_CXXFLAGS=$CXXFLAGS
+ CXXFLAGS="$CXXFLAGS $QT_INCLUDES $QT_LDFLAGS"
+
+ for libname in -lqt-mt -lqt3 -lqt2 -lqt;
+ do
+ QT_TRY_LINK($libname)
+ if test -n "$qt_cv_libname"; then
+ break;
+ fi
+ done
+
+ CXXFLAGS=$SAVE_CXXFLAGS
+ ])
+
+ if test -z "$qt_cv_libname"; then
+ AC_MSG_RESULT([failed])
+ if test "$FATAL" = 1 ; then
+ AC_MSG_ERROR([Cannot compile a simple Qt executable. Check you have the right \$QTDIR !])
+ fi
+ else
+ AC_MSG_RESULT([$qt_cv_libname])
+ fi
+])
+
+dnl get Qt version we're using
+AC_DEFUN([QT_GET_VERSION],
+[
+ AC_CACHE_CHECK([Qt version],lyx_cv_qtversion,
+ [
+ AC_LANG_CPLUSPLUS
+ SAVE_CPPFLAGS=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS $QT_INCLUDES"
+
+ cat > conftest.$ac_ext <<EOF
+#line __oline__ "configure"
+#include "confdefs.h"
+#include <qglobal.h>
+"%%%"QT_VERSION_STR"%%%"
+EOF
+ lyx_cv_qtversion=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 | \
+ grep '^"%%%"' 2>/dev/null | \
+ sed -e 's/"%%%"//g' -e 's/"//g'`
+ rm -f conftest.$ac_ext
+ CPPFLAGS=$SAVE_CPPFLAGS
+ ])
+
+ QT_VERSION=$lyx_cv_qtversion
+ AC_SUBST(QT_VERSION)
+])
+
+dnl start here
+AC_DEFUN([QT_DO_IT_ALL],
+[
+ dnl Please leave this alone. I use this file in
+ dnl oprofile.
+ FATAL=0
+
+ AC_ARG_WITH(qt-dir, [ --with-qt-dir where the root of Qt is installed ],
+ [ qt_cv_dir=`eval echo "$withval"/` ])
+
+ AC_ARG_WITH(qt-includes, [ --with-qt-includes where the Qt includes are. ],
+ [ qt_cv_includes=`eval echo "$withval"` ])
+
+ AC_ARG_WITH(qt-libraries, [ --with-qt-libraries where the Qt library is installed.],
+ [ qt_cv_libraries=`eval echo "$withval"` ])
+
+ dnl pay attention to $QTDIR unless overridden
+ if test -z "$qt_cv_dir"; then
+ qt_cv_dir=$QTDIR
+ fi
+
+ dnl derive inc/lib if needed
+ if test -n "$qt_cv_dir"; then
+ if test -z "$qt_cv_includes"; then
+ qt_cv_includes=$qt_cv_dir/include
+ fi
+ if test -z "$qt_cv_libraries"; then
+ qt_cv_libraries=$qt_cv_dir/lib
+ fi
+ fi
+
+ dnl flags for compilation
+ QT_INCLUDES=
+ QT_LDFLAGS=
+ if test -n "$qt_cv_includes"; then
+ QT_INCLUDES="-isystem $qt_cv_includes"
+ fi
+ if test -n "$qt_cv_libraries"; then
+ QT_LDFLAGS="-L$qt_cv_libraries"
+ fi
+ AC_SUBST(QT_INCLUDES)
+ AC_SUBST(QT_LDFLAGS)
+
+ QT_FIND_MOC
+ MOC=$ac_moc
+ AC_SUBST(MOC)
+ QT_FIND_UIC
+ UIC=$ac_uic
+ AC_SUBST(UIC)
+
+ QT_CHECK_COMPILE
+
+ QT_LIB=$qt_cv_libname;
+ AC_SUBST(QT_LIB)
+
+ if test -n "$qt_cv_libname"; then
+ QT_GET_VERSION
+ fi
+])
diff --git a/m4/resultyn.m4 b/m4/resultyn.m4
new file mode 100644
index 0000000..2aac1cc
--- /dev/null
+++ b/m4/resultyn.m4
@@ -0,0 +1,6 @@
+
+dnl AX_MSG_RESULT_YN(a)
+dnl results "yes" iff a==1, "no" else
+AC_DEFUN([AX_MSG_RESULT_YN], [x=no
+test "x$1" = "x1" && x=yes
+AC_MSG_RESULT($x)])
diff --git a/m4/sstream.m4 b/m4/sstream.m4
new file mode 100644
index 0000000..4337fb5
--- /dev/null
+++ b/m4/sstream.m4
@@ -0,0 +1,9 @@
+dnl AX_CHECK_SSTREAM - check if local sstream is needed to compile OK
+AC_DEFUN([AX_CHECK_SSTREAM],
+[
+AC_MSG_CHECKING([whether to use included sstream])
+AC_TRY_COMPILE([#include <sstream>], [],
+AC_MSG_RESULT([no]);,
+AC_MSG_RESULT([yes]); OP_CXXFLAGS="$OP_CXXFLAGS -I\${top_srcdir}/include")
+]
+)
diff --git a/m4/typedef.m4 b/m4/typedef.m4
new file mode 100644
index 0000000..b2807d4
--- /dev/null
+++ b/m4/typedef.m4
@@ -0,0 +1,46 @@
+dnl AX_CHECK_TYPEDEF(typedef_name, type, action-if-true, action-if-false)
+dnl exec action-if-true if typedef_name is a typedef to type else exec
+dnl action-if-false
+dnl currently work only with type typedef'ed in stddef.h
+AC_DEFUN([AX_CHECK_TYPEDEF], [
+dnl AC_LANG_PUSH(C) not in autoconf 2.13
+AC_LANG_SAVE
+AC_LANG_C
+SAVE_CFLAGS=$CFLAGS
+CFLAGS="-Werror $CFLAGS"
+
+AC_TRY_COMPILE(
+ [
+ #include <stddef.h>
+ ],
+ [
+ typedef void (*fct1)($1);
+ typedef void (*fct2)($2);
+ fct1 f1 = 0;
+ fct2 f2 = 0;
+ if (f1 == f2) {}
+ ],
+[$3],[$4])
+
+CFLAGS=$SAVE_CFLAGS
+AC_LANG_RESTORE
+])
+
+
+dnl AX_TYPEDEFED_NAME(typedef_name, candidate_list, var_name)
+dnl set var_name to the typedef name of $1 which must be in canditate_list
+dnl else produce a fatal error
+AC_DEFUN([AX_TYPEDEFED_NAME], [
+ AC_MSG_CHECKING([type of $1])
+ for f in $2; do
+ AX_CHECK_TYPEDEF($1, $f, $3="$f", $3="")
+ if test -n "${$3}"; then
+ break
+ fi
+ done
+ if test -n "${$3}"; then
+ AC_MSG_RESULT([${$3}])
+ else
+ AC_MSG_ERROR([not found])
+ fi
+])
diff --git a/missing b/missing
new file mode 100755
index 0000000..894e786
--- /dev/null
+++ b/missing
@@ -0,0 +1,360 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2005-06-08.21
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+fi
+
+run=:
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+ configure_ac=configure.ac
+else
+ configure_ac=configure.in
+fi
+
+msg="missing on your system"
+
+case "$1" in
+--run)
+ # Try to run requested program, and just exit if it succeeds.
+ run=
+ shift
+ "$@" && exit 0
+ # Exit code 63 means version mismatch. This often happens
+ # when the user try to use an ancient version of a tool on
+ # a file that requires a minimum version. In this case we
+ # we should proceed has if the program had been absent, or
+ # if --run hadn't been passed.
+ if test $? = 63; then
+ run=:
+ msg="probably too old"
+ fi
+ ;;
+
+ -h|--h|--he|--hel|--help)
+ echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version output version information and exit
+ --run try to run the given command, and emulate it if it fails
+
+Supported PROGRAM values:
+ aclocal touch file \`aclocal.m4'
+ autoconf touch file \`configure'
+ autoheader touch file \`config.h.in'
+ automake touch all \`Makefile.in' files
+ bison create \`y.tab.[ch]', if possible, from existing .[ch]
+ flex create \`lex.yy.c', if possible, from existing .c
+ help2man touch the output file
+ lex create \`lex.yy.c', if possible, from existing .c
+ makeinfo touch the output file
+ tar try tar, gnutar, gtar, then tar without non-portable flags
+ yacc create \`y.tab.[ch]', if possible, from existing .[ch]
+
+Send bug reports to <bug-automake@gnu.org>."
+ exit $?
+ ;;
+
+ -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+ echo "missing $scriptversion (GNU Automake)"
+ exit $?
+ ;;
+
+ -*)
+ echo 1>&2 "$0: Unknown \`$1' option"
+ echo 1>&2 "Try \`$0 --help' for more information"
+ exit 1
+ ;;
+
+esac
+
+# Now exit if we have it, but it failed. Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program).
+case "$1" in
+ lex|yacc)
+ # Not GNU programs, they don't have --version.
+ ;;
+
+ tar)
+ if test -n "$run"; then
+ echo 1>&2 "ERROR: \`tar' requires --run"
+ exit 1
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+ exit 1
+ fi
+ ;;
+
+ *)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+ # Could not run --version or --help. This is probably someone
+ # running `$TOOL --version' or `$TOOL --help' to check whether
+ # $TOOL exists and not knowing $TOOL uses missing.
+ exit 1
+ fi
+ ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case "$1" in
+ aclocal*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`acinclude.m4' or \`${configure_ac}'. You might want
+ to install the \`Automake' and \`Perl' packages. Grab them from
+ any GNU archive site."
+ touch aclocal.m4
+ ;;
+
+ autoconf)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`${configure_ac}'. You might want to install the
+ \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
+ archive site."
+ touch configure
+ ;;
+
+ autoheader)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`acconfig.h' or \`${configure_ac}'. You might want
+ to install the \`Autoconf' and \`GNU m4' packages. Grab them
+ from any GNU archive site."
+ files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+ test -z "$files" && files="config.h"
+ touch_files=
+ for f in $files; do
+ case "$f" in
+ *:*) touch_files="$touch_files "`echo "$f" |
+ sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+ *) touch_files="$touch_files $f.in";;
+ esac
+ done
+ touch $touch_files
+ ;;
+
+ automake*)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
+ You might want to install the \`Automake' and \`Perl' packages.
+ Grab them from any GNU archive site."
+ find . -type f -name Makefile.am -print |
+ sed 's/\.am$/.in/' |
+ while read f; do touch "$f"; done
+ ;;
+
+ autom4te)
+ echo 1>&2 "\
+WARNING: \`$1' is needed, but is $msg.
+ You might have modified some files without having the
+ proper tools for further handling them.
+ You can get \`$1' as part of \`Autoconf' from any GNU
+ archive site."
+
+ file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
+ test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
+ if test -f "$file"; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo "#! /bin/sh"
+ echo "# Created by GNU Automake missing as a replacement of"
+ echo "# $ $@"
+ echo "exit 0"
+ chmod +x $file
+ exit 1
+ fi
+ ;;
+
+ bison|yacc)
+ echo 1>&2 "\
+WARNING: \`$1' $msg. You should only need it if
+ you modified a \`.y' file. You may need the \`Bison' package
+ in order for those modifications to take effect. You can get
+ \`Bison' from any GNU archive site."
+ rm -f y.tab.c y.tab.h
+ if [ $# -ne 1 ]; then
+ eval LASTARG="\${$#}"
+ case "$LASTARG" in
+ *.y)
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" y.tab.c
+ fi
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" y.tab.h
+ fi
+ ;;
+ esac
+ fi
+ if [ ! -f y.tab.h ]; then
+ echo >y.tab.h
+ fi
+ if [ ! -f y.tab.c ]; then
+ echo 'main() { return 0; }' >y.tab.c
+ fi
+ ;;
+
+ lex|flex)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a \`.l' file. You may need the \`Flex' package
+ in order for those modifications to take effect. You can get
+ \`Flex' from any GNU archive site."
+ rm -f lex.yy.c
+ if [ $# -ne 1 ]; then
+ eval LASTARG="\${$#}"
+ case "$LASTARG" in
+ *.l)
+ SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+ if [ -f "$SRCFILE" ]; then
+ cp "$SRCFILE" lex.yy.c
+ fi
+ ;;
+ esac
+ fi
+ if [ ! -f lex.yy.c ]; then
+ echo 'main() { return 0; }' >lex.yy.c
+ fi
+ ;;
+
+ help2man)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a dependency of a manual page. You may need the
+ \`Help2man' package in order for those modifications to take
+ effect. You can get \`Help2man' from any GNU archive site."
+
+ file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+ if test -z "$file"; then
+ file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
+ fi
+ if [ -f "$file" ]; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo ".ab help2man is required to generate this page"
+ exit 1
+ fi
+ ;;
+
+ makeinfo)
+ echo 1>&2 "\
+WARNING: \`$1' is $msg. You should only need it if
+ you modified a \`.texi' or \`.texinfo' file, or any other file
+ indirectly affecting the aspect of the manual. The spurious
+ call might also be the consequence of using a buggy \`make' (AIX,
+ DU, IRIX). You might want to install the \`Texinfo' package or
+ the \`GNU make' package. Grab either from any GNU archive site."
+ # The file to touch is that specified with -o ...
+ file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+ if test -z "$file"; then
+ # ... or it is the one specified with @setfilename ...
+ infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+ file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile`
+ # ... or it is derived from the source name (dir/f.texi becomes f.info)
+ test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
+ fi
+ # If the file does not exist, the user really needs makeinfo;
+ # let's fail without touching anything.
+ test -f $file || exit 1
+ touch $file
+ ;;
+
+ tar)
+ shift
+
+ # We have already tried tar in the generic part.
+ # Look for gnutar/gtar before invocation to avoid ugly error
+ # messages.
+ if (gnutar --version > /dev/null 2>&1); then
+ gnutar "$@" && exit 0
+ fi
+ if (gtar --version > /dev/null 2>&1); then
+ gtar "$@" && exit 0
+ fi
+ firstarg="$1"
+ if shift; then
+ case "$firstarg" in
+ *o*)
+ firstarg=`echo "$firstarg" | sed s/o//`
+ tar "$firstarg" "$@" && exit 0
+ ;;
+ esac
+ case "$firstarg" in
+ *h*)
+ firstarg=`echo "$firstarg" | sed s/h//`
+ tar "$firstarg" "$@" && exit 0
+ ;;
+ esac
+ fi
+
+ echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+ You may want to install GNU tar or Free paxutils, or check the
+ command line arguments."
+ exit 1
+ ;;
+
+ *)
+ echo 1>&2 "\
+WARNING: \`$1' is needed, and is $msg.
+ You might have modified some files without having the
+ proper tools for further handling them. Check the \`README' file,
+ it often tells you about the needed prerequisites for installing
+ this package. You may also peek at any GNU archive site, in case
+ some other package would contain this missing \`$1' program."
+ exit 1
+ ;;
+esac
+
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/module/Makefile.in b/module/Makefile.in
new file mode 100644
index 0000000..9630259
--- /dev/null
+++ b/module/Makefile.in
@@ -0,0 +1,22 @@
+OPROFILE_DIR=@OPROFILE_DIR@
+VERSION=@VERSION@
+KVERS=@KVERS@
+KSRC=@KSRC@
+
+EXTRA_CFLAGS=@EXTRA_CFLAGS_MODULE@ -D__NO_VERSION__ \
+ -I$(OPROFILE_DIR)/module/@OPROFILE_MODULE_ARCH@ -I$(OPROFILE_DIR) -I$(OPROFILE_DIR)/libutil -I$(OPROFILE_DIR)/libop
+
+# NB: do not add a file here without adding it to EXTRA_DIST in ../Makefile.am
+
+O_TARGET := oprofile-module.o
+
+obj-y := compat.o op_init.o op_util.o op_dname.o oprofile.o @OPROFILE_MODULE_ARCH@/arch.o $(OPROFILE_DIR)/libop/libop.a
+obj-m := $(O_TARGET)
+O_OBJS := $(obj-y)
+M_OBJS := $(O_TARGET)
+
+TOPDIR := $(KSRC)
+CONFIG_SHELL := TOPDIR=$(KSRC) /bin/bash
+include $(KSRC)/Rules.make
+
+# FIXME: deps
diff --git a/module/compat.c b/module/compat.c
new file mode 100644
index 0000000..a8c17fb
--- /dev/null
+++ b/module/compat.c
@@ -0,0 +1,63 @@
+/**
+ * @file compat.c
+ * This file is intended to be up-to-date with the last linux version and
+ * provide work-arounds for missing features in previous kernel version
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include "op_dcache.h"
+#include <linux/ioport.h>
+
+#ifdef NEED_2_2_DENTRIES
+
+/* note - assumes you only test for NULL, and not
+ * actually care about the return value */
+void * compat_request_region(unsigned long start, unsigned long n, char const * name)
+{
+ if (check_region(start, n) != 0)
+ return NULL;
+ request_region(start, n, name);
+ return (void *)1;
+}
+
+int wind_dentries_2_2(struct dentry * dentry)
+{
+ struct dentry * root = current->fs->root;
+
+ if (dentry->d_parent != dentry && list_empty(&dentry->d_hash))
+ return 0;
+
+ for (;;) {
+ struct dentry * parent;
+
+ if (dentry == root)
+ break;
+
+ dentry = dentry->d_covers;
+ parent = dentry->d_parent;
+
+ if (dentry == parent)
+ break;
+
+ push_dname(&dentry->d_name);
+
+ dentry = parent;
+ }
+
+ return 1;
+}
+
+/* called with note_lock held */
+uint do_path_hash_2_2(struct dentry * dentry)
+{
+ /* BKL is already taken */
+
+ return do_hash(dentry, 0, 0, 0);
+}
+
+#endif /* NEED_2_2_DENTRIES */
diff --git a/module/compat.h b/module/compat.h
new file mode 100644
index 0000000..e0c9277
--- /dev/null
+++ b/module/compat.h
@@ -0,0 +1,70 @@
+/**
+ * @file compat.h
+ * This file is intended to be up-to-date with the last linux version and
+ * provide work-arounds for missing features in previous kernel version
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+
+#ifndef COMPAT_H
+#define COMPAT_H
+
+#include <linux/version.h>
+#include <linux/module.h>
+#ifdef HAVE_LINUX_SPINLOCK_HEADER
+/* FIXME do we need this still ? */
+#include <linux/spinlock.h>
+#endif
+
+#define V_BEFORE(a, b, c) (LINUX_VERSION_CODE < KERNEL_VERSION(a, b, c))
+#define V_AT_LEAST(a, b, c) (LINUX_VERSION_CODE >= KERNEL_VERSION(a, b, c))
+
+#if V_BEFORE(2, 4, 0)
+ #include "compat22.h"
+#else
+ #include "compat24.h"
+#endif
+
+#include "op_cache.h"
+
+/* Things that cannot rely on a particular linux version or are needed between
+ * major release */
+
+#ifndef BUG_ON
+#define BUG_ON(p) do { if (p) BUG(); } while (0)
+#endif
+
+#ifndef MODULE_LICENSE
+#define MODULE_LICENSE(x)
+#endif
+
+/* Compiler work-around */
+
+/* branch prediction */
+#ifndef likely
+ #ifdef EXPECT_OK
+ #define likely(a) __builtin_expect((a), 1)
+ #else
+ #define likely(a) (a)
+ #endif
+#endif
+#ifndef unlikely
+ #ifdef EXPECT_OK
+ #define unlikely(a) __builtin_expect((a), 0)
+ #else
+ #define unlikely(a) (a)
+ #endif
+#endif
+
+#ifndef CONFIG_X86_64
+#define VMALLOC_32(sz) vmalloc_32(sz)
+#else /* CONFIG_X86_64 */
+#define VMALLOC_32(sz) vmalloc(sz)
+#endif /* CONFIG_X86_64 */
+
+#endif /* COMPAT_H */
diff --git a/module/compat22.h b/module/compat22.h
new file mode 100644
index 0000000..ac294d3
--- /dev/null
+++ b/module/compat22.h
@@ -0,0 +1,153 @@
+/**
+ * @file compat22.h
+ * Compatability functions for 2.2 kernels
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#ifndef COMPAT22_H
+#define COMPAT22_H
+
+#include <linux/smp_lock.h>
+
+#define local_irq_disable() __cli()
+#define local_irq_enable() __sti()
+#define pte_page_address(a) pte_page(a)
+
+#define GET_VM_OFFSET(v) ((v)->vm_offset)
+#define MODULE_LICENSE(l)
+#define NEED_2_2_DENTRIES
+#define INC_USE_COUNT_MAYBE MOD_INC_USE_COUNT
+#define DEC_USE_COUNT_MAYBE MOD_DEC_USE_COUNT
+#define lock_execve lock_kernel
+#define unlock_execve unlock_kernel
+
+/* BKL-protected on 2.2 */
+#define lock_mmap(mm) do {} while (0)
+#define unlock_mmap(mm) do {} while (0)
+
+/* on 2.2 we use pid as tgid, thread seperation is possible but
+ * each thread is in its own thread group */
+static inline pid_t op_get_tgid(void)
+{
+ return current->pid;
+}
+
+/* the wake_up path doesn't disable interrupts for wait queue
+ * manipulation. So let's force it to.
+ */
+static inline void oprof_wake_up(struct wait_queue **q)
+{
+ unsigned long flags;
+ save_flags(flags);
+ cli();
+ wake_up(q);
+ restore_flags(flags);
+}
+
+extern int wind_dentries_2_2(struct dentry * dentry);
+extern uint do_path_hash_2_2(struct dentry * dentry);
+#define wind_dentries(d, v, r, m) wind_dentries_2_2(d)
+#define hash_path(f) do_path_hash_2_2((f)->f_dentry)
+
+static inline void lock_out_mmap(void)
+{
+ lock_kernel();
+ down(&current->mm->mmap_sem);
+}
+
+static inline void unlock_out_mmap(void)
+{
+ unlock_kernel();
+ up(&current->mm->mmap_sem);
+}
+
+/* different request_region */
+#define request_region_check compat_request_region
+void * compat_request_region (unsigned long start, unsigned long n, char const * name);
+
+#define __exit
+
+#define virt_to_page(va) MAP_NR(va)
+
+/* 2.2 has no cpu_number_map on UP */
+#ifdef CONFIG_SMP
+ #define op_cpu_id() cpu_number_map[smp_processor_id()]
+#else
+ #define op_cpu_id() smp_processor_id()
+#endif /* CONFIG_SMP */
+
+/* provide a working smp_call_function */
+#if !defined(CONFIG_SMP)
+
+ #undef smp_call_function
+ static int inline smp_call_function (void (*func) (void * info), void * info,
+ int retry, int wait)
+ {
+ return 0;
+ }
+
+#endif /* !CONFIG_SMP */
+
+#if V_BEFORE(2, 2, 18)
+
+ /* 2.2.18 introduced module_init */
+ /* Not sure what version aliases were introduced in, but certainly in 2.91.66. */
+ #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 91)
+ #define module_init(x) int init_module(void) __attribute__((alias(#x)));
+ #define module_exit(x) void cleanup_module(void) __attribute__((alias(#x)));
+ #else
+ #define module_init(x) int init_module(void) { return x(); }
+ #define module_exit(x) void cleanup_module(void) { x(); }
+ #endif
+
+ /* 2.2.18 introduced vmalloc_32 */
+ #define vmalloc_32 vmalloc
+
+ /* 2.2.18 add doubled linked list wait_queue and mutex */
+ #define DECLARE_WAIT_QUEUE_HEAD(q) struct wait_queue * q = NULL
+ #define DECLARE_MUTEX(foo) struct semaphore foo = MUTEX
+
+ /* 2.2.18 add THIS_MODULE */
+ #define THIS_MODULE (&__this_module)
+
+ /* 2.2.18 add BUG() FIXME: this is arch dependant would must use
+ * *(char *)0 = 0 instead ? */
+ #define BUG() __asm__ __volatile__("ud2\n");
+
+#endif /* V_BEFORE(2,2,18) */
+
+/* 2.2.18 introduced the rtc lock */
+#ifdef RTC_LOCK
+ #define lock_rtc(f) spin_lock_irqsave(&rtc_lock, f)
+ #define unlock_rtc(f) spin_unlock_irqrestore(&rtc_lock, f)
+#else
+ #define lock_rtc(f) do { save_flags(f); cli(); } while (0)
+ #define unlock_rtc(f) restore_flags(f)
+#endif /* RTC_LOCK */
+
+#if V_AT_LEAST(2, 2, 20)
+ #define PTRACE_OFF(t) ((t)->ptrace &= ~PT_DTRACE)
+#else
+ #define PTRACE_OFF(t) ((t)->flags &= ~PF_DTRACE)
+#endif
+
+/* 2.2.21 introduced cpuid_edx */
+#if V_BEFORE(2, 2, 21)
+static inline unsigned int cpuid_edx(unsigned int op)
+{
+ unsigned int eax, edx;
+
+ __asm__("cpuid"
+ : "=a" (eax), "=d" (edx)
+ : "0" (op)
+ : "bx", "cx");
+ return edx;
+}
+#endif
+
+#endif /* COMPAT22_H */
diff --git a/module/compat24.h b/module/compat24.h
new file mode 100644
index 0000000..0937b8c
--- /dev/null
+++ b/module/compat24.h
@@ -0,0 +1,61 @@
+/**
+ * @file compat24.h
+ * Compatability functions for 2.4 kernels
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#ifndef COMPAT24_H
+#define COMPAT24_H
+
+#include <linux/version.h>
+
+static inline pid_t op_get_tgid(void)
+{
+ return current->tgid;
+}
+
+#define pte_page_address(a) page_address(pte_page(a))
+#define oprof_wake_up(w) wake_up(w)
+#define lock_rtc(f) spin_lock_irqsave(&rtc_lock, f)
+#define unlock_rtc(f) spin_unlock_irqrestore(&rtc_lock, f)
+#define wind_dentries(d, v, r, m) wind_dentries_2_4(d, v, r, m)
+extern uint do_path_hash_2_4(struct dentry * dentry, struct vfsmount * vfsmnt);
+#define hash_path(f) do_path_hash_2_4((f)->f_dentry, (f)->f_vfsmnt)
+#define request_region_check request_region
+#define op_cpu_id() cpu_number_map(smp_processor_id())
+#define GET_VM_OFFSET(v) ((v)->vm_pgoff << PAGE_SHIFT)
+#define PTRACE_OFF(t) ((t)->ptrace &= ~PT_DTRACE)
+#define lock_execve() do { } while (0)
+#define unlock_execve() do { } while (0)
+#define lock_out_mmap() do { } while (0)
+#define unlock_out_mmap() do { } while (0)
+#define HAVE_MMAP2
+#define HAVE_FILE_OPERATIONS_OWNER
+
+/* ->owner field in 2.4 */
+#define INC_USE_COUNT_MAYBE
+#define DEC_USE_COUNT_MAYBE
+
+/* no global waitqueue spinlock in 2.4 */
+#define wq_is_lockable() (1)
+
+/* 2.4.3 introduced rw mmap semaphore */
+#if V_AT_LEAST(2, 4, 3)
+ #define lock_mmap(mm) down_read(&mm->mmap_sem)
+ #define unlock_mmap(mm) up_read(&mm->mmap_sem)
+#else
+ #define lock_mmap(mm) down(&mm->mmap_sem)
+ #define unlock_mmap(mm) up(&mm->mmap_sem)
+#endif
+
+/* 2.4.26 exported the needed stuff for HT support */
+#if V_AT_LEAST(2, 4, 26) && defined(CONFIG_SMP)
+#define HT_SUPPORT
+#endif
+
+#endif /* COMPAT24_H */
diff --git a/module/ia64/IA64entry.h b/module/ia64/IA64entry.h
new file mode 100644
index 0000000..77c2874
--- /dev/null
+++ b/module/ia64/IA64entry.h
@@ -0,0 +1,79 @@
+/**
+ * @file IA64entry.h
+ *
+ * @remark Copy of source code from linux kernel
+ * @remark linux/arch/ia64/kernel/entry.h
+ *
+ */
+
+#include <linux/config.h>
+
+/*
+ * Preserved registers that are shared between code in ivt.S and entry.S. Be
+ * careful not to step on these!
+ */
+
+#define pKern p2 /**< will leave_kernel return to kernel-mode? */
+#define pUser p3 /**< will leave_kernel return to user-mode? */
+#define pSys p4 /**< are we processing a (synchronous) system call? */
+#define pNonSys p5 /**< complement of pSys */
+
+#define PT(f) (IA64_PT_REGS_##f##_OFFSET)
+#define SW(f) (IA64_SWITCH_STACK_##f##_OFFSET)
+
+#define PT_REGS_SAVES(off) \
+ .unwabi @svr4, 'i'; \
+ .fframe IA64_PT_REGS_SIZE+16+(off); \
+ .spillsp rp, PT(CR_IIP)+16+(off); \
+ .spillsp ar.pfs, PT(CR_IFS)+16+(off); \
+ .spillsp ar.unat, PT(AR_UNAT)+16+(off); \
+ .spillsp ar.fpsr, PT(AR_FPSR)+16+(off); \
+ .spillsp pr, PT(PR)+16+(off);
+
+#define PT_REGS_UNWIND_INFO(off) \
+ .prologue; \
+ PT_REGS_SAVES(off); \
+ .body
+
+#define SWITCH_STACK_SAVES(off) \
+ .savesp ar.unat, SW(CALLER_UNAT)+16+(off); \
+ .savesp ar.fpsr, SW(AR_FPSR)+16+(off); \
+ .spillsp f2, SW(F2)+16+(off); .spillsp f3, SW(F3)+16+(off); \
+ .spillsp f4, SW(F4)+16+(off); .spillsp f5, SW(F5)+16+(off); \
+ .spillsp f16, SW(F16)+16+(off); .spillsp f17, SW(F17)+16+(off); \
+ .spillsp f18, SW(F18)+16+(off); .spillsp f19, SW(F19)+16+(off); \
+ .spillsp f20, SW(F20)+16+(off); .spillsp f21, SW(F21)+16+(off); \
+ .spillsp f22, SW(F22)+16+(off); .spillsp f23, SW(F23)+16+(off); \
+ .spillsp f24, SW(F24)+16+(off); .spillsp f25, SW(F25)+16+(off); \
+ .spillsp f26, SW(F26)+16+(off); .spillsp f27, SW(F27)+16+(off); \
+ .spillsp f28, SW(F28)+16+(off); .spillsp f29, SW(F29)+16+(off); \
+ .spillsp f30, SW(F30)+16+(off); .spillsp f31, SW(F31)+16+(off); \
+ .spillsp r4, SW(R4)+16+(off); .spillsp r5, SW(R5)+16+(off); \
+ .spillsp r6, SW(R6)+16+(off); .spillsp r7, SW(R7)+16+(off); \
+ .spillsp b0, SW(B0)+16+(off); .spillsp b1, SW(B1)+16+(off); \
+ .spillsp b2, SW(B2)+16+(off); .spillsp b3, SW(B3)+16+(off); \
+ .spillsp b4, SW(B4)+16+(off); .spillsp b5, SW(B5)+16+(off); \
+ .spillsp ar.pfs, SW(AR_PFS)+16+(off); .spillsp ar.lc, SW(AR_LC)+16+(off); \
+ .spillsp @priunat, SW(AR_UNAT)+16+(off); \
+ .spillsp ar.rnat, SW(AR_RNAT)+16+(off); \
+ .spillsp ar.bspstore, SW(AR_BSPSTORE)+16+(off); \
+ .spillsp pr, SW(PR)+16+(off))
+
+#define DO_SAVE_SWITCH_STACK \
+ movl r28=1f; \
+ ;; \
+ .fframe IA64_SWITCH_STACK_SIZE; \
+ adds sp=-IA64_SWITCH_STACK_SIZE, sp; \
+ mov.ret.sptk b7=r28, 1f; \
+ SWITCH_STACK_SAVES(0); \
+ br.cond.sptk.many save_switch_stack; \
+1:
+
+#define DO_LOAD_SWITCH_STACK \
+ movl r28=1f; \
+ ;; \
+ invala; \
+ mov.ret.sptk b7=r28, 1f; \
+ br.cond.sptk.many load_switch_stack; \
+1: .restore sp; \
+ adds sp=IA64_SWITCH_STACK_SIZE, sp
diff --git a/module/ia64/IA64minstate.h b/module/ia64/IA64minstate.h
new file mode 100644
index 0000000..02c320f
--- /dev/null
+++ b/module/ia64/IA64minstate.h
@@ -0,0 +1,280 @@
+/**
+ * @file IA64minstate.h
+ *
+ * @remark Copy of source code from linux kernel
+ * @remark linux/arch/ia64/kernel/minstate.h
+ *
+ */
+
+#include <linux/config.h>
+
+#include "IA64entry.h"
+
+/*
+ * A couple of convenience macros that make writing and reading
+ * SAVE_MIN and SAVE_REST easier.
+ */
+#define rARPR r31
+#define rCRIFS r30
+#define rCRIPSR r29
+#define rCRIIP r28
+#define rARRSC r27
+#define rARPFS r26
+#define rARUNAT r25
+#define rARRNAT r24
+#define rARBSPSTORE r23
+#define rKRBS r22
+#define rB6 r21
+#define rR1 r20
+
+/*
+ * Here start the source dependent macros.
+ */
+
+/*
+ * For ivt.s we want to access the stack virtually so we dont have
+ * to disable translation on interrupts.
+ */
+#define MINSTATE_START_SAVE_MIN_VIRT \
+ /* r1 = current (virtual) */ \
+ dep r1=-1, r1, 61, 3; \
+ /* set enforced lazy mode, pl 0, little-endian, loadrs=0 */ \
+(pUser) mov ar.rsc=0; \
+ ;; \
+ /* compute base of RBS */ \
+(pUser) addl rKRBS=IA64_RBS_OFFSET, r1; \
+(pUser) mov rARRNAT=ar.rnat; \
+ /* get sp */ \
+(pKern) mov r1=sp; \
+ ;; \
+ /* compute base of memory stack */ \
+(pUser) addl r1=IA64_STK_OFFSET-IA64_PT_REGS_SIZE, r1; \
+ /* save ar.bspstore */ \
+(pUser) mov rARBSPSTORE=ar.bspstore; \
+ ;; \
+ /* if in kernel mode, use sp (r12) */ \
+(pKern) addl r1=-IA64_PT_REGS_SIZE, r1; \
+ /* switch to kernel RBS */ \
+(pUser) mov ar.bspstore=rKRBS; \
+ ;; \
+(pUser) mov r18=ar.bsp; \
+ /* set eager mode, pl 0, little-endian, loadrs=0 */ \
+(pUser) mov ar.rsc=0x3;
+
+#define MINSTATE_END_SAVE_MIN_VIRT \
+ /* make `current' a kernel virtual address */ \
+ or r13=r13, r14; \
+ /* switch back to bank 1 (must be last in insn group) */ \
+ bsw.1; \
+ ;;
+
+/*
+ * For mca_asm.S we want to access the stack physically since the state
+ * is saved before we go virtual and dont want to destroy the iip or ipsr.
+ */
+#define MINSTATE_START_SAVE_MIN_PHYS \
+(pKern) movl sp=ia64_init_stack+IA64_STK_OFFSET-IA64_PT_REGS_SIZE; \
+ /* set enforced lazy mode, pl 0, little-endian, loadrs=0 */ \
+(pUser) mov ar.rsc=0; \
+ /* compute base of register backing store */ \
+(pUser) addl rKRBS=IA64_RBS_OFFSET, r1; \
+ ;; \
+(pUser) mov rARRNAT=ar.rnat; \
+ /* compute physical addr of sp */ \
+(pKern) dep r1=0, sp, 61, 3; \
+ /* compute base of memory stack */ \
+(pUser) addl r1=IA64_STK_OFFSET-IA64_PT_REGS_SIZE, r1; \
+ /* save ar.bspstore */ \
+(pUser) mov rARBSPSTORE=ar.bspstore; \
+ /* compute kernel virtual addr of RBS */ \
+(pUser) dep rKRBS=-1, rKRBS, 61, 3; \
+ ;; \
+ /* if in kernel mode, use sp (r12) */ \
+(pKern) addl r1=-IA64_PT_REGS_SIZE, r1; \
+ /* switch to kernel RBS */ \
+(pUser) mov ar.bspstore=rKRBS; \
+ ;; \
+(pUser) mov r18=ar.bsp; \
+ /* set eager mode, pl 0, little-endian, loadrs=0 */ \
+(pUser) mov ar.rsc=0x3;
+
+#define MINSTATE_END_SAVE_MIN_PHYS \
+ /* make sp a kernel virtual address */ \
+ or r12=r12, r14; \
+ /* make `current' a kernel virtual address */ \
+ or r13=r13, r14; \
+ ;;
+
+#ifdef MINSTATE_VIRT
+# define MINSTATE_START_SAVE_MIN MINSTATE_START_SAVE_MIN_VIRT
+# define MINSTATE_END_SAVE_MIN MINSTATE_END_SAVE_MIN_VIRT
+#endif
+
+#ifdef MINSTATE_PHYS
+# define MINSTATE_START_SAVE_MIN MINSTATE_START_SAVE_MIN_PHYS
+# define MINSTATE_END_SAVE_MIN MINSTATE_END_SAVE_MIN_PHYS
+#endif
+
+/*
+ * DO_SAVE_MIN switches to the kernel stacks (if necessary) and saves
+ * the minimum state necessary that allows us to turn psr.ic back
+ * on.
+ *
+ * Assumed state upon entry:
+ * psr.ic: off
+ * psr.dt: off
+ * r31: contains saved predicates (pr)
+ *
+ * Upon exit, the state is as follows:
+ * psr.ic: off
+ * r2 = points to &pt_regs.r16
+ * r12 = kernel sp (kernel virtual address)
+ * r13 = points to current task_struct (kernel virtual address)
+ * p15 = TRUE if psr.i is set in cr.ipsr
+ * predicate registers (other than p2, p3, and p15), b6, r3, r8, r9,
+ * r10, r11, r14, r15: preserved
+ *
+ * Note that psr.ic is NOT turned on by this macro. This is so that
+ * we can pass interruption state as arguments to a handler.
+ */
+#define DO_SAVE_MIN(COVER, SAVE_IFS, EXTRA) \
+ mov rARRSC=ar.rsc; \
+ mov rARPFS=ar.pfs; \
+ mov rR1=r1; \
+ mov rARUNAT=ar.unat; \
+ mov rCRIPSR=cr.ipsr; \
+ /* rB6 = branch reg 6 */ \
+ mov rB6=b6; \
+ mov rCRIIP=cr.iip; \
+ /* r1 = current (physical) */ \
+ mov r1=IA64_KR(CURRENT); \
+ COVER; \
+ ;; \
+ invala; \
+ /* extract psr.cpl */ \
+ extr.u r16=rCRIPSR, 32, 2; \
+ ;; \
+ /* are we in kernel mode already? (psr.cpl==0) */ \
+ cmp.eq pKern, pUser=r0, r16; \
+ /* switch from user to kernel RBS: */ \
+ ;; \
+ SAVE_IFS; \
+ MINSTATE_START_SAVE_MIN \
+ ;; \
+ /* initialize first base pointer */ \
+ mov r16=r1; \
+ /* initialize second base pointer */ \
+ adds r17=8, r1; \
+ ;; \
+ st8 [r16]=rCRIPSR, 16; /* save cr.ipsr */ \
+ st8 [r17]=rCRIIP, 16; /* save cr.iip */ \
+(pKern) mov r18=r0; /* make sure r18 isn't NaT */ \
+ ;; \
+ st8 [r16]=rCRIFS, 16; /* save cr.ifs */ \
+ st8 [r17]=rARUNAT, 16; /* save ar.unat */ \
+(pUser) sub r18=r18, rKRBS; /* r18=RSE.ndirty*8 */ \
+ ;; \
+ st8 [r16]=rARPFS, 16; /* save ar.pfs */ \
+ st8 [r17]=rARRSC, 16; /* save ar.rsc */ \
+ tbit.nz p15, p0=rCRIPSR, IA64_PSR_I_BIT \
+ ;; /* avoid RAW on r16 & r17 */ \
+(pKern) adds r16=16, r16; /* skip over ar_rnat field */ \
+(pKern) adds r17=16, r17; /* skip over ar_bspstore field */ \
+(pUser) st8 [r16]=rARRNAT, 16; /* save ar.rnat */ \
+(pUser) st8 [r17]=rARBSPSTORE, 16; /* save ar.bspstore */ \
+ ;; \
+ st8 [r16]=rARPR, 16; /* save predicates */ \
+ st8 [r17]=rB6, 16; /* save b6 */ \
+ /* compute ar.rsc to be used for "loadrs" */ \
+ shl r18=r18, 16; \
+ ;; \
+ st8 [r16]=r18, 16; /* save ar.rsc value for "loadrs" */ \
+ st8.spill [r17]=rR1, 16; /* save original r1 */ \
+ ;; \
+.mem.offset 0, 0; st8.spill [r16]=r2, 16; \
+.mem.offset 8, 0; st8.spill [r17]=r3, 16; \
+ adds r2=IA64_PT_REGS_R16_OFFSET, r1; \
+ ;; \
+.mem.offset 0, 0; st8.spill [r16]=r12, 16; \
+.mem.offset 8, 0; st8.spill [r17]=r13, 16; \
+ /* initialize pSys=0, pNonSys=1 */ \
+ cmp.eq pNonSys, pSys=r0, r0 \
+ ;; \
+.mem.offset 0, 0; st8.spill [r16]=r14, 16; \
+.mem.offset 8, 0; st8.spill [r17]=r15, 16; \
+ dep r14=-1, r0, 61, 3; \
+ ;; \
+.mem.offset 0, 0; st8.spill [r16]=r8, 16; \
+.mem.offset 8, 0; st8.spill [r17]=r9, 16; \
+ /* switch to kernel memory stack (with 16 bytes of scratch) */ \
+ adds r12=-16, r1; \
+ ;; \
+.mem.offset 0, 0; st8.spill [r16]=r10, 16; \
+.mem.offset 8, 0; st8.spill [r17]=r11, 16; \
+ mov r13=IA64_KR(CURRENT); /* establish `current' */ \
+ ;; \
+ EXTRA; \
+ movl r1=__gp; /* establish kernel global pointer */ \
+ ;; \
+ MINSTATE_END_SAVE_MIN
+
+/*
+ * SAVE_REST saves the remainder of pt_regs (with psr.ic on). This
+ * macro guarantees to preserve all predicate registers, r8, r9, r10,
+ * r11, r14, and r15.
+ *
+ * Assumed state upon entry:
+ * psr.ic: on
+ * psr.dt: on
+ * r2: points to &pt_regs.r16
+ * r3: points to &pt_regs.r17
+ */
+#define SAVE_REST \
+.mem.offset 0, 0; st8.spill [r2]=r16, 16; \
+.mem.offset 8, 0; st8.spill [r3]=r17, 16; \
+ ;; \
+.mem.offset 0, 0; st8.spill [r2]=r18, 16; \
+.mem.offset 8, 0; st8.spill [r3]=r19, 16; \
+ ;; \
+ mov r16=ar.ccv; /* M-unit */ \
+ movl r18=FPSR_DEFAULT /* L-unit */ \
+ ;; \
+ mov r17=ar.fpsr; /* M-unit */ \
+ mov ar.fpsr=r18; /* M-unit */ \
+ ;; \
+.mem.offset 0, 0; st8.spill [r2]=r20, 16; \
+.mem.offset 8, 0; st8.spill [r3]=r21, 16; \
+ mov r18=b0; \
+ ;; \
+.mem.offset 0, 0; st8.spill [r2]=r22, 16; \
+.mem.offset 8, 0; st8.spill [r3]=r23, 16; \
+ mov r19=b7; \
+ ;; \
+.mem.offset 0, 0; st8.spill [r2]=r24, 16; \
+.mem.offset 8, 0; st8.spill [r3]=r25, 16; \
+ ;; \
+.mem.offset 0, 0; st8.spill [r2]=r26, 16; \
+.mem.offset 8, 0; st8.spill [r3]=r27, 16; \
+ ;; \
+.mem.offset 0, 0; st8.spill [r2]=r28, 16; \
+.mem.offset 8, 0; st8.spill [r3]=r29, 16; \
+ ;; \
+.mem.offset 0, 0; st8.spill [r2]=r30, 16; \
+.mem.offset 8, 0; st8.spill [r3]=r31, 16; \
+ ;; \
+ st8 [r2]=r16, 16; /* ar.ccv */ \
+ st8 [r3]=r17, 16; /* ar.fpsr */ \
+ ;; \
+ st8 [r2]=r18, 16; /* b0 */ \
+ st8 [r3]=r19, 16+8; /* b7 */ \
+ ;; \
+ stf.spill [r2]=f6, 32; \
+ stf.spill [r3]=f7, 32; \
+ ;; \
+ stf.spill [r2]=f8, 32; \
+ stf.spill [r3]=f9, 32
+
+#define SAVE_MIN_WITH_COVER DO_SAVE_MIN(cover, mov rCRIFS=cr.ifs,)
+#define SAVE_MIN_WITH_COVER_R19 \
+ DO_SAVE_MIN(cover, mov rCRIFS=cr.ifs, mov r15=r19)
+#define SAVE_MIN DO_SAVE_MIN(, mov rCRIFS=r0,)
diff --git a/module/ia64/IA64syscallstub.h b/module/ia64/IA64syscallstub.h
new file mode 100644
index 0000000..705d9c3
--- /dev/null
+++ b/module/ia64/IA64syscallstub.h
@@ -0,0 +1,197 @@
+/**
+ * @file IA64syscallstub.h
+ * Assembly language file macros
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Bob Montgomery
+ */
+
+/* $Id: IA64syscallstub.h,v 1.3 2008/01/21 21:35:17 movement Exp $ */
+
+#define SYSCALLSTUB_POST(name) \
+ .sbss; \
+ .align 8; \
+ .type .post_saverp_##name, @object; \
+ .size .post_saverp_##name, 8; \
+.post_saverp_##name: \
+ .skip 8; \
+ .text; \
+ .global post_stub_##name; \
+ .align 32; \
+ .proc post_stub_##name; \
+post_stub_##name: \
+.L1_##name: \
+ mov r3=ip; \
+ ;; \
+ addl r16=.L2_##name - .L1_##name, r3; \
+ ;; \
+ mov b6=r16; \
+ ;; \
+ br.ret.sptk.many b6; \
+ ;; \
+.L2_##name: \
+ mov r3=ip; \
+ mov r15=gp; /* save kgp */ \
+ mov r17=rp; \
+ ;; \
+ addl r14=.post_fptr_##name - .L2_##name, r3; \
+ ;; \
+ ld8 r14=[r14]; \
+ ;; \
+ adds r14=8, r14; \
+ ;; \
+ ld8 gp=[r14]; \
+ ;; \
+ addl r14=@ltoff(old_sys_##name), gp; \
+ addl r16=@gprel(.post_saverp_##name), gp; \
+ ;; \
+ ld8 r14=[r14]; \
+ st8 [r16]=r17; /* save krp */ \
+ ;; \
+ ld8 r14=[r14]; \
+ mov gp=r15; /* restore kgp */ \
+ ;; \
+ ld8 r14=[r14]; \
+ ;; \
+ mov b6 = r14; \
+ ;; \
+ br.call.sptk.many b0=b6; \
+ ;; \
+.L3_##name: \
+ mov r3=ip; \
+ mov r15=gp; /* save kgp */ \
+ ;; \
+ addl r14=.post_fptr_##name - .L3_##name, r3; \
+ ;; \
+ ld8 r14=[r14]; \
+ ;; \
+ adds r14=8, r14; \
+ ;; \
+ ld8 gp=[r14]; \
+ br.call.sptk.many b0=post_call_stub_##name; \
+ ;; \
+ addl r16=@gprel(.post_saverp_##name), gp; \
+ ;; \
+ ld8 r14=[r16]; \
+ ;; \
+ mov b0 = r14; \
+ mov gp = r15; /* preserved */ \
+ br.cond.sptk.many b0; \
+ .align 16; \
+.post_fptr_##name: \
+ data8 @fptr(post_sys_##name); \
+ .endp post_stub_##name; \
+ .align 16; \
+ .global post_call_stub_##name; \
+ .proc post_call_stub_##name; \
+post_call_stub_##name: \
+ alloc loc1=ar.pfs, 8, 6, 8, 0; \
+ mov loc0=rp; \
+ mov loc2=r15; /* preserve it */ \
+ mov loc3=r8; \
+ mov loc4=r10; \
+ mov loc5=gp; \
+ mov out0 = r8; /* old rv */ \
+ mov out1 = in0; \
+ mov out2 = in1; \
+ mov out3 = in2; \
+ mov out4 = in3; \
+ mov out5 = in4; \
+ mov out6 = in5; \
+ mov out7 = in6; \
+ ;; \
+ br.call.sptk.many rp = post_sys_##name; \
+ ;; \
+ mov ar.pfs = loc1; \
+ mov rp = loc0; \
+ mov r15=loc2; \
+ mov r8=loc3; \
+ mov r10=loc4; \
+ mov gp=loc5; \
+ br.ret.sptk.few rp; \
+ .endp post_call_stub_##name;
+
+#define SYSCALLSTUB_PRE(name) \
+ .text; \
+ .global pre_stub_##name; \
+ .align 32; \
+ .proc pre_stub_##name; \
+pre_stub_##name: \
+.L4_##name: \
+ mov r3=ip; \
+ ;; \
+ addl r17=.L5_##name - .L4_##name, r3; \
+ ;; \
+ mov b6=r17; \
+ ;; \
+ br.ret.sptk.many b6; \
+ ;; \
+.L5_##name: \
+ mov r3=ip; \
+ mov r15=gp; /* save kgp */ \
+ mov r16=rp; /* save krp */ \
+ ;; \
+ addl r14=.pre_fptr_##name - .L5_##name, r3; \
+ ;; \
+ ld8 r14=[r14]; \
+ ;; \
+ adds r14=8, r14; \
+ ;; \
+ ld8 gp=[r14]; \
+ ;; \
+ br.call.sptk.many b0=pre_call_stub_##name; \
+ ;; \
+ /* kernel gp still in r15 */ \
+ /* kernel rp still in r16 */ \
+ /* module gp in gp */ \
+ ;; \
+ addl r14=@ltoff(old_sys_##name), gp; \
+ ;; \
+ ld8 r14=[r14]; \
+ ;; \
+ ld8 r14=[r14]; \
+ mov gp=r15; /* restore kgp */ \
+ ;; \
+ ld8 r14=[r14]; \
+ mov rp=r16; /* restore krp */ \
+ ;; \
+ mov b6 = r14; \
+ ;; \
+ /* use the saved krp */ \
+ br.call.sptk.many b6=b6; \
+ ;; \
+ .align 16; \
+.pre_fptr_##name: \
+ data8 @fptr(pre_sys_##name); \
+ .endp pre_stub_##name; \
+ .align 16; \
+ .global pre_call_stub_##name; \
+ .proc pre_call_stub_##name; \
+pre_call_stub_##name: \
+ alloc loc1=ar.pfs, 8, 5, 8, 0; \
+ mov loc0=rp; \
+ mov loc2=r15; /* preserve it */ \
+ mov loc3=r16; /* preserve it */ \
+ mov loc4=gp; \
+ mov out0 = in0; \
+ mov out1 = in1; \
+ mov out2 = in2; \
+ mov out3 = in3; \
+ mov out4 = in4; \
+ mov out5 = in5; \
+ mov out6 = in6; \
+ mov out7 = in7; \
+ ;; \
+ br.call.sptk.many rp = pre_sys_##name; \
+ ;; \
+ mov ar.pfs = loc1; \
+ mov rp = loc0; \
+ mov r15=loc2; \
+ mov r16=loc3; \
+ mov gp=loc4; \
+ br.ret.sptk.few rp; \
+ .endp pre_call_stub_##name;
+
+
diff --git a/module/ia64/Makefile.in b/module/ia64/Makefile.in
new file mode 100644
index 0000000..b1a932c
--- /dev/null
+++ b/module/ia64/Makefile.in
@@ -0,0 +1,30 @@
+#
+# module/ia64/Makefile.in
+#
+# Will Cohen
+# 7/29/2002
+
+OPROFILE_DIR=@OPROFILE_DIR@
+VERSION=@VERSION@
+KVERS=@KVERS@
+KSRC=@KSRC@
+
+EXTRA_CFLAGS=@EXTRA_CFLAGS_MODULE@ -D__NO_VERSION__ \
+ -I$(OPROFILE_DIR)/ -I$(OPROFILE_DIR)/libutil -I$(OPROFILE_DIR)/libop -I$(OPROFILE_DIR)/module
+
+USE_STANDARD_AS_RULE=1
+
+# NB: do not add a file here without adding it to EXTRA_DIST in ../Makefile.am
+
+O_TARGET := arch.o
+
+obj-y := cpu_type.o op_pmu.o op_syscalls.o oprofile_stubs.o
+obj-m := $(O_TARGET)
+O_OBJS := $(obj-y)
+M_OBJS := $(O_TARGET)
+
+TOPDIR := $(KSRC)
+CONFIG_SHELL := TOPDIR=$(KSRC) /bin/bash
+include $(KSRC)/Rules.make
+
+# FIXME: dependencies
diff --git a/module/ia64/cpu_type.c b/module/ia64/cpu_type.c
new file mode 100644
index 0000000..69e1ed4
--- /dev/null
+++ b/module/ia64/cpu_type.c
@@ -0,0 +1,34 @@
+/**
+ * @file cpu_type.c
+ * CPU determination
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ * @author Will Cohen
+ */
+
+#include "oprofile.h"
+
+EXPORT_NO_SYMBOLS;
+
+__init op_cpu get_cpu_type(void)
+{
+ __u8 family = local_cpu_data->family;
+
+ /* FIXME: There should be a bit more checking here. */
+ switch (family) {
+ /* Itanium */
+ case 0x07:
+ return CPU_IA64_1;
+ break;
+ /* Itanium 2 */
+ case 0x1f:
+ return CPU_IA64_2;
+ break;
+ }
+ /* Go for the basic generic IA64 */
+ return CPU_IA64;
+}
diff --git a/module/ia64/op_ia64_model.h b/module/ia64/op_ia64_model.h
new file mode 100644
index 0000000..79f6c06
--- /dev/null
+++ b/module/ia64/op_ia64_model.h
@@ -0,0 +1,32 @@
+/**
+ * @file op_ia64_model.h
+ * interface to ia64 model-specific MSR operations
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Graydon Hoare
+ * @author Will Cohen
+ */
+
+#ifndef OP_IA64_MODEL_H
+#define OP_IA64_MODEL_H
+
+#include "oprofile.h"
+
+struct op_saved_msr {
+ uint high;
+ uint low;
+};
+
+struct op_msr_group {
+ uint * addrs;
+ struct op_saved_msr * saved;
+};
+
+struct op_msrs {
+ struct op_msr_group counters;
+ struct op_msr_group controls;
+};
+
+#endif /* OP_IA64_MODEL_H */
diff --git a/module/ia64/op_pmu.c b/module/ia64/op_pmu.c
new file mode 100644
index 0000000..1f9791d
--- /dev/null
+++ b/module/ia64/op_pmu.c
@@ -0,0 +1,661 @@
+/**
+ * @file op_pmu.c
+ * Setup and handling of IA64 Performance Monitoring Unit (PMU)
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Bob Montgomery
+ * @author Will Cohen
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+
+#include "oprofile.h"
+#include "op_util.h"
+#include <asm/perfmon.h>
+#include "op_ia64_model.h"
+
+/* number of counters physically present */
+static uint op_nr_counters = 4;
+
+/* performance counters are in pairs: pmcN and pmdN. The pmc register acts
+ * as the event selection; the pmd register is the counter. */
+#define perf_reg(c) ((c)+4)
+
+#define IA64_1_PMD_MASK_VAL ((1UL << 32) - 1)
+#define IA64_2_PMD_MASK_VAL ((1UL << 47) - 1)
+
+/* The appropriate value is selected in pmu_init() */
+unsigned long pmd_mask = IA64_2_PMD_MASK_VAL;
+
+#define pmd_overflowed(r, c) ((r) & (1 << perf_reg(c)))
+#define set_pmd_neg(v, c) do { \
+ ia64_set_pmd(perf_reg(c), -(ulong)(v) & pmd_mask); \
+ ia64_srlz_d(); } while (0)
+#define set_pmd(v, c) do { \
+ ia64_set_pmd(perf_reg(c), (v) & pmd_mask); \
+ ia64_srlz_d(); } while (0)
+#define set_pmc(v, c) do { ia64_set_pmc(perf_reg(c), (v)); ia64_srlz_d(); } while (0)
+#define get_pmd(c) ia64_get_pmd(perf_reg(c))
+#define get_pmc(c) ia64_get_pmc(perf_reg(c))
+
+/* ---------------- IRQ handler ------------------ */
+
+/* The args match the args for pfm_overflow_handler in perfmon.c.
+ * The task_struct is currently filled in with the perfmon "owner" of
+ * the PMU. This might change. I'm not sure it makes sense in perfmon
+ * either with system-wide profiling.
+ * pmc0 is a bit mask for overflowed counters (bits 4-7)
+ * This routine should return 0 to resume interrupts.
+ */
+inline static void
+op_do_pmu_interrupt(u64 pmc0, struct pt_regs * regs)
+{
+ uint cpu = op_cpu_id();
+ int ctr;
+
+ for (ctr = 0 ; ctr < op_nr_counters ; ++ctr) {
+ if (pmd_overflowed(pmc0, ctr)) {
+ op_do_profile(cpu, regs->cr_iip, 1, ctr);
+ set_pmd_neg(oprof_data[cpu].ctr_count[ctr], ctr);
+ }
+ }
+ return;
+}
+
+
+static void
+op_raw_pmu_interrupt(int irq, void * arg, struct pt_regs * regs)
+{
+ u64 pmc0;
+
+ pmc0 = ia64_get_pmc(0);
+
+ if ((pmc0 & ~0x1UL) != 0UL) {
+ op_do_pmu_interrupt(pmc0, regs);
+ ia64_set_pmc(0, 0);
+ ia64_srlz_d();
+ }
+}
+
+
+#define MY_OPROFILE_VECTOR (IA64_PERFMON_VECTOR - 2)
+
+static void
+op_set_pmv(void * dummy)
+{
+ ia64_set_pmv(MY_OPROFILE_VECTOR);
+ ia64_srlz_d();
+}
+
+
+static void
+op_restore_pmv(void* dummy)
+{
+ ia64_set_pmv(IA64_PERFMON_VECTOR);
+ ia64_srlz_d();
+}
+
+
+static int
+install_handler(void)
+{
+ int err = 0;
+
+ /* Try it legally - confusion about vec vs irq */
+ err = request_irq(MY_OPROFILE_VECTOR, op_raw_pmu_interrupt,
+ SA_INTERRUPT | SA_PERCPU_IRQ, "oprofile", NULL);
+
+ if (err) {
+ printk(KERN_ALERT "oprofile_IA64: request_irq fails, "
+ "returns %d\n", err);
+ return err;
+ }
+
+ if ((smp_call_function(op_set_pmv, NULL, 0, 1))) {
+ printk(KERN_ALERT "oprofile_IA64: unexpected failure "
+ "of smp_call_function(op_set_pmv)\n");
+ }
+
+ op_set_pmv(NULL);
+
+ return err;
+}
+
+
+static int
+restore_handler(void)
+{
+ int err = 0;
+
+ if ((smp_call_function(op_restore_pmv, NULL, 0, 1))) {
+ printk(KERN_ALERT "oprofile_IA64: unexpected failure "
+ "of smp_call_function(op_restore_pmv)\n");
+ }
+
+ op_restore_pmv(NULL);
+
+ free_irq(MY_OPROFILE_VECTOR, NULL);
+ return err;
+}
+
+
+/* ---------------- PMU setup ------------------ */
+
+/* This is kind of artificial. The proc interface might really want to
+ * accept register values directly. There are other features not exposed
+ * by this limited interface. Of course that might require all sorts of
+ * validity checking??? */
+static void
+pmc_fill_in(ulong * val, u8 kernel, u8 user, u8 event, u8 um)
+{
+ /* enable interrupt generation */
+ *val |= (1 << 5);
+
+ /* setup as a privileged monitor */
+ *val |= (1 << 6);
+
+ /* McKinley requires pmc4 to have bit 23 set (enable PMU).
+ * It is supposedly ignored in other pmc registers.
+ * Try assuming it's ignored in Itanium, too, and just
+ * set it for everyone.
+ */
+
+ *val |= (1 << 23);
+
+ /* enable/disable chosen OS and USR counting */
+ (user) ? (*val |= (1 << 3))
+ : (*val &= ~(1 << 3));
+
+ (kernel) ? (*val |= (1 << 0))
+ : (*val &= ~(1 << 0));
+
+ /* what are we counting ? */
+ *val &= ~(0xff << 8);
+ *val |= ((event & 0xff) << 8);
+ *val &= ~(0xf << 16);
+ *val |= ((um & 0xf) << 16);
+}
+
+
+static void
+pmu_setup(void * dummy)
+{
+ ulong pmc_val;
+ int ii;
+
+ /* setup each counter */
+ for (ii = 0 ; ii < op_nr_counters ; ++ii) {
+ if (sysctl.ctr[ii].enabled) {
+ pmc_val = 0;
+
+ set_pmd_neg(sysctl.ctr[ii].count, ii);
+ pmc_fill_in(&pmc_val, sysctl.ctr[ii].kernel,
+ sysctl.ctr[ii].user, sysctl.ctr[ii].event,
+ sysctl.ctr[ii].unit_mask);
+
+ set_pmc(pmc_val, ii);
+ }
+ }
+}
+
+
+void
+disable_psr(void * dummy)
+{
+ struct pt_regs * regs;
+ /* disable profiling for my saved state */
+ regs = (struct pt_regs *)((unsigned long) current + IA64_STK_OFFSET);
+ regs--;
+ ia64_psr(regs)->pp = 0;
+ /* shouldn't need to */
+ ia64_psr(regs)->up = 0;
+
+ /* disable profiling for my current state */
+ __asm__ __volatile__ ("rsm psr.pp;;"::: "memory");
+
+#if defined(CONFIG_PERFMON) && defined(CONFIG_SMP)
+#if V_AT_LEAST(2, 4, 21)
+ local_cpu_data->pfm_syst_info |= PFM_CPUINFO_SYST_WIDE;
+ local_cpu_data->pfm_syst_info &= ~PFM_CPUINFO_DCR_PP;
+ /* FIXME: what todo with the 3rd flags PFM_CPUINFO_EXCL_IDLE 0x4 */
+#else
+ /* disable profiling for everyone else */
+ local_cpu_data->pfm_syst_wide = 1;
+ local_cpu_data->pfm_dcr_pp = 0;
+#endif
+#endif
+ ia64_set_pmc(0, 0);
+ ia64_srlz_d();
+}
+
+
+static int
+pmu_setup_all(void)
+{
+
+ /* This would be a great place to reserve all cpus with
+ * some sort of call to perfmonctl (something like the
+ * CREATE_CONTEXT command). The current interface to
+ * perfmonctl wants to be called from a different task id
+ * for each CPU to be set up (and doesn't allow calls from
+ * modules.
+ */
+
+ /* disable profiling with the psr.pp bit */
+ if ((smp_call_function(disable_psr, NULL, 0, 1)))
+ return -EFAULT;
+
+ disable_psr(NULL);
+
+ /* now I've reserved the PMUs and they should be quiet */
+
+ if ((smp_call_function(pmu_setup, NULL, 0, 1)))
+ return -EFAULT;
+
+ pmu_setup(NULL);
+ return 0;
+}
+
+
+#ifndef CONFIG_SMP
+/* from linux/arch/ia64/kernel/perfmon.c */
+/*
+ * Originaly Written by Ganesh Venkitachalam, IBM Corp.
+ * Copyright (C) 1999 Ganesh Venkitachalam <venkitac@us.ibm.com>
+ *
+ * Modifications by Stephane Eranian, Hewlett-Packard Co.
+ * Modifications by David Mosberger-Tang, Hewlett-Packard Co.
+ *
+ * Copyright (C) 1999-2002 Hewlett Packard Co
+ * Stephane Eranian <eranian@hpl.hp.com>
+ * David Mosberger-Tang <davidm@hpl.hp.com>
+ */
+
+/*
+ * On UP kernels, we do not need to constantly set the psr.pp bit
+ * when a task is scheduled. The psr.pp bit can only be changed in
+ * the kernel because of a user request. Given we are on a UP non preeemptive
+ * kernel we know that no other task is running, so we cna simply update their
+ * psr.pp from their saved state. There is this no impact on the context switch
+ * code compared to the SMP case.
+ */
+static void
+op_tasklist_toggle_pp(unsigned int val)
+{
+ struct task_struct * p;
+ struct pt_regs * regs;
+
+ read_lock(&tasklist_lock);
+
+ for_each_task(p) {
+ regs = (struct pt_regs *)((unsigned long) p + IA64_STK_OFFSET);
+
+ /*
+ * position on pt_regs saved on stack on 1st entry into the kernel
+ */
+ regs--;
+
+ /*
+ * update psr.pp
+ */
+ ia64_psr(regs)->pp = val;
+ }
+ read_unlock(&tasklist_lock);
+}
+#endif
+
+
+static void
+pmu_start(void * info)
+{
+ struct pt_regs * regs;
+
+ if (info && (*((uint *)info) != op_cpu_id()))
+ return;
+
+ /* printk(KERN_ALERT "oprofile_IA64: pmu_start on cpu %d\n",
+ op_cpu_id()); */
+ /* The default control register pp value is copied into psr.pp
+ * on an interrupt. This allows interrupt service routines to
+ * be monitored.
+ */
+ ia64_set_dcr(ia64_get_dcr() | IA64_DCR_PP);
+
+#ifdef CONFIG_PERFMON
+#ifdef CONFIG_SMP
+#if V_AT_LEAST(2, 4, 21)
+ local_cpu_data->pfm_syst_info |= PFM_CPUINFO_SYST_WIDE;
+ local_cpu_data->pfm_syst_info |= PFM_CPUINFO_DCR_PP;
+ /* FIXME: what todo with the 3rd flags PFM_CPUINFO_EXCL_IDLE 0x4 */
+#else
+ local_cpu_data->pfm_syst_wide = 1;
+ local_cpu_data->pfm_dcr_pp = 1;
+#endif
+#else
+ op_tasklist_toggle_pp(1);
+#endif
+#endif
+ /* set it in my saved state */
+ regs = (struct pt_regs *)((unsigned long) current + IA64_STK_OFFSET);
+ regs--;
+ ia64_psr(regs)->pp = 1;
+
+ /* set it in my current state */
+ __asm__ __volatile__ ("ssm psr.pp;;"::: "memory");
+ ia64_srlz_d();
+}
+
+
+static void
+pmu_stop(void * info)
+{
+ struct pt_regs * regs;
+
+ if (info && (*((uint *)info) != op_cpu_id()))
+ return;
+
+ /* stop in my current state */
+ __asm__ __volatile__ ("rsm psr.pp;;"::: "memory");
+
+ /* disable the dcr pp */
+ ia64_set_dcr(ia64_get_dcr() & ~IA64_DCR_PP);
+
+#ifdef CONFIG_PERFMON
+#ifdef CONFIG_SMP
+#if V_AT_LEAST(2, 4, 21)
+ local_cpu_data->pfm_syst_info &= ~PFM_CPUINFO_SYST_WIDE;
+ local_cpu_data->pfm_syst_info &= ~PFM_CPUINFO_DCR_PP;
+ /* FIXME: what todo with the 3rd flags PFM_CPUINFO_EXCL_IDLE 0x4 */
+#else
+ local_cpu_data->pfm_syst_wide = 0;
+ local_cpu_data->pfm_dcr_pp = 0;
+#endif
+#else
+ pfm_tasklist_toggle_pp(0);
+#endif
+#endif
+
+ /* disable in my saved state */
+ regs = (struct pt_regs *)((unsigned long) current + IA64_STK_OFFSET);
+ regs--;
+ ia64_psr(regs)->pp = 0;
+}
+
+
+static void
+pmu_select_start(uint cpu)
+{
+ if (cpu == op_cpu_id())
+ pmu_start(NULL);
+ else
+ smp_call_function(pmu_start, &cpu, 0, 1);
+}
+
+
+static void
+pmu_select_stop(uint cpu)
+{
+ if (cpu == op_cpu_id())
+ pmu_stop(NULL);
+ else
+ smp_call_function(pmu_stop, &cpu, 0, 1);
+}
+
+
+static void
+pmu_start_all(void)
+{
+ int cpu, i;
+
+ for (cpu=0; cpu < smp_num_cpus; cpu++) {
+ struct _oprof_data * data = &oprof_data[cpu];
+
+ for (i = 0 ; i < op_nr_counters ; ++i) {
+ if (sysctl.ctr[i].enabled) {
+ data->ctr_count[i] = sysctl.ctr[i].count;
+ } else {
+ data->ctr_count[i] = 0;
+ }
+ }
+ }
+
+ if (!install_handler()) {
+ smp_call_function(pmu_start, NULL, 0, 1);
+ pmu_start(NULL);
+ }
+ /* FIXME need some way to fail here */;
+}
+
+
+static void
+pmu_stop_all(void)
+{
+ smp_call_function(pmu_stop, NULL, 0, 1);
+ pmu_stop(NULL);
+ restore_handler();
+}
+
+
+static int
+pmu_check_params(void)
+{
+ int i;
+ int enabled = 0;
+
+ for (i = 0; i < op_nr_counters ; i++) {
+ if (!sysctl.ctr[i].enabled)
+ continue;
+
+ enabled = 1;
+
+ if (!sysctl.ctr[i].user && !sysctl.ctr[i].kernel) {
+ printk(KERN_ERR "oprofile: neither kernel nor user "
+ "set for counter %d\n", i);
+ return -EINVAL;
+ }
+
+ if (check_range(sysctl.ctr[i].count, 1, OP_MAX_PERF_COUNT,
+ "ctr count value %d not in range (%d %ld)\n"))
+ return -EINVAL;
+ }
+
+ if (!enabled) {
+ printk(KERN_ERR "oprofile: no counters have been enabled.\n");
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
+
+static struct op_msrs cpu_msrs[NR_CPUS];
+
+
+static void free_msr_group(struct op_msr_group * group)
+{
+ if (group->addrs)
+ kfree(group->addrs);
+ if (group->saved)
+ kfree(group->saved);
+ group->addrs = NULL;
+ group->saved = NULL;
+}
+
+
+static void pmu_save_registers(void * dummy)
+{
+ uint i;
+ uint const cpu = op_cpu_id();
+ struct op_msr_group * counters = &cpu_msrs[cpu].counters;
+ struct op_msr_group * controls = &cpu_msrs[cpu].controls;
+
+ counters->addrs = NULL;
+ counters->saved = NULL;
+ controls->addrs = NULL;
+ controls->saved = NULL;
+
+ counters->saved = kmalloc(
+ op_nr_counters * sizeof(struct op_saved_msr), GFP_KERNEL);
+ if (!counters->saved)
+ goto fault;
+
+ controls->saved = kmalloc(
+ op_nr_counters * sizeof(struct op_saved_msr), GFP_KERNEL);
+ if (!controls->saved)
+ goto fault;
+
+ for (i = 0; i < op_nr_counters; ++i) {
+ controls->saved[i].low = get_pmc(i);
+ counters->saved[i].low = get_pmd(i);
+ }
+ return;
+
+fault:
+ free_msr_group(counters);
+ free_msr_group(controls);
+}
+
+
+static void pmu_restore_registers(void * dummy)
+{
+ uint i;
+ uint const cpu = op_cpu_id();
+ struct op_msr_group * counters = &cpu_msrs[cpu].counters;
+ struct op_msr_group * controls = &cpu_msrs[cpu].controls;
+
+ for (i = 0; i < op_nr_counters; ++i) {
+ set_pmc(controls->saved[i].low, i);
+ set_pmd(counters->saved[i].low, i);
+ }
+
+ free_msr_group(counters);
+ free_msr_group(controls);
+}
+
+
+
+static int
+pmu_init(void)
+{
+ int err = 0;
+
+ /* figure out processor type configure number of bits in pmd
+ and number of counters */
+ switch (get_cpu_type()) {
+ case CPU_IA64_1:
+ pmd_mask = IA64_1_PMD_MASK_VAL; break;
+ case CPU_IA64_2:
+ case CPU_IA64:
+ pmd_mask = IA64_2_PMD_MASK_VAL; break;
+ default:
+ err = -EIO; break;
+ }
+
+ op_nr_counters = 4;
+
+ if ((err = smp_call_function(pmu_save_registers, NULL, 0, 1)))
+ goto out;
+
+ pmu_save_registers(NULL);
+
+out:
+ return err;
+}
+
+
+static void
+pmu_deinit(void)
+{
+ smp_call_function(pmu_restore_registers, NULL, 0, 1);
+ pmu_restore_registers(NULL);
+}
+
+
+static char * names[] = { "0", "1", "2", "3", };
+
+
+static int
+pmu_add_sysctls(ctl_table * next)
+{
+ ctl_table * start = next;
+ ctl_table * tab;
+ int i, j;
+
+ for (i=0; i < op_nr_counters; i++) {
+ next->ctl_name = 1;
+ next->procname = names[i];
+ next->mode = 0700;
+
+ if (!(tab = kmalloc(sizeof(ctl_table)*7, GFP_KERNEL)))
+ goto cleanup;
+
+ next->child = tab;
+
+ memset(tab, 0, sizeof(ctl_table)*7);
+ tab[0] = ((ctl_table) { 1, "enabled", &sysctl_parms.ctr[i].enabled, sizeof(int), 0600, NULL, lproc_dointvec, NULL, });
+ tab[1] = ((ctl_table) { 1, "event", &sysctl_parms.ctr[i].event, sizeof(int), 0600, NULL, lproc_dointvec, NULL, });
+ tab[2] = ((ctl_table) { 1, "count", &sysctl_parms.ctr[i].count, sizeof(int), 0600, NULL, lproc_dointvec, NULL, });
+ tab[3] = ((ctl_table) { 1, "unit_mask", &sysctl_parms.ctr[i].unit_mask, sizeof(int), 0600, NULL, lproc_dointvec, NULL, });
+ tab[4] = ((ctl_table) { 1, "kernel", &sysctl_parms.ctr[i].kernel, sizeof(int), 0600, NULL, lproc_dointvec, NULL, });
+ tab[5] = ((ctl_table) { 1, "user", &sysctl_parms.ctr[i].user, sizeof(int), 0600, NULL, lproc_dointvec, NULL, });
+ next++;
+ }
+
+ return 0;
+
+cleanup:
+ next = start;
+ for (j = 0; j < i; j++) {
+ kfree(next->child);
+ next++;
+ }
+ return -EFAULT;
+}
+
+
+static void pmu_remove_sysctls(ctl_table * next)
+{
+ int ii;
+
+ for (ii=0; ii < op_nr_counters; ii++) {
+ kfree(next->child);
+ next++;
+ }
+}
+
+
+struct op_int_operations op_nmi_ops = {
+ init: pmu_init,
+ deinit: pmu_deinit,
+ add_sysctls: pmu_add_sysctls,
+ remove_sysctls: pmu_remove_sysctls,
+ check_params: pmu_check_params,
+ setup: pmu_setup_all,
+ start: pmu_start_all,
+ stop: pmu_stop_all,
+ start_cpu: pmu_select_start,
+ stop_cpu: pmu_select_stop,
+};
+
+
+struct op_int_operations const * op_int_interface()
+{
+ return &op_nmi_ops;
+}
+
+/* Need this dummy so module/oprofile.c links */
+struct op_int_operations op_rtc_ops = {
+ init: NULL,
+ deinit: NULL,
+ add_sysctls: NULL,
+ remove_sysctls: NULL,
+ check_params: NULL,
+ setup: NULL,
+ start: NULL,
+ stop: NULL,
+ start_cpu: NULL,
+ stop_cpu: NULL,
+};
diff --git a/module/ia64/op_syscalls.c b/module/ia64/op_syscalls.c
new file mode 100644
index 0000000..d68c916
--- /dev/null
+++ b/module/ia64/op_syscalls.c
@@ -0,0 +1,383 @@
+/**
+ * @file op_syscalls.c
+ * Tracing of system calls
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Bob Montgomery
+ * @author Will Cohen
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include <linux/sched.h>
+#include <linux/unistd.h>
+#include <linux/mman.h>
+#include <linux/file.h>
+
+#include "oprofile.h"
+#include "op_dcache.h"
+#include "op_util.h"
+
+uint dname_top;
+struct qstr **dname_stack;
+char * pool_pos;
+char * pool_start;
+char * pool_end;
+
+void oprof_put_note(struct op_note * samp);
+
+/* ------------ system calls --------------- */
+
+struct mmap_arg_struct {
+ unsigned long addr;
+ unsigned long len;
+ unsigned long prot;
+ unsigned long flags;
+ unsigned long fd;
+ unsigned long offset;
+};
+
+/* --------- IA64 versions of system calls ------ */
+asmlinkage static int (*old_sys_clone)(long, long);
+asmlinkage static int (*old_sys_clone2)(long, long, long);
+asmlinkage static int (*old_sys_execve)(char *, char **, char **);
+asmlinkage static unsigned long (*old_sys_mmap)(unsigned long,
+ unsigned long, int, int, int, long);
+asmlinkage static unsigned long (*old_sys_mmap2)(unsigned long,
+ unsigned long, int, int, int, long);
+asmlinkage static long (*old_sys_init_module)(char const *, struct module *);
+asmlinkage static long (*old_sys_exit)(int);
+
+/* --------- declarations of interception stubs for IA64 ------ */
+asmlinkage long post_stub_clone(long, long);
+asmlinkage long post_stub_clone2(long, long, long);
+asmlinkage long my_ia64_execve(char *, char **, char **);
+asmlinkage unsigned long post_stub_mmap(unsigned long,
+ unsigned long, int, int, int, long);
+asmlinkage unsigned long post_stub_mmap2(unsigned long,
+ unsigned long, int, int, int, long);
+asmlinkage long post_stub_init_module(char const *, struct module *);
+asmlinkage long pre_stub_exit(int);
+
+/* IA64 system call table doesn't use function pointers, it uses
+ * pointers to code (not the same thing). Basically it can violate the
+ * procedure calling rules because these "procedure calls" are made by
+ * the assembly language BREAK handler in ivt.S.
+ */
+
+struct fdesc {
+ void * ip;
+ void * gp;
+};
+
+struct fdesc fdesc_clone;
+struct fdesc fdesc_clone2;
+struct fdesc fdesc_execve;
+struct fdesc fdesc_mmap;
+struct fdesc fdesc_mmap2;
+struct fdesc fdesc_init_module;
+struct fdesc fdesc_exit;
+/* ----------- End of IA64 weirdness for now -------------- */
+
+spinlock_t map_lock = SPIN_LOCK_UNLOCKED;
+
+/* called with map_lock held */
+static void oprof_output_map(ulong addr, ulong len,
+ ulong offset, struct file * file, int is_execve)
+{
+ struct op_note note;
+
+ /* don't bother with /dev/zero mappings etc. */
+ if (!len)
+ return;
+
+ note.pid = current->pid;
+ note.tgid = op_get_tgid();
+ note.addr = addr;
+ note.len = len;
+ note.offset = offset;
+ note.type = is_execve ? OP_EXEC : OP_MAP;
+ note.hash = hash_path(file);
+ if (note.hash == -1)
+ return;
+ oprof_put_note(&note);
+}
+
+static int oprof_output_maps(struct task_struct * task)
+{
+ int size=0;
+ struct mm_struct * mm;
+ struct vm_area_struct * map;
+
+ /* we don't need to worry about mm_users here, since there is at
+ least one user (current), and if there's other code using this
+ mm, then mm_users must be at least 2; we should never have to
+ mmput() here. */
+
+ if (!(mm = task->mm))
+ goto out;
+
+ lock_mmap(mm);
+ spin_lock(&map_lock);
+
+ /* We need two pass, daemon assume than the first mmap notification
+ * is for the executable but some process doesn't follow this model.
+ */
+ for (map = mm->mmap; map; map = map->vm_next) {
+ if (!(map->vm_flags & VM_EXEC) || !map->vm_file)
+ continue;
+ if (!(map->vm_flags & VM_EXECUTABLE))
+ continue;
+
+ oprof_output_map(map->vm_start, map->vm_end-map->vm_start,
+ GET_VM_OFFSET(map), map->vm_file, 1);
+ }
+ for (map = mm->mmap; map; map = map->vm_next) {
+ if (!(map->vm_flags & VM_EXEC) || !map->vm_file)
+ continue;
+ if (map->vm_flags & VM_EXECUTABLE)
+ continue;
+
+ oprof_output_map(map->vm_start, map->vm_end-map->vm_start,
+ GET_VM_OFFSET(map), map->vm_file, 0);
+ }
+ spin_unlock(&map_lock);
+ unlock_mmap(mm);
+
+out:
+ return size;
+}
+
+
+/* execve is a special case on IA64. The others get the result and
+ * arguments after the system call has been made from the ASM stub. */
+
+asmlinkage long
+my_sys_execve (char * filename, char **argv, char **envp, struct pt_regs * regs)
+{
+ int error;
+
+ MOD_INC_USE_COUNT;
+
+ filename = getname(filename);
+ error = PTR_ERR(filename);
+ if (IS_ERR(filename))
+ goto out;
+ error = do_execve(filename, argv, envp, regs);
+
+ if (!error) {
+ PTRACE_OFF(current);
+ oprof_output_maps(current);
+ }
+ putname(filename);
+out:
+ unlock_execve();
+ MOD_DEC_USE_COUNT;
+ return error;
+}
+
+
+static void out_mmap(ulong addr, ulong len, ulong prot, ulong flags,
+ ulong fd, ulong offset)
+{
+ struct file * file;
+
+ lock_out_mmap();
+
+ file = fget(fd);
+ if (!file)
+ goto out;
+
+ spin_lock(&map_lock);
+ oprof_output_map(addr, len, offset, file, 0);
+ spin_unlock(&map_lock);
+
+ fput(file);
+
+out:
+ unlock_out_mmap();
+}
+
+
+/*
+ * IA64 mmap routines:
+ * The post_sys_* routines are called after the syscall has been made.
+ * The first argument is the return value from the system call.
+ */
+asmlinkage void post_sys_mmap2(ulong ret, ulong addr, ulong len,
+ ulong prot, ulong flags, ulong fd, ulong pgoff)
+{
+ /* FIXME: This should be done in the ASM stub. */
+ MOD_INC_USE_COUNT;
+
+ if ((prot & PROT_EXEC) && ret >= 0)
+ out_mmap(ret, len, prot, flags, fd, pgoff << PAGE_SHIFT);
+ goto out;
+out:
+ MOD_DEC_USE_COUNT;
+}
+
+asmlinkage void post_sys_mmap(ulong ret, ulong addr, ulong len,
+ ulong prot, ulong flags, ulong fd, ulong off)
+{
+ /* FIXME: This should be done in the ASM stub. */
+ MOD_INC_USE_COUNT;
+
+ if ((prot & PROT_EXEC) && ret >= 0)
+ out_mmap(ret, len, prot, flags, fd, off);
+ goto out;
+out:
+ MOD_DEC_USE_COUNT;
+}
+
+
+inline static void oprof_report_fork(u32 old_pid, u32 new_pid, u32 old_tgid, u32 new_tgid)
+{
+ struct op_note note;
+
+ note.type = OP_FORK;
+ note.pid = old_pid;
+ note.tgid = old_tgid;
+ note.addr = new_pid;
+ note.len = new_tgid;
+ oprof_put_note(&note);
+}
+
+
+asmlinkage void post_sys_clone(long ret, long arg0, long arg1)
+{
+ u32 pid = current->pid;
+ u32 tgid = op_get_tgid();
+
+ /* FIXME: This should be done in the ASM stub. */
+ MOD_INC_USE_COUNT;
+
+ if (ret)
+ /* FIXME: my libc show clone() is not implemented in ia64
+ * but used only by fork() with a SIGCHILD first parameter
+ * so we assume it's a fork */
+ oprof_report_fork(pid, ret, pid, tgid);
+ MOD_DEC_USE_COUNT;
+}
+
+asmlinkage void post_sys_clone2(long ret, long arg0, long arg1, long arg2)
+{
+ u32 pid = current->pid;
+ u32 tgid = op_get_tgid();
+ long clone_flags = arg0;
+
+ /* FIXME: This should be done in the ASM stub. */
+ MOD_INC_USE_COUNT;
+
+ if (ret) {
+ if (clone_flags & CLONE_THREAD)
+ oprof_report_fork(pid, ret, tgid, tgid);
+ else
+ oprof_report_fork(pid, ret, tgid, ret);
+ }
+ MOD_DEC_USE_COUNT;
+}
+
+asmlinkage void
+post_sys_init_module(long ret, char const * name_user,
+ struct module * mod_user)
+{
+ /* FIXME: This should be done in the ASM stub. */
+ MOD_INC_USE_COUNT;
+
+ if (ret >= 0) {
+ struct op_note note;
+
+ note.type = OP_DROP_MODULES;
+ oprof_put_note(&note);
+ }
+ MOD_DEC_USE_COUNT;
+}
+
+/* Exit must use a pre-call intercept stub. There is no post exit. */
+asmlinkage void pre_sys_exit(int error_code)
+{
+ struct op_note note;
+
+ MOD_INC_USE_COUNT;
+
+ note.addr = current->times.tms_utime;
+ note.len = current->times.tms_stime;
+ note.offset = current->start_time;
+ note.type = OP_EXIT;
+ note.pid = current->pid;
+ note.tgid = op_get_tgid();
+ oprof_put_note(&note);
+
+ /* this looks UP-dangerous, as the exit sleeps and we don't
+ * have a use count, but in fact its ok as sys_exit is noreturn,
+ * so we can never come back to this non-existent exec page
+ */
+ MOD_DEC_USE_COUNT;
+}
+
+extern void * sys_call_table[];
+
+/* FIXME: Now that I'm never trying to do a C-level call through these
+ * pointers, I should just save, intercept, and restore with void *
+ * instead of the void * part of the function descriptor, I think.
+ */
+
+void op_save_syscalls(void)
+{
+ fdesc_clone.ip = sys_call_table[__NR_clone - __NR_ni_syscall];
+ old_sys_clone = (void *)&fdesc_clone;
+ fdesc_clone2.ip = sys_call_table[__NR_clone2 - __NR_ni_syscall];
+ old_sys_clone2 = (void *)&fdesc_clone2;
+ fdesc_execve.ip = sys_call_table[__NR_execve - __NR_ni_syscall];
+ old_sys_execve = (void *)&fdesc_execve;
+ fdesc_mmap.ip = sys_call_table[__NR_mmap - __NR_ni_syscall];
+ old_sys_mmap = (void *)&fdesc_mmap;
+ fdesc_mmap2.ip = sys_call_table[__NR_mmap2 - __NR_ni_syscall];
+ old_sys_mmap2 = (void *)&fdesc_mmap2;
+ fdesc_init_module.ip = sys_call_table[__NR_init_module - __NR_ni_syscall];
+ old_sys_init_module = (void *)&fdesc_init_module;
+ fdesc_exit.ip = sys_call_table[__NR_exit - __NR_ni_syscall];
+ old_sys_exit = (void *)&fdesc_exit;
+}
+
+void op_intercept_syscalls(void)
+{
+ /* Must extract the function address from the stub function
+ * descriptors.
+ */
+ sys_call_table[__NR_clone - __NR_ni_syscall] =
+ ((struct fdesc *)post_stub_clone)->ip;
+ sys_call_table[__NR_clone2 - __NR_ni_syscall] =
+ ((struct fdesc *)post_stub_clone2)->ip;
+ sys_call_table[__NR_execve - __NR_ni_syscall] =
+ ((struct fdesc *)my_ia64_execve)->ip;
+ sys_call_table[__NR_mmap - __NR_ni_syscall] =
+ ((struct fdesc *)post_stub_mmap)->ip;
+ sys_call_table[__NR_mmap2 - __NR_ni_syscall] =
+ ((struct fdesc *)post_stub_mmap2)->ip;
+ sys_call_table[__NR_init_module - __NR_ni_syscall] =
+ ((struct fdesc *)post_stub_init_module)->ip;
+ sys_call_table[__NR_exit - __NR_ni_syscall] =
+ ((struct fdesc *)pre_stub_exit)->ip;
+}
+
+void op_restore_syscalls(void)
+{
+ sys_call_table[__NR_clone - __NR_ni_syscall] =
+ ((struct fdesc *)old_sys_clone)->ip;
+ sys_call_table[__NR_clone2 - __NR_ni_syscall] =
+ ((struct fdesc *)old_sys_clone2)->ip;
+ sys_call_table[__NR_execve - __NR_ni_syscall] =
+ ((struct fdesc *)old_sys_execve)->ip;
+ sys_call_table[__NR_mmap - __NR_ni_syscall] =
+ ((struct fdesc *)old_sys_mmap)->ip;
+ sys_call_table[__NR_mmap2 - __NR_ni_syscall] =
+ ((struct fdesc *)old_sys_mmap2)->ip;
+ sys_call_table[__NR_init_module - __NR_ni_syscall] =
+ ((struct fdesc *)old_sys_init_module)->ip;
+ sys_call_table[__NR_exit - __NR_ni_syscall] =
+ ((struct fdesc *)old_sys_exit)->ip;
+}
diff --git a/module/ia64/oprofile_stubs.S b/module/ia64/oprofile_stubs.S
new file mode 100644
index 0000000..3bc19ea
--- /dev/null
+++ b/module/ia64/oprofile_stubs.S
@@ -0,0 +1,140 @@
+/**
+ * @file oprofile_stubs.S
+ * Assembly language system call interceptor stubs
+ *
+ * @remark Copyright 2001-2002 Hewlett-Packard Company
+ * @remark Read the file COPYING
+ *
+ * @author Bob Montgomery <bob_montgomery@hp.com>
+ */
+
+/*
+ * This interceptor for execve was stolen from ia64/kernel/entry.S
+ *
+ * Kernel entry points.
+ *
+ * Copyright (C) 1998-2001 Hewlett-Packard Co
+ * David Mosberger-Tang <davidm@hpl.hp.com>
+ * Copyright (C) 1999 VA Linux Systems
+ * Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
+ * Copyright (C) 1999 Asit Mallick <Asit.K.Mallick@intel.com>
+ * Copyright (C) 1999 Don Dugger <Don.Dugger@intel.com>
+ */
+/*
+ * ia64_switch_to now places correct virtual mapping in in TR2 for
+ * kernel stack. This allows us to handle interrupts without changing
+ * to physical mode.
+ *
+ * Jonathan Nicklin <nicklin@missioncriticallinux.com>
+ * Patrick O'Rourke <orourke@missioncriticallinux.com>
+ * 11/07/2000
+ */
+/*
+ * Global (preserved) predicate usage on syscall entry/exit path:
+ *
+ * pKern: See entry.h.
+ * pUser: See entry.h.
+ * pSys: See entry.h.
+ * pNonSys: !pSys
+ */
+
+#include <linux/config.h>
+
+#include <asm/cache.h>
+#include <asm/errno.h>
+#include <asm/kregs.h>
+#include <asm/offsets.h>
+#include <asm/processor.h>
+#include <asm/unistd.h>
+#include <asm/asmmacro.h>
+#include <asm/pgtable.h>
+
+#include "IA64minstate.h"
+
+ /*
+ * execve() is special because in case of success, we need to
+ * setup a null register window frame.
+ */
+GLOBAL_ENTRY(my_ia64_execve)
+ .prologue ASM_UNW_PRLG_RP|ASM_UNW_PRLG_PFS, ASM_UNW_PRLG_GRSAVE(3)
+ alloc loc1=ar.pfs, 3, 3, 4, 0
+ mov loc0=rp
+ mov loc2=gp
+ .body
+ mov out0=in0 // filename
+ ;; // stop bit between alloc and call
+ mov out1=in1 // argv
+ mov out2=in2 // envp
+ add out3=16, sp // regs
+ /*
+ * We are here with the kernel's gp register value but we need
+ * to find the module's gp value before we can call our own
+ * routine. That's why we can't just use:
+ * br.call.sptk.many rp=my_sys_execve
+ * Use ip-relative addressing to get to the fptr since I can't
+ * use gp-relative anything without the module's gp.
+ */
+.L1_execve:
+ mov r3 = ip
+ ;;
+ addl r14 = .fptr_execve - .L1_execve, r3
+ ;;
+ ld8 r14=[r14]
+ ;;
+ ld8 r15=[r14], 8
+ ;;
+ ld8 gp=[r14]
+ ;;
+ mov b6=r15
+ br.call.sptk.many b0=b6
+ ;;
+.ret0: cmp4.ge p6, p7=r8, r0
+ mov ar.pfs=loc1 // restore ar.pfs
+ sxt4 r8=r8 // return 64-bit result
+ ;;
+ stf.spill [sp]=f0
+(p6) cmp.ne pKern, pUser=r0, r0 // a successful execve() lands us in user-mode...
+ mov gp=loc2
+ mov rp=loc0
+(p6) mov ar.pfs=r0 // clear ar.pfs on success
+(p7) br.ret.sptk.many rp
+
+ /*
+ * In theory, we'd have to zap this state only to prevent leaking of
+ * security sensitive state (e.g., if current->mm->dumpable is zero). However,
+ * this executes in less than 20 cycles even on Itanium, so it's not worth
+ * optimizing for...).
+ */
+ mov r4=0; mov f2=f0; mov b1=r0
+ mov r5=0; mov f3=f0; mov b2=r0
+ mov r6=0; mov f4=f0; mov b3=r0
+ mov r7=0; mov f5=f0; mov b4=r0
+ mov ar.unat=0; mov f10=f0; mov b5=r0
+ ldf.fill f11=[sp]; ldf.fill f12=[sp]; mov f13=f0
+ ldf.fill f14=[sp]; ldf.fill f15=[sp]; mov f16=f0
+ ldf.fill f17=[sp]; ldf.fill f18=[sp]; mov f19=f0
+ ldf.fill f20=[sp]; ldf.fill f21=[sp]; mov f22=f0
+ ldf.fill f23=[sp]; ldf.fill f24=[sp]; mov f25=f0
+ ldf.fill f26=[sp]; ldf.fill f27=[sp]; mov f28=f0
+ ldf.fill f29=[sp]; ldf.fill f30=[sp]; mov f31=f0
+ mov ar.lc=0
+ br.ret.sptk.many rp
+ .align 16
+.fptr_execve:
+ data8 @fptr(my_sys_execve)
+END(my_ia64_execve)
+
+/* These interceptors are from IA64syscallstub.h macros */
+#include "IA64syscallstub.h"
+
+SYSCALLSTUB_POST(clone)
+
+SYSCALLSTUB_POST(clone2)
+
+SYSCALLSTUB_POST(mmap)
+
+SYSCALLSTUB_POST(mmap2)
+
+SYSCALLSTUB_POST(init_module)
+
+SYSCALLSTUB_PRE(exit)
diff --git a/module/op_cache.h b/module/op_cache.h
new file mode 100644
index 0000000..90c5f6f
--- /dev/null
+++ b/module/op_cache.h
@@ -0,0 +1,57 @@
+/**
+ * @file op_cache.h
+ * Cache definitions for compatibility
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#ifndef OP_CACHE_H
+#define OP_CACHE_H
+
+#include <asm/cache.h>
+
+#ifndef L1_CACHE_ALIGN
+#define L1_CACHE_ALIGN(x) (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1))
+#endif
+
+#ifndef SMP_CACHE_BYTES
+#define SMP_CACHE_BYTES L1_CACHE_BYTES
+#endif
+
+/* 2.4.0 introduced __cacheline_aligned */
+#ifndef ____cacheline_aligned
+#define ____cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES)))
+#endif
+
+#ifndef __cacheline_aligned
+#ifdef MODULE
+#define __cacheline_aligned ____cacheline_aligned
+#else
+#define __cacheline_aligned \
+ __attribute__((__aligned__(SMP_CACHE_BYTES), \
+ __section__(".data.cacheline_aligned")))
+#endif
+#endif /* __cacheline_aligned */
+
+/* 2.4.10 introduced ___cacheline_aligned_in_smp */
+#ifndef ____cacheline_aligned_in_smp
+#ifdef CONFIG_SMP
+#define ____cacheline_aligned_in_smp ____cacheline_aligned
+#else
+#define ____cacheline_aligned_in_smp
+#endif /* CONFIG_SMP */
+#endif
+
+#ifndef __cacheline_aligned_in_smp
+#ifdef CONFIG_SMP
+#define __cacheline_aligned_in_smp __cacheline_aligned
+#else
+#define __cacheline_aligned_in_smp
+#endif /* CONFIG_SMP */
+#endif
+
+#endif /* !OP_CACHE_H */
diff --git a/module/op_dcache.h b/module/op_dcache.h
new file mode 100644
index 0000000..26560e1
--- /dev/null
+++ b/module/op_dcache.h
@@ -0,0 +1,87 @@
+/**
+ * @file op_dcache.h
+ * Compatibility functions for dcache lookups
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#ifndef OP_DCACHE_H
+#define OP_DCACHE_H
+
+#include <linux/sched.h>
+#include <linux/unistd.h>
+#include <linux/mman.h>
+#include <linux/file.h>
+
+#include "oprofile.h"
+
+extern uint op_dname_top;
+extern struct qstr **op_dname_stack;
+extern char * op_pool_pos;
+extern char * op_pool_start;
+extern char * op_pool_end;
+
+uint do_hash(struct dentry * dentry, struct vfsmount * vfsmnt, struct dentry * root, struct vfsmount * rootmnt);
+
+inline static uint alloc_in_pool(char const * str, uint len);
+inline static int add_hash_entry(struct op_hash_index * entry, uint parent, char const * name, uint len);
+inline static uint name_hash(char const * name, uint len, uint parent);
+
+inline static uint name_hash(char const * name, uint len, uint parent)
+{
+ uint hash=0;
+
+ while (len--)
+ hash = (hash + (name[len] << 4) + (name[len] >> 4)) * 11;
+
+ return (hash ^ parent) % OP_HASH_MAP_NR;
+}
+
+/* empty ascending dname stack */
+inline static void push_dname(struct qstr * dname)
+{
+ op_dname_stack[op_dname_top] = dname;
+ if (op_dname_top != DNAME_STACK_MAX)
+ op_dname_top++;
+ else
+ printk(KERN_ERR "oprofile: overflowed dname stack !\n");
+}
+
+inline static struct qstr * pop_dname(void)
+{
+ if (op_dname_top == 0)
+ return NULL;
+
+ return op_dname_stack[--op_dname_top];
+}
+
+inline static uint alloc_in_pool(char const * str, uint len)
+{
+ char * place = op_pool_pos;
+ if (op_pool_pos + len + 1 >= op_pool_end)
+ return 0;
+
+ strcpy(place, str);
+ op_pool_pos += len + 1;
+ return place - op_pool_start;
+}
+
+inline static char * get_from_pool(uint index)
+{
+ return op_pool_start + index;
+}
+
+inline static int add_hash_entry(struct op_hash_index * entry, uint parent, char const * name, uint len)
+{
+ entry->name = alloc_in_pool(name, len);
+ if (!entry->name)
+ return -1;
+ entry->parent = parent;
+ return 0;
+}
+
+#endif /* OP_DCACHE_H */
diff --git a/module/op_dname.c b/module/op_dname.c
new file mode 100644
index 0000000..136b358
--- /dev/null
+++ b/module/op_dname.c
@@ -0,0 +1,227 @@
+/**
+ * @file op_dname.c
+ * dentry stack walking
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include <linux/sched.h>
+#include <linux/unistd.h>
+#include <linux/mman.h>
+#include <linux/file.h>
+
+#include "oprofile.h"
+#include "op_dcache.h"
+#include "op_util.h"
+
+/* --------- device routines ------------- */
+
+uint op_dname_top;
+struct qstr ** op_dname_stack;
+char * op_pool_pos;
+char * op_pool_start;
+char * op_pool_end;
+
+static ulong hash_map_open;
+static struct op_hash_index * hash_map;
+
+unsigned long is_map_ready(void)
+{
+ return hash_map_open;
+}
+
+int oprof_init_hashmap(void)
+{
+ uint i;
+
+ op_dname_stack = kmalloc(DNAME_STACK_MAX * sizeof(struct qstr *), GFP_KERNEL);
+ if (!op_dname_stack)
+ return -EFAULT;
+ op_dname_top = 0;
+ memset(op_dname_stack, 0, DNAME_STACK_MAX * sizeof(struct qstr *));
+
+ hash_map = rvmalloc(PAGE_ALIGN(OP_HASH_MAP_SIZE));
+ if (!hash_map)
+ return -EFAULT;
+
+ for (i = 0; i < OP_HASH_MAP_NR; ++i) {
+ hash_map[i].name = 0;
+ hash_map[i].parent = -1;
+ }
+
+ op_pool_start = (char *)(hash_map + OP_HASH_MAP_NR);
+ op_pool_end = op_pool_start + POOL_SIZE;
+ op_pool_pos = op_pool_start;
+
+ /* Ensure that the zero hash map entry is never used, we use this
+ * value as end of path terminator */
+ hash_map[0].name = alloc_in_pool("/", 1);
+ hash_map[0].parent = 0;
+
+ return 0;
+}
+
+void oprof_free_hashmap(void)
+{
+ kfree(op_dname_stack);
+ rvfree(hash_map, PAGE_ALIGN(OP_HASH_MAP_SIZE));
+}
+
+int oprof_hash_map_open(void)
+{
+ if (test_and_set_bit(0, &hash_map_open))
+ return -EBUSY;
+
+ return 0;
+}
+
+int oprof_hash_map_release(void)
+{
+ if (!hash_map_open)
+ return -EFAULT;
+
+ clear_bit(0, &hash_map_open);
+ return 0;
+}
+
+int oprof_hash_map_mmap(struct file * file, struct vm_area_struct * vma)
+{
+ ulong start = (ulong)vma->vm_start;
+ ulong page, pos;
+ ulong size = (ulong)(vma->vm_end-vma->vm_start);
+
+ if (size > PAGE_ALIGN(OP_HASH_MAP_SIZE) || (vma->vm_flags & VM_WRITE) || GET_VM_OFFSET(vma))
+ return -EINVAL;
+
+ pos = (ulong)hash_map;
+ while (size > 0) {
+ page = kvirt_to_pa(pos);
+ if (remap_page_range(start, page, PAGE_SIZE, PAGE_SHARED))
+ return -EAGAIN;
+ start += PAGE_SIZE;
+ pos += PAGE_SIZE;
+ size -= PAGE_SIZE;
+ }
+ return 0;
+}
+
+
+#ifndef NEED_2_2_DENTRIES
+int wind_dentries_2_4(struct dentry * dentry, struct vfsmount * vfsmnt, struct dentry * root, struct vfsmount * rootmnt)
+{
+ struct dentry * d = dentry;
+ struct vfsmount * v = vfsmnt;
+
+ /* wind the dentries onto the stack pages */
+ for (;;) {
+ /* deleted ? */
+ if (!IS_ROOT(d) && list_empty(&d->d_hash))
+ return 0;
+
+ /* the root */
+ if (d == root && v == rootmnt)
+ break;
+
+ if (d == v->mnt_root || IS_ROOT(d)) {
+ if (v->mnt_parent == v)
+ break;
+ /* cross the mount point */
+ d = v->mnt_mountpoint;
+ v = v->mnt_parent;
+ }
+
+ push_dname(&d->d_name);
+
+ d = d->d_parent;
+ }
+
+ return 1;
+}
+
+/* called with note_lock held */
+uint do_path_hash_2_4(struct dentry * dentry, struct vfsmount * vfsmnt)
+{
+ uint value;
+ struct vfsmount * rootmnt;
+ struct dentry * root;
+
+ read_lock(&current->fs->lock);
+ rootmnt = mntget(current->fs->rootmnt);
+ root = dget(current->fs->root);
+ read_unlock(&current->fs->lock);
+
+ spin_lock(&dcache_lock);
+
+ value = do_hash(dentry, vfsmnt, root, rootmnt);
+
+ spin_unlock(&dcache_lock);
+ dput(root);
+ mntput(rootmnt);
+ return value;
+}
+#endif /* NEED_2_2_DENTRIES */
+
+/* called with note_lock held */
+uint do_hash(struct dentry * dentry, struct vfsmount * vfsmnt, struct dentry * root, struct vfsmount * rootmnt)
+{
+ struct qstr * dname;
+ uint value = -1;
+ uint firsthash;
+ uint incr;
+ uint parent = 0;
+ struct op_hash_index * entry;
+
+ if (!wind_dentries(dentry, vfsmnt, root, rootmnt))
+ goto out;
+
+ /* unwind and hash */
+
+ while ((dname = pop_dname())) {
+ /* if N is prime, value in [0-N[ and incr = max(1, value) then
+ * iteration: value = (value + incr) % N covers the range [0-N[
+ * in N iterations */
+ incr = firsthash = value = name_hash(dname->name, dname->len, parent);
+ if (incr == 0)
+ incr = 1;
+
+ retry:
+ entry = &hash_map[value];
+ /* existing entry ? */
+ if (streq(get_from_pool(entry->name), dname->name)
+ && entry->parent == parent)
+ goto next;
+
+ /* new entry ? */
+ if (entry->parent == -1) {
+ if (add_hash_entry(entry, parent, dname->name, dname->len))
+ goto fullpool;
+ goto next;
+ }
+
+ /* nope, find another place in the table */
+ value = (value + incr) % OP_HASH_MAP_NR;
+
+ if (value == firsthash)
+ goto fulltable;
+
+ goto retry;
+ next:
+ parent = value;
+ }
+
+out:
+ op_dname_top = 0;
+ return value;
+fullpool:
+ printk(KERN_ERR "oprofile: string pool exhausted.\n");
+ value = -1;
+ goto out;
+fulltable:
+ printk(KERN_ERR "oprofile: component hash table full :(\n");
+ value = -1;
+ goto out;
+}
diff --git a/module/op_init.c b/module/op_init.c
new file mode 100644
index 0000000..61394fc
--- /dev/null
+++ b/module/op_init.c
@@ -0,0 +1,33 @@
+/**
+ * @file op_init.c
+ * Initialisation stubs
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+// FIXME: any point in this file now we don't fiddle
+// with -march options ??
+
+#undef __NO_VERSION__
+
+#include "oprofile.h"
+
+EXPORT_NO_SYMBOLS;
+
+int __init stub_init(void)
+{
+ sysctl.cpu_type = get_cpu_type();
+ return oprof_init();
+}
+
+void __exit stub_exit(void)
+{
+ oprof_exit();
+}
+
+module_init(stub_init);
+module_exit(stub_exit);
diff --git a/module/op_util.c b/module/op_util.c
new file mode 100644
index 0000000..c35225c
--- /dev/null
+++ b/module/op_util.c
@@ -0,0 +1,103 @@
+/**
+ * @file op_util.c
+ * Various utility functions
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include <linux/vmalloc.h>
+#include <linux/wrapper.h>
+#include <linux/pagemap.h>
+
+#include "compat.h"
+
+#include "op_util.h"
+
+/* Given PGD from the address space's page table, return the kernel
+ * virtual mapping of the physical memory mapped at ADR.
+ */
+static inline unsigned long uvirt_to_kva(pgd_t * pgd, unsigned long adr)
+{
+ unsigned long ret = 0UL;
+ pmd_t * pmd;
+ pte_t * ptep, pte;
+
+ if (!pgd_none(*pgd)) {
+ pmd = pmd_offset(pgd, adr);
+ if (!pmd_none(*pmd)) {
+ ptep = pte_offset(pmd, adr);
+ pte = *ptep;
+ if (pte_present(pte)) {
+ ret = (unsigned long) pte_page_address(pte);
+ ret |= adr & (PAGE_SIZE - 1);
+ }
+ }
+ }
+ return ret;
+}
+
+/* Here we want the physical address of the memory.
+ * This is used when initializing the contents of the
+ * area and marking the pages as reserved.
+ */
+unsigned long kvirt_to_pa(unsigned long adr)
+{
+ unsigned long va, kva, ret;
+
+ va = VMALLOC_VMADDR(adr);
+ kva = uvirt_to_kva(pgd_offset_k(va), va);
+ ret = __pa(kva);
+ return ret;
+}
+
+void * rvmalloc(signed long size)
+{
+ void * mem;
+ unsigned long adr, page;
+
+ mem = VMALLOC_32(size);
+ if (!mem)
+ return NULL;
+
+ memset(mem, 0, size);
+
+ adr=(unsigned long) mem;
+ while (size > 0) {
+ page = kvirt_to_pa(adr);
+ mem_map_reserve(virt_to_page((unsigned long)__va(page)));
+ adr += PAGE_SIZE;
+ size -= PAGE_SIZE;
+ }
+ return mem;
+}
+
+void rvfree(void * mem, signed long size)
+{
+ unsigned long adr, page;
+
+ if (!mem)
+ return;
+
+ adr=(unsigned long) mem;
+ while (size > 0) {
+ page = kvirt_to_pa(adr);
+ mem_map_unreserve(virt_to_page((unsigned long)__va(page)));
+
+ adr += PAGE_SIZE;
+ size -= PAGE_SIZE;
+ }
+ vfree(mem);
+}
+
+int check_range(int val, int l, int h, char const * msg)
+{
+ if (val < l || val > h) {
+ printk(msg, val, l, h);
+ return -EINVAL;
+ }
+ return 0;
+}
diff --git a/module/op_util.h b/module/op_util.h
new file mode 100644
index 0000000..baea40e
--- /dev/null
+++ b/module/op_util.h
@@ -0,0 +1,21 @@
+/**
+ * @file op_util.h
+ * Various utility functions
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#ifndef OP_UTIL_H
+#define OP_UTIL_H
+
+unsigned long kvirt_to_pa(unsigned long adr);
+void * rvmalloc(signed long size);
+void rvfree(void * mem, signed long size);
+// returns non-zero on failure, inclusive
+int check_range(int val, int l, int h, char const * msg);
+
+#endif /* OP_UTIL_H */
diff --git a/module/oprofile.c b/module/oprofile.c
new file mode 100644
index 0000000..88dddd9
--- /dev/null
+++ b/module/oprofile.c
@@ -0,0 +1,880 @@
+/**
+ * @file oprofile.c
+ * Main driver code
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include "oprofile.h"
+#include "op_util.h"
+#include "config.h"
+
+EXPORT_NO_SYMBOLS;
+
+MODULE_AUTHOR("John Levon (levon@movementarian.org)");
+MODULE_DESCRIPTION("Continuous Profiling Module");
+MODULE_LICENSE("GPL");
+
+MODULE_PARM(allow_unload, "i");
+MODULE_PARM_DESC(allow_unload, "Allow module to be unloaded.");
+#ifdef CONFIG_SMP
+static int allow_unload;
+#else
+static int allow_unload = 1;
+#endif
+
+/* sysctl settables */
+struct oprof_sysctl sysctl_parms;
+/* some of the sys ctl settable variable needs to be copied to protect
+ * against user that try to change through /proc/sys/dev/oprofile/ * running
+ * parameters during profiling */
+struct oprof_sysctl sysctl;
+
+static enum oprof_state state __cacheline_aligned_in_smp = STOPPED;
+
+static int op_major;
+
+static volatile ulong oprof_opened __cacheline_aligned_in_smp;
+static volatile ulong oprof_note_opened __cacheline_aligned_in_smp;
+static DECLARE_WAIT_QUEUE_HEAD(oprof_wait);
+
+static u32 oprof_ready[NR_CPUS] __cacheline_aligned_in_smp;
+struct _oprof_data oprof_data[NR_CPUS] __cacheline_aligned;
+
+struct op_note * note_buffer __cacheline_aligned_in_smp;
+u32 note_pos __cacheline_aligned_in_smp;
+
+// the interrupt handler ops structure to use
+static struct op_int_operations const * int_ops;
+
+static char const * op_version = PACKAGE " " VERSION;
+
+/* ---------------- interrupt entry routines ------------------ */
+
+inline static int need_wakeup(uint cpu, struct _oprof_data * data)
+{
+ return data->nextbuf >= (data->buf_size - data->buf_watermark) && !oprof_ready[cpu];
+}
+
+inline static void next_sample(struct _oprof_data * data)
+{
+ if (unlikely(++data->nextbuf == data->buf_size))
+ data->nextbuf = 0;
+}
+
+inline static void evict_op_entry(uint cpu, struct _oprof_data * data, long irq_enabled)
+{
+ next_sample(data);
+ if (likely(!need_wakeup(cpu, data)))
+ return;
+
+ /* locking rationale :
+ *
+ * other CPUs are not a race concern since we synch on oprof_wait->lock.
+ *
+ * for the current CPU, we might have interrupted another user of e.g.
+ * runqueue_lock, deadlocking on SMP and racing on UP. So we check that IRQs
+ * were not disabled (corresponding to the irqsave/restores in __wake_up().
+ *
+ * Note that this requires all spinlocks taken by the full wake_up path
+ * to have saved IRQs - otherwise we can interrupt whilst holding a spinlock
+ * taken from some non-wake_up() path and deadlock. Currently this means only
+ * oprof_wait->lock and runqueue_lock: all instances disable IRQs before
+ * taking the lock.
+ *
+ * This will mean that approaching the end of the buffer, a number of the
+ * evictions may fail to wake up the daemon. We simply hope this doesn't
+ * take long; a pathological case could cause buffer overflow.
+ *
+ * Note that we use oprof_ready as our flag for whether we have initiated a
+ * wake-up. Once the wake-up is received, the flag is reset as well as
+ * data->nextbuf, preventing multiple wakeups.
+ *
+ * On 2.2, a global waitqueue_lock is used, so we must check it's not held
+ * by the current CPU. We make sure that any users of the wait queue (i.e.
+ * us and the code for wait_event_interruptible()) disable interrupts so it's
+ * still safe to check IF_MASK.
+ */
+ if (likely(irq_enabled)) {
+ oprof_ready[cpu] = 1;
+ wake_up(&oprof_wait);
+ }
+}
+
+inline static void
+fill_op_entry(struct op_sample * ops, long eip, pid_t pid, pid_t tgid, int ctr)
+{
+ ops->eip = eip;
+ ops->pid = pid;
+ ops->tgid = tgid;
+ ops->counter = ctr;
+}
+
+void op_do_profile(uint cpu, long eip, long irq_enabled, int ctr)
+{
+ struct _oprof_data * data = &oprof_data[cpu];
+ pid_t const pid = current->pid;
+ pid_t const tgid = op_get_tgid();
+ struct op_sample * samples = &data->buffer[data->nextbuf];
+
+ data->nr_irq++;
+
+ fill_op_entry(samples, eip, pid, tgid, ctr);
+ evict_op_entry(cpu, data, irq_enabled);
+}
+
+/* ---------------- driver routines ------------------ */
+
+/* only stop and start profiling interrupt when we are
+ * fully running !
+ */
+static void stop_cpu_perfctr(int cpu)
+{
+ if (state == RUNNING)
+ int_ops->stop_cpu(cpu);
+}
+
+static void start_cpu_perfctr(int cpu)
+{
+ if (state == RUNNING)
+ int_ops->start_cpu(cpu);
+}
+
+spinlock_t note_lock __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
+/* which buffer nr. is waiting to be read ? */
+int cpu_buffer_waiting;
+
+static int is_ready(void)
+{
+ uint cpu_nr;
+ for (cpu_nr = 0 ; cpu_nr < smp_num_cpus; cpu_nr++) {
+ if (oprof_ready[cpu_nr]) {
+ cpu_buffer_waiting = cpu_nr;
+ return 1;
+ }
+ }
+ return 0;
+}
+
+inline static void up_and_check_note(void)
+{
+ note_pos++;
+ if (likely(note_pos < (sysctl.note_size - OP_PRE_NOTE_WATERMARK(sysctl.note_size)) && !is_ready()))
+ return;
+
+ /* if we reach the end of the buffer, just pin
+ * to the last entry until it is read. This loses
+ * notes, but we have no choice. */
+ if (unlikely(note_pos == sysctl.note_size)) {
+ static int warned;
+ if (!warned) {
+ printk(KERN_WARNING "note buffer overflow: restart "
+ "oprofile with a larger note buffer.\n");
+ warned = 1;
+ }
+ sysctl.nr_note_buffer_overflow++;
+ note_pos = sysctl.note_size - 1;
+ }
+
+ /* we just use cpu 0 as a convenient one to wake up */
+ oprof_ready[0] = 2;
+ oprof_wake_up(&oprof_wait);
+}
+
+/* if holding note_lock */
+void __oprof_put_note(struct op_note * onote)
+{
+ /* ignore note if we're not up and running fully */
+ if (state != RUNNING)
+ return;
+
+ memcpy(&note_buffer[note_pos], onote, sizeof(struct op_note));
+ up_and_check_note();
+}
+
+void oprof_put_note(struct op_note * onote)
+{
+ spin_lock(&note_lock);
+ __oprof_put_note(onote);
+ spin_unlock(&note_lock);
+}
+
+static ssize_t oprof_note_read(char * buf, size_t count, loff_t * ppos)
+{
+ struct op_note * mybuf;
+ uint num;
+ ssize_t max;
+
+ max = sizeof(struct op_note) * sysctl.note_size;
+
+ if (*ppos || count != max)
+ return -EINVAL;
+
+ mybuf = vmalloc(max);
+ if (!mybuf)
+ return -EFAULT;
+
+ spin_lock(&note_lock);
+
+ num = note_pos;
+
+ count = note_pos * sizeof(struct op_note);
+
+ if (count)
+ memcpy(mybuf, note_buffer, count);
+
+ note_pos = 0;
+
+ spin_unlock(&note_lock);
+
+ if (count && copy_to_user(buf, mybuf, count))
+ count = -EFAULT;
+
+ vfree(mybuf);
+ return count;
+}
+
+static int oprof_note_open(void)
+{
+ if (test_and_set_bit(0, &oprof_note_opened))
+ return -EBUSY;
+ INC_USE_COUNT_MAYBE;
+ return 0;
+}
+
+static int oprof_note_release(void)
+{
+ BUG_ON(!oprof_note_opened);
+ clear_bit(0, &oprof_note_opened);
+ DEC_USE_COUNT_MAYBE;
+ return 0;
+}
+
+static int check_buffer_amount(int cpu_nr)
+{
+ struct _oprof_data * data = &oprof_data[cpu_nr];
+ int size = data->buf_size;
+ int num = data->nextbuf;
+ if (num < size - data->buf_watermark && oprof_ready[cpu_nr] != 2) {
+ printk(KERN_WARNING "oprofile: Detected overflow of size %d. "
+ "You must increase the module buffer size with\n"
+ "opcontrol --setup --bufer-size= or reduce the "
+ "interrupt frequency\n", num);
+ data->nr_buffer_overflow += num;
+ num = size;
+ } else
+ data->nextbuf = 0;
+ return num;
+}
+
+static int copy_buffer(char * buf, int cpu_nr)
+{
+ struct op_buffer_head head;
+ int ret = -EFAULT;
+
+ stop_cpu_perfctr(cpu_nr);
+
+ head.cpu_nr = cpu_nr;
+ head.count = check_buffer_amount(cpu_nr);
+ head.state = state;
+
+ oprof_ready[cpu_nr] = 0;
+
+ if (copy_to_user(buf, &head, sizeof(struct op_buffer_head)))
+ goto out;
+
+ if (head.count) {
+ size_t const size = head.count * sizeof(struct op_sample);
+ if (copy_to_user(buf + sizeof(struct op_buffer_head),
+ oprof_data[cpu_nr].buffer, size))
+ goto out;
+ ret = size + sizeof(struct op_buffer_head);
+ } else {
+ ret = sizeof(struct op_buffer_head);
+ }
+
+out:
+ start_cpu_perfctr(cpu_nr);
+ return ret;
+}
+
+static ssize_t oprof_read(struct file * file, char * buf, size_t count, loff_t * ppos)
+{
+ ssize_t max;
+
+ if (!capable(CAP_SYS_PTRACE))
+ return -EPERM;
+
+ switch (MINOR(file->f_dentry->d_inode->i_rdev)) {
+ case 2: return oprof_note_read(buf, count, ppos);
+ case 0: break;
+ default: return -EINVAL;
+ }
+
+ max = sizeof(struct op_buffer_head) + sizeof(struct op_sample) * sysctl.buf_size;
+
+ if (*ppos || count != max)
+ return -EINVAL;
+
+ switch (state) {
+ case RUNNING:
+ wait_event_interruptible(oprof_wait, is_ready());
+ if (signal_pending(current))
+ return -EINTR;
+ break;
+
+ /* Non-obvious. If O_NONBLOCK is set, that means
+ * the daemon knows it has to quit and is asking
+ * for final buffer data. If it's not set, then we
+ * have just transitioned to STOPPING, and we must
+ * inform the daemon (which we can do just by a normal
+ * operation).
+ */
+ case STOPPING: {
+ int cpu;
+
+ if (!(file->f_flags & O_NONBLOCK))
+ break;
+
+ for (cpu = 0; cpu < smp_num_cpus; ++cpu) {
+ if (oprof_data[cpu].nextbuf) {
+ cpu_buffer_waiting = cpu;
+ oprof_ready[cpu] = 2;
+ break;
+ }
+ }
+
+ if (cpu == smp_num_cpus)
+ return -EAGAIN;
+
+ }
+ break;
+
+ case STOPPED: BUG();
+ }
+
+ return copy_buffer(buf, cpu_buffer_waiting);
+}
+
+
+static int oprof_start(void);
+static int oprof_stop(void);
+
+static int oprof_open(struct inode * ino, struct file * file)
+{
+ int err;
+
+ if (!capable(CAP_SYS_PTRACE))
+ return -EPERM;
+
+ switch (MINOR(file->f_dentry->d_inode->i_rdev)) {
+ case 1: return oprof_hash_map_open();
+ case 2: return oprof_note_open();
+ case 0:
+ /* make sure the other devices are open */
+ if (is_map_ready())
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ if (test_and_set_bit(0, &oprof_opened))
+ return -EBUSY;
+
+ err = oprof_start();
+ if (err)
+ clear_bit(0, &oprof_opened);
+ return err;
+}
+
+static int oprof_release(struct inode * ino, struct file * file)
+{
+ switch (MINOR(file->f_dentry->d_inode->i_rdev)) {
+ case 1: return oprof_hash_map_release();
+ case 2: return oprof_note_release();
+ case 0: break;
+ default: return -EINVAL;
+ }
+
+ BUG_ON(!oprof_opened);
+
+ clear_bit(0, &oprof_opened);
+
+ // FIXME: is this safe when I kill -9 the daemon ?
+ return oprof_stop();
+}
+
+static int oprof_mmap(struct file * file, struct vm_area_struct * vma)
+{
+ if (MINOR(file->f_dentry->d_inode->i_rdev) == 1)
+ return oprof_hash_map_mmap(file, vma);
+ return -EINVAL;
+}
+
+/* called under spinlock, cannot sleep */
+static void oprof_free_mem(uint num)
+{
+ uint i;
+ for (i=0; i < num; i++) {
+ if (oprof_data[i].buffer)
+ vfree(oprof_data[i].buffer);
+ oprof_data[i].buffer = NULL;
+ }
+ vfree(note_buffer);
+ note_buffer = NULL;
+}
+
+static int oprof_init_data(void)
+{
+ uint i, notebufsize;
+ ulong buf_size;
+ struct _oprof_data * data;
+
+ sysctl.nr_note_buffer_overflow = 0;
+ notebufsize = sizeof(struct op_note) * sysctl.note_size;
+ note_buffer = vmalloc(notebufsize);
+ if (!note_buffer) {
+ printk(KERN_ERR "oprofile: failed to allocate note buffer of %u bytes\n",
+ notebufsize);
+ return -EFAULT;
+ }
+ note_pos = 0;
+
+ // safe init
+ for (i = 0; i < smp_num_cpus; ++i) {
+ data = &oprof_data[i];
+ data->buf_size = 0;
+ data->buffer = 0;
+ data->buf_watermark = 0;
+ data->nr_buffer_overflow = 0;
+ }
+
+ buf_size = (sizeof(struct op_sample) * sysctl.buf_size);
+
+ for (i = 0 ; i < smp_num_cpus ; ++i) {
+ data = &oprof_data[i];
+
+ data->buffer = vmalloc(buf_size);
+ if (!data->buffer) {
+ printk(KERN_ERR "oprofile: failed to allocate eviction buffer of %lu bytes\n", buf_size);
+ oprof_free_mem(i);
+ return -EFAULT;
+ }
+
+ memset(data->buffer, 0, buf_size);
+
+ data->buf_size = sysctl.buf_size;
+ data->buf_watermark = OP_PRE_WATERMARK(data->buf_size);
+ data->nextbuf = 0;
+ }
+
+ return 0;
+}
+
+static int parms_check(void)
+{
+ int err;
+
+ if ((err = check_range(sysctl.buf_size, OP_MIN_BUF_SIZE, OP_MAX_BUF_SIZE,
+ "sysctl.buf_size value %d not in range (%d %d)\n")))
+ return err;
+ if ((err = check_range(sysctl.note_size, OP_MIN_NOTE_TABLE_SIZE, OP_MAX_NOTE_TABLE_SIZE,
+ "sysctl.note_size value %d not in range (%d %d)\n")))
+ return err;
+
+ if ((err = int_ops->check_params()))
+ return err;
+
+ return 0;
+}
+
+
+static DECLARE_MUTEX(sysctlsem);
+
+
+static int oprof_start(void)
+{
+ int err = 0;
+
+ down(&sysctlsem);
+
+ /* save the sysctl settable things to protect against change through
+ * systcl the profiler params */
+ sysctl_parms.cpu_type = sysctl.cpu_type;
+ sysctl = sysctl_parms;
+
+ if ((err = oprof_init_data()))
+ goto out;
+
+ if ((err = parms_check())) {
+ oprof_free_mem(smp_num_cpus);
+ goto out;
+ }
+
+ if ((err = int_ops->setup())) {
+ oprof_free_mem(smp_num_cpus);
+ goto out;
+ }
+
+ op_intercept_syscalls();
+
+ int_ops->start();
+
+ state = RUNNING;
+
+out:
+ up(&sysctlsem);
+ return err;
+}
+
+/*
+ * stop interrupts being generated and notes arriving.
+ * This is idempotent.
+ */
+static void oprof_partial_stop(void)
+{
+ BUG_ON(state == STOPPED);
+
+ if (state == RUNNING) {
+ op_restore_syscalls();
+ int_ops->stop();
+ }
+
+ state = STOPPING;
+}
+
+static int oprof_stop(void)
+{
+ uint i;
+ // FIXME: err not needed
+ int err = -EINVAL;
+
+ down(&sysctlsem);
+
+ BUG_ON(state == STOPPED);
+
+ /* here we need to :
+ * bring back the old system calls
+ * stop the perf counter
+ * bring back the old NMI handler
+ * reset the map buffer stuff and ready values
+ *
+ * Nothing will be able to write into the map buffer because
+ * we synchronise via the spinlocks
+ */
+
+ oprof_partial_stop();
+
+ spin_lock(&note_lock);
+
+ for (i = 0 ; i < smp_num_cpus; i++) {
+ struct _oprof_data * data = &oprof_data[i];
+ oprof_ready[i] = 0;
+ data->nextbuf = 0;
+ }
+
+ oprof_free_mem(smp_num_cpus);
+
+ spin_unlock(&note_lock);
+ err = 0;
+
+ /* FIXME: can we really say this ? */
+ state = STOPPED;
+ up(&sysctlsem);
+ return err;
+}
+
+static struct file_operations oprof_fops = {
+#ifdef HAVE_FILE_OPERATIONS_OWNER
+ owner: THIS_MODULE,
+#endif
+ open: oprof_open,
+ release: oprof_release,
+ read: oprof_read,
+ mmap: oprof_mmap,
+};
+
+/*
+ * /proc/sys/dev/oprofile/
+ * bufsize
+ * notesize
+ * dump
+ * dump_stop
+ * nr_interrupts
+ * #ctr/
+ * event
+ * enabled
+ * count
+ * unit_mask
+ * kernel
+ * user
+ *
+ * #ctr is in [0-1] for PPro core, [0-3] for Athlon core
+ *
+ */
+
+/* These access routines are basically not safe on SMP for module unload.
+ * And there is nothing we can do about it - the API is broken. We'll just
+ * make a best-efforts thing. Note the sem is needed to prevent parms_check
+ * bypassing during oprof_start().
+ */
+
+static void lock_sysctl(void)
+{
+ MOD_INC_USE_COUNT;
+ down(&sysctlsem);
+}
+
+static void unlock_sysctl(void)
+{
+ up(&sysctlsem);
+ MOD_DEC_USE_COUNT;
+}
+
+static int get_nr_interrupts(ctl_table * table, int write, struct file * filp, void * buffer, size_t * lenp)
+{
+ uint cpu;
+ int ret = -EINVAL;
+
+ lock_sysctl();
+
+ if (write)
+ goto out;
+
+ sysctl.nr_interrupts = 0;
+
+ for (cpu = 0 ; cpu < smp_num_cpus; cpu++) {
+ sysctl.nr_interrupts += oprof_data[cpu].nr_irq;
+ oprof_data[cpu].nr_irq = 0;
+ }
+
+ ret = proc_dointvec(table, write, filp, buffer, lenp);
+out:
+ unlock_sysctl();
+ return ret;
+}
+
+static int get_nr_buffer_overflow(ctl_table * table, int write, struct file * filp, void * buffer, size_t * lenp)
+{
+ uint cpu;
+ int ret = -EINVAL;
+
+ lock_sysctl();
+
+ if (write)
+ goto out;
+
+ for (cpu = 0 ; cpu < smp_num_cpus; cpu++) {
+ sysctl.nr_buffer_overflow += oprof_data[cpu].nr_buffer_overflow;
+ oprof_data[cpu].nr_buffer_overflow = 0;
+ }
+
+ ret = proc_dointvec(table, write, filp, buffer, lenp);
+out:
+ unlock_sysctl();
+ return ret;
+}
+
+int lproc_dointvec(ctl_table * table, int write, struct file * filp, void * buffer, size_t * lenp)
+{
+ int err;
+
+ lock_sysctl();
+ err = proc_dointvec(table, write, filp, buffer, lenp);
+ unlock_sysctl();
+
+ return err;
+}
+
+static void do_actual_dump(void)
+{
+ uint cpu;
+
+ for (cpu = 0 ; cpu < smp_num_cpus; cpu++)
+ oprof_ready[cpu] = 2;
+ oprof_wake_up(&oprof_wait);
+}
+
+static int sysctl_do_dump(ctl_table * table, int write, struct file * filp, void * buffer, size_t * lenp)
+{
+ int err = -EINVAL;
+
+ lock_sysctl();
+
+ if (state != RUNNING)
+ goto out;
+
+ if (!write) {
+ err = proc_dointvec(table, write, filp, buffer, lenp);
+ goto out;
+ }
+
+ do_actual_dump();
+
+ err = 0;
+out:
+ unlock_sysctl();
+ return err;
+}
+
+static int sysctl_do_dump_stop(ctl_table * table, int write, struct file * filp, void * buffer, size_t * lenp)
+{
+ int err = -EINVAL;
+
+ lock_sysctl();
+
+ if (state != RUNNING)
+ goto out;
+
+ if (!write) {
+ err = proc_dointvec(table, write, filp, buffer, lenp);
+ goto out;
+ }
+
+ oprof_partial_stop();
+
+ /* also wakes up daemon */
+ do_actual_dump();
+
+ err = 0;
+out:
+ unlock_sysctl();
+ return err;
+}
+
+static int const nr_oprof_static = 8;
+
+static ctl_table oprof_table[] = {
+ { 1, "bufsize", &sysctl_parms.buf_size, sizeof(int), 0644, NULL, &lproc_dointvec, NULL, },
+ { 1, "dump", &sysctl_parms.dump, sizeof(int), 0666, NULL, &sysctl_do_dump, NULL, },
+ { 1, "dump_stop", &sysctl_parms.dump_stop, sizeof(int), 0644, NULL, &sysctl_do_dump_stop, NULL, },
+ { 1, "nr_interrupts", &sysctl.nr_interrupts, sizeof(int), 0444, NULL, &get_nr_interrupts, NULL, },
+ { 1, "notesize", &sysctl_parms.note_size, sizeof(int), 0644, NULL, &lproc_dointvec, NULL, },
+ { 1, "cpu_type", &sysctl.cpu_type, sizeof(int), 0444, NULL, &lproc_dointvec, NULL, },
+ { 1, "note_buffer_overflow", &sysctl.nr_note_buffer_overflow, sizeof(int), 0444, NULL, &lproc_dointvec, NULL, },
+ { 1, "buffer_overflow", &sysctl.nr_buffer_overflow, sizeof(int), 0444, NULL, &get_nr_buffer_overflow, NULL, },
+ { 0, }, { 0, }, { 0, }, { 0, }, { 0, }, { 0, }, { 0, }, { 0, },
+ { 0, },
+};
+
+static ctl_table oprof_root[] = {
+ {1, "oprofile", NULL, 0, 0755, oprof_table},
+ {0, },
+};
+
+static ctl_table dev_root[] = {
+ {CTL_DEV, "dev", NULL, 0, 0555, oprof_root},
+ {0, },
+};
+
+static struct ctl_table_header * sysctl_header;
+
+/* NOTE: we do *not* support sysctl() syscall */
+
+static int __init init_sysctl(void)
+{
+ int err = 0;
+ ctl_table * next = &oprof_table[nr_oprof_static];
+
+ /* these sysctl parms need sensible value */
+ sysctl_parms.buf_size = OP_DEFAULT_BUF_SIZE;
+ sysctl_parms.note_size = OP_DEFAULT_NOTE_SIZE;
+
+ if ((err = int_ops->add_sysctls(next)))
+ return err;
+
+ sysctl_header = register_sysctl_table(dev_root, 0);
+ return err;
+}
+
+/* not safe to mark as __exit since used from __init code */
+static void cleanup_sysctl(void)
+{
+ ctl_table * next = &oprof_table[nr_oprof_static];
+ unregister_sysctl_table(sysctl_header);
+
+ int_ops->remove_sysctls(next);
+
+ return;
+}
+
+static int can_unload(void)
+{
+ int can = -EBUSY;
+ down(&sysctlsem);
+
+ if (allow_unload && state == STOPPED && !GET_USE_COUNT(THIS_MODULE))
+ can = 0;
+ up(&sysctlsem);
+ return can;
+}
+
+int __init oprof_init(void)
+{
+ int err = 0;
+
+ if (sysctl.cpu_type != CPU_RTC) {
+ int_ops = op_int_interface();
+
+ // try to init, fall back to rtc if not
+ if ((err = int_ops->init())) {
+ int_ops = &op_rtc_ops;
+ if ((err = int_ops->init()))
+ return err;
+ sysctl.cpu_type = CPU_RTC;
+ }
+ } else {
+ int_ops = &op_rtc_ops;
+ if ((err = int_ops->init()))
+ return err;
+ }
+
+ if ((err = init_sysctl()))
+ goto out_err;
+
+ err = op_major = register_chrdev(0, "oprof", &oprof_fops);
+ if (err < 0)
+ goto out_err2;
+
+ err = oprof_init_hashmap();
+ if (err < 0) {
+ printk(KERN_ERR "oprofile: couldn't allocate hash map !\n");
+ unregister_chrdev(op_major, "oprof");
+ goto out_err2;
+ }
+
+ /* module might not be unloadable */
+ THIS_MODULE->can_unload = can_unload;
+
+ /* do this now so we don't have to track save/restores later */
+ op_save_syscalls();
+
+ printk(KERN_INFO "%s loaded, major %u\n", op_version, op_major);
+ return 0;
+
+out_err2:
+ cleanup_sysctl();
+out_err:
+ int_ops->deinit();
+ return err;
+}
+
+void __exit oprof_exit(void)
+{
+ oprof_free_hashmap();
+
+ unregister_chrdev(op_major, "oprof");
+
+ cleanup_sysctl();
+
+ int_ops->deinit();
+}
+
+/*
+ * "The most valuable commodity I know of is information."
+ * - Gordon Gekko
+ */
diff --git a/module/oprofile.h b/module/oprofile.h
new file mode 100644
index 0000000..257fdcf
--- /dev/null
+++ b/module/oprofile.h
@@ -0,0 +1,161 @@
+/**
+ * @file oprofile.h
+ * Main driver code
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#ifndef OPROFILE_H
+#define OPROFILE_H
+
+#include <linux/version.h>
+#include <linux/module.h>
+#include <linux/config.h>
+#include <linux/kernel.h>
+#include <linux/init.h>
+#include <linux/slab.h>
+#include <linux/delay.h>
+#include <linux/vmalloc.h>
+#include <linux/sched.h>
+#include <linux/sysctl.h>
+#include <linux/smp_lock.h>
+
+#include <asm/uaccess.h>
+
+#include "compat.h"
+
+#include "op_config_24.h"
+#include "op_hw_config.h"
+#include "op_interface.h"
+#include "op_cpu_type.h"
+
+#undef min
+#undef max
+
+#define streq(a, b) (!strcmp((a), (b)))
+
+/* per-cpu dynamic data */
+struct _oprof_data {
+ /* eviction buffer */
+ struct op_sample * buffer;
+ /* nr. in buffer */
+ uint buf_size;
+ /* we try to wakeup when nextbuf >= buf_watermark */
+ uint buf_watermark;
+ /* next in buffer (atomic) */
+ uint nextbuf;
+ /* number of IRQs for this CPU */
+ uint nr_irq;
+ /* buffer overflow cumulated size */
+ uint nr_buffer_overflow;
+ /* reset counter values */
+ uint ctr_count[OP_MAX_COUNTERS];
+};
+
+/* reflect /proc/sys/dev/oprofile/#counter files */
+struct oprof_counter {
+ int count;
+ int enabled;
+ int event;
+ int kernel;
+ int user;
+ int unit_mask;
+};
+
+/* reflect /proc/sys/dev/oprofile files */
+struct oprof_sysctl {
+ /* nr. in eviction buffser */
+ int buf_size;
+ /* sysctl dump */
+ int dump;
+ /* dump and stop */
+ int dump_stop;
+ /* nr. in note buffer */
+ int note_size;
+ /* nr. interrupts occured */
+ int nr_interrupts;
+ /* the cpu core type: CPU_PPRO, CPU_PII ... */
+ int cpu_type;
+ /* nr note buffer overflow */
+ int nr_note_buffer_overflow;
+ /* nr buffer overflow */
+ int nr_buffer_overflow;
+ /* counter setup */
+ struct oprof_counter ctr[OP_MAX_COUNTERS];
+};
+
+/**
+ * A interrupt handler must implement these routines.
+ * When an interrupt arrives, it must eventually call
+ * op_do_profile().
+ */
+struct op_int_operations {
+ /* initialise the interrupt handler on module load.
+ * On failure deinit handler is not called so all resources
+ * allocated by init() must be freed before returning an error code
+ * (or 0 on success)
+ */
+ int (*init)(void);
+ /* deinitialise on module unload */
+ void (*deinit)(void);
+ /* add any handler-specific sysctls at the position given by @next. Return 0 on success */
+ int (*add_sysctls)(ctl_table * next);
+ /* remove handler-specific sysctls */
+ void (*remove_sysctls)(ctl_table * next);
+ /* check given profiling parameters are correct. Return 0 on success */
+ int (*check_params)(void);
+ /* setup the handler from profiling parameters. Return 0 on success */
+ int (*setup)(void);
+ /* start profiling on all CPUs */
+ void (*start)(void);
+ /* stop profiling on all CPUs */
+ void (*stop)(void);
+ /* start profiling on the given CPU */
+ void (*start_cpu)(uint);
+ /* stop profiling on the given CPU */
+ void (*stop_cpu)(uint);
+};
+
+/* maximum depth of dname trees - this is just a page */
+#define DNAME_STACK_MAX 1024
+
+/* oprof_start() copy here the sysctl settable parameters */
+extern struct oprof_sysctl sysctl;
+
+int oprof_init(void);
+void oprof_exit(void);
+unsigned long is_map_ready(void);
+int oprof_hash_map_open(void);
+int oprof_hash_map_release(void);
+int oprof_hash_map_mmap(struct file * file, struct vm_area_struct * vma);
+int oprof_map_open(void);
+int oprof_map_release(void);
+int oprof_init_hashmap(void);
+void oprof_free_hashmap(void);
+
+/* used by interrupt handlers if the underlined harware doesn't support
+ * performance counter */
+extern struct op_int_operations op_rtc_ops;
+
+void op_do_profile(uint cpu, long eip, long irq_enabled, int ctr);
+extern struct _oprof_data oprof_data[NR_CPUS];
+extern struct oprof_sysctl sysctl_parms;
+extern int lproc_dointvec(ctl_table * table, int write, struct file * filp, void * buffer, size_t * lenp);
+
+/* functionality provided by the architecture dependent file */
+/* must return OP_RTC if the hardware doesn't support something like
+ * perf counter */
+op_cpu get_cpu_type(void);
+/* return an interface pointer, this function is called only if get_cpu_type
+ * doesn't return OP_RTC */
+struct op_int_operations const * op_int_interface(void);
+/* intercept the needed syscall */
+void op_intercept_syscalls(void);
+void op_restore_syscalls(void);
+void op_save_syscalls(void);
+
+#endif /* OPROFILE_H */
diff --git a/module/x86/Makefile.in b/module/x86/Makefile.in
new file mode 100644
index 0000000..c5f1833
--- /dev/null
+++ b/module/x86/Makefile.in
@@ -0,0 +1,28 @@
+OPROFILE_DIR=@OPROFILE_DIR@
+VERSION=@VERSION@
+KVERS=@KVERS@
+KSRC=@KSRC@
+
+EXTRA_CFLAGS=@EXTRA_CFLAGS_MODULE@ -D__NO_VERSION__ \
+ -I$(OPROFILE_DIR)/ -I$(OPROFILE_DIR)/libutil -I$(OPROFILE_DIR)/libop -I$(OPROFILE_DIR)/module
+
+USE_STANDARD_AS_RULE=1
+
+# NB: do not add a file here without adding it to EXTRA_DIST in ../Makefile.am
+
+O_TARGET := arch.o
+
+obj-y := cpu_type.o op_apic.o op_fixmap.o op_rtc.o op_nmi.o \
+ op_model_ppro.o op_model_athlon.o op_model_p4.o
+
+obj-y += oprofile_nmi.o op_syscalls.o
+
+obj-m := $(O_TARGET)
+O_OBJS := $(obj-y)
+M_OBJS := $(O_TARGET)
+
+TOPDIR := $(KSRC)
+CONFIG_SHELL := TOPDIR=$(KSRC) /bin/bash
+include $(KSRC)/Rules.make
+
+# FIXME: dependencies
diff --git a/module/x86/apic_compat.h b/module/x86/apic_compat.h
new file mode 100644
index 0000000..73ea40e
--- /dev/null
+++ b/module/x86/apic_compat.h
@@ -0,0 +1,80 @@
+/**
+ * @file apic_compat.h
+ * Definitions and functions for APIC interaction
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#ifndef APIC_COMPAT_H
+#define APIC_COMPAT_H
+
+#if V_BEFORE(2, 4, 0)
+/* even on SMP, some defines are missing in 2.2 */
+#define APIC_LVR 0x30
+#define APIC_LVTPC 0x340
+#define APIC_LVTERR 0x370
+#define GET_APIC_VERSION(x) ((x)&0xFF)
+#define GET_APIC_MAXLVT(x) (((x) >> 16)&0xFF)
+#define APIC_INTEGRATED(x) ((x)&0xF0)
+#else
+#include <asm/apic.h>
+#include <asm/apicdef.h>
+#include <asm/mpspec.h>
+#endif
+
+#ifndef MSR_IA32_APICBASE
+#define MSR_IA32_APICBASE 0x1B
+#endif
+
+#ifndef APIC_SPIV_APIC_ENABLED
+#define APIC_SPIV_APIC_ENABLED (1 << 8)
+#endif
+
+#ifndef APIC_DEFAULT_PHYS_BASE
+#define APIC_DEFAULT_PHYS_BASE 0xfee00000
+#endif
+
+#if !defined(CONFIG_X86_LOCAL_APIC)
+
+#define APIC_DEFAULT_PHYS_BASE 0xfee00000
+#define APIC_SPIV 0xF0
+#define APIC_ESR 0x280
+#define APIC_LVTT 0x320
+#define APIC_LVT0 0x350
+#define APIC_LVT_MASKED (1 << 16)
+#define APIC_LVT_LEVEL_TRIGGER (1 << 15)
+#define APIC_MODE_NMI 0x4
+#define APIC_MODE_EXINT 0x7
+#define GET_APIC_DELIVERY_MODE(x) (((x) >> 8)&0x7)
+#define SET_APIC_DELIVERY_MODE(x, y) (((x)&~0x700)|((y) << 8))
+#define APIC_LVT1 0x360
+#define APIC_SEND_PENDING (1 << 12)
+#define APIC_TDCR 0x3E0
+#define APIC_TDR_DIV_1 0xB
+
+/* when !CONFIG_X86_LOCAL_APIC we need to provide a valid va to map the
+ * the pa of APIC onto. This va must be un-cachable/un-swapable*/
+/*#define APIC_BASE (fix_to_virt(FIX_APIC_BASE))*/
+extern unsigned long virt_apic_base;
+/* the other define above can be redefined until the ref is identical, this
+ * allow a compile time checking but this need to be redefined differently */
+#undef APIC_BASE
+#define APIC_BASE virt_apic_base
+
+static __inline void apic_write(unsigned long reg, unsigned long v)
+{
+ *((volatile u32 *)(APIC_BASE+reg)) = v;
+}
+
+static __inline unsigned long apic_read(unsigned long reg)
+{
+ return *((volatile u32 *)(APIC_BASE+reg));
+}
+
+#endif /* !defined(CONFIG_X86_LOCAL_APIC) */
+
+#endif /* APIC_COMPAT_H */
diff --git a/module/x86/cpu_type.c b/module/x86/cpu_type.c
new file mode 100644
index 0000000..d749405
--- /dev/null
+++ b/module/x86/cpu_type.c
@@ -0,0 +1,192 @@
+/**
+ * @file cpu_type.c
+ * CPU determination
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include "oprofile.h"
+#include "op_msr.h"
+
+#include <linux/smp.h>
+
+EXPORT_NO_SYMBOLS;
+
+MODULE_PARM(force_rtc, "i");
+MODULE_PARM_DESC(force_rtc, "force RTC mode.");
+static int force_rtc;
+
+#ifndef HT_SUPPORT
+/**
+ * p4_threads - determines the number of logical processor threads in a die
+ *
+ * returns number of threads in p4 die (1 for non-HT processors)
+ */
+static int p4_threads(void)
+{
+ int processor_threads = 1;
+
+#ifdef CONFIG_SMP
+ if (test_bit(X86_FEATURE_HT, &current_cpu_data.x86_capability)) {
+ /* This it a Pentium 4 with HT, find number of threads */
+ int eax, ebx, ecx, edx;
+
+ cpuid (1, &eax, &ebx, &ecx, &edx);
+ processor_threads = (ebx >> 16) & 0xff;
+ }
+#endif /* CONFIG_SMP */
+
+ return processor_threads;
+}
+
+#ifdef CONFIG_SMP
+/**
+ * do_cpu_id - Call the cpuid instruction and fill in data at passed address
+ *
+ * We expect that data is pointing to an array of unsigned chars as big as there
+ * are cpus in an smp system.
+ */
+static void do_cpu_id(void * data)
+{
+ int eax, ebx, ecx, edx;
+ unsigned char * ptr = (unsigned char *) data;
+
+ cpuid(1, &eax, &ebx, &ecx, &edx);
+
+ /* bits EBX[31:24] define APIC ID */
+ ptr[smp_processor_id()] = (unsigned char) ((ebx & 0xff000000) >> 24);
+}
+#endif
+
+/**
+ * p4_ht_enabled - Determines if Hyper Threading is enabled or not.
+ *
+ * A P4 can be capable of HT, but not enabled via BIOS. The check for
+ * this is unfortunately not simple and involves running cpuid on all
+ * logical processors and checking for bits in the APIC_ID fields.
+ * As per Intel docs. Returns 1 if enabled, 0 otherwise.
+ *
+ */
+static int p4_ht_enabled(void)
+{
+#ifndef CONFIG_SMP
+ return 0;
+#else
+ int enabled, threads, i;
+ unsigned char mask;
+ unsigned char apic_id[smp_num_cpus];
+ unsigned int cpu;
+
+ /* First check for capability */
+ threads = p4_threads();
+ if (threads == 1) return 0;
+ /* Create mask for low order bits */
+ mask = 0xff;
+ i = 1;
+ while (i < threads) {
+ i *= 2;
+ mask <<= 1;
+ }
+ /* Get APIC_ID from all logial procs and self */
+ smp_call_function(do_cpu_id, apic_id, 1, 1);
+ do_cpu_id(apic_id);
+ /* If the low order bits are on, then HT is enabled */
+ enabled = 0;
+ cpu = 0;
+ do {
+ if (apic_id[cpu] & ~mask) {
+ enabled = 1;
+ break;
+ }
+ cpu++;
+ } while (cpu < smp_num_cpus);
+
+ return enabled;
+#endif /* CONFIG_SMP */
+}
+#endif /* !HT_SUPPORT */
+
+
+op_cpu p4_cpu_type(void)
+{
+ __u8 model = current_cpu_data.x86_model;
+ if (model <= 4) {
+#ifdef HT_SUPPORT
+ if (smp_num_siblings == 1) {
+ return CPU_P4;
+ } else if (smp_num_siblings == 2) {
+ return CPU_P4_HT2;
+ } else {
+ printk(KERN_INFO
+ "oprofile: P4 HT unsupported number of siblings"
+ "processor, reverting to RTC\n");
+ return CPU_RTC;
+ }
+#else
+ /* Cannot handle enabled HT P4 hardware */
+ if ((p4_threads() > 1) && p4_ht_enabled()) {
+ printk(KERN_INFO
+ "oprofile: P4 HT enabled, reverting to RTC\n");
+ return CPU_RTC;
+ }
+ else
+ return CPU_P4;
+#endif
+ } else
+ /* Do not know what it is */
+ return CPU_RTC;
+}
+
+
+__init op_cpu get_cpu_type(void)
+{
+ __u8 vendor = current_cpu_data.x86_vendor;
+ __u8 family = current_cpu_data.x86;
+ __u8 model = current_cpu_data.x86_model;
+ __u16 val;
+
+ if (force_rtc)
+ return CPU_RTC;
+
+ switch (vendor) {
+ case X86_VENDOR_AMD:
+ if (family == 6) {
+ /* certain models of K7 does not have apic.
+ * Check if apic is really present before enabling it.
+ * IA32 V3, 7.4.1 */
+ val = cpuid_edx(1);
+ if (!(val & (1 << 9)))
+ return CPU_RTC;
+ return CPU_ATHLON;
+ }
+ if (family == 15)
+ return CPU_HAMMER;
+ return CPU_RTC;
+
+ case X86_VENDOR_INTEL:
+ switch (family) {
+ default:
+ return CPU_RTC;
+ case 6:
+ /* A P6-class processor */
+ if (model == 14)
+ return CPU_CORE;
+ if (model > 0xd)
+ return CPU_RTC;
+ if (model > 5)
+ return CPU_PIII;
+ else if (model > 2)
+ return CPU_PII;
+ return CPU_PPRO;
+ case 0xf:
+ return p4_cpu_type();
+ }
+
+ default:
+ return CPU_RTC;
+ }
+}
diff --git a/module/x86/op_apic.c b/module/x86/op_apic.c
new file mode 100644
index 0000000..4bce431
--- /dev/null
+++ b/module/x86/op_apic.c
@@ -0,0 +1,239 @@
+/**
+ * @file op_apic.c
+ *
+ * APIC setup etc. routines
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ * @author Dave Jones
+ * @author Graydon Hoare
+ */
+
+#include <linux/mm.h>
+#include <linux/init.h>
+#include <linux/config.h>
+#include <asm/io.h>
+
+#include "oprofile.h"
+#include "op_msr.h"
+#include "op_apic.h"
+
+/* used to save/restore original kernel nmi */
+static struct gate_struct kernel_nmi;
+static ulong lvtpc_masked;
+
+/* this masking code is unsafe and nasty but might deal with the small
+ * race when installing the NMI entry into the IDT.
+ */
+static void mask_lvtpc(void * e)
+{
+ u32 v = apic_read(APIC_LVTPC);
+ lvtpc_masked = v & APIC_LVT_MASKED;
+ apic_write(APIC_LVTPC, v | APIC_LVT_MASKED);
+}
+
+static void unmask_lvtpc(void * e)
+{
+ if (!lvtpc_masked)
+ apic_write(APIC_LVTPC, apic_read(APIC_LVTPC) & ~APIC_LVT_MASKED);
+}
+
+
+void install_nmi(void)
+{
+ struct _descr descr;
+
+ /* NMI handler is at idt_table[IDT_VECTOR_NUMBER] */
+ /* see Intel Vol.3 Figure 5-2, interrupt gate */
+
+ smp_call_function(mask_lvtpc, NULL, 0, 1);
+ mask_lvtpc(NULL);
+
+ store_idt(descr);
+ kernel_nmi = descr.base[NMI_VECTOR_NUM];
+ SET_NMI_GATE;
+
+ smp_call_function(unmask_lvtpc, NULL, 0, 1);
+ unmask_lvtpc(NULL);
+}
+
+void restore_nmi(void)
+{
+ struct _descr descr;
+
+ smp_call_function(mask_lvtpc, NULL, 0, 1);
+ mask_lvtpc(NULL);
+
+ store_idt(descr);
+ descr.base[NMI_VECTOR_NUM] = kernel_nmi;
+
+ smp_call_function(unmask_lvtpc, NULL, 0, 1);
+ unmask_lvtpc(NULL);
+}
+
+
+/* ---------------- APIC setup ------------------ */
+static uint saved_lvtpc[NR_CPUS];
+
+void __init lvtpc_apic_setup(void * dummy)
+{
+ uint val;
+
+ /* set up LVTPC as we need it */
+ /* IA32 V3, Figure 7.8 */
+ val = apic_read(APIC_LVTPC);
+ saved_lvtpc[op_cpu_id()] = val;
+ /* allow PC overflow interrupts */
+ val &= ~APIC_LVT_MASKED;
+ /* set delivery to NMI */
+ val = SET_APIC_DELIVERY_MODE(val, APIC_MODE_NMI);
+ apic_write(APIC_LVTPC, val);
+}
+
+/* not safe to mark as __exit since used from __init code */
+void lvtpc_apic_restore(void * dummy)
+{
+ /* restoring APIC_LVTPC can trigger an apic error because the delivery
+ * mode and vector nr combination can be illegal. That's by design: on
+ * power on apic lvt contain a zero vector nr which are legal only for
+ * NMI delivrey mode. So inhibit apic err before restoring lvtpc
+ */
+ uint v = apic_read(APIC_LVTERR);
+ apic_write(APIC_LVTERR, v | APIC_LVT_MASKED);
+ apic_write(APIC_LVTPC, saved_lvtpc[op_cpu_id()]);
+ apic_write(APIC_LVTERR, v);
+}
+
+static int __init enable_apic(void)
+{
+ uint msr_low, msr_high;
+ uint val;
+
+ /* enable local APIC via MSR. Forgetting this is a fun way to
+ * lock the box. But we have to hope this is allowed if the APIC
+ * has already been enabled.
+ *
+ * IA32 V3, 7.4.2 */
+ rdmsr(MSR_IA32_APICBASE, msr_low, msr_high);
+ if ((msr_low & (1 << 11)) == 0)
+ wrmsr(MSR_IA32_APICBASE, msr_low | (1 << 11), msr_high);
+
+ /* even if the apic is up we must check for a good APIC */
+
+ /* IA32 V3, 7.4.15 */
+ val = apic_read(APIC_LVR);
+ if (!APIC_INTEGRATED(GET_APIC_VERSION(val)))
+ goto not_local_apic;
+
+ /* LVT0,LVT1,LVTT,LVTPC */
+ if (GET_APIC_MAXLVT(apic_read(APIC_LVR)) < 4)
+ goto not_local_apic;
+
+ /* IA32 V3, 7.4.14.1 */
+ val = apic_read(APIC_SPIV);
+ if (!(val & APIC_SPIV_APIC_ENABLED))
+ apic_write(APIC_SPIV, val | APIC_SPIV_APIC_ENABLED);
+
+ return !!(val & APIC_SPIV_APIC_ENABLED);
+
+not_local_apic:
+ /* disable the apic only if it was disabled */
+ if ((msr_low & (1 << 11)) == 0)
+ wrmsr(MSR_IA32_APICBASE, msr_low & ~(1 << 11), msr_high);
+
+ printk(KERN_ERR "oprofile: no suitable local APIC. Falling back to RTC mode.\n");
+ return -ENODEV;
+}
+
+static void __init do_apic_setup(void)
+{
+ uint val;
+
+ local_irq_disable();
+
+ val = APIC_LVT_LEVEL_TRIGGER;
+ val = SET_APIC_DELIVERY_MODE(val, APIC_MODE_EXINT);
+ apic_write(APIC_LVT0, val);
+
+ /* edge triggered, IA 7.4.11 */
+ val = SET_APIC_DELIVERY_MODE(0, APIC_MODE_NMI);
+ apic_write(APIC_LVT1, val);
+
+ /* clear error register */
+ /* IA32 V3, 7.4.17 */
+ /* PHE must be cleared after unmasking by a back-to-back write,
+ * but it is probably ok because we mask only, the ESR is not
+ * updated is this a real problem ? */
+ apic_write(APIC_ESR, 0);
+
+ /* mask error interrupt */
+ /* IA32 V3, Figure 7.8 */
+ val = apic_read(APIC_LVTERR);
+ val |= APIC_LVT_MASKED;
+ apic_write(APIC_LVTERR, val);
+
+ /* setup timer vector */
+ /* IA32 V3, 7.4.8 */
+ apic_write(APIC_LVTT, APIC_SEND_PENDING | 0x31);
+
+ /* Divide configuration register */
+ /* PHE the apic clock is based on the FSB. This should only
+ * changed with a calibration method. */
+ val = APIC_TDR_DIV_1;
+ apic_write(APIC_TDCR, val);
+
+ local_irq_enable();
+}
+
+/* does the CPU have a local APIC ? */
+static int __init check_cpu_ok(void)
+{
+ if (sysctl.cpu_type != CPU_PPRO &&
+ sysctl.cpu_type != CPU_PII &&
+ sysctl.cpu_type != CPU_PIII &&
+ sysctl.cpu_type != CPU_ATHLON &&
+ sysctl.cpu_type != CPU_HAMMER &&
+ sysctl.cpu_type != CPU_P4 &&
+ sysctl.cpu_type != CPU_P4_HT2)
+ return 0;
+
+ return 1;
+}
+
+int __init apic_setup(void)
+{
+ u32 val;
+
+ if (!check_cpu_ok())
+ goto nodev;
+
+ fixmap_setup();
+
+ switch (enable_apic()) {
+ case 0:
+ do_apic_setup();
+ val = apic_read(APIC_ESR);
+ printk(KERN_INFO "oprofile: enabled local APIC. Err code %.08x\n", val);
+ break;
+ case 1:
+ printk(KERN_INFO "oprofile: APIC was already enabled\n");
+ break;
+ default:
+ goto nodev;
+ }
+
+ lvtpc_apic_setup(NULL);
+ return 0;
+nodev:
+ printk(KERN_WARNING "Your CPU does not have a local APIC, e.g. "
+ "mobile P6. Falling back to RTC mode.\n");
+ return -ENODEV;
+}
+
+void apic_restore(void)
+{
+ fixmap_restore();
+}
diff --git a/module/x86/op_apic.h b/module/x86/op_apic.h
new file mode 100644
index 0000000..bdae336
--- /dev/null
+++ b/module/x86/op_apic.h
@@ -0,0 +1,71 @@
+/**
+ * @file op_apic.h
+ * x86 apic, nmi, perf counter declaration
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ * @author Dave Jones
+ * @author Graydon Hoare
+ */
+
+#ifndef OP_APIC_H
+#define OP_APIC_H
+
+#include "apic_compat.h"
+
+#define NMI_GATE_TYPE 14
+#define NMI_VECTOR_NUM 2
+#define NMI_DPL_LEVEL 0
+
+
+/* copied from kernel 2.4.19 : arch/i386/traps.c */
+
+struct gate_struct {
+ u32 a;
+ u32 b;
+} __attribute__((packed));
+
+#define _set_gate(gate_addr, type, dpl, addr) \
+do { \
+ int __d0, __d1; \
+ __asm__ __volatile__ ("movw %%dx, %%ax\n\t" \
+ "movw %4, %%dx\n\t" \
+ "movl %%eax, %0\n\t" \
+ "movl %%edx, %1" \
+ :"=m" (*((long *) (gate_addr))), \
+ "=m" (*(1+(long *) (gate_addr))), "=&a" (__d0), "=&d" (__d1) \
+ :"i" ((short) (0x8000+(dpl << 13)+(type << 8))), \
+ "3" ((char *) (addr)), "2" (__KERNEL_CS << 16)); \
+} while (0)
+
+#define SET_NMI_GATE \
+ _set_gate(&descr.base[NMI_VECTOR_NUM], NMI_GATE_TYPE, NMI_DPL_LEVEL, &op_nmi);
+
+#define store_idt(addr) \
+ do { \
+ __asm__ __volatile__ ("sidt %0" \
+ : "=m" (addr) \
+ : : "memory"); \
+ } while (0)
+
+struct _descr {
+ u16 limit;
+ struct gate_struct * base;
+} __attribute__((__packed__));
+
+void lvtpc_apic_setup(void * dummy);
+void lvtpc_apic_restore(void * dummy);
+int apic_setup(void);
+void apic_restore(void);
+void install_nmi(void);
+void restore_nmi(void);
+
+void fixmap_setup(void);
+void fixmap_restore(void);
+
+asmlinkage void op_nmi(void);
+
+#endif /* OP_APIC_H */
diff --git a/module/x86/op_arch.h b/module/x86/op_arch.h
new file mode 100644
index 0000000..9bf41e9
--- /dev/null
+++ b/module/x86/op_arch.h
@@ -0,0 +1,24 @@
+/**
+ * @file op_arch.h
+ * defines registers for x86
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Will Cohen
+ */
+
+#ifndef OP_ARCH_H
+#define OP_ARCH_H
+
+#include <asm/ptrace.h>
+
+/* How to access the processor's instruction pointer */
+#ifndef instruction_pointer
+#define instruction_pointer(regs) ((regs)->eip)
+#endif
+
+/* Bit in processor's status register for interrupt masking */
+#define IRQ_ENABLED(regs) ((regs)->eflags & IF_MASK)
+
+#endif /* OP_ARCH_H */
diff --git a/module/x86/op_fixmap.c b/module/x86/op_fixmap.c
new file mode 100644
index 0000000..50adf94
--- /dev/null
+++ b/module/x86/op_fixmap.c
@@ -0,0 +1,200 @@
+/**
+ * @file op_fixmap.c
+ * Horrible hacks for compatibility's sake.
+ * Based in part on arch/i386/kernel/mpparse.c
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include <linux/mm.h>
+#include <linux/init.h>
+#include <linux/config.h>
+#include <linux/pagemap.h>
+#include <asm/io.h>
+
+#include "oprofile.h"
+#include "apic_compat.h"
+
+#ifndef cpu_has_pge
+#if V_BEFORE(2, 4, 0)
+#define cpu_has_pge (test_bit(X86_FEATURE_PGE, &boot_cpu_data.x86_capability))
+#else
+#define cpu_has_pge (test_bit(X86_FEATURE_PGE, boot_cpu_data.x86_capability))
+#endif
+#endif
+
+unsigned long virt_apic_base;
+
+/* some static commented out to avoid warning, trying to figure out
+ * in exactly which circumstances we need this function is too prone
+ * error to be made w/o a full rebuild of supported kernel version */
+/* how about __attribute__(__unused__) then ? */
+
+/* FIXME is this comment right ? */
+/* We don't take care about locking mm->page_table_lock because this is
+ * only needed on SMP and on SMP we have already a sensible setup */
+
+/*static*/ void set_pte_phys(ulong vaddr, ulong phys)
+{
+ pgprot_t prot;
+ pgd_t * pgd;
+ pmd_t * pmd;
+ pte_t * pte;
+
+ pgd = pgd_offset_k(vaddr);
+ pmd = pmd_offset(pgd, vaddr);
+ pte = pte_offset(pmd, vaddr);
+ prot = PAGE_KERNEL;
+ /* when !CONFIG_X86_LOCAL_APIC we can't rely on no cache flag set */
+ pgprot_val(prot) |= _PAGE_PCD;
+ if (cpu_has_pge)
+ pgprot_val(prot) |= _PAGE_GLOBAL;
+ set_pte(pte, mk_pte_phys(phys, prot));
+ __flush_tlb_one(vaddr);
+}
+
+/*static*/ void alloc_fixmap(void)
+{
+ /* dirty hack :/ */
+ virt_apic_base = (ulong)vmalloc(4096);
+ set_pte_phys(virt_apic_base, APIC_DEFAULT_PHYS_BASE);
+}
+
+/*static*/ void free_fixmap(void)
+{
+ ulong vaddr;
+ pgd_t * pgd;
+ pmd_t * pmd;
+ pte_t * pte;
+
+ vaddr = virt_apic_base;
+ if (!vaddr)
+ return;
+
+ pgd = pgd_offset_k(vaddr);
+ if (!pgd)
+ return;
+
+ pmd = pmd_offset(pgd, vaddr);
+ if (!pmd)
+ return;
+
+ pte = pte_offset(pmd, vaddr);
+ if (!pte)
+ return;
+
+ /* FIXME: is this the right way */
+ pte_clear(pte);
+ __flush_tlb_one(vaddr);
+
+ vfree((void*)virt_apic_base);
+}
+
+/*
+ * Make sure we can access the APIC. Some kernel versions create
+ * a meaningless zero-page mapping for the local APIC: we must
+ * detect this case and reset it.
+ *
+ * Some kernel versions/configs won't map the APIC at all, in
+ * which case we need to hack it ourselves.
+ */
+void fixmap_setup(void)
+{
+#if V_BEFORE(2, 4, 10)
+#if defined(CONFIG_X86_LOCAL_APIC)
+ static int find_intel_smp(void);
+
+ if (!find_intel_smp()) {
+ set_pte_phys(__fix_to_virt(FIX_APIC_BASE),
+ APIC_DEFAULT_PHYS_BASE);
+ printk(KERN_INFO "oprofile: remapping local APIC.\n");
+ }
+#else
+ alloc_fixmap();
+ printk(KERN_INFO "oprofile: mapping APIC.\n");
+#endif /* CONFIG_X86_LOCAL_APIC */
+#else
+#if !defined(CONFIG_X86_LOCAL_APIC)
+ alloc_fixmap();
+ printk(KERN_INFO "oprofile: mapping APIC.\n");
+#endif
+#endif
+}
+
+void fixmap_restore(void)
+{
+#if V_BEFORE(2, 4, 10)
+#if defined(CONFIG_X86_LOCAL_APIC)
+ /* Nothing to do */
+#else
+ free_fixmap();
+ printk(KERN_INFO "oprofile: freeing APIC mapping.\n");
+#endif /* CONFIG_X86_LOCAL_APIC */
+#else
+#if !defined(CONFIG_X86_LOCAL_APIC)
+ free_fixmap();
+ printk(KERN_INFO "oprofile: freeing APIC mapping.\n");
+#endif
+#endif
+}
+
+/* ---------------- MP table code ------------------ */
+
+#if V_BEFORE(2, 4, 10) && defined(CONFIG_X86_LOCAL_APIC)
+
+static int __init mpf_checksum(unsigned char * mp, int len)
+{
+ int sum = 0;
+
+ while (len--)
+ sum += *mp++;
+
+ return sum & 0xFF;
+}
+
+static int __init mpf_table_ok(struct intel_mp_floating * mpf, unsigned long * bp)
+{
+ if (*bp != SMP_MAGIC_IDENT)
+ return 0;
+ if (mpf->mpf_length != 1)
+ return 0;
+ if (mpf_checksum((unsigned char *)bp, 16))
+ return 0;
+
+ return (mpf->mpf_specification == 1 || mpf->mpf_specification == 4);
+}
+
+static int __init smp_scan_config (unsigned long base, unsigned long length)
+{
+ unsigned long * bp = phys_to_virt(base);
+ struct intel_mp_floating * mpf;
+
+ while (length > 0) {
+ mpf = (struct intel_mp_floating *)bp;
+ if (mpf_table_ok(mpf, bp))
+ return 1;
+ bp += 4;
+ length -= 16;
+ }
+ return 0;
+}
+
+static int __init find_intel_smp(void)
+{
+ unsigned int address;
+
+ if (smp_scan_config(0x0, 0x400) ||
+ smp_scan_config(639*0x400, 0x400) ||
+ smp_scan_config(0xF0000, 0x10000))
+ return 1;
+
+ address = *(unsigned short *)phys_to_virt(0x40E);
+ address <<= 4;
+ return smp_scan_config(address, 0x1000);
+}
+
+#endif /* V_BEFORE(2,4,10) && defined(CONFIG_X86_LOCAL_APIC) */
diff --git a/module/x86/op_model_athlon.c b/module/x86/op_model_athlon.c
new file mode 100644
index 0000000..d5e38a7
--- /dev/null
+++ b/module/x86/op_model_athlon.c
@@ -0,0 +1,139 @@
+/**
+ * @file op_model_athlon.h
+ * athlon / K7 model-specific MSR operations
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ * @author Graydon Hoare
+ */
+
+#include "op_x86_model.h"
+#include "op_arch.h"
+#include "op_msr.h"
+
+#define NUM_COUNTERS 4
+#define NUM_CONTROLS 4
+
+#define CTR_READ(l, h, msrs, c) do {rdmsr(msrs->counters.addrs[(c)], (l), (h));} while (0)
+#define CTR_WRITE(l, msrs, c) do {wrmsr(msrs->counters.addrs[(c)], -(u32)(l), 0xffff);} while (0)
+#define CTR_OVERFLOWED(n) (!((n) & (1U << 31)))
+
+#define CTRL_READ(l, h, msrs, c) do {rdmsr(msrs->controls.addrs[(c)], (l), (h));} while (0)
+#define CTRL_WRITE(l, h, msrs, c) do {wrmsr(msrs->controls.addrs[(c)], (l), (h));} while (0)
+#define CTRL_SET_ACTIVE(n) (n |= (1 << 22))
+#define CTRL_SET_INACTIVE(n) (n &= ~(1 << 22))
+#define CTRL_CLEAR(x) (x &= (1 << 21))
+#define CTRL_SET_ENABLE(val) (val |= 1 << 20)
+#define CTRL_SET_USR(val, u) (val |= ((u & 1) << 16))
+#define CTRL_SET_KERN(val, k) (val |= ((k & 1) << 17))
+#define CTRL_SET_UM(val, m) (val |= (m << 8))
+#define CTRL_SET_EVENT(val, e) (val |= e)
+
+
+static void athlon_fill_in_addresses(struct op_msrs * const msrs)
+{
+ msrs->counters.addrs[0] = MSR_K7_PERFCTR0;
+ msrs->counters.addrs[1] = MSR_K7_PERFCTR1;
+ msrs->counters.addrs[2] = MSR_K7_PERFCTR2;
+ msrs->counters.addrs[3] = MSR_K7_PERFCTR3;
+
+ msrs->controls.addrs[0] = MSR_K7_EVNTSEL0;
+ msrs->controls.addrs[1] = MSR_K7_EVNTSEL1;
+ msrs->controls.addrs[2] = MSR_K7_EVNTSEL2;
+ msrs->controls.addrs[3] = MSR_K7_EVNTSEL3;
+}
+
+
+static void athlon_setup_ctrs(struct op_msrs const * const msrs)
+{
+ uint low, high;
+ int i;
+
+ /* clear all counters */
+ for (i = 0 ; i < NUM_CONTROLS; ++i) {
+ CTRL_READ(low, high, msrs, i);
+ CTRL_CLEAR(low);
+ CTRL_WRITE(low, high, msrs, i);
+ }
+
+ /* avoid a false detection of ctr overflows in NMI handler */
+ for (i = 0; i < NUM_COUNTERS; ++i)
+ CTR_WRITE(1, msrs, i);
+
+ /* enable active counters */
+ for (i = 0; i < NUM_COUNTERS; ++i) {
+ if (sysctl.ctr[i].enabled) {
+
+ CTR_WRITE(sysctl.ctr[i].count, msrs, i);
+
+ CTRL_READ(low, high, msrs, i);
+ CTRL_CLEAR(low);
+ CTRL_SET_ENABLE(low);
+ CTRL_SET_USR(low, sysctl.ctr[i].user);
+ CTRL_SET_KERN(low, sysctl.ctr[i].kernel);
+ CTRL_SET_UM(low, sysctl.ctr[i].unit_mask);
+ CTRL_SET_EVENT(low, sysctl.ctr[i].event);
+ CTRL_WRITE(low, high, msrs, i);
+ }
+ }
+}
+
+
+static void athlon_check_ctrs(uint const cpu,
+ struct op_msrs const * const msrs,
+ struct pt_regs * const regs)
+{
+ uint low, high;
+ int i;
+ for (i = 0 ; i < NUM_COUNTERS; ++i) {
+ if (sysctl.ctr[i].enabled) {
+ CTR_READ(low, high, msrs, i);
+ if (CTR_OVERFLOWED(low)) {
+ op_do_profile(cpu, instruction_pointer(regs), IRQ_ENABLED(regs), i);
+ CTR_WRITE(oprof_data[cpu].ctr_count[i], msrs, i);
+ }
+ }
+ }
+}
+
+
+static void athlon_start(struct op_msrs const * const msrs)
+{
+ uint low, high;
+ int i;
+ for (i = 0 ; i < NUM_COUNTERS ; ++i) {
+ if (sysctl.ctr[i].enabled) {
+ CTRL_READ(low, high, msrs, i);
+ CTRL_SET_ACTIVE(low);
+ CTRL_WRITE(low, high, msrs, i);
+ }
+ }
+}
+
+
+static void athlon_stop(struct op_msrs const * const msrs)
+{
+ uint low, high;
+ int i;
+ for (i = 0 ; i < NUM_COUNTERS ; ++i) {
+ if (sysctl.ctr[i].enabled) {
+ CTRL_READ(low, high, msrs, i);
+ CTRL_SET_INACTIVE(low);
+ CTRL_WRITE(low, high, msrs, i);
+ }
+ }
+}
+
+
+struct op_x86_model_spec const op_athlon_spec = {
+ .num_counters = NUM_COUNTERS,
+ .num_controls = NUM_CONTROLS,
+ .fill_in_addresses = &athlon_fill_in_addresses,
+ .setup_ctrs = &athlon_setup_ctrs,
+ .check_ctrs = &athlon_check_ctrs,
+ .start = &athlon_start,
+ .stop = &athlon_stop
+};
diff --git a/module/x86/op_model_p4.c b/module/x86/op_model_p4.c
new file mode 100644
index 0000000..94c8e96
--- /dev/null
+++ b/module/x86/op_model_p4.c
@@ -0,0 +1,727 @@
+/**
+ * @file op_model_p4.c
+ * P4 model-specific MSR operations
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Graydon Hoare
+ */
+
+#include "op_x86_model.h"
+#include "op_msr.h"
+#include "op_apic.h"
+#include "op_arch.h"
+
+#define NUM_EVENTS 39
+
+#define NUM_COUNTERS_NON_HT 8
+#define NUM_ESCRS_NON_HT 45
+#define NUM_CCCRS_NON_HT 18
+#define NUM_CONTROLS_NON_HT (NUM_ESCRS_NON_HT + NUM_CCCRS_NON_HT)
+
+#define NUM_COUNTERS_HT2 4
+#define NUM_ESCRS_HT2 23
+#define NUM_CCCRS_HT2 9
+#define NUM_CONTROLS_HT2 (NUM_ESCRS_HT2 + NUM_CCCRS_HT2)
+
+static unsigned int num_counters = NUM_COUNTERS_NON_HT;
+
+
+/* this has to be checked dynamically since the
+ hyper-threadedness of a chip is discovered at
+ kernel boot-time. */
+static inline void setup_num_counters(void)
+{
+#ifdef HT_SUPPORT
+ if (smp_num_siblings == 2)
+ num_counters = NUM_COUNTERS_HT2;
+#endif
+}
+
+static int inline addr_increment(void)
+{
+#ifdef HT_SUPPORT
+ return smp_num_siblings == 2 ? 2 : 1;
+#else
+ return 1;
+#endif
+}
+
+
+/* tables to simulate simplified hardware view of p4 registers */
+struct p4_counter_binding {
+ int virt_counter;
+ int counter_address;
+ int cccr_address;
+};
+
+struct p4_event_binding {
+ /* value to put in CCCR */
+ int escr_select;
+ /* value to put in ESCR */
+ int event_select;
+ struct {
+ /* for this counter... */
+ int virt_counter;
+ /* use this ESCR */
+ int escr_address;
+ } bindings[2];
+};
+
+/* nb: these CTR_* defines are a duplicate of defines in
+ event/i386.p4*events. */
+
+
+#define CTR_BPU_0 (1 << 0)
+#define CTR_MS_0 (1 << 1)
+#define CTR_FLAME_0 (1 << 2)
+#define CTR_IQ_4 (1 << 3)
+#define CTR_BPU_2 (1 << 4)
+#define CTR_MS_2 (1 << 5)
+#define CTR_FLAME_2 (1 << 6)
+#define CTR_IQ_5 (1 << 7)
+
+static struct p4_counter_binding p4_counters[NUM_COUNTERS_NON_HT] = {
+ { CTR_BPU_0, MSR_P4_BPU_PERFCTR0, MSR_P4_BPU_CCCR0 },
+ { CTR_MS_0, MSR_P4_MS_PERFCTR0, MSR_P4_MS_CCCR0 },
+ { CTR_FLAME_0, MSR_P4_FLAME_PERFCTR0, MSR_P4_FLAME_CCCR0 },
+ { CTR_IQ_4, MSR_P4_IQ_PERFCTR4, MSR_P4_IQ_CCCR4 },
+ { CTR_BPU_2, MSR_P4_BPU_PERFCTR2, MSR_P4_BPU_CCCR2 },
+ { CTR_MS_2, MSR_P4_MS_PERFCTR2, MSR_P4_MS_CCCR2 },
+ { CTR_FLAME_2, MSR_P4_FLAME_PERFCTR2, MSR_P4_FLAME_CCCR2 },
+ { CTR_IQ_5, MSR_P4_IQ_PERFCTR5, MSR_P4_IQ_CCCR5 }
+};
+
+#define NUM_UNUSED_CCCRS NUM_CCCRS_NON_HT - NUM_COUNTERS_NON_HT
+
+/* All cccr we don't use. */
+static int p4_unused_cccr[NUM_UNUSED_CCCRS] = {
+ MSR_P4_BPU_CCCR1, MSR_P4_BPU_CCCR3,
+ MSR_P4_MS_CCCR1, MSR_P4_MS_CCCR3,
+ MSR_P4_FLAME_CCCR1, MSR_P4_FLAME_CCCR3,
+ MSR_P4_IQ_CCCR0, MSR_P4_IQ_CCCR1,
+ MSR_P4_IQ_CCCR2, MSR_P4_IQ_CCCR3
+};
+
+/* p4 event codes in libop/op_event.h are indices into this table. */
+
+static struct p4_event_binding p4_events[NUM_EVENTS] = {
+
+ { /* BRANCH_RETIRED */
+ 0x05, 0x06,
+ { {CTR_IQ_4, MSR_P4_CRU_ESCR2},
+ {CTR_IQ_5, MSR_P4_CRU_ESCR3} }
+ },
+
+ { /* MISPRED_BRANCH_RETIRED */
+ 0x04, 0x03,
+ { { CTR_IQ_4, MSR_P4_CRU_ESCR0},
+ { CTR_IQ_5, MSR_P4_CRU_ESCR1} }
+ },
+
+ { /* TC_DELIVER_MODE */
+ 0x01, 0x01,
+ { { CTR_MS_0, MSR_P4_TC_ESCR0},
+ { CTR_MS_2, MSR_P4_TC_ESCR1} }
+ },
+
+ { /* BPU_FETCH_REQUEST */
+ 0x00, 0x03,
+ { { CTR_BPU_0, MSR_P4_BPU_ESCR0},
+ { CTR_BPU_2, MSR_P4_BPU_ESCR1} }
+ },
+
+ { /* ITLB_REFERENCE */
+ 0x03, 0x18,
+ { { CTR_BPU_0, MSR_P4_ITLB_ESCR0},
+ { CTR_BPU_2, MSR_P4_ITLB_ESCR1} }
+ },
+
+ { /* MEMORY_CANCEL */
+ 0x05, 0x02,
+ { { CTR_FLAME_0, MSR_P4_DAC_ESCR0},
+ { CTR_FLAME_2, MSR_P4_DAC_ESCR1} }
+ },
+
+ { /* MEMORY_COMPLETE */
+ 0x02, 0x08,
+ { { CTR_FLAME_0, MSR_P4_SAAT_ESCR0},
+ { CTR_FLAME_2, MSR_P4_SAAT_ESCR1} }
+ },
+
+ { /* LOAD_PORT_REPLAY */
+ 0x02, 0x04,
+ { { CTR_FLAME_0, MSR_P4_SAAT_ESCR0},
+ { CTR_FLAME_2, MSR_P4_SAAT_ESCR1} }
+ },
+
+ { /* STORE_PORT_REPLAY */
+ 0x02, 0x05,
+ { { CTR_FLAME_0, MSR_P4_SAAT_ESCR0},
+ { CTR_FLAME_2, MSR_P4_SAAT_ESCR1} }
+ },
+
+ { /* MOB_LOAD_REPLAY */
+ 0x02, 0x03,
+ { { CTR_BPU_0, MSR_P4_MOB_ESCR0},
+ { CTR_BPU_2, MSR_P4_MOB_ESCR1} }
+ },
+
+ { /* PAGE_WALK_TYPE */
+ 0x04, 0x01,
+ { { CTR_BPU_0, MSR_P4_PMH_ESCR0},
+ { CTR_BPU_2, MSR_P4_PMH_ESCR1} }
+ },
+
+ { /* BSQ_CACHE_REFERENCE */
+ 0x07, 0x0c,
+ { { CTR_BPU_0, MSR_P4_BSU_ESCR0},
+ { CTR_BPU_2, MSR_P4_BSU_ESCR1} }
+ },
+
+ /* intel doc vol 3 table A-1: P4 and xeon with cpuid signature < 0xf27
+ * doen't allow MSR_FSB_ESCR1 so only counter 0 is available */
+ { /* IOQ_ALLOCATION */
+ 0x06, 0x03,
+ { { CTR_BPU_0, MSR_P4_FSB_ESCR0},
+ { 0, 0 } }
+ },
+
+ { /* IOQ_ACTIVE_ENTRIES */
+ 0x06, 0x1a,
+ { { CTR_BPU_2, MSR_P4_FSB_ESCR1},
+ { 0, 0 } }
+ },
+
+ { /* FSB_DATA_ACTIVITY */
+ 0x06, 0x17,
+ { { CTR_BPU_0, MSR_P4_FSB_ESCR0},
+ { CTR_BPU_2, MSR_P4_FSB_ESCR1} }
+ },
+
+ { /* BSQ_ALLOCATION */
+ 0x07, 0x05,
+ { { CTR_BPU_0, MSR_P4_BSU_ESCR0},
+ { 0, 0 } }
+ },
+
+ { /* BSQ_ACTIVE_ENTRIES */
+ 0x07, 0x06,
+ /* FIXME intel doc don't say which ESCR1 to use, using
+ BSU_ESCR1 is a sensible guess but will need validation */
+ { { CTR_BPU_2, MSR_P4_BSU_ESCR1 },
+ { 0, 0 } }
+ },
+
+ { /* X87_ASSIST */
+ 0x05, 0x03,
+ { { CTR_IQ_4, MSR_P4_CRU_ESCR2},
+ { CTR_IQ_5, MSR_P4_CRU_ESCR3} }
+ },
+
+ { /* SSE_INPUT_ASSIST */
+ 0x01, 0x34,
+ { { CTR_FLAME_0, MSR_P4_FIRM_ESCR0},
+ { CTR_FLAME_2, MSR_P4_FIRM_ESCR1} }
+ },
+
+ { /* PACKED_SP_UOP */
+ 0x01, 0x08,
+ { { CTR_FLAME_0, MSR_P4_FIRM_ESCR0},
+ { CTR_FLAME_2, MSR_P4_FIRM_ESCR1} }
+ },
+
+ { /* PACKED_DP_UOP */
+ 0x01, 0x0c,
+ { { CTR_FLAME_0, MSR_P4_FIRM_ESCR0},
+ { CTR_FLAME_2, MSR_P4_FIRM_ESCR1} }
+ },
+
+ { /* SCALAR_SP_UOP */
+ 0x01, 0x0a,
+ { { CTR_FLAME_0, MSR_P4_FIRM_ESCR0},
+ { CTR_FLAME_2, MSR_P4_FIRM_ESCR1} }
+ },
+
+ { /* SCALAR_DP_UOP */
+ 0x01, 0x0e,
+ { { CTR_FLAME_0, MSR_P4_FIRM_ESCR0},
+ { CTR_FLAME_2, MSR_P4_FIRM_ESCR1} }
+ },
+
+ { /* 64BIT_MMX_UOP */
+ 0x01, 0x02,
+ { { CTR_FLAME_0, MSR_P4_FIRM_ESCR0},
+ { CTR_FLAME_2, MSR_P4_FIRM_ESCR1} }
+ },
+
+ { /* 128BIT_MMX_UOP */
+ 0x01, 0x1a,
+ { { CTR_FLAME_0, MSR_P4_FIRM_ESCR0},
+ { CTR_FLAME_2, MSR_P4_FIRM_ESCR1} }
+ },
+
+ { /* X87_FP_UOP */
+ 0x01, 0x04,
+ { { CTR_FLAME_0, MSR_P4_FIRM_ESCR0},
+ { CTR_FLAME_2, MSR_P4_FIRM_ESCR1} }
+ },
+
+ { /* X87_SIMD_MOVES_UOP */
+ 0x01, 0x2e,
+ { { CTR_FLAME_0, MSR_P4_FIRM_ESCR0},
+ { CTR_FLAME_2, MSR_P4_FIRM_ESCR1} }
+ },
+
+ { /* MACHINE_CLEAR */
+ 0x05, 0x02,
+ { { CTR_IQ_4, MSR_P4_CRU_ESCR2},
+ { CTR_IQ_5, MSR_P4_CRU_ESCR3} }
+ },
+
+ { /* GLOBAL_POWER_EVENTS */
+ 0x06, 0x13 /* older manual says 0x05, newer 0x13 */,
+ { { CTR_BPU_0, MSR_P4_FSB_ESCR0},
+ { CTR_BPU_2, MSR_P4_FSB_ESCR1} }
+ },
+
+ { /* TC_MS_XFER */
+ 0x00, 0x05,
+ { { CTR_MS_0, MSR_P4_MS_ESCR0},
+ { CTR_MS_2, MSR_P4_MS_ESCR1} }
+ },
+
+ { /* UOP_QUEUE_WRITES */
+ 0x00, 0x09,
+ { { CTR_MS_0, MSR_P4_MS_ESCR0},
+ { CTR_MS_2, MSR_P4_MS_ESCR1} }
+ },
+
+ { /* FRONT_END_EVENT */
+ 0x05, 0x08,
+ { { CTR_IQ_4, MSR_P4_CRU_ESCR2},
+ { CTR_IQ_5, MSR_P4_CRU_ESCR3} }
+ },
+
+ { /* EXECUTION_EVENT */
+ 0x05, 0x0c,
+ { { CTR_IQ_4, MSR_P4_CRU_ESCR2},
+ { CTR_IQ_5, MSR_P4_CRU_ESCR3} }
+ },
+
+ { /* REPLAY_EVENT */
+ 0x05, 0x09,
+ { { CTR_IQ_4, MSR_P4_CRU_ESCR2},
+ { CTR_IQ_5, MSR_P4_CRU_ESCR3} }
+ },
+
+ { /* INSTR_RETIRED */
+ 0x04, 0x02,
+ { { CTR_IQ_4, MSR_P4_CRU_ESCR0},
+ { CTR_IQ_5, MSR_P4_CRU_ESCR1} }
+ },
+
+ { /* UOPS_RETIRED */
+ 0x04, 0x01,
+ { { CTR_IQ_4, MSR_P4_CRU_ESCR0},
+ { CTR_IQ_5, MSR_P4_CRU_ESCR1} }
+ },
+
+ { /* UOP_TYPE */
+ 0x02, 0x02,
+ { { CTR_IQ_4, MSR_P4_RAT_ESCR0},
+ { CTR_IQ_5, MSR_P4_RAT_ESCR1} }
+ },
+
+ { /* RETIRED_MISPRED_BRANCH_TYPE */
+ 0x02, 0x05,
+ { { CTR_MS_0, MSR_P4_TBPU_ESCR0},
+ { CTR_MS_2, MSR_P4_TBPU_ESCR1} }
+ },
+
+ { /* RETIRED_BRANCH_TYPE */
+ 0x02, 0x04,
+ { { CTR_MS_0, MSR_P4_TBPU_ESCR0},
+ { CTR_MS_2, MSR_P4_TBPU_ESCR1} }
+ }
+};
+
+
+#define MISC_PMC_ENABLED_P(x) ((x) & 1 << 7)
+
+#define ESCR_RESERVED_BITS 0x80000003
+#define ESCR_CLEAR(escr) ((escr) &= ESCR_RESERVED_BITS)
+#define ESCR_SET_USR_0(escr, usr) ((escr) |= (((usr) & 1) << 2))
+#define ESCR_SET_OS_0(escr, os) ((escr) |= (((os) & 1) << 3))
+#define ESCR_SET_USR_1(escr, usr) ((escr) |= (((usr) & 1)))
+#define ESCR_SET_OS_1(escr, os) ((escr) |= (((os) & 1) << 1))
+#define ESCR_SET_EVENT_SELECT(escr, sel) ((escr) |= (((sel) & 0x3f) << 25))
+#define ESCR_SET_EVENT_MASK(escr, mask) ((escr) |= (((mask) & 0xffff) << 9))
+#define ESCR_READ(escr, high, ev, i) do {rdmsr(ev->bindings[(i)].escr_address, (escr), (high));} while (0)
+#define ESCR_WRITE(escr, high, ev, i) do {wrmsr(ev->bindings[(i)].escr_address, (escr), (high));} while (0)
+
+#define CCCR_RESERVED_BITS 0x38030FFF
+#define CCCR_CLEAR(cccr) ((cccr) &= CCCR_RESERVED_BITS)
+#define CCCR_SET_REQUIRED_BITS(cccr) ((cccr) |= 0x00030000)
+#define CCCR_SET_ESCR_SELECT(cccr, sel) ((cccr) |= (((sel) & 0x07) << 13))
+#define CCCR_SET_PMI_OVF_0(cccr) ((cccr) |= (1 << 26))
+#define CCCR_SET_PMI_OVF_1(cccr) ((cccr) |= (1 << 27))
+#define CCCR_SET_ENABLE(cccr) ((cccr) |= (1 << 12))
+#define CCCR_SET_DISABLE(cccr) ((cccr) &= ~(1 << 12))
+#define CCCR_READ(low, high, i) do {rdmsr(p4_counters[(i)].cccr_address, (low), (high));} while (0)
+#define CCCR_WRITE(low, high, i) do {wrmsr(p4_counters[(i)].cccr_address, (low), (high));} while (0)
+#define CCCR_OVF_P(cccr) ((cccr) & (1U << 31))
+#define CCCR_CLEAR_OVF(cccr) ((cccr) &= (~(1U << 31)))
+
+#define CTR_READ(l, h, i) do {rdmsr(p4_counters[(i)].counter_address, (l), (h));} while (0)
+#define CTR_WRITE(l, i) do {wrmsr(p4_counters[(i)].counter_address, -(u32)(l), -1);} while (0)
+#define CTR_OVERFLOW_P(ctr) (!((ctr) & 0x80000000))
+
+
+/* this assigns a "stagger" to the current CPU, which is used throughout
+ the code in this module as an extra array offset, to select the "even"
+ or "odd" part of all the divided resources. */
+static unsigned int get_stagger(void)
+{
+#ifdef HT_SUPPORT
+ int cpu;
+ if (smp_num_siblings > 1) {
+ cpu = smp_processor_id();
+ return (cpu_sibling_map[cpu] > cpu) ? 0 : 1;
+ }
+#endif
+ return 0;
+}
+
+
+/* finally, mediate access to a real hardware counter
+ by passing a "virtual" counter numer to this macro,
+ along with your stagger setting. */
+#define VIRT_CTR(stagger, i) ((i) + ((num_counters) * (stagger)))
+
+
+static void p4_fill_in_addresses(struct op_msrs * const msrs)
+{
+ unsigned int i;
+ unsigned int addr, stag;
+
+ setup_num_counters();
+ stag = get_stagger();
+
+ /* the counter registers we pay attention to */
+ for (i = 0; i < num_counters; ++i) {
+ msrs->counters.addrs[i] =
+ p4_counters[VIRT_CTR(stag, i)].counter_address;
+ }
+
+ /* FIXME: bad feeling, we don't save the 10 counters we don't use. */
+
+ /* 18 CCCR registers */
+ for (i = 0, addr = MSR_P4_BPU_CCCR0 + stag;
+ addr <= MSR_P4_IQ_CCCR5; ++i, addr += addr_increment()) {
+ msrs->controls.addrs[i] = addr;
+ }
+
+ /* 43 ESCR registers in three or four discontiguous group */
+ for (addr = MSR_P4_BSU_ESCR0 + stag;
+ addr < MSR_P4_IQ_ESCR0; ++i, addr += addr_increment()) {
+ msrs->controls.addrs[i] = addr;
+ }
+
+ /* no IQ_ESCR0/1 on some models, we save a seconde time BSU_ESCR0/1
+ * to avoid special case in nmi_{save|restore}_registers() */
+ if (boot_cpu_data.x86_model >= 0x3) {
+ for (addr = MSR_P4_BSU_ESCR0 + stag;
+ addr <= MSR_P4_BSU_ESCR1; ++i, addr += addr_increment()) {
+ msrs->controls.addrs[i] = addr;
+ }
+ } else {
+ for (addr = MSR_P4_IQ_ESCR0 + stag;
+ addr <= MSR_P4_IQ_ESCR1; ++i, addr += addr_increment()) {
+ msrs->controls.addrs[i] = addr;
+ }
+ }
+
+ for (addr = MSR_P4_RAT_ESCR0 + stag;
+ addr <= MSR_P4_SSU_ESCR0; ++i, addr += addr_increment()) {
+ msrs->controls.addrs[i] = addr;
+ }
+
+ for (addr = MSR_P4_MS_ESCR0 + stag;
+ addr <= MSR_P4_TC_ESCR1; ++i, addr += addr_increment()) {
+ msrs->controls.addrs[i] = addr;
+ }
+
+ for (addr = MSR_P4_IX_ESCR0 + stag;
+ addr <= MSR_P4_CRU_ESCR3; ++i, addr += addr_increment()) {
+ msrs->controls.addrs[i] = addr;
+ }
+
+ /* there are 2 remaining non-contiguously located ESCRs */
+
+ if (num_counters == NUM_COUNTERS_NON_HT) {
+ /* standard non-HT CPUs handle both remaining ESCRs*/
+ msrs->controls.addrs[i++] = MSR_P4_CRU_ESCR5;
+ msrs->controls.addrs[i++] = MSR_P4_CRU_ESCR4;
+
+ } else if (stag == 0) {
+ /* HT CPUs give the first remainder to the even thread, as
+ the 32nd control register */
+ msrs->controls.addrs[i++] = MSR_P4_CRU_ESCR4;
+
+ } else {
+ /* and two copies of the second to the odd thread,
+ for the 22st and 23nd control registers */
+ msrs->controls.addrs[i++] = MSR_P4_CRU_ESCR5;
+ msrs->controls.addrs[i++] = MSR_P4_CRU_ESCR5;
+ }
+}
+
+
+static void pmc_setup_one_p4_counter(unsigned int ctr)
+{
+ int i;
+ int const maxbind = 2;
+ unsigned int cccr = 0;
+ unsigned int escr = 0;
+ unsigned int high = 0;
+ unsigned int counter_bit;
+ struct p4_event_binding * ev = NULL;
+ unsigned int stag;
+
+ stag = get_stagger();
+
+ /* convert from counter *number* to counter *bit* */
+ counter_bit = 1 << VIRT_CTR(stag, ctr);
+
+ /* find our event binding structure. */
+ if (sysctl.ctr[ctr].event <= 0 || sysctl.ctr[ctr].event > NUM_EVENTS) {
+ printk(KERN_ERR
+ "oprofile: P4 event code 0x%x out of range\n",
+ sysctl.ctr[ctr].event);
+ return;
+ }
+
+ ev = &(p4_events[sysctl.ctr[ctr].event - 1]);
+
+ for (i = 0; i < maxbind; i++) {
+ if (ev->bindings[i].virt_counter & counter_bit) {
+
+ /* modify ESCR */
+ ESCR_READ(escr, high, ev, i);
+ ESCR_CLEAR(escr);
+ if (stag == 0) {
+ ESCR_SET_USR_0(escr, sysctl.ctr[ctr].user);
+ ESCR_SET_OS_0(escr, sysctl.ctr[ctr].kernel);
+ } else {
+ ESCR_SET_USR_1(escr, sysctl.ctr[ctr].user);
+ ESCR_SET_OS_1(escr, sysctl.ctr[ctr].kernel);
+ }
+ ESCR_SET_EVENT_SELECT(escr, ev->event_select);
+ ESCR_SET_EVENT_MASK(escr, sysctl.ctr[ctr].unit_mask);
+ ESCR_WRITE(escr, high, ev, i);
+
+ /* modify CCCR */
+ CCCR_READ(cccr, high, VIRT_CTR(stag, ctr));
+ CCCR_CLEAR(cccr);
+ CCCR_SET_REQUIRED_BITS(cccr);
+ CCCR_SET_ESCR_SELECT(cccr, ev->escr_select);
+ if (stag == 0) {
+ CCCR_SET_PMI_OVF_0(cccr);
+ } else {
+ CCCR_SET_PMI_OVF_1(cccr);
+ }
+ CCCR_WRITE(cccr, high, VIRT_CTR(stag, ctr));
+ return;
+ }
+ }
+
+ printk(KERN_ERR
+ "oprofile: P4 event code 0x%x no binding, ctr %d\n",
+ sysctl.ctr[ctr].event, ctr);
+}
+
+
+static void p4_setup_ctrs(struct op_msrs const * const msrs)
+{
+ unsigned int i;
+ unsigned int low, high;
+ unsigned int addr;
+ unsigned int stag;
+
+ stag = get_stagger();
+
+ rdmsr(MSR_IA32_MISC_ENABLE, low, high);
+ if (!MISC_PMC_ENABLED_P(low)) {
+ printk(KERN_ERR "oprofile: P4 PMC not available\n");
+ return;
+ }
+
+ /* clear the cccrs we will use */
+ for (i = 0 ; i < num_counters ; i++) {
+ rdmsr(p4_counters[VIRT_CTR(stag, i)].cccr_address, low, high);
+ CCCR_CLEAR(low);
+ CCCR_SET_REQUIRED_BITS(low);
+ wrmsr(p4_counters[VIRT_CTR(stag, i)].cccr_address, low, high);
+ }
+
+ /* clear cccrs outside our concern */
+ for (i = stag ; i < NUM_UNUSED_CCCRS ; i += addr_increment()) {
+ rdmsr(p4_unused_cccr[i], low, high);
+ CCCR_CLEAR(low);
+ CCCR_SET_REQUIRED_BITS(low);
+ wrmsr(p4_unused_cccr[i], low, high);
+ }
+
+ /* clear all escrs (including those outside our concern) */
+ for (addr = MSR_P4_BSU_ESCR0 + stag;
+ addr < MSR_P4_IQ_ESCR0; addr += addr_increment()) {
+ wrmsr(addr, 0, 0);
+ }
+
+ /* On older models clear also MSR_P4_IQ_ESCR0/1 */
+ if (boot_cpu_data.x86_model < 0x3) {
+ wrmsr(MSR_P4_IQ_ESCR0, 0, 0);
+ wrmsr(MSR_P4_IQ_ESCR1, 0, 0);
+ }
+
+ for (addr = MSR_P4_RAT_ESCR0 + stag;
+ addr <= MSR_P4_SSU_ESCR0; ++i, addr += addr_increment()) {
+ wrmsr(addr, 0, 0);
+ }
+
+ for (addr = MSR_P4_MS_ESCR0 + stag;
+ addr <= MSR_P4_TC_ESCR1; addr += addr_increment()) {
+ wrmsr(addr, 0, 0);
+ }
+
+ for (addr = MSR_P4_IX_ESCR0 + stag;
+ addr <= MSR_P4_CRU_ESCR3; addr += addr_increment()) {
+ wrmsr(addr, 0, 0);
+ }
+
+ if (num_counters == NUM_COUNTERS_NON_HT) {
+ wrmsr(MSR_P4_CRU_ESCR4, 0, 0);
+ wrmsr(MSR_P4_CRU_ESCR5, 0, 0);
+ } else if (stag == 0) {
+ wrmsr(MSR_P4_CRU_ESCR4, 0, 0);
+ } else {
+ wrmsr(MSR_P4_CRU_ESCR5, 0, 0);
+ }
+
+ /* setup all counters */
+ for (i = 0 ; i < num_counters ; ++i) {
+ if (sysctl.ctr[i].event) {
+ pmc_setup_one_p4_counter(i);
+ CTR_WRITE(sysctl.ctr[i].count, VIRT_CTR(stag, i));
+ }
+ }
+}
+
+
+static void p4_check_ctrs(unsigned int const cpu,
+ struct op_msrs const * const msrs,
+ struct pt_regs * const regs)
+{
+ unsigned long ctr, low, high, stag, real;
+ int i;
+
+ stag = get_stagger();
+
+ for (i = 0; i < num_counters; ++i) {
+
+ if (!sysctl.ctr[i].enabled)
+ continue;
+
+ /*
+ * there is some eccentricity in the hardware which
+ * requires that we perform 2 extra corrections:
+ *
+ * - check both the CCCR:OVF flag for overflow and the
+ * counter high bit for un-flagged overflows.
+ *
+ * - write the counter back twice to ensure it gets
+ * updated properly.
+ *
+ * the former seems to be related to extra NMIs happening
+ * during the current NMI; the latter is reported as errata
+ * N15 in intel doc 249199-029, pentium 4 specification
+ * update, though their suggested work-around does not
+ * appear to solve the problem.
+ */
+
+ real = VIRT_CTR(stag, i);
+
+ CCCR_READ(low, high, real);
+ CTR_READ(ctr, high, real);
+ if (CCCR_OVF_P(low) || CTR_OVERFLOW_P(ctr)) {
+ op_do_profile(cpu, instruction_pointer(regs), IRQ_ENABLED(regs), i);
+ CTR_WRITE(oprof_data[cpu].ctr_count[i], real);
+ CCCR_CLEAR_OVF(low);
+ CCCR_WRITE(low, high, real);
+ CTR_WRITE(oprof_data[cpu].ctr_count[i], real);
+ }
+ }
+
+ /* P4 quirk: you have to re-unmask the apic vector */
+ apic_write(APIC_LVTPC, apic_read(APIC_LVTPC) & ~APIC_LVT_MASKED);
+}
+
+
+static void p4_start(struct op_msrs const * const msrs)
+{
+ unsigned int low, high, stag;
+ int i;
+
+ stag = get_stagger();
+
+ for (i = 0; i < num_counters; ++i) {
+ if (!sysctl.ctr[i].enabled)
+ continue;
+ CCCR_READ(low, high, VIRT_CTR(stag, i));
+ CCCR_SET_ENABLE(low);
+ CCCR_WRITE(low, high, VIRT_CTR(stag, i));
+ }
+}
+
+
+static void p4_stop(struct op_msrs const * const msrs)
+{
+ unsigned int low, high, stag;
+ int i;
+
+ stag = get_stagger();
+
+ for (i = 0; i < num_counters; ++i) {
+ /* FIXME: 2.6 driver doesn't do that ? */
+ if (!sysctl.ctr[i].enabled)
+ continue;
+ CCCR_READ(low, high, VIRT_CTR(stag, i));
+ CCCR_SET_DISABLE(low);
+ CCCR_WRITE(low, high, VIRT_CTR(stag, i));
+ }
+}
+
+#ifdef HT_SUPPORT
+
+struct op_x86_model_spec const op_p4_ht2_spec = {
+ .num_counters = NUM_COUNTERS_HT2,
+ .num_controls = NUM_CONTROLS_HT2,
+ .fill_in_addresses = &p4_fill_in_addresses,
+ .setup_ctrs = &p4_setup_ctrs,
+ .check_ctrs = &p4_check_ctrs,
+ .start = &p4_start,
+ .stop = &p4_stop
+};
+#endif
+
+struct op_x86_model_spec const op_p4_spec = {
+ .num_counters = NUM_COUNTERS_NON_HT,
+ .num_controls = NUM_CONTROLS_NON_HT,
+ .fill_in_addresses = &p4_fill_in_addresses,
+ .setup_ctrs = &p4_setup_ctrs,
+ .check_ctrs = &p4_check_ctrs,
+ .start = &p4_start,
+ .stop = &p4_stop
+};
diff --git a/module/x86/op_model_ppro.c b/module/x86/op_model_ppro.c
new file mode 100644
index 0000000..4ee85d5
--- /dev/null
+++ b/module/x86/op_model_ppro.c
@@ -0,0 +1,123 @@
+/**
+ * @file op_model_ppro.h
+ * pentium pro / P6 model-specific MSR operations
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ * @author Graydon Hoare
+ */
+
+#include "op_x86_model.h"
+#include "op_arch.h"
+#include "op_msr.h"
+
+#define NUM_COUNTERS 2
+#define NUM_CONTROLS 2
+
+#define CTR_READ(l, h, msrs, c) do {rdmsr(msrs->counters.addrs[(c)], (l), (h));} while (0)
+#define CTR_WRITE(l, msrs, c) do {wrmsr(msrs->counters.addrs[(c)], -(u32)(l), -1);} while (0)
+#define CTR_OVERFLOWED(n) (!((n) & (1U << 31)))
+
+#define CTRL_READ(l, h, msrs, c) do {rdmsr((msrs->controls.addrs[(c)]), (l), (h));} while (0)
+#define CTRL_WRITE(l, h, msrs, c) do {wrmsr((msrs->controls.addrs[(c)]), (l), (h));} while (0)
+#define CTRL_SET_ACTIVE(n) (n |= (1 << 22))
+#define CTRL_SET_INACTIVE(n) (n &= ~(1 << 22))
+#define CTRL_CLEAR(x) (x &= (1 << 21))
+#define CTRL_SET_ENABLE(val) (val |= 1 << 20)
+#define CTRL_SET_USR(val, u) (val |= ((u & 1) << 16))
+#define CTRL_SET_KERN(val, k) (val |= ((k & 1) << 17))
+#define CTRL_SET_UM(val, m) (val |= (m << 8))
+#define CTRL_SET_EVENT(val, e) (val |= e)
+
+
+static void ppro_fill_in_addresses(struct op_msrs * const msrs)
+{
+ msrs->counters.addrs[0] = MSR_P6_PERFCTR0;
+ msrs->counters.addrs[1] = MSR_P6_PERFCTR1;
+
+ msrs->controls.addrs[0] = MSR_P6_EVNTSEL0;
+ msrs->controls.addrs[1] = MSR_P6_EVNTSEL1;
+}
+
+
+static void ppro_setup_ctrs(struct op_msrs const * const msrs)
+{
+ uint low, high;
+ int i;
+
+ /* clear all counters */
+ for (i = 0 ; i < NUM_CONTROLS; ++i) {
+ CTRL_READ(low, high, msrs, i);
+ CTRL_CLEAR(low);
+ CTRL_WRITE(low, high, msrs, i);
+ }
+
+ /* avoid a false detection of ctr overflows in NMI handler */
+ for (i = 0; i < NUM_COUNTERS; ++i)
+ CTR_WRITE(1, msrs, i);
+
+ /* enable active counters */
+ for (i = 0; i < NUM_COUNTERS; ++i) {
+ if (sysctl.ctr[i].enabled) {
+
+ CTR_WRITE(sysctl.ctr[i].count, msrs, i);
+
+ CTRL_READ(low, high, msrs, i);
+ CTRL_CLEAR(low);
+ CTRL_SET_ENABLE(low);
+ CTRL_SET_USR(low, sysctl.ctr[i].user);
+ CTRL_SET_KERN(low, sysctl.ctr[i].kernel);
+ CTRL_SET_UM(low, sysctl.ctr[i].unit_mask);
+ CTRL_SET_EVENT(low, sysctl.ctr[i].event);
+ CTRL_WRITE(low, high, msrs, i);
+ }
+ }
+}
+
+
+static void ppro_check_ctrs(uint const cpu,
+ struct op_msrs const * const msrs,
+ struct pt_regs * const regs)
+{
+ ulong low, high;
+ int i;
+ for (i = 0 ; i < NUM_COUNTERS; ++i) {
+ CTR_READ(low, high, msrs, i);
+ if (CTR_OVERFLOWED(low)) {
+ op_do_profile(cpu, instruction_pointer(regs), IRQ_ENABLED(regs), i);
+ CTR_WRITE(oprof_data[cpu].ctr_count[i], msrs, i);
+ }
+ }
+}
+
+
+static void ppro_start(struct op_msrs const * const msrs)
+{
+ uint low, high;
+ CTRL_READ(low, high, msrs, 0);
+ CTRL_SET_ACTIVE(low);
+ CTRL_WRITE(low, high, msrs, 0);
+}
+
+
+static void ppro_stop(struct op_msrs const * const msrs)
+{
+ uint low, high;
+ CTRL_READ(low, high, msrs, 0);
+ CTRL_SET_INACTIVE(low);
+ CTRL_WRITE(low, high, msrs, 0);
+}
+
+
+struct op_x86_model_spec const op_ppro_spec = {
+ .num_counters = NUM_COUNTERS,
+ .num_controls = NUM_CONTROLS,
+ .fill_in_addresses = &ppro_fill_in_addresses,
+ .setup_ctrs = &ppro_setup_ctrs,
+ .check_ctrs = &ppro_check_ctrs,
+ .start = &ppro_start,
+ .stop = &ppro_stop
+};
diff --git a/module/x86/op_msr.h b/module/x86/op_msr.h
new file mode 100644
index 0000000..06b7329
--- /dev/null
+++ b/module/x86/op_msr.h
@@ -0,0 +1,337 @@
+/**
+ * @file op_msr.h
+ * x86-specific MSR stuff
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#ifndef OP_MSR_H
+#define OP_MSR_H
+
+/* work-around compiler bug in gcc 2.91.66, just mark all input register as
+ * magically cloberred by wrmsr */
+#if __GNUC__ == 2 && __GNUC_MINOR__ == 91
+ #undef wrmsr
+ #define wrmsr(msr, val1, val2) \
+ __asm__ __volatile__("wrmsr" \
+ /* no outputs */ \
+ : \
+ : "c" (msr), "a" (val1), "d" (val2) \
+ : "ecx", "eax", "edx")
+#endif
+
+#ifndef MSR_IA32_MISC_ENABLE
+#define MSR_IA32_MISC_ENABLE 0x1a0
+#endif
+
+/* MSRs */
+#ifndef MSR_P6_PERFCTR0
+#define MSR_P6_PERFCTR0 0xc1
+#endif
+#ifndef MSR_P6_PERFCTR1
+#define MSR_P6_PERFCTR1 0xc2
+#endif
+#ifndef MSR_P6_EVNTSEL0
+#define MSR_P6_EVNTSEL0 0x186
+#endif
+#ifndef MSR_P6_EVNTSEL1
+#define MSR_P6_EVNTSEL1 0x187
+#endif
+#ifndef MSR_K7_EVNTSEL0
+#define MSR_K7_EVNTSEL0 0xc0010000
+#endif
+#ifndef MSR_K7_EVNTSEL1
+#define MSR_K7_EVNTSEL1 0xc0010001
+#endif
+#ifndef MSR_K7_EVNTSEL2
+#define MSR_K7_EVNTSEL2 0xc0010002
+#endif
+#ifndef MSR_K7_EVNTSEL3
+#define MSR_K7_EVNTSEL3 0xc0010003
+#endif
+#ifndef MSR_K7_PERFCTR0
+#define MSR_K7_PERFCTR0 0xc0010004
+#endif
+#ifndef MSR_K7_PERFCTR1
+#define MSR_K7_PERFCTR1 0xc0010005
+#endif
+#ifndef MSR_K7_PERFCTR2
+#define MSR_K7_PERFCTR2 0xc0010006
+#endif
+#ifndef MSR_K7_PERFCTR3
+#define MSR_K7_PERFCTR3 0xc0010007
+#endif
+
+/* There are *82* pentium 4 MSRs:
+
+ - 1 misc register
+
+ - 18 counters (PERFCTRs)
+
+ - 18 counter configuration control registers (CCCRs)
+
+ - 45 event selection control registers (ESCRs). */
+
+
+#ifndef MSR_P4_BPU_PERFCTR0
+#define MSR_P4_BPU_PERFCTR0 0x300
+#endif
+#ifndef MSR_P4_BPU_PERFCTR1
+#define MSR_P4_BPU_PERFCTR1 0x301
+#endif
+#ifndef MSR_P4_BPU_PERFCTR2
+#define MSR_P4_BPU_PERFCTR2 0x302
+#endif
+#ifndef MSR_P4_BPU_PERFCTR3
+#define MSR_P4_BPU_PERFCTR3 0x303
+#endif
+#ifndef MSR_P4_MS_PERFCTR0
+#define MSR_P4_MS_PERFCTR0 0x304
+#endif
+#ifndef MSR_P4_MS_PERFCTR1
+#define MSR_P4_MS_PERFCTR1 0x305
+#endif
+#ifndef MSR_P4_MS_PERFCTR2
+#define MSR_P4_MS_PERFCTR2 0x306
+#endif
+#ifndef MSR_P4_MS_PERFCTR3
+#define MSR_P4_MS_PERFCTR3 0x307
+#endif
+#ifndef MSR_P4_FLAME_PERFCTR0
+#define MSR_P4_FLAME_PERFCTR0 0x308
+#endif
+#ifndef MSR_P4_FLAME_PERFCTR1
+#define MSR_P4_FLAME_PERFCTR1 0x309
+#endif
+#ifndef MSR_P4_FLAME_PERFCTR2
+#define MSR_P4_FLAME_PERFCTR2 0x30a
+#endif
+#ifndef MSR_P4_FLAME_PERFCTR3
+#define MSR_P4_FLAME_PERFCTR3 0x30b
+#endif
+#ifndef MSR_P4_IQ_PERFCTR0
+#define MSR_P4_IQ_PERFCTR0 0x30c
+#endif
+#ifndef MSR_P4_IQ_PERFCTR1
+#define MSR_P4_IQ_PERFCTR1 0x30d
+#endif
+#ifndef MSR_P4_IQ_PERFCTR2
+#define MSR_P4_IQ_PERFCTR2 0x30e
+#endif
+#ifndef MSR_P4_IQ_PERFCTR3
+#define MSR_P4_IQ_PERFCTR3 0x30f
+#endif
+#ifndef MSR_P4_IQ_PERFCTR4
+#define MSR_P4_IQ_PERFCTR4 0x310
+#endif
+#ifndef MSR_P4_IQ_PERFCTR5
+#define MSR_P4_IQ_PERFCTR5 0x311
+#endif
+
+
+#ifndef MSR_P4_BPU_CCCR0
+#define MSR_P4_BPU_CCCR0 0x360
+#endif
+#ifndef MSR_P4_BPU_CCCR1
+#define MSR_P4_BPU_CCCR1 0x361
+#endif
+#ifndef MSR_P4_BPU_CCCR2
+#define MSR_P4_BPU_CCCR2 0x362
+#endif
+#ifndef MSR_P4_BPU_CCCR3
+#define MSR_P4_BPU_CCCR3 0x363
+#endif
+#ifndef MSR_P4_MS_CCCR0
+#define MSR_P4_MS_CCCR0 0x364
+#endif
+#ifndef MSR_P4_MS_CCCR1
+#define MSR_P4_MS_CCCR1 0x365
+#endif
+#ifndef MSR_P4_MS_CCCR2
+#define MSR_P4_MS_CCCR2 0x366
+#endif
+#ifndef MSR_P4_MS_CCCR3
+#define MSR_P4_MS_CCCR3 0x367
+#endif
+#ifndef MSR_P4_FLAME_CCCR0
+#define MSR_P4_FLAME_CCCR0 0x368
+#endif
+#ifndef MSR_P4_FLAME_CCCR1
+#define MSR_P4_FLAME_CCCR1 0x369
+#endif
+#ifndef MSR_P4_FLAME_CCCR2
+#define MSR_P4_FLAME_CCCR2 0x36a
+#endif
+#ifndef MSR_P4_FLAME_CCCR3
+#define MSR_P4_FLAME_CCCR3 0x36b
+#endif
+#ifndef MSR_P4_IQ_CCCR0
+#define MSR_P4_IQ_CCCR0 0x36c
+#endif
+#ifndef MSR_P4_IQ_CCCR1
+#define MSR_P4_IQ_CCCR1 0x36d
+#endif
+#ifndef MSR_P4_IQ_CCCR2
+#define MSR_P4_IQ_CCCR2 0x36e
+#endif
+#ifndef MSR_P4_IQ_CCCR3
+#define MSR_P4_IQ_CCCR3 0x36f
+#endif
+#ifndef MSR_P4_IQ_CCCR4
+#define MSR_P4_IQ_CCCR4 0x370
+#endif
+#ifndef MSR_P4_IQ_CCCR5
+#define MSR_P4_IQ_CCCR5 0x371
+#endif
+
+
+#ifndef MSR_P4_ALF_ESCR0
+#define MSR_P4_ALF_ESCR0 0x3ca
+#endif
+#ifndef MSR_P4_ALF_ESCR1
+#define MSR_P4_ALF_ESCR1 0x3cb
+#endif
+#ifndef MSR_P4_BPU_ESCR0
+#define MSR_P4_BPU_ESCR0 0x3b2
+#endif
+#ifndef MSR_P4_BPU_ESCR1
+#define MSR_P4_BPU_ESCR1 0x3b3
+#endif
+#ifndef MSR_P4_BSU_ESCR0
+#define MSR_P4_BSU_ESCR0 0x3a0
+#endif
+#ifndef MSR_P4_BSU_ESCR1
+#define MSR_P4_BSU_ESCR1 0x3a1
+#endif
+#ifndef MSR_P4_CRU_ESCR0
+#define MSR_P4_CRU_ESCR0 0x3b8
+#endif
+#ifndef MSR_P4_CRU_ESCR1
+#define MSR_P4_CRU_ESCR1 0x3b9
+#endif
+#ifndef MSR_P4_CRU_ESCR2
+#define MSR_P4_CRU_ESCR2 0x3cc
+#endif
+#ifndef MSR_P4_CRU_ESCR3
+#define MSR_P4_CRU_ESCR3 0x3cd
+#endif
+#ifndef MSR_P4_CRU_ESCR4
+#define MSR_P4_CRU_ESCR4 0x3e0
+#endif
+#ifndef MSR_P4_CRU_ESCR5
+#define MSR_P4_CRU_ESCR5 0x3e1
+#endif
+#ifndef MSR_P4_DAC_ESCR0
+#define MSR_P4_DAC_ESCR0 0x3a8
+#endif
+#ifndef MSR_P4_DAC_ESCR1
+#define MSR_P4_DAC_ESCR1 0x3a9
+#endif
+#ifndef MSR_P4_FIRM_ESCR0
+#define MSR_P4_FIRM_ESCR0 0x3a4
+#endif
+#ifndef MSR_P4_FIRM_ESCR1
+#define MSR_P4_FIRM_ESCR1 0x3a5
+#endif
+#ifndef MSR_P4_FLAME_ESCR0
+#define MSR_P4_FLAME_ESCR0 0x3a6
+#endif
+#ifndef MSR_P4_FLAME_ESCR1
+#define MSR_P4_FLAME_ESCR1 0x3a7
+#endif
+#ifndef MSR_P4_FSB_ESCR0
+#define MSR_P4_FSB_ESCR0 0x3a2
+#endif
+#ifndef MSR_P4_FSB_ESCR1
+#define MSR_P4_FSB_ESCR1 0x3a3
+#endif
+#ifndef MSR_P4_IQ_ESCR0
+#define MSR_P4_IQ_ESCR0 0x3ba
+#endif
+#ifndef MSR_P4_IQ_ESCR1
+#define MSR_P4_IQ_ESCR1 0x3bb
+#endif
+#ifndef MSR_P4_IS_ESCR0
+#define MSR_P4_IS_ESCR0 0x3b4
+#endif
+#ifndef MSR_P4_IS_ESCR1
+#define MSR_P4_IS_ESCR1 0x3b5
+#endif
+#ifndef MSR_P4_ITLB_ESCR0
+#define MSR_P4_ITLB_ESCR0 0x3b6
+#endif
+#ifndef MSR_P4_ITLB_ESCR1
+#define MSR_P4_ITLB_ESCR1 0x3b7
+#endif
+#ifndef MSR_P4_IX_ESCR0
+#define MSR_P4_IX_ESCR0 0x3c8
+#endif
+#ifndef MSR_P4_IX_ESCR1
+#define MSR_P4_IX_ESCR1 0x3c9
+#endif
+#ifndef MSR_P4_MOB_ESCR0
+#define MSR_P4_MOB_ESCR0 0x3aa
+#endif
+#ifndef MSR_P4_MOB_ESCR1
+#define MSR_P4_MOB_ESCR1 0x3ab
+#endif
+#ifndef MSR_P4_MS_ESCR0
+#define MSR_P4_MS_ESCR0 0x3c0
+#endif
+#ifndef MSR_P4_MS_ESCR1
+#define MSR_P4_MS_ESCR1 0x3c1
+#endif
+#ifndef MSR_P4_PMH_ESCR0
+#define MSR_P4_PMH_ESCR0 0x3ac
+#endif
+#ifndef MSR_P4_PMH_ESCR1
+#define MSR_P4_PMH_ESCR1 0x3ad
+#endif
+#ifndef MSR_P4_RAT_ESCR0
+#define MSR_P4_RAT_ESCR0 0x3bc
+#endif
+#ifndef MSR_P4_RAT_ESCR1
+#define MSR_P4_RAT_ESCR1 0x3bd
+#endif
+#ifndef MSR_P4_SAAT_ESCR0
+#define MSR_P4_SAAT_ESCR0 0x3ae
+#endif
+#ifndef MSR_P4_SAAT_ESCR1
+#define MSR_P4_SAAT_ESCR1 0x3af
+#endif
+#ifndef MSR_P4_SSU_ESCR0
+#define MSR_P4_SSU_ESCR0 0x3be
+#endif
+/* guess: not defined in manual */
+#ifndef MSR_P4_SSU_ESCR1
+#define MSR_P4_SSU_ESCR1 0x3bf
+#endif
+#ifndef MSR_P4_TBPU_ESCR0
+#define MSR_P4_TBPU_ESCR0 0x3c2
+#endif
+#ifndef MSR_P4_TBPU_ESCR1
+#define MSR_P4_TBPU_ESCR1 0x3c3
+#endif
+#ifndef MSR_P4_TC_ESCR0
+#define MSR_P4_TC_ESCR0 0x3c4
+#endif
+#ifndef MSR_P4_TC_ESCR1
+#define MSR_P4_TC_ESCR1 0x3c5
+#endif
+#ifndef MSR_P4_U2L_ESCR0
+#define MSR_P4_U2L_ESCR0 0x3b0
+#endif
+#ifndef MSR_P4_U2L_ESCR1
+#define MSR_P4_U2L_ESCR1 0x3b1
+#endif
+
+/* Hyper-Threading */
+#ifndef X86_FEATURE_HT
+#define X86_FEATURE_HT (0*32+28)
+#endif
+
+#endif /* OP_MSR_H */
diff --git a/module/x86/op_nmi.c b/module/x86/op_nmi.c
new file mode 100644
index 0000000..00e617c
--- /dev/null
+++ b/module/x86/op_nmi.c
@@ -0,0 +1,376 @@
+/**
+ * @file op_nmi.c
+ * Setup and handling of NMI PMC interrupts
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include "oprofile.h"
+#include "op_msr.h"
+#include "op_apic.h"
+#include "op_util.h"
+#include "op_x86_model.h"
+
+static struct op_msrs cpu_msrs[NR_CPUS];
+static struct op_x86_model_spec const * model = NULL;
+
+static struct op_x86_model_spec const * get_model(void)
+{
+ if (!model) {
+ /* pick out our per-model function table */
+ switch (sysctl.cpu_type) {
+ case CPU_ATHLON:
+ case CPU_HAMMER:
+ model = &op_athlon_spec;
+ break;
+ case CPU_P4:
+ model = &op_p4_spec;
+ break;
+#ifdef HT_SUPPORT
+ case CPU_P4_HT2:
+ model = &op_p4_ht2_spec;
+ break;
+#endif
+ default:
+ model = &op_ppro_spec;
+ break;
+ }
+ }
+ return model;
+}
+
+asmlinkage void op_do_nmi(struct pt_regs * regs)
+{
+ uint const cpu = op_cpu_id();
+ struct op_msrs const * const msrs = &cpu_msrs[cpu];
+
+ model->check_ctrs(cpu, msrs, regs);
+}
+
+/* ---------------- PMC setup ------------------ */
+
+static void pmc_setup_ctr(void * dummy)
+{
+ uint const cpu = op_cpu_id();
+ struct op_msrs const * const msrs = &cpu_msrs[cpu];
+ get_model()->setup_ctrs(msrs);
+}
+
+
+static int pmc_setup_all(void)
+{
+ if (smp_call_function(pmc_setup_ctr, NULL, 0, 1))
+ return -EFAULT;
+ pmc_setup_ctr(NULL);
+ return 0;
+}
+
+
+static void pmc_start(void * info)
+{
+ uint const cpu = op_cpu_id();
+ struct op_msrs const * const msrs = &cpu_msrs[cpu];
+
+ if (info && (*((uint *)info) != cpu))
+ return;
+
+ get_model()->start(msrs);
+}
+
+
+static void pmc_stop(void * info)
+{
+ uint const cpu = op_cpu_id();
+ struct op_msrs const * const msrs = &cpu_msrs[cpu];
+
+ if (info && (*((uint *)info) != cpu))
+ return;
+
+ get_model()->stop(msrs);
+}
+
+
+static void pmc_select_start(uint cpu)
+{
+ if (cpu == op_cpu_id())
+ pmc_start(NULL);
+ else
+ smp_call_function(pmc_start, &cpu, 0, 1);
+}
+
+
+static void pmc_select_stop(uint cpu)
+{
+ if (cpu == op_cpu_id())
+ pmc_stop(NULL);
+ else
+ smp_call_function(pmc_stop, &cpu, 0, 1);
+}
+
+
+static void pmc_start_all(void)
+{
+ int cpu, i;
+
+ for (cpu = 0 ; cpu < smp_num_cpus; cpu++) {
+ struct _oprof_data * data = &oprof_data[cpu];
+
+ for (i = 0 ; i < get_model()->num_counters ; ++i) {
+ if (sysctl.ctr[i].enabled)
+ data->ctr_count[i] = sysctl.ctr[i].count;
+ else
+ data->ctr_count[i] = 0;
+ }
+ }
+
+ install_nmi();
+ smp_call_function(pmc_start, NULL, 0, 1);
+ pmc_start(NULL);
+}
+
+
+static void pmc_stop_all(void)
+{
+ smp_call_function(pmc_stop, NULL, 0, 1);
+ pmc_stop(NULL);
+ restore_nmi();
+}
+
+
+static int pmc_check_params(void)
+{
+ int i;
+ int enabled = 0;
+
+ for (i = 0; i < get_model()->num_counters; i++) {
+ if (!sysctl.ctr[i].enabled)
+ continue;
+
+ enabled = 1;
+
+ if (!sysctl.ctr[i].user && !sysctl.ctr[i].kernel) {
+ printk(KERN_ERR "oprofile: neither kernel nor user "
+ "set for counter %d\n", i);
+ return -EINVAL;
+ }
+
+ if (check_range(sysctl.ctr[i].count, 1, OP_MAX_PERF_COUNT,
+ "ctr count value %d not in range (%d %ld)\n"))
+ return -EINVAL;
+
+ }
+
+ if (!enabled) {
+ printk(KERN_ERR "oprofile: no counters have been enabled.\n");
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
+
+static void free_msr_group(struct op_msr_group * group)
+{
+ if (group->addrs)
+ kfree(group->addrs);
+ if (group->saved)
+ kfree(group->saved);
+ group->addrs = NULL;
+ group->saved = NULL;
+}
+
+
+static void pmc_save_registers(void * dummy)
+{
+ uint i;
+ uint const cpu = op_cpu_id();
+ uint const nr_ctrs = get_model()->num_counters;
+ uint const nr_ctrls = get_model()->num_controls;
+ struct op_msr_group * counters = &cpu_msrs[cpu].counters;
+ struct op_msr_group * controls = &cpu_msrs[cpu].controls;
+
+ counters->addrs = NULL;
+ counters->saved = NULL;
+ controls->addrs = NULL;
+ controls->saved = NULL;
+
+ counters->addrs = kmalloc(nr_ctrs * sizeof(uint), GFP_KERNEL);
+ if (!counters->addrs)
+ goto fault;
+
+ counters->saved = kmalloc(
+ nr_ctrs * sizeof(struct op_saved_msr), GFP_KERNEL);
+ if (!counters->saved)
+ goto fault;
+
+ controls->addrs = kmalloc(nr_ctrls * sizeof(uint), GFP_KERNEL);
+ if (!controls->addrs)
+ goto fault;
+
+ controls->saved = kmalloc(
+ nr_ctrls * sizeof(struct op_saved_msr), GFP_KERNEL);
+ if (!controls->saved)
+ goto fault;
+
+ model->fill_in_addresses(&cpu_msrs[cpu]);
+
+ for (i = 0; i < nr_ctrs; ++i) {
+ rdmsr(counters->addrs[i],
+ counters->saved[i].low,
+ counters->saved[i].high);
+ }
+
+ for (i = 0; i < nr_ctrls; ++i) {
+ rdmsr(controls->addrs[i],
+ controls->saved[i].low,
+ controls->saved[i].high);
+ }
+ return;
+
+fault:
+ free_msr_group(counters);
+ free_msr_group(controls);
+}
+
+
+static void pmc_restore_registers(void * dummy)
+{
+ uint i;
+ uint const cpu = op_cpu_id();
+ uint const nr_ctrs = get_model()->num_counters;
+ uint const nr_ctrls = get_model()->num_controls;
+ struct op_msr_group * counters = &cpu_msrs[cpu].counters;
+ struct op_msr_group * controls = &cpu_msrs[cpu].controls;
+
+ if (controls->addrs) {
+ for (i = 0; i < nr_ctrls; ++i) {
+ wrmsr(controls->addrs[i],
+ controls->saved[i].low,
+ controls->saved[i].high);
+ }
+ }
+
+ if (counters->addrs) {
+ for (i = 0; i < nr_ctrs; ++i) {
+ wrmsr(counters->addrs[i],
+ counters->saved[i].low,
+ counters->saved[i].high);
+ }
+ }
+
+ free_msr_group(counters);
+ free_msr_group(controls);
+}
+
+
+static int pmc_init(void)
+{
+ int err = 0;
+
+ if ((err = smp_call_function(pmc_save_registers, NULL, 0, 1)))
+ goto out;
+
+ pmc_save_registers(NULL);
+
+ if ((err = apic_setup()))
+ goto out_restore;
+
+ if ((err = smp_call_function(lvtpc_apic_setup, NULL, 0, 1))) {
+ lvtpc_apic_restore(NULL);
+ goto out_restore;
+ }
+
+out:
+ return err;
+out_restore:
+ smp_call_function(pmc_restore_registers, NULL, 0, 1);
+ pmc_restore_registers(NULL);
+ goto out;
+}
+
+
+static void pmc_deinit(void)
+{
+ smp_call_function(lvtpc_apic_restore, NULL, 0, 1);
+ lvtpc_apic_restore(NULL);
+
+ apic_restore();
+
+ smp_call_function(pmc_restore_registers, NULL, 0, 1);
+ pmc_restore_registers(NULL);
+}
+
+
+static char * names[] = {"0", "1", "2", "3", "4", "5", "6", "7", "8"};
+
+static int pmc_add_sysctls(ctl_table * next)
+{
+ ctl_table * start = next;
+ ctl_table * tab;
+ int i, j;
+
+ /* now init the sysctls */
+ for (i=0; i < get_model()->num_counters; i++) {
+ next->ctl_name = 1;
+ next->procname = names[i];
+ next->mode = 0755;
+
+ if (!(tab = kmalloc(sizeof(ctl_table)*7, GFP_KERNEL)))
+ goto cleanup;
+
+ next->child = tab;
+
+ memset(tab, 0, sizeof(ctl_table)*7);
+ tab[0] = ((ctl_table) { 1, "enabled", &sysctl_parms.ctr[i].enabled, sizeof(int), 0644, NULL, lproc_dointvec, NULL, });
+ tab[1] = ((ctl_table) { 1, "event", &sysctl_parms.ctr[i].event, sizeof(int), 0644, NULL, lproc_dointvec, NULL, });
+ tab[2] = ((ctl_table) { 1, "count", &sysctl_parms.ctr[i].count, sizeof(int), 0644, NULL, lproc_dointvec, NULL, });
+ tab[3] = ((ctl_table) { 1, "unit_mask", &sysctl_parms.ctr[i].unit_mask, sizeof(int), 0644, NULL, lproc_dointvec, NULL, });
+ tab[4] = ((ctl_table) { 1, "kernel", &sysctl_parms.ctr[i].kernel, sizeof(int), 0644, NULL, lproc_dointvec, NULL, });
+ tab[5] = ((ctl_table) { 1, "user", &sysctl_parms.ctr[i].user, sizeof(int), 0644, NULL, lproc_dointvec, NULL, });
+ next++;
+ }
+
+ return 0;
+
+cleanup:
+ next = start;
+ for (j = 0; j < i; j++) {
+ kfree(next->child);
+ next++;
+ }
+ return -EFAULT;
+}
+
+
+static void pmc_remove_sysctls(ctl_table * next)
+{
+ int i;
+ for (i=0; i < get_model()->num_counters; i++) {
+ kfree(next->child);
+ next++;
+ }
+}
+
+
+static struct op_int_operations op_nmi_ops = {
+ init: pmc_init,
+ deinit: pmc_deinit,
+ add_sysctls: pmc_add_sysctls,
+ remove_sysctls: pmc_remove_sysctls,
+ check_params: pmc_check_params,
+ setup: pmc_setup_all,
+ start: pmc_start_all,
+ stop: pmc_stop_all,
+ start_cpu: pmc_select_start,
+ stop_cpu: pmc_select_stop,
+};
+
+
+struct op_int_operations const * op_int_interface()
+{
+ return &op_nmi_ops;
+}
diff --git a/module/x86/op_rtc.c b/module/x86/op_rtc.c
new file mode 100644
index 0000000..acc5c6f
--- /dev/null
+++ b/module/x86/op_rtc.c
@@ -0,0 +1,194 @@
+/**
+ * @file op_rtc.c
+ * Setup and handling of RTC interrupts
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Bob Montgomery
+ * @author Philippe Elie
+ * @author John Levon
+ */
+
+#include <linux/ioport.h>
+#include <linux/mc146818rtc.h>
+#include <asm/ptrace.h>
+
+#include "oprofile.h"
+#include "op_arch.h"
+#include "op_util.h"
+
+#define RTC_IO_PORTS 2
+
+/* not in 2.2 */
+#ifndef RTC_IRQ
+#define RTC_IRQ 8
+#endif
+
+/* ---------------- RTC handler ------------------ */
+
+static void do_rtc_interrupt(int irq, void * dev_id, struct pt_regs * regs)
+{
+ uint cpu = op_cpu_id();
+ unsigned char intr_flags;
+ unsigned long flags;
+
+ int usermode = user_mode(regs);
+ if ((sysctl.ctr[0].kernel && usermode)
+ || (sysctl.ctr[0].user && !usermode))
+ return;
+
+ lock_rtc(flags);
+
+ /* read and ack the interrupt */
+ intr_flags = CMOS_READ(RTC_INTR_FLAGS);
+ /* Is this my type of interrupt? */
+ if (intr_flags & RTC_PF) {
+ op_do_profile(cpu, instruction_pointer(regs), IRQ_ENABLED(regs), 0);
+ }
+
+ unlock_rtc(flags);
+
+ return;
+}
+
+static int rtc_setup(void)
+{
+ unsigned char tmp_control;
+ unsigned long flags;
+ unsigned char tmp_freq_select;
+ unsigned long target;
+ unsigned int exp, freq;
+
+ lock_rtc(flags);
+
+ /* disable periodic interrupts */
+ tmp_control = CMOS_READ(RTC_CONTROL);
+ tmp_control &= ~RTC_PIE;
+ CMOS_WRITE(tmp_control, RTC_CONTROL);
+ CMOS_READ(RTC_INTR_FLAGS);
+
+ /* Set the frequency for periodic interrupts by finding the
+ * closest power of two within the allowed range.
+ */
+
+ target = sysctl.ctr[0].count;
+
+ exp = 0;
+ while (target > (1 << exp) + ((1 << exp) >> 1))
+ exp++;
+ freq = 16 - exp;
+
+ tmp_freq_select = CMOS_READ(RTC_FREQ_SELECT);
+ tmp_freq_select = (tmp_freq_select & 0xf0) | freq;
+ CMOS_WRITE(tmp_freq_select, RTC_FREQ_SELECT);
+
+ /* Update /proc with the actual frequency. */
+ sysctl_parms.ctr[0].count = sysctl.ctr[0].count = 1 << exp;
+
+ unlock_rtc(flags);
+ return 0;
+}
+
+static void rtc_start(void)
+{
+ unsigned char tmp_control;
+ unsigned long flags;
+
+ lock_rtc(flags);
+
+ /* Enable periodic interrupts */
+ tmp_control = CMOS_READ(RTC_CONTROL);
+ tmp_control |= RTC_PIE;
+ CMOS_WRITE(tmp_control, RTC_CONTROL);
+
+ /* read the flags register to start interrupts */
+ CMOS_READ(RTC_INTR_FLAGS);
+
+ unlock_rtc(flags);
+}
+
+static void rtc_stop(void)
+{
+ unsigned char tmp_control;
+ unsigned long flags;
+
+ lock_rtc(flags);
+
+ /* disable periodic interrupts */
+ tmp_control = CMOS_READ(RTC_CONTROL);
+ tmp_control &= ~RTC_PIE;
+ CMOS_WRITE(tmp_control, RTC_CONTROL);
+ CMOS_READ(RTC_INTR_FLAGS);
+
+ unlock_rtc(flags);
+}
+
+static void rtc_start_cpu(uint cpu)
+{
+ rtc_start();
+}
+
+static void rtc_stop_cpu(uint cpu)
+{
+ rtc_stop();
+}
+
+static int rtc_check_params(void)
+{
+ int target = sysctl.ctr[0].count;
+
+ if (check_range(target, OP_MIN_RTC_COUNT, OP_MAX_RTC_COUNT,
+ "RTC value %d is out of range (%d-%d)\n"))
+ return -EINVAL;
+
+ return 0;
+}
+
+static int rtc_init(void)
+{
+ /* request_region returns 0 on **failure** */
+ if (!request_region_check(RTC_PORT(0), RTC_IO_PORTS, "oprofile")) {
+ printk(KERN_ERR "oprofile: can't get RTC I/O Ports\n");
+ return -EBUSY;
+ }
+
+ /* request_irq returns 0 on **success** */
+ if (request_irq(RTC_IRQ, do_rtc_interrupt,
+ SA_INTERRUPT, "oprofile", NULL)) {
+ printk(KERN_ERR "oprofile: IRQ%d busy \n", RTC_IRQ);
+ release_region(RTC_PORT(0), RTC_IO_PORTS);
+ return -EBUSY;
+ }
+ return 0;
+}
+
+static void rtc_deinit(void)
+{
+ free_irq(RTC_IRQ, NULL);
+ release_region(RTC_PORT(0), RTC_IO_PORTS);
+}
+
+static int rtc_add_sysctls(ctl_table * next)
+{
+ *next = ((ctl_table) { 1, "rtc_value", &sysctl_parms.ctr[0].count, sizeof(int), 0600, NULL, lproc_dointvec, NULL, });
+ return 0;
+}
+
+static void rtc_remove_sysctls(ctl_table * next)
+{
+ /* nothing to do */
+}
+
+struct op_int_operations op_rtc_ops = {
+ init: rtc_init,
+ deinit: rtc_deinit,
+ add_sysctls: rtc_add_sysctls,
+ remove_sysctls: rtc_remove_sysctls,
+ check_params: rtc_check_params,
+ setup: rtc_setup,
+ start: rtc_start,
+ stop: rtc_stop,
+ start_cpu: rtc_start_cpu,
+ stop_cpu: rtc_stop_cpu,
+};
diff --git a/module/x86/op_syscalls.c b/module/x86/op_syscalls.c
new file mode 100644
index 0000000..2fb632d
--- /dev/null
+++ b/module/x86/op_syscalls.c
@@ -0,0 +1,352 @@
+/**
+ * @file op_syscalls.c
+ * Tracing of system calls
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include <linux/sched.h>
+#include <linux/unistd.h>
+#include <linux/mman.h>
+#include <linux/file.h>
+
+#include "oprofile.h"
+
+void oprof_put_note(struct op_note * samp);
+void __oprof_put_note(struct op_note * samp);
+
+extern spinlock_t note_lock;
+
+/* ------------ system calls --------------- */
+
+struct mmap_arg_struct {
+ unsigned long addr;
+ unsigned long len;
+ unsigned long prot;
+ unsigned long flags;
+ unsigned long fd;
+ unsigned long offset;
+};
+
+asmlinkage static int (*old_sys_fork)(struct pt_regs);
+asmlinkage static int (*old_sys_vfork)(struct pt_regs);
+asmlinkage static int (*old_sys_clone)(struct pt_regs);
+asmlinkage static int (*old_sys_execve)(struct pt_regs);
+asmlinkage static int (*old_old_mmap)(struct mmap_arg_struct *);
+#ifdef HAVE_MMAP2
+asmlinkage static long (*old_sys_mmap2)(ulong, ulong, ulong, ulong, ulong, ulong);
+#endif
+asmlinkage static long (*old_sys_init_module)(char const *, struct module *);
+asmlinkage static long (*old_sys_exit)(int);
+
+/* called with note_lock held */
+static void oprof_output_map(ulong addr, ulong len, ulong offset,
+ struct file * file, int is_execve)
+{
+ struct op_note note;
+
+ /* don't bother with /dev/zero mappings etc. */
+ if (!len)
+ return;
+
+ note.pid = current->pid;
+ note.tgid = op_get_tgid();
+ note.addr = addr;
+ note.len = len;
+ note.offset = offset;
+ note.type = is_execve ? OP_EXEC : OP_MAP;
+ note.hash = hash_path(file);
+ if (note.hash == -1)
+ return;
+ /* holding note lock */
+ __oprof_put_note(&note);
+}
+
+static int oprof_output_maps(struct task_struct * task)
+{
+ int size=0;
+ struct mm_struct * mm;
+ struct vm_area_struct * map;
+
+ /* we don't need to worry about mm_users here, since there is at
+ least one user (current), and if there's other code using this
+ mm, then mm_users must be at least 2; we should never have to
+ mmput() here. */
+
+ if (!(mm = task->mm))
+ goto out;
+
+ lock_mmap(mm);
+ spin_lock(&note_lock);
+
+ /* We need two pass, daemon assume than the first mmap notification
+ * is for the executable but some process doesn't follow this model.
+ */
+ for (map = mm->mmap; map; map = map->vm_next) {
+ if (!(map->vm_flags & VM_EXEC) || !map->vm_file)
+ continue;
+ if (!(map->vm_flags & VM_EXECUTABLE))
+ continue;
+
+ oprof_output_map(map->vm_start, map->vm_end-map->vm_start,
+ GET_VM_OFFSET(map), map->vm_file, 1);
+ }
+ for (map = mm->mmap; map; map = map->vm_next) {
+ if (!(map->vm_flags & VM_EXEC) || !map->vm_file)
+ continue;
+ if (map->vm_flags & VM_EXECUTABLE)
+ continue;
+
+ oprof_output_map(map->vm_start, map->vm_end-map->vm_start,
+ GET_VM_OFFSET(map), map->vm_file, 0);
+ }
+
+ spin_unlock(&note_lock);
+ unlock_mmap(mm);
+
+out:
+ return size;
+}
+
+asmlinkage static int my_sys_execve(struct pt_regs regs)
+{
+ char * filename;
+ int ret;
+
+ MOD_INC_USE_COUNT;
+
+ lock_execve();
+
+ filename = getname((char *)regs.ebx);
+ if (IS_ERR(filename)) {
+ ret = PTR_ERR(filename);
+ goto out;
+ }
+ ret = do_execve(filename, (char **)regs.ecx, (char **)regs.edx, &regs);
+
+ if (!ret) {
+ PTRACE_OFF(current);
+ oprof_output_maps(current);
+ }
+
+ putname(filename);
+
+out:
+ unlock_execve();
+ MOD_DEC_USE_COUNT;
+ return ret;
+}
+
+static void out_mmap(ulong addr, ulong len, ulong prot, ulong flags, ulong fd,
+ ulong offset)
+{
+ struct file * file;
+
+ lock_out_mmap();
+
+ file = fget(fd);
+ if (!file)
+ goto out;
+
+ spin_lock(&note_lock);
+ oprof_output_map(addr, len, offset, file, 0);
+ spin_unlock(&note_lock);
+
+ fput(file);
+
+out:
+ unlock_out_mmap();
+}
+
+#ifdef HAVE_MMAP2
+asmlinkage static int my_sys_mmap2(ulong addr, ulong len,
+ ulong prot, ulong flags, ulong fd, ulong pgoff)
+{
+ int ret;
+
+ MOD_INC_USE_COUNT;
+
+ ret = old_sys_mmap2(addr, len, prot, flags, fd, pgoff);
+
+ if ((prot & PROT_EXEC) && ret >= 0)
+ out_mmap(ret, len, prot, flags, fd, pgoff << PAGE_SHIFT);
+
+ MOD_DEC_USE_COUNT;
+ return ret;
+}
+#endif
+
+asmlinkage static int my_old_mmap(struct mmap_arg_struct * arg)
+{
+ int ret;
+
+ MOD_INC_USE_COUNT;
+
+ ret = old_old_mmap(arg);
+
+ if (ret >= 0) {
+ struct mmap_arg_struct a;
+
+ if (copy_from_user(&a, arg, sizeof(a))) {
+ ret = -EFAULT;
+ goto out;
+ }
+
+ if (a.prot&PROT_EXEC)
+ out_mmap(ret, a.len, a.prot, a.flags, a.fd, a.offset);
+ }
+
+out:
+ MOD_DEC_USE_COUNT;
+ return ret;
+}
+
+inline static void oprof_report_fork(u32 old_pid, u32 new_pid, u32 old_tgid, u32 new_tgid)
+{
+ struct op_note note;
+
+ note.type = OP_FORK;
+ note.pid = old_pid;
+ note.tgid = old_tgid;
+ note.addr = new_pid;
+ note.len = new_tgid;
+ oprof_put_note(&note);
+}
+
+asmlinkage static int my_sys_fork(struct pt_regs regs)
+{
+ u32 pid = current->pid;
+ u32 tgid = op_get_tgid();
+ int ret;
+
+ MOD_INC_USE_COUNT;
+
+ ret = old_sys_fork(regs);
+ if (ret)
+ oprof_report_fork(pid, ret, tgid, ret);
+ MOD_DEC_USE_COUNT;
+ return ret;
+}
+
+asmlinkage static int my_sys_vfork(struct pt_regs regs)
+{
+ u32 pid = current->pid;
+ u32 tgid = op_get_tgid();
+ int ret;
+
+ MOD_INC_USE_COUNT;
+ ret = old_sys_vfork(regs);
+ if (ret)
+ oprof_report_fork(pid, ret, tgid, ret);
+ MOD_DEC_USE_COUNT;
+ return ret;
+}
+
+asmlinkage static int my_sys_clone(struct pt_regs regs)
+{
+ u32 pid = current->pid;
+ u32 tgid = op_get_tgid();
+#if V_AT_LEAST(2, 4, 0)
+ u32 clone_flags = regs.ebx;
+#endif
+ int ret;
+
+ MOD_INC_USE_COUNT;
+ ret = old_sys_clone(regs);
+ if (ret) {
+#if V_AT_LEAST(2, 4, 0)
+ if (clone_flags & CLONE_THREAD)
+ oprof_report_fork(pid, ret, tgid, tgid);
+ else
+#endif
+ oprof_report_fork(pid, ret, tgid, ret);
+ }
+ MOD_DEC_USE_COUNT;
+ return ret;
+}
+
+asmlinkage static long my_sys_init_module(char const * name_user, struct module * mod_user)
+{
+ long ret;
+
+ MOD_INC_USE_COUNT;
+
+ ret = old_sys_init_module(name_user, mod_user);
+
+ if (ret >= 0) {
+ struct op_note note;
+
+ note.type = OP_DROP_MODULES;
+ oprof_put_note(&note);
+ }
+ MOD_DEC_USE_COUNT;
+ return ret;
+}
+
+/* used from do_nmi */
+asmlinkage long my_sys_exit(int error_code)
+{
+ struct op_note note;
+
+ MOD_INC_USE_COUNT;
+
+ note.type = OP_EXIT;
+ note.pid = current->pid;
+ note.tgid = op_get_tgid();
+ oprof_put_note(&note);
+
+ /* this looks UP-dangerous, as the exit sleeps and we don't
+ * have a use count, but in fact its ok as sys_exit is noreturn,
+ * so we can never come back to this non-existent exec page
+ */
+ MOD_DEC_USE_COUNT;
+ return old_sys_exit(error_code);
+}
+
+extern void * sys_call_table[];
+
+void op_save_syscalls(void)
+{
+ old_sys_fork = sys_call_table[__NR_fork];
+ old_sys_vfork = sys_call_table[__NR_vfork];
+ old_sys_clone = sys_call_table[__NR_clone];
+ old_sys_execve = sys_call_table[__NR_execve];
+ old_old_mmap = sys_call_table[__NR_mmap];
+#ifdef HAVE_MMAP2
+ old_sys_mmap2 = sys_call_table[__NR_mmap2];
+#endif
+ old_sys_init_module = sys_call_table[__NR_init_module];
+ old_sys_exit = sys_call_table[__NR_exit];
+}
+
+void op_intercept_syscalls(void)
+{
+ sys_call_table[__NR_fork] = my_sys_fork;
+ sys_call_table[__NR_vfork] = my_sys_vfork;
+ sys_call_table[__NR_clone] = my_sys_clone;
+ sys_call_table[__NR_execve] = my_sys_execve;
+ sys_call_table[__NR_mmap] = my_old_mmap;
+#ifdef HAVE_MMAP2
+ sys_call_table[__NR_mmap2] = my_sys_mmap2;
+#endif
+ sys_call_table[__NR_init_module] = my_sys_init_module;
+ sys_call_table[__NR_exit] = my_sys_exit;
+}
+
+void op_restore_syscalls(void)
+{
+ sys_call_table[__NR_fork] = old_sys_fork;
+ sys_call_table[__NR_vfork] = old_sys_vfork;
+ sys_call_table[__NR_clone] = old_sys_clone;
+ sys_call_table[__NR_execve] = old_sys_execve;
+ sys_call_table[__NR_mmap] = old_old_mmap;
+#ifdef HAVE_MMAP2
+ sys_call_table[__NR_mmap2] = old_sys_mmap2;
+#endif
+ sys_call_table[__NR_init_module] = old_sys_init_module;
+ sys_call_table[__NR_exit] = old_sys_exit;
+}
diff --git a/module/x86/op_x86_model.h b/module/x86/op_x86_model.h
new file mode 100644
index 0000000..09a1546
--- /dev/null
+++ b/module/x86/op_x86_model.h
@@ -0,0 +1,52 @@
+/**
+ * @file op_x86_model.h
+ * interface to x86 model-specific MSR operations
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Graydon Hoare
+ */
+
+#ifndef OP_X86_MODEL_H
+#define OP_X86_MODEL_H
+
+#include "oprofile.h"
+
+struct op_saved_msr {
+ uint high;
+ uint low;
+};
+
+struct op_msr_group {
+ uint * addrs;
+ struct op_saved_msr * saved;
+};
+
+struct op_msrs {
+ struct op_msr_group counters;
+ struct op_msr_group controls;
+};
+
+struct pt_regs;
+
+struct op_x86_model_spec {
+ uint const num_counters;
+ uint const num_controls;
+ void (*fill_in_addresses)(struct op_msrs * const msrs);
+ void (*setup_ctrs)(struct op_msrs const * const msrs);
+ void (*check_ctrs)(uint const cpu,
+ struct op_msrs const * const msrs,
+ struct pt_regs * const regs);
+ void (*start)(struct op_msrs const * const msrs);
+ void (*stop)(struct op_msrs const * const msrs);
+};
+
+extern struct op_x86_model_spec const op_ppro_spec;
+extern struct op_x86_model_spec const op_athlon_spec;
+extern struct op_x86_model_spec const op_p4_spec;
+#ifdef HT_SUPPORT
+extern struct op_x86_model_spec const op_p4_ht2_spec;
+#endif
+
+#endif /* OP_X86_MODEL_H */
diff --git a/module/x86/oprofile_nmi.S b/module/x86/oprofile_nmi.S
new file mode 100644
index 0000000..d197086
--- /dev/null
+++ b/module/x86/oprofile_nmi.S
@@ -0,0 +1,63 @@
+#ifndef __ASSEMBLY__
+#define __ASSEMBLY__ /* for some 2.2 kernel */
+#endif
+#include <linux/sys.h>
+#include <linux/linkage.h>
+#include <asm/segment.h>
+#define ASSEMBLY
+#include <asm/smp.h>
+
+#define SAVE_ALL \
+ cld; \
+ pushl %es; \
+ pushl %ds; \
+ pushl %eax; \
+ pushl %ebp; \
+ pushl %edi; \
+ pushl %esi; \
+ pushl %edx; \
+ pushl %ecx; \
+ pushl %ebx; \
+ movl $(__KERNEL_DS), %edx; \
+ movl %edx, %ds; \
+ movl %edx, %es;
+
+#define RESTORE_ALL \
+ popl %ebx; \
+ popl %ecx; \
+ popl %edx; \
+ popl %esi; \
+ popl %edi; \
+ popl %ebp; \
+ popl %eax; \
+1: popl %ds; \
+2: popl %es; \
+ addl $4, %esp; \
+3: iret; \
+.section .fixup,"ax"; \
+4: movl $0, (%esp); \
+ jmp 1b; \
+5: movl $0, (%esp); \
+ jmp 2b; \
+6: pushl %ss; \
+ popl %ds; \
+ pushl %ss; \
+ popl %es; \
+ pushl $11; \
+ call my_sys_exit;\
+.previous; \
+.section __ex_table,"a";\
+ .align 4; \
+ .long 1b, 4b; \
+ .long 2b, 5b; \
+ .long 3b, 6b; \
+.previous
+
+ENTRY(op_nmi)
+ pushl %eax
+ SAVE_ALL
+ movl %esp, %edx
+ pushl %edx
+ call op_do_nmi
+ addl $4, %esp
+ RESTORE_ALL
diff --git a/opjitconv/Makefile.am b/opjitconv/Makefile.am
new file mode 100644
index 0000000..b253507
--- /dev/null
+++ b/opjitconv/Makefile.am
@@ -0,0 +1,20 @@
+AM_CPPFLAGS = -I ${top_srcdir}/libopagent -I ${top_srcdir}/libutil -I ${top_srcdir}/daemon
+AM_CFLAGS = @OP_CFLAGS@
+
+bin_PROGRAMS = opjitconv
+
+LIBS = @BFD_LIBS@
+
+needed_libs = \
+ ../libutil/libutil.a
+
+opjitconv_LDADD = $(needed_libs)
+
+opjitconv_SOURCES = \
+ opjitconv.c \
+ opjitconv.h \
+ conversion.c \
+ parse_dump.c \
+ jitsymbol.c \
+ create_bfd.c \
+ debug_line.c
diff --git a/opjitconv/Makefile.in b/opjitconv/Makefile.in
new file mode 100644
index 0000000..670aa29
--- /dev/null
+++ b/opjitconv/Makefile.in
@@ -0,0 +1,522 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+bin_PROGRAMS = opjitconv$(EXEEXT)
+subdir = opjitconv
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/binutils.m4 \
+ $(top_srcdir)/m4/builtinexpect.m4 \
+ $(top_srcdir)/m4/cellspubfdsupport.m4 \
+ $(top_srcdir)/m4/compileroption.m4 \
+ $(top_srcdir)/m4/configmodule.m4 \
+ $(top_srcdir)/m4/copyifchange.m4 $(top_srcdir)/m4/docbook.m4 \
+ $(top_srcdir)/m4/extradirs.m4 $(top_srcdir)/m4/findkernel.m4 \
+ $(top_srcdir)/m4/kerneloption.m4 \
+ $(top_srcdir)/m4/kernelversion.m4 \
+ $(top_srcdir)/m4/mallocattribute.m4 \
+ $(top_srcdir)/m4/poptconst.m4 \
+ $(top_srcdir)/m4/precompiledheader.m4 $(top_srcdir)/m4/qt.m4 \
+ $(top_srcdir)/m4/resultyn.m4 $(top_srcdir)/m4/sstream.m4 \
+ $(top_srcdir)/m4/typedef.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am_opjitconv_OBJECTS = opjitconv.$(OBJEXT) conversion.$(OBJEXT) \
+ parse_dump.$(OBJEXT) jitsymbol.$(OBJEXT) create_bfd.$(OBJEXT) \
+ debug_line.$(OBJEXT)
+opjitconv_OBJECTS = $(am_opjitconv_OBJECTS)
+am__DEPENDENCIES_1 = ../libutil/libutil.a
+opjitconv_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(opjitconv_SOURCES)
+DIST_SOURCES = $(opjitconv_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFD_LIBS = @BFD_LIBS@
+BUILD_JVMPI_AGENT_FALSE = @BUILD_JVMPI_AGENT_FALSE@
+BUILD_JVMPI_AGENT_TRUE = @BUILD_JVMPI_AGENT_TRUE@
+BUILD_JVMTI_AGENT_FALSE = @BUILD_JVMTI_AGENT_FALSE@
+BUILD_JVMTI_AGENT_TRUE = @BUILD_JVMTI_AGENT_TRUE@
+CAT_ENTRY_END = @CAT_ENTRY_END@
+CAT_ENTRY_START = @CAT_ENTRY_START@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOCBOOK_ROOT = @DOCBOOK_ROOT@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+EXTRA_CFLAGS_MODULE = @EXTRA_CFLAGS_MODULE@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAVA_HOMEDIR = @JAVA_HOMEDIR@
+KINC = @KINC@
+KSRC = @KSRC@
+KVERS = @KVERS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBERTY_LIBS = @LIBERTY_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @BFD_LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MOC = @MOC@
+MODINSTALLDIR = @MODINSTALLDIR@
+OBJEXT = @OBJEXT@
+OPROFILE_DIR = @OPROFILE_DIR@
+OPROFILE_MODULE_ARCH = @OPROFILE_MODULE_ARCH@
+OP_CFLAGS = @OP_CFLAGS@
+OP_CXXFLAGS = @OP_CXXFLAGS@
+OP_DOCDIR = @OP_DOCDIR@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POPT_LIBS = @POPT_LIBS@
+PTRDIFF_T_TYPE = @PTRDIFF_T_TYPE@
+QT_INCLUDES = @QT_INCLUDES@
+QT_LDFLAGS = @QT_LDFLAGS@
+QT_LIB = @QT_LIB@
+QT_VERSION = @QT_VERSION@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIZE_T_TYPE = @SIZE_T_TYPE@
+STRIP = @STRIP@
+UIC = @UIC@
+VERSION = @VERSION@
+XML_CATALOG = @XML_CATALOG@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+have_qt_FALSE = @have_qt_FALSE@
+have_qt_TRUE = @have_qt_TRUE@
+have_xsltproc_FALSE = @have_xsltproc_FALSE@
+have_xsltproc_TRUE = @have_xsltproc_TRUE@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+kernel_support_FALSE = @kernel_support_FALSE@
+kernel_support_TRUE = @kernel_support_TRUE@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+topdir = @topdir@
+AM_CPPFLAGS = -I ${top_srcdir}/libopagent -I ${top_srcdir}/libutil -I ${top_srcdir}/daemon
+AM_CFLAGS = @OP_CFLAGS@
+needed_libs = \
+ ../libutil/libutil.a
+
+opjitconv_LDADD = $(needed_libs)
+opjitconv_SOURCES = \
+ opjitconv.c \
+ opjitconv.h \
+ conversion.c \
+ parse_dump.c \
+ jitsymbol.c \
+ create_bfd.c \
+ debug_line.c
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign opjitconv/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign opjitconv/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ if test -f $$p \
+ || test -f $$p1 \
+ ; then \
+ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+ else :; fi; \
+ done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+ rm -f "$(DESTDIR)$(bindir)/$$f"; \
+ done
+
+clean-binPROGRAMS:
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+opjitconv$(EXEEXT): $(opjitconv_OBJECTS) $(opjitconv_DEPENDENCIES)
+ @rm -f opjitconv$(EXEEXT)
+ $(LINK) $(opjitconv_LDFLAGS) $(opjitconv_OBJECTS) $(opjitconv_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conversion.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/create_bfd.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug_line.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/jitsymbol.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opjitconv.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_dump.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+ clean-generic clean-libtool ctags distclean distclean-compile \
+ distclean-generic distclean-libtool distclean-tags distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-binPROGRAMS install-data install-data-am install-exec \
+ install-exec-am install-info install-info-am install-man \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am tags uninstall uninstall-am \
+ uninstall-binPROGRAMS uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/opjitconv/conversion.c b/opjitconv/conversion.c
new file mode 100644
index 0000000..111fe9d
--- /dev/null
+++ b/opjitconv/conversion.c
@@ -0,0 +1,92 @@
+/**
+ * @file conversion.c
+ * Convert a jit dump file to an ELF file
+ *
+ * @remark Copyright 2008 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Daniel Hansel
+ *
+ * Copyright IBM Corporation 2008
+ *
+ */
+
+#include <stdlib.h>
+
+#include "opjitconv.h"
+
+static void free_jit_records(void)
+{
+ struct jitentry * entry, * next;
+
+ for (entry = jitentry_list; entry; entry = next) {
+ if (entry->sym_name_malloced)
+ free(entry->symbol_name);
+ next = entry->next;
+ free(entry);
+ }
+ jitentry_list = NULL;
+}
+
+static void free_jit_debug_line(void)
+{
+ struct jitentry_debug_line * entry, * next;
+
+ for (entry = jitentry_debug_line_list; entry; entry = next) {
+ next = entry->next;
+ free(entry);
+ }
+ jitentry_debug_line_list = NULL;
+}
+
+int op_jit_convert(struct op_jitdump_info file_info, char const * elffile,
+ unsigned long long start_time, unsigned long long end_time)
+{
+ void const * jitdump = file_info.dmp_file;
+ int rc= OP_JIT_CONV_OK;
+
+ entry_count = 0;
+ max_entry_count = 0;
+ syms = NULL;
+ cur_bfd = NULL;
+ jitentry_list = NULL;
+ jitentry_debug_line_list = NULL;
+ entries_symbols_ascending = entries_address_ascending = NULL;
+
+ if ((rc = parse_all(jitdump, jitdump + file_info.dmp_file_stat.st_size,
+ end_time)) == OP_JIT_CONV_FAIL)
+ goto out;
+
+ create_arrays();
+ if ((rc = resolve_overlaps(start_time)) == OP_JIT_CONV_FAIL)
+ goto out;
+
+ disambiguate_symbol_names();
+ if (!entry_count)
+ return OP_JIT_CONV_NO_JIT_RECS_IN_DUMPFILE;
+
+ if ((cur_bfd = open_elf(elffile)) == NULL) {
+ rc = OP_JIT_CONV_FAIL;
+ goto out;
+ }
+
+ init_debug_line_info(cur_bfd);
+
+ if ((rc = partition_sections()) == OP_JIT_CONV_FAIL)
+ goto out;
+
+ if ((rc = fill_sections()) == OP_JIT_CONV_FAIL)
+ goto out;
+
+ finalize_debug_line_info(cur_bfd);
+
+ if (cur_bfd)
+ bfd_close(cur_bfd);
+ free(syms);
+ out: free_jit_records();
+ free_jit_debug_line();
+ free(entries_symbols_ascending);
+ free(entries_address_ascending);
+ return rc;
+}
+
diff --git a/opjitconv/create_bfd.c b/opjitconv/create_bfd.c
new file mode 100644
index 0000000..b90e59f
--- /dev/null
+++ b/opjitconv/create_bfd.c
@@ -0,0 +1,272 @@
+/**
+ * @file create_bfd.c
+ * Routine to handle elf file creation
+ *
+ * @remark Copyright 2007 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Jens Wilke
+ * @Modifications Maynard Johnson
+ * @Modifications Philippe Elie
+ * @Modifications Daniel Hansel
+ *
+ * Copyright IBM Corporation 2007
+ *
+ */
+
+#include "opjitconv.h"
+#include "opd_printf.h"
+#include "op_libiberty.h"
+
+#include <bfd.h>
+#include <stdint.h>
+#include <stdio.h>
+
+/* Create the symbols and fill the syms array for all functions
+ * from start_idx to end_idx pointing into entries_address_ascending array */
+static int fill_symtab(void)
+{
+ int rc = OP_JIT_CONV_OK;
+ u32 i;
+ int r;
+ struct jitentry const * e;
+ asymbol * s;
+ asection * section = NULL;
+
+ /* Check for valid value of entry_count to avoid integer overflow. */
+ if (entry_count > UINT32_MAX - 1) {
+ bfd_perror("invalid entry_count value");
+ rc = OP_JIT_CONV_FAIL;
+ goto out;
+ }
+
+ syms = xmalloc(sizeof(asymbol *) * (entry_count+1));
+ syms[entry_count] = NULL;
+ for (i = 0; i < entry_count; i++) {
+ e = entries_address_ascending[i];
+ if (e->section)
+ section = e->section;
+ s = bfd_make_empty_symbol(cur_bfd);
+ if (!s) {
+ bfd_perror("bfd_make_empty_symbol");
+ rc = OP_JIT_CONV_FAIL;
+ goto out;
+ }
+ s->name = e->symbol_name;
+ s->section = section;
+ s->flags = BSF_GLOBAL | BSF_FUNCTION;
+ s->value = e->vma - section->vma;
+ verbprintf(debug,"add sym: name=%s, value=%llx\n", s->name,
+ (unsigned long long)s->value);
+ syms[i] = s;
+ }
+ r = bfd_set_symtab(cur_bfd, syms, entry_count);
+ if (r == FALSE) {
+ bfd_perror("bfd_set_symtab");
+ rc = OP_JIT_CONV_FAIL;
+ }
+out:
+ return rc;
+}
+
+/*
+ * create a new section.
+ */
+asection * create_section(bfd * abfd, char const * section_name,
+ size_t size, bfd_vma vma, flagword flags)
+{
+ asection * section;
+
+ verbprintf(debug, "create_section() %s\n", section_name);
+ section = bfd_make_section(abfd, section_name);
+ if (section == NULL) {
+ bfd_perror("bfd_make_section");
+ goto error;
+ }
+ if (bfd_set_section_vma(abfd, section, vma) == FALSE) {
+ bfd_perror("bfd_set_section_vma");
+ goto error;
+ }
+ if (bfd_set_section_size(abfd, section, size) == FALSE) {
+ bfd_perror("bfd_set_section_size");
+ goto error;
+ }
+ if (bfd_set_section_flags(abfd, section, flags) == FALSE) {
+ bfd_perror("bfd_set_section_flags");
+ goto error;
+ }
+ return section;
+error:
+ return NULL;
+}
+
+
+/* create a .text section. end_idx: index last jitentry (inclusive!) */
+static int create_text_section(int start_idx, int end_idx)
+{
+ int rc = OP_JIT_CONV_OK;
+
+ asection * section;
+ char const * section_name;
+ int idx = start_idx;
+ unsigned long long vma_start =
+ entries_address_ascending[start_idx]->vma;
+ struct jitentry * ee = entries_address_ascending[end_idx];
+ unsigned long long vma_end = ee->vma + ee->code_size;
+ int size = vma_end - vma_start;
+
+ section_name = bfd_get_unique_section_name(cur_bfd, ".text", &idx);
+ verbprintf(debug, "section idx=%i, name=%s, vma_start=%llx, size=%i\n",
+ idx, section_name, vma_start, size);
+
+ section = create_section(cur_bfd, section_name, size, vma_start,
+ SEC_ALLOC|SEC_LOAD|SEC_READONLY|SEC_CODE|SEC_HAS_CONTENTS);
+ if (section)
+ entries_address_ascending[start_idx]->section = section;
+ else
+ rc = OP_JIT_CONV_FAIL;
+
+ return rc;
+}
+
+/* fill a section contents at a given offset from the start of the section */
+int fill_section_content(bfd * abfd, asection * section,
+ void const * b, file_ptr offset, size_t sz)
+{
+ if (bfd_set_section_contents(abfd, section, b, offset, sz) == FALSE) {
+ bfd_perror("bfd_set_section_contents");
+ return OP_JIT_CONV_FAIL;
+ }
+ return OP_JIT_CONV_OK;
+}
+
+/*
+ * Copy all code of the functions that are within start_idx and end_idx to
+ * the section.
+ */
+static int fill_text_section_content(asection * section, int start_idx,
+ int end_idx)
+{
+ int rc = OP_JIT_CONV_OK;
+ unsigned long long vma_start =
+ entries_address_ascending[start_idx]->vma;
+ struct jitentry const * e;
+ int i;
+
+ for (i = start_idx; i <= end_idx; i++) {
+ e = entries_address_ascending[i];
+ verbprintf(debug, "section = %s, i = %i, code = %llx,"
+ " vma = %llx, offset = %llx,"
+ "size = %i, name = %s\n",
+ section->name, i,
+ (unsigned long long) (uintptr_t) e->code,
+ e->vma, e->vma - vma_start,
+ e->code_size, e->symbol_name);
+ /* the right part that is created by split_entry may
+ * have no code; also, the agent may have passed NULL
+ * for the code location.
+ */
+ if (e->code) {
+ rc = fill_section_content(cur_bfd, section,
+ e->code, (file_ptr) (e->vma - vma_start),
+ (bfd_size_type)e->code_size);
+ if (rc != OP_JIT_CONV_OK)
+ break;
+ }
+ }
+ return rc;
+}
+
+
+/* Walk over the symbols sorted by address and create ELF sections. Whenever we
+ * have a gap greater or equal to 4096 make a new section.
+ */
+int partition_sections(void)
+{
+ int rc = OP_JIT_CONV_OK;
+ u32 i, j;
+ struct jitentry const * pred;
+ struct jitentry const * entry;
+ unsigned long long end_addr;
+
+ // i: start index of the section
+ i = 0;
+ for (j = 1; j < entry_count; j++) {
+ entry = entries_address_ascending[j];
+ pred = entries_address_ascending[j - 1];
+ end_addr = pred->vma + pred->code_size;
+ // calculate gap between code, if it is more than one page
+ // create an additional section
+ if ((entry->vma - end_addr) >= 4096) {
+ rc = create_text_section(i, j - 1);
+ if (rc == OP_JIT_CONV_FAIL)
+ goto out;
+ i = j;
+ }
+ }
+ // this holds always if we have at least one jitentry
+ if (i < entry_count)
+ rc = create_text_section(i, entry_count - 1);
+out:
+ return rc;
+}
+
+
+/* Fill the code content into the sections created by partition_sections() */
+int fill_sections(void)
+{
+ int rc = OP_JIT_CONV_OK;
+ u32 i, j;
+ asection * section;
+
+ rc = fill_symtab();
+ if (rc == OP_JIT_CONV_FAIL)
+ goto out;
+
+ verbprintf(debug, "opjitconv: fill_sections\n");
+ i = 0;
+ for (j = 1; j < entry_count; j++) {
+ if (entries_address_ascending[j]->section) {
+ section = entries_address_ascending[i]->section;
+ rc = fill_text_section_content(section, i,
+ j - 1);
+ if (rc == OP_JIT_CONV_FAIL)
+ goto out;
+ i = j;
+ }
+ }
+ // this holds always if we have at least one jitentry
+ if (i < entry_count) {
+ section = entries_address_ascending[i]->section;
+ rc = fill_text_section_content(section,
+ i, entry_count - 1);
+ }
+out:
+ return rc;
+}
+
+
+/* create the elf file */
+bfd * open_elf(char const * filename)
+{
+ bfd * abfd;
+
+ abfd = bfd_openw(filename, dump_bfd_target_name);
+ if (!abfd) {
+ bfd_perror("bfd_openw");
+ goto error1;
+ }
+ if (bfd_set_format(abfd, bfd_object) == FALSE) {
+ bfd_perror("bfd_set_format");
+ goto error;
+ }
+ if (bfd_set_arch_mach(abfd, dump_bfd_arch, dump_bfd_mach) == FALSE) {
+ bfd_perror("bfd_set_format");
+ goto error;
+ }
+ return abfd;
+error:
+ bfd_close(abfd);
+error1:
+ return NULL;
+}
diff --git a/opjitconv/debug_line.c b/opjitconv/debug_line.c
new file mode 100644
index 0000000..d7db8ec
--- /dev/null
+++ b/opjitconv/debug_line.c
@@ -0,0 +1,526 @@
+/**
+ * @file debug_line.c
+ * DWARF 2 debug line info creation helper
+ *
+ * @remark Copyright 2007 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ */
+
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <bfd.h>
+#include <limits.h>
+
+#include "opjitconv.h"
+#include "jitdump.h"
+#include "opagent.h"
+#include "op_libiberty.h"
+#include "op_growable_buffer.h"
+
+/*
+ * Terminology comes from the TIS DWARF Debugging Information Format
+ * version 2.0
+ */
+
+typedef uint32_t uword;
+typedef uint16_t uhalf;
+typedef int32_t sword;
+typedef int16_t shalf;
+typedef uint8_t ubyte;
+typedef int8_t sbyte;
+
+/*
+ * Many of the following enum are incomplete and define only the subset
+ * of DWARF we use.
+ */
+enum lns_opcode {
+ DW_LNS_copy=1,
+ DW_LNS_advance_pc,
+ DW_LNS_advance_line,
+ DW_LNS_set_file,
+ DW_LNS_set_column,
+ DW_LNS_negate_stmt,
+ DW_LNS_set_basic_block,
+ DW_LNS_const_add_pc,
+ DW_LNS_fixed_advance_pc,
+
+ /* Adding new opcode needs an update of the standard_opcode_length
+ * array */
+
+ DW_LNS_max_opcode,
+};
+
+enum lne_opcode {
+ DW_LNE_end_sequence = 1,
+ DW_LNE_set_address,
+ DW_LNE_define_file
+};
+
+enum dw_tag {
+ DW_TAG_compile_unit = 0x11,
+};
+
+enum dw_at {
+ DW_AT_name = 0x03,
+ DW_AT_stmt_list = 0x10,
+ DW_AT_low_pc,
+ DW_AT_high_pc,
+ DW_AT_language,
+ DW_AT_compdir = 0x1b,
+ DW_AT_producer = 0x25,
+};
+
+enum dw_children {
+ DW_CHILDREN_no,
+ DW_CHILDREN_yes
+};
+
+enum dw_form {
+ DW_FORM_data4 = 0x06,
+};
+
+struct debug_line_header {
+ // Not counting this field
+ uword total_length;
+ // version number (2 currently)
+ uhalf version;
+ // relative offset from next field to
+ // program statement
+ uword prolog_length;
+ ubyte minimum_instruction_length;
+ ubyte default_is_stmt;
+ // line_base - see DWARF 2 specs
+ sbyte line_base;
+ // line_range - see DWARF 2 specs
+ ubyte line_range;
+ // number of opcode + 1
+ ubyte opcode_base;
+ /* follow the array of opcode args nr: ubytes [nr_opcode_base] */
+ /* follow the search directories index, zero terminated string
+ * terminated by an empty string.
+ */
+ /* follow an array of { filename, LEB128, LEB128, LEB128 }, first is
+ * the directory index entry, 0 means current directory, then mtime
+ * and filesize, last entry is followed by en empty string.
+ */
+ /* follow the first program statement */
+} __attribute__((packed));
+
+/* DWARF 2 spec talk only about one possible compilation unit header while
+ * binutils can handle two flavours of dwarf 2, 32 and 64 bits, this is not
+ * related to the used arch, an ELF 32 can hold more than 4 Go of debug
+ * information. For now we handle only DWARF 2 32 bits comp unit. It'll only
+ * become a problem if we generate more than 4GB of debug information.
+ */
+struct compilation_unit_header {
+ uword total_length;
+ uhalf version;
+ uword debug_abbrev_offset;
+ ubyte pointer_size;
+} __attribute__((packed));
+
+/* field filled at run time are marked with -1 */
+static struct debug_line_header const default_debug_line_header = {
+ -1,
+ 2,
+ -1,
+ 1, /* could be better when min instruction size != 1 */
+ 1, /* we don't take care about basic block */
+ -5, /* sensible value for line base ... */
+ 14, /* ... and line range are guessed statically */
+ DW_LNS_max_opcode
+};
+
+static ubyte const standard_opcode_length[DW_LNS_max_opcode - 1] =
+{
+ 0, 1, 1, 1, 1, 0, 0, 0, 1
+};
+
+/* field filled at run time are marked with -1 */
+static struct compilation_unit_header const default_comp_unit_header = {
+ -1,
+ 2,
+ 0, /* we reuse the same abbrev entries for all comp unit */
+ -1
+};
+
+
+static void emit_uword(struct growable_buffer * b, uword data)
+{
+ add_data(b, &data, sizeof(uword));
+}
+
+
+static void emit_string(struct growable_buffer * b, char const * s)
+{
+ add_data(b, s, strlen(s) + 1);
+}
+
+
+static void emit_unsigned_LEB128(struct growable_buffer * b,
+ unsigned long data)
+{
+ do {
+ ubyte cur = data & 0x7F;
+ data >>= 7;
+ if (data)
+ cur |= 0x80;
+ add_data(b, &cur, 1);
+ } while (data);
+}
+
+
+static void emit_signed_LEB128(struct growable_buffer * b, long data)
+{
+ int more = 1;
+ int negative = data < 0;
+ int size = sizeof(long) * CHAR_BIT;
+ while (more) {
+ ubyte cur = data & 0x7F;
+ data >>= 7;
+ if (negative)
+ data |= - (1 << (size - 7));
+ if ((data == 0 && !(cur & 0x40)) ||
+ (data == -1l && (cur & 0x40)))
+ more = 0;
+ else
+ cur |= 0x80;
+ add_data(b, &cur, 1);
+ }
+}
+
+
+static void emit_extended_opcode(struct growable_buffer * b, ubyte opcode,
+ void * data, size_t data_len)
+{
+ add_data(b, "", 1);
+ emit_unsigned_LEB128(b, data_len + 1);
+ add_data(b, &opcode, 1);
+ add_data(b, data, data_len);
+}
+
+
+static void emit_opcode(struct growable_buffer * b, ubyte opcode)
+{
+ add_data(b, &opcode, 1);
+}
+
+
+static void emit_opcode_signed(struct growable_buffer * b,
+ ubyte opcode, long data)
+{
+ add_data(b, &opcode, 1);
+ emit_signed_LEB128(b, data);
+}
+
+
+static void emit_opcode_unsigned(struct growable_buffer * b, ubyte opcode,
+ unsigned long data)
+{
+ add_data(b, &opcode, 1);
+ emit_unsigned_LEB128(b, data);
+}
+
+
+static void emit_advance_pc(struct growable_buffer * b, unsigned long delta_pc)
+{
+ emit_opcode_unsigned(b, DW_LNS_advance_pc, delta_pc);
+}
+
+
+static void emit_advance_lineno(struct growable_buffer * b, long delta_lineno)
+{
+ emit_opcode_signed(b, DW_LNS_advance_line, delta_lineno);
+}
+
+
+static void emit_lne_end_of_sequence(struct growable_buffer * b)
+{
+ emit_extended_opcode(b, DW_LNE_end_sequence, NULL, 0);
+}
+
+
+static void emit_set_file(struct growable_buffer * b, unsigned long index)
+{
+ emit_opcode_unsigned(b, DW_LNS_set_file, index);
+}
+
+
+static void emit_lne_define_filename(struct growable_buffer * b,
+ char const * filename)
+{
+ /* emit_extended_opcode() can't be used here, we have additional
+ * data to output and the len field will be miscalculated. */
+ add_data(b, "", 1);
+ /* strlen(filename) + zero terminator + len field + 3 bytes for the dir
+ * entry, timestamp and filesize */
+ emit_unsigned_LEB128(b, strlen(filename) + 5);
+ emit_opcode(b, DW_LNE_define_file);
+ emit_string(b, filename);
+ add_data(b, "\0\0\0", 3);
+}
+
+
+static void emit_lne_set_address(struct growable_buffer * b,
+ void const * address)
+{
+ emit_extended_opcode(b, DW_LNE_set_address, &address, sizeof(address));
+}
+
+
+static ubyte get_special_opcode(struct debug_line_info const * line,
+ unsigned int last_lineno, unsigned long last_vma)
+{
+ unsigned int temp;
+ unsigned long delta_addr;
+
+ /* See TIS DWARF Debugging Information Format version 2.0 § 6.2.5.1 */
+
+ temp = (line->lineno - last_lineno) -
+ default_debug_line_header.line_base;
+ if (temp >= default_debug_line_header.line_range)
+ return 0;
+
+ delta_addr = (line->vma - last_vma) /
+ default_debug_line_header.minimum_instruction_length;
+ /* This is not sufficient to ensure opcode will be in [0-256] but
+ * sufficient to ensure when summing with the delta lineno we will
+ * not overflow the unsigned long opcode */
+ if (delta_addr <= 256 / default_debug_line_header.line_range) {
+ unsigned long opcode = temp +
+ (delta_addr * default_debug_line_header.line_range) +
+ default_debug_line_header.opcode_base;
+
+ return opcode <= 255 ? opcode : 0;
+ }
+
+ return 0;
+}
+
+
+static void emit_lineno_info(struct growable_buffer * b,
+ struct debug_line_info const * line, size_t nr_entry,
+ unsigned long code_addr)
+{
+ size_t i;
+
+ /*
+ * Machine state at start of a statement program
+ * address = 0
+ * file = 1
+ * line = 1
+ * column = 0
+ * is_stmt = default_is_stmt as given in the debug_line_header
+ * basic block = 0
+ * end sequence = 0
+ */
+
+ /* start state of the state machine we take care of */
+ unsigned long last_vma = code_addr;
+ unsigned int last_lineno = 1;
+ char const * cur_filename = NULL;
+ unsigned long cur_file_index = 0;
+
+ /* FIXME: relocatable address? */
+ emit_lne_set_address(b, (void const *)code_addr);
+ emit_advance_lineno(b, line[0].lineno - last_lineno);
+ last_lineno = line[0].lineno;
+ emit_lne_define_filename(b, line[0].filename);
+ cur_filename = line[0].filename;
+ emit_set_file(b, ++cur_file_index);
+ emit_opcode(b, DW_LNS_copy);
+
+
+ for (i = 0; i < nr_entry; i++) {
+ int need_copy = 0;
+ ubyte special_opcode;
+
+ if (!cur_filename || strcmp(cur_filename, line[i].filename)) {
+ emit_lne_define_filename(b, line[i].filename);
+ cur_filename = line[i].filename;
+ emit_set_file(b, ++cur_file_index);
+ need_copy = 1;
+ }
+ if ((special_opcode = get_special_opcode(&line[i],
+ last_lineno, last_vma)) != 0) {
+ last_lineno = line[i].lineno;
+ last_vma = line[i].vma;
+ emit_opcode(b, special_opcode);
+ } else {
+ if (last_lineno != line[i].lineno) {
+ emit_advance_lineno(b,
+ line[i].lineno - last_lineno);
+ last_lineno = line[i].lineno;
+ need_copy = 1;
+ }
+ if (last_vma != line[i].vma) {
+ emit_advance_pc(b, line[i].vma - last_vma);
+ last_vma = line[i].vma;
+ need_copy = 1;
+ }
+ if (need_copy)
+ emit_opcode(b, DW_LNS_copy);
+ }
+ }
+}
+
+
+static void add_debug_line(struct growable_buffer * b,
+ struct debug_line_info const * line, size_t nr_entry,
+ unsigned long code_addr)
+{
+ struct debug_line_header * dbg_header;
+ size_t old_size;
+
+ old_size = b->size;
+
+ add_data(b, &default_debug_line_header,
+ sizeof(default_debug_line_header));
+ add_data(b, &standard_opcode_length, sizeof(standard_opcode_length));
+
+ // empty directory entry
+ add_data(b, "", 1);
+
+ // empty filename directory
+ add_data(b, "", 1);
+
+ dbg_header = b->p + old_size;
+ dbg_header->prolog_length = (b->size - old_size) -
+ offsetof(struct debug_line_header, minimum_instruction_length);
+
+ emit_lineno_info(b, line, nr_entry, code_addr);
+
+ emit_lne_end_of_sequence(b);
+
+ dbg_header = b->p + old_size;
+ dbg_header->total_length = (b->size - old_size) -
+ offsetof(struct debug_line_header, version);
+}
+
+
+static void add_compilation_unit(struct growable_buffer * b,
+ size_t offset_debug_line)
+{
+ struct compilation_unit_header * comp_unit_header;
+
+ size_t old_size = b->size;
+
+ add_data(b, &default_comp_unit_header,
+ sizeof(default_comp_unit_header));
+
+ emit_unsigned_LEB128(b, 1);
+ emit_uword(b, offset_debug_line);
+
+ comp_unit_header = b->p + old_size;
+ comp_unit_header->total_length = (b->size - old_size) -
+ offsetof(struct compilation_unit_header, version);
+ comp_unit_header->pointer_size = sizeof(void *);
+}
+
+
+static void create_debug_abbrev(struct growable_buffer * b)
+{
+ emit_unsigned_LEB128(b, 1);
+ emit_unsigned_LEB128(b, DW_TAG_compile_unit);
+ emit_unsigned_LEB128(b, DW_CHILDREN_yes);
+ emit_unsigned_LEB128(b, DW_AT_stmt_list);
+ emit_unsigned_LEB128(b, DW_FORM_data4);
+ emit_unsigned_LEB128(b, 0);
+}
+
+static struct growable_buffer b_line;
+static struct growable_buffer b_debug_info;
+static struct growable_buffer b_debug_abbrev;
+
+int init_debug_line_info(bfd * abfd)
+{
+ asection * line_section, * debug_info, * debug_abbrev;
+ struct jitentry_debug_line * debug_line;
+
+ init_buffer(&b_line);
+ init_buffer(&b_debug_info);
+ init_buffer(&b_debug_abbrev);
+
+ for (debug_line = jitentry_debug_line_list;
+ debug_line;
+ debug_line = debug_line->next) {
+ struct jr_code_debug_info const * rec = debug_line->data;
+ if (rec->nr_entry) {
+ size_t i;
+ void const * data = rec + 1;
+ struct debug_line_info * dbg_line =
+ xmalloc(rec->nr_entry *
+ sizeof(struct debug_line_info));
+ for (i = 0; i < rec->nr_entry; ++i) {
+ dbg_line[i].vma = *(unsigned long *)data;
+ data += sizeof(unsigned long);
+ dbg_line[i].lineno = *(unsigned int *)data;
+ data += sizeof(unsigned int);
+ dbg_line[i].filename = data;
+ data += strlen(data) + 1;
+ }
+
+ add_compilation_unit(&b_debug_info, b_line.size);
+ add_debug_line(&b_line, dbg_line,
+ rec->nr_entry, rec->code_addr);
+ create_debug_abbrev(&b_debug_abbrev);
+
+ free(dbg_line);
+ }
+ }
+
+ line_section = create_section(abfd, ".debug_line", b_line.size, 0,
+ SEC_HAS_CONTENTS|SEC_READONLY|SEC_DEBUGGING);
+ if (!line_section)
+ return -1;
+
+ debug_info = create_section(abfd, ".debug_info", b_debug_info.size, 0,
+ SEC_HAS_CONTENTS|SEC_READONLY|SEC_DEBUGGING);
+ if (!debug_info)
+ return -1;
+
+ debug_abbrev = create_section(abfd, ".debug_abbrev",
+ b_debug_abbrev.size, 0,
+ SEC_HAS_CONTENTS|SEC_READONLY|SEC_DEBUGGING);
+ if (!debug_abbrev)
+ return -1;
+
+ return 0;
+}
+
+
+int finalize_debug_line_info(bfd * abfd)
+{
+ asection * line_section, * debug_info, * debug_abbrev;
+
+ line_section = bfd_get_section_by_name(abfd, ".debug_line");
+ if (!line_section)
+ return -1;
+
+ debug_info = bfd_get_section_by_name(abfd, ".debug_info");
+ if (!debug_info)
+ return -1;
+
+
+ debug_abbrev = bfd_get_section_by_name(abfd, ".debug_abbrev");
+ if (!debug_abbrev)
+ return -1;
+
+ fill_section_content(abfd, line_section, b_line.p, 0, b_line.size);
+ fill_section_content(abfd, debug_info, b_debug_info.p,
+ 0, b_debug_info.size);
+ fill_section_content(abfd, debug_abbrev, b_debug_abbrev.p, 0,
+ b_debug_abbrev.size);
+
+
+ free_buffer(&b_line);
+ free_buffer(&b_debug_info);
+ free_buffer(&b_debug_abbrev);
+
+ return 0;
+}
diff --git a/opjitconv/jitsymbol.c b/opjitconv/jitsymbol.c
new file mode 100644
index 0000000..1aa6db1
--- /dev/null
+++ b/opjitconv/jitsymbol.c
@@ -0,0 +1,555 @@
+/**
+ * @file jitsymbol.c
+ * Handle symbols found in jitted code dump
+ *
+ * @remark Copyright 2007 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Jens Wilke
+ * @Modifications Maynard Johnson
+ * @Modifications Philippe Elie
+ * @Modifications Daniel Hansel
+ *
+ * Copyright IBM Corporation 2007
+ *
+ */
+
+#include "opjitconv.h"
+#include "opd_printf.h"
+#include "op_libiberty.h"
+#include "op_types.h"
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <limits.h>
+
+typedef int (*compare_symbol)(void const *, void const *);
+
+
+/* count the entries in the jitentry_list */
+static u32 count_entries(void)
+{
+ struct jitentry const * entry;
+ u32 cnt = 0;
+ for (entry = jitentry_list; entry; entry = entry->next)
+ cnt++;
+ return cnt;
+}
+
+
+static void fill_entry_array(struct jitentry * entries[])
+{
+ int i = 0;
+ struct jitentry * entry;
+ for (entry = jitentry_list; entry; entry = entry->next)
+ entries[i++] = entry;
+}
+
+
+/* create an array pointing to the jitentry structures which is sorted
+ * according to the comparator rule given by parameter compar
+ */
+static struct jitentry ** create_sorted_array(compare_symbol compare)
+{
+ struct jitentry ** array =
+ xmalloc(sizeof(struct jitentry *) * entry_count);
+ fill_entry_array(array);
+ qsort(array, entry_count, sizeof(struct jitentry *), compare);
+ return array;
+}
+
+
+/* comparator method for qsort which sorts jitentries by symbol_name */
+static int cmp_symbolname(void const * a, void const * b)
+{
+ struct jitentry * a0 = *(struct jitentry **) a;
+ struct jitentry * b0 = *(struct jitentry **) b;
+ return strcmp(a0->symbol_name, b0->symbol_name);
+}
+
+
+/* comparator method for qsort which sorts jitentries by address */
+static int cmp_address(void const * a, void const * b)
+{
+ struct jitentry * a0 = *(struct jitentry **) a;
+ struct jitentry * b0 = *(struct jitentry **) b;
+ if (a0->vma < b0->vma)
+ return -1;
+ if (a0->vma == b0->vma)
+ return 0;
+ return 1;
+}
+
+
+/* resort address_ascending array */
+static void resort_address(void)
+{
+ u32 i;
+
+ qsort(entries_address_ascending, entry_count,
+ sizeof(struct jitentry *), cmp_address);
+
+ // lower entry_count if entries are invalidated
+ for (i = 0; i < entry_count; ++i) {
+ if (entries_address_ascending[i]->vma)
+ break;
+ }
+
+ if (i) {
+ entry_count -= i;
+ memmove(&entries_address_ascending[0],
+ &entries_address_ascending[i],
+ sizeof(struct jitentry *) * entry_count);
+ }
+}
+
+
+/* Copy address_ascending array to entries_symbols_ascending and resort it. */
+static void resort_symbol(void)
+{
+ memcpy(entries_symbols_ascending, entries_address_ascending,
+ sizeof(struct jitentry *) * entry_count);
+ qsort(entries_symbols_ascending, entry_count,
+ sizeof(struct jitentry *), cmp_symbolname);
+}
+
+/* allocate, populate and sort the jitentry arrays */
+void create_arrays(void)
+{
+ max_entry_count = entry_count = count_entries();
+ entries_symbols_ascending = create_sorted_array(cmp_symbolname);
+ entries_address_ascending = create_sorted_array(cmp_address);
+}
+
+
+/* add a new create jitentry to the array. mallocs new arrays if space is
+ * needed */
+static void insert_entry(struct jitentry * entry)
+{
+ if (entry_count == max_entry_count) {
+ if (max_entry_count < UINT32_MAX - 18)
+ max_entry_count += 18;
+ else if (max_entry_count < UINT32_MAX)
+ max_entry_count += 1;
+ else {
+ fprintf(stderr, "Amount of JIT dump file entries is too large.\n");
+ exit(EXIT_FAILURE);
+ }
+ entries_symbols_ascending = (struct jitentry **)
+ xrealloc(entries_symbols_ascending,
+ sizeof(struct jitentry *) * max_entry_count);
+ entries_address_ascending = (struct jitentry **)
+ xrealloc(entries_address_ascending,
+ sizeof(struct jitentry *) * max_entry_count);
+ }
+ entries_address_ascending[entry_count++] = entry;
+}
+
+
+/* add a suffix to the name to differenciate it */
+static char * replacement_name(char * s, int i)
+{
+ int cnt = 1;
+ int j = i;
+ char * res;
+
+ while ((j = j/10))
+ cnt++;
+ cnt += 2 + strlen(s);
+ res = xmalloc(cnt);
+ snprintf(res, cnt, "%s~%i", s, i);
+ return res;
+}
+
+
+/*
+ * Mark the entry so it is not included in the ELF file. We do this by
+ * writing a 0 address as magic vma and sorting
+ * it out later
+ */
+static void invalidate_entry(struct jitentry * e)
+{
+ verbprintf(debug, "invalidate_entry: addr=%llx, name=%s\n",
+ e->vma, e->symbol_name);
+ e->vma = 0;
+}
+
+
+/*
+ * Invalidate all symbols that are not alive at sampling start time.
+ */
+static void invalidate_earlybirds(unsigned long long start_time)
+{
+ u32 i;
+ int flag;
+ struct jitentry * a;
+
+ flag = 0;
+ for (i = 0; i < entry_count; i++) {
+ a = entries_address_ascending[i];
+ if (a->life_end < start_time) {
+ invalidate_entry(a);
+ flag = 1;
+ }
+ }
+ if (flag) {
+ resort_address();
+ resort_symbol();
+ }
+}
+
+
+/* select the symbol with the longest life time in the index range */
+static int select_one(int start_idx, int end_idx)
+{
+ int i;
+ int candidate = OP_JIT_CONV_FAIL;
+ unsigned long long lifetime = 0;
+ unsigned long long x;
+ struct jitentry const * e;
+
+ for (i = start_idx; i <= end_idx; i++) {
+ e = entries_address_ascending[i];
+ x = e->life_end - e->life_start;
+ if (candidate == -1 || x > lifetime) {
+ candidate = i;
+ lifetime = x;
+ }
+ }
+ return candidate;
+}
+
+
+/*
+ * We decided to keep one entry in favor of the other. Instead of dropping
+ * the overlapping entry we split or truncate it to not overlap any more.
+ *
+ * Looking on the address regions, we may have the following situation:
+ *
+ * split: |------------|
+ * keep: |---|
+ *
+ * The split entry may be splitted in a left part and a right part. E.g.:
+ *
+ * split0/1: |--| |---|
+ * keep: |---|
+ *
+ * However, both parts may or may not exist.
+ */
+static void split_entry(struct jitentry * split, struct jitentry const * keep)
+{
+ unsigned long long start_addr_keep = keep->vma;
+ unsigned long long end_addr_keep = keep->vma + keep->code_size;
+ unsigned long long end_addr_split = split->vma + split->code_size;
+ unsigned long long start_addr_split = split->vma;
+
+ // do we need a right part?
+ if (end_addr_split > end_addr_keep) {
+ struct jitentry * new_entry =
+ xcalloc(1, sizeof(struct jitentry));
+ char * s = NULL;
+
+ /* Check for max. length to avoid possible integer overflow. */
+ if (strlen(split->symbol_name) > SIZE_MAX - 3) {
+ fprintf(stderr, "Length of symbol name is too large.\n");
+ exit(EXIT_FAILURE);
+ } else {
+ s = xmalloc(strlen(split->symbol_name) + 3);
+ strcpy(s, split->symbol_name);
+ strcat(s, "#1");
+ }
+
+ new_entry->vma = end_addr_keep;
+ new_entry->code_size = end_addr_split - end_addr_keep;
+ new_entry->symbol_name = s;
+ new_entry->sym_name_malloced = 1;
+ new_entry->life_start = split->life_start;
+ new_entry->life_end = split->life_end;
+ // the right part does not have an associated code, because we
+ // don't know whether the split part begins at an opcode
+ new_entry->code = NULL;
+ verbprintf(debug, "split right (new) name=%s, start=%llx,"
+ " end=%llx\n", new_entry->symbol_name,
+ new_entry->vma,
+ new_entry->vma + new_entry->code_size);
+ insert_entry(new_entry);
+ }
+ // do we need a left part?
+ if (start_addr_split < start_addr_keep) {
+ char * s = NULL;
+
+ /* Check for max. length to avoid possible integer overflow. */
+ if (strlen(split->symbol_name) > SIZE_MAX - 3) {
+ fprintf(stderr, "Length of symbol name is too large.\n");
+ exit(EXIT_FAILURE);
+ } else {
+ s = xmalloc(strlen(split->symbol_name) + 3);
+ strcpy(s, split->symbol_name);
+ strcat(s, "#0");
+ }
+
+ split->code_size = start_addr_keep - start_addr_split;
+ if (split->sym_name_malloced)
+ free(split->symbol_name);
+ split->symbol_name = s;
+ split->sym_name_malloced = 1;
+ verbprintf(debug, "split left name=%s, start=%llx, end=%llx\n",
+ split->symbol_name, split->vma,
+ split->vma + split->code_size);
+ } else {
+ invalidate_entry(split);
+ }
+}
+
+
+/*
+ * Scans through the index range and splits/truncates entries that overlap
+ * with the one indexed by keep_idx. Returns the total lifetime of the symbols
+ * found to overlap.
+ * Returns ULONG_MAX on error.
+ */
+static unsigned long long eliminate_overlaps(int start_idx, int end_idx,
+ int keep_idx)
+{
+ unsigned long long retval;
+ struct jitentry const * keep = entries_address_ascending[keep_idx];
+ struct jitentry * e;
+ unsigned long long start_addr_keep = keep->vma;
+ unsigned long long end_addr_keep = keep->vma + keep->code_size;
+ unsigned long long start_addr_entry, end_addr_entry;
+ int i;
+ unsigned long long min_start = keep->life_start;
+ unsigned long long max_end = keep->life_end;
+
+ for (i = start_idx; i <= end_idx; i++) {
+ if (i == keep_idx)
+ continue;
+ e = entries_address_ascending[i];
+ start_addr_entry = e->vma;
+ end_addr_entry = e->vma + e->code_size;
+ if (debug) {
+ if (!(start_addr_entry <= end_addr_entry)) {
+ verbprintf(debug, "assert failed:"
+ " start_addr_entry <="
+ " end_addr_entry\n");
+ retval = ULONG_MAX;
+ goto out;
+ }
+ if (!(start_addr_keep <= end_addr_keep)) {
+ verbprintf(debug, "assert failed: "
+ "start_addr_keep <="
+ " end_addr_keep\n");
+ retval = ULONG_MAX;
+ goto out;
+ }
+ }
+ if (start_addr_entry < end_addr_keep &&
+ end_addr_entry > start_addr_keep) {
+ if (e->life_start < min_start)
+ min_start = e->life_start;
+ if (e->life_end > max_end)
+ max_end = e->life_end;
+ split_entry(e, keep);
+ }
+ }
+ retval = max_end - min_start;
+out:
+ return retval;
+}
+
+
+/*
+ * Within the index range (into the array entries_address_ascending), find the
+ * symbol with the maximal lifetime and split/truncate all symbols that overlap
+ * with it (i.e. that there won't be any overlaps anymore).
+ */
+static int handle_overlap_region(int start_idx, int end_idx)
+{
+ int rc = OP_JIT_CONV_OK;
+ int idx;
+ struct jitentry * e;
+ int cnt;
+ char * name;
+ int i, j;
+ unsigned long long totaltime;
+
+ if (debug) {
+ for (i = start_idx; i <= end_idx; i++) {
+ e = entries_address_ascending[i];
+ verbprintf(debug, "overlap idx=%i, name=%s, "
+ "start=%llx, end=%llx, life_start=%lli, "
+ "life_end=%lli, lifetime=%lli\n",
+ i, e->symbol_name, e->vma,
+ e->vma + e->code_size, e->life_start,
+ e->life_end, e->life_end - e->life_start);
+ }
+ }
+ idx = select_one(start_idx, end_idx);
+ totaltime = eliminate_overlaps(start_idx, end_idx, idx);
+ if (totaltime == ULONG_MAX) {
+ rc = OP_JIT_CONV_FAIL;
+ goto out;
+ }
+ e = entries_address_ascending[idx];
+
+ cnt = 1;
+ j = (e->life_end - e->life_start) * 100 / totaltime;
+ while ((j = j/10))
+ cnt++;
+
+ // Mark symbol name with a %% to indicate the overlap.
+ cnt += strlen(e->symbol_name) + 2 + 1;
+ name = xmalloc(cnt);
+ snprintf(name, cnt, "%s%%%llu", e->symbol_name,
+ (e->life_end - e->life_start) * 100 / totaltime);
+ if (e->sym_name_malloced)
+ free(e->symbol_name);
+ e->symbol_name = name;
+ e->sym_name_malloced = 1;
+ verbprintf(debug, "selected idx=%i, name=%s\n", idx, e->symbol_name);
+out:
+ return rc;
+}
+
+
+/*
+ * one scan through the symbols to find overlaps.
+ * return 1 if an overlap is found. this is repeated until no more overlap
+ * is there.
+ * Process: There may be more than two overlapping symbols with each other.
+ * The index range of symbols found to overlap are passed to
+ * handle_overlap_region.
+ */
+static int scan_overlaps(void)
+{
+ int i, j;
+ unsigned long long end_addr, end_addr2;
+ struct jitentry const * a;
+ int flag = 0;
+ // entry_count can be incremented by split_entry() during the loop,
+ // save the inital value as loop count
+ int loop_count = entry_count;
+
+ verbprintf(debug,"count=%i, scan overlaps...\n", entry_count);
+ i = 0;
+ end_addr = 0;
+ for (j = 1; j < loop_count; j++) {
+ /**
+ * Take a symbol [i] and look for the next symbol(s) [j] that are overlapping
+ * symbol [i]. If a symbol [j] is found that is not overlapping symbol [i] the
+ * symbols [i]..[j-1] are handled to be not overlapping anymore.
+ * See descriptions of handle_overlap_region() and eliminate_overlaps() for
+ * further details of this handling.
+ * E.g. possible cases to be handled could be:
+ *
+ * sym1 |-----------|
+ * sym2 |---|
+ *
+ * sym1 |--------|
+ * sym2 |--------|
+ *
+ * sym1 |--------|
+ * sym2 |-------|
+ * sym3 |---------|
+ *
+ * But in the following case
+ *
+ * sym1 |--------|
+ * sym2 |-------------|
+ * sym3 |----------|
+ *
+ * sym3 would not overlap with sym1. Therefore handle_overlap_regio() would
+ * only be called for sym1 up to sym2.
+ */
+ a = entries_address_ascending[j - 1];
+ end_addr2 = a->vma + a->code_size;
+ if (end_addr2 > end_addr)
+ end_addr = end_addr2;
+ a = entries_address_ascending[j];
+ if (end_addr <= a->vma) {
+ if (i != j - 1) {
+ if (handle_overlap_region(i, j - 1) ==
+ OP_JIT_CONV_FAIL) {
+ flag = OP_JIT_CONV_FAIL;
+ goto out;
+ }
+ flag = 1;
+ }
+ i = j;
+ }
+ }
+ if (i != j - 1) {
+ if (handle_overlap_region(i, j - 1) == OP_JIT_CONV_FAIL)
+ flag = OP_JIT_CONV_FAIL;
+ else
+ flag = 1;
+ }
+out:
+ return flag;
+}
+
+
+/* search for symbols that have overlapping address ranges and decide for
+ * one */
+int resolve_overlaps(unsigned long long start_time)
+{
+ int rc = OP_JIT_CONV_OK;
+ int cnt = 0;
+
+ invalidate_earlybirds(start_time);
+ while ((rc = scan_overlaps()) && rc != OP_JIT_CONV_FAIL) {
+ resort_address();
+ if (cnt == 0) {
+ verbprintf(debug, "WARNING: overlaps detected. "
+ "Removing overlapping JIT methods\n");
+ }
+ cnt++;
+ }
+ if (cnt > 0 && rc != OP_JIT_CONV_FAIL)
+ resort_symbol();
+ return rc;
+}
+
+
+/*
+ * scan through the sorted array and replace identical symbol names by unique
+ * ones by adding a counter value.
+ */
+void disambiguate_symbol_names(void)
+{
+ u32 j;
+ int cnt, rep_cnt;
+ struct jitentry * a;
+ struct jitentry * b;
+
+ rep_cnt = 0;
+ for (j = 1; j < entry_count; j++) {
+ a = entries_symbols_ascending[j - 1];
+ cnt = 1;
+ do {
+ b = entries_symbols_ascending[j];
+ if (strcmp(a->symbol_name, b->symbol_name) == 0) {
+ if (b->sym_name_malloced)
+ free(b->symbol_name);
+ b->symbol_name =
+ replacement_name(a->symbol_name, cnt);
+ b->sym_name_malloced = 1;
+ j++;
+ cnt++;
+ rep_cnt++;
+ } else {
+ break;
+ }
+ } while (j < entry_count);
+ }
+ /* recurse to avoid that the added suffix also creates a collision */
+ if (rep_cnt) {
+ qsort(entries_symbols_ascending, entry_count,
+ sizeof(struct jitentry *), cmp_symbolname);
+ disambiguate_symbol_names();
+ }
+}
diff --git a/opjitconv/opjitconv.c b/opjitconv/opjitconv.c
new file mode 100644
index 0000000..ac957ab
--- /dev/null
+++ b/opjitconv/opjitconv.c
@@ -0,0 +1,641 @@
+/**
+ * @file opjitconv.c
+ * Convert a jit dump file to an ELF file
+ *
+ * @remark Copyright 2007 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Jens Wilke
+ * @Modifications Maynard Johnson
+ * @Modifications Daniel Hansel
+ * @Modifications Gisle Dankel
+ *
+ * Copyright IBM Corporation 2007
+ *
+ */
+
+#include "opjitconv.h"
+#include "opd_printf.h"
+#include "op_file.h"
+#include "op_libiberty.h"
+
+#include <dirent.h>
+#include <fnmatch.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <pwd.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/mman.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <wait.h>
+
+/*
+ * list head. The linked list is used during parsing (parse_all) to
+ * hold all jitentry elements. After parsing, the program works on the
+ * array structures (entries_symbols_ascending, entries_address_ascending)
+ * and the linked list is not used any more.
+ */
+struct jitentry * jitentry_list = NULL;
+struct jitentry_debug_line * jitentry_debug_line_list = NULL;
+
+/* Global variable for asymbols so we can free the storage later. */
+asymbol ** syms;
+
+/* jit dump header information */
+enum bfd_architecture dump_bfd_arch;
+int dump_bfd_mach;
+char const * dump_bfd_target_name;
+
+/* user information for special user 'oprofile' */
+struct passwd * pw_oprofile;
+
+char sys_cmd_buffer[PATH_MAX + 1];
+
+/* the bfd handle of the ELF file we write */
+bfd * cur_bfd;
+
+/* count of jitentries in the list */
+u32 entry_count;
+/* maximul space in the entry arrays, needed to add entries */
+u32 max_entry_count;
+/* array pointing to all jit entries, sorted by symbol names */
+struct jitentry ** entries_symbols_ascending;
+/* array pointing to all jit entries sorted by address */
+struct jitentry ** entries_address_ascending;
+
+/* debug flag, print some information */
+int debug;
+
+/*
+ * Front-end processing from this point to end of the source.
+ * From main(), the general flow is as follows:
+ * 1. Find all anonymous samples directories
+ * 2. Find all JIT dump files
+ * 3. For each JIT dump file:
+ * 3.1 Find matching anon samples dir (from list retrieved in step 1)
+ * 3.2 mmap the JIT dump file
+ * 3.3 Call op_jit_convert to create ELF file if necessary
+ */
+
+/* Callback function used for get_matching_pathnames() call to obtain
+ * matching path names.
+ */
+static void get_pathname(char const * pathname, void * name_list)
+{
+ struct list_head * names = (struct list_head *) name_list;
+ struct pathname * pn = xmalloc(sizeof(struct pathname));
+ pn->name = xstrdup(pathname);
+ list_add(&pn->neighbor, names);
+}
+
+static void delete_pathname(struct pathname * pname)
+{
+ free(pname->name);
+ list_del(&pname->neighbor);
+ free(pname);
+}
+
+
+static void delete_path_names_list(struct list_head * list)
+{
+ struct list_head * pos1, * pos2;
+ list_for_each_safe(pos1, pos2, list) {
+ struct pathname * pname = list_entry(pos1, struct pathname,
+ neighbor);
+ delete_pathname(pname);
+ }
+}
+
+static int mmap_jitdump(char const * dumpfile,
+ struct op_jitdump_info * file_info)
+{
+ int rc = OP_JIT_CONV_OK;
+ int dumpfd;
+
+ dumpfd = open(dumpfile, O_RDONLY);
+ if (dumpfd < 0) {
+ if (errno == ENOENT)
+ rc = OP_JIT_CONV_NO_DUMPFILE;
+ else
+ rc = OP_JIT_CONV_FAIL;
+ goto out;
+ }
+ rc = fstat(dumpfd, &file_info->dmp_file_stat);
+ if (rc < 0) {
+ perror("opjitconv:fstat on dumpfile");
+ rc = OP_JIT_CONV_FAIL;
+ goto out;
+ }
+ file_info->dmp_file = mmap(0, file_info->dmp_file_stat.st_size,
+ PROT_READ, MAP_PRIVATE, dumpfd, 0);
+ if (file_info->dmp_file == MAP_FAILED) {
+ perror("opjitconv:mmap\n");
+ rc = OP_JIT_CONV_FAIL;
+ }
+out:
+ return rc;
+}
+
+static char const * find_anon_dir_match(struct list_head * anon_dirs,
+ char const * proc_id)
+{
+ struct list_head * pos;
+ char match_filter[10];
+ snprintf(match_filter, 10, "*/%s.*", proc_id);
+ list_for_each(pos, anon_dirs) {
+ struct pathname * anon_dir =
+ list_entry(pos, struct pathname, neighbor);
+ if (!fnmatch(match_filter, anon_dir->name, 0))
+ return anon_dir->name;
+ }
+ return NULL;
+}
+
+int change_owner(char * path)
+{
+ int rc = OP_JIT_CONV_OK;
+ int fd;
+
+ fd = open(path, 0);
+ if (fd < 0) {
+ printf("opjitconv: File cannot be opened for changing ownership.\n");
+ rc = OP_JIT_CONV_FAIL;
+ goto out;
+ }
+ if (fchown(fd, pw_oprofile->pw_uid, pw_oprofile->pw_gid) != 0) {
+ printf("opjitconv: Changing ownership failed (%s).\n", strerror(errno));
+ close(fd);
+ rc = OP_JIT_CONV_FAIL;
+ goto out;
+ }
+ close(fd);
+
+out:
+ return rc;
+}
+
+/* Copies the given file to the temporary working directory and sets ownership
+ * to 'oprofile:oprofile'.
+ */
+int copy_dumpfile(char const * dumpfile, char * tmp_dumpfile)
+{
+ int rc = OP_JIT_CONV_OK;
+
+ sprintf(sys_cmd_buffer, "/bin/cp -p %s %s", dumpfile, tmp_dumpfile);
+
+ if (system(sys_cmd_buffer) != 0) {
+ printf("opjitconv: Calling system() to copy files failed.\n");
+ rc = OP_JIT_CONV_FAIL;
+ goto out;
+ }
+
+ if (change_owner(tmp_dumpfile) != 0) {
+ printf("opjitconv: Changing ownership of temporary dump file failed.\n");
+ rc = OP_JIT_CONV_FAIL;
+ goto out;
+ }
+
+out:
+ return rc;
+}
+
+/* Copies the created ELF file located in the temporary working directory to the
+ * final destination (i.e. given ELF file name) and sets ownership to the
+ * current user.
+ */
+int copy_elffile(char * elf_file, char * tmp_elffile)
+{
+ int rc = OP_JIT_CONV_OK;
+ int fd;
+
+ sprintf(sys_cmd_buffer, "/bin/cp -p %s %s", tmp_elffile, elf_file);
+ if (system(sys_cmd_buffer) != 0) {
+ printf("opjitconv: Calling system() to copy files failed.\n");
+ rc = OP_JIT_CONV_FAIL;
+ goto out;
+ }
+
+ fd = open(elf_file, 0);
+ if (fd < 0) {
+ printf("opjitconv: File cannot be opened for changing ownership.\n");
+ rc = OP_JIT_CONV_FAIL;
+ goto out;
+ }
+ if (fchown(fd, getuid(), getgid()) != 0) {
+ printf("opjitconv: Changing ownership failed (%s).\n", strerror(errno));
+ close(fd);
+ rc = OP_JIT_CONV_FAIL;
+ goto out;
+ }
+ close(fd);
+
+out:
+ return rc;
+}
+
+/* Look for an anonymous samples directory that matches the process ID
+ * given by the passed JIT dmp_pathname. If none is found, it's an error
+ * since by agreement, all JIT dump files should be removed every time
+ * the user does --reset. If we do find the matching samples directory,
+ * we create an ELF file (<proc_id>.jo) and place it in that directory.
+ */
+static int process_jit_dumpfile(char const * dmp_pathname,
+ struct list_head * anon_sample_dirs,
+ unsigned long long start_time,
+ unsigned long long end_time,
+ char * tmp_conv_dir)
+{
+ int result_dir_length, proc_id_length;
+ int rc = OP_JIT_CONV_OK;
+ int jofd;
+ struct stat file_stat;
+ time_t dumpfile_modtime;
+ struct op_jitdump_info dmp_info;
+ char * elf_file = NULL;
+ char * proc_id = NULL;
+ char const * anon_dir;
+ char const * dumpfilename = rindex(dmp_pathname, '/');
+ /* temporary copy of dump file created for conversion step */
+ char * tmp_dumpfile;
+ /* temporary ELF file created during conversion step */
+ char * tmp_elffile;
+
+ verbprintf(debug, "Processing dumpfile %s\n", dmp_pathname);
+
+ /* Check if the dump file is a symbolic link.
+ * We should not trust symbolic links because we only produce normal dump
+ * files (no links).
+ */
+ if (lstat(dmp_pathname, &file_stat) == -1) {
+ printf("opjitconv: lstat for dumpfile failed (%s).\n", strerror(errno));
+ rc = OP_JIT_CONV_FAIL;
+ goto out;
+ }
+ if (S_ISLNK(file_stat.st_mode)) {
+ printf("opjitconv: dumpfile path is corrupt (symbolic links not allowed).\n");
+ rc = OP_JIT_CONV_FAIL;
+ goto out;
+ }
+
+ if (dumpfilename) {
+ size_t tmp_conv_dir_length = strlen(tmp_conv_dir);
+ char const * dot_dump = rindex(++dumpfilename, '.');
+ if (!dot_dump)
+ goto chk_proc_id;
+ proc_id_length = dot_dump - dumpfilename;
+ proc_id = xmalloc(proc_id_length + 1);
+ memcpy(proc_id, dumpfilename, proc_id_length);
+ proc_id[proc_id_length] = '\0';
+ verbprintf(debug, "Found JIT dumpfile for process %s\n",
+ proc_id);
+
+ tmp_dumpfile = xmalloc(tmp_conv_dir_length + 1 + strlen(dumpfilename) + 1);
+ strncpy(tmp_dumpfile, tmp_conv_dir, tmp_conv_dir_length);
+ tmp_dumpfile[tmp_conv_dir_length] = '\0';
+ strcat(tmp_dumpfile, "/");
+ strcat(tmp_dumpfile, dumpfilename);
+ }
+chk_proc_id:
+ if (!proc_id) {
+ printf("opjitconv: dumpfile path is corrupt.\n");
+ rc = OP_JIT_CONV_FAIL;
+ goto out;
+ }
+ if (!(anon_dir = find_anon_dir_match(anon_sample_dirs, proc_id))) {
+ printf("Possible error: No matching anon samples for %s\n",
+ dmp_pathname);
+ rc = OP_JIT_CONV_NO_MATCHING_ANON_SAMPLES;
+ goto free_res1;
+ }
+
+ if (copy_dumpfile(dmp_pathname, tmp_dumpfile) != OP_JIT_CONV_OK)
+ goto free_res1;
+
+ if ((rc = mmap_jitdump(tmp_dumpfile, &dmp_info)) == OP_JIT_CONV_OK) {
+ char * anon_path_seg = rindex(anon_dir, '/');
+ if (!anon_path_seg) {
+ printf("opjitconv: Bad path for anon sample: %s\n",
+ anon_dir);
+ rc = OP_JIT_CONV_FAIL;
+ goto free_res2;
+ }
+ result_dir_length = ++anon_path_seg - anon_dir;
+ /* create final ELF file name */
+ elf_file = xmalloc(result_dir_length +
+ strlen(proc_id) + strlen(".jo") + 1);
+ strncpy(elf_file, anon_dir, result_dir_length);
+ elf_file[result_dir_length] = '\0';
+ strcat(elf_file, proc_id);
+ strcat(elf_file, ".jo");
+ /* create temporary ELF file name */
+ tmp_elffile = xmalloc(strlen(tmp_conv_dir) + 1 +
+ strlen(proc_id) + strlen(".jo") + 1);
+ strncpy(tmp_elffile, tmp_conv_dir, strlen(tmp_conv_dir));
+ tmp_elffile[strlen(tmp_conv_dir)] = '\0';
+ strcat(tmp_elffile, "/");
+ strcat(tmp_elffile, proc_id);
+ strcat(tmp_elffile, ".jo");
+
+ // Check if final ELF file exists already
+ jofd = open(elf_file, O_RDONLY);
+ if (jofd < 0)
+ goto create_elf;
+ rc = fstat(jofd, &file_stat);
+ if (rc < 0) {
+ perror("opjitconv:fstat on .jo file");
+ rc = OP_JIT_CONV_FAIL;
+ goto free_res3;
+ }
+ if (dmp_info.dmp_file_stat.st_mtime >
+ dmp_info.dmp_file_stat.st_ctime)
+ dumpfile_modtime = dmp_info.dmp_file_stat.st_mtime;
+ else
+ dumpfile_modtime = dmp_info.dmp_file_stat.st_ctime;
+
+ /* Final ELF file already exists, so if dumpfile has not been
+ * modified since the ELF file's mod time, we don't need to
+ * do ELF creation again.
+ */
+ if (!(file_stat.st_ctime < dumpfile_modtime ||
+ file_stat.st_mtime < dumpfile_modtime)) {
+ rc = OP_JIT_CONV_ALREADY_DONE;
+ goto free_res3;
+ }
+
+ create_elf:
+ verbprintf(debug, "Converting %s to %s\n", dmp_pathname,
+ elf_file);
+ /* Set eGID of the special user 'oprofile'. */
+ if (setegid(pw_oprofile->pw_gid) != 0) {
+ perror("opjitconv: setegid to special user failed");
+ rc = OP_JIT_CONV_FAIL;
+ goto free_res3;
+ }
+ /* Set eUID of the special user 'oprofile'. */
+ if (seteuid(pw_oprofile->pw_uid) != 0) {
+ perror("opjitconv: seteuid to special user failed");
+ rc = OP_JIT_CONV_FAIL;
+ goto free_res3;
+ }
+ /* Convert the dump file as the special user 'oprofile'. */
+ rc = op_jit_convert(dmp_info, tmp_elffile, start_time, end_time);
+ /* Set eUID back to the original user. */
+ if (seteuid(getuid()) != 0) {
+ perror("opjitconv: seteuid to original user failed");
+ rc = OP_JIT_CONV_FAIL;
+ goto free_res3;
+ }
+ /* Set eGID back to the original user. */
+ if (setegid(getgid()) != 0) {
+ perror("opjitconv: setegid to original user failed");
+ rc = OP_JIT_CONV_FAIL;
+ goto free_res3;
+ }
+ rc = copy_elffile(elf_file, tmp_elffile);
+ free_res3:
+ free(elf_file);
+ free(tmp_elffile);
+ free_res2:
+ munmap(dmp_info.dmp_file, dmp_info.dmp_file_stat.st_size);
+ }
+free_res1:
+ free(proc_id);
+ free(tmp_dumpfile);
+out:
+ return rc;
+}
+
+/* If non-NULL value is returned, caller is responsible for freeing memory.*/
+static char * get_procid_from_dirname(char * dirname)
+{
+ char * ret = NULL;
+ if (dirname) {
+ char * proc_id;
+ int proc_id_length;
+ char * fname = rindex(dirname, '/');
+ char const * dot = index(++fname, '.');
+ if (!dot)
+ goto out;
+ proc_id_length = dot - fname;
+ proc_id = xmalloc(proc_id_length + 1);
+ memcpy(proc_id, fname, proc_id_length);
+ proc_id[proc_id_length] = '\0';
+ ret = proc_id;
+ }
+out:
+ return ret;
+}
+static void filter_anon_samples_list(struct list_head * anon_dirs)
+{
+ struct procid {
+ struct procid * next;
+ char * pid;
+ };
+ struct procid * pid_list = NULL;
+ struct procid * id, * nxt;
+ struct list_head * pos1, * pos2;
+ list_for_each_safe(pos1, pos2, anon_dirs) {
+ struct pathname * pname = list_entry(pos1, struct pathname,
+ neighbor);
+ char * proc_id = get_procid_from_dirname(pname->name);
+ if (proc_id) {
+ int found = 0;
+ for (id = pid_list; id != NULL; id = id->next) {
+ if (!strcmp(id->pid, proc_id)) {
+ /* Already have an entry for this
+ * process ID, so delete this entry
+ * from anon_dirs.
+ */
+ free(pname->name);
+ list_del(&pname->neighbor);
+ free(pname);
+ found = 1;
+ }
+ }
+ if (!found) {
+ struct procid * this_proc =
+ xmalloc(sizeof(struct procid));
+ this_proc->pid = proc_id;
+ this_proc->next = pid_list;
+ pid_list = this_proc;
+ }
+ } else {
+ printf("Unexpected result in processing anon sample"
+ " directory\n");
+ }
+ }
+ for (id = pid_list; id; id = nxt) {
+ free(id->pid);
+ nxt = id->next;
+ free(id);
+ }
+}
+
+
+static int op_process_jit_dumpfiles(char const * session_dir,
+ unsigned long long start_time, unsigned long long end_time)
+{
+ struct list_head * pos1, * pos2;
+ int rc = OP_JIT_CONV_OK;
+ char jitdumpfile[PATH_MAX + 1];
+ char oprofile_tmp_template[] = "/tmp/oprofile.XXXXXX";
+ char const * jitdump_dir = "/var/lib/oprofile/jitdump/";
+ LIST_HEAD(jd_fnames);
+ char const * anon_dir_filter = "*/{dep}/{anon:anon}/[0-9]*.*";
+ LIST_HEAD(anon_dnames);
+ char const * samples_subdir = "/samples/current";
+ int samples_dir_len = strlen(session_dir) + strlen(samples_subdir);
+ char * samples_dir;
+ /* temporary working directory for dump file conversion step */
+ char * tmp_conv_dir;
+
+ /* Create a temporary working directory used for the conversion step.
+ */
+ tmp_conv_dir = mkdtemp(oprofile_tmp_template);
+ if (tmp_conv_dir == NULL) {
+ printf("opjitconv: Temporary working directory cannot be created.\n");
+ rc = OP_JIT_CONV_FAIL;
+ goto out;
+ }
+
+ if ((rc = get_matching_pathnames(&jd_fnames, get_pathname,
+ jitdump_dir, "*.dump", NO_RECURSION)) < 0
+ || list_empty(&jd_fnames))
+ goto rm_tmp;
+
+ /* Get user information (i.e. UID and GID) for special user 'oprofile'.
+ */
+ pw_oprofile = getpwnam("oprofile");
+ if (pw_oprofile == NULL) {
+ printf("opjitconv: User information for special user oprofile cannot be found.\n");
+ rc = OP_JIT_CONV_FAIL;
+ goto rm_tmp;
+ }
+
+ /* Change ownership of the temporary working directory to prevent other users
+ * to attack conversion process.
+ */
+ if (change_owner(tmp_conv_dir) != 0) {
+ printf("opjitconv: Changing ownership of temporary directory failed.\n");
+ rc = OP_JIT_CONV_FAIL;
+ goto rm_tmp;
+ }
+
+ samples_dir = xmalloc(samples_dir_len + 1);
+ sprintf(samples_dir, "%s%s", session_dir, samples_subdir);
+ if (get_matching_pathnames(&anon_dnames, get_pathname,
+ samples_dir, anon_dir_filter,
+ MATCH_DIR_ONLY_RECURSION) < 0
+ || list_empty(&anon_dnames)) {
+ rc = OP_JIT_CONV_NO_ANON_SAMPLES;
+ goto rm_tmp;
+ }
+ /* When using get_matching_pathnames to find anon samples,
+ * the list that's returned may contain multiple entries for
+ * one or more processes; e.g.,
+ * 6868.0x100000.0x103000
+ * 6868.0xdfe77000.0xdec40000
+ * 7012.0x100000.0x103000
+ * 7012.0xdfe77000.0xdec40000
+ *
+ * So we must filter the list so there's only one entry per
+ * process.
+ */
+ filter_anon_samples_list(&anon_dnames);
+
+ /* get_matching_pathnames returns only filename segment when
+ * NO_RECURSION is passed, so below, we add back the JIT
+ * dump directory path to the name.
+ */
+ list_for_each_safe(pos1, pos2, &jd_fnames) {
+ struct pathname * dmpfile =
+ list_entry(pos1, struct pathname, neighbor);
+ strncpy(jitdumpfile, jitdump_dir, PATH_MAX);
+ strncat(jitdumpfile, dmpfile->name, PATH_MAX);
+ rc = process_jit_dumpfile(jitdumpfile, &anon_dnames,
+ start_time, end_time, tmp_conv_dir);
+ if (rc == OP_JIT_CONV_FAIL) {
+ verbprintf(debug, "JIT convert error %d\n", rc);
+ goto rm_tmp;
+ }
+ delete_pathname(dmpfile);
+ }
+ delete_path_names_list(&anon_dnames);
+
+rm_tmp:
+ /* Delete temporary working directory with all its files
+ * (i.e. dump and ELF file).
+ */
+ sprintf(sys_cmd_buffer, "/bin/rm -rf %s", tmp_conv_dir);
+ if (system(sys_cmd_buffer) != 0) {
+ printf("opjitconv: Removing temporary working directory failed.\n");
+ rc = OP_JIT_CONV_TMPDIR_NOT_REMOVED;
+ }
+
+out:
+ return rc;
+}
+
+int main(int argc, char ** argv)
+{
+ unsigned long long start_time, end_time;
+ char const * session_dir;
+ int rc = 0;
+
+ debug = 0;
+ if (argc > 1 && strcmp(argv[1], "-d") == 0) {
+ debug = 1;
+ argc--;
+ argv++;
+ }
+
+ if (argc != 4) {
+ printf("Usage: opjitconv [-d] <session_dir> <starttime>"
+ " <endtime>\n");
+ fflush(stdout);
+ rc = EXIT_FAILURE;
+ goto out;
+ }
+
+ session_dir = argv[1];
+ /*
+ * Check for a maximum of 4096 bytes (Linux path name length limit) decremented
+ * by 16 bytes (will be used later for appending samples sub directory).
+ * Integer overflows according to the session dir parameter (user controlled)
+ * are not possible anymore.
+ */
+ if (strlen(session_dir) > PATH_MAX - 16) {
+ printf("opjitconv: Path name length limit exceeded for session directory: %s\n", session_dir);
+ rc = EXIT_FAILURE;
+ goto out;
+ }
+
+ start_time = atol(argv[2]);
+ end_time = atol(argv[3]);
+
+ if (start_time > end_time) {
+ rc = EXIT_FAILURE;
+ goto out;
+ }
+ verbprintf(debug, "start time/end time is %llu/%llu\n",
+ start_time, end_time);
+ rc = op_process_jit_dumpfiles(session_dir, start_time, end_time);
+ if (rc > OP_JIT_CONV_OK) {
+ verbprintf(debug, "opjitconv: Ending with rc = %d. This code"
+ " is usually OK, but can be useful for debugging"
+ " purposes.\n", rc);
+ rc = OP_JIT_CONV_OK;
+ }
+ fflush(stdout);
+ if (rc == OP_JIT_CONV_OK)
+ rc = EXIT_SUCCESS;
+ else
+ rc = EXIT_FAILURE;
+out:
+ _exit(rc);
+}
diff --git a/opjitconv/opjitconv.h b/opjitconv/opjitconv.h
new file mode 100644
index 0000000..71c2c95
--- /dev/null
+++ b/opjitconv/opjitconv.h
@@ -0,0 +1,140 @@
+/**
+ * @file opjitconv.h
+ * Convert a jit dump file to an ELF file
+ *
+ * @remark Copyright 2007 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Jens Wilke
+ * @Modifications Maynard Johnson
+ * @Modifications Philippe Elie
+ * @Modifications Daniel Hansel
+ *
+ * Copyright IBM Corporation 2007
+ *
+ */
+
+#ifndef OPJITCONV_H
+#define OPJITCONV_H
+
+#define OP_JIT_CONV_OK 0
+#define OP_JIT_CONV_FAIL -1
+#define OP_JIT_CONV_NO_DUMPFILE 1
+#define OP_JIT_CONV_NO_ANON_SAMPLES 2
+#define OP_JIT_CONV_NO_MATCHING_ANON_SAMPLES 3
+#define OP_JIT_CONV_NO_JIT_RECS_IN_DUMPFILE 4
+#define OP_JIT_CONV_ALREADY_DONE 5
+#define OP_JIT_CONV_TMPDIR_NOT_REMOVED 6
+
+#include <bfd.h>
+#include <stddef.h>
+#include <sys/stat.h>
+
+#include "op_list.h"
+#include "op_types.h"
+
+/* Structure that contains all information
+ * for one function entry in the jit dump file.
+ * the jit dump file gets mmapped and code and
+ * symbol_name point directly into the file */
+struct jitentry {
+ /* linked list. see jitentry_list */
+ struct jitentry * next;
+ /* vma */
+ unsigned long long vma;
+ /* point to code in the memory mapped file */
+ void const * code;
+ /* size of the jitted code */
+ int code_size;
+ /* point to the name in memory mapped jitdump file, or
+ * to a malloced string, if we have a disambiguation replacement */
+ char * symbol_name;
+ /* sym_name_malloced ==1 means we need to free the memory when done. */
+ int sym_name_malloced;
+ /* seconds since epoch when the code was created */
+ unsigned long long life_start;
+ /* seconds since epoch when the code was overwritten */
+ unsigned long long life_end;
+ /* after ordering and partitioning this is the ELF
+ * section we put this code to */
+ asection * section;
+};
+
+struct jitentry_debug_line {
+ struct jitentry_debug_line * next;
+ struct jr_code_debug_info const * data;
+ /* seconds since epoch when the code was created */
+ unsigned long long life_start;
+ /* seconds since epoch when the code was overwritten */
+ unsigned long long life_end;
+ void const * end;
+};
+
+struct op_jitdump_info
+{
+ void * dmp_file;
+ struct stat dmp_file_stat;
+};
+
+struct pathname
+{
+ char * name;
+ struct list_head neighbor;
+};
+
+/* jitsymbol.c */
+void create_arrays(void);
+int resolve_overlaps(unsigned long long start_time);
+void disambiguate_symbol_names(void);
+
+/* parse_dump.c */
+int parse_all(void const * start, void const * end,
+ unsigned long long end_time);
+
+/* conversion.c */
+int op_jit_convert(struct op_jitdump_info file_info, char const * elffile,
+ unsigned long long start_time, unsigned long long end_time);
+
+/* create_bfd.c */
+bfd * open_elf(char const * filename);
+int partition_sections(void);
+int fill_sections(void);
+asection * create_section(bfd * abfd, char const * section_name,
+ size_t size, bfd_vma vma, flagword flags);
+int fill_section_content(bfd * abfd, asection * section,
+ void const * b, file_ptr offset, size_t sz);
+
+/* debug_line.c */
+int init_debug_line_info(bfd * abfd);
+int finalize_debug_line_info(bfd * abfd);
+
+/* jit dump header information */
+extern enum bfd_architecture dump_bfd_arch;
+extern int dump_bfd_mach;
+extern char const * dump_bfd_target_name;
+/*
+ * list head. The linked list is used during parsing (parse_all) to
+ * hold all jitentry elements. After parsing, the program works on the
+ * array structures (entries_symbols_ascending, entries_address_ascending)
+ * and the linked list is not used any more.
+ */
+extern struct jitentry * jitentry_list;
+/* count of jitentries in the list */
+extern u32 entry_count;
+/* list head for debug line information */
+extern struct jitentry_debug_line * jitentry_debug_line_list;
+/* maximum space in the entry arrays, needed to add entries */
+extern u32 max_entry_count;
+/* array pointing to all jit entries, sorted by symbol names */
+extern struct jitentry ** entries_symbols_ascending;
+/* array pointing to all jit entries sorted by address */
+extern struct jitentry ** entries_address_ascending;
+/* Global variable for asymbols so we can free the storage later. */
+extern asymbol ** syms;
+/* the bfd handle of the ELF file we write */
+extern bfd * cur_bfd;
+/* debug flag, print some information */
+extern int debug;
+
+
+#endif /* OPJITCONV_H */
diff --git a/opjitconv/parse_dump.c b/opjitconv/parse_dump.c
new file mode 100644
index 0000000..2625c7c
--- /dev/null
+++ b/opjitconv/parse_dump.c
@@ -0,0 +1,247 @@
+/**
+ * @file parse_dump.c
+ * parse a jit dump file
+ *
+ * @remark Copyright 2007 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Jens Wilke
+ * @Modifications Maynard Johnson
+ * @Modifications Philippe Elie
+ * @Modifications Daniel Hansel
+ *
+ * Copyright IBM Corporation 2007
+ *
+ */
+
+#include "opjitconv.h"
+#include "jitdump.h"
+#include "opd_printf.h"
+#include "op_libiberty.h"
+
+#include <string.h>
+#include <stdio.h>
+
+/* parse a code load record and add the entry to the jitentry list */
+static int parse_code_load(void const * ptr_arg, int size,
+ unsigned long long end_time)
+{
+ struct jitentry * entry;
+ int rc = OP_JIT_CONV_OK;
+ char const * ptr = ptr_arg;
+ struct jr_code_load const * rec = ptr_arg;
+ char const * end;
+ size_t padding_count, rec_totalsize;
+ end = rec->code_addr ? ptr + size : NULL;
+
+ entry = xcalloc(1, sizeof(struct jitentry));
+
+ // jitentry constructor
+ entry->next = NULL;
+ ptr += sizeof(*rec);
+ /* symbol_name can be malloced so we cast away the constness. */
+ entry->symbol_name = (char *)ptr;
+ entry->sym_name_malloced = 0;
+ ptr += strlen(ptr) + 1;
+ entry->code = rec->code_addr ? ptr : NULL;
+ entry->vma = rec->vma;
+ entry->code_size = rec->code_size;
+ entry->section = NULL;
+ entry->life_start = rec->timestamp;
+ // if nothing else is known the symbol lives till the end of the
+ // sampling run, this value may be overwritten by an unload record1
+ // later
+ entry->life_end = end_time;
+
+ // build list
+ entry->next = jitentry_list;
+ jitentry_list = entry;
+
+ /* padding bytes are calculated over the complete record
+ * (i.e. header + symbol name + code)
+ */
+ rec_totalsize = sizeof(*rec) + strlen(entry->symbol_name) + 1 + entry->code_size;
+ padding_count = PADDING_8ALIGNED(rec_totalsize);
+
+ verbprintf(debug, "record0: name=%s, vma=%llx, code_size=%i, "
+ "padding_count=%llu, life_start=%lli, life_end=%lli\n", entry->symbol_name,
+ entry->vma, entry->code_size, (unsigned long long)padding_count, entry->life_start,
+ entry->life_end);
+ /* If end == NULL, the dump does not include code, and this sanity
+ * check is skipped.
+ */
+ if (end && (ptr + entry->code_size + padding_count != end)) {
+ verbprintf(debug, "record total size mismatch\n");
+ rc = OP_JIT_CONV_FAIL;
+ }
+ return rc;
+}
+
+
+/*
+ * parse a code unload record. Search for existing record with this code
+ * address and fill life_end field with the timestamp. linear search not very
+ * efficient. FIXME: inefficient
+ */
+static void parse_code_unload(void const * ptr, unsigned long long end_time)
+{
+ struct jr_code_unload const * rec = ptr;
+ struct jitentry * entry;
+
+ verbprintf(debug,"record1: vma=%llx, life_end=%lli\n",
+ rec->vma, rec->timestamp);
+ /**
+ * Normally we won't get a jr_code_unload with a zero time stamp or
+ * a zero code address. The code address is directly provided by the JVMTI.
+ * The documentation of JVMTI does not say anything about the address value if
+ * it could be zero or not. Therefore it is only a sanity check at the moment.
+ */
+ if (rec->timestamp > 0 && rec->vma != 0) {
+ for (entry = jitentry_list; entry; entry = entry->next) {
+ if (entry->vma == rec->vma &&
+ entry->life_end == end_time) {
+ entry->life_end = rec->timestamp;
+ verbprintf(debug,"matching record found\n");
+ break;
+ }
+ }
+ }
+}
+
+
+/*
+ * There is no real parsing here, we just record a pointer to the data,
+ * we will interpret on the fly the record when building the bfd file.
+ */
+static void parse_code_debug_info(void const * ptr, void const * end,
+ unsigned long long end_time)
+{
+ struct jr_code_debug_info const * rec = ptr;
+ struct jitentry_debug_line * debug_line =
+ xmalloc(sizeof(struct jitentry_debug_line));
+
+ debug_line->data = rec;
+ debug_line->end = end;
+ debug_line->life_start = rec->timestamp;
+ debug_line->life_end = end_time;
+
+ debug_line->next = jitentry_debug_line_list;
+ jitentry_debug_line_list = debug_line;
+}
+
+
+/* parse all entries in the jit dump file and build jitentry_list.
+ * the code needs to check always whether there is enough
+ * to read remaining. this is because the file may be written to
+ * concurrently. */
+static int parse_entries(void const * ptr, void const * end,
+ unsigned long long end_time)
+{
+ int rc = OP_JIT_CONV_OK;
+ struct jr_prefix const * rec = ptr;
+
+ while ((void *)rec + sizeof(struct jr_prefix) < end) {
+ if (((void *) rec + rec->total_size) > end) {
+ verbprintf(debug, "record past end of file\n");
+ rc = OP_JIT_CONV_FAIL;
+ break;
+ }
+
+ switch (rec->id) {
+ case JIT_CODE_LOAD:
+ if (parse_code_load(rec, rec->total_size, end_time)) {
+ rc = OP_JIT_CONV_FAIL;
+ break;
+ }
+ break;
+
+ case JIT_CODE_UNLOAD:
+ parse_code_unload(rec, end_time);
+ break;
+
+ // end of VM live time, no action
+ case JIT_CODE_CLOSE:
+ break;
+
+ case JIT_CODE_DEBUG_INFO:
+ if (rec->total_size == 0) {
+ /* op_write_debug_line_info() ensures to write records with
+ * totalsize > 0.
+ */
+ rc = OP_JIT_CONV_FAIL;
+ break;
+ }
+
+ parse_code_debug_info(rec, end, end_time);
+ break;
+
+ default:
+ verbprintf(debug, "unknown record type\n");
+ rc = OP_JIT_CONV_FAIL;
+ break;
+ }
+
+ /* advance to next record (incl. possible padding bytes) */
+ rec = (void *)rec + rec->total_size;
+ }
+
+ return rc;
+}
+
+
+/* parse the jit dump header information
+ * The ptr arg is the address of the pointer to the mmapped
+ * file, which we modify below.
+ */
+static int parse_header(char const ** ptr, char const * end)
+{
+ int rc = OP_JIT_CONV_OK;
+ struct jitheader const * header;
+
+ if (*ptr + sizeof(struct jitheader) >= end) {
+ verbprintf(debug,
+ "opjitconv: EOF in jitdump file, no header\n");
+ rc = OP_JIT_CONV_FAIL;
+ goto out;
+ }
+ header = (struct jitheader *)*ptr;
+ if (header->magic != JITHEADER_MAGIC) {
+ verbprintf(debug, "opjitconv: Wrong jitdump file magic\n");
+ rc = OP_JIT_CONV_FAIL;
+ goto out;
+ }
+ if (header->version != JITHEADER_VERSION) {
+ verbprintf(debug, "opjitconv: Wrong jitdump file version\n");
+ rc = OP_JIT_CONV_FAIL;
+ goto out;
+ }
+ if (*ptr + header->totalsize > end) {
+ verbprintf(debug, "opjitconv: EOF in jitdump file, not enough "
+ "data for header\n");
+ rc = OP_JIT_CONV_FAIL;
+ goto out;
+ }
+ dump_bfd_arch = header->bfd_arch;
+ dump_bfd_mach = header->bfd_mach;
+ dump_bfd_target_name = header->bfd_target;
+ verbprintf(debug, "header: bfd-arch=%i, bfd-mach=%i,"
+ " bfd_target_name=%s\n", dump_bfd_arch, dump_bfd_mach,
+ dump_bfd_target_name);
+ *ptr = *ptr + header->totalsize;
+out:
+ return rc;
+}
+
+
+/* Read in the memory mapped jitdump file.
+ * Build up jitentry structure and set global variables.
+*/
+int parse_all(void const * start, void const * end,
+ unsigned long long end_time)
+{
+ char const * ptr = start;
+ if (!parse_header(&ptr, end))
+ return parse_entries(ptr, end, end_time);
+ else
+ return OP_JIT_CONV_FAIL;
+}
diff --git a/pp/Makefile.am b/pp/Makefile.am
new file mode 100644
index 0000000..1436473
--- /dev/null
+++ b/pp/Makefile.am
@@ -0,0 +1,45 @@
+AM_CPPFLAGS = \
+ -I ${top_srcdir}/libop \
+ -I ${top_srcdir}/libutil \
+ -I ${top_srcdir}/libdb \
+ -I ${top_srcdir}/libopt++ \
+ -I ${top_srcdir}/libutil++ \
+ -I ${top_srcdir}/libregex \
+ -I ${top_srcdir}/libpp
+
+AM_CXXFLAGS = @OP_CXXFLAGS@
+
+bin_PROGRAMS = opreport opannotate opgprof oparchive
+
+LIBS=@POPT_LIBS@ @BFD_LIBS@
+
+pp_common = common_option.cpp common_option.h
+
+common_libs = \
+ ../libpp/libpp.a \
+ ../libopt++/libopt++.a \
+ ../libregex/libop_regex.a \
+ ../libutil++/libutil++.a \
+ ../libop/libop.a \
+ ../libutil/libutil.a \
+ ../libdb/libodb.a
+
+opreport_SOURCES = opreport.cpp \
+ opreport_options.h opreport_options.cpp \
+ $(pp_common)
+opreport_LDADD = $(common_libs)
+
+opannotate_SOURCES = opannotate.cpp \
+ opannotate_options.h opannotate_options.cpp \
+ $(pp_common)
+opannotate_LDADD = $(common_libs)
+
+opgprof_SOURCES = opgprof.cpp \
+ opgprof_options.h opgprof_options.cpp \
+ $(pp_common)
+opgprof_LDADD = $(common_libs)
+
+oparchive_SOURCES = oparchive.cpp \
+ oparchive_options.h oparchive_options.cpp \
+ $(pp_common)
+oparchive_LDADD = $(common_libs)
diff --git a/pp/Makefile.in b/pp/Makefile.in
new file mode 100644
index 0000000..5a656b8
--- /dev/null
+++ b/pp/Makefile.in
@@ -0,0 +1,584 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+bin_PROGRAMS = opreport$(EXEEXT) opannotate$(EXEEXT) opgprof$(EXEEXT) \
+ oparchive$(EXEEXT)
+subdir = pp
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/binutils.m4 \
+ $(top_srcdir)/m4/builtinexpect.m4 \
+ $(top_srcdir)/m4/cellspubfdsupport.m4 \
+ $(top_srcdir)/m4/compileroption.m4 \
+ $(top_srcdir)/m4/configmodule.m4 \
+ $(top_srcdir)/m4/copyifchange.m4 $(top_srcdir)/m4/docbook.m4 \
+ $(top_srcdir)/m4/extradirs.m4 $(top_srcdir)/m4/findkernel.m4 \
+ $(top_srcdir)/m4/kerneloption.m4 \
+ $(top_srcdir)/m4/kernelversion.m4 \
+ $(top_srcdir)/m4/mallocattribute.m4 \
+ $(top_srcdir)/m4/poptconst.m4 \
+ $(top_srcdir)/m4/precompiledheader.m4 $(top_srcdir)/m4/qt.m4 \
+ $(top_srcdir)/m4/resultyn.m4 $(top_srcdir)/m4/sstream.m4 \
+ $(top_srcdir)/m4/typedef.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am__objects_1 = common_option.$(OBJEXT)
+am_opannotate_OBJECTS = opannotate.$(OBJEXT) \
+ opannotate_options.$(OBJEXT) $(am__objects_1)
+opannotate_OBJECTS = $(am_opannotate_OBJECTS)
+am__DEPENDENCIES_1 = ../libpp/libpp.a ../libopt++/libopt++.a \
+ ../libregex/libop_regex.a ../libutil++/libutil++.a \
+ ../libop/libop.a ../libutil/libutil.a ../libdb/libodb.a
+opannotate_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_oparchive_OBJECTS = oparchive.$(OBJEXT) oparchive_options.$(OBJEXT) \
+ $(am__objects_1)
+oparchive_OBJECTS = $(am_oparchive_OBJECTS)
+oparchive_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_opgprof_OBJECTS = opgprof.$(OBJEXT) opgprof_options.$(OBJEXT) \
+ $(am__objects_1)
+opgprof_OBJECTS = $(am_opgprof_OBJECTS)
+opgprof_DEPENDENCIES = $(am__DEPENDENCIES_1)
+am_opreport_OBJECTS = opreport.$(OBJEXT) opreport_options.$(OBJEXT) \
+ $(am__objects_1)
+opreport_OBJECTS = $(am_opreport_OBJECTS)
+opreport_DEPENDENCIES = $(am__DEPENDENCIES_1)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(opannotate_SOURCES) $(oparchive_SOURCES) \
+ $(opgprof_SOURCES) $(opreport_SOURCES)
+DIST_SOURCES = $(opannotate_SOURCES) $(oparchive_SOURCES) \
+ $(opgprof_SOURCES) $(opreport_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFD_LIBS = @BFD_LIBS@
+BUILD_JVMPI_AGENT_FALSE = @BUILD_JVMPI_AGENT_FALSE@
+BUILD_JVMPI_AGENT_TRUE = @BUILD_JVMPI_AGENT_TRUE@
+BUILD_JVMTI_AGENT_FALSE = @BUILD_JVMTI_AGENT_FALSE@
+BUILD_JVMTI_AGENT_TRUE = @BUILD_JVMTI_AGENT_TRUE@
+CAT_ENTRY_END = @CAT_ENTRY_END@
+CAT_ENTRY_START = @CAT_ENTRY_START@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOCBOOK_ROOT = @DOCBOOK_ROOT@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+EXTRA_CFLAGS_MODULE = @EXTRA_CFLAGS_MODULE@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAVA_HOMEDIR = @JAVA_HOMEDIR@
+KINC = @KINC@
+KSRC = @KSRC@
+KVERS = @KVERS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBERTY_LIBS = @LIBERTY_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @POPT_LIBS@ @BFD_LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MOC = @MOC@
+MODINSTALLDIR = @MODINSTALLDIR@
+OBJEXT = @OBJEXT@
+OPROFILE_DIR = @OPROFILE_DIR@
+OPROFILE_MODULE_ARCH = @OPROFILE_MODULE_ARCH@
+OP_CFLAGS = @OP_CFLAGS@
+OP_CXXFLAGS = @OP_CXXFLAGS@
+OP_DOCDIR = @OP_DOCDIR@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POPT_LIBS = @POPT_LIBS@
+PTRDIFF_T_TYPE = @PTRDIFF_T_TYPE@
+QT_INCLUDES = @QT_INCLUDES@
+QT_LDFLAGS = @QT_LDFLAGS@
+QT_LIB = @QT_LIB@
+QT_VERSION = @QT_VERSION@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIZE_T_TYPE = @SIZE_T_TYPE@
+STRIP = @STRIP@
+UIC = @UIC@
+VERSION = @VERSION@
+XML_CATALOG = @XML_CATALOG@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+have_qt_FALSE = @have_qt_FALSE@
+have_qt_TRUE = @have_qt_TRUE@
+have_xsltproc_FALSE = @have_xsltproc_FALSE@
+have_xsltproc_TRUE = @have_xsltproc_TRUE@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+kernel_support_FALSE = @kernel_support_FALSE@
+kernel_support_TRUE = @kernel_support_TRUE@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+topdir = @topdir@
+AM_CPPFLAGS = \
+ -I ${top_srcdir}/libop \
+ -I ${top_srcdir}/libutil \
+ -I ${top_srcdir}/libdb \
+ -I ${top_srcdir}/libopt++ \
+ -I ${top_srcdir}/libutil++ \
+ -I ${top_srcdir}/libregex \
+ -I ${top_srcdir}/libpp
+
+AM_CXXFLAGS = @OP_CXXFLAGS@
+pp_common = common_option.cpp common_option.h
+common_libs = \
+ ../libpp/libpp.a \
+ ../libopt++/libopt++.a \
+ ../libregex/libop_regex.a \
+ ../libutil++/libutil++.a \
+ ../libop/libop.a \
+ ../libutil/libutil.a \
+ ../libdb/libodb.a
+
+opreport_SOURCES = opreport.cpp \
+ opreport_options.h opreport_options.cpp \
+ $(pp_common)
+
+opreport_LDADD = $(common_libs)
+opannotate_SOURCES = opannotate.cpp \
+ opannotate_options.h opannotate_options.cpp \
+ $(pp_common)
+
+opannotate_LDADD = $(common_libs)
+opgprof_SOURCES = opgprof.cpp \
+ opgprof_options.h opgprof_options.cpp \
+ $(pp_common)
+
+opgprof_LDADD = $(common_libs)
+oparchive_SOURCES = oparchive.cpp \
+ oparchive_options.h oparchive_options.cpp \
+ $(pp_common)
+
+oparchive_LDADD = $(common_libs)
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign pp/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign pp/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ if test -f $$p \
+ || test -f $$p1 \
+ ; then \
+ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+ else :; fi; \
+ done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+ rm -f "$(DESTDIR)$(bindir)/$$f"; \
+ done
+
+clean-binPROGRAMS:
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+opannotate$(EXEEXT): $(opannotate_OBJECTS) $(opannotate_DEPENDENCIES)
+ @rm -f opannotate$(EXEEXT)
+ $(CXXLINK) $(opannotate_LDFLAGS) $(opannotate_OBJECTS) $(opannotate_LDADD) $(LIBS)
+oparchive$(EXEEXT): $(oparchive_OBJECTS) $(oparchive_DEPENDENCIES)
+ @rm -f oparchive$(EXEEXT)
+ $(CXXLINK) $(oparchive_LDFLAGS) $(oparchive_OBJECTS) $(oparchive_LDADD) $(LIBS)
+opgprof$(EXEEXT): $(opgprof_OBJECTS) $(opgprof_DEPENDENCIES)
+ @rm -f opgprof$(EXEEXT)
+ $(CXXLINK) $(opgprof_LDFLAGS) $(opgprof_OBJECTS) $(opgprof_LDADD) $(LIBS)
+opreport$(EXEEXT): $(opreport_OBJECTS) $(opreport_DEPENDENCIES)
+ @rm -f opreport$(EXEEXT)
+ $(CXXLINK) $(opreport_LDFLAGS) $(opreport_OBJECTS) $(opreport_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common_option.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opannotate.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opannotate_options.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oparchive.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oparchive_options.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opgprof.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opgprof_options.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opreport.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opreport_options.Po@am__quote@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@ if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@ if $(LTCXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+ clean-generic clean-libtool ctags distclean distclean-compile \
+ distclean-generic distclean-libtool distclean-tags distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-binPROGRAMS install-data install-data-am install-exec \
+ install-exec-am install-info install-info-am install-man \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ pdf pdf-am ps ps-am tags uninstall uninstall-am \
+ uninstall-binPROGRAMS uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/pp/common_option.cpp b/pp/common_option.cpp
new file mode 100644
index 0000000..99e0e96
--- /dev/null
+++ b/pp/common_option.cpp
@@ -0,0 +1,292 @@
+/**
+ * @file common_option.cpp
+ * Contains common options and implementation of entry point of pp tools
+ * and some miscelleaneous functions
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Philippe Elie
+ */
+
+#include <cstdlib>
+
+#include <iostream>
+#include <sstream>
+#include <iterator>
+#include <cstdlib>
+
+#include "op_config.h"
+#include "locate_images.h"
+#include "op_exception.h"
+#include "popt_options.h"
+#include "cverb.h"
+#include "common_option.h"
+#include "file_manip.h"
+
+using namespace std;
+
+namespace options {
+ double threshold = 0.0;
+ string threshold_opt;
+ string session_dir = OP_SESSION_DIR_DEFAULT;
+ string command_options;
+ vector<string> image_path;
+ string root_path;
+}
+
+namespace {
+
+vector<string> verbose_strings;
+
+popt::option common_options_array[] = {
+ popt::option(verbose_strings, "verbose", 'V',
+ // FIXME help string for verbose level
+ "verbose output", "all,debug,bfd,level1,sfile,stats,xml"),
+ popt::option(options::session_dir, "session-dir", '\0',
+ "specify session path to hold samples database and session data (" OP_SESSION_DIR_DEFAULT ")", "path"),
+ popt::option(options::image_path, "image-path", 'p',
+ "comma-separated path to search missing binaries", "path"),
+ popt::option(options::root_path, "root", 'R',
+ "path to filesystem to search for missing binaries", "path"),
+};
+
+
+double handle_threshold(string threshold)
+{
+ double value = 0.0;
+
+ if (threshold.length()) {
+ istringstream ss(threshold);
+ if (!(ss >> value)) {
+ cerr << "illegal threshold value: " << threshold
+ << " allowed range: [0-100]" << endl;
+ exit(EXIT_FAILURE);
+ }
+
+ if (value < 0.0 || value > 100.0) {
+ cerr << "illegal threshold value: " << threshold
+ << " allowed range: [0-100]" << endl;
+ exit(EXIT_FAILURE);
+ }
+ }
+
+ cverb << vdebug << "threshold: " << value << endl;;
+
+ return value;
+}
+
+
+vector<string> pre_parse_spec(vector<string> const & non_options)
+{
+ vector<string> result;
+
+ for (size_t i = 0; i < non_options.size(); ++i) {
+ if (non_options[i] == "{}") {
+ result.push_back("{");
+ result.push_back("}");
+ } else {
+ result.push_back(non_options[i]);
+ }
+ }
+
+ return result;
+}
+
+
+options::spec const parse_spec(vector<string> non_options)
+{
+ bool in_first = false;
+ bool in_second = false;
+ bool first = false;
+ bool second = false;
+ options::spec pspec;
+
+ non_options = pre_parse_spec(non_options);
+
+ vector<string>::const_iterator it = non_options.begin();
+ vector<string>::const_iterator end = non_options.end();
+
+ for (; it != end; ++it) {
+ if (*it == "{") {
+ if (in_first || in_second || second)
+ goto fail;
+ if (first) {
+ in_second = true;
+ second = true;
+ } else {
+ in_first = true;
+ first = true;
+ }
+ continue;
+ }
+
+ if (*it == "}") {
+ if (in_first) {
+ in_first = false;
+ } else if (in_second) {
+ in_second = false;
+ } else {
+ goto fail;
+ }
+ continue;
+ }
+
+ if (in_first) {
+ pspec.first.push_back(*it);
+ } else if (in_second) {
+ pspec.second.push_back(*it);
+ } else {
+ pspec.common.push_back(*it);
+ }
+ }
+
+ if (in_first || in_second || (first && !second))
+ goto fail;
+
+ if (pspec.first.empty() && pspec.second.size())
+ goto fail;
+
+ if (first && second) {
+ pspec.first.insert(pspec.first.begin(), pspec.common.begin(),
+ pspec.common.end());
+ pspec.second.insert(pspec.second.begin(), pspec.common.begin(),
+ pspec.common.end());
+ }
+
+ return pspec;
+fail:
+ cerr << "invalid profile specification ";
+ copy(non_options.begin(), non_options.end(),
+ ostream_iterator<string>(cerr, " "));
+ cerr << endl;
+ exit(EXIT_FAILURE);
+}
+
+
+options::spec get_options(int argc, char const * argv[])
+{
+ vector<string> non_options;
+ popt::parse_options(argc, argv, non_options);
+
+ // initialize paths in op_config.h
+ init_op_config_dirs(options::session_dir.c_str());
+
+ if (!options::threshold_opt.empty())
+ options::threshold = handle_threshold(options::threshold_opt);
+
+ if (!verbose::setup(verbose_strings)) {
+ cerr << "unknown --verbose= options\n";
+ exit(EXIT_FAILURE);
+ }
+
+ // XML generator needs command line options for its header
+ ostringstream str;
+ for (int i = 1; i < argc; ++i)
+ str << argv[i] << " ";
+ options::command_options = str.str();
+
+ return parse_spec(non_options);
+}
+
+} // anon namespace
+
+
+int run_pp_tool(int argc, char const * argv[], pp_fct_run_t fct)
+{
+ try {
+ return fct(get_options(argc, argv));
+ }
+ catch (op_runtime_error const & e) {
+ cerr << argv[0] << " error: " << e.what() << endl;
+ }
+ catch (op_fatal_error const & e) {
+ cerr << argv[0] << " error: " << e.what() << endl;
+ }
+ catch (op_exception const & e) {
+ cerr << argv[0] << " error: " << e.what() << endl;
+ }
+ catch (invalid_argument const & e) {
+ cerr << argv[0] << " error: " << e.what() << endl;
+ }
+ catch (exception const & e) {
+ cerr << argv[0] << " error: " << e.what() << endl;
+ }
+ catch (...) {
+ cerr << argv[0] << " unknown exception" << endl;
+ }
+
+ return EXIT_FAILURE;
+}
+
+
+demangle_type handle_demangle_option(string const & option)
+{
+ if (option == "none")
+ return dmt_none;
+ if (option == "smart")
+ return dmt_smart;
+ if (option == "normal")
+ return dmt_normal;
+
+ throw op_runtime_error("invalid option --demangle=" + option);
+}
+
+
+merge_option handle_merge_option(vector<string> const & mergespec,
+ bool allow_lib, bool exclude_dependent)
+{
+ using namespace options;
+ merge_option merge_by;
+
+ merge_by.cpu = false;
+ merge_by.lib = false;
+ merge_by.tid = false;
+ merge_by.tgid = false;
+ merge_by.unitmask = false;
+
+ if (!allow_lib)
+ merge_by.lib = true;
+
+ bool is_all = false;
+
+ vector<string>::const_iterator cit = mergespec.begin();
+ vector<string>::const_iterator end = mergespec.end();
+
+ for (; cit != end; ++cit) {
+ if (*cit == "cpu") {
+ merge_by.cpu = true;
+ } else if (*cit == "tid") {
+ merge_by.tid = true;
+ } else if (*cit == "tgid") {
+ // PP:5.21 tgid merge imply tid merging.
+ merge_by.tgid = true;
+ merge_by.tid = true;
+ } else if ((*cit == "lib" || *cit == "library") && allow_lib) {
+ merge_by.lib = true;
+ } else if (*cit == "unitmask") {
+ merge_by.unitmask = true;
+ } else if (*cit == "all") {
+ merge_by.cpu = true;
+ merge_by.lib = true;
+ merge_by.tid = true;
+ merge_by.tgid = true;
+ merge_by.unitmask = true;
+ is_all = true;
+ } else {
+ cerr << "unknown merge option: " << *cit << endl;
+ exit(EXIT_FAILURE);
+ }
+ }
+
+ // if --merge all, don't warn about lib merging,
+ // it's not user friendly. Behaviour should still
+ // be correct.
+ if (exclude_dependent && merge_by.lib && allow_lib && !is_all) {
+ cerr << "--merge=lib is meaningless "
+ << "with --exclude-dependent" << endl;
+ exit(EXIT_FAILURE);
+ }
+
+ return merge_by;
+}
diff --git a/pp/common_option.h b/pp/common_option.h
new file mode 100644
index 0000000..b54ef7c
--- /dev/null
+++ b/pp/common_option.h
@@ -0,0 +1,72 @@
+/**
+ * @file common_option.h
+ * Declaration of entry point of pp tools, implementation file add common
+ * options of pp tools and some miscelleaneous functions
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#ifndef COMMON_OPTION_H
+#define COMMON_OPTION_H
+
+#include <vector>
+#include <list>
+
+#include "arrange_profiles.h"
+#include "demangle_symbol.h"
+
+namespace options {
+ extern bool verbose;
+ extern double threshold;
+ extern std::string threshold_opt;
+ extern std::string command_options;
+ extern std::vector<std::string> image_path;
+ extern std::string root_path;
+
+ struct spec {
+ std::list<std::string> common;
+ std::list<std::string> first;
+ std::list<std::string> second;
+ };
+}
+
+/**
+ * prototype of a pp tool entry point. This entry point is called
+ * by run_pp_tool
+ */
+typedef int (*pp_fct_run_t)(options::spec const & spec);
+
+/**
+ * @param argc command line number of argument
+ * @param argv command line argument pointer array
+ * @param fct function to run to start this pp tool
+ *
+ * Provide a common entry to all pp tools, parsing all options, handling
+ * common options and providing the necessary try catch clause
+ */
+int run_pp_tool(int argc, char const * argv[], pp_fct_run_t fct);
+
+/**
+ * @param option one of [smart,none,normal]
+ *
+ * return the demangle_type of option or throw an exception if option
+ * is not valid.
+ */
+demangle_type handle_demangle_option(std::string const & option);
+
+/**
+ * @param mergespec merge option
+ * @param allow_lib is merge)lib allowed in mergespec
+ * @param exclude_dependent user specified --exclude-dependent
+ *
+ * parse merge option and return a merge_option filled from it.
+ *
+ */
+merge_option handle_merge_option(std::vector<std::string> const & mergespec,
+ bool allow_lib, bool exclude_dependent);
+
+#endif /* !COMMON_OPTION_H */
diff --git a/pp/opannotate.cpp b/pp/opannotate.cpp
new file mode 100644
index 0000000..5c224aa
--- /dev/null
+++ b/pp/opannotate.cpp
@@ -0,0 +1,858 @@
+/**
+ * @file opannotate.cpp
+ * Implement opannotate utility
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include <iostream>
+#include <sstream>
+#include <algorithm>
+#include <iomanip>
+#include <fstream>
+#include <utility>
+
+#include "op_exception.h"
+#include "op_header.h"
+#include "profile.h"
+#include "populate.h"
+#include "op_sample_file.h"
+#include "cverb.h"
+#include "string_manip.h"
+#include "demangle_symbol.h"
+#include "child_reader.h"
+#include "op_file.h"
+#include "file_manip.h"
+#include "arrange_profiles.h"
+#include "opannotate_options.h"
+#include "profile_container.h"
+#include "symbol_sort.h"
+#include "image_errors.h"
+
+using namespace std;
+using namespace options;
+
+namespace {
+
+size_t nr_events;
+
+scoped_ptr<profile_container> samples;
+
+/// how opannotate was invoked
+string cmdline;
+
+/// empty annotation fill string
+string annotation_fill;
+
+/// string used as start / end comment to annotate source
+string const begin_comment("/* ");
+string const in_comment(" * ");
+string const end_comment(" */");
+
+/// field width for the sample count
+unsigned int const count_width = 6;
+
+string get_annotation_fill()
+{
+ string str;
+
+ for (size_t i = 0; i < nr_events; ++i) {
+ str += string(count_width, ' ') + ' ';
+ str += string(percent_width, ' ');
+ }
+
+ for (size_t i = 1; i < nr_events; ++i)
+ str += " ";
+
+ str += " :";
+ return str;
+}
+
+
+symbol_entry const * find_symbol(string const & image_name,
+ string const & str_vma)
+{
+ // do not use the bfd equivalent:
+ // - it does not skip space at begin
+ // - we does not need cross architecture compile so the native
+ // strtoull must work, assuming unsigned long long can contain a vma
+ // and on 32/64 bits box bfd_vma is 64 bits
+ bfd_vma vma = strtoull(str_vma.c_str(), NULL, 16);
+
+ return samples->find_symbol(image_name, vma);
+}
+
+
+void output_info(ostream & out)
+{
+ out << begin_comment << '\n';
+
+ out << in_comment << "Command line: " << cmdline << '\n'
+ << in_comment << '\n';
+
+ out << in_comment << "Interpretation of command line:" << '\n';
+
+ if (!assembly) {
+ out << in_comment
+ << "Output annotated source file with samples" << '\n';
+
+ if (options::threshold != 0) {
+ out << in_comment
+ << "Output files where samples count reach "
+ << options::threshold << "% of the samples\n";
+ } else {
+ out << in_comment << "Output all files" << '\n';
+ }
+ } else {
+ out << in_comment
+ << "Output annotated assembly listing with samples"
+ << '\n';
+
+ if (!objdump_params.empty()) {
+ out << in_comment << "Passing the following "
+ "additional arguments to objdump ; \"";
+ for (size_t i = 0 ; i < objdump_params.size() ; ++i)
+ out << objdump_params[i] << " ";
+ out << "\"" << '\n';
+ }
+ }
+
+ out << in_comment << '\n';
+
+ out << in_comment << classes.cpuinfo << endl;
+ if (!classes.event.empty())
+ out << in_comment << classes.event << endl;
+
+ for (size_t i = 0; i < classes.v.size(); ++i)
+ out << in_comment << classes.v[i].longname << endl;
+
+ out << end_comment << '\n';
+}
+
+
+string count_str(count_array_t const & count,
+ count_array_t const & total)
+{
+ ostringstream os;
+ for (size_t i = 0; i < nr_events; ++i) {
+ os << setw(count_width) << count[i] << ' ';
+
+ os << format_percent(op_ratio(count[i], total[i]) * 100.0,
+ percent_int_width, percent_fract_width);
+ }
+ return os.str();
+}
+
+
+/// NOTE: This function annotates a list<string> containing output from objdump.
+/// It uses a list iterator, and a sample_container iterator which iterates
+/// from the beginning to the end, and compare sample address
+/// against the instruction address on the asm line.
+///
+/// There are 2 cases of annotation:
+/// 1. If sample address matches current line address, annotate the current line.
+/// 2. If (previous line address < sample address < current line address),
+/// then we annotate previous line. This case happens when sample address
+/// is not aligned with the instruction address, which is seen when profile
+/// using the instruction fetch mode of AMD Instruction-Based Sampling (IBS).
+///
+int asm_list_annotation(symbol_entry const * last_symbol,
+ bfd_vma last_symbol_vma,
+ list<string>::iterator sit,
+ sample_container::samples_iterator & samp_it,
+ list<string> & asm_lines)
+{
+ int ret = 0;
+
+ sample_entry const * sample = NULL;
+
+ if (samp_it != samples->end())
+ sample = &samp_it->second;
+
+ // do not use the bfd equivalent:
+ // - it does not skip space at begin
+ // - we does not need cross architecture compile so the native
+ // strtoull must work, assuming unsigned long long can contain a vma
+ // and on 32/64 bits box bfd_vma is 64 bits
+ // gcc 2.91.66 workaround
+ bfd_vma vma = strtoull((*sit).c_str(), NULL, 16);
+
+ if (sample
+ && ((sample->vma < last_symbol_vma) || (sample->vma > vma))) {
+ *sit = annotation_fill + *sit;
+ } else if (sample && sample->vma == vma) {
+ // Case 1 : Sample address match current line address.
+ string str = count_str(sample->counts, samples->samples_count());
+
+ // For each events
+ for (size_t i = 1; i < nr_events; ++i)
+ str += " ";
+
+ *sit = str + " :" + *sit;
+ if (samp_it != samples->end())
+ ++samp_it;
+
+ } else if (sample && sample->vma < vma) {
+ // Case 2 : vma of the current line is greater than vma of the sample
+
+ // Get the string of previous assembly line
+ list<string>::iterator sit_prev = sit;
+ string prev_line, prev_vma_str;
+ string::size_type loc1 = string::npos, loc2 = string::npos;
+ while (sit_prev != asm_lines.begin()) {
+ --sit_prev;
+ prev_line = *sit_prev;
+
+ loc1 = prev_line.find(":", 0);
+ if (loc1 != string::npos) {
+ loc2 = prev_line.find(":", loc1+1);
+ if (loc2 != string::npos) {
+ prev_vma_str = prev_line.substr(loc1+1, loc2);
+ break;
+ }
+ }
+ }
+
+ bfd_vma prev_vma = strtoull(prev_vma_str.c_str(), NULL, 16);
+
+ // Need to check if prev_vma < sample->vma
+ if (prev_vma != 0 && prev_vma < sample->vma) {
+ string str;
+
+ // Get sample for previous line.
+ sample_entry * prev_sample = (sample_entry *)samples->
+ find_sample(last_symbol, prev_vma);
+ if (prev_sample) {
+ // Aggregate sample with previous line if it already has samples
+ prev_sample->counts += sample->counts;
+ str = count_str(prev_sample->counts, samples->samples_count());
+ } else {
+ str = count_str(sample->counts, samples->samples_count());
+ }
+
+ // For each events
+ for (size_t i = 1; i < nr_events; ++i)
+ str += " ";
+
+ *sit_prev = str + " :" + prev_line.substr(loc1+1);
+ if (samp_it != samples->end())
+ ++samp_it;
+ ret = -1;
+ } else {
+ // Failed to annotate the previous line. Skip sample.
+ *sit = annotation_fill + *sit;
+ if (samp_it != samples->end())
+ ++samp_it;
+ }
+ } else {
+ // In case sample is NULL
+ *sit = annotation_fill + *sit;
+ }
+
+ return ret;
+}
+
+
+string symbol_annotation(symbol_entry const * symbol)
+{
+ if (!symbol)
+ return string();
+
+ string annot = count_str(symbol->sample.counts,
+ samples->samples_count());
+
+ string const & symname = symbol_names.demangle(symbol->name);
+
+ string str = " ";
+ str += begin_comment + symname + " total: ";
+ str += count_str(symbol->sample.counts, samples->samples_count());
+ str += end_comment;
+ return str;
+}
+
+
+/// return true if this line contains a symbol name in objdump formatting
+/// symbol are on the form 08030434 <symbol_name>: we need to be strict
+/// here to avoid any interpretation of a source line as a symbol line
+bool is_symbol_line(string const & str, string::size_type pos)
+{
+ if (str[pos] != ' ' || str[pos + 1] != '<')
+ return false;
+
+ return str[str.length() - 1] == ':';
+}
+
+
+void annotate_objdump_str_list(string const & app_name,
+ symbol_collection const & symbols,
+ list<string> & asm_lines)
+{
+ symbol_entry const * last_symbol = 0;
+ bfd_vma last_symbol_vma = 0;
+ int ret = 0;
+
+ // to filter output of symbols (filter based on command line options)
+ bool do_output = true;
+
+ // We simultaneously walk the two structures (list and sample_container)
+ // which are sorted by address. and do address comparision.
+ list<string>::iterator sit = asm_lines.begin();
+ list<string>::iterator send = asm_lines.end();
+ sample_container::samples_iterator samp_it = samples->begin();
+
+ for (; sit != send; (!ret? sit++: sit)) {
+ // output of objdump is a human readable form and can contain some
+ // ambiguity so this code is dirty. It is also optimized a little bit
+ // so it is difficult to simplify it without breaking something ...
+
+ // line of interest are: "[:space:]*[:xdigit:]?[ :]", the last char of
+ // this regexp dis-ambiguate between a symbol line and an asm line. If
+ // source contain line of this form an ambiguity occur and we rely on
+ // the robustness of this code.
+ string str = *sit;
+ size_t pos = 0;
+ while (pos < str.length() && isspace(str[pos]))
+ ++pos;
+
+ if (pos == str.length() || !isxdigit(str[pos])) {
+ if (do_output) {
+ *sit = annotation_fill + str;
+ continue;
+ }
+ }
+
+ while (pos < str.length() && isxdigit(str[pos]))
+ ++pos;
+
+ if (pos == str.length() || (!isspace(str[pos]) && str[pos] != ':')) {
+ if (do_output) {
+ *sit = annotation_fill + str;
+ continue;
+ }
+ }
+
+ if (is_symbol_line(str, pos)) {
+
+ last_symbol = find_symbol(app_name, str);
+ last_symbol_vma = strtoull(str.c_str(), NULL, 16);
+
+ // ! complexity: linear in number of symbol must use sorted
+ // by address vector and lower_bound ?
+ // Note this use a pointer comparison. It work because symbols
+ // pointer are unique
+ if (find(symbols.begin(), symbols.end(), last_symbol)
+ != symbols.end())
+ do_output = true;
+ else
+ do_output = false;
+
+ if (do_output) {
+ *sit += symbol_annotation(last_symbol);
+
+ // Realign the sample iterator to
+ // the beginning of this symbols
+ samp_it = samples->begin(last_symbol);
+ }
+ } else {
+ // not a symbol, probably an asm line.
+ if (do_output)
+ ret = asm_list_annotation(last_symbol,
+ last_symbol_vma,
+ sit, samp_it,
+ asm_lines);
+ }
+
+ if (!do_output)
+ *sit = "";
+ }
+}
+
+
+void output_objdump_str_list(symbol_collection const & symbols,
+ string const & app_name,
+ list<string> & asm_lines)
+{
+
+ annotate_objdump_str_list(app_name, symbols, asm_lines);
+
+ // Printing objdump output to stdout
+ list<string>::iterator sit = asm_lines.begin();
+ list<string>::iterator send = asm_lines.end();
+ sit = asm_lines.begin();
+ for (; sit != send; ++sit) {
+ string str = *sit;
+ if (str.length() != 0)
+ cout << str << '\n';
+ }
+}
+
+
+void do_one_output_objdump(symbol_collection const & symbols,
+ string const & image_name, string const & app_name,
+ bfd_vma start, bfd_vma end)
+{
+ vector<string> args;
+ list<string> asm_lines;
+
+ args.push_back("-d");
+ args.push_back("--no-show-raw-insn");
+ if (source)
+ args.push_back("-S");
+
+ if (start || end != ~(bfd_vma)0) {
+ ostringstream arg1, arg2;
+ arg1 << "--start-address=" << start;
+ arg2 << "--stop-address=" << end;
+ args.push_back(arg1.str());
+ args.push_back(arg2.str());
+ }
+
+ if (!objdump_params.empty()) {
+ for (size_t i = 0 ; i < objdump_params.size() ; ++i)
+ args.push_back(objdump_params[i]);
+ }
+
+ args.push_back(image_name);
+ child_reader reader("objdump", args);
+ if (reader.error()) {
+ cerr << "An error occur during the execution of objdump:\n\n";
+ cerr << reader.error_str() << endl;
+ return;
+ }
+
+ // Read each output line from objdump and store in a list.
+ string str;
+ while (reader.getline(str))
+ asm_lines.push_back(str);
+
+ output_objdump_str_list(symbols, app_name, asm_lines);
+
+ // objdump always returns SUCCESS so we must rely on the stderr state
+ // of objdump. If objdump error message is cryptic our own error
+ // message will be probably also cryptic
+ ostringstream std_err;
+ ostringstream std_out;
+ reader.get_data(std_out, std_err);
+ if (std_err.str().length()) {
+ cerr << "An error occur during the execution of objdump:\n\n";
+ cerr << std_err.str() << endl;
+ return ;
+ }
+
+ // force error code to be acquired
+ reader.terminate_process();
+
+ // required because if objdump stop by signal all above things suceeed
+ // (signal error message are not output through stdout/stderr)
+ if (reader.error()) {
+ cerr << "An error occur during the execution of objdump:\n\n";
+ cerr << reader.error_str() << endl;
+ return;
+ }
+}
+
+
+void output_objdump_asm(symbol_collection const & symbols,
+ string const & app_name)
+{
+ image_error error;
+ string image =
+ classes.extra_found_images.find_image_path(app_name, error,
+ true);
+
+ // this is only an optimisation, we can either filter output by
+ // directly calling objdump and rely on the symbol filtering or
+ // we can call objdump with the right parameter to just disassemble
+ // the needed part. This is a real win only when calling objdump
+ // a medium number of times, I dunno if the used threshold is optimal
+ // but it is a conservative value.
+ size_t const max_objdump_exec = 50;
+ if (symbols.size() <= max_objdump_exec || error != image_ok) {
+ symbol_collection::const_iterator cit = symbols.begin();
+ symbol_collection::const_iterator end = symbols.end();
+ for (; cit != end; ++cit) {
+ bfd_vma start = (*cit)->sample.vma;
+ bfd_vma end = start + (*cit)->size;
+ do_one_output_objdump(symbols, image, app_name,
+ start, end);
+ }
+ } else {
+ do_one_output_objdump(symbols, image,
+ app_name, 0, ~bfd_vma(0));
+ }
+}
+
+
+bool output_asm(string const & app_name)
+{
+ profile_container::symbol_choice choice;
+ choice.threshold = options::threshold;
+ choice.image_name = app_name;
+ choice.match_image = true;
+ symbol_collection symbols = samples->select_symbols(choice);
+
+ if (!symbols.empty()) {
+ sort_options options;
+ options.add_sort_option(sort_options::sample);
+ options.sort(symbols, false, false);
+
+ output_info(cout);
+
+ output_objdump_asm(symbols, app_name);
+
+ return true;
+ }
+
+ return false;
+}
+
+
+string const source_line_annotation(debug_name_id filename, size_t linenr)
+{
+ string str;
+
+ count_array_t counts = samples->samples_count(filename, linenr);
+ if (!counts.zero()) {
+ str += count_str(counts, samples->samples_count());
+ for (size_t i = 1; i < nr_events; ++i)
+ str += " ";
+ str += " :";
+ } else {
+ str = annotation_fill;
+ }
+
+ return str;
+}
+
+
+string source_symbol_annotation(debug_name_id filename, size_t linenr)
+{
+ symbol_collection const symbols = samples->find_symbol(filename, linenr);
+
+ if (symbols.empty())
+ return string();
+
+ string str = " " + begin_comment;
+
+ count_array_t counts;
+ for (size_t i = 0; i < symbols.size(); ++i) {
+ str += symbol_names.demangle(symbols[i]->name);
+ if (symbols.size() == 1)
+ str += " total: ";
+ else
+ str += " ";
+ str += count_str(symbols[i]->sample.counts,
+ samples->samples_count());
+ if (symbols.size() != 1)
+ str += ", ";
+
+ counts += symbols[i]->sample.counts;
+ }
+
+ if (symbols.size() > 1)
+ str += "total: " + count_str(counts, samples->samples_count());
+ str += end_comment;
+
+ return str;
+}
+
+
+void output_per_file_info(ostream & out, debug_name_id filename,
+ count_array_t const & total_file_count)
+{
+ out << begin_comment << '\n'
+ << in_comment << "Total samples for file : "
+ << '"' << debug_names.name(filename) << '"'
+ << '\n';
+ out << in_comment << '\n' << in_comment
+ << count_str(total_file_count, samples->samples_count())
+ << '\n';
+ out << end_comment << '\n' << '\n';
+}
+
+
+string const line0_info(debug_name_id filename)
+{
+ string annotation = source_line_annotation(filename, 0);
+ if (trim(annotation, " \t:").empty())
+ return string();
+
+ string str = "<credited to line zero> ";
+ str += annotation;
+ return str;
+}
+
+
+void do_output_one_file(ostream & out, istream & in, debug_name_id filename,
+ bool header)
+{
+ count_array_t count = samples->samples_count(filename);
+
+ if (header) {
+ output_per_file_info(out, filename, count);
+ out << line0_info(filename) << '\n';
+ }
+
+
+ if (in) {
+ string str;
+
+ for (size_t linenr = 1 ; getline(in, str) ; ++linenr) {
+ out << source_line_annotation(filename, linenr) << str
+ << source_symbol_annotation(filename, linenr)
+ << '\n';
+ }
+
+ } else {
+ // source is not available but we can at least output all the
+ // symbols belonging to this file. This make more visible the
+ // problem of having less samples for a given file than the
+ // sum of all symbols samples for this file due to inlining
+ symbol_collection const symbols = samples->select_symbols(filename);
+ for (size_t i = 0; i < symbols.size(); ++i)
+ out << symbol_annotation(symbols[i]) << endl;
+ }
+
+ if (!header) {
+ output_per_file_info(out, filename, count);
+ out << line0_info(filename) << '\n';
+ }
+}
+
+
+void output_one_file(istream & in, debug_name_id filename,
+ string const & source)
+{
+ if (output_dir.empty()) {
+ do_output_one_file(cout, in, filename, true);
+ return;
+ }
+
+ string const out_file = op_realpath(output_dir + source);
+
+ /* Just because you're paranoid doesn't mean they're not out to
+ * get you ...
+ *
+ * This is just a lame final safety check. If we found the
+ * source, then "source" should be canonical already, and
+ * can't escape from the output dir. We can't use op_realpath()
+ * alone as that needs the file to exist already.
+ *
+ * Let's not complain again if we couldn't find the file anyway.
+ */
+ if (out_file.find("/../") != string::npos) {
+ if (in) {
+ cerr << "refusing to create non-canonical filename "
+ << out_file << endl;
+ }
+ return;
+ } else if (!is_prefix(out_file, output_dir)) {
+ if (in) {
+ cerr << "refusing to create file " << out_file
+ << " outside of output directory " << output_dir
+ << endl;
+ }
+ return;
+ }
+
+ if (is_files_identical(out_file, source)) {
+ cerr << "input and output files are identical: "
+ << out_file << endl;
+ return;
+ }
+
+ if (create_path(out_file.c_str())) {
+ cerr << "unable to create file: "
+ << '"' << op_dirname(out_file) << '"' << endl;
+ return;
+ }
+
+ ofstream out(out_file.c_str());
+ if (!out) {
+ cerr << "unable to open output file "
+ << '"' << out_file << '"' << endl;
+ } else {
+ do_output_one_file(out, in, filename, false);
+ output_info(out);
+ }
+}
+
+
+/* Locate a source file from debug info, which may be relative */
+string const locate_source_file(debug_name_id filename_id)
+{
+ string const origfile = debug_names.name(filename_id);
+ string file = origfile;
+
+ if (file.empty())
+ return file;
+
+ /* Allow absolute paths to be relocated to a different directory */
+ if (file[0] == '/') {
+ vector<string>::const_iterator cit = base_dirs.begin();
+ vector<string>::const_iterator end = base_dirs.end();
+ for (; cit != end; ++cit) {
+ string path = op_realpath(*cit);
+
+ if (is_prefix(file, path)) {
+ file = file.substr(path.length());
+ break;
+ }
+ }
+ }
+
+ vector<string>::const_iterator cit = search_dirs.begin();
+ vector<string>::const_iterator end = search_dirs.end();
+
+ for (; cit != end; ++cit) {
+ string const absfile = op_realpath(*cit + "/" + file);
+
+ if (op_file_readable(absfile))
+ return absfile;
+ }
+
+ /* We didn't find a relocated absolute file, or a relative file,
+ * assume the original is correct, accounting for the
+ * possibility it's relative the cwd
+ */
+ return op_realpath(origfile);
+}
+
+
+void output_source(path_filter const & filter)
+{
+ bool const separate_file = !output_dir.empty();
+
+ if (!separate_file)
+ output_info(cout);
+
+ vector<debug_name_id> filenames =
+ samples->select_filename(options::threshold);
+
+ for (size_t i = 0 ; i < filenames.size() ; ++i) {
+ string const & source = locate_source_file(filenames[i]);
+
+ if (!filter.match(source))
+ continue;
+
+ ifstream in(source.c_str());
+
+ // it is common to have empty filename due to the lack
+ // of debug info (eg _init function) so warn only
+ // if the filename is non empty. The case: no debug
+ // info at all has already been checked.
+ if (!in && source.length()) {
+ cerr << "opannotate (warning): unable to open for "
+ "reading: " << source << endl;
+ }
+
+ if (source.length())
+ output_one_file(in, filenames[i], source);
+ }
+}
+
+
+bool annotate_source(list<string> const & images)
+{
+ annotation_fill = get_annotation_fill();
+
+ if (!output_dir.empty()) {
+
+ if (create_path(output_dir.c_str())) {
+ cerr << "unable to create " << output_dir
+ << " directory: " << endl;
+ return false;
+ }
+
+ // Make sure we have an absolute path.
+ output_dir = op_realpath(output_dir);
+ if (output_dir.length() &&
+ output_dir[output_dir.length() - 1] != '/')
+ output_dir += '/';
+
+ /* Don't let the user stomp on their sources */
+ if (output_dir == "/") {
+ cerr << "Output path of / would over-write the "
+ "source files" << endl;
+ return false;
+ }
+ }
+
+ if (assembly) {
+ bool some_output = false;
+
+ list<string>::const_iterator it = images.begin();
+ list<string>::const_iterator const end = images.end();
+
+ for (; it != end; ++it) {
+ if (output_asm(*it))
+ some_output = true;
+ }
+
+ if (!some_output) {
+ // It's the only case we must care since we know the
+ // selected image set is not empty
+ cerr << "selected image set doesn't contain any of "
+ << "the selected symbol\n";
+ }
+ } else {
+ output_source(file_filter);
+ }
+
+ return true;
+}
+
+
+int opannotate(options::spec const & spec)
+{
+ handle_options(spec);
+
+ nr_events = classes.v.size();
+
+ samples.reset(new profile_container(true, true,
+ classes.extra_found_images));
+
+ list<string> images;
+
+ list<inverted_profile> iprofiles = invert_profiles(classes);
+
+ report_image_errors(iprofiles, classes.extra_found_images);
+
+ list<inverted_profile>::iterator it = iprofiles.begin();
+ list<inverted_profile>::iterator const end = iprofiles.end();
+
+ bool debug_info = false;
+ for (; it != end; ++it) {
+ bool tmp = false;
+ populate_for_image(*samples, *it,
+ options::symbol_filter, &tmp);
+ images.push_back(it->image);
+ if (tmp)
+ debug_info = true;
+ }
+
+ if (!debug_info && !options::assembly) {
+ cerr << "opannotate (warning): no debug information available for binary "
+ << it->image << ", and --assembly not requested\n";
+ }
+
+ annotate_source(images);
+
+ return 0;
+}
+
+} // anonymous namespace
+
+
+int main(int argc, char const * argv[])
+{
+ // set the invocation, for the file headers later
+ for (int i = 0 ; i < argc ; ++i)
+ cmdline += string(argv[i]) + " ";
+
+ return run_pp_tool(argc, argv, opannotate);
+}
diff --git a/pp/opannotate_options.cpp b/pp/opannotate_options.cpp
new file mode 100644
index 0000000..57a5924
--- /dev/null
+++ b/pp/opannotate_options.cpp
@@ -0,0 +1,153 @@
+/**
+ * @file opannotate_options.cpp
+ * Options for opannotate tool
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include <cstdlib>
+
+#include <vector>
+#include <list>
+#include <iterator>
+#include <iostream>
+#include <cstdlib>
+
+#include "profile_spec.h"
+#include "arrange_profiles.h"
+#include "op_exception.h"
+#include "opannotate_options.h"
+#include "popt_options.h"
+#include "cverb.h"
+
+using namespace std;
+
+profile_classes classes;
+
+namespace options {
+ demangle_type demangle = dmt_normal;
+ string output_dir;
+ vector<string> search_dirs;
+ vector<string> base_dirs;
+ merge_option merge_by;
+ path_filter file_filter;
+ string_filter symbol_filter;
+ bool source;
+ bool assembly;
+ vector<string> objdump_params;
+ bool exclude_dependent;
+}
+
+
+namespace {
+
+string include_symbols;
+string exclude_symbols;
+string include_file;
+string exclude_file;
+string demangle_option = "normal";
+vector<string> mergespec;
+
+popt::option options_array[] = {
+ popt::option(demangle_option, "demangle", 'D',
+ "demangle GNU C++ symbol names (default normal)",
+ "none|normal|smart"),
+ popt::option(options::output_dir, "output-dir", 'o',
+ "output directory", "directory name"),
+ popt::option(options::search_dirs, "search-dirs", 'd',
+ "directories to look for source files", "comma-separated paths"),
+ popt::option(options::base_dirs, "base-dirs", 'b',
+ "source file prefixes to strip", "comma-separated paths"),
+ popt::option(include_file, "include-file", '\0',
+ "include these comma separated filename", "filenames"),
+ popt::option(exclude_file, "exclude-file", '\0',
+ "exclude these comma separated filename", "filenames"),
+ popt::option(include_symbols, "include-symbols", 'i',
+ "include these comma separated symbols", "symbols"),
+ popt::option(exclude_symbols, "exclude-symbols", 'e',
+ "exclude these comma separated symbols", "symbols"),
+ popt::option(options::objdump_params, "objdump-params", '\0',
+ "additional params to pass to objdump", "parameters"),
+ popt::option(options::exclude_dependent, "exclude-dependent", 'x',
+ "exclude libs, kernel, and module samples for applications"),
+ popt::option(mergespec, "merge", 'm',
+ "comma separated list", "cpu,tid,tgid,unitmask,all"),
+ popt::option(options::source, "source", 's', "output source"),
+ popt::option(options::assembly, "assembly", 'a', "output assembly"),
+ popt::option(options::threshold_opt, "threshold", 't',
+ "minimum percentage needed to produce output",
+ "percent"),
+};
+
+} // anonymous namespace
+
+
+void handle_options(options::spec const & spec)
+{
+ using namespace options;
+
+ if (spec.first.size()) {
+ cerr << "differential profiles not allowed" << endl;
+ exit(EXIT_FAILURE);
+ }
+
+ if (!assembly && !source) {
+ cerr << "you must specify at least --source or --assembly\n";
+ exit(EXIT_FAILURE);
+ }
+
+ if (!objdump_params.empty() && !assembly) {
+ cerr << "--objdump-params is meaningless without --assembly\n";
+ exit(EXIT_FAILURE);
+ }
+
+ if (search_dirs.empty() && !base_dirs.empty()) {
+ cerr << "--base-dirs is useless unless you specify an "
+ "alternative source location with --search-dirs"
+ << endl;
+ exit(EXIT_FAILURE);
+ }
+
+ if (assembly && !output_dir.empty()) {
+ cerr << "--output-dir is meaningless with --assembly" << endl;
+ exit(EXIT_FAILURE);
+ }
+
+ options::symbol_filter = string_filter(include_symbols, exclude_symbols);
+
+ options::file_filter = path_filter(include_file, exclude_file);
+
+ profile_spec const pspec =
+ profile_spec::create(spec.common, options::image_path,
+ options::root_path);
+
+ list<string> sample_files = pspec.generate_file_list(exclude_dependent, true);
+
+ cverb << vsfile << "Archive: " << pspec.get_archive_path() << endl;
+
+ cverb << vsfile << "Matched sample files: " << sample_files.size()
+ << endl;
+ copy(sample_files.begin(), sample_files.end(),
+ ostream_iterator<string>(cverb << vsfile, "\n"));
+
+ demangle = handle_demangle_option(demangle_option);
+
+ // we always merge but this have no effect on output since at source
+ // or assembly point of view the result will be merged anyway
+ merge_by = handle_merge_option(mergespec, false, exclude_dependent);
+
+ classes = arrange_profiles(sample_files, merge_by,
+ pspec.extra_found_images);
+
+ cverb << vsfile << "profile_classes:\n" << classes << endl;
+
+ if (classes.v.empty()) {
+ cerr << "error: no sample files found: profile specification "
+ "too strict ?" << endl;
+ exit(EXIT_FAILURE);
+ }
+}
diff --git a/pp/opannotate_options.h b/pp/opannotate_options.h
new file mode 100644
index 0000000..632a7bb
--- /dev/null
+++ b/pp/opannotate_options.h
@@ -0,0 +1,47 @@
+/**
+ * @file opannotate_options.h
+ * Options for opannotate tool
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#ifndef OPANNOTATE_OPTIONS_H
+#define OPANNOTATE_OPTIONS_H
+
+#include <string>
+#include <vector>
+
+#include "common_option.h"
+#include "path_filter.h"
+
+class profile_classes;
+
+namespace options {
+ extern demangle_type demangle;
+ extern bool source;
+ extern bool assembly;
+ extern string_filter symbol_filter;
+ extern path_filter file_filter;
+ extern std::string output_dir;
+ extern std::vector<std::string> search_dirs;
+ extern std::vector<std::string> base_dirs;
+ extern std::vector<std::string> objdump_params;
+ extern double threshold;
+}
+
+/// classes of sample filenames to handle
+extern profile_classes classes;
+
+/**
+ * handle_options - process command line
+ * @param spec profile specification
+ *
+ * Process the spec, fatally complaining on error.
+ */
+void handle_options(options::spec const & spec);
+
+#endif // OPANNOTATE_OPTIONS_H
diff --git a/pp/oparchive.cpp b/pp/oparchive.cpp
new file mode 100644
index 0000000..caf285c
--- /dev/null
+++ b/pp/oparchive.cpp
@@ -0,0 +1,237 @@
+/**
+ * @file oparchive.cpp
+ * Implement oparchive utility
+ *
+ * @remark Copyright 2003, 2004 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Will Cohen
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include <cstdlib>
+
+#include <iostream>
+#include <fstream>
+#include <cstdlib>
+
+#include <errno.h>
+#include <string.h>
+#include <dirent.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include "op_file.h"
+#include "op_bfd.h"
+#include "op_config.h"
+#include "oparchive_options.h"
+#include "file_manip.h"
+#include "cverb.h"
+#include "image_errors.h"
+#include "string_manip.h"
+#include "locate_images.h"
+
+using namespace std;
+
+namespace {
+
+
+void copy_one_file(image_error err, string const & source, string const & dest)
+{
+ if (!op_file_readable(source))
+ return;
+
+ if (options::list_files) {
+ cout << source << endl;
+ return;
+ }
+
+ if (!copy_file(source, dest) && err == image_ok) {
+ cerr << "can't copy from " << source << " to " << dest
+ << " cause: " << strerror(errno) << endl;
+ }
+}
+
+void copy_stats(string const & session_samples_dir,
+ string const & archive_path)
+{
+ DIR * dir;
+ struct dirent * dirent;
+ string stats_path;
+
+ stats_path = session_samples_dir + "stats/";
+
+ if (!(dir = opendir(stats_path.c_str()))) {
+ cerr << "Session overflow stats not available" << endl;
+ return;
+ }
+
+ string sample_base_dir = session_samples_dir.substr(archive_path.size());
+ string archive_stats = options::outdirectory + sample_base_dir + "stats/";
+ string archive_stats_path = archive_stats + "event_lost_overflow";
+ if (!options::list_files &&
+ create_path(archive_stats_path.c_str())) {
+ cerr << "Unable to create directory for "
+ << archive_stats << "." << endl;
+ exit (EXIT_FAILURE);
+ }
+
+ copy_one_file(image_ok, stats_path + "/event_lost_overflow", archive_stats_path);
+
+ while ((dirent = readdir(dir))) {
+ int cpu_nr;
+ string path;
+ if (sscanf(dirent->d_name, "cpu%d", &cpu_nr) != 1)
+ continue;
+ path = string(dirent->d_name) + "/" + "sample_lost_overflow";
+ archive_stats_path = archive_stats + path;
+ if (!options::list_files &&
+ create_path(archive_stats_path.c_str())) {
+ cerr << "Unable to create directory for "
+ << archive_stats_path << "." << endl;
+ exit (EXIT_FAILURE);
+ }
+ copy_one_file(image_ok, stats_path + path, archive_stats_path);
+
+ }
+ closedir(dir);
+
+}
+
+int oparchive(options::spec const & spec)
+{
+ handle_options(spec);
+
+ string archive_path = classes.extra_found_images.get_archive_path();
+
+ /* Check to see if directory can be created */
+ if (!options::list_files && create_path(options::outdirectory.c_str())) {
+ cerr << "Unable to create directory for "
+ << options::outdirectory << "." << endl;
+ exit (EXIT_FAILURE);
+ }
+
+ /* copy over each of the executables and the debuginfo files */
+ list<inverted_profile> iprofiles = invert_profiles(classes);
+
+ report_image_errors(iprofiles, classes.extra_found_images);
+
+ list<inverted_profile>::iterator it = iprofiles.begin();
+ list<inverted_profile>::iterator const end = iprofiles.end();
+
+ cverb << vdebug << "(exe_names)" << endl << endl;
+ for (; it != end; ++it) {
+
+ string exe_name = it->image;
+ image_error error;
+ string real_exe_name =
+ classes.extra_found_images.find_image_path(it->image,
+ error, true);
+
+ if (error == image_ok)
+ exe_name = classes.extra_found_images.strip_path_prefix(real_exe_name);
+
+ // output name must be identical to the original name, when
+ // using this archive the used fixup will be identical e.g.:
+ // oparchive -p /lib/modules/2.6.42/kernel -o tmp;
+ // opreport -p /lib/modules/2.6.42/kernel { archive:tmp }
+ string exe_archive_file = options::outdirectory + exe_name;
+
+ // FIXME: hacky
+ if (it->error == image_not_found && is_prefix(exe_name, "anon "))
+ continue;
+
+ cverb << vdebug << real_exe_name << endl;
+ /* Create directory for executable file. */
+ if (!options::list_files &&
+ create_path(exe_archive_file.c_str())) {
+ cerr << "Unable to create directory for "
+ << exe_archive_file << "." << endl;
+ exit (EXIT_FAILURE);
+ }
+
+ /* Copy actual executable files */
+ copy_one_file(it->error, real_exe_name, exe_archive_file);
+
+ /* If there are any debuginfo files, copy them over.
+ * Need to copy the debug info file to somewhere we'll
+ * find it - executable location + "/.debug"
+ * to avoid overwriting files with the same name. The
+ * /usr/lib/debug search path is not going to work.
+ */
+ bfd * ibfd = open_bfd(real_exe_name);
+ if (ibfd) {
+ string dirname = op_dirname(real_exe_name);
+ string debug_filename;
+ if (find_separate_debug_file(ibfd, real_exe_name,
+ debug_filename, classes.extra_found_images)) {
+ /* found something copy it over */
+ string dest_debug_dir = options::outdirectory +
+ dirname + "/.debug/";
+ if (!options::list_files &&
+ create_dir(dest_debug_dir.c_str())) {
+ cerr << "Unable to create directory: "
+ << dest_debug_dir << "." << endl;
+ exit (EXIT_FAILURE);
+ }
+
+ string dest_debug = dest_debug_dir +
+ op_basename(debug_filename);
+ copy_one_file(image_ok, debug_filename, dest_debug);
+ }
+ bfd_close(ibfd);
+ }
+ }
+
+ /* copy over each of the sample files */
+ list<string>::iterator sit = sample_files.begin();
+ list<string>::iterator const send = sample_files.end();
+
+ string a_sample_file = *sit;
+ int offset = a_sample_file.find('{');
+ string base_samples_dir = a_sample_file.substr(0, offset);
+ copy_stats(base_samples_dir, archive_path);
+
+ cverb << vdebug << "(sample_names)" << endl << endl;
+
+ for (; sit != send; ++sit) {
+ string sample_name = *sit;
+ /* Get rid of the the archive_path from the name */
+ string sample_base = sample_name.substr(archive_path.size());
+ string sample_archive_file = options::outdirectory + sample_base;
+
+ cverb << vdebug << sample_name << endl;
+ cverb << vdebug << " destp " << sample_archive_file << endl;
+ if (!options::list_files &&
+ create_path(sample_archive_file.c_str())) {
+ cerr << "Unable to create directory for "
+ << sample_archive_file << "." << endl;
+ exit (EXIT_FAILURE);
+ }
+
+ /* Copy over actual sample file. */
+ copy_one_file(image_ok, sample_name, sample_archive_file);
+ }
+
+ /* copy over the <session-dir>/abi file if it exists */
+ string abi_name = string(op_session_dir) + "/abi";
+ copy_one_file(image_ok, archive_path + abi_name,
+ options::outdirectory + abi_name);
+
+ /* copy over the <session-dir>/samples/oprofiled.log file */
+ string log_name = string(op_samples_dir) + "/oprofiled.log";
+ copy_one_file(image_ok, archive_path + log_name,
+ options::outdirectory + log_name);
+
+ return 0;
+}
+
+} // anonymous namespace
+
+
+int main(int argc, char const * argv[])
+{
+ return run_pp_tool(argc, argv, oparchive);
+}
diff --git a/pp/oparchive_options.cpp b/pp/oparchive_options.cpp
new file mode 100644
index 0000000..4b33aec
--- /dev/null
+++ b/pp/oparchive_options.cpp
@@ -0,0 +1,119 @@
+/**
+ * @file oparchive_options.cpp
+ * Options for oparchive tool
+ *
+ * @remark Copyright 2002, 2003, 2004 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author William Cohen
+ * @author Philippe Elie
+ */
+
+#include <vector>
+#include <list>
+#include <iostream>
+#include <algorithm>
+#include <iterator>
+#include <fstream>
+
+#include "profile_spec.h"
+#include "arrange_profiles.h"
+#include "oparchive_options.h"
+#include "popt_options.h"
+#include "string_filter.h"
+#include "file_manip.h"
+#include "cverb.h"
+
+
+using namespace std;
+
+profile_classes classes;
+list<string> sample_files;
+
+namespace options {
+ demangle_type demangle = dmt_normal;
+ bool exclude_dependent;
+ merge_option merge_by;
+ string outdirectory;
+ bool list_files;
+}
+
+
+namespace {
+
+vector<string> mergespec;
+
+popt::option options_array[] = {
+ popt::option(options::outdirectory, "output-directory", 'o',
+ "output to the given directory", "directory"),
+ popt::option(options::exclude_dependent, "exclude-dependent", 'x',
+ "exclude libs, kernel, and module samples for applications"),
+ popt::option(options::list_files, "list-files", 'l',
+ "just list the files necessary, don't produce the archive")
+};
+
+
+/**
+ * check incompatible or meaningless options
+ *
+ */
+void check_options()
+{
+ using namespace options;
+
+ /* output directory is required */
+ if (!list_files) {
+ if (outdirectory.size() == 0) {
+ cerr << "Requires --output-directory option." << endl;
+ exit(EXIT_FAILURE);
+ }
+ string realpath = op_realpath(outdirectory);
+ if (realpath == "/") {
+ cerr << "Invalid --output-directory: /" << endl;
+ exit(EXIT_FAILURE);
+ }
+ }
+}
+
+} // anonymous namespace
+
+
+void handle_options(options::spec const & spec)
+{
+ using namespace options;
+
+ if (spec.first.size()) {
+ cerr << "differential profiles not allowed" << endl;
+ exit(EXIT_FAILURE);
+ }
+
+ // merging doesn't occur in oparchive but we must allow it to avoid
+ // triggering sanity checking in arrange_profiles()
+ merge_by.cpu = true;
+ merge_by.lib = true;
+ merge_by.tid = true;
+ merge_by.tgid = true;
+ merge_by.unitmask = true;
+ check_options();
+
+ profile_spec const pspec =
+ profile_spec::create(spec.common, image_path, root_path);
+
+ sample_files = pspec.generate_file_list(exclude_dependent, false);
+
+ cverb << vsfile << "Matched sample files: " << sample_files.size()
+ << endl;
+ copy(sample_files.begin(), sample_files.end(),
+ ostream_iterator<string>(cverb << vsfile, "\n"));
+
+ classes = arrange_profiles(sample_files, merge_by,
+ pspec.extra_found_images);
+
+ cverb << vsfile << "profile_classes:\n" << classes << endl;
+
+ if (classes.v.empty()) {
+ cerr << "error: no sample files found: profile specification "
+ "too strict ?" << endl;
+ exit(EXIT_FAILURE);
+ }
+}
diff --git a/pp/oparchive_options.h b/pp/oparchive_options.h
new file mode 100644
index 0000000..69c0c21
--- /dev/null
+++ b/pp/oparchive_options.h
@@ -0,0 +1,39 @@
+/**
+ * @file oparchive_options.h
+ * Options for oparchive tool
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author Will Cohen
+ * @author Philippe Elie
+ */
+
+#ifndef OPARCHIVE_OPTIONS_H
+#define OPARCHIVE_OPTIONS_H
+
+#include "common_option.h"
+
+class profile_classes;
+class merge_option;
+
+namespace options {
+ extern bool exclude_dependent;
+ extern merge_option merge_by;
+ extern std::string outdirectory;
+ extern bool list_files;
+}
+
+/// All the chosen sample files.
+extern profile_classes classes;
+extern std::list<std::string> sample_files;
+
+/**
+ * handle_options - process command line
+ * @param spec profile specification
+ *
+ * Process the spec, fatally complaining on error.
+ */
+void handle_options(options::spec const & spec);
+
+#endif // OPARCHIVE_OPTIONS_H
diff --git a/pp/opgprof.cpp b/pp/opgprof.cpp
new file mode 100644
index 0000000..6550f21
--- /dev/null
+++ b/pp/opgprof.cpp
@@ -0,0 +1,322 @@
+/**
+ * @file opgprof.cpp
+ * Implement opgprof utility
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include <iostream>
+#include <cstdio>
+
+#include "op_header.h"
+#include "profile.h"
+#include "op_libiberty.h"
+#include "op_fileio.h"
+#include "string_filter.h"
+#include "profile_container.h"
+#include "arrange_profiles.h"
+#include "image_errors.h"
+#include "opgprof_options.h"
+#include "cverb.h"
+#include "op_file.h"
+
+using namespace std;
+
+extern profile_classes classes;
+
+namespace {
+
+#define GMON_VERSION 1
+#define GMON_TAG_TIME_HIST 0
+#define GMON_TAG_CG_ARC 1
+
+struct gmon_hdr {
+ char cookie[4];
+ u32 version;
+ u32 spare[3];
+};
+
+
+void op_write_vma(FILE * fp, op_bfd const & abfd, bfd_vma vma)
+{
+ // bfd vma write size is a per binary property not a bfd
+ // configuration property
+ switch (abfd.bfd_arch_bits_per_address()) {
+ case 32:
+ op_write_u32(fp, vma);
+ break;
+ case 64:
+ op_write_u64(fp, vma);
+ break;
+ default:
+ cerr << "oprofile: unknown vma size for this binary\n";
+ exit(EXIT_FAILURE);
+ }
+}
+
+
+void get_vma_range(bfd_vma & min, bfd_vma & max,
+ profile_container const & samples)
+{
+ min = bfd_vma(-1);
+ max = 0;
+
+ sample_container::samples_iterator it = samples.begin();
+ sample_container::samples_iterator end = samples.end();
+ for (; it != end ; ++it) {
+ if (it->second.vma < min)
+ min = it->second.vma;
+ if (it->second.vma > max)
+ max = it->second.vma;
+ }
+
+ if (min == bfd_vma(-1))
+ min = 0;
+ // we must return a range [min, max) not a range [min, max]
+ if (max != 0)
+ max += 1;
+}
+
+
+/**
+ * @param abfd bfd object
+ * @param samples_files profile container to act on
+ * @param gap a power of 2
+ *
+ * return true if all sample in samples_files are at least aligned on gap. This
+ * function is used to get at runtime the right size of gprof bin size
+ * reducing gmon.out on arch with fixed size instruction length
+ *
+ */
+bool aligned_samples(profile_container const & samples, int gap)
+{
+ sample_container::samples_iterator it = samples.begin();
+ sample_container::samples_iterator end = samples.end();
+ for (; it != end ; ++it) {
+ if (it->second.vma % gap)
+ return false;
+ }
+
+ return true;
+}
+
+
+void output_cg(FILE * fp, op_bfd const & abfd, profile_t const & cg_db)
+{
+ opd_header const & header = cg_db.get_header();
+ bfd_vma offset = 0;
+ if (header.is_kernel)
+ offset = abfd.get_start_offset(0);
+ else
+ offset = header.anon_start;
+
+ profile_t::iterator_pair p_it = cg_db.samples_range();
+ for (; p_it.first != p_it.second; ++p_it.first) {
+ bfd_vma from = p_it.first.vma() >> 32;
+ bfd_vma to = p_it.first.vma() & 0xffffffff;
+
+ op_write_u8(fp, GMON_TAG_CG_ARC);
+ op_write_vma(fp, abfd, abfd.offset_to_pc(from + offset));
+ op_write_vma(fp, abfd, abfd.offset_to_pc(to + offset));
+ u32 count = p_it.first.count();
+ if (count != p_it.first.count()) {
+ count = (u32)-1;
+ cerr << "Warning: capping sample count by "
+ << p_it.first.count() - count << endl;
+ }
+ op_write_u32(fp, p_it.first.count());
+ }
+}
+
+
+void output_gprof(op_bfd const & abfd, profile_container const & samples,
+ profile_t const & cg_db, string const & gmon_filename)
+{
+ static gmon_hdr hdr = { { 'g', 'm', 'o', 'n' }, GMON_VERSION, {0, 0, 0 } };
+
+ bfd_vma low_pc;
+ bfd_vma high_pc;
+
+ /* FIXME worth to try more multiplier ? */
+ int multiplier = 2;
+ if (aligned_samples(samples, 4))
+ multiplier = 8;
+
+ cverb << vdebug << "opgrof multiplier: " << multiplier << endl;
+
+ get_vma_range(low_pc, high_pc, samples);
+
+ cverb << vdebug << "low_pc: " << hex << low_pc << " " << "high_pc: "
+ << high_pc << dec << endl;
+
+ // round-down low_pc to ensure bin number is correct in the inner loop
+ low_pc = (low_pc / multiplier) * multiplier;
+ // round-up high_pc to ensure a correct histsize calculus
+ high_pc = ((high_pc + multiplier - 1) / multiplier) * multiplier;
+
+ cverb << vdebug << "low_pc: " << hex << low_pc << " " << "high_pc: "
+ << high_pc << dec << endl;
+
+ size_t histsize = (high_pc - low_pc) / multiplier;
+
+ // FIXME: must we skip the flat profile write if histsize == 0 ?
+ // (this can occur with callgraph w/o samples to the binary) but in
+ // this case user must gprof --no-flat-profile which is a bit boring
+ // and result *seems* weirds.
+
+ FILE * fp = op_open_file(gmon_filename.c_str(), "w");
+
+ op_write_file(fp, &hdr, sizeof(gmon_hdr));
+ op_write_u8(fp, GMON_TAG_TIME_HIST);
+
+ op_write_vma(fp, abfd, low_pc);
+ op_write_vma(fp, abfd, high_pc);
+ /* size of histogram */
+ op_write_u32(fp, histsize);
+ /* profiling rate */
+ op_write_u32(fp, 1);
+ op_write_file(fp, "samples\0\0\0\0\0\0\0\0", 15);
+ /* abbreviation */
+ op_write_u8(fp, '1');
+
+ u16 * hist = (u16*)xcalloc(histsize, sizeof(u16));
+
+ profile_container::symbol_choice choice;
+ choice.threshold = options::threshold;
+ symbol_collection symbols = samples.select_symbols(choice);
+
+ symbol_collection::const_iterator sit = symbols.begin();
+ symbol_collection::const_iterator send = symbols.end();
+
+ for (; sit != send; ++sit) {
+ sample_container::samples_iterator it = samples.begin(*sit);
+ sample_container::samples_iterator end = samples.end(*sit);
+ for (; it != end ; ++it) {
+ u32 pos = (it->second.vma - low_pc) / multiplier;
+ count_type count = it->second.counts[0];
+
+ if (pos >= histsize) {
+ cerr << "Bogus histogram bin " << pos
+ << ", larger than " << pos << " !\n";
+ continue;
+ }
+
+ if (hist[pos] + count > (u16)-1) {
+ hist[pos] = (u16)-1;
+ cerr << "Warning: capping sample count by "
+ << hist[pos] + count - ((u16)-1) << endl;
+ } else {
+ hist[pos] += (u16)count;
+ }
+ }
+ }
+
+ op_write_file(fp, hist, histsize * sizeof(u16));
+
+ if (!cg_db.empty())
+ output_cg(fp, abfd, cg_db);
+
+ op_close_file(fp);
+
+ free(hist);
+}
+
+
+void
+load_samples(op_bfd const & abfd, list<profile_sample_files> const & files,
+ string const & image, profile_container & samples)
+{
+ list<profile_sample_files>::const_iterator it = files.begin();
+ list<profile_sample_files>::const_iterator const end = files.end();
+
+ for (; it != end; ++it) {
+ // we can get call graph w/o any samples to the binary
+ if (it->sample_filename.empty())
+ continue;
+
+ cverb << vsfile << "loading flat samples files : "
+ << it->sample_filename << endl;
+
+ profile_t profile;
+
+ profile.add_sample_file(it->sample_filename);
+ profile.set_offset(abfd);
+
+ check_mtime(abfd.get_filename(), profile.get_header());
+
+ samples.add(profile, abfd, image, 0);
+ }
+}
+
+
+void load_cg(profile_t & cg_db, list<profile_sample_files> const & files)
+{
+ list<profile_sample_files>::const_iterator it = files.begin();
+ list<profile_sample_files>::const_iterator const end = files.end();
+
+ /* the list of non cg files is a super set of the list of cg file
+ * (module always log a samples to non-cg files before logging
+ * call stack) so by using the list of non-cg file we are sure to get
+ * all existing cg files.
+ */
+ for (; it != end; ++it) {
+ list<string>::const_iterator cit;
+ list<string>::const_iterator const cend = it->cg_files.end();
+ for (cit = it->cg_files.begin(); cit != cend; ++cit) {
+ // FIXME: do we need filtering ?
+ /* We can't handle start_offset now but after splitting
+ * data in from/to eip. */
+ cverb << vsfile << "loading cg samples file : "
+ << *cit << endl;
+ cg_db.add_sample_file(*cit);
+ }
+ }
+}
+
+
+int opgprof(options::spec const & spec)
+{
+ handle_options(spec);
+
+ profile_container samples(false, true, classes.extra_found_images);
+
+ bool ok = image_profile.error == image_ok;
+ // FIXME: symbol_filter would be allowed through option
+ op_bfd abfd(image_profile.image, string_filter(),
+ classes.extra_found_images, ok);
+ if (!ok && image_profile.error == image_ok)
+ image_profile.error = image_format_failure;
+
+ if (image_profile.error != image_ok) {
+ report_image_error(image_profile, true,
+ classes.extra_found_images);
+ exit(EXIT_FAILURE);
+ }
+
+ profile_t cg_db;
+
+ image_group_set const & groups = image_profile.groups[0];
+ image_group_set::const_iterator it;
+ for (it = groups.begin(); it != groups.end(); ++it) {
+ load_samples(abfd, it->files, image_profile.image, samples);
+
+ load_cg(cg_db, it->files);
+ }
+
+ output_gprof(abfd, samples, cg_db, options::gmon_filename);
+
+ return 0;
+}
+
+
+} // anonymous namespace
+
+
+int main(int argc, char const * argv[])
+{
+ return run_pp_tool(argc, argv, opgprof);
+}
diff --git a/pp/opgprof_options.cpp b/pp/opgprof_options.cpp
new file mode 100644
index 0000000..abeaeac
--- /dev/null
+++ b/pp/opgprof_options.cpp
@@ -0,0 +1,124 @@
+/**
+ * @file opgprof_options.cpp
+ * Options for opgprof tool
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include <cstdlib>
+
+#include <vector>
+#include <list>
+#include <iterator>
+#include <iostream>
+#include <cstdlib>
+
+#include "opgprof_options.h"
+#include "popt_options.h"
+#include "cverb.h"
+#include "profile_spec.h"
+#include "arrange_profiles.h"
+
+using namespace std;
+
+profile_classes classes;
+inverted_profile image_profile;
+
+namespace options {
+ string gmon_filename = "gmon.out";
+
+ // Ugly, for build only
+ demangle_type demangle;
+}
+
+
+namespace {
+
+popt::option options_array[] = {
+ popt::option(options::gmon_filename, "output-filename", 'o',
+ "output filename, defaults to gmon.out if not specified",
+ "filename"),
+ popt::option(options::threshold_opt, "threshold", 't',
+ "minimum percentage needed to produce output",
+ "percent"),
+};
+
+
+bool try_merge_profiles(profile_spec const & spec, bool exclude_dependent)
+{
+ list<string> sample_files = spec.generate_file_list(exclude_dependent, false);
+
+ cverb << vsfile
+ << "Matched sample files: " << sample_files.size() << endl;
+ copy(sample_files.begin(), sample_files.end(),
+ ostream_iterator<string>(cverb << vsfile, "\n"));
+
+ // opgprof merge all by default
+ merge_option merge_by;
+ merge_by.cpu = true;
+ merge_by.lib = true;
+ merge_by.tid = true;
+ merge_by.tgid = true;
+ merge_by.unitmask = true;
+
+ classes = arrange_profiles(sample_files, merge_by,
+ spec.extra_found_images);
+
+ cverb << vsfile << "profile_classes:\n" << classes << endl;
+
+ size_t nr_classes = classes.v.size();
+
+ list<inverted_profile> iprofiles = invert_profiles(classes);
+
+ if (nr_classes == 1 && iprofiles.size() == 1) {
+ image_profile = *(iprofiles.begin());
+ return true;
+ }
+
+ // come round for another try
+ if (exclude_dependent)
+ return false;
+
+ if (iprofiles.empty()) {
+ cerr << "error: no sample files found: profile specification "
+ "too strict ?" << endl;
+ exit(EXIT_FAILURE);
+ }
+
+ if (nr_classes > 1 || iprofiles.size() > 1) {
+ cerr << "error: specify exactly one binary to process "
+ "and give an event: or count: specification if necessary"
+ << endl;
+ exit(EXIT_FAILURE);
+ }
+
+ return false;
+}
+
+} // anonymous namespace
+
+
+void handle_options(options::spec const & spec)
+{
+ if (spec.first.size()) {
+ cerr << "differential profiles not allowed" << endl;
+ exit(EXIT_FAILURE);
+ }
+
+ profile_spec const pspec =
+ profile_spec::create(spec.common, options::image_path,
+ options::root_path);
+
+ cverb << vsfile << "output filename: " << options::gmon_filename
+ << endl;
+
+ // we do a first try with exclude-dependent if it fails we include
+ // dependent. First try should catch "opgrof /usr/bin/make" whilst
+ // the second catch "opgprof /lib/libc-2.2.5.so"
+ if (!try_merge_profiles(pspec, true))
+ try_merge_profiles(pspec, false);
+}
diff --git a/pp/opgprof_options.h b/pp/opgprof_options.h
new file mode 100644
index 0000000..09edcc8
--- /dev/null
+++ b/pp/opgprof_options.h
@@ -0,0 +1,36 @@
+/**
+ * @file opgprof_options.h
+ * Options for opgprof tool
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#ifndef OPGPROF_OPTIONS_H
+#define OPGPROF_OPTIONS_H
+
+#include <string>
+
+#include "common_option.h"
+
+namespace options {
+ extern std::string gmon_filename;
+}
+
+class inverted_profile;
+
+/// a set of sample filenames to handle.
+extern inverted_profile image_profile;
+
+/**
+ * handle_options - process command line
+ * @param spec profile specification
+ *
+ * Process the spec, fatally complaining on error.
+ */
+void handle_options(options::spec const & spec);
+
+#endif // OPGPROF_OPTIONS_H
diff --git a/pp/opreport.cpp b/pp/opreport.cpp
new file mode 100644
index 0000000..327043c
--- /dev/null
+++ b/pp/opreport.cpp
@@ -0,0 +1,591 @@
+/**
+ * @file opreport.cpp
+ * Implement opreport utility
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include <iostream>
+#include <iomanip>
+#include <vector>
+#include <algorithm>
+#include <sstream>
+#include <numeric>
+
+#include "op_exception.h"
+#include "stream_util.h"
+#include "string_manip.h"
+#include "file_manip.h"
+#include "opreport_options.h"
+#include "op_header.h"
+#include "profile.h"
+#include "populate.h"
+#include "arrange_profiles.h"
+#include "profile_container.h"
+#include "callgraph_container.h"
+#include "diff_container.h"
+#include "symbol_sort.h"
+#include "format_output.h"
+#include "xml_utils.h"
+#include "image_errors.h"
+
+using namespace std;
+
+namespace {
+
+static size_t nr_classes;
+
+/// storage for a merged file summary
+struct summary {
+ count_array_t counts;
+ string lib_image;
+
+ bool operator<(summary const & rhs) const {
+ return options::reverse_sort
+ ? counts[0] < rhs.counts[0] : rhs.counts[0] < counts[0];
+ }
+
+ /// add a set of files to a summary
+ count_type add_files(list<profile_sample_files> const & files,
+ size_t pclass);
+};
+
+
+count_type summary::
+add_files(list<profile_sample_files> const & files, size_t pclass)
+{
+ count_type subtotal = 0;
+
+ list<profile_sample_files>::const_iterator it = files.begin();
+ list<profile_sample_files>::const_iterator const end = files.end();
+
+ for (; it != end; ++it) {
+ count_type count = profile_t::sample_count(it->sample_filename);
+ counts[pclass] += count;
+ subtotal += count;
+
+ if (!it->cg_files.empty()) {
+ throw op_runtime_error("opreport.cpp::add_files(): "
+ "unxpected non empty cg file set");
+ }
+ }
+
+ return subtotal;
+}
+
+
+/**
+ * Summary of an application: a set of image summaries
+ * for one application, i.e. an application image and all
+ * dependent images such as libraries.
+ */
+struct app_summary {
+ /// total count of us and all dependents
+ count_array_t counts;
+ /// the main image
+ string image;
+ /// our dependent images
+ vector<summary> deps;
+
+ /// construct and fill in the data
+ count_type add_profile(profile_set const & profile, size_t pclass);
+
+ bool operator<(app_summary const & rhs) const {
+ return options::reverse_sort
+ ? counts[0] < rhs.counts[0] : rhs.counts[0] < counts[0];
+ }
+
+private:
+ /// find a matching summary (including main app summary)
+ summary & find_summary(string const & image);
+};
+
+
+summary & app_summary::find_summary(string const & image)
+{
+ vector<summary>::iterator sit = deps.begin();
+ vector<summary>::iterator const send = deps.end();
+ for (; sit != send; ++sit) {
+ if (sit->lib_image == image)
+ return *sit;
+ }
+
+ summary summ;
+ summ.lib_image = image;
+ deps.push_back(summ);
+ return deps.back();
+}
+
+
+count_type app_summary::add_profile(profile_set const & profile,
+ size_t pclass)
+{
+ count_type group_total = 0;
+
+ // first the main image
+ summary & summ = find_summary(profile.image);
+ count_type app_count = summ.add_files(profile.files, pclass);
+ counts[pclass] += app_count;
+ group_total += app_count;
+
+ // now all dependent images if any
+ list<profile_dep_set>::const_iterator it = profile.deps.begin();
+ list<profile_dep_set>::const_iterator const end = profile.deps.end();
+
+ for (; it != end; ++it) {
+ summary & summ = find_summary(it->lib_image);
+ count_type lib_count = summ.add_files(it->files, pclass);
+ counts[pclass] += lib_count;
+ group_total += lib_count;
+ }
+
+ return group_total;
+}
+
+
+/// all the summaries
+struct summary_container {
+ summary_container(vector<profile_class> const & pclasses);
+
+ /// all map summaries
+ vector<app_summary> apps;
+ /// total count of samples for all summaries
+ count_array_t total_counts;
+};
+
+
+summary_container::
+summary_container(vector<profile_class> const & pclasses)
+{
+ typedef map<string, app_summary> app_map_t;
+ app_map_t app_map;
+
+ for (size_t i = 0; i < pclasses.size(); ++i) {
+ list<profile_set>::const_iterator it
+ = pclasses[i].profiles.begin();
+ list<profile_set>::const_iterator const end
+ = pclasses[i].profiles.end();
+
+ for (; it != end; ++it) {
+ app_map_t::iterator ait = app_map.find(it->image);
+ if (ait == app_map.end()) {
+ app_summary app;
+ app.image = it->image;
+ total_counts[i] += app.add_profile(*it, i);
+ app_map[app.image] = app;
+ } else {
+ total_counts[i]
+ += ait->second.add_profile(*it, i);
+ }
+ }
+ }
+
+ app_map_t::const_iterator it = app_map.begin();
+ app_map_t::const_iterator const end = app_map.end();
+
+ for (; it != end; ++it)
+ apps.push_back(it->second);
+
+ // sort by count
+ stable_sort(apps.begin(), apps.end());
+ vector<app_summary>::iterator ait = apps.begin();
+ vector<app_summary>::iterator const aend = apps.end();
+ for (; ait != aend; ++ait)
+ stable_sort(ait->deps.begin(), ait->deps.end());
+}
+
+
+void output_header()
+{
+ if (!options::show_header)
+ return;
+
+ cout << classes.cpuinfo << endl;
+ if (!classes.event.empty())
+ cout << classes.event << endl;
+
+ for (vector<profile_class>::size_type i = 0;
+ i < classes.v.size(); ++i) {
+ cout << classes.v[i].longname << endl;
+ }
+}
+
+
+string get_filename(string const & filename)
+{
+ return options::long_filenames ? filename : op_basename(filename);
+}
+
+
+/// Output a count and a percentage
+void output_count(count_type total_count, count_type count)
+{
+ cout << setw(9) << count << ' ';
+ double ratio = op_ratio(count, total_count);
+ cout << format_percent(ratio * 100, percent_int_width,
+ percent_fract_width) << ' ';
+}
+
+
+void output_col_headers(bool indent)
+{
+ if (!options::show_header)
+ return;
+
+ if (indent)
+ cout << '\t';
+
+ size_t colwidth = 9 + 1 + percent_width;
+
+ for (size_t i = 0; i < classes.v.size(); ++i) {
+ string name = classes.v[i].name;
+ if (name.length() > colwidth)
+ name = name.substr(0, colwidth - 3)
+ + "...";
+ io_state state(cout);
+ // gcc 2.95 doesn't know right io manipulator
+ cout.setf(ios::right, ios::adjustfield);
+ // gcc 2.95 doesn't honor setw() for std::string
+ cout << setw(colwidth) << name.c_str();
+ cout << '|';
+ }
+ cout << '\n';
+
+ if (indent)
+ cout << '\t';
+
+ for (size_t i = 0; i < classes.v.size(); ++i) {
+ cout << " samples| ";
+ io_state state(cout);
+ // gcc 2.95 doesn't know right io manipulator
+ cout.setf(ios::right, ios::adjustfield);
+ cout << setw(percent_width) << "%|";
+ }
+
+ cout << '\n';
+
+ if (indent)
+ cout << '\t';
+
+ for (size_t i = 0; i < classes.v.size(); ++i) {
+ cout << "-----------";
+ string str(percent_width, '-');
+ cout << str;
+ }
+
+ cout << '\n';
+}
+
+
+void
+output_deps(summary_container const & summaries,
+ app_summary const & app)
+{
+ // the app summary itself is *always* present
+ // (perhaps with zero counts) so this test
+ // is correct
+ if (app.deps.size() == 1)
+ return;
+
+ output_col_headers(true);
+
+ for (size_t j = 0 ; j < app.deps.size(); ++j) {
+ summary const & summ = app.deps[j];
+
+ if (summ.counts.zero())
+ continue;
+
+ cout << '\t';
+
+ for (size_t i = 0; i < nr_classes; ++i) {
+ count_type tot_count = options::global_percent
+ ? summaries.total_counts[i] : app.counts[i];
+
+ output_count(tot_count, summ.counts[i]);
+ }
+
+ cout << get_filename(summ.lib_image);
+ cout << '\n';
+ }
+}
+
+
+/**
+ * Display all the given summary information
+ */
+void output_summaries(summary_container const & summaries)
+{
+ output_col_headers(false);
+
+ for (size_t i = 0; i < summaries.apps.size(); ++i) {
+ app_summary const & app = summaries.apps[i];
+
+ if ((app.counts[0] * 100.0) / summaries.total_counts[0]
+ < options::threshold) {
+ continue;
+ }
+
+ for (size_t j = 0; j < nr_classes; ++j)
+ output_count(summaries.total_counts[j], app.counts[j]);
+
+ cout << get_filename(app.image) << '\n';
+
+ output_deps(summaries, app);
+ }
+}
+
+
+format_flags get_format_flags(column_flags const & cf)
+{
+ format_flags flags(ff_none);
+ flags = format_flags(flags | ff_nr_samples);
+ flags = format_flags(flags | ff_percent | ff_symb_name);
+
+ if (options::show_address)
+ flags = format_flags(flags | ff_vma);
+
+ if (options::debug_info)
+ flags = format_flags(flags | ff_linenr_info);
+
+ if (options::accumulated) {
+ flags = format_flags(flags | ff_nr_samples_cumulated);
+ flags = format_flags(flags | ff_percent_cumulated);
+ }
+
+ if (classes2.v.size())
+ flags = format_flags(flags | ff_diff);
+
+ if (cf & cf_image_name)
+ flags = format_flags(flags | ff_image_name);
+
+ return flags;
+}
+
+
+void output_symbols(profile_container const & pc, bool multiple_apps)
+{
+ profile_container::symbol_choice choice;
+ choice.threshold = options::threshold;
+ symbol_collection symbols = pc.select_symbols(choice);
+ options::sort_by.sort(symbols, options::reverse_sort,
+ options::long_filenames);
+ format_output::formatter * out;
+ format_output::xml_formatter * xml_out = 0;
+ format_output::opreport_formatter * text_out = 0;
+
+ if (options::xml) {
+ xml_out = new format_output::xml_formatter(&pc, symbols,
+ pc.extra_found_images, options::symbol_filter);
+ 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::opreport_formatter(pc);
+ text_out->show_details(options::details);
+ 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(choice.hints & cf_64bit_vma);
+ out->show_global_percent(options::global_percent);
+
+ format_flags flags = get_format_flags(choice.hints);
+ if (multiple_apps)
+ flags = format_flags(flags | ff_app_name);
+
+ out->add_format(flags);
+
+ if (options::xml) {
+ xml_support = new xml_utils(xml_out, symbols, nr_classes,
+ pc.extra_found_images);
+ xml_out->output(cout);
+ } else {
+ text_out->output(cout, symbols);
+ }
+}
+
+
+void output_diff_symbols(profile_container const & pc1,
+ profile_container const & pc2, bool multiple_apps)
+{
+ diff_container dc(pc1, pc2);
+
+ profile_container::symbol_choice choice;
+ choice.threshold = options::threshold;
+
+ diff_collection symbols = dc.get_symbols(choice);
+
+ format_flags flags = get_format_flags(choice.hints);
+ if (multiple_apps)
+ flags = format_flags(flags | ff_app_name);
+
+ // With diff profile we output only filename coming from the first
+ // profile session, internally we use only name derived from the sample
+ // filename so image name can match.
+ format_output::diff_formatter out(dc, pc1.extra_found_images);
+
+ out.set_nr_classes(nr_classes);
+ out.show_long_filenames(options::long_filenames);
+ out.show_header(options::show_header);
+ out.show_global_percent(options::global_percent);
+ out.vma_format_64bit(choice.hints & cf_64bit_vma);
+ out.add_format(flags);
+
+ options::sort_by.sort(symbols, options::reverse_sort,
+ options::long_filenames);
+
+ out.output(cout, symbols);
+}
+
+
+void output_cg_symbols(callgraph_container const & cg, bool multiple_apps)
+{
+ column_flags output_hints = cg.output_hint();
+
+ symbol_collection symbols = cg.get_symbols();
+
+ options::sort_by.sort(symbols, options::reverse_sort,
+ options::long_filenames);
+
+ format_output::formatter * out;
+ format_output::xml_cg_formatter * xml_out = 0;
+ format_output::cg_formatter * text_out = 0;
+
+ if (options::xml) {
+ xml_out = new format_output::xml_cg_formatter(cg, symbols,
+ options::symbol_filter);
+ 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);
+
+ if (options::xml) {
+ xml_support = new xml_utils(xml_out, symbols, nr_classes,
+ cg.extra_found_images);
+ xml_out->output(cout);
+ } else {
+ text_out->output(cout, symbols);
+ }
+
+}
+
+
+int opreport(options::spec const & spec)
+{
+ want_xml = options::xml;
+
+ handle_options(spec);
+
+ nr_classes = classes.v.size();
+
+ if (!options::symbols && !options::xml) {
+ summary_container summaries(classes.v);
+ output_header();
+ output_summaries(summaries);
+ return 0;
+ }
+
+ bool multiple_apps = false;
+
+ for (size_t i = 0; i < classes.v.size(); ++i) {
+ if (classes.v[i].profiles.size() > 1)
+ multiple_apps = true;
+ }
+
+ list<inverted_profile> iprofiles = invert_profiles(classes);
+
+ report_image_errors(iprofiles, classes.extra_found_images);
+
+ if (options::xml) {
+ xml_utils::output_xml_header(options::command_options,
+ classes.cpuinfo, classes.event);
+ } else {
+ output_header();
+ }
+
+ if (classes2.v.size()) {
+ for (size_t i = 0; i < classes2.v.size(); ++i) {
+ if (classes2.v[i].profiles.size() > 1)
+ multiple_apps |= true;
+ }
+
+ profile_container pc1(options::debug_info, options::details,
+ classes.extra_found_images);
+
+ list<inverted_profile>::iterator it = iprofiles.begin();
+ list<inverted_profile>::iterator const end = iprofiles.end();
+
+ for (; it != end; ++it)
+ populate_for_image(pc1, *it,
+ options::symbol_filter, 0);
+
+ list<inverted_profile> iprofiles2 = invert_profiles(classes2);
+
+ report_image_errors(iprofiles2, classes2.extra_found_images);
+
+ profile_container pc2(options::debug_info, options::details,
+ classes2.extra_found_images);
+
+ list<inverted_profile>::iterator it2 = iprofiles2.begin();
+ list<inverted_profile>::iterator const end2 = iprofiles2.end();
+
+ for (; it2 != end2; ++it2)
+ populate_for_image(pc2, *it2,
+ options::symbol_filter, 0);
+
+ output_diff_symbols(pc1, pc2, multiple_apps);
+ } else if (options::callgraph) {
+ callgraph_container cg_container;
+ cg_container.populate(iprofiles, classes.extra_found_images,
+ options::debug_info, options::threshold,
+ options::merge_by.lib, options::symbol_filter);
+
+ output_cg_symbols(cg_container, multiple_apps);
+ } else {
+ profile_container samples(options::debug_info,
+ options::details, classes.extra_found_images);
+
+ list<inverted_profile>::iterator it = iprofiles.begin();
+ list<inverted_profile>::iterator const end = iprofiles.end();
+
+ for (; it != end; ++it)
+ populate_for_image(samples, *it,
+ options::symbol_filter, 0);
+
+ output_symbols(samples, multiple_apps);
+ }
+
+ return 0;
+}
+
+} // anonymous namespace
+
+
+int main(int argc, char const * argv[])
+{
+ cout.tie(0);
+ return run_pp_tool(argc, argv, opreport);
+}
diff --git a/pp/opreport_options.cpp b/pp/opreport_options.cpp
new file mode 100644
index 0000000..95d219c
--- /dev/null
+++ b/pp/opreport_options.cpp
@@ -0,0 +1,335 @@
+/**
+ * @file opreport_options.cpp
+ * Options for opreport tool
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#include <vector>
+#include <list>
+#include <iostream>
+#include <algorithm>
+#include <iterator>
+#include <fstream>
+
+#include "profile_spec.h"
+#include "arrange_profiles.h"
+#include "opreport_options.h"
+#include "popt_options.h"
+#include "string_filter.h"
+#include "file_manip.h"
+#include "xml_output.h"
+#include "xml_utils.h"
+#include "cverb.h"
+
+using namespace std;
+
+profile_classes classes;
+profile_classes classes2;
+
+namespace options {
+ demangle_type demangle = dmt_normal;
+ bool symbols;
+ bool callgraph;
+ bool debug_info;
+ bool details;
+ bool exclude_dependent;
+ string_filter symbol_filter;
+ sort_options sort_by;
+ merge_option merge_by;
+ bool show_header = true;
+ bool long_filenames;
+ bool show_address;
+ bool accumulated;
+ bool reverse_sort;
+ bool global_percent;
+ bool xml;
+ string xml_options;
+}
+
+
+namespace {
+
+string outfile;
+vector<string> mergespec;
+vector<string> sort;
+vector<string> exclude_symbols;
+vector<string> include_symbols;
+string demangle_option = "normal";
+
+popt::option options_array[] = {
+ popt::option(options::callgraph, "callgraph", 'c',
+ "show call graph"),
+ popt::option(options::details, "details", 'd',
+ "output detailed samples for each symbol"),
+ popt::option(options::symbols, "symbols", 'l',
+ "list all symbols"),
+
+ popt::option(outfile, "output-file", 'o',
+ "output to the given filename", "file"),
+
+ popt::option(sort, "sort", 's',
+ "sort by", "sample,image,app-name,symbol,debug,vma"),
+ popt::option(options::reverse_sort, "reverse-sort", 'r',
+ "use reverse sort"),
+ popt::option(mergespec, "merge", 'm',
+ "comma separated list", "cpu,lib,tid,tgid,unitmask,all"),
+ popt::option(options::exclude_dependent, "exclude-dependent", 'x',
+ "exclude libs, kernel, and module samples for applications"),
+ popt::option(exclude_symbols, "exclude-symbols", 'e',
+ "exclude these comma separated symbols", "symbols"),
+ popt::option(include_symbols, "include-symbols", 'i',
+ "include these comma separated symbols", "symbols"),
+ popt::option(options::threshold_opt, "threshold", 't',
+ "minimum percentage needed to produce output",
+ "percent"),
+
+ popt::option(demangle_option, "demangle", 'D',
+ "demangle GNU C++ symbol names (default normal)",
+ "none|normal|smart"),
+ // PP:5
+ popt::option(options::debug_info, "debug-info", 'g',
+ "add source file and line number to output"),
+ popt::option(options::show_header, "no-header", 'n',
+ "remove all headers from output"),
+ popt::option(options::show_address, "show-address", 'w',
+ "show VMA address of each symbol"),
+ popt::option(options::long_filenames, "long-filenames", 'f',
+ "show the full path of filenames"),
+ popt::option(options::accumulated, "accumulated", 'a',
+ "percentage field show accumulated count"),
+ popt::option(options::global_percent, "global-percent", '%',
+ "percentage are not relative to symbol count or image "
+ "count but total sample count"),
+
+ popt::option(options::xml, "xml", 'X',
+ "XML output"),
+
+};
+
+
+void handle_sort_option()
+{
+ if (options::xml && !sort.empty()) {
+ cerr << "warning: sort options ignored because they "
+ << "are incompatible with --xml" << endl;
+ // don't allow any other sorting, except the default below,
+ // to mess up symbol traversal for XML
+ sort.clear();
+ }
+
+ if (sort.empty() || options::xml) {
+ // PP:5.14 sort default to sample
+ if (options::xml) {
+ // implicitly sort by app-name,image so that in the
+ // symbol traversal all library module symbols are
+ // grouped together with their application
+ sort.push_back("app-name");
+ sort.push_back("image");
+ } else
+ sort.push_back("sample");
+ }
+
+ vector<string>::const_iterator cit = sort.begin();
+ vector<string>::const_iterator end = sort.end();
+
+ for (; cit != end; ++cit)
+ options::sort_by.add_sort_option(*cit);
+}
+
+
+void handle_output_file()
+{
+ if (outfile.empty())
+ return;
+
+ static ofstream os(outfile.c_str());
+ if (!os) {
+ cerr << "Couldn't open \"" << outfile
+ << "\" for writing." << endl;
+ exit(EXIT_FAILURE);
+ }
+
+ cout.rdbuf(os.rdbuf());
+}
+
+
+/// Check incompatible or meaningless options.
+void check_options(bool diff)
+{
+ using namespace options;
+
+ bool do_exit = false;
+
+ if (callgraph) {
+ symbols = true;
+ if (details) {
+ cerr << "--callgraph is incompatible with --details" << endl;
+ do_exit = true;
+ }
+
+ if (diff) {
+ cerr << "differential profiles are incompatible with --callgraph" << endl;
+ do_exit = true;
+ }
+ }
+
+ if (xml) {
+ if (accumulated) {
+ cerr << "--accumulated is incompatible with --xml" << endl;
+ do_exit = true;
+ }
+
+ if (global_percent) {
+ cerr << "--global_percent is incompatible with --xml" << endl;
+ do_exit = true;
+ }
+ }
+
+
+ if (details && diff) {
+ cerr << "differential profiles are incompatible with --details" << endl;
+ do_exit = true;
+ }
+
+ if (!symbols) {
+ if (diff) {
+ cerr << "different profiles are meaningless "
+ "without --symbols" << endl;
+ do_exit = true;
+ }
+
+ if (show_address) {
+ cerr << "--show-address is meaningless "
+ "without --symbols" << endl;
+ do_exit = true;
+ }
+
+ if (debug_info || accumulated) {
+ cerr << "--debug-info and --accumulated are "
+ << "meaningless without --symbols" << endl;
+ do_exit = true;
+ }
+
+ if (!exclude_symbols.empty() || !include_symbols.empty()) {
+ cerr << "--exclude-symbols and --include-symbols are "
+ << "meaningless without --symbols" << endl;
+ do_exit = true;
+ }
+
+ if (find(sort_by.options.begin(), sort_by.options.end(),
+ sort_options::vma) != sort_by.options.end()) {
+ cerr << "--sort=vma is "
+ << "meaningless without --symbols" << endl;
+ do_exit = true;
+ }
+ }
+
+ if (global_percent && symbols && !(details || callgraph)) {
+ cerr << "--global-percent is meaningless with --symbols "
+ "and without --details or --callgraph" << endl;
+ do_exit = true;
+ }
+
+ if (do_exit)
+ exit(EXIT_FAILURE);
+}
+
+
+/// process a spec into classes
+void process_spec(profile_classes & classes, list<string> const & spec)
+{
+ using namespace options;
+
+ copy(spec.begin(), spec.end(),
+ ostream_iterator<string>(cverb << vsfile, " "));
+ cverb << vsfile << "\n\n";
+
+ profile_spec const pspec =
+ profile_spec::create(spec, options::image_path,
+ options::root_path);
+
+ list<string> sample_files = pspec.generate_file_list(exclude_dependent,
+ !options::callgraph);
+
+ cverb << vsfile << "Archive: " << pspec.get_archive_path() << endl;
+
+ cverb << vsfile << "Matched sample files: " << sample_files.size()
+ << endl;
+ copy(sample_files.begin(), sample_files.end(),
+ ostream_iterator<string>(cverb << vsfile, "\n"));
+
+ classes = arrange_profiles(sample_files, merge_by,
+ pspec.extra_found_images);
+
+ cverb << vsfile << "profile_classes:\n" << classes << endl;
+
+ if (classes.v.empty()) {
+ cerr << "error: no sample files found: profile specification "
+ "too strict ?" << endl;
+ exit(EXIT_FAILURE);
+ }
+}
+
+
+} // namespace anon
+
+
+void handle_options(options::spec const & spec)
+{
+ using namespace options;
+
+ if (details) {
+ symbols = true;
+ show_address = true;
+ }
+
+ if (options::xml) {
+ if (spec.common.size() != 0)
+ xml_utils::add_option(SESSION, spec.common);
+ if (debug_info)
+ xml_utils::add_option(DEBUG_INFO, true);
+ if (details)
+ xml_utils::add_option(DETAILS, true);
+ if (!image_path.empty())
+ xml_utils::add_option(IMAGE_PATH, image_path);
+ if (!mergespec.empty())
+ xml_utils::add_option(MERGE, mergespec);
+ if (exclude_dependent)
+ xml_utils::add_option(EXCLUDE_DEPENDENT, true);
+ if (!exclude_symbols.empty())
+ xml_utils::add_option(EXCLUDE_SYMBOLS, exclude_symbols);
+ if (!include_symbols.empty())
+ xml_utils::add_option(INCLUDE_SYMBOLS, include_symbols);
+ }
+
+ handle_sort_option();
+ merge_by = handle_merge_option(mergespec, true, exclude_dependent);
+ handle_output_file();
+ demangle = handle_demangle_option(demangle_option);
+ check_options(spec.first.size());
+
+ symbol_filter = string_filter(include_symbols, exclude_symbols);
+
+ if (!spec.first.size()) {
+ process_spec(classes, spec.common);
+ } else {
+ if (options::xml) {
+ cerr << "differential profiles are incompatible with --xml" << endl;
+ exit(EXIT_FAILURE);
+ }
+ cverb << vsfile << "profile spec 1:" << endl;
+ process_spec(classes, spec.first);
+ cverb << vsfile << "profile spec 2:" << endl;
+ process_spec(classes2, spec.second);
+
+ if (!classes.matches(classes2)) {
+ cerr << "profile classes are incompatible" << endl;
+ exit(EXIT_FAILURE);
+ }
+ }
+}
diff --git a/pp/opreport_options.h b/pp/opreport_options.h
new file mode 100644
index 0000000..51ab7a6
--- /dev/null
+++ b/pp/opreport_options.h
@@ -0,0 +1,58 @@
+/**
+ * @file opreport_options.h
+ * Options for opreport tool
+ *
+ * @remark Copyright 2003 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#ifndef OPREPORT_OPTIONS_H
+#define OPREPORT_OPTIONS_H
+
+#include <string>
+#include <vector>
+#include <iosfwd>
+
+#include "common_option.h"
+#include "string_filter.h"
+#include "symbol_sort.h"
+
+class profile_classes;
+class merge_option;
+
+namespace options {
+ extern demangle_type demangle;
+ extern bool symbols;
+ extern bool callgraph;
+ extern bool debug_info;
+ extern bool details;
+ extern bool reverse_sort;
+ extern bool exclude_dependent;
+ extern sort_options sort_by;
+ extern merge_option merge_by;
+ extern bool global_percent;
+ extern bool long_filenames;
+ extern bool show_address;
+ extern string_filter symbol_filter;
+ extern bool show_header;
+ extern bool accumulated;
+ extern bool xml;
+ extern std::string xml_options;
+}
+
+/// All the chosen sample files.
+extern profile_classes classes;
+extern profile_classes classes2;
+
+/**
+ * handle_options - process command line
+ * @param spec profile specification
+ *
+ * Process the spec, fatally complaining on error.
+ */
+void handle_options(options::spec const & spec);
+
+#endif // OPREPORT_OPTIONS_H
diff --git a/utils/Makefile.am b/utils/Makefile.am
new file mode 100644
index 0000000..45136e0
--- /dev/null
+++ b/utils/Makefile.am
@@ -0,0 +1,10 @@
+AM_CPPFLAGS=-I ${top_srcdir}/libop -I ${top_srcdir}/libutil
+AM_CFLAGS = @OP_CFLAGS@
+
+LIBS=@POPT_LIBS@ @LIBERTY_LIBS@
+
+bin_PROGRAMS = ophelp
+dist_bin_SCRIPTS = opcontrol
+
+ophelp_SOURCES = ophelp.c
+ophelp_LDADD = ../libop/libop.a ../libutil/libutil.a
diff --git a/utils/Makefile.in b/utils/Makefile.in
new file mode 100644
index 0000000..726cb36
--- /dev/null
+++ b/utils/Makefile.in
@@ -0,0 +1,529 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+bin_PROGRAMS = ophelp$(EXEEXT)
+subdir = utils
+DIST_COMMON = $(dist_bin_SCRIPTS) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/binutils.m4 \
+ $(top_srcdir)/m4/builtinexpect.m4 \
+ $(top_srcdir)/m4/cellspubfdsupport.m4 \
+ $(top_srcdir)/m4/compileroption.m4 \
+ $(top_srcdir)/m4/configmodule.m4 \
+ $(top_srcdir)/m4/copyifchange.m4 $(top_srcdir)/m4/docbook.m4 \
+ $(top_srcdir)/m4/extradirs.m4 $(top_srcdir)/m4/findkernel.m4 \
+ $(top_srcdir)/m4/kerneloption.m4 \
+ $(top_srcdir)/m4/kernelversion.m4 \
+ $(top_srcdir)/m4/mallocattribute.m4 \
+ $(top_srcdir)/m4/poptconst.m4 \
+ $(top_srcdir)/m4/precompiledheader.m4 $(top_srcdir)/m4/qt.m4 \
+ $(top_srcdir)/m4/resultyn.m4 $(top_srcdir)/m4/sstream.m4 \
+ $(top_srcdir)/m4/typedef.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am_ophelp_OBJECTS = ophelp.$(OBJEXT)
+ophelp_OBJECTS = $(am_ophelp_OBJECTS)
+ophelp_DEPENDENCIES = ../libop/libop.a ../libutil/libutil.a
+dist_binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
+SCRIPTS = $(dist_bin_SCRIPTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(ophelp_SOURCES)
+DIST_SOURCES = $(ophelp_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BFD_LIBS = @BFD_LIBS@
+BUILD_JVMPI_AGENT_FALSE = @BUILD_JVMPI_AGENT_FALSE@
+BUILD_JVMPI_AGENT_TRUE = @BUILD_JVMPI_AGENT_TRUE@
+BUILD_JVMTI_AGENT_FALSE = @BUILD_JVMTI_AGENT_FALSE@
+BUILD_JVMTI_AGENT_TRUE = @BUILD_JVMTI_AGENT_TRUE@
+CAT_ENTRY_END = @CAT_ENTRY_END@
+CAT_ENTRY_START = @CAT_ENTRY_START@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DATE = @DATE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOCBOOK_ROOT = @DOCBOOK_ROOT@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+EXTRA_CFLAGS_MODULE = @EXTRA_CFLAGS_MODULE@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JAVA_HOMEDIR = @JAVA_HOMEDIR@
+KINC = @KINC@
+KSRC = @KSRC@
+KVERS = @KVERS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBERTY_LIBS = @LIBERTY_LIBS@
+LIBOBJS = @LIBOBJS@
+LIBS = @POPT_LIBS@ @LIBERTY_LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MOC = @MOC@
+MODINSTALLDIR = @MODINSTALLDIR@
+OBJEXT = @OBJEXT@
+OPROFILE_DIR = @OPROFILE_DIR@
+OPROFILE_MODULE_ARCH = @OPROFILE_MODULE_ARCH@
+OP_CFLAGS = @OP_CFLAGS@
+OP_CXXFLAGS = @OP_CXXFLAGS@
+OP_DOCDIR = @OP_DOCDIR@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+POPT_LIBS = @POPT_LIBS@
+PTRDIFF_T_TYPE = @PTRDIFF_T_TYPE@
+QT_INCLUDES = @QT_INCLUDES@
+QT_LDFLAGS = @QT_LDFLAGS@
+QT_LIB = @QT_LIB@
+QT_VERSION = @QT_VERSION@
+RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIZE_T_TYPE = @SIZE_T_TYPE@
+STRIP = @STRIP@
+UIC = @UIC@
+VERSION = @VERSION@
+XML_CATALOG = @XML_CATALOG@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
+X_CFLAGS = @X_CFLAGS@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_LIBS = @X_LIBS@
+X_PRE_LIBS = @X_PRE_LIBS@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+have_qt_FALSE = @have_qt_FALSE@
+have_qt_TRUE = @have_qt_TRUE@
+have_xsltproc_FALSE = @have_xsltproc_FALSE@
+have_xsltproc_TRUE = @have_xsltproc_TRUE@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+kernel_support_FALSE = @kernel_support_FALSE@
+kernel_support_TRUE = @kernel_support_TRUE@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+topdir = @topdir@
+AM_CPPFLAGS = -I ${top_srcdir}/libop -I ${top_srcdir}/libutil
+AM_CFLAGS = @OP_CFLAGS@
+dist_bin_SCRIPTS = opcontrol
+ophelp_SOURCES = ophelp.c
+ophelp_LDADD = ../libop/libop.a ../libutil/libutil.a
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign utils/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign utils/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ if test -f $$p \
+ || test -f $$p1 \
+ ; then \
+ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+ else :; fi; \
+ done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+ rm -f "$(DESTDIR)$(bindir)/$$f"; \
+ done
+
+clean-binPROGRAMS:
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+ophelp$(EXEEXT): $(ophelp_OBJECTS) $(ophelp_DEPENDENCIES)
+ @rm -f ophelp$(EXEEXT)
+ $(LINK) $(ophelp_LDFLAGS) $(ophelp_OBJECTS) $(ophelp_LDADD) $(LIBS)
+install-dist_binSCRIPTS: $(dist_bin_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+ @list='$(dist_bin_SCRIPTS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f $$d$$p; then \
+ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+ echo " $(dist_binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+ $(dist_binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \
+ else :; fi; \
+ done
+
+uninstall-dist_binSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(dist_bin_SCRIPTS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+ rm -f "$(DESTDIR)$(bindir)/$$f"; \
+ done
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ophelp.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS) $(SCRIPTS)
+installdirs:
+ for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-binPROGRAMS install-dist_binSCRIPTS
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-dist_binSCRIPTS \
+ uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+ clean-generic clean-libtool ctags distclean distclean-compile \
+ distclean-generic distclean-libtool distclean-tags distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-binPROGRAMS install-data install-data-am \
+ install-dist_binSCRIPTS install-exec install-exec-am \
+ install-info install-info-am install-man install-strip \
+ installcheck installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-binPROGRAMS \
+ uninstall-dist_binSCRIPTS uninstall-info-am
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/utils/opcontrol b/utils/opcontrol
new file mode 100644
index 0000000..8aee35a
--- /dev/null
+++ b/utils/opcontrol
@@ -0,0 +1,2020 @@
+#!/bin/sh
+#
+# opcontrol is a script to control OProfile
+# opcontrol --help and opcontrol --list-events have info
+#
+# Copyright 2002
+# Read the file COPYING
+#
+# Authors: John Levon, Philippe Elie, Will Cohen, Jens Wilke, Daniel Hansel
+#
+# Copyright IBM Corporation 2007
+#
+# NOTE: This script should be as shell independent as possible
+
+SYSCTL=do_sysctl
+
+# A replacement function for the sysctl (procps package) utility which is
+# missing on some distribution (e.g. slack 7.0).
+# Handles only the -w option of sysctl.
+do_sysctl()
+{
+ if test "$1" != "-w"; then
+ echo "$0 unknown sysctl option" >&2
+ exit 1
+ fi
+
+ shift
+
+ arg=`echo $1 | awk -F= '{print $1}'`
+ val=`echo $1 | awk -F= '{print $2}'`
+
+ dev_name=`echo $arg | tr . /`
+
+ if test ! -f /proc/sys/$dev_name; then
+ echo "/proc/sys/$dev_name does not exist or is not a regular file" >&2
+ exit 1
+ fi
+ echo $val > /proc/sys/$dev_name
+}
+
+
+# check value is set
+error_if_empty()
+{
+ if test -z "$2"; then
+ echo "No value given for option $1" >&2
+ do_help
+ exit 1
+ fi
+}
+
+
+# rm_device arguments $1=file_name
+rm_device()
+{
+ if test -c "$1"; then
+ vecho "Removing $1"
+ rm "$1"
+ fi
+}
+
+
+# create_device arguments $1=file_name $2=MAJOR_NR $3=MINOR_NR
+create_device()
+{
+ vecho "Doing mknod $1"
+ mknod "$1" c $2 $3
+ if test "$?" != "0"; then
+ echo "Couldn't mknod $1" >&2
+ exit 1
+ fi
+ chmod 700 "$1"
+}
+
+
+move_and_remove()
+{
+ if test -e $1; then
+ mv $1 $SAMPLES_DIR/.tmp_reset.$$
+ rm -rf $SAMPLES_DIR/.tmp_reset.$$
+ fi
+}
+
+
+# verbose echo
+vecho()
+{
+ if test -n "$VERBOSE"; then
+ echo $@
+ fi
+}
+
+
+is_tool_available()
+{
+ if which $1 &>/dev/null; then
+ if test -x `which $1`; then
+ return 1
+ fi
+ fi
+
+ return 0
+}
+
+
+# print help message
+do_help()
+{
+ cat >&2 <<EOF
+opcontrol: usage:
+ -l/--list-events list event types and unit masks
+ -?/--help this message
+ -v/--version show version
+ --init loads the oprofile module and oprofilefs
+ --setup give setup arguments (may be omitted)
+ --status show configuration
+ --start-daemon start daemon without starting profiling
+ -s/--start start data collection
+ -d/--dump flush the collected profiling data
+ -t/--stop stop data collection
+ -h/--shutdown stop data collection and kill daemon
+ -V/--verbose[=all,sfile,arcs,samples,module,misc,ext]
+ be verbose in the daemon log
+ --reset clears out data from current session
+ --save=name save data from current session to session_name
+ --deinit unload the oprofile module and oprofilefs
+
+ -e/--event=eventspec
+
+ Choose an event. May be specified multiple times. Of the form
+ "default" or "name:count:unitmask:kernel:user", where :
+
+ name: event name, e.g. CPU_CLK_UNHALTED or RTC_INTERRUPTS
+ count: reset counter value e.g. 100000
+ unitmask: hardware unit mask e.g. 0x0f
+ kernel: whether to profile kernel: 0 or 1
+ user: whether to profile userspace: 0 or 1
+
+ -p/--separate=type,[types]
+
+ Separate profiles as follows :
+
+ none: no profile separation
+ library: separate shared library profiles per-application
+ kernel: same as library, plus kernel profiles
+ thread: per-thread/process profiles
+ cpu: per CPU profiles
+ all: all of the above
+
+ -c/--callgraph=#depth enable callgraph sample collection with a maximum depth.
+ Use 0 to disable callgraph profiling.
+ --session-dir=dir place sample database in dir instead of
+ default location (/var/lib/oprofile)
+ -i/--image=name[,names] list of binaries to profile (default is "all")
+ --vmlinux=file vmlinux kernel image
+ --no-vmlinux no kernel image (vmlinux) available
+ --kernel-range=start,end kernel range vma address in hexadecimal
+ --buffer-size=num kernel buffer size in sample units
+ --buffer-watershed kernel buffer watershed in sample units (2.6 only=
+ --cpu-buffer-size=num per-cpu buffer size in units (2.6 only)
+ --note-table-size kernel notes buffer size in notes units (2.4 only)
+
+ --xen Xen image (for Xen only)
+ --active-domains=<list> List of domains in profiling session (for Xen only)
+ (list contains domain ids separated by commas)
+EOF
+}
+
+
+# load the module and mount oprofilefs
+load_module_26()
+{
+ grep oprofilefs /proc/filesystems >/dev/null
+ if test "$?" -ne 0; then
+ modprobe oprofile
+ if test "$?" != "0"; then
+ # couldn't load the module
+ return
+ fi
+ grep oprofile /proc/modules >/dev/null
+ if test "$?" != "0"; then
+ # didn't find module
+ return
+ fi
+ grep oprofilefs /proc/filesystems >/dev/null
+ if test "$?" -ne 0; then
+ # filesystem still not around
+ return
+ fi
+ fi
+ mkdir /dev/oprofile >/dev/null 2>&1
+ grep oprofilefs /etc/mtab >/dev/null
+ if test "$?" -ne 0; then
+ mount -t oprofilefs nodev /dev/oprofile >/dev/null
+ fi
+ KERNEL_SUPPORT=yes
+ OPROFILE_AVAILABLE=yes
+}
+
+
+load_module_24()
+{
+ grep oprof /proc/devices >/dev/null
+ if test "$?" -ne 0; then
+ modprobe oprofile
+ if test "$?" != "0"; then
+ # couldn't load a module
+ return
+ fi
+ grep oprofile /proc/modules >/dev/null
+ if test "$?" != "0"; then
+ # didn't find module
+ return
+ fi
+ fi
+ KERNEL_SUPPORT=no
+ OPROFILE_AVAILABLE=yes
+}
+
+
+load_module()
+{
+ OPROFILE_AVAILABLE=no
+ load_module_26
+ if test "$OPROFILE_AVAILABLE" != "yes"; then
+ load_module_24
+ fi
+ if test "$OPROFILE_AVAILABLE" != "yes"; then
+ echo "Kernel doesn't support oprofile" >&2
+ exit 1
+ fi
+}
+
+# setup variables related to path or daemon. Set vars according to following
+# relationship: command-line-option > config-file-settings > defaults.
+# Note that upon entry SESSION_DIR may be set by command-line option.
+do_init_daemon_vars()
+{
+ # load settings from config file, keeping command-line value
+ # of SESSION_DIR if necessary.
+ if test -n "$SESSION_DIR"; then
+ SAVED=$SESSION_DIR
+ fi
+ do_load_setup
+ if test -n "$SAVED"; then
+ SESSION_DIR=$SAVED
+ fi
+
+ # daemon parameters (as in op_config.h). Note that we preserve
+ # any previous value of SESSION_DIR
+ if test -z "$SESSION_DIR"; then
+ SESSION_DIR="/var/lib/oprofile"
+ fi
+ LOCK_FILE="$SESSION_DIR/lock"
+ SAMPLES_DIR="$SESSION_DIR/samples"
+ LOG_FILE="$SAMPLES_DIR/oprofiled.log"
+ CURRENT_SAMPLES_DIR="$SAMPLES_DIR/current"
+}
+
+
+# pick the appropriate device mount based on kernel
+decide_oprofile_device_mount()
+{
+ if test "$KERNEL_SUPPORT" = "yes"; then
+ MOUNT="/dev/oprofile"
+ else
+ MOUNT="/proc/sys/dev/oprofile"
+ fi
+}
+
+
+# pick the appropriate locations device for oprofile based on kernel
+decide_oprofile_device()
+{
+ if test "$KERNEL_SUPPORT" = "yes"; then
+ DEVICE_FILE="$MOUNT/buffer"
+ else
+ DEVICE_FILE="$SESSION_DIR/opdev"
+ NOTE_DEVICE_FILE="$SESSION_DIR/opnotedev"
+ HASH_MAP_DEVICE_FILE="$SESSION_DIR/ophashmapdev"
+ fi
+}
+
+# initialise parameters
+do_init()
+{
+ # for these three buffer size == 0 means use the default value
+ # hard-coded in op_user.h
+ BUF_SIZE=0
+ BUF_WATERSHED=0
+ CPU_BUF_SIZE=0
+ NOTE_SIZE=0
+ VMLINUX=
+ XENIMAGE="none"
+ VERBOSE=""
+ SEPARATE_LIB=0
+ SEPARATE_KERNEL=0
+ SEPARATE_THREAD=0
+ SEPARATE_CPU=0
+ CALLGRAPH=0
+ IBS_FETCH_EVENTS=""
+ IBS_FETCH_COUNT=0
+ IBS_FETCH_UNITMASK=0
+ IBS_OP_EVENTS=""
+ IBS_OP_COUNT=0
+ IBS_OP_UNITMASK=0
+
+ OPROFILED="$OPDIR/oprofiled"
+
+ # location for daemon setup information
+ SETUP_DIR="/root/.oprofile"
+ SETUP_FILE="$SETUP_DIR/daemonrc"
+
+ # initialize daemon vars
+ decide_oprofile_device_mount
+ CPUTYPE=`cat $MOUNT/cpu_type`
+ OP_COUNTERS=`ls $MOUNT/ | grep "^[0-9]\+\$" | tr "\n" " "`
+ NR_CHOSEN=0
+
+ do_init_daemon_vars
+ decide_oprofile_device
+
+ DEFAULT_EVENT=`$OPHELP --get-default-event`
+
+ IS_TIMER=0
+ IS_PERFMON=0
+ if test "$CPUTYPE" = "timer"; then
+ IS_TIMER=1
+ else
+ case "$CPUTYPE" in
+ ia64/*)
+ IS_PERFMON=$KERNEL_SUPPORT
+ ;;
+ esac
+ fi
+}
+
+
+create_dir()
+{
+ if test ! -d "$1"; then
+ mkdir -p "$1"
+ if test "$?" != "0"; then
+ echo "Couldn't mkdir -p $1" >&2
+ exit 1
+ fi
+ chmod 755 "$1"
+ fi
+}
+
+get_event()
+{
+ GOTEVENT=`eval "echo \\$CHOSEN_EVENTS_$1"`
+}
+
+set_event()
+{
+ eval "CHOSEN_EVENTS_$1=$2"
+}
+
+
+# save all the setup related information
+do_save_setup()
+{
+ create_dir "$SETUP_DIR"
+
+ touch $SETUP_FILE
+ chmod 644 $SETUP_FILE
+ >$SETUP_FILE
+
+ echo "SESSION_DIR=$SESSION_DIR" >>$SETUP_FILE
+
+ if test "$NR_CHOSEN" != "0"; then
+ for f in `seq 0 $((NR_CHOSEN - 1))`; do
+ get_event $f
+ echo "CHOSEN_EVENTS_${f}=$GOTEVENT" >>$SETUP_FILE
+ done
+ fi
+
+ echo "NR_CHOSEN=$NR_CHOSEN" >>$SETUP_FILE
+
+ echo "SEPARATE_LIB=$SEPARATE_LIB" >> $SETUP_FILE
+ echo "SEPARATE_KERNEL=$SEPARATE_KERNEL" >> $SETUP_FILE
+ echo "SEPARATE_THREAD=$SEPARATE_THREAD" >> $SETUP_FILE
+ echo "SEPARATE_CPU=$SEPARATE_CPU" >> $SETUP_FILE
+ echo "VMLINUX=$VMLINUX" >> $SETUP_FILE
+ echo "IMAGE_FILTER=$IMAGE_FILTER" >> $SETUP_FILE
+ # write the actual information to file
+ if test "$BUF_SIZE" != "0"; then
+ echo "BUF_SIZE=$BUF_SIZE" >> $SETUP_FILE
+ fi
+ if test "$BUF_WATERSHED" != "0"; then
+ echo "BUF_WATERSHED=$BUF_WATERSHED" >> $SETUP_FILE
+ fi
+ if test "$KERNEL_SUPPORT" = "yes"; then
+ echo "CPU_BUF_SIZE=$CPU_BUF_SIZE" >> $SETUP_FILE
+ fi
+ if test "$KERNEL_SUPPORT" != "yes"; then
+ echo "NOTE_SIZE=$NOTE_SIZE" >> $SETUP_FILE
+ fi
+ echo "CALLGRAPH=$CALLGRAPH" >> $SETUP_FILE
+ if test "$KERNEL_RANGE"; then
+ echo "KERNEL_RANGE=$KERNEL_RANGE" >> $SETUP_FILE
+ fi
+ echo "XENIMAGE=$XENIMAGE" >> $SETUP_FILE
+ if test "$XEN_RANGE"; then
+ echo "XEN_RANGE=$XEN_RANGE" >> $SETUP_FILE
+ fi
+}
+
+
+# reload all the setup-related information
+do_load_setup()
+{
+ if test -f "$SETUP_FILE"; then
+ # load the actual information from file
+ # FIXME this is insecure, arbitrary commands could be added to
+ # $SETUP_FILE and be executed as root
+ . $SETUP_FILE
+ fi
+}
+
+
+check_valid_args()
+{
+ if test -z "$VMLINUX"; then
+ echo "No vmlinux file specified. You must specify the correct vmlinux file, e.g." >&2
+ echo "opcontrol --vmlinux=/path/to/vmlinux" >&2
+ echo "If you do not have a vmlinux file, use " >&2
+ echo "opcontrol --no-vmlinux" >&2
+ echo "Enter opcontrol --help for full options" >&2
+ exit 1
+ fi
+
+ if test -f "$VMLINUX"; then
+ return
+ fi
+
+ if test "$VMLINUX" = "none"; then
+ return
+ fi
+
+ echo "The specified vmlinux file \"$VMLINUX\" doesn't exist." >&2
+ exit 1
+
+# similar check for Xen image
+ if test -f "$XENIMAGE"; then
+ return
+ fi
+
+ if test "$XENIMAGE" = "none"; then
+ return
+ fi
+
+ echo "The specified XenImage file \"$XENIMAGE\" does not exist." >&2
+ exit 1
+}
+
+
+# get start and end points of a file image (linux kernel or xen)
+# get_image_range parameter: $1=type_of_image (linux or xen)
+get_image_range()
+{
+ if test "$1" = "xen"; then
+ if test ! -z "$XEN_RANGE"; then
+ return;
+ fi
+ FILE_IMAGE="$XENIMAGE"
+ else
+ if test ! -z "$KERNEL_RANGE"; then
+ return;
+ fi
+ FILE_IMAGE="$VMLINUX"
+ fi
+
+ if test "$FILE_IMAGE" = "none"; then
+ return;
+ fi
+
+ if is_tool_available objdump; then
+ echo "objdump is not installed on this system, use opcontrol --kernel-range=start,end or opcontrol --xen-range= or install objdump"
+ exit 1
+ fi
+
+ # start at the start of .text, and end at _etext
+ range_info=`objdump -h $FILE_IMAGE 2>/dev/null | grep " .text "`
+ tmp1=`echo $range_info | awk '{print $4}'`
+ tmp2=`objdump -t $FILE_IMAGE 2>/dev/null | grep "_etext$" | awk '{ print $1 }'`
+
+ if test -z "$tmp1" -o -z "$tmp2"; then
+ echo "The specified file $FILE_IMAGE does not seem to be valid" >&2
+ echo "Make sure you are using the non-compressed image file (e.g. vmlinux not vmlinuz)" >&2
+ vecho "found start as \"$tmp1\", end as \"$tmp2\"" >&2
+ exit 1
+ fi
+
+ if test "$1" = "xen"; then
+ XEN_RANGE="`echo $tmp1`,`echo $tmp2`"
+ vecho "XEN_RANGE $XEN_RANGE"
+ else
+ KERNEL_RANGE="`echo $tmp1`,`echo $tmp2`"
+ vecho "KERNEL_RANGE $KERNEL_RANGE"
+ fi
+}
+
+
+# validate --separate= parameters. This function is called with IFS=,
+# so on each argument is splitted
+validate_separate_args()
+{
+ error_if_empty $1 $2 # we need at least one argument
+ local i=1
+ SEPARATE_LIB=0
+ SEPARATE_KERNEL=0
+ SEPARATE_THREAD=0
+ SEPARATE_CPU=0
+ while [ "$i" -lt "$#" ]; do
+ shift
+ case "$1" in
+ lib|library)
+ SEPARATE_LIB=1
+ ;;
+ kernel)
+ # first implied by second
+ SEPARATE_LIB=1
+ SEPARATE_KERNEL=1
+ ;;
+ thread)
+ SEPARATE_THREAD=1
+ ;;
+ cpu)
+ SEPARATE_CPU=1
+ ;;
+ all)
+ SEPARATE_LIB=1
+ SEPARATE_KERNEL=1
+ SEPARATE_THREAD=1
+ SEPARATE_CPU=1
+ ;;
+ none)
+ SEPARATE_LIB=0
+ SEPARATE_KERNEL=0
+ SEPARATE_THREAD=0
+ SEPARATE_CPU=0
+ ;;
+ *)
+ echo "invalid --separate= argument: $1"
+ exit 1
+ esac
+ done
+}
+
+
+# check the counters make sense, and resolve the hardware allocation
+verify_counters()
+{
+ if test "$IS_TIMER" = 1; then
+ if test "$NR_CHOSEN" != 0; then
+ echo "You cannot specify any performance counter events" >&2
+ echo "because OProfile is in timer mode." >&2
+ exit 1
+ fi
+ return
+ fi
+
+ OPHELP_ARGS=
+
+ if test "$NR_CHOSEN" != 0; then
+ for f in `seq 0 $((NR_CHOSEN - 1))`; do
+ get_event $f
+ if test "$GOTEVENT" != ""; then
+ verify_ibs $GOTEVENT
+ OPHELP_ARGS="$OPHELP_ARGS $GOTEVENT"
+ fi
+ done
+
+ if test ! -z "$OPHELP_ARGS" ; then
+ HW_CTRS=`$OPHELP --check-events $OPHELP_ARGS --callgraph=$CALLGRAPH`
+ if test "$?" != 0; then
+ exit 1
+ fi
+ fi
+ fi
+}
+
+
+# setup any needed default value in chosen events
+normalise_events()
+{
+ if test "$NR_CHOSEN" -le 0 || test "$IS_TIMER" = 1; then
+ return
+ fi
+
+ for f in `seq 0 $((NR_CHOSEN - 1))`; do
+ get_event $f
+ if test "$GOTEVENT" != ""; then
+ EVENT=`echo $GOTEVENT | awk -F: '{print $1}'`
+ EVENT_VAL=`$OPHELP $EVENT`
+ if test "$?" != 0; then
+ exit 1
+ fi
+ COUNT=`echo $GOTEVENT | awk -F: '{print $2}'`
+ UNIT_MASK=`echo $GOTEVENT | awk -F: '{print $3}'`
+ KERNEL=`echo $GOTEVENT | awk -F: '{print $4}'`
+ USER=`echo $GOTEVENT | awk -F: '{print $5}'`
+ if test -z "$UNIT_MASK"; then
+ TMPEVENT="$EVENT:$COUNT"
+ UNIT_MASK=`$OPHELP --unit-mask $TMPEVENT`
+ if test "$?" != 0; then
+ exit 1
+ fi
+ fi
+ if test -z "$KERNEL"; then
+ KERNEL=1
+ fi
+ if test -z "$USER"; then
+ USER=1
+ fi
+
+ set_event $f "$EVENT:$COUNT:$UNIT_MASK:$KERNEL:$USER"
+ fi
+ done
+}
+
+
+# get and check specified options
+do_options()
+{
+ EXCLUSIVE_ARGC=0
+ SETUP=no
+ NEED_SETUP=no
+ SEEN_EVENT=0
+
+ # note: default settings have already been loaded
+
+ while [ "$#" -ne 0 ]
+ do
+ arg=`printf %s $1 | awk -F= '{print $1}'`
+ val=`printf %s $1 | awk -F= '{print $2}'`
+ shift
+ if test -z "$val"; then
+ local possibleval=$1
+ printf %s $1 "$possibleval" | grep ^- >/dev/null 2>&1
+ if test "$?" != "0"; then
+ val=$possibleval
+ if [ "$#" -ge 1 ]; then
+ shift
+ fi
+ fi
+ fi
+
+ case "$arg" in
+
+ --init)
+ # this is already done in load_module
+ # because need to know the processor type
+ # and number of registers
+ INIT=yes;
+ EXCLUSIVE_ARGC=`expr $EXCLUSIVE_ARGC + 1`
+ EXCLUSIVE_ARGV="$arg"
+ ;;
+
+ --setup)
+ SETUP=yes
+ ;;
+
+ --start-daemon)
+ if test "$KERNEL_SUPPORT" != "yes"; then
+ echo "$arg unsupported. use \"--start\"" >&2
+ exit 1
+ fi
+ START_DAEMON=yes
+ EXCLUSIVE_ARGC=`expr $EXCLUSIVE_ARGC + 1`
+ EXCLUSIVE_ARGV="$arg"
+ ;;
+
+ -s|--start)
+ START=yes
+ EXCLUSIVE_ARGC=`expr $EXCLUSIVE_ARGC + 1`
+ EXCLUSIVE_ARGV="$arg"
+ ;;
+
+ -d|--dump)
+ DUMP=yes
+ ONLY_DUMP=yes
+ EXCLUSIVE_ARGC=`expr $EXCLUSIVE_ARGC + 1`
+ EXCLUSIVE_ARGV="$arg"
+ ;;
+
+ -t|--stop)
+ if test "$KERNEL_SUPPORT" != "yes"; then
+ echo "$arg unsupported. use \"--shutdown\"" >&2
+ exit 1
+ fi
+ DUMP=yes
+ STOP=yes
+ EXCLUSIVE_ARGC=`expr $EXCLUSIVE_ARGC + 1`
+ EXCLUSIVE_ARGV="$arg"
+ ;;
+
+ -h|--shutdown)
+ DUMP=yes
+ STOP=yes
+ KILL_DAEMON=yes
+ EXCLUSIVE_ARGC=`expr $EXCLUSIVE_ARGC + 1`
+ EXCLUSIVE_ARGV="$arg"
+ ;;
+
+ --status)
+ STATUS=yes
+ ;;
+
+ --reset)
+ DUMP=yes
+ RESET=yes
+ EXCLUSIVE_ARGC=`expr $EXCLUSIVE_ARGC + 1`
+ EXCLUSIVE_ARGV="$arg"
+ ;;
+
+ --save)
+ error_if_empty $arg $val
+ DUMP=yes
+ SAVE_SESSION=yes
+ SAVE_NAME=$val
+ EXCLUSIVE_ARGC=`expr $EXCLUSIVE_ARGC + 1`
+ EXCLUSIVE_ARGV="$arg"
+ ;;
+
+ --deinit)
+ DUMP=yes
+ test ! -f "$LOCK_FILE" || {
+ STOP=yes
+ KILL_DAEMON=yes
+ }
+ DEINIT=yes
+ EXCLUSIVE_ARGC=`expr $EXCLUSIVE_ARGC + 1`
+ EXCLUSIVE_ARGV="$arg"
+ ;;
+
+ # --setup options
+
+ --session-dir)
+ # already processed
+ ;;
+ --buffer-size)
+ error_if_empty $arg $val
+ BUF_SIZE=$val
+ DO_SETUP=yes
+ ;;
+ --buffer-watershed)
+ if test "$KERNEL_SUPPORT" != "yes"; then
+ echo "$arg unsupported for this kernel version"
+ exit 1
+ fi
+ error_if_empty $arg $val
+ BUF_WATERSHED=$val
+ DO_SETUP=yes
+ ;;
+ --cpu-buffer-size)
+ if test "$KERNEL_SUPPORT" != "yes"; then
+ echo "$arg unsupported for this kernel version"
+ exit 1
+ fi
+ error_if_empty $arg $val
+ CPU_BUF_SIZE=$val
+ DO_SETUP=yes
+ ;;
+ -e|--event)
+ error_if_empty $arg $val
+ # reset any read-in defaults from daemonrc
+ if test "$SEEN_EVENT" = "0"; then
+ NR_CHOSEN=0
+ SEEN_EVENT=1
+ fi
+ if test "$val" = "default"; then
+ val=$DEFAULT_EVENT
+ fi
+ set_event $NR_CHOSEN "$val"
+ NR_CHOSEN=`expr $NR_CHOSEN + 1`
+ DO_SETUP=yes
+ ;;
+ -p|--separate)
+ OLD_IFS=$IFS
+ IFS=,
+ validate_separate_args $arg $val
+ IFS=$OLD_IFS
+ DO_SETUP=yes
+ ;;
+ -c|--callgraph)
+ error_if_empty $arg $val
+ if test ! -f $MOUNT/backtrace_depth; then
+ echo "Call-graph profiling unsupported on this kernel/hardware" >&2
+ exit 1
+ fi
+ CALLGRAPH=$val
+ DO_SETUP=yes
+ ;;
+ --vmlinux)
+ error_if_empty $arg $val
+ VMLINUX=$val
+ DO_SETUP=yes
+ ;;
+ --no-vmlinux)
+ VMLINUX=none
+ DO_SETUP=yes
+ ;;
+ --kernel-range)
+ error_if_empty $arg $val
+ KERNEL_RANGE=$val
+ DO_SETUP=yes
+ ;;
+ --xen)
+ error_if_empty $arg $val
+ XENIMAGE=$val
+ DO_SETUP=yes
+ ;;
+ --active-domains)
+ error_if_empty $arg $val
+ ACTIVE_DOMAINS=$val
+ DO_SETUP=yes
+ ;;
+ --note-table-size)
+ error_if_empty $arg $val
+ if test "$KERNEL_SUPPORT" = "yes"; then
+ echo "\"$arg\" meaningless on this kernel" >&2
+ exit 1
+ else
+ NOTE_SIZE=$val
+ fi
+ DO_SETUP=yes
+ ;;
+ -i|--image)
+ error_if_empty $arg $val
+ if test "$val" = "all"; then
+ IMAGE_FILTER=
+ else
+ IMAGE_FILTER=$val
+ fi
+ DO_SETUP=yes
+ ;;
+
+ -V|--verbose)
+ if test -z "$val"; then
+ VERBOSE="all"
+ else
+ VERBOSE=$val
+ fi
+ ;;
+
+ -l|--list-events)
+ EXCLUSIVE_ARGC=`expr $EXCLUSIVE_ARGC + 1`
+ EXCLUSIVE_ARGV="$arg"
+ exec $OPHELP
+ ;;
+
+ *)
+ echo "Unknown option \"$arg\". See opcontrol --help" >&2
+ exit 1
+ ;;
+ esac
+ done
+
+ normalise_events
+ verify_counters
+
+ # error checking to make sure options make sense
+ if test "$EXCLUSIVE_ARGC" -gt 1; then
+ echo "Option \"$EXCLUSIVE_ARGV\" not valid with other options." >&2
+ exit 1
+ fi
+
+ if test "$SETUP" = "yes" -a "$DO_SETUP" != "yes"; then
+ echo "No options specified for --setup." >&2
+ exit 1
+ fi
+
+ if test -n "$VERBOSE"; then
+ if test "$START" != "yes" -a "$START_DAEMON" != "yes"; then
+ echo "Option --verbose may only be used with --start or --start-daemon" >&2
+ exit 1
+ fi
+ fi
+
+ if test "$DO_SETUP" = "yes"; then
+ SETUP="$DO_SETUP"
+ fi
+
+ if test "$EXCLUSIVE_ARGC" -eq 1 -a "$SETUP" = "yes"; then
+ if test "$EXCLUSIVE_ARGV" != "--start-daemon" -a "$EXCLUSIVE_ARGV" != "--start"; then
+ echo "Option \"--setup\" not valid with \"$EXCLUSIVE_ARGV\"." >&2
+ exit 1
+ fi
+ fi
+
+ vecho "Parameters used:"
+ vecho "SESSION_DIR $SESSION_DIR"
+ vecho "LOCK_FILE $LOCK_FILE"
+ vecho "SAMPLES_DIR $SAMPLES_DIR"
+ vecho "CURRENT_SAMPLES_DIR $CURRENT_SAMPLES_DIR"
+ vecho "CPUTYPE $CPUTYPE"
+ if test "$BUF_SIZE" != "0"; then
+ vecho "BUF_SIZE $BUF_SIZE"
+ else
+ vecho "BUF_SIZE default value"
+ fi
+ if test "$BUF_WATERSHED" != "0"; then
+ vecho "BUF_WATERSHED $BUF_WATERSHED"
+ else
+ vecho "BUF_WATERSHED default value"
+ fi
+ if test "$KERNEL_SUPPORT" = "yes"; then
+ if test "$CPU_BUF_SIZE" != "0"; then
+ vecho "CPU_BUF_SIZE $CPU_BUF_SIZE"
+ else
+ vecho "CPU_BUF_SIZE default value"
+ fi
+ fi
+
+ vecho "SEPARATE_LIB $SEPARATE_LIB"
+ vecho "SEPARATE_KERNEL $SEPARATE_KERNEL"
+ vecho "SEPARATE_THREAD $SEPARATE_THREAD"
+ vecho "SEPARATE_CPU $SEPARATE_CPU"
+ vecho "CALLGRAPH $CALLGRAPH"
+ vecho "VMLINUX $VMLINUX"
+ vecho "KERNEL_RANGE $KERNEL_RANGE"
+ vecho "XENIMAGE $XENIMAGE"
+ vecho "XEN_RANGE $XEN_RANGE"
+}
+
+
+# stop any existing daemon
+do_stop()
+{
+ if test ! -f "$LOCK_FILE"; then
+ echo "Daemon not running" >&2
+ return
+ fi
+
+ kill -0 `cat $LOCK_FILE` 2>/dev/null
+ if test "$?" -ne 0; then
+ echo "Detected stale lock file. Removing." >&2
+ rm -f "$LOCK_FILE"
+ return
+ fi
+
+ if test $KERNEL_SUPPORT = "yes" \
+ && test 0 != $(cat /dev/oprofile/enable); then
+ echo "Stopping profiling."
+ echo 0 >/dev/oprofile/enable
+ fi
+ kill -USR2 `cat $LOCK_FILE` 2>/dev/null
+}
+
+
+# kill the daemon process(es)
+do_kill_daemon()
+{
+ if test ! -f "$LOCK_FILE"; then
+ # no error message, do_kill_daemon imply stop and stop already
+ # output "Daemon not running"
+ return
+ fi
+
+ kill -0 `cat $LOCK_FILE` 2>/dev/null
+ if test "$?" -ne 0; then
+ echo "Detected stale lock file. Removing." >&2
+ rm -f "$LOCK_FILE"
+ return
+ fi
+
+ echo "Killing daemon."
+
+ if test $KERNEL_SUPPORT = "yes"; then
+ kill -TERM `cat $LOCK_FILE`
+ else
+ echo 1 >/proc/sys/dev/oprofile/dump_stop
+ fi
+
+ COUNT=0
+ while test -n "`pidof oprofiled`"
+ do
+ sleep 1
+
+ # because oprofiled only sets a variable inside the
+ # signal handler itself, it's possible to miss a
+ # signal just before it goes to sleep waiting for
+ # data from the kernel that never arrives. So we
+ # remind it it needs to die - this works because
+ # the signal will bring oprofiled out of the kernel
+ # back into userspace
+ if test $KERNEL_SUPPORT = "yes"; then
+ pid=`cat $LOCK_FILE 2>/dev/null`
+ kill -TERM "$pid" 2>/dev/null
+ fi
+
+ COUNT=`expr $COUNT + 1`
+
+ # IBS can generate a large number of samples/events.
+ # Therefore, extend the delay before killing
+ if test "$IBS_FETCH_COUNT" != "0" \
+ -o "$IBS_OP_COUNT" != "0" ; then
+ DELAY_KILL=60
+ else
+ DELAY_KILL=15
+ fi
+ if test "$COUNT" -eq "$DELAY_KILL"; then
+ echo "Daemon stuck shutting down; killing !"
+ kill -9 `cat $LOCK_FILE`
+ fi
+ done
+ sleep 1
+ # already removed unless we forced the kill
+ rm -f "$SESSION_DIR/lock"
+ cp -r /dev/oprofile/stats "$SAMPLES_DIR/current"
+}
+
+
+rm_devices_24()
+{
+ rm_device "$DEVICE_FILE"
+ rm_device "$NOTE_DEVICE_FILE"
+ rm_device "$HASH_MAP_DEVICE_FILE"
+}
+
+
+create_devices_24()
+{
+ MAJOR_NR=`grep oprof /proc/devices | awk '{print $1}'`
+
+ create_device $DEVICE_FILE $MAJOR_NR 0
+ create_device $NOTE_DEVICE_FILE $MAJOR_NR 2
+ create_device $HASH_MAP_DEVICE_FILE $MAJOR_NR 1
+}
+
+# create jitdump directory and remove any old files from
+# a previous run
+prep_jitdump() {
+ local dumpdir=$SESSION_DIR/jitdump
+ test -d $dumpdir || {
+ mkdir -p $dumpdir;
+ chmod 777 $dumpdir;
+ return;
+ }
+ # VMs may already be running when profiling is started, so
+ # remove only dump files that are not in use
+ for I in $dumpdir/*; do
+ test -f $I || continue;
+ local pid=`basename $I .dump`;
+ if test -d /proc/$pid; then
+ local files=`find /proc/$pid/fd -lname $I`;
+ test -n "$files" && continue;
+ fi
+ rm -f $I;
+ done
+}
+
+# setup and start module
+do_setup()
+{
+ create_dir "$SESSION_DIR"
+
+ if test "$KERNEL_SUPPORT" != "yes"; then
+ rm_devices_24
+ create_devices_24
+ fi
+
+ create_dir "$CURRENT_SAMPLES_DIR"
+
+ prep_jitdump;
+}
+
+
+# set a sysctl/oprofilefs parameter
+set_param()
+{
+ if test "$KERNEL_SUPPORT" = "yes"; then
+ echo $2 >$MOUNT/$1
+ else
+ $SYSCTL -w dev.oprofile.$1=$2
+ fi
+}
+
+
+# set a sysctl/oprofilefs counter parameter
+set_ctr_param()
+{
+ # no such thing for perfmon
+ if test "$IS_PERFMON" = "yes"; then
+ return
+ fi
+
+ if test "$KERNEL_SUPPORT" = "yes"; then
+ if test -e $MOUNT/$1; then
+ echo $3 >$MOUNT/$1/$2
+ else
+ echo -n "Error: counter $1 not available"
+ if test -e /proc/sys/kernel/nmi_watchdog; then
+ echo " nmi_watchdog using this resource ? Try:"
+ echo "opcontrol --deinit"
+ echo "echo 0 > /proc/sys/kernel/nmi_watchdog"
+ fi
+ exit 1
+ fi
+ else
+ $SYSCTL -w dev.oprofile.$1.$2=$3
+ fi
+}
+
+
+# returns 1 if $CPUTYPE is a PPC64 variant
+is_non_cell_ppc64_variant()
+{
+ case "$1" in
+ ppc64/*)
+ tmp="${1/cell/CELL}"
+ if test "$1" = "$tmp"; then
+ #No substituion occurred, so cputype is not cell
+ return 1
+ else
+ return 0
+ fi
+ ;;
+ *)
+ return 0;
+ ;;
+ esac
+}
+
+
+# The check_event_mapping_data procedure gives the
+# opportunity to validate events and enforce any
+# arch-specific restritions, etc.
+check_event_mapping_data()
+{
+
+ is_non_cell_ppc64_variant $CPUTYPE
+ if test $? -ne 0 ; then
+ # For PPC64 architectures, the values required to program
+ # MMCRs for the given event are returned along with the event.
+ # Here we use those values to ensure that all chosen events
+ # are from the same group.
+ MMCR0=`echo $EVENT_STR | awk '{print $2}'`
+ MMCR1=`echo $EVENT_STR | awk '{print $3}'`
+ MMCRA=`echo $EVENT_STR | awk '{print $4}'`
+ MMCR0_VAL=`echo $MMCR0 | awk -F: '{print $2}'`
+ MMCR1_VAL=`echo $MMCR1 | awk -F: '{print $2}'`
+ MMCRA_VAL=`echo $MMCRA | awk -F: '{print $2}'`
+
+ ## mmcr0, mmcr1, mmcra are for all ppc64 counters
+ # Save first event mmcr settings to compare with additional
+ # events. All events must have the same mmcrx values i.e. be in
+ # the same group. Only one event is assigned per counter,
+ # hence there will not be a conflict on the counters
+ if [ "$MMCR0_CK_VAL" = "" ] ; then
+ MMCR0_CK_VAL=$MMCR0_VAL
+ MMCR1_CK_VAL=$MMCR1_VAL
+ MMCRA_CK_VAL=$MMCRA_VAL
+ else
+ # make sure all events are from the same group
+ if test $MMCR0_CK_VAL != $MMCR0_VAL \
+ -o $MMCR1_CK_VAL != $MMCR1_VAL \
+ -o $MMCRA_CK_VAL != $MMCRA_VAL ; then
+ echo "ERROR: The specified events are not from the same group."
+ echo " Use 'opcontrol --list-events' to see event groupings."
+ exit 1
+ fi
+ fi
+
+ # Check if all user/kernel flags per-counter are matching.
+ if [ "$USER_CK" = "" ] ; then
+ USER_CK=$USER
+ KERNEL_CK=$KERNEL
+ else
+ if test $USER_CK != $USER \
+ -o $KERNEL_CK != $KERNEL ; then
+ echo "ERROR: All kernel/user event flags must match."
+ exit 1
+ fi
+ fi
+ fi
+ if [ "$CPUTYPE" = "ppc64/cell-be" ]; then
+ event_num=`echo $EVENT_STR | awk '{print $1}'`
+ # PPU event and cycle events can be measured at
+ # the same time. SPU event can not be measured
+ # at the same time as any other event. Similarly for
+ # SPU Cycles
+
+ # We use EVNT_MSK to track what events have already
+ # been seen. Valid values are:
+ # NULL string - no events seen yet
+ # 1 - PPU CYCLES or PPU Event seen
+ # 2 - SPU CYCLES seen
+ # 3 - SPU EVENT seen
+
+ # check if event is PPU_CYCLES
+ if [ "$event_num" = "1" ]; then
+ if [ "$EVNT_MSK" = "1" ] || [ "$EVNT_MSK" = "" ]; then
+ EVNT_MSK=1
+ else
+ echo "PPU CYCLES not compatible with previously specified event"
+ exit 1
+ fi
+
+ # check if event is SPU_CYCLES
+ elif [ "$event_num" = "2" ]; then
+ if [ "$EVNT_MSK" = "" ]; then
+ EVNT_MSK=2
+ else
+ echo "SPU CYCLES not compatible with any other event"
+ exit 1
+ fi
+
+ # check if event is SPU Event profiling
+ elif [ "$event_num" -ge "4100" ] && [ "$event_num" -le "4163" ] ; then
+ if [ "$EVNT_MSK" = "" ]; then
+ EVNT_MSK=3
+ else
+ echo "SPU event profiling not compatible with any other event"
+ exit 1
+ fi
+
+ # Check to see that the kernel supports SPU event
+ # profiling. Note, if the file exits it should have
+ # the LSB bit set to 1 indicating SPU event profiling
+ # support. For now, it is sufficient to test that the
+ # file exists.
+ if test ! -f /dev/oprofile/cell_support; then
+ echo "Kernel does not support SPU event profiling"
+ exit 1
+ fi
+
+ # check if event is PPU Event profiling (all other
+ # events are PPU events)
+ else
+ if [ "$EVNT_MSK" = "1" ] || [ "$EVNT_MSK" = "" ]; then
+ EVNT_MSK=1
+ else
+ echo "PPU profiling not compatible with previously specified event"
+ exit 1
+ fi
+ fi
+ fi
+ len=`echo -n $event_num | wc -m`
+ num_chars_in_grpid=`expr $len - 2`
+ GRP_NUM_VAL=`echo | awk '{print substr("'"${event_num}"'",1,"'"${num_chars_in_grpid}"'")}'`
+ if [ "$GRP_NUM_CK_VAL" = "" ] ; then
+ GRP_NUM_CK_VAL=$GRP_NUM_VAL
+ else
+ if test $GRP_NUM_CK_VAL != $GRP_NUM_VAL ; then
+ echo "ERROR: The specified events are not from the same group." >&2
+ echo " Use 'opcontrol --list-events' to see event groupings." >&2
+ exit 1
+ fi
+ fi
+}
+
+
+do_param_setup()
+{
+ # different names
+ if test $BUF_SIZE != 0; then
+ if test "$KERNEL_SUPPORT" = "yes"; then
+ echo $BUF_SIZE >$MOUNT/buffer_size
+ else
+ $SYSCTL -w dev.oprofile.bufsize=$BUF_SIZE
+ fi
+ fi
+
+ if test $BUF_WATERSHED != 0; then
+ if test "$KERNEL_SUPPORT" = "yes"; then
+ echo $BUF_WATERSHED >$MOUNT/buffer_watershed
+ else
+ echo "buffer-watershed not supported - ignored" >&2
+ fi
+ fi
+
+ if test $CPU_BUF_SIZE != 0; then
+ if test "$KERNEL_SUPPORT" = "yes"; then
+ echo $CPU_BUF_SIZE >$MOUNT/cpu_buffer_size
+ else
+ echo "cpu-buffer-size not supported - ignored" >&2
+ fi
+ fi
+
+ if test -n "$ACTIVE_DOMAINS"; then
+ if test "$KERNEL_SUPPORT" = "yes"; then
+ echo $ACTIVE_DOMAINS >$MOUNT/active_domains
+ else
+ echo "active-domains not supported - ignored" >&2
+ fi
+ fi
+
+ if test $NOTE_SIZE != 0; then
+ set_param notesize $NOTE_SIZE
+ fi
+
+ if test "$KERNEL_SUPPORT" = "yes" -a -f $MOUNT/backtrace_depth; then
+ set_param backtrace_depth $CALLGRAPH
+ elif test "$CALLGRAPH" != "0"; then
+ echo "Call-graph profiling not supported - ignored" >&2
+ fi
+
+ if test "$IS_TIMER" = 1; then
+ return
+ fi
+
+ # use the default setup if none set
+ if test "$NR_CHOSEN" = 0; then
+ set_event 0 $DEFAULT_EVENT
+ NR_CHOSEN=1
+ HW_CTRS=`$OPHELP --check-events $DEFAULT_EVENT --callgraph=$CALLGRAPH`
+ echo "Using default event: $DEFAULT_EVENT"
+ fi
+
+ # Necessary in this case :
+ # opcontrol ctr0-on ctr1-on then opcontrol ctr0-on
+ for f in $OP_COUNTERS ; do
+ set_ctr_param $f enabled 0
+ set_ctr_param $f event 0
+ set_ctr_param $f count 0
+ done
+
+ # Check if driver has IBS support
+ if test -d $MOUNT/ibs_fetch; then
+ # Reset driver's IBS fetch setting
+ set_param ibs_fetch/enable 0
+ fi
+
+ if test -d $MOUNT/ibs_op ; then
+ # Reset driver's IBS op setting
+ set_param ibs_op/enable 0
+ fi
+
+ verify_counters
+
+ OPROFILED_EVENTS=
+ for f in `seq 0 $((NR_CHOSEN - 1))`; do
+ get_event $f
+ if test "$GOTEVENT" != ""; then
+ EVENT=`echo $GOTEVENT | awk -F: '{print $1}'`
+ EVENT_STR=`$OPHELP $EVENT`
+ EVENT_VAL=`echo $EVENT_STR | awk '{print $1}'`
+ COUNT=`echo $GOTEVENT | awk -F: '{print $2}'`
+ UNIT_MASK=`echo $GOTEVENT | awk -F: '{print $3}'`
+ KERNEL=`echo $GOTEVENT | awk -F: '{print $4}'`
+ USER=`echo $GOTEVENT | awk -F: '{print $5}'`
+ CTR=`echo $HW_CTRS | awk "{print \\$$((f + 1))}"`
+ check_event_mapping_data
+
+ if test "$EVENT" = "SPU_CYCLES"; then
+ if test "$SEPARATE_KERNEL" = "1"; then
+ SEPARATE_KERNEL=0
+ echo "Ignoring --separate=kernel option with SPU_CYCLES"
+ fi
+ if test "$SEPARATE_LIB" = "0"; then
+ SEPARATE_LIB=1
+ echo "Forcing required option --separate=lib with SPU_CYCLES"
+ fi
+
+ # It is possible for a single application to be
+ # running on all SPUs simultaneously. Without
+ # SEPARATE_CPU, the resulting sample data would
+ # consist of a single sample file. If all SPUs
+ # were truly running the same code, the merging
+ # of sample data would be fine. However, an
+ # application file may have multiple SPU images
+ # embedded within it, resulting in different
+ # code running on different SPUs. Therefore,
+ # we force SEPARATE_CPU in order to properly
+ # handle this case.
+ if test "$SEPARATE_CPU" = "0"; then
+ SEPARATE_CPU=1
+ echo "Forcing required option --separate=cpu with SPU_CYCLES"
+
+ fi
+ fi
+
+ if [ "$CTR" = "ibs_fetch" -o "$CTR" = "ibs_op" ] ; then
+ # Handle IBS events setup
+ do_param_setup_ibs
+ continue
+ fi
+
+ if test "$EVENT" = "RTC_INTERRUPTS"; then
+ set_param rtc_value $COUNT
+ $SYSCTL -w dev.oprofile.rtc_value=$COUNT
+ else
+ set_ctr_param $CTR enabled 1
+ set_ctr_param $CTR event $EVENT_VAL
+ loop_count=1
+ for i in ${EVENT_STR}; do
+ #Skip first argument of EVENT_STR (event val) since we've already
+ #processed that value.
+ if test "$loop_count" -gt 1; then
+ KEY=`echo $i | awk -F: '{print $1}'`
+ VAL=`echo $i | awk -F: '{print $2}'`
+ set_ctr_param "" $KEY $VAL
+ fi
+ loop_count=$((loop_count+1))
+ done
+ set_ctr_param $CTR count $COUNT
+ set_ctr_param $CTR kernel $KERNEL
+ set_ctr_param $CTR user $USER
+ set_ctr_param $CTR unit_mask $UNIT_MASK
+ fi
+ OPROFILED_EVENTS=${OPROFILED_EVENTS}$EVENT:$EVENT_VAL:
+ OPROFILED_EVENTS=${OPROFILED_EVENTS}$CTR:$COUNT:$UNIT_MASK:
+ OPROFILED_EVENTS=${OPROFILED_EVENTS}$KERNEL:$USER,
+ fi
+ done
+
+ # For PPC64 architectures we need to set the enable_kernel and
+ # enable_user flags for enabling/disabling user/kernel domain
+ # profiling. All per-counter user/kernel flags must match.
+ # This condition is checked previously by check_event_mapping_data.
+ # This statement uses the last event's user/kernel flags to set
+ # /dev/oprofile/enable_kernel and /dev/oprofile/enable_user.
+ is_non_cell_ppc64_variant $CPUTYPE
+ if test $? -ne 0 ; then
+ set_param "enable_kernel" $KERNEL
+ set_param "enable_user" $USER
+ fi
+
+}
+
+
+do_start_daemon()
+{
+
+ if test -f "$LOCK_FILE"; then
+ kill -0 `cat $LOCK_FILE` 2>/dev/null
+ if test "$?" -eq 0; then
+ return;
+ else
+ echo "Detected stale lock file. Removing." >&2
+ rm -f "$LOCK_FILE"
+ fi
+ fi
+
+ do_setup
+ check_valid_args
+ get_image_range "linux"
+ get_image_range "xen"
+ do_param_setup
+
+ OPD_ARGS=" \
+ --session-dir=$SESSION_DIR \
+ --separate-lib=$SEPARATE_LIB \
+ --separate-kernel=$SEPARATE_KERNEL \
+ --separate-thread=$SEPARATE_THREAD \
+ --separate-cpu=$SEPARATE_CPU"
+
+ if test "$IS_TIMER" = 1; then
+ OPD_ARGS="$OPD_ARGS --events="
+ else
+ if ! test -z "$OPROFILED_EVENTS"; then
+ OPD_ARGS="$OPD_ARGS --events=$OPROFILED_EVENTS"
+ fi
+ fi
+
+ if test "$VMLINUX" = "none"; then
+ OPD_ARGS="$OPD_ARGS --no-vmlinux"
+ else
+ OPD_ARGS="$OPD_ARGS --vmlinux=$VMLINUX --kernel-range=$KERNEL_RANGE"
+ fi
+
+ if ! test "$XENIMAGE" = "none"; then
+ OPD_ARGS="$OPD_ARGS --xen-image=$XENIMAGE --xen-range=$XEN_RANGE"
+ fi
+
+ if ! test -z "$IMAGE_FILTER"; then
+ OPD_ARGS="$OPD_ARGS --image=$IMAGE_FILTER"
+ fi
+
+ if test -n "$VERBOSE"; then
+ OPD_ARGS="$OPD_ARGS --verbose=$VERBOSE"
+ fi
+
+ help_start_daemon_with_ibs
+
+ vecho "executing oprofiled $OPD_ARGS"
+
+ $OPROFILED $OPD_ARGS
+
+ COUNT=0
+ while ! test -f "$SESSION_DIR/lock"
+ do
+ sleep 1
+ COUNT=`expr $COUNT + 1`
+ if test "$COUNT" -eq 10; then
+ echo "Couldn't start oprofiled." >&2
+ echo "Check the log file \"$LOG_FILE\" and kernel syslog" >&2
+ exit 1
+ fi
+ done
+
+ echo "Daemon started."
+}
+
+do_start()
+{
+ prep_jitdump;
+ if test "$KERNEL_SUPPORT" = "yes"; then
+ echo 1 >$MOUNT/enable
+ fi
+ kill -USR1 `cat $LOCK_FILE` 2>/dev/null
+ echo "Profiler running."
+}
+
+
+# print status
+do_status()
+{
+ OPROFILED_PID=`cat $SESSION_DIR/lock 2>/dev/null`
+ if test -n "$OPROFILED_PID" -a -d "/proc/$OPROFILED_PID"; then
+ echo "Daemon running: pid $OPROFILED_PID"
+ else
+ echo "Daemon not running"
+ fi
+
+ if test "$NR_CHOSEN" != "0"; then
+ for f in `seq 0 $((NR_CHOSEN - 1))`; do
+ get_event $f
+ echo "Event $f: $GOTEVENT"
+ done
+ fi
+
+ SEPARATE=""
+ if test "$SEPARATE_LIB" = "1"; then
+ SEPARATE="library";
+ fi
+ if test "$SEPARATE_KERNEL" = "1"; then
+ SEPARATE="$SEPARATE kernel";
+ fi
+ if test "$SEPARATE_THREAD" = "1"; then
+ SEPARATE="$SEPARATE thread";
+ fi
+ if test "$SEPARATE_CPU" = "1"; then
+ SEPARATE="$SEPARATE cpu";
+ fi
+
+ if test -z "$SEPARATE"; then
+ SEPARATE=none
+ fi
+
+ echo "Separate options: $SEPARATE"
+ echo "vmlinux file: $VMLINUX"
+
+ if test -z "$IMAGE_FILTER"; then
+ echo "Image filter: none"
+ else
+ echo "Image filter: $IMAGE_FILTER"
+ fi
+
+ echo "Call-graph depth: $CALLGRAPH"
+ if test "$BUF_SIZE" != "0"; then
+ echo "Buffer size: $BUF_SIZE"
+ fi
+ if test "$KERNEL_SUPPORT" != "yes"; then
+ if test "$NOTE_SIZE" != "0"; then
+ echo "Note buffer size: $NOTE_SIZE"
+ fi
+ else
+ if test "$BUF_WATERSHED" != "0"; then
+ echo "CPU buffer watershed: $BUF_WATERSHED"
+ fi
+ if test "$CPU_BUF_SIZE" != "0"; then
+ echo "CPU buffer size: $CPU_BUF_SIZE"
+ fi
+ fi
+
+ exit 0
+}
+
+
+# do_dump_data
+# returns 0 if successful
+# returns 1 if the daemon is unable to dump data
+# exit 1 if we need to be root to dump
+do_dump_data()
+{
+ # make sure that the daemon is not dead and gone
+ if test -e "$SESSION_DIR/lock"; then
+ OPROFILED_PID=`cat $SESSION_DIR/lock`
+ if test ! -d "/proc/$OPROFILED_PID"; then
+ echo "dump fail: daemon died during last run ?" >&2
+ return 1;
+ fi
+ else
+ return 1;
+ fi
+
+ if test "$KERNEL_SUPPORT" = "yes"; then
+ if ! test -w $MOUNT/dump; then
+ if test `id -u` != "0"; then
+ echo "You must be root to dump with this kernel version"
+ exit 1
+ fi
+ fi
+ # trigger oprofiled to execute opjitconv
+ echo do_jitconv > $SESSION_DIR/opd_pipe
+ rm -f "$SESSION_DIR/complete_dump"
+ echo 1 > $MOUNT/dump
+ # loop until the complete_dump file is created to
+ # signal that the dump has been completed
+ while [ \( ! -e "$SESSION_DIR/complete_dump" \) ]
+ do
+ if test ! -d "/proc/$OPROFILED_PID"; then
+ echo "dump fail: either daemon died during last run or dies during dump" >&2
+ return 1
+ fi
+ sleep 1;
+ done
+ else
+ echo 1 > $MOUNT/dump
+ # HACK !
+ sleep 2
+ fi
+ return 0;
+}
+
+
+# do_dump
+# returns 0 if successful
+# exits if unsuccessful
+do_dump()
+{
+ do_dump_data
+ if test $? -ne 0 -a "$ONLY_DUMP" = "yes"; then
+ echo "Unable to complete dump of oprofile data: is the oprofile daemon running?" >& 2
+ exit 1;
+ fi
+ return 0;
+}
+
+# tell daemon to re-open the sample files
+hup_daemon()
+{
+ if test -f "$LOCK_FILE"; then
+ echo -n "Signalling daemon... "
+ kill -HUP `cat $LOCK_FILE`
+ echo "done"
+ fi
+}
+
+
+# move all the sample files to a sample directory
+do_save_session()
+{
+ SAVE_DIR="${SAMPLES_DIR}/${SAVE_NAME}"
+
+ if test -e "$SAVE_DIR"; then
+ echo "session $SAVE_DIR already exists" >&2
+ exit 1
+ fi
+
+ if ! test -e $CURRENT_SAMPLES_DIR; then
+ echo "$CURRENT_SAMPLES_DIR doesn't exist: nothing to save" >&2
+ exit 0
+ fi
+
+ # FIXME: I don't think it's worth checking for empty current directory
+
+ mv $CURRENT_SAMPLES_DIR $SAVE_DIR
+ if test "$?" != "0"; then
+ echo "Couldn't move $CURRENT_SAMPLES_DIR to $SAVE_DIR" >&2
+ exit 1
+ fi
+
+ hup_daemon
+}
+
+
+# remove all the sample files
+do_reset()
+{
+ if test -z "$SAMPLES_DIR"; then
+ echo "opcontrol:do_reset() SAMPLES_DIR is empty!"
+ exit 1;
+ fi
+
+ # daemon use {kern} and {root} subdir, it's not a typo to not use ${}
+ move_and_remove $SAMPLES_DIR/current/{kern}
+ move_and_remove $SAMPLES_DIR/current/{root}
+ move_and_remove $SAMPLES_DIR/current/stats
+
+ # clear temp directory for jitted code
+ prep_jitdump;
+
+ hup_daemon
+}
+
+
+do_deinit()
+{
+ # unmount /dev/oprofile if it is mounted
+ OPROF_FS=`grep /dev/oprofile /etc/mtab`
+ if test -n "$OPROF_FS"; then
+ umount /dev/oprofile
+ fi
+ # unload the oprofile module if it is around
+ OPROF_MOD=`lsmod | grep oprofile`
+ if test -n "$OPROF_MOD"; then
+ echo "Unloading oprofile module" >& 2
+ rmmod oprofile
+ fi
+}
+
+
+# The function that calls the appropriate operations
+do_operations()
+{
+ # INIT always done by load_module to get access to cputype
+ # thus INIT is a noop
+
+ if test "$STATUS" = "yes"; then
+ do_status
+ fi
+
+ if test "$SETUP" = "yes"; then
+ check_valid_args
+ do_save_setup
+ fi
+
+ if test "$START_DAEMON" = "yes"; then
+ do_start_daemon
+ fi
+
+ if test "$START" = "yes"; then
+ do_start_daemon
+ do_start
+ fi
+
+ if test "$DUMP" = "yes"; then
+ do_dump
+ fi
+
+ if test "$SAVE_SESSION" = "yes"; then
+ do_save_session
+ fi
+
+ if test "$STOP" = "yes"; then
+ do_stop
+ fi
+
+ if test "$KILL_DAEMON" = "yes"; then
+ do_kill_daemon
+ fi
+
+ if test "$RESET" = "yes"; then
+ do_reset
+ fi
+
+ if test "$DEINIT" = "yes"; then
+ do_deinit
+ fi
+}
+
+# early check for --version, --help and --session-dir
+check_options_early()
+{
+
+ OPHELP="$OPDIR/ophelp"
+
+ for i in $@; do
+ # added to handle arg=val parameters
+ arg=`printf %s $i | awk -F= '{print $1}'`
+ val=`printf %s $i | awk -F= '{print $2}'`
+ case "$arg" in
+ -\?|--help)
+ do_help
+ exit 0
+ ;;
+
+ -v|--version)
+ echo -n "`basename $0`: "
+ $OPHELP --version | cut -d' ' -f2-
+ exit 0
+ ;;
+ --session-dir)
+ error_if_empty $arg $val
+ SESSION_DIR="$val"
+ DO_SETUP=yes
+ # do not exit early
+ ;;
+
+ esac
+ done
+}
+
+
+# determine which module is loaded
+check_version()
+{
+ OPROFILE_AVAILABLE=no
+ grep oprofilefs /etc/mtab >/dev/null
+ if test "$?" -eq 0; then
+ # need to have oprofilefs mounted for this to work on 2.6
+ KERNEL_SUPPORT=yes
+ OPROFILE_AVAILABLE=yes
+ return
+ fi
+ # need to have /proc/oprof available for this to work on 2.4
+ grep oprof /proc/devices >/dev/null
+ if test "$?" -eq 0; then
+ KERNEL_SUPPORT=no
+ OPROFILE_AVAILABLE=yes
+ return
+ fi
+}
+
+# error out if the module is not loaded
+check_oprofile_available()
+{
+ if test "$OPROFILE_AVAILABLE" != "yes"; then
+ echo "Kernel support not available, missing opcontrol --init as root ?"
+ exit 1
+ fi
+}
+
+
+try_reset_sample_file()
+{
+ # special case to avoid loading the module, it works only if the
+ # daemon is not running because --reset imply --dump. Rather to check
+ # if the daemon is running we check if the module is loaded because
+ # we are only trying to avoid its load, if the check fails we fallback
+ # to the normal dump / reset sequence.
+ if test -z "$2" -a "$1" = "--reset"; then
+ check_version
+ if test "$OPROFILE_AVAILABLE" != "yes"; then
+ do_init_daemon_vars
+ do_reset
+ exit 0
+ fi
+ fi
+}
+
+#
+# Begin IBS Specific Functions
+#
+verify_ibs()
+{
+ IBS_EVENT=`echo $1| awk -F: '{print $1}'`
+ IBS_COUNT=`echo $1 | awk -F: '{print $2}'`
+ IBS_MASK=`echo $1 | awk -F: '{print $3}'`
+
+ IBS_TYPE=`$OPHELP --check-events $1`
+ if test "$?" != "0" ; then
+ exit 1
+ fi
+
+ if [ "$IBS_TYPE" = "ibs_fetch " ] ; then
+ # Check IBS_COUNT consistency
+ if test "$IBS_FETCH_COUNT" = "0" ; then
+ IBS_FETCH_COUNT=$IBS_COUNT
+ IBS_FETCH_MASK=$IBS_MASK
+ elif test "$IBS_FETCH_COUNT" != "$IBS_COUNT" ; then
+ echo "All IBS Fetch must have the same count."
+ exit 1
+ fi
+
+ # Check IBS_MASK consistency
+ if test "$IBS_FETCH_MASK" != "$IBS_MASK" ; then
+ echo "All IBS Fetch must have the same unitmask."
+ exit 1
+ fi
+
+ elif [ "$IBS_TYPE" = "ibs_op " ] ; then
+ # Check IBS_COUNT consistency
+ if test "$IBS_OP_COUNT" = "0" ; then
+ IBS_OP_COUNT=$IBS_COUNT
+ IBS_OP_MASK=$IBS_MASK
+ elif test "$IBS_OP_COUNT" != "$IBS_COUNT" ; then
+ echo "All IBS Op must have the same count."
+ exit 1
+ fi
+
+ # Check IBS_MASK consistency
+ if test "$IBS_OP_MASK" != "$IBS_MASK" ; then
+ echo "All IBS Op must have the same unitmask."
+ exit 1
+ fi
+ fi
+
+ return
+}
+
+
+do_param_setup_ibs()
+{
+ if test "$KERNEL_SUPPORT" != "yes" ; then
+ echo "ERROR: No kernel support for IBS profiling."
+ exit 1
+ fi
+
+ # Check if driver has IBS support
+ if test ! -d $MOUNT/ibs_fetch -o ! -d $MOUNT/ibs_op ; then
+ echo "ERROR: No kernel support for IBS profiling."
+ exit 1
+ fi
+
+ if test `echo $EVENT | \
+ awk '{ print substr($0, 1, 10)}'` = "IBS_FETCH_" ; then
+ if test "$COUNT" != "0"; then
+ if [ "$IBS_FETCH_EVENTS" = "" ] ; then
+ IBS_FETCH_EVENTS="$EVENT"
+ else
+ IBS_FETCH_EVENTS="$IBS_FETCH_EVENTS,$EVENT"
+ fi
+ IBS_FETCH_COUNT=$COUNT
+ set_param ibs_fetch/max_count $COUNT
+ set_param ibs_fetch/rand_enable 1
+ set_param ibs_fetch/enable 1
+ else
+ set_param ibs_fetch/enable 0
+ fi
+
+ elif test `echo $EVENT | \
+ awk '{ print substr($0, 1, 7)}'` = "IBS_OP_" ; then
+ if test "$COUNT" != "0"; then
+ if [ "$IBS_OP_EVENTS" = "" ] ; then
+ IBS_OP_EVENTS="$EVENT"
+ else
+ IBS_OP_EVENTS="$IBS_OP_EVENTS,$EVENT"
+ fi
+ IBS_OP_COUNT=$COUNT
+ IBS_OP_UNITMASK=$UNIT_MASK
+
+ set_param ibs_op/max_count $COUNT
+ set_param ibs_op/enable 1
+
+ # NOTE: We default to use dispatched_op if available.
+ # Some of the older family10 system does not have
+ # dispatched_ops feature.
+ # dispatched op is enabled by bit 1 of the unitmask
+ if test -f $MOUNT/ibs_op/dispatched_ops ; then
+ IBS_OP_DISPATCHED_OP=$(( IBS_OP_UNITMASK & 0x1 ))
+ set_param ibs_op/dispatched_ops $IBS_OP_DISPATCHED_OP
+ fi
+ else
+ set_param ibs_op/enable 0
+ fi
+ fi
+}
+
+
+help_start_daemon_with_ibs()
+{
+ if test "$IBS_FETCH_COUNT" != "0" -o "$IBS_OP_COUNT" != "0" ; then
+ OPD_ARGS="${OPD_ARGS} --ext-feature=ibs:"
+ if test "$IBS_FETCH_COUNT" != "0"; then
+ OPD_ARGS="${OPD_ARGS}fetch:$IBS_FETCH_EVENTS:$IBS_FETCH_COUNT:$IBS_FETCH_UNITMASK|"
+ fi
+
+ if test "$IBS_OP_COUNT" != "0"; then
+ OPD_ARGS="${OPD_ARGS}op:$IBS_OP_EVENTS:$IBS_OP_COUNT:$IBS_OP_UNITMASK"
+ fi
+ fi
+}
+
+#
+# End IBS Specific Functions
+#
+
+# main
+
+# determine the location of opcontrol and related programs
+if test -z "$OPDIR"; then
+ BINDIR="/usr/bin"
+ OPCONTROL=`$BINDIR/which $0`
+ OPDIR=`$BINDIR/dirname $OPCONTROL`
+fi
+
+PATH=$OPDIR:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin
+
+check_options_early $@
+
+if test -z "$1"; then
+ do_help
+ exit 0
+fi
+
+if test `id -u` = "0"; then
+ try_reset_sample_file $@
+
+ load_module
+fi
+check_version
+
+# Except --reset, even the few operations allowed as non root needs the
+# kernel support, if we don't error out now the error message will be obscure
+check_oprofile_available
+
+do_init
+if test `id -u` != "0"; then
+ if test -z "$2"; then
+ case "$1" in
+ --dump|-d)
+ ONLY_DUMP=yes
+ do_dump
+ exit 0;
+ ;;
+ --list-events|-l)
+ exec $OPHELP
+ exit 0;
+ ;;
+ *)
+ echo "Normal users are limited to either '--dump' or '--list-events'." >&2
+ exit 1
+ ;;
+ esac
+ else
+ echo "Normal users are limited to either '--dump' or '--list-events'." >&2
+ exit 1
+ fi
+fi
+
+do_options $@
+do_operations
diff --git a/utils/ophelp.c b/utils/ophelp.c
new file mode 100644
index 0000000..5f6c534
--- /dev/null
+++ b/utils/ophelp.c
@@ -0,0 +1,678 @@
+/**
+ * @file ophelp.c
+ * Print out PMC event information
+ *
+ * @remark Copyright 2002 OProfile authors
+ * @remark Read the file COPYING
+ *
+ * @author John Levon
+ * @author Philippe Elie
+ */
+
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <limits.h>
+
+#include "op_version.h"
+#include "op_events.h"
+#include "op_popt.h"
+#include "op_cpufreq.h"
+#include "op_hw_config.h"
+#include "op_string.h"
+#include "op_alloc_counter.h"
+#include "op_parse_event.h"
+#include "op_libiberty.h"
+#include "op_xml_events.h"
+
+static char const ** chosen_events;
+static int num_chosen_events;
+struct parsed_event * parsed_events;
+static op_cpu cpu_type = CPU_NO_GOOD;
+static char * cpu_string;
+static int callgraph_depth;
+static int want_xml;
+
+static poptContext optcon;
+
+
+/// return the Hamming weight (number of set bits)
+static size_t hweight(size_t mask)
+{
+ size_t count = 0;
+
+ while (mask) {
+ mask &= mask - 1;
+ count++;
+ }
+
+ return count;
+}
+
+static void do_arch_specific_event_help(struct op_event * event)
+{
+ switch (cpu_type) {
+ case CPU_PPC64_CELL:
+ printf("Group %u :", event->val / 100);
+ break;
+ default:
+ break;
+ }
+}
+
+#define LINE_LEN 99
+
+static void word_wrap(int indent, int *column, char *msg)
+{
+ while (*msg) {
+ int wlen = strcspn(msg, " ");
+ if (*column + wlen > LINE_LEN) {
+ printf("\n%*s", indent, "");
+ *column = indent;
+ }
+ printf("%.*s ", wlen, msg);
+ *column += wlen + 1;
+ msg += wlen;
+ msg += strspn(msg, " ");
+ }
+}
+
+/**
+ * help_for_event - output event name and description
+ * @param i event number
+ *
+ * output an help string for the event @i
+ */
+static void help_for_event(struct op_event * event)
+{
+ int column;
+ uint i, j;
+ uint mask;
+ size_t nr_counters;
+ char buf[32];
+
+ do_arch_specific_event_help(event);
+ nr_counters = op_get_nr_counters(cpu_type);
+
+ /* Sanity check */
+ if (!event)
+ return;
+
+ printf("%s", event->name);
+
+ if(event->counter_mask != 0) {
+ printf(": (counter: ");
+
+ mask = event->counter_mask;
+ if (hweight(mask) == nr_counters) {
+ printf("all");
+ } else {
+ for (i = 0; i < CHAR_BIT * sizeof(event->counter_mask); ++i) {
+ if (mask & (1 << i)) {
+ printf("%d", i);
+ mask &= ~(1 << i);
+ if (mask)
+ printf(", ");
+ }
+ }
+ }
+ } else if (event->ext != NULL) {
+ /* Handling extended feature interface */
+ printf(": (ext: %s", event->ext);
+ } else {
+ /* Handling arch_perfmon case */
+ printf(": (counter: all");
+ }
+
+ printf(")\n\t");
+ column = 8;
+ word_wrap(8, &column, event->desc);
+ snprintf(buf, sizeof buf, "(min count: %d)", event->min_count);
+ word_wrap(8, &column, buf);
+ putchar('\n');
+
+ if (strcmp(event->unit->name, "zero")) {
+
+ printf("\tUnit masks (default 0x%x)\n",
+ event->unit->default_mask);
+ printf("\t----------\n");
+
+ for (j = 0; j < event->unit->num; j++) {
+ printf("\t0x%.2x: ",
+ event->unit->um[j].value);
+ column = 14;
+ word_wrap(14, &column, event->unit->um[j].desc);
+ putchar('\n');
+ }
+ }
+}
+
+
+static void check_event(struct parsed_event * pev,
+ struct op_event const * event)
+{
+ int ret;
+ int min_count;
+ int const callgraph_min_count_scale = 15;
+
+ if (!event) {
+ event = find_event_by_name(pev->name, 0, 0);
+ if (event)
+ fprintf(stderr, "Invalid unit mask %x for event %s\n",
+ pev->unit_mask, pev->name);
+ else
+ fprintf(stderr, "No event named %s is available.\n",
+ pev->name);
+ exit(EXIT_FAILURE);
+ }
+
+ ret = op_check_events(0, event->val, pev->unit_mask, cpu_type);
+
+ if (ret & OP_INVALID_UM) {
+ fprintf(stderr, "Invalid unit mask 0x%x for event %s\n",
+ pev->unit_mask, pev->name);
+ exit(EXIT_FAILURE);
+ }
+
+ min_count = event->min_count;
+ if (callgraph_depth)
+ min_count *= callgraph_min_count_scale;
+ if (pev->count < min_count) {
+ fprintf(stderr, "Count %d for event %s is below the "
+ "minimum %d\n", pev->count, pev->name, min_count);
+ exit(EXIT_FAILURE);
+ }
+}
+
+
+static void resolve_events(void)
+{
+ size_t count, count_events;
+ size_t i, j;
+ size_t * counter_map;
+ size_t nr_counters = op_get_nr_counters(cpu_type);
+ struct op_event const * selected_events[num_chosen_events];
+
+ count = parse_events(parsed_events, num_chosen_events, chosen_events);
+
+ for (i = 0; i < count; ++i) {
+ for (j = i + 1; j < count; ++j) {
+ struct parsed_event * pev1 = &parsed_events[i];
+ struct parsed_event * pev2 = &parsed_events[j];
+
+ if (!strcmp(pev1->name, pev2->name) &&
+ pev1->count == pev2->count &&
+ pev1->unit_mask == pev2->unit_mask &&
+ pev1->kernel == pev2->kernel &&
+ pev1->user == pev2->user) {
+ fprintf(stderr, "All events must be distinct.\n");
+ exit(EXIT_FAILURE);
+ }
+ }
+ }
+
+ for (i = 0, count_events = 0; i < count; ++i) {
+ struct parsed_event * pev = &parsed_events[i];
+
+ /* For 0 unit mask always do wild card match */
+ selected_events[i] = find_event_by_name(pev->name, pev->unit_mask,
+ pev->unit_mask ? pev->unit_mask_valid : 0);
+ check_event(pev, selected_events[i]);
+
+ if (selected_events[i]->ext == NULL) {
+ count_events++;
+ }
+ }
+ if (count_events > nr_counters) {
+ fprintf(stderr, "Not enough hardware counters. "
+ "Need %lu counters but only has %lu.\n",
+ (unsigned long) count_events,
+ (unsigned long) nr_counters);
+ exit(EXIT_FAILURE);
+ }
+
+ counter_map = map_event_to_counter(selected_events, count, cpu_type);
+
+ if (!counter_map) {
+ fprintf(stderr, "Couldn't allocate hardware counters for the selected events.\n");
+ exit(EXIT_FAILURE);
+ }
+
+ for (i = 0; i < count; ++i)
+ if(counter_map[i] == (size_t)-1)
+ if (selected_events[i]->ext != NULL)
+ printf("%s ", (char*) selected_events[i]->ext);
+ else
+ printf("N/A ");
+ else
+ printf("%d ", (unsigned int) counter_map[i]);
+ printf("\n");
+
+ free(counter_map);
+}
+
+
+static void show_unit_mask(void)
+{
+ struct op_event * event;
+ size_t count;
+
+ count = parse_events(parsed_events, num_chosen_events, chosen_events);
+ if (count > 1) {
+ fprintf(stderr, "More than one event specified.\n");
+ exit(EXIT_FAILURE);
+ }
+
+ event = find_event_by_name(parsed_events[0].name, 0, 0);
+
+ if (!event) {
+ fprintf(stderr, "No such event found.\n");
+ exit(EXIT_FAILURE);
+ }
+
+ printf("%d\n", event->unit->default_mask);
+}
+
+
+static void show_default_event(void)
+{
+ struct op_default_event_descr descr;
+
+ op_default_event(cpu_type, &descr);
+
+ if (descr.name[0] == '\0')
+ return;
+
+ printf("%s:%lu:%lu:1:1\n", descr.name, descr.count, descr.um);
+}
+
+
+static int show_vers;
+static int get_cpu_type;
+static int check_events;
+static int unit_mask;
+static int get_default_event;
+
+static struct poptOption options[] = {
+ { "cpu-type", 'c', POPT_ARG_STRING, &cpu_string, 0,
+ "use the given CPU type", "cpu type", },
+ { "check-events", 'e', POPT_ARG_NONE, &check_events, 0,
+ "check the given event descriptions for validity", NULL, },
+ { "unit-mask", 'u', POPT_ARG_NONE, &unit_mask, 0,
+ "default unit mask for the given event", NULL, },
+ { "get-cpu-type", 'r', POPT_ARG_NONE, &get_cpu_type, 0,
+ "show the auto-detected CPU type", NULL, },
+ { "get-default-event", 'd', POPT_ARG_NONE, &get_default_event, 0,
+ "get the default event", NULL, },
+ { "callgraph", '\0', POPT_ARG_INT, &callgraph_depth, 0,
+ "use this callgraph depth", "callgraph depth", },
+ { "version", 'v', POPT_ARG_NONE, &show_vers, 0,
+ "show version", NULL, },
+ { "xml", 'X', POPT_ARG_NONE, &want_xml, 0,
+ "list events as XML", NULL, },
+ POPT_AUTOHELP
+ { NULL, 0, 0, NULL, 0, NULL, NULL, },
+};
+
+/**
+ * get_options - process command line
+ * @param argc program arg count
+ * @param argv program arg array
+ *
+ * Process the arguments, fatally complaining on error.
+ */
+static void get_options(int argc, char const * argv[])
+{
+ optcon = op_poptGetContext(NULL, argc, argv, options, 0);
+
+ if (show_vers)
+ show_version(argv[0]);
+
+ /* non-option, must be a valid event name or event specs */
+ chosen_events = poptGetArgs(optcon);
+
+ if(chosen_events) {
+ num_chosen_events = 0;
+ while (chosen_events[num_chosen_events] != NULL)
+ num_chosen_events++;
+ }
+
+ /* don't free the context now, we need chosen_events */
+}
+
+
+/** make valgrind happy */
+static void cleanup(void)
+{
+ int i;
+ if (parsed_events) {
+ for (i = 0; i < num_chosen_events; ++i) {
+ if (parsed_events[i].name)
+ free(parsed_events[i].name);
+ }
+ }
+ op_free_events();
+ if (optcon)
+ poptFreeContext(optcon);
+ if (parsed_events)
+ free(parsed_events);
+}
+
+
+#define MAX_LINE 256
+int main(int argc, char const * argv[])
+{
+ struct list_head * events;
+ struct list_head * pos;
+ char const * pretty;
+ char title[10 * MAX_LINE];
+ char const * event_doc = "";
+
+ atexit(cleanup);
+
+ get_options(argc, argv);
+
+ /* usefull for testing purpose to allow to force the cpu type
+ * with --cpu-type */
+ if (cpu_string) {
+ cpu_type = op_get_cpu_number(cpu_string);
+ } else {
+ cpu_type = op_get_cpu_type();
+ }
+
+ if (cpu_type == CPU_NO_GOOD) {
+ fprintf(stderr, "cpu_type '%s' is not valid\n",
+ cpu_string ? cpu_string : "unset");
+ fprintf(stderr, "you should upgrade oprofile or force the "
+ "use of timer mode\n");
+ exit(EXIT_FAILURE);
+ }
+
+ parsed_events = (struct parsed_event *)xcalloc(num_chosen_events,
+ sizeof(struct parsed_event));
+
+ pretty = op_get_cpu_type_str(cpu_type);
+
+ if (get_cpu_type) {
+ printf("%s\n", pretty);
+ exit(EXIT_SUCCESS);
+ }
+
+ if (get_default_event) {
+ show_default_event();
+ exit(EXIT_SUCCESS);
+ }
+
+ if (cpu_type == CPU_TIMER_INT) {
+ if (!check_events)
+ printf("Using timer interrupt.\n");
+ exit(EXIT_SUCCESS);
+ }
+
+ events = op_events(cpu_type);
+
+ if (!chosen_events && (unit_mask || check_events)) {
+ fprintf(stderr, "No events given.\n");
+ exit(EXIT_FAILURE);
+ }
+
+ if (unit_mask) {
+ show_unit_mask();
+ exit(EXIT_SUCCESS);
+ }
+
+ if (check_events) {
+ resolve_events();
+ exit(EXIT_SUCCESS);
+ }
+
+ /* without --check-events, the only argument must be an event name */
+ if (chosen_events && chosen_events[0]) {
+ if (chosen_events[1]) {
+ fprintf(stderr, "Too many arguments.\n");
+ exit(EXIT_FAILURE);
+ }
+
+ list_for_each(pos, events) {
+ struct op_event * event = list_entry(pos, struct op_event, event_next);
+
+ if (strcmp(event->name, chosen_events[0]) == 0) {
+ char const * map = find_mapping_for_event(event->val, cpu_type);
+ if (map) {
+ printf("%d %s\n", event->val, map);
+ } else {
+ printf("%d\n", event->val);
+ }
+ exit(EXIT_SUCCESS);
+ }
+ }
+ fprintf(stderr, "No such event \"%s\"\n", chosen_events[0]);
+ exit(EXIT_FAILURE);
+ }
+
+ /* default: list all events */
+
+ switch (cpu_type) {
+ case CPU_HAMMER:
+ event_doc =
+ "See BIOS and Kernel Developer's Guide for AMD Athlon and AMD Opteron Processors\n"
+ "(26094.pdf), Section 10.2\n\n";
+ break;
+ case CPU_FAMILY10:
+ event_doc =
+ "See BIOS and Kernel Developer's Guide for AMD Family 10h Processors\n"
+ "(31116.pdf), Section 3.14\n\n";
+ break;
+ case CPU_FAMILY11H:
+ event_doc =
+ "See BIOS and Kernel Developer's Guide for AMD Family 11h Processors\n"
+ "(41256.pdf), Section 3.14\n\n";
+ break;
+ case CPU_ATHLON:
+ event_doc =
+ "See AMD Athlon Processor x86 Code Optimization Guide\n"
+ "(22007.pdf), Appendix D\n\n";
+ break;
+ case CPU_PPRO:
+ case CPU_PII:
+ case CPU_PIII:
+ case CPU_P6_MOBILE:
+ case CPU_P4:
+ case CPU_P4_HT2:
+ case CPU_CORE:
+ case CPU_CORE_2:
+ case CPU_CORE_I7:
+ case CPU_ATOM:
+ event_doc =
+ "See Intel Architecture Developer's Manual Volume 3B, Appendix A and\n"
+ "Intel Architecture Optimization Reference Manual (730795-001)\n\n";
+ break;
+
+ case CPU_ARCH_PERFMON:
+ event_doc =
+ "See Intel 64 and IA-32 Architectures Software Developer's Manual\n"
+ "Volume 3B (Document 253669) Chapter 18 for architectural perfmon events\n"
+ "This is a limited set of fallback events because oprofile doesn't know your CPU\n";
+ break;
+
+ case CPU_IA64:
+ case CPU_IA64_1:
+ case CPU_IA64_2:
+ event_doc =
+ "See Intel Itanium Processor Reference Manual\n"
+ "for Software Development (Document 245320-003),\n"
+ "Intel Itanium Processor Reference Manual\n"
+ "for Software Optimization (Document 245473-003),\n"
+ "Intel Itanium 2 Processor Reference Manual\n"
+ "for Software Development and Optimization (Document 251110-001)\n\n";
+ break;
+ case CPU_AXP_EV4:
+ case CPU_AXP_EV5:
+ case CPU_AXP_PCA56:
+ case CPU_AXP_EV6:
+ case CPU_AXP_EV67:
+ event_doc =
+ "See Alpha Architecture Reference Manual\n"
+ "http://download.majix.org/dec/alpha_arch_ref.pdf\n";
+ break;
+ case CPU_ARM_XSCALE1:
+ case CPU_ARM_XSCALE2:
+ event_doc =
+ "See Intel XScale Core Developer's Manual\n"
+ "Chapter 8 Performance Monitoring\n";
+ break;
+ case CPU_ARM_MPCORE:
+ event_doc =
+ "See ARM11 MPCore Processor Technical Reference Manual r1p0\n"
+ "Page 3-70, performance counters\n";
+ break;
+
+ case CPU_ARM_V6:
+ event_doc = "See ARM11 Technical Reference Manual\n";
+ break;
+
+ case CPU_ARM_V7:
+ event_doc =
+ "See ARM11 Technical Reference Manual\n"
+ "Cortex A8 DDI (ARM DDI 0344B, revision r1p1)\n";
+ break;
+
+ case CPU_PPC64_PA6T:
+ event_doc =
+ "See PA6T Power Implementation Features Book IV\n"
+ "Chapter 7 Performance Counters\n";
+ break;
+
+ case CPU_PPC64_POWER4:
+ case CPU_PPC64_POWER5:
+ case CPU_PPC64_POWER6:
+ case CPU_PPC64_POWER5p:
+ case CPU_PPC64_POWER5pp:
+ case CPU_PPC64_970:
+ case CPU_PPC64_970MP:
+ case CPU_PPC64_POWER7:
+ case CPU_PPC64_IBM_COMPAT_V1:
+ event_doc =
+ "Obtain PowerPC64 processor documentation at:\n"
+ "http://www-306.ibm.com/chips/techlib/techlib.nsf/productfamilies/PowerPC\n";
+ break;
+
+ case CPU_PPC64_CELL:
+ event_doc =
+ "Obtain Cell Broadband Engine documentation at:\n"
+ "http://www-306.ibm.com/chips/techlib/techlib.nsf/products/Cell_Broadband_Engine\n";
+ break;
+
+ case CPU_MIPS_20K:
+ event_doc =
+ "See Programming the MIPS64 20Kc Processor Core User's "
+ "manual available from www.mips.com\n";
+ break;
+ case CPU_MIPS_24K:
+ event_doc =
+ "See Programming the MIPS32 24K Core "
+ "available from www.mips.com\n";
+ break;
+ case CPU_MIPS_25K:
+ event_doc =
+ "See Programming the MIPS64 25Kf Processor Core User's "
+ "manual available from www.mips.com\n";
+ break;
+ case CPU_MIPS_34K:
+ event_doc =
+ "See Programming the MIPS32 34K Core Family "
+ "available from www.mips.com\n";
+ break;
+ case CPU_MIPS_5K:
+ event_doc =
+ "See Programming the MIPS64 5K Processor Core Family "
+ "Software User's manual available from www.mips.com\n";
+ break;
+ case CPU_MIPS_R10000:
+ case CPU_MIPS_R12000:
+ event_doc =
+ "See NEC R10000 / R12000 User's Manual\n"
+ "http://www.necelam.com/docs/files/U10278EJ3V0UM00.pdf\n";
+ break;
+ case CPU_MIPS_RM7000:
+ event_doc =
+ "See RM7000 Family User Manual "
+ "available from www.pmc-sierra.com\n";
+ break;
+ case CPU_MIPS_RM9000:
+ event_doc =
+ "See RM9000x2 Family User Manual "
+ "available from www.pmc-sierra.com\n";
+ break;
+ case CPU_MIPS_SB1:
+ case CPU_MIPS_VR5432:
+ event_doc =
+ "See NEC VR5443 User's Manual, Volume 1\n"
+ "http://www.necelam.com/docs/files/1375_V1.pdf\n";
+ break;
+ case CPU_MIPS_VR5500:
+ event_doc =
+ "See NEC R10000 / R12000 User's Manual\n"
+ "http://www.necel.com/nesdis/image/U16677EJ3V0UM00.pdf\n";
+ break;
+
+ case CPU_PPC_E500:
+ case CPU_PPC_E500_2:
+ event_doc =
+ "See PowerPC e500 Core Complex Reference Manual\n"
+ "Chapter 7: Performance Monitor\n"
+ "Downloadable from http://www.freescale.com\n";
+ break;
+
+ case CPU_PPC_E300:
+ event_doc =
+ "See PowerPC e300 Core Reference Manual\n"
+ "Downloadable from http://www.freescale.com\n";
+ break;
+
+ case CPU_PPC_7450:
+ event_doc =
+ "See MPC7450 RISC Microprocessor Family Reference "
+ "Manual\n"
+ "Chapter 11: Performance Monitor\n"
+ "Downloadable from http://www.freescale.com\n";
+ break;
+
+ case CPU_AVR32:
+ event_doc =
+ "See AVR32 Architecture Manual\n"
+ "Chapter 6: Performance Counters\n"
+ "http://www.atmel.com/dyn/resources/prod_documents/doc32000.pdf\n";
+
+ case CPU_RTC:
+ break;
+
+ // don't use default, if someone add a cpu he wants a compiler warning
+ // if he forgets to handle it here.
+ case CPU_TIMER_INT:
+ case CPU_NO_GOOD:
+ case MAX_CPU_TYPE:
+ printf("%d is not a valid processor type.\n", cpu_type);
+ exit(EXIT_FAILURE);
+ }
+
+ sprintf(title, "oprofile: available events for CPU type \"%s\"\n\n", pretty);
+ if (want_xml)
+ open_xml_events(title, event_doc, cpu_type);
+ else
+ printf("%s%s", title, event_doc);
+
+ list_for_each(pos, events) {
+ struct op_event * event = list_entry(pos, struct op_event, event_next);
+ if (want_xml)
+ xml_help_for_event(event);
+ else
+ help_for_event(event);
+ }
+
+ if (want_xml)
+ close_xml_events();
+
+ return EXIT_SUCCESS;
+}