Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add memory instrumentation support #197

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

vgvassilev
Copy link
Member

Initial implementation of a rootbench memory tracing library.

It implements a C library which records information about the memory allocations. The library is loaded using the LD_PRELOAD mechanism (and DYLD_INSERT_LIBRARIES for osx).

GoogleBenchmark displays the memory allocation results are only in the json format. For instance:

DYLD_FORCE_FLAT_NAMESPACE=1 DYLD_INSERT_LIBRARIES=./lib/Instrumentation/libRBInstrumentation.dylib ./root/interpreter/InterpreterLookupHelperBenchmarks --benchma
    rk_format=json:
    
    ...
    {
          "name": "BM_LookupHelper_Leak",
          "run_name": "BM_LookupHelper_Leak",
          "run_type": "iteration",
          "repetitions": 0,
          "repetition_index": 0,
          "threads": 1,
          "iterations": 1,
          "real_time": 1.3199219449888916e+09,
          "cpu_time": 8.0450300000000000e+08,
          "time_unit": "ns",
          "allocs_per_iter": 6.0000000000000000e+00,
          "max_bytes_used": 3368
    }

@vgvassilev vgvassilev force-pushed the add_memory_instrumentation_support branch 2 times, most recently from 5205fa0 to dae8452 Compare October 12, 2020 10:59
@vgvassilev
Copy link
Member Author

ping

@oshadura
Copy link
Collaborator

oshadura commented Dec 3, 2020

@vgvassilev sorry! I am here finally, can I ask you to rebase please?

@vgvassilev vgvassilev force-pushed the add_memory_instrumentation_support branch from dae8452 to 7f49792 Compare December 3, 2020 15:46
@oshadura
Copy link
Collaborator

oshadura commented Dec 3, 2020

@vgvassilev if you will rebase on master again, GH Actions with root-nightlies from conda will be retriggered 👍

@vgvassilev vgvassilev force-pushed the add_memory_instrumentation_support branch from 7f49792 to f21c2b5 Compare December 3, 2020 18:58
@vgvassilev
Copy link
Member Author

Done

@vgvassilev vgvassilev force-pushed the add_memory_instrumentation_support branch from f21c2b5 to baf7db3 Compare December 4, 2020 11:29
@oshadura
Copy link
Collaborator

oshadura commented Dec 4, 2020

 [ 18%] Building CXX object lib/Support/CMakeFiles/RBSupport.dir/MemoryManager.cxx.o
In file included from /home/runner/work/rootbench/rootbench/lib/Support/MemoryManager.cxx:12:0:
/home/runner/work/rootbench/rootbench/include/rootbench/RBConfig.h:40:3: error: #error Unsupported Platform;
 # error Unsupported Platform;
   ^~~~~
lib/Support/CMakeFiles/RBSupport.dir/build.make:94: recipe for target 'lib/Support/CMakeFiles/RBSupport.dir/MemoryManager.cxx.o' failed
CMakeFiles/Makefile2:1474: recipe for target 'lib/Support/CMakeFiles/RBSupport.dir/all' failed
Makefile:113: recipe for target 'all' failed
``` (I could check a bit later in case you are busy..)

@vgvassilev vgvassilev force-pushed the add_memory_instrumentation_support branch from baf7db3 to 03f6ef1 Compare December 4, 2020 11:51
It implements a C library which records information about the memory allocations.
The library is loaded using the LD_PRELOAD mechanism (and DYLD_INSERT_LIBRARIES
for osx).

GoogleBenchmark displays the memory allocation results are only in the json
format. For instance:

DYLD_FORCE_FLAT_NAMESPACE=1 DYLD_INSERT_LIBRARIES=./lib/Instrumentation/libRBInstrumentation.dylib ./root/interpreter/InterpreterLookupHelperBenchmarks --benchma
rk_format=json:

...
{
      "name": "BM_LookupHelper_Leak",
      "run_name": "BM_LookupHelper_Leak",
      "run_type": "iteration",
      "repetitions": 0,
      "repetition_index": 0,
      "threads": 1,
      "iterations": 1,
      "real_time": 1.3199219449888916e+09,
      "cpu_time": 8.0450300000000000e+08,
      "time_unit": "ns",
      "allocs_per_iter": 6.0000000000000000e+00,
      "max_bytes_used": 3368
}
@vgvassilev vgvassilev force-pushed the add_memory_instrumentation_support branch from 03f6ef1 to 7e06ec2 Compare December 4, 2020 12:38
@oshadura
Copy link
Collaborator

oshadura commented Jan 5, 2021

@vgvassilev I check CI logs and I see segfault :(

3: 
3:  *** Break *** segmentation violation
3:  Generating stack trace...
 3/21 Test  #3: rootbench-InterpreterLookupHelperBenchmarks ...***Failed    1.01 sec

If you will have time can you rebase please here?

@vgvassilev
Copy link
Member Author

I can reproduce the failure. I do not know what's going on and I will have to fix it before landing it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants