[profile-stdlib][patch] Stdlib advisory tool implemetation

Lixia Liu liulixia@purdue.edu
Thu Aug 28 11:38:00 GMT 2008


Note: This patch was originally sent on Aug 15th but failed, so send again.

Description:
This patch has implemented an tool to advise programmers to use
standard c++ library efficiently. The patch includes instrumentation
in standard c++ library, profiling runtime library and wrapper of
profile mode. The patch also includes modification in GCC driver to
turn on
tool with option -fprofile-stdlib. Current version contains four
diagnostics: HASHTABLE_TOO_SMALL, HASHTABLE_TOO_LARGE,
VECTOR_TOO_SMALL and VECTOR_TOO_LARGE.

The details can be referred to the design document of profile mode in
manual.
Changelog:
src/gcc/ChangeLog.profile-stdlib
2008-08-15  Lixia Liu  <liulixia@purdue.edu>
   * gcc.c (main): Invoke external script when -fprofile-stdlib-use is
       enabled.
   * c-cppbuiltin.c (c_cpp_builtins): Enable -D_GLIBCXX_PROFILE when
       -fprofile-stdlib is on.
   * cp/g++spec.c (lang_specific_driver): Link profiling runtime library
       "libprofc++.a" when profiling is enabled.
   * opts.c (common_handle_option): Handle profiling options
   * common.opt: Add options for profile-stdlib-use and profile-stdlib
   * ChangLog.profile-stdlib: New file. Change log for directory src/gcc.

src/libstdc++/ChangeLog.profile-stdlib
2008-08-15  Lixia Liu  <liulixia@purdue.edu>
   * configure: Add directory libprofc++ for profiling runtime library.
   * Makefile.in: Add directory libprofc++.
   * Makefile.am: Ditto.
   * acinclude.m4: Ditto.
   * libprofc++/Makefile.in: New makefile.
   * libprofc++/Makefile.am: New makefile.
   * libprofc++/profiler.h: New public header file for runtime library.
   * libprofc++/profiler_trace.h: New file.
   * libprofc++/profiler_state.h: New file.
   * libprofc++/profiler_node.h: New file.
   * libprofc++/profiler_container_size.h: New file.
   * libprofc++/profiler_trace.cc: New file.
   * libprofc++/profiler_state.cc: New file.
   * libprofc++/profiler_node.cc: New file.
   * libprofc++/profiler_container_size.cc: New file.
   * libprofc++/profiler_vector_size.cc: New file.
   * libprofc++/profiler_hashtable_size.cc: New file.
   * src/Makefile.in: Add new library.
   * src/Makefile.am: Add new library.
   * include/Makefile.in: Add new instrumented header files.
   * include/Makefile.am: Add new instrumented header files.
   * include/tr1_impl/hashtable (_Hashtable): Expose insert_return_type.
   * include/std/vector: Include profile/vector guided by _GLIBCXX_PROFILE.
   * include/std/deque: Likewise.
   * include/std/list: Likewise.
   * include/std/map: Likewise.
   * include/std/unordered_map: Likewise.
   * include/std/bitset: Likewise.
   * include/std/set: Likewise.
   * include/std/unordered_set: Likewise.
   * include/profile/base.h: New file.
   * include/profile/set.h: New file for instrumented container set.
   * include/profile/unordered_set: Likewise.
   * include/profile/vector: Likewise.
   * include/profile/deque: Likewise.
   * include/profile/map.h: Likewise.
   * include/profile/multimap.h: Likewise.
   * include/profile/hashtable.h: Likewise.
   * include/bits/c++config: Define profile namespace.
   * include/backward/hash_map: New file for instrumented hash_map
   * include/backward/hash_set: Likewise.
   * testsuite/Makefile.in: Add check-profile.
   * testsuite/Makefile.am: Ditto.
   * testsuite/23_containers/vector/resize/moveable.cc: Aware profile mode.
   * testsuite/31_profile/hash_map.cc: New testcase for profile mode.
   * testsuite/31_profile/vector.cc:  New testcase for profile mode.
   * testsuite/31_profile/unordered.cc: New testcase for profile mode.
   * ChangeLog.profile-stdlib: New changelog for branch profile-stdlib.

Patch: see the attachment.

Test result:
               === libstdc++ Summary ===

# of expected passes            5247
# of unexpected failures        9
# of expected failures          79
# of unsupported tests          335

Is it okay to submit?

Thanks.

Lixia Liu < liulixia@purdue.edu>

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch_profile.txt
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20080828/d05ef420/attachment.txt>


More information about the Libstdc++ mailing list