This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Profile mode maintenance patch


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: profile.patch.bz2
Description: application/bzip


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]