summaryrefslogtreecommitdiffstats
path: root/translate.cxx
Commit message (Collapse)AuthorAgeFilesLines
* fix a bug with %% in format stringsTim Moore2009-04-201-1/+2
| | | | | | | | | | | * translate.cxx (c_unparser::visit_print_format): Always use _stp_printf if a format string contains "%%". Previously a format string with no arguments would always be printed with _stp_print. * testsuite/systemtap.printf/basic6.stp: New test for %% in format strings. * testsuite/systemtap.printf/basic6.exp: test driver * testsuite/systemtap.examples/grapher.stp: Remove workaround for "%%" literal problem.
* Micro-optimization: no-modules translate pass 3 case.Mark Wielaard2009-04-191-8/+22
| | | | | | | | Saves 250ms in the unlikely case there are no modules needed. * translate.cxx (emit_symbol_data_done): New function. (emit_symbol_data): Call emit_symbol_data_done immediately when no module data is needed.
* Keep track of relocation section sizes.Mark Wielaard2009-04-141-15/+43
| | | | | | | | * runtime/sym.h (_stp_section): Add size field. * translate.cxx (dump_unwindsyms): Get start of module address space, turn seclist into vector of secname, size pairs, track relocation section size, or add module address range if no sections, output size in _stp_section list.
* Cleanup symbol table sanity checking.Mark Wielaard2009-04-091-16/+29
| | | | | | * translate.cxx (dump_unwindsyms): Get and check against module end, only check STT_FUNC && SHN_ABS for kernel, check shndxp for non-allocated section.
* Omit symbols that have suspicious addresses (before base) from symbol table.Mark Wielaard2009-04-081-2/+5
| | | | * translate.cxx (dump_unwindsyms): Filter out sym.st_value < base values.
* PR10026: Read marker/tracepoint args directlyJosh Stone2009-04-061-1/+6
| | | | | | | | | | We already stash the context variables for markers and tracepoints into the locals for the probe body, but then we were using separate functions to read those locals for each particular probe body. This patch instead teaches the unparser how to emit the local name directly for those context variables. The resulting code from the translator is much simpler now.
* Reorder includes so regs.c and regs-ia64.c included before task_finder.c.William Cohen2009-04-021-2/+0
|
* PR10019: --skip-badvars to suppress run-time memory errors tooFrank Ch. Eigler2009-04-011-0/+2
| | | | | | | | * NEWS: Note this change. * hash.cxx (find_script_hash): Add s.skip_badvars into hash. * translate.cxx (translate_pass): Emit STP_SKIP_BADVARS. * runtime/loc2c-runtime.h (DEREF_FAULT, STORE_DEREF_FAULT): Provide dummy implementation if STP_SKIP_BADVARS.
* PR10000: emit _stp_relocate* calculations correctly for kernel/module global ↵Frank Ch. Eigler2009-03-271-3/+4
| | | | | | | | | | | | | | | | $data * translate.cxx (dump_unwindsyms): Also emit STT_OBJECT symbols, therefore .data etc. sections into stap-symbols.h. * tapsets.cxx (iterate_over_modules): Omit a dwfl_getmodules() RC-checking assertion that blocked meaningful $context var error messages. (dwflpp::emit_address): Bypass dwfl_module_relocate_address() for kernel symbols as it has been unreliable; subtract sess.sym_stext manually. * testsuite/buildok/seventeen.stp: Extend test with module $global.
* brown paper bag fix for commit 5d6b0142Frank Ch. Eigler2009-03-241-2/+2
| | | | return != break
* further accelerate pass-3 symbol/unwind process, skip one more iterationFrank Ch. Eigler2009-03-241-2/+4
|
* accelerate pass-3 symbol/unwind generationFrank Ch. Eigler2009-03-241-2/+2
| | | | | * translate.cxx (emit_symbol_data): Abort dwfl_getmodules loop as soon as we run out of modules we're looking for.
* fix build regression w/o -tFrank Ch. Eigler2009-03-201-2/+0
| | | | * translate.cxx (emit_common_header): Always emit atomic_t skipped_* counters.
* PR9967: don't count -DINTERRUPTIBLE=1 reentrancy against MAXSKIPPEDFrank Ch. Eigler2009-03-201-2/+3
| | | | | | | * tapsets.cxx (common_probe_entryfn_prologue): Become conditional on !INTERRUPTIBLE. * translate.cxx (emit_module_exit): Still print skipped_count_reentrant with -t, even if skipped_count was zero.
* Get the canonical path of the main file for comparison at runtime.Mark Wielaard2009-03-171-0/+9
| | | | | | | | | When given directly by the user through -d or in case of the kernel name and path might differ. path should be used for matching. * runtime/sym.h (_stp_module): Add path field. * runtime/task_finder.c (__stp_tf_vm_cb): Use module path to compare vm_path. * translate.cxx (dump_unwindsyms): Output canonical path.
* Add workaround for dwfl_module_build_id bug with elfutils < 0.140.Mark Wielaard2009-03-161-7/+25
| | | | | * translate.cxx (dump_unwindsyms): Check elfutils version and whether build_id_vaddr < base, and if so add main_bias to address.
* Let -DINTERRUPTIBLE=0 mask interrupts in probesJosh Stone2009-03-091-0/+3
| | | | | | | | | | | | | | | Some time ago we loosened up the code for all probe types to allow interrupts during the handler. However, when probing something like kernel.trace("*"), you get a mix of probes in and out of the interrupt path, and it becomes much more common to have probes skipped due to interrupt reentrancy. The common_probe_entryfn_prologue and common_probe_entryfn_epilogue functions had an interruptible flag, but this was no longer used anywhere. I removed this flag, but then reused the logic to check an INTERRUPTIBLE macro instead. Now users can use -DINTERRUPTIBLE=0 to prevent interrupt reentrancy in their script, at the cost of a bit more overhead to toggle the interrupt mask.
* Check pending_interrupts more frequently during unwindsyms (pass 3) processingFrank Ch. Eigler2009-03-081-0/+3
|
* Tweak tracepoint logic to run on tracepoint_synchronize_unregister()-less RHEL5Frank Ch. Eigler2009-03-071-0/+5
|
* PR9919: Set last_stmt for array (scalar or statistical) assignments.Mark Wielaard2009-03-041-2/+2
| | | | * translate.cxx (visit_arrayindex): Update last_stmt.
* Skip generating empty struct globalWenji Huang2009-02-241-15/+17
| | | | | | | | Impact: trivial cleanup. Avoid emitting empty struct global code that is harmless. Signed-off-by: Wenji Huang <wenji.huang@oracle.com>
* Adjust extra_offset address against module base.Mark Wielaard2009-02-241-0/+4
| | | | | * translate.cxx (dump_unwindsyms): Adjust extra_offset always against module base as workaround for buggy elfutils < 0.138.
* Made probe_start()/probe_exit() function definitions match their declarations.David Smith2009-02-231-2/+2
| | | | | | | 2009-02-23 David Smith <dsmith@redhat.com> * translate.cxx (translate_pass): Made probe_start()/probe_exit() function definitions match their declarations.
* Adjust ET_DYN symbol addresses against module base.Mark Wielaard2009-02-211-1/+10
| | | | | * translate.cxx (dump_unwindsyms): Adjust sym_addr for ET_DYN always against module base as workaround for buggy elfutils < 0.138.
* Ignore kernel functions with "absolute" addresses.Mark Wielaard2009-02-201-7/+6
| | | | | | | translate.cxx (dump_unwindsyms): Augment the test for creating the stap-symbols to be STT_FUNC && !(SHN_UNDEF || SHN_ABS). The combination STT_FUNC && SHN_ABS only seems to occur on older i386 kernels and covers the vDSO "functions" we were seeing.
* Ignore symbols before module base address.Mark Wielaard2009-02-191-0/+6
|
* Enable typecasting with @castJosh Stone2009-02-181-1/+9
|\ | | | | | | | | | | | | println(@cast(myptr, "task_struct")->pid) println(@cast(myptr, "task_struct", "kernel")->pid) Merge branch 'typecast', bump ChangeLog entries to push date
| * Bump copyright years to 2009Josh Stone2009-02-181-1/+1
| |
| * Add high-level support for @cast()ingJosh Stone2009-02-181-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This handles all of the parsing, traversal, and optimization. It doesn't actually resolve the cast yet though. * staptree.h (struct cast_op, visitor::visit_cast_op): New. * staptree.cxx (cast_op::print/visit, various visitor::visit_cast_op's): Incorporate cast_op into the basic tree operations. * parse.cxx (parser::parse_symbol): Parse @cast operator with an expression operand, type string, and optional module string. * translate.cxx (c_unparser::visit_cast_op): Error out if a @cast survives to translation. * elaborate.cxx (typeresolution_info::visit_cast_op): Error out if a @cast survives to type resolution. (symbol_fetcher::visit_cast_op): treat @casts as a symbol target (void_statement_reducer::visit_cast_op): unused @casts can be discarded, but the operand should still be evaluated.
* | convert remaining translator-output code from <<endl to \nFrank Ch. Eigler2009-02-131-60/+60
| |
* | Use "\n" instead of endl in inner loops.Mark Wielaard2009-02-121-2/+2
|/
* PR9810: Mostly revert "PR6961: initial sketch: set up dummy pt_regs for ↵Frank Ch. Eigler2009-02-031-1/+0
| | | | non-trap based probes"
* Process extra_offset for kernel symbols with dwfl_module_relocate_address.Mark Wielaard2009-02-011-0/+4
|
* Add Vim modelines for GNU style in stapJosh Stone2009-01-281-0/+2
|
* Use 'static' as much as possibleJosh Stone2009-01-281-18/+18
| | | | | | | | | | This change just inserts 'static' on runtime, tapset, and generated C functions and globals, so the compiler can do a better job of optimizing. My tests with small scripts show ~10% reduction in compile time and ~20% reduction in module size. Larger scripts may show less benefit, but I expect purely positive results.
* build: make compatible with elfutils 0.138 tooFrank Ch. Eigler2008-12-311-2/+12
|
* First attempt at printf kernel memory hex dumpElliott Baron2008-12-191-2/+4
|
* PR6961: initial sketch: set up dummy pt_regs for non-trap based probesFrank Ch. Eigler2008-12-091-0/+1
|
* Merge branch 'master' of ssh://sources.redhat.com/git/systemtapFrank Ch. Eigler2008-12-051-2/+2
|\ | | | | | | | | * 'master' of ssh://sources.redhat.com/git/systemtap: PR7051: Remove broken printf %n directive support
| * PR7051: Remove broken printf %n directive supportroot2008-12-051-2/+2
| |
* | turn on elfutils-level debuginfo<->stripped-binary checksum matchingFrank Ch. Eigler2008-12-051-1/+1
|/ | | | | | This is necessary to detect mismatching debuginfo for user-space programs without build-id. We don't have run-time version assertions for user-space binaries.
* PR5892: rename new -B /PATH to -r /PATH; merge functionalityFrank Ch. Eigler2008-12-031-12/+23
|
* BZ 5892: Add stap -B to sic systemtap at an alternate kernel build treeRajan Arora2008-12-011-3/+5
|
* PR 6965: tweak symbol/unwind control macros to STP_NEED_{UNWIND,SYMBOL}_DATAFrank Ch. Eigler2008-11-281-6/+6
|
* PR6965 - Conditionally compile symbol table. Split context.stp into 3 files.Elliott Baron2008-11-281-2/+8
|
* safety: add another schedule_sched, ahead of the per-context release loopFrank Ch. Eigler2008-11-261-1/+6
|
* PR4886: enable assertive build-id checking for new kernelsFrank Ch. Eigler2008-11-261-1/+1
|
* safety: add paranoid call to synchronize_sched() during shutdown processFrank Ch. Eigler2008-11-261-0/+6
|
* PR5689 part 3/3: print kprobe/uprobe skipped statsFrank Ch. Eigler2008-11-221-0/+6
|
* PR5689 part 2: separate skip counters for low-stack and reentrancy casesFrank Ch. Eigler2008-11-211-8/+13
|