François Dumont
2014-09-21 21:29:21 UTC
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
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