77import scorep .helper
88
99
10- def gen_subsystem_lib_name ():
10+ def generate_subsystem_lib_name ():
1111 """
1212 generate the name for the subsystem lib.
1313 """
@@ -16,6 +16,19 @@ def gen_subsystem_lib_name():
1616 return mpi_lib_name
1717
1818
19+ def generate_ld_preload (scorep_config ):
20+ """
21+ This functions generate a string that needs to be passed to $LD_PRELOAD.
22+ After this sting is passed, the tracing needs to be restarted with this $LD_PRELOAD in env.
23+
24+ @return ld_preload string which needs to be passed to LD_PRELOAD
25+ """
26+
27+ (_ , preload , _ ) = scorep .helper .call (
28+ ["scorep-config" ] + scorep_config + ["--user" , "--preload-libs" ])
29+ return preload
30+
31+
1932def generate_subsystem_code (config = []):
2033 """
2134 Generates the data needed to be preloaded.
@@ -62,7 +75,7 @@ def generate(scorep_config, keep_files=False):
6275 with open (temp_dir + "/scorep_init.c" , "w" ) as f :
6376 f .write (scorep_adapter_init )
6477
65- subsystem_lib_name = gen_subsystem_lib_name ()
78+ subsystem_lib_name = generate_subsystem_lib_name ()
6679
6780 cc = distutils .ccompiler .new_compiler ()
6881 compiled_subsystem = cc .compile (
@@ -97,7 +110,7 @@ def init_environment(scorep_config=[], keep_files=False):
97110
98111 subsystem_lib_name , temp_dir = scorep .subsystem .generate (
99112 scorep_config , keep_files )
100- scorep_ld_preload = scorep . helper . generate_ld_preload (scorep_config )
113+ scorep_ld_preload = generate_ld_preload (scorep_config )
101114
102115 scorep .helper .add_to_ld_library_path (temp_dir )
103116
0 commit comments