public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "François Dumont" <frs.dumont@gmail.com>
To: "libstdc++@gcc.gnu.org" <libstdc++@gcc.gnu.org>,
	 gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Profile mode maintenance patch
Date: Sun, 21 Sep 2014 21:29:00 -0000	[thread overview]
Message-ID: <541F4331.1070701@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1931 bytes --]

Hi

     Here is the promise major patch for the profile mode. Here are the 
most important modifications.

     Now instance of profiling structs are kept as pointers in the 
containers themselves. It has an impact on the container ABI but it 
greatly enhance performances as we do not need to move through a search 
in an unordered container which also imply a lock during this research. 
I have even been able to remove those unordered containers eventually 
just keeping a counter of allocated bytes to know if we should stop 
creating new profiling structs.

     I get rid of the re-entrancy mechanism. The only reason for it was 
a potential hook in the memory allocator potentially creating new 
profiling structs and so long forever. I prefer to put it just where it 
is necessary that is to say when we first allocate memory for profiling 
which is then we create the back-trace.

     I wonder if we shouldn't emit a #error when trying to activate 
profiling mode without backtrace feature cause in this case we simply 
won't collect anything.

     I finalize ordered to unordered profiling by adding the missing 
__iterator_tracker on the ordered containers (map, multimap, set, multiset).

     I clean all useless stuff like __stack_info_base class.

     I fixed many memory leak and added a cleanup at exit of the 
application.

     Profiling of containers is reseted as soon as one of the following 
operations occur: copy assignment, move assignment, initialization from 
an initialization list, clear.

     I have added usage of atomic operations to maintain some counters 
that might be updated from different threads. Do not hesitate to review 
those closely. Especially __objects_byte_size which I am using in 
profiler_trace.h without atomic operation, is it fine ?

     With all those modifications I have been able to run all testsuite 
in profile mode with success.

     Ok to commit ?

François


[-- Attachment #2: profile.patch.bz2 --]
[-- Type: application/x-bzip, Size: 15946 bytes --]

             reply	other threads:[~2014-09-21 21:29 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-21 21:29 François Dumont [this message]
2014-09-23 11:27 ` Jonathan Wakely
2014-09-23 21:20   ` François Dumont
2014-09-23 22:45     ` Jonathan Wakely
2014-10-04 20:54   ` François Dumont
2014-10-06  9:28     ` Jonathan Wakely
  -- strict thread matches above, loose matches on Subject: below --
2014-05-12 20:15 profile " François Dumont
2014-05-12 20:44 ` Paolo Carlini
2014-05-12 20:50   ` François Dumont
2014-05-24 11:33 ` Jonathan Wakely
2014-05-24 21:10   ` François Dumont
2014-05-24 21:39     ` Jonathan Wakely
2014-05-25  8:34       ` Paolo Carlini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=541F4331.1070701@gmail.com \
    --to=frs.dumont@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).