summaryrefslogtreecommitdiffstats
path: root/translate.h
Commit message (Collapse)AuthorAgeFilesLines
* PR10524: reduce massive-uprobe script modules' .data consumptionFrank Ch. Eigler2009-09-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The general approach is to rip out task_finder_tgt's from all over the place (including the unwindsym vmcbs, and the stap_uprobe_specs), and instead have a small handful of them: one for all unwindsyms, and one per abstract probed process (PID or NAME). These are in turn shared by all new stap_unwind_specs by index. Before: probe process("./stap").function("*") -rw-r--r--. 1 fche users 11775283 2009-09-08 20:26 /var/tmp/fche/systemtap/cache/96/stap_96c0479d674db55ec98d8a8750a790e7_7989596.ko text data bss dec hex filename 445158 8351944 4306472 13103574 c7f1d6 /var/tmp/fche/systemtap/cache/96/stap_96c0479d674db55ec98d8a8750a790e7_7989596.ko After: (Note how data shrank, though text gained a bit in const-init-data.) -rw-r--r--. 1 fche users 4021569 2009-09-08 20:27 /var/tmp/fche/systemtap/cache/e4/stap_e46e88634efd850b1586e81c231c239a_8058419.ko text data bss dec hex filename 1896511 2192 4324808 6223511 5ef697 /var/tmp/fche/systemtap/cache/e4/stap_e46e88634efd850b1586e81c231c239a_8058419.ko * tapsets.cxx (uprobe_derived_probe_group): Rewrite emit_module_decls, and adjust emit_module_init. * runtime/sym.c (_stp_sym_init): Initialize unwindsyms-shared vmcb. * runtime/sym.h (_stp_module): Remove *vmcb field. * translate.cxx (emit_module_init, dump_unwindsyms): Adapt. * translate.h (assert_0_indent): Flush output before possibly assert-failing.
* Only sign modules if --unprivileged is specified.Dave Brolley2009-06-111-3/+0
| | | | | | Don't generate an error message for unsigned modules. Make sure module signature exists before attempting to copy to the cache. Allow timer p[robes for unprivileged users.
* 2009-04-06 Dave Brolley <brolley@redhat.com>Dave Brolley2009-04-061-1/+4
| | | | | | | | * translate.cxx (emint_unprivileged_user_check): New method of c_unparser. (c_unparser::emit_module_init): If --unprivileged has been specified, generate code to call systemtap_unprivileged_user_check. (translate_pass): Call emit_unprivileged_user_check. * translate.h (emint_unprivileged_user_check): New method of c_unparser.
* Add Vim modelines for GNU style in stapJosh Stone2009-01-281-0/+2
|
* c code generation: assert C indentation/nesting cancels out at appropriate ↵Frank Ch. Eigler2008-08-021-0/+1
| | | | points
* PR 3635: reduce number of global objectsfche2007-10-021-2/+6
| | | | | | | | | 2007-10-02 Frank Ch. Eigler <fche@redhat.com> PR 3635 * translate.cxx (emit_global): Wrap all globals and locks into one top-level struct. Update references to former "global_VAR" prefix. * translate.h (emit_global_init): New function.
* 2007-04-25 David Smith <dsmith@redhat.com>dsmith2007-04-251-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR 2339 * translate.cxx: Renamed "qname" to "value" throughout, since there are times now when qname would refer to a constant value. (tmpvar::override): Added function to allow for overriding a temporary variable name with a string. (tmpvar::value): New function that returns either the overridden string or the temporary variable name. (c_unparser::c_expression): New function. (c_unparser_assignment::c_assignop): Speed up assignment when numeric or string constants are used. (c_tmpcounter::visit_block): Avoid empty structs inside the union of temporary variables. (c_tmpcounter_assignment::prepare_rvalue): New function. (c_tmpcounter_assignment::c_assignop): New function. (c_tmpcounter_assignment::visit_symbol): Update temporary declarations. (c_unparser_assignment::prepare_rvalue): Speed up use of rvalues by using numeric and string constants directly instead of copying them to temporaries first. (c_tmpcounter::load_map_indices): New function. (c_unparser::load_map_indices): Speed up use of numeric and string constants as map indices. (c_tmpcounter::visit_arrayindex): Updated temporary declarations. (c_tmpcounter_assignment::visit_arrayindex): Updated temporary declarations. * translate.h (class translator_output): Added tellp() and seekp() functions.
* 2007-03-21 David Smith <dsmith@redhat.com>dsmith2007-03-211-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | PR 4146 * tapsets.cxx (common_probe_entryfn_prologue): Added 'interruptible' parameter. If a probe is interruptible, interrupts are not disabled while the probe executes. Preemption is disabled however. Interruptible parameter defaults to false. (common_probe_entryfn_epilogue): Ditto. (be_derived_probe_group::emit_module_decl): Uses new 'interruptible' parameter to mark begin/end probes as interruptible. (probe_derived_probe_group::emit_module): Initialize 'actionremaining' with MAXACTION instead of initializing 'actioncount' with 0. * translate.cxx (emit_common_header): Renamed 'actioncount' to 'actionremaining'. Turned logic around to initialize actionremaining to MAXACTION or MAXACTION_INTERRUPTIBLE then decrement it as actions occur. (translate_pass): Added MAXACTION_INTERRUPTIBLE initialization. * translate.h: Removed outdated comment portion. * stap.1.in: Documented MAXACTION_INTERRUPTIBLE. * NEWS: Added note about begin/end probes being run with interrupts enabled.
* 2006-05-18 Frank Ch. Eigler <fche@elastic.org>fche2006-05-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Organize "-t" output by script/parse level probes rather than derived-probes. * elaborate.cxx (derived_probe ctor): Remove name field setting. (alias_derived_probe): New class. (alias_expandion_builder::build): Create an instance of the above instead of parse-tree-level plain probe. * elaborate.h: Corresponding changes. (derived_probe::basest): Define. * staptree.cxx (probe ctor): Set new name field. * staptree.h (probe): Corresponding changes. (probe::basest): New field. * tapsets.cxx (emit_probe_prologue, emit_probe_entries): Switch to basest() probe name for Stat instance. (dwarf_derived_probe ctor): Stash away base probe. * translate.cxx (unparser::emit_probe): Remove index operand, just use probe name to generate symbols. (emit_module_init): Reorganize -t output in unregister functions. (translate_pass): Remove unparser::current_probenum field and all uses. * translate.h: Corresponding changes.
* 2006-02-25 Frank Ch. Eigler <fche@elastic.org>fche2006-02-251-0/+3
| | | | | | | * translate.cxx (var::init): Don't crush string module_params. (emit_global_param): New function, forked out of emit_global, to put module_param calls at the bottom of C file. * translate.h: Corresponding changes.
* 2006-01-10 Frank Ch. Eigler <fche@redhat.com>fche2006-01-101-1/+2
| | | | | | | | | | | | | PR 2060. * buildrun.cxx (compile_pass): Add "V=1" to kbuild if verbose. * translate.cxx (translator_output): For output-file constructor, set an explicit output buffer. (emit_module_init, emit_module_exit): Reorganize output, to spit each individual probe registration/deregistration blurb into a separate function. * translate.h: Corresponding changes; set default buffer size to 8K. * translate.cxx, tapsets.cxx: Replace "endl" by buffer-friendly "\n" throughout code generation routines.
* 2005-08-24 Frank Ch. Eigler <fche@elastic.org>fche2005-08-241-1/+1
| | | | | * translate.cxx (emit_global, emit_module_init): Use 2.6.9-compatible rwlock initialization.
* 2005-07-26 Frank Ch. Eigler <fche@redhat.com>fche2005-07-261-1/+1
| | | | | | | | | | | | | | | | | | | | | Support %{ embedded-c %} * staptree.h (embeddedcode): New statement subtype. Stub support in visitors. * staptree.cxx: Ditto. * parse.cxx: Parse %{ / %}. Accept "_" as identifier leading char. (parse_probe): Simplify calling convention. * elaborate.h: Store embedded code. * elaborate.cxx: Pass it. * translate.cxx: Transcribe it. Return some dropped module init/exit code. * Makefile.am: Add buildok/buildko tests. * Makefile.in: Regenerated. * main.cxx: Return EXIT_SUCCESS/FAILURE even for weird rc. * testsuite/parseok/nine.stp: Test _identifiers. * testsuite/transko/*.stp: Tweak to force -p3 rather than -p2 errors. * testsuite/semok/transko.stp: ... and keep it that way in the future. * testsuite/parse*/*: Some new tests for %{ %}. * testsuite/build*/*: New tests for -p4.
* 2005-06-02 Frank Ch. Eigler <fche@redhat.com>fche2005-06-021-3/+6
| | | | | | | | | | | | | | | | Parse foreach construct. Added fuller copyright notices throughout. * staptree.h (foreach_loop): New tree node type. * staptree.cxx: Print it, visit it, love it, leave it. * parse.cxx: Parse it. (parse_stmt_block): Don't require ";" separators between statements. (parse_array_in): Use [] as index group operator instead of (). * elaborate.cxx (visit_foreach_loop): New code. * translate.cxx: Slightly tighten errorcount/actioncount handling. * main.cxx: Accept "-" as script file name standing for stdin. (visit_arrayindex): Switch to simpler set_arity call. * configure.ac: Generate DATE macro. * Makefile.in, configure, config.in: Regenerated. * testsuite/*: New/updated tests for syntax changes, foreach ().
* * at long last, a more full-bodied snapshotfche2005-05-211-0/+93
2005-05-20 Frank Ch. Eigler <fche@redhat.com> Many changes throughout. Partial sketch of translation output. * elaborate.*: Elaboration pass. * translate.*: Translation pass. * staptree.*: Simplified for visitor concept. * main.cxx: Translator mainline. * *test.cxx: Removed. * testsuite/*: Some new tests, some changed for newer syntax.