summaryrefslogtreecommitdiffstats
path: root/translate.cxx
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge branch 'master' into unwindFrank Ch. Eigler2008-03-311-0/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | * master: Revert "Just a test commit" Just a test commit bump autoconf* version numbers to 0.7 replace mentions of CVS with GIT in docuemntation files 2008-03-27 Frank Ch. Eigler <fche@elastic.org> 2008-03-27 Frank Ch. Eigler <fche@elastic.org> 2008-03-26 Frank Ch. Eigler <fche@elastic.org> Revert "dummy commit" dummy commit
| * 2008-03-26 Frank Ch. Eigler <fche@elastic.org>fche2008-03-261-0/+3
| | | | | | | | | | * translate.cxx (emit_function): Set context last_stmt, in case an error occurs during the function.
* | rebased unwind_branch on top of current masterFrank Ch. Eigler2008-03-251-66/+29
|/
* 2008-03-10 Dave Brolley <brolley@redhat.com>brolley2008-03-101-2/+73
| | | | | | | | | | | | | | PR5189 * translate.cxx (probe_or_function_needs_deref_fault_handler): New member of c_unparser. (c_unparser::emit_function): Initialize probe_or_function_needs_deref_fault_handler. Check it after the body is visited and generate a deref fault handler if necessary. (c_unparser::emit_probe): Likewise. (c_unparser::visit_print_format): Correct the compoenent type for an overridden string literal. Generate code to check that pointer arguments to %m can be dereferenced. Generate casts for printf arguments as necessary. * elaborate.cxx (typeresolution_info::visit_print_format): Desired type for conv_memory is pe_long.
* PR5045: clean up after interruptsfche2008-02-281-2/+9
| | | | | | | | | | | 2008-02-28 Frank Ch. Eigler <fche@elastic.org> PR5045 * session.h (pending_interrupts): New global. * main.cxx (handle_interrupts): New fn to handle SIGINT* etc. * elaborate.cxx, translate.cxx, tapsets.cxx, main.cxx (*): Insert pending_interrupts escape hatches inside potentially timetaking loops. * buildrun.cxx: Don't deal with signals.
* 2008-02-12 Martin Hunt <hunt@redhat.com>hunt2008-02-121-2/+2
| | | | | PR 5757 * tapsets.cxx, translate.cxx: Cleanup findentation a bit.
* 2008-01-23 Dave Brolley <brolley@redhat.com>brolley2008-01-231-0/+18
| | | | | | | * translate.cxx (var::fini): New method. (c_unparser::emit_module_init): Call var::fini when deregistering variables without indices. (c_unparser::emit_module_exit): Likewise.
* PR 4936: probe pont conditions part 2; reorg in prep for full rewritingfche2008-01-181-8/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2008-01-17 Frank Ch. Eigler <fche@elastic.org> PR 4935. Reorganize probe condition implementation. * elaborate.cxx (add_condition): New function. (derived_probe): Remove condition member. (derived_probe ctors): Assert non-null incoming probe/location ptrs. (insert_condition_statement): Remove; turn into ... (semantic_pass_conditions): New pass-2 subpass. (semantic_pass_symbols, visit_symbol, visit_functioncall, find_var): Detect some condition-related error cases. (match_key): Change type to exp_type from tok_type. Update callers. (alias_expansion_builder): Propagate probe conditions. * staptree.cxx (probe): Remove condition field and related functions. * tapsets.cxx (dwarf_derived_probe ctor): Compute replacement wildcard-expanded probe_point preserving more of the original location. (mark_derived_probe ctor): Make similar to others - take location rather than condition parameters. * translate.cxx (emit_common_header): Tweak ordering of tmpcounter traversal and hashkey expression generation. * elaborate.h: Corresponding changes. 2008-01-17 Frank Ch. Eigler <fche@elastic.org> PR 4935. * semko/forty.stp, fortyone.stp, fortytwo.stp: New tests. * semok/twentynine.stp: Weaken test since condition expressions have become more tightly constrained.
* 2008-01-14 Martin Hunt <hunt@redhat.com>hunt2008-01-151-16/+8
| | | | | * translate.cxx (emit_module_init): Call _stp_print_kernel_info() to print out version information and internal memory usage stats.
* 2008-01-14 Martin Hunt <hunt@redhat.com>hunt2008-01-141-0/+1
| | | | | * translate.cxx (emit_module_exit): When using timing, delete timing stats when finished.
* 2007-11-15 David Smith <dsmith@redhat.com>dsmith2007-11-151-1/+1
| | | | | | | | | | | * tapsets.cxx (mark_derived_probe::initialize_probe_context_vars): Updated to work with latest LTTNG patch patch-2.6.24-rc2-lttng-0.10-pre23.tar.bz2. (mark_derived_probe_group::emit_module_decls): Ditto. (mark_derived_probe_group::emit_module_init): Ditto. (mark_derived_probe_group::emit_module_exit): Ditto. * translate.cxx (c_unparser::emit_common_header): Ditto.
* 2007-11-12 Martin Hunt <hunt@redhat.com>hunt2007-11-121-3/+35
| | | | | | | | | | | | | * translate.cxx (visit_print_format): Strings without a format or formatted with "%s" or "%s\n" should be printed with calls to _stp_print(). Call _stp_print_char() if printing a char. * staptree.cxx (parse_print): Check for "print_char". * staptree.h (struct print_format): Add print_char. (parse_print): Update prototype. * parse.cxx (parse_symbol): Set print_char bool in print_format.
* 2007-10-03 Frank Ch. Eigler <fche@elastic.org>fche2007-10-041-49/+40
| | | | | | | | | PR 5102 * translate.cxx (visit_statement): Add new parameter regarding whether c->last_stmt needs to be updated. Update callers, mostly passing "false". (visit_EXPRESSIONTYPE): Generally omit setting c->last_stmt, unless the construct can set c->last_error.
* PR 5096: improve code generation for function callsfche2007-10-031-18/+19
| | | | | | | | | 2007-10-03 Frank Ch. Eigler <fche@elastic.org> PR 5096 * translate.cxx (emit_function): Put nesting limit/control logic into function body ... (visit_functioncall): ... and not into each call site.
* PR 3635: reduce number of global objectsfche2007-10-021-27/+40
| | | | | | | | | 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-10-02 Frank Ch. Eigler <fche@redhat.com>fche2007-10-021-21/+24
| | | | | | | | | | | | | | | | | | | PR 5078 * tapsets.cxx (be_derived_probe): Rework to add error probe support. Emit probe description array in C for traversal by generated code. * register_standard_tapsets: Add error probes. * stapprobes.5.in: Document. * translate.cxx (emit_module_init): Handle errors that may occur during begin probes. (emit_module_exit): Use schedule() rather than cpu_relax() during shutdown synchronization wait loop. * staptree.cxx (probe::printsig): Put multiple probe points on same line. 2007-10-02 Frank Ch. Eigler <fche@redhat.com> PR 5078 * semok/twentysix.stp, systemtap.base/beginenderror.*: New tests.
* 2007-09-25 Josh Stone <joshua.i.stone@intel.com>jistone2007-09-251-1/+1
| | | | | * tapsets.cxx (translator_output::~translator_output): Fix mismatched delete / delete [].
* 2007-09-12 Frank Ch. Eigler <fche@elastic.org>fche2007-09-131-5/+24
| | | | | | | | | | | PR 5023 * translate.cxx (c_unparser::visit_literal_number): Support LLONG_MIN. (visit_unary_expression): Likewise. 2007-09-12 Frank Ch. Eigler <fche@elastic.org> PR 5023. * buildok/ten.stp: Extend some more.
* 2007-09-12 Martin Hunt <hunt@redhat.com>hunt2007-09-121-7/+3
| | | | | | | | | | | | | | PR 5019 * elaborate.cxx (visit_hist_op): Remove log histogram param. * translate.cxx (assert_hist_compatible): Ditto. * staptree.cxx (hist_op::print): Ditto. * session.h (statistic_decl): Ditto. * parse.cxx (expect_number): Allow negative numbers. Also validate that input is really numeric. This is used by histograms to get the parameters. (parse_hist_op_or_bare_name): Remove code to get parameter for log histograms.
* 2007-09-12 David Smith <dsmith@redhat.com>dsmith2007-09-121-0/+1
| | | | | | * translate.cxx (c_unparser::emit_common_header): Added 'data' variable to context structure to support procfs probes. * tapsets.cxx: Improved procfs probe handling.
* 2007-08-30 David Smith <dsmith@redhat.com>dsmith2007-08-301-2/+14
| | | | | | | | PR 4983 * translate.cxx (c_tmpcounter::visit_print_format): Don't declare temporaries for number and string constants. (c_unparser::visit_print_format): Use numeric and string constants directly instead of copying them into temporaries.
* 2007-08-21 David Smith <dsmith@redhat.com>dsmith2007-08-211-2/+12
| | | | | | | PR 2305 * translate.cxx (c_unparser::visit_foreach_loop): When the user requested sorting an array of aggregates by value, sort by @count.
* 2007-08-16 Josh Stone <joshua.i.stone@intel.com>jistone2007-08-171-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | PR 4591 * parse.cxx (parser::parse_symbol): Tweak 'print' matching to allow all the new variants with printd and println. * staptree.h (struct print_format): Add fields for the new print variants, and parse_print() to help matching. * staptree.cxx (print_format::parse_print): New static method to match the print variants and determine their properties. (print_format::print): Handle the new print types. (deep_copy_visitor::visit_print_format): Copy the new fields. * translate.cxx (c_unparser::visit_print_format): Insert delims and newlines where appropriate for new print functions. * stap1.in: Document the new print functions. testsuite/ * lib/stap_run.exp: Make sure to match the entire output, in case there are multiple pass/fail messages. * buildok/printf.stp: Add lines for new print variants. * parseko/printd01.stp: Make sure that bad printd calls are handled. * parseko/printd02.stp: Ditto. * parseko/printd03.stp: Ditto. * parseko/printd04.stp: Ditto. * systemtap.base/print.stp: Try a bunch of different print calls. * systemtap.base/print.exp: Driver for above.
* 2007-08-10 Josh Stone <joshua.i.stone@intel.com>jistone2007-08-111-1/+2
| | | | | | | | | | | | | | | | | | | PR 4593 * translate.cxx (c_unparser::emit_common_header): Add an error_buffer to the context to allow dynamic error messages. * tapsets.cxx (dwflpp::express_as_string): Let deref / store_deref fill in last_error with a detailed message. runtime/ * loc2c-runtime.h (deref, store_deref): Set an error message with the pointer value and name into last_error, since it's hard to determine the details once you've already jumped to deref_fault. tapset/ * conversions.stp (kernel_string, kernel_long, kernel_int, kernel_short, kernel_char, user_string_warn): Use the CONTEXT->error_buffer to create an error message instead of a static local array.
* 2007-08-09 Frank Ch. Eigler <fche@elastic.org>fche2007-08-091-1/+1
| | | | | From Lai Jiangshan <laijs@cn.fujitsu.com>: * translate.cxx (emit_module_exit): Use stp_warn for warning.
* 2007-06-14 Frank Ch. Eigler <fche@elastic.org>fche2007-06-141-1/+5
| | | | | | | * translate.cxx (emit_module_init): Emit translator/elfutils version numbers together. * main.cxx (version): Ditto. (main): Skip printing tapset directories where no sources were found.
* 2007-05-21 David Smith <dsmith@redhat.com>dsmith2007-05-211-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR 4446. * elaborate.h (derived_probe::initialize_probe_context_vars): New virtual function that will allow added context vars to be initialized. * translate.cxx (c_unparser::emit_common_header): Added 'mark_va_list'. (c_unparser::emit_probe): Calls new function initialize_probe_context_vars. (translate_pass): Includes linux/marker.h if CONFIG_MARKERS is defined. * tapsets.cxx (struct dwarf_query): Split into base_query (which contains most of the original code) and a much smaller dwarf_query class. (struct base_query): New class. (dwarf_query::handle_query_module): New function. (query_module): Moved code into dwarf_query::handle_query_module(). (mark_derived_probe): Adjusted for new kernel markers. (mark_derived_probe_group): Ditto. (mark_var_expanding_copy_visitor): Ditto. (mark_var_expanding_copy_visitor::visit_target_symbol): Generates code for new kernel markers. (struct mark_query): New class. (mark_query::handle_query_module): New function. (mark_derived_probe::mark_derived_probe): Adjusted for new kernel markers. (mark_derived_probe::join_group): Ditto. (mark_derived_probe::emit_probe_context_vars): Ditto. (mark_derived_probe::parse_probe_sig): New function. (mark_derived_probe::initialize_probe_context_vars): New function. (mark_derived_probe::emit_module_decls): Adjust for new kernel markers. (mark_derived_probe::emit_module_init): Ditto. (mark_derived_probe::emit_module_exit): Ditto. (struct mark_builder): Ditto. (mark_builder::build): Ditto.
* 2007-05-02 David Smith <dsmith@redhat.com>dsmith2007-05-021-6/+15
| | | | | | | * translate.cxx (c_tmpcounter::visit_functioncall): Updated temporary handling. (c_unparser::visit_functioncall): No longer copies numeric and string constants to temporary variables.
* 2007-05-01 David Smith <dsmith@redhat.com>dsmith2007-05-011-11/+27
| | | | | | | | | | * translate.cxx (c_tmpcounter::visit_binary_expression): Updated temporary handling. (c_unparser::visit_binary_expression): Improved handing of numeric constants when handling '%' and '/' operators. (c_tmpcounter::visit_print_format): Updated temporary handling. (c_unparser::visit_print_format): Removed the need for a result temporary when printing to a stream.
* 2007-04-30 David Smith <dsmith@redhat.com>dsmith2007-04-301-31/+13
| | | | | | | | | PR 2339 * translate.cxx (c_unparser_assignment::c_assignop): Improved handling of numeric constants in the rest of the assignment operators. (c_tmpcounter_assignment::c_assignop): Updated temporary handling.
* 2007-04-25 David Smith <dsmith@redhat.com>dsmith2007-04-251-131/+295
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-04-04 Frank Ch. Eigler <fche@elastic.org>fche2007-04-041-0/+1
| | | | | | GCC 4.3 compatibility patches from Debian. * buildrun.cxx, hash.cxx, tapsets.cxx, translate.cxx: #include a few more C++ headers.
* 2007-03-30 David Smith <dsmith@redhat.com>dsmith2007-03-301-4/+36
| | | | | | | | | | | PR 2341 * translate.cxx (c_unparser::emit_locks): No longer emits a read lock for global variables that are only written to in begin/end probes. (c_unparser::emit_unlocks): Ditto. (translate_pass): Runs a varuse_collecting_visitor over probes that need global variable locks for use in emit_locks()/emit_unlocks().
* * tweak wordagefche2007-03-291-1/+2
|
* 2007-03-28 David Smith <dsmith@redhat.com>dsmith2007-03-281-3/+12
| | | | | | | | | | | | | | | | | | | | PR 2341 (partial fix) * elaborate.h (struct derived_probe): Added needs_global_locks() member function. Unless overridden, will return true indicating that this probe needs locks around global variable references. * tapsets.cxx (struct be_derived_probe): Added override of default needs_global_locks() returning false. begin/end probes don't need locks around global variables, since they aren't run concurrently with any other probes. * translate.cxx (c_unparser::emit_common_header): Updated probe_contents logic to match the logic in emit_probe. (c_unparser::emit_probe): Added whether the probe needs global variable locks to the probe string (that helps eliminate duplicate probes). The generated C changes based on whether or not global variable locks are needed, but the pass 2 output doesn't differ between a probe that needs global variable locks and one that doesn't. If the probe doesn't need global variable locks, doesn't output them.
* 2007-03-21 David Smith <dsmith@redhat.com>dsmith2007-03-211-8/+11
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* 2007-03-20 Frank Ch. Eigler <fche@elastic.org>fche2007-03-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | PR 4224. * tapsets.cxx (add_probe_point): Make kernel implicitly relocated relative to the _stext symbol. (dwarf_derived_probe ctor, emit_module_decls): Cooperate. (lookup_symbol_address): New function. (dwarf_builder::build): Call it thrice. (in_kprobes_function): Simplify. * session.h (systemtap_session): Rename cached symbol addresses. * translate.cxx, elaborate.cxx: Corresponding tweaks. 2007-03-20 Frank Ch. Eigler <fche@elastic.org> PR 4224. * sym.c (_stp_module_relocate): Support kernel relocations. 2007-03-20 Frank Ch. Eigler <fche@elastic.org> * symbols.c (_stp_do_symbols): Add cautionary blurb for important setup of _stp_modules[0]->text.
* 2007-03-19 David Smith <dsmith@redhat.com>dsmith2007-03-191-2/+6
| | | | | | | | | | PR 4146 (partial fix) * tapsets.cxx (all_session_groups): Added note about stating that begin probes should be registered (actually run) first and end probes should be unregistered (run) last. * translate.cxx (c_unparser::emit_module_exit): Process probe group vector in reverse order so that probe groups will get unregistered in the reverse order that they were registered.
* 2007-03-16 David Smith <dsmith@redhat.com>dsmith2007-03-161-1/+19
| | | | | | | | | | | | | | | | PR 3545. * tapsets.cxx (common_probe_entryfn_prologue): Added 'overload_processing' parameter, which defaults to true. If overload_processing is set to false, doesn't output the STP_OVERLOAD code. (common_probe_entryfn_epilogue): Ditto. (be_derived_probe_group::emit_module_decl): Set overload_processing to false in calls to common_probe_entryfn_prologue and common_probe_entryfn_epilogue since begin/end probes shouldn't overload the system. * translate.cxx (c_unparser::emit_common_header): Emit STP_OVERLOAD global variables. (translate_pass): Emit STP_OVERLOAD defines.
* 2007-03-14 Martin Hunt <hunt@redhat.com>hunt2007-03-141-10/+5
| | | | | | | | | | | | | | | * Makefile.am (staprun_SOURCES): Sources now live in runtime/staprun. * makefile.in: Rebuilt. * staprun.8.in: Updated. * buildrun.cxx (run_pass): Use "-v" instead of not "-q" to be compatible with latest staprun. * translate.cxx (emit_module_exit): Print warning using _stp_printf so it shows up at the end of all output. (translate_pass): Replace STP_RELAYFS with STP_BULKMODE. Eliminate STP_RELAYFS_MERGE.
* more warning elisionfche2007-02-231-11/+4
|
* 2007-02-19 Frank Ch. Eigler <fche@elastic.org>fche2007-02-191-3/+3
| | | | | | | | | PR 4078 and more, including patch from Eugeniy Meshcheryakov <eugen@debian.org>: * Makefile.am (AM_CXXFLAGS, AM_CFLAGS): Add -Wextra -Wall -Werror consistently. * Makefile.in: Regenerated. (*): Many minor warning fixes.
* 2007-02-17 Frank Ch. Eigler <fche@elastic.org>fche2007-02-171-24/+39
| | | | | | | PR 4066. * translate.cxx (var::init): Check stat scalar initialization, just like is done for arrays. (emit_module_exit): Check unlikely but possible null timing stat.
* 2007-01-31 Martin Hunt <hunt@redhat.com>hunt2007-01-311-11/+2
| | | | | * translate.cxx (translate_pass): Remove old string impedance mismatch stuff. Modify included files.
* 2007-01-29 Frank Ch. Eigler <fche@elastic.org>fche2007-01-291-5/+5
| | | | * translate.cxx (emit_module_init): Add some more type casts to printk args.
* 2007-01-29 Martin Hunt <hunt@redhat.com>hunt2007-01-291-16/+19
| | | | | * translate.cxx (emit_module_init): BZ3888. Add memory usage for the runtime to the printk.
* 2007-01-22 Martin Hunt <hunt@redhat.com>hunt2007-01-221-4/+3
| | | | | | * translate.cxx (mapvar::exists): Use new _stp_map_exists function. Testing for zero is no longer correct after changes from 2007-01-10 below.
* 2007-01-18 Frank Ch. Eigler <fche@elastic.org>fche2007-01-181-1/+16
| | | | | | * main.cxx (version): Add (C) 2007. * translate.cxx (emit_module_init): Add a KERN_DEBUG printk at module startup time to aid debugging and auditing.
* 2007-01-10 Martin Hunt <hunt@redhat.com>hunt2007-01-101-7/+2
| | | | | * translate.cxx (mapvar::del): Call the new _stp_map_del function instead of setting to zero.
* 2006-12-29 Frank Ch. Eigler <fche@elastic.org>fche2006-12-301-2/+3
| | | | | | | * tapsets.cxx (*group:emit_module_init): flush stdout less for timing mode. Also, Set probe_point variable ... * translate.cxx (emit_module_init): ... so on registration failure, a usable error message can be generated.