diff options
author | kenistoj <kenistoj> | 2007-10-08 21:52:12 +0000 |
---|---|---|
committer | kenistoj <kenistoj> | 2007-10-08 21:52:12 +0000 |
commit | 6274464ec4e095cd42238d0b4b5dc1d45bf100da (patch) | |
tree | e640a94f014c692f57e95ce087e87e1b2b301779 /main.cxx | |
parent | a9e8f7e0533811be2cd7c9a88d9058da8caa1d11 (diff) | |
download | systemtap-steved-6274464ec4e095cd42238d0b4b5dc1d45bf100da.tar.gz systemtap-steved-6274464ec4e095cd42238d0b4b5dc1d45bf100da.tar.xz systemtap-steved-6274464ec4e095cd42238d0b4b5dc1d45bf100da.zip |
PR 5709
* main.cxx: Add pass 4.5: make uprobes.ko in runtime/uprobes
* buildrun.cxx: Add uprobes_enabled() and make_uprobes().
Factor run_make_cmd() out of compile_pass().
* buildrun.h: Add uprobes_enabled and make_uprobes decls.
* tapsets.cxx: Do correct #include for modprobed uprobes.ko;
set need_uprobes in pass 2.
* session.h: Add need_uprobes
* runtime/staprun/common.c: Add -u option -> need_uprobes
* runtime/staprun/staprun_funcs.c: Generalize insert_module()
to support inserting uprobes.ko.
* runtime/staprun/staprun.c: Add enable_uprobes(). insert_module
call becomes insert_stap_module().
* runtime/staprun/staprun.h: Reflect insert_module() and
need_uprobes changes
* runtime/uprobes/*.[c,h]: uprobes is built as a module,
rather than included into the source of the stap-generated
module.
* runtime/uprobes/Makefile: Added
Diffstat (limited to 'main.cxx')
-rw-r--r-- | main.cxx | 26 |
1 files changed, 20 insertions, 6 deletions
@@ -225,6 +225,7 @@ main (int argc, char * const argv []) s.symtab = false; s.use_cache = true; s.tapset_compile_coverage = false; + s.need_uprobes = false; const char* s_p = getenv ("SYSTEMTAP_TAPSET"); if (s_p != NULL) @@ -728,12 +729,13 @@ main (int argc, char * const argv []) // See if we can use cached source/module. if (get_from_cache(s)) { - // If our last pass isn't 5, we're done (since passes 3 and - // 4 just generate what we just pulled out of the cache). - if (s.last_pass < 5) goto cleanup; + // If our last pass isn't 5, and we don't need to build + // uprobes, we're done (since passes 3 and 4 just generate + // what we just pulled out of the cache). + if (s.last_pass < 4) goto cleanup; - // Short-circuit to pass 5. - goto pass_5; + // Short-circuit to pass 4.5. + goto pass_4point5; } } @@ -810,8 +812,20 @@ main (int argc, char * const argv []) } } - if (rc || s.last_pass == 4) goto cleanup; + if (rc) goto cleanup; + // PASS 4.5: BUILD SYSTEMTAP'S VERSION OF UPROBES (IF NECESSARY) +pass_4point5: + if (s.need_uprobes) + { + if (s.last_pass == 5 && uprobes_enabled()) + // Uprobes symbols are currently available in the kernel, + // so staprun won't use what we'd build anyway. + goto pass_5; + + (void) make_uprobes(s); + } + if (s.last_pass == 4) goto cleanup; // PASS 5: RUN pass_5: |