PATCH: libstdc++/include/profile bug fixes and cleanup
Silvius Rus
rus@google.com
Thu Jan 7 23:06:00 GMT 2010
All of the changes are either serious bug fixes, cleanup requested by
maintainers or minor features agreed previously by maintainers.
This is the last round of changes for the profile mode for 4.5.
Some of the changes were already reviewed in
http://gcc.gnu.org/ml/libstdc++/2009-12/msg00015.html.
1. Fix bug: Initialization would possibly run more than once on
multithreaded programs due to missing fence.
Fix by using compare_and_swap to set the state.
2. Fix bug: Reentrance guard mechanism was broken since
http://gcc.gnu.org/ml/gcc-patches/2009-11/msg00890.html.
Fix guard logic.
3. Fix bug: Compile time disabling of individual diagnostics was broken.
After this patch, to enable all diagnostics except "vector to list":
g++ -D_GLIBCXX_PROFILE -D_GLIBCXX_PROFILE_NO_VECTOR_TO_LIST
4. Cleanup: Drop support for hash_map and hash_set.
Requested by library maintainer Paolo Carlini.
http://gcc.gnu.org/ml/libstdc++/2010-01/msg00026.html
5. Cleanup: Get rid of templates used only for inline linkage.
Requested by library maintainer Benjamin Kosnik.
http://gcc.gnu.org/ml/libstdc++/2009-12/msg00015.html
Replaced with inline functions containing static members.
See new macros _GLIBCXX_PROFILE_DEFINE_DATA
and _GLIBCXX_PROFILE_DATA.
6. Minor feature: Add support for setting decision weights in config file.
Reviewed by maintainer Benjamin Kosnik.
http://gcc.gnu.org/ml/libstdc++/2009-12/msg00015.html
7. Minor features: Add two simple diagnostics.
list_to_vector and list_to_slist were added. list_to_set was dropped
from previous patch.
Reviewed by maintainer Benjamin Kosnik.
http://gcc.gnu.org/ml/libstdc++/2009-12/msg00015.html
8. Update docs.
Requested by maintener Benjamin Kosnik.
http://gcc.gnu.org/ml/libstdc++/2009-12/msg00015.html
Tested:
x86_64/linux make check-profile
There were 14 FAILs. I will make them pass or ask for specific help
before submitting.
Questions to maintainers:
1. Currently, multithreaded execution of the profile mode requires
TLS. Is this a reasonable way to test TLS support?
#if (defined _GLIBCXX_PROFILE_THREADS) && !(defined HAVE_TLS)
#error profile mode requires either -DHAVE_TLS or -D_GLIBCXX_PROFILE_NO_THREADS
2. I am testing for execinfo.h with #ifdef HAVE_EXECINFO_H.
What is the right way to make sure this gets set in a config file?
Thank you,
Silvius
-------------- next part --------------
2010-01-07 Silvius Rus <rus@google.com>
* doc/xml/manual/profile_mode.xml: Add list_to_slist manual.
Also, correct user interface mistakes.
* include/Makefile.in: Add references to new include files.
* include/Makefile.am: Add references to new include files.
* include/backward/hash_map: Remove profile include.
* include/backward/hash_set: Remove profile include.
* include/profile/hashtable.h: Delete file.
* include/profile/iterator_tracker.h: New file.
* include/profile/vector: Add instrumentation for tracked iterator.
* include/profile/list: Same.
* include/profile/impl/profiler_list_to_slist.h: New file.
* include/profile/impl/profiler_list_to_vector.h: Same.
* include/profile/impl/profiler.h: Add list_to_slist and
list_to_vector instrumentation hook interfaces. Fixed broken
diagnostic disabling mechanism.
(_GLIBCXX_PROFILE_DEFINE_DATA,_GLIBCXX_PROFILE_DATA) New macros.
(__reentrance_guard) Fix bug.
* include/profile/impl/profiler_trace.h: Replace dummy templates
with _GLIBCXX_PROFILE_DEFINE_DATA.
* include/profile/impl/profiler_container_size.h: Same.
* include/profile/impl/profiler_vector_size.h: Same.
* include/profile/impl/profiler_hash_func.h: Same.
* include/profile/impl/profiler_vector_to_list.h: Same.
* include/profile/impl/profiler_map_to_unordered_map.h: Same.
* include/profile/impl/profiler_hashtable_size.h: Same.
* include/profile/impl/profiler_node.h: Same.
* include/profile/impl/profiler_state.h: Same. Also, remove
class __state. Also, use __sync_val_compare_and_swap to set state.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rus-profile-20100107.patch
Type: text/x-patch
Size: 206314 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20100107/8a443ea2/attachment.bin>
More information about the Libstdc++
mailing list