roland [Sun, 27 Nov 2005 02:05:00 +0000 (02:05 +0000)]
2005-11-26 Roland McGrath <roland@redhat.com>
* loc2c.c (struct location): Move frame_base member out of the union.
(alloc_location): Initialize it.
(new_synthetic_loc, translate, location_from_address): Update uses.
(emit_loc_value): Don't handle frame_base here.
(c_emit_location): Do it here instead.
(translate): Track USED_DEREF separately for each piece.
Use a temporary struct when allocating a new piece, letting
a pending loc_address piece finish up first.
fche [Thu, 24 Nov 2005 22:45:52 +0000 (22:45 +0000)]
2005-11-24 Frank Ch. Eigler <fche@redhat.com>
PR 1903
* parse.cxx (eval_pp_conditional): Support %( arch == "i686" %) form.
* stap.1.in: Document it.
* testsuite/parseok/fourteen.stp: Test it.
* session.h (architecture): New field.
* main.cxx (main): Initialize it.
graydon [Thu, 24 Nov 2005 05:55:52 +0000 (05:55 +0000)]
2005-11-23 Graydon Hoare <graydon@redhat.com>
* elaborate.h (get_symbol_within_expression): Make visible.
* elaborate.cxx (get_symbol_within_expression): Make non-static.
(stat_decl_collector): New struct.
(semantic_pass_stats): New semantic pass.
(semantic_pass): Call it.
(semantic_pass_symbols): Remove collection of statistic_decls from files.
(visit_stat_op): Only fail if inferred type is not pe_long.
* parse.cxx (parser::parse): Don't pass per-file statistic_decl
into parse_global.
(parser::parse_global): Don't parse global statistic_decls,
they're obsolete.
* parse.hh (parser::parse_global): Adjust signature to match.
* session.h (statistic_decl::operator==): New method.
* staptree.h (print_format::is_empty): New method.
(stapfile::stat_decls): Remove field.
* staptree.cxx (string_to_components): Fix bugs in format-string
parser.
* translate.cxx (var): Make private fields protected.
(var::init): Support HIST_NONE stats.
(aggvar): New struct.
(mapvar::is_parallel): New method.
(mapvar::call_prefix): Use it.
(mapvar::calculate_aggregate): New method.
(mapvar::fetch_existing_aggregate): New method.
(mapvar::get): Support pe_stats.
(mapvar::init): Use is_parallel(), and support HIST_NONE.
(itervar::itervar): Only fault on pe_unknown.
(itervar::start): Use mapvar::is_parallel and
mapvar::fetch_existing_aggregate.
(emit_map_type_instantiations): Include alloc.c before pmap-gen.c.
Include pmap-gen.c for pe_stats maps.
(c_unparser::gensym_aggregate): New method.
(c_unparser::visit_foreach_loop): Handle mapvar::is_parallel case.
(arrayindex_downcaster): New struct.
(expression_is_arrayindex): New function.
(c_tmpcounter::visit_stat_op): New method.
(c_unparser::visit_stat_op): Implement.
(c_unparser::visit_hist_op): Add commentary, still not implemented.
* testsuite/buildok/stat_{insert,extract}.stp: New tests.
* testsuite/semok/ten.stp: Correct for changes to global declarations.
* testsuite/semko/*.stp: Likewise.
roland [Tue, 22 Nov 2005 00:29:54 +0000 (00:29 +0000)]
2005-11-21 Roland McGrath <roland@redhat.com>
* loc2c.c (c_translate_location): Take Dwarf_Op vector as argument
directly, not Dwarf_Attribute.p
* loc2c.h: Update decl.
* loc2c-test.c (get_location): New function.
(handle_variable): Use it.
* tapsets.cxx (dwflpp::translate_location): New method.
(dwflpp::translate_components, dwflpp::literal_stmt_for_local): Use it.
fche [Mon, 21 Nov 2005 19:02:44 +0000 (19:02 +0000)]
2005-11-21 Frank Ch. Eigler <fche@elastic.org>
PR 1276
From Josh Stone <joshua.i.stone@intel.com>:
* tapsets.cxx (timer_derived_probe, timer_builder,
register_standard_tapsets): Support timer.ms() variety.
* stapprobes.5.in: Document it.
* testsuite/builok/fourteen.stp: Test its buildability.
graydon [Mon, 14 Nov 2005 04:39:47 +0000 (04:39 +0000)]
2005-11-13 Graydon Hoare <graydon@redhat.com>
* staptree.h (struct indexable): New struct.
(classify_indexable): New function.
(classify_const_indexable): New function.
(struct symbol): Implement indexable.
(struct arrayindex): Take indexable as base.
(struct foreach_loop): Take indexable as base.
(struct print_format): New struct.
(enum stat_component_type): New enum.
(struct stat_op): New struct.
(enum historgram_type): New enum.
(struct hist_op): New struct.
(struct visitor)
(struct traversing_visitor)
(struct throwing_visitor)
(struct deep_copy_visitor): Add new visitor methods.
(require): Specialize for indexable*.
* staptree.cxx (print_format::*)
(stat_op::*)
(hist_op::*)
(indexable::*)
(traversing_visitor::*)
(throwing_visitor::*)
(deep_copy_visitor::*)
(classify_indexable)
(classify_const_indexable): Implement
(deep_copy_visitor::*): Update to use indexables.
* parse.h (parser::parse_indexable): New method.
(parser::parse_hist_op_or_bare_name): New method.
* elaborate.cxx (symbol_fetcher): New class.
(get_symbol_within_expression): New function.
(get_symbol_within_indexable): New function.
(mutated_var_collector): Replace mutated_map_collector.
(no_var_mutation_during_iteration_check): Replace
no_map_mutation_during_iteration_check.
(semantic_pass_vars): Replace semantic_pass_maps.
(semantic_pass): Update call accordingly.
(symresolution_info::*) Add new visitors, teach about indexables
(typeresolution_info::*) Likewise.
* translate.cxx
(c_unparser::getiter): Take symbol, not foreach_loop.
(c_unparser::*) Add new visitors, teach about indexables.
(c_tmpcounter::*)
(delete_statement_operand_visitor::visit_arrayindex)
(c_tmpcounter_assignment::*)
(c_unparser_assignment::*): Likewise.
(hist_op_downcaster): New struct.
(expression_is_hist_op): New function.
* testsuite/buildok/printf.stp: New test for print_format.
hunt [Fri, 11 Nov 2005 06:13:24 +0000 (06:13 +0000)]
2005-11-10 Martin Hunt <hunt@redhat.com>
* pmaps/ix2.c: New test. Test _stp_pmap_get_*().
* pmaps/iii3.c: New test. Test _stp_pmap_get_*().
* pmaps/pmap.test: Update.
kevinrs [Thu, 10 Nov 2005 21:23:27 +0000 (21:23 +0000)]
* system_calls.stp
Polished entry point aliases, no more pointer-deref
faults (instead the user-space address is given for
pointer arguments). Return probe aliases still dont
do much. Tested on vanilla 2.6.13 and 2.6.14.
* aux_syscalls.stp
Any helpers for the syscall tapset are now in this
file. More to come.
hunt [Thu, 10 Nov 2005 21:22:35 +0000 (21:22 +0000)]
2005-11-10 Martin Hunt <hunt@redhat.com>
* map.c: Doc updates.
* pmap-gen.c: Change a bunch of generated function names to
avoid conflicts with maps with the same key and value types.
fche [Wed, 9 Nov 2005 17:08:19 +0000 (17:08 +0000)]
2005-11-09 Frank Ch. Eigler <fche@elastic.org>
Reported by Guang Lei Li <liguangl@cn.ibm.com>:
* tapset/context.stp (pid,ppid,tid): Correctly pick tgid vs pid.
* testsuite/buildok/context_test.stp: Print out tid() too.
hunt [Wed, 9 Nov 2005 08:24:52 +0000 (08:24 +0000)]
2005-11-09 Martin Hunt <hunt@redhat.com>
* map.h (struct map_root): Delete fields
used by old API.
* map.c: Remove old map API functions.
* map-stat.c (_stp_map_add_stat): Delete.
(_stp_pmap_new_hstat_linear): Move here from map.c.
(_stp_pmap_new_hstat_log): Ditto.
hunt [Tue, 8 Nov 2005 19:48:23 +0000 (19:48 +0000)]
2005-11-08 Martin Hunt <hunt@redhat.com>
* map.c (_stp_map_init): New function. Extracted from _stp_map_new()
so it can be used in _stp_pmap_new().
(_stp_map_new): Call _stp_map_init().
(_stp_pmap_new): New function.
(_stp_pmap_new_hstat_linear): New function.
(_stp_pmap_new_hstat_log): New function.
(_stp_pmap_del): New function.
(_stp_pmap_printn_cpu): New function.
(_stp_pmap_printn): New function.
(_stp_new_agg): New function.
(_stp_add_agg): New function.
(_stp_pmap_agg): New function.
(_new_map_clear_node): New function.
* map.h (struct map_root): Add Hist struct. Add copy
and cmp function pointers for pmaps.
* stat.h: Remove Stat struct. Replace with Hist struct
that is limited to only histogram params.
* map-stat.c: Fix up references to histogram params in map_root.
* stat-common.c: Ditto.
* stat.c: Ditto.
* pmap-gen.c: New file. Implements per-cpu maps.
* map-gen.c: Minor bug fixes. Use new VAL_IS_ZERO() macro.
* alloc.c (vmalloc_node): For NUMA, provide a vmalloc that
does node-local allocations.
(_stp_alloc_cpu): A version of _stp_alloc() that does
node-local allocations.
(_stp_valloc): A version of _stp_valloc() that does
node-local allocations.
(__stp_valloc_percpu): New function. Like alloc_percpu()
except uses _stp_valloc().
(_stp_vfree_percpu): New function. Like free_percpu().
fche [Tue, 8 Nov 2005 18:43:37 +0000 (18:43 +0000)]
2005-11-08 Frank Ch. Eigler <fche@redhat.com>
* translate.cxx (c_unparser::visit_foreach_loop): With PR 1275
done, add back read lock around foreach loop. Add a write lock
around preceding sort operation. Leave a race condition window. :-(
fche [Tue, 8 Nov 2005 16:52:36 +0000 (16:52 +0000)]
2005-11-08 Frank Ch. Eigler <fche@redhat.com>
* tapsets.cxx (blacklisted_p): Add blacklist for some .return
probes to kludge around bug #1345.
* tapset/system_calls.stp: Add some %( %? %) conditionals to
get closer to using tapset on 2.6.9 kernel.
fche [Fri, 4 Nov 2005 21:46:14 +0000 (21:46 +0000)]
2005-11-04 Frank Ch. Eigler <fche@redhat.com>
* tapsets.cxx (dwarf_derived_probe::emit_registrations): Add
possible kprobe address prechecking logic. Set kretprobes
maxactive to zero.
* translate.cxx (emit_module_init): Set a more helpful default
probe_point value for use in registration errors. Exit properly
after registration failure of probe #0.
fche [Thu, 3 Nov 2005 21:20:52 +0000 (21:20 +0000)]
2005-11-03 Frank Ch. Eigler <fche@elastic.org>
PR 1329.
* tapsets.cxx (dwarf_query::add_probe_point): Look up section name
containing given address. Skip request if it came from .init.*.
* testsuite/semko/thirtytwo.stp: New test.
fche [Wed, 2 Nov 2005 01:46:39 +0000 (01:46 +0000)]
2005-11-01 Frank Ch. Eigler <fche@elastic.org>
Sound advice from <drepper@redhat.com>:
* configure.ac: Undo last change.
* configure.ac: Unregenerated.
* parse.cxx: Use glibc strverscmp function instead of rpmlib.
* stap.1.in: Update correspondingly.
askeshav [Fri, 28 Oct 2005 22:49:28 +0000 (22:49 +0000)]
IA64 Runtime support patches. With this in place
Systemtap should now be able to build on Ia64.
Includes supports for - function probes, return probes,
function parameter access and dumping stack backtrace.
Added by Anil S Keshavamurthy <Anil.s.keshavamurthy@intel.com>
hunt [Fri, 28 Oct 2005 19:44:58 +0000 (19:44 +0000)]
2005-10-28 Martin Hunt <hunt@redhat.com>
* map-gen.c (MAP_GET_VAL): Use the _stp_get_*() functions.
(_stp_map_set_*): When setting to "", don't create
node if key not found.
(_stp_map_get_*): Use new MAP_GET_VAL. Return "" when
string lookups not found.
* map.c (_stp_get_int64): Check args and return
0 on bad args or wrong type.
(_stp_get_stat): Ditto.
(_stp_key_get_int64): Ditto.
(_stp_get_str): Check args and return
"bad type" on bad args or wrong type.
(_stp_key_get_str): Ditto.
(_new_map_set_str): If setting to "", delete node.
(_new_map_get_*): Delete. Use _stp_get_*().
hunt [Fri, 28 Oct 2005 19:20:28 +0000 (19:20 +0000)]
2005-10-28 Martin Hunt <hunt@redhat.com>
* maps/keys.c: New file. Tests specific to _stp_key_get_*().
* maps/iiss2.c (main): Add some comments to make clear expected
results.
* maps/is2.c (main): _stp_map_get_*s() now returns "" instead
of NULL when lookup fails. _stp_map_set_*s() now deletes a node
when setting to "" (as well as NULL).
* maps/setadd.c (main): Ditto.
* maps/map.test: update results.
hunt [Wed, 26 Oct 2005 08:29:38 +0000 (08:29 +0000)]
2005-10-26 Martin Hunt <hunt@redhat.com>
* map.c (_new_map_create, _new_map_del_node, _new_map_del_node,
_new_map_set_int64, _new_map_set_str,_new_map_get_int64,
_new_map_get_str, _new_map_get_stat, _new_map_set_stat):
New internal functions for the new API.
* map-int.c (__stp_map_set_int64): Modify to return an
error code.
* map-stat.c (_stp_map_add_stat): Ditto.
* map-str (_stp_map_set_str): Ditto.
* Doxyfile: Remove predefines NEED_STRING_VALS,
NEED_STATS, NEED_INT64.
* map-keys.c: Ditto.
* list.c (_stp_list_new): Ditto. Also set map->list.
* map-values.c: Ditto.
hunt [Wed, 26 Oct 2005 08:08:53 +0000 (08:08 +0000)]
2005-10-26 Martin Hunt <hunt@redhat.com>
* maps/map.test: Update with results for new tests.
* maps/*2.c: Tests for the new API.
* maps/ist.c: Renamed isx.c.
* maps/setadd.c: New test of adding and setting.
graydon [Thu, 20 Oct 2005 22:11:33 +0000 (22:11 +0000)]
2005-10-20 Graydon Hoare <graydon@redhat.com>
PR 917 (incomplete)
* staptree.h (struct statistic_decl): New struct.
(stapfile::stat_decls): New member.
* parse.h, parse.cxx
(parser::expect_known): Fix typo.
(parser::expect_number): New method.
(parser::parse_global): Parse global statistic_decls.
* elaborate.h (systemtap_session::stat_decls): New member.
* elaborate.cxx (semantic_pass_symbols): Copy per-file stat_decls
to session-wide.
(typeresolution_info::visit_assignment): Detect some semantic stats
errors in type resolution pass.
* translate.cxx (var::sd): New private member.
(var::var): Initialize it.
(var::sdecl): New accessor.
(var::init): Handle stats values.
(mapvar::mapvar): Pass through statistic_decl to var ctor.
(mapvar::get): Test for long explicitly.
(mapvar::set): Likewise.
(mapvar::init): Handle stats values.
(c_unparser::emit_common_header): Remove typedef of stats_t,
include stat.c when necessary.
(mapvar::key_typename): Typo.
(c_unparser::emit_map_type_instantiations): Thinko: value_typename not key_typename.
(c_unparser::c_typename): Implementation typename is "Stat", not "stats_t".
(c_unparser::c_assign): Fix bad error message.
(c_unparser_assignment::c_assignop): Handle operator <<<.
(c_unparser::getvar): Feed session statistic_decl into var.
(c_unparser::getmap): Likewise.
(c_unparser::visit_assignment): Handle operator <<<.
(c_tmpcounter_assignment::visit_symbol): Derive type from rvalue when present.
(c_unparser_assignment::visit_symbol)
(c_tmpcounter_assignment::visit_arrayindex)
(c_unparser_assignment::load_map_indices): Likewise.
(c_unparser::visit_arrayindex): Likewise, and Prohibit statistic rvalues.
(c_unparser_assignment::visit_arrayindex): Handle operator <<<.
* testsuite/semko/twentyfour.stp:
* testsuite/semko/twentyfive.stp:
* testsuite/semko/twentysix.stp:
* testsuite/semko/twentyseven.stp:
* testsuite/semko/twentyeight.stp:
* testsuite/semko/twentynine.stp:
* testsuite/semko/thirty.stp:
* testsuite/semko/thirtyone.stp: New tests for prohibited statistic contexts.
* testsuite/buildok/twentytwo.stp: New test for legal statistic contexts.
fche [Tue, 18 Oct 2005 17:59:17 +0000 (17:59 +0000)]
2005-10-18 Frank Ch. Eigler <fche@redhat.com>
PR 1477.
* main.cxx (main): Set PATH and LC_ALL, so
* buildrun.cxx (compile_pass, run_pass): ... and ...
* translate.cxx (emit_symbol_data): ... don't have to.
fche [Tue, 18 Oct 2005 12:40:59 +0000 (12:40 +0000)]
2005-10-18 Frank Ch. Eigler <fche@elastic.org>
PR 1482 cont'd.
* translator.cxx (emit_module_init): Set aside a variable for
detailed probe point id.
* tapsets.cxx (emit_registrations): Use it.
(add_probe_point): Correct synthesized probe-point typo.
hunt [Tue, 18 Oct 2005 04:34:05 +0000 (04:34 +0000)]
2005-10-17 Martin Hunt <hunt@redhat.com>
* transport.c (_stp_handle_start): Grab semaphore before
calling probe_start() and release after it is done.
(_stp_handle_exit): Ditto for exiting. This prevents
exiting before probe_start() is finished.
graydon [Mon, 17 Oct 2005 23:52:34 +0000 (23:52 +0000)]
2005-10-17 Graydon Hoare <graydon@redhat.com>
* testsuite/semko/twentyone.stp: Check function doesn't match inline.
* testsuite/semko/twentytwo.stp: Check inline doesn't match function.
* testsuite/buildok/six.stp: Change "function" to "inline".
* stapprobes.5.in: Describe "inline" probes.
* tapsets.cxx (TOK_INLINE): New token "inline".
(dwarf_query::has_inline_str)
(dwarf_query::has_inline_num)
(dwarf_query::inline_str_val)
(dwarf_query::inline_num_val): New members.
(dwarf_query::dwarf_query): Load new members.
(query_dwarf_inline_instance)
(query_dwarf_func)
(query_cu)
(query_module)
(dwarf_derived_probe::add_probe_point)
(dwarf_builder::build):
Use inline-related members where appropriate.
(dwarf_derived_probe::register_inline_variants): New method.
(dwarf_derived_probe::register_function_and_statement_variants):
Call it.