fche [Thu, 8 Dec 2005 23:49:23 +0000 (23:49 +0000)]
2005-12-08 Frank Ch. Eigler <fche@elastic.org>
PR 1937
* buildrun.cxx (run_pass): Pass new "-d PID" option to stpd.
Set SIGHUP to SIG_IGN too.
2005-12-08 Frank Ch. Eigler <fche@elastic.org>
PR 1937
* stpd.c (main): Support new "-d" option.
(usage): Document it.
* librelay.c (driver_poll): New function to react to death of
driver process.
(stp_main_loop): Call it if "-d PID" given. Treat SIGHUP like others.
hunt [Thu, 8 Dec 2005 18:57:45 +0000 (18:57 +0000)]
2005-12-08 Martin Hunt <hunt@redhat.com>
* map.c (_new_map_create): Only increment map size if a node
was moved off the free list.
(_stp_map_size): New function.
(_stp_pmap_size): New function.
* map.c (_stp_map_init): Use kmalloc() to allocate individual
nodes instead of using vmalloc() to allocate one big chunk.
(_stp_map_new): Use kmalloc.
(_stp_pmap_new): Use kmalloc. Return a PMAP.
(__stp_map_del): New function. Free all the nodes in a map.
(_stp_map_del): Call __stp_map_del() then free map struct.
(_stp_pmap_del): Takes a PMAP. Calls __stp_map_del() for
each cpu.
(_stp_pmap_printn_cpu): Change arg to PMAP.
(_stp_pmap_agg): Change arg to PMAP.
(_stp_pmap_get_agg): Change arg to PMAP.
* map-stat.c (_stp_pmap_new_hstat_linear): Use PMAP
instead of MAP. Fix allocations.
(_stp_pmap_new_hstat_log): Ditto.
* pmap-gen.c Fix all functions to take or return PMAPS
instead of MAPS.
* alloc.c: Remove everything except kmalloc_node().
All runtime code now uses kmalloc() directly.
kevinrs [Wed, 7 Dec 2005 18:15:49 +0000 (18:15 +0000)]
* system_calls.stp:
* alphabatized for easier navigation
* removed comments from reference to void pointer args
* removed reference to some unsafe copy_from_user funcs
* added final aliases for i386
* aux_syscalls.stp
* commented out embedded C functions that made use of
copy_from_user(), a function that might sleep and that
was causing Oops on my machine when sleep was called
from invalid context.
fche [Wed, 7 Dec 2005 03:25:08 +0000 (03:25 +0000)]
2005-12-06 Frank Ch. Eigler <fche@elastic.org>
PR 1934.
* tapsets.cxx (resolve_prologue_endings2): Add new heuristic for
tail-call optimized functions.
(query_func_info): Make somewhat less verbose.
graydon [Fri, 2 Dec 2005 23:28:03 +0000 (23:28 +0000)]
2005-12-02 Graydon Hoare <graydon@redhat.com>
* elaborate.cxx (mutated_var_collector): Forward
traversal portion of calls to base class.
(mutated_var_collector::visit_arrayindex): Resolve
arrayindex-into-histogram expression as pe_long.
(typeresolution_info::visit_print_format): Traverse
into histogram if present.
fche [Fri, 2 Dec 2005 19:34:36 +0000 (19:34 +0000)]
2005-12-02 Frank Ch. Eigler <fche@elastic.org>
* configure.ac: Bump version number.
* stap.1.in: Document some of the new print/stats stuff.
* configure: Regenerated.
* systemtap.spec.in: Enable ia64 and ppc builds.
fche [Wed, 30 Nov 2005 22:19:03 +0000 (22:19 +0000)]
2005-11-30 Frank Ch. Eigler <fche@redhat.com>
PR 1276
From Josh Stone <joshua.i.stone@intel.com>:
* tapsets.cxx (profile_derived_probe, profile_builder,
register_standard_tapsets): Support timer.profile variety.
* stapprobes.5.in: Document it.
* testsuite/builok/fourteen.stp: Test its buildability.
hunt [Wed, 30 Nov 2005 08:38:13 +0000 (08:38 +0000)]
2005-11-30 Martin Hunt <hunt@redhat.com>
* transport.h (STP_WORK_TIMER): Declare.
* transport.c (_stp_work_queue): Wake up every STP_WORK_QUEUE
jiffies and check IO and exit status.
(_stp_handle_exit): Deleted.
* procfs.c (_stp_proc_write_cmd): Just set exit flag on STP_EXIT.
(_stp_write): Don't call wake_up_interruptible.
graydon [Tue, 29 Nov 2005 01:06:47 +0000 (01:06 +0000)]
[ChangeLog]
2005-11-28 Graydon Hoare <graydon@redhat.com>
* translate.cxx (var::assert_hist_compatible): New method.
(var::hist): New method.
(c_unparser::load_aggregate): New method.
(hist_op_downcaster): Remove, it was a mistake.
(expression_is_hist_op): Likewise.
(c_tmpcounter::visit_print_format): Implement print(@hist(...)).
(c_unparser::visit_print_format): Likewise.
* staptree.h (struct print_format): Add optional hist_op* member.
* staptree.cxx (traversing_visitor::visit_functioncall): Visit
hist_op if present in print_format.
(deep_copy_visitor::visit_print_format): Likewise.
* parse.cxx (parse_symbol): Special case to consume print(@hist(...)).
* elaborate.cxx (typeresolution_info::visit_arrayindex): Fix type inference bug.
(typeresolution_info::visit_foreach_loop): Likewise.
* testsuite/buildok/print_histograms.stp: New test.
[runtime/ChangeLog]
2005-11-28 Graydon Hoare <graydon@redhat.com>
* stat-common.c (_stp_stat_print_histogram): Various formatting
corrections and aesthetic tweaks.
(__stp_stat_add): Correction to linear bucket underflow cases.
hunt [Mon, 28 Nov 2005 22:08:39 +0000 (22:08 +0000)]
2005-11-28 Martin Hunt <hunt@redhat.com>
* alloc.c (__stp_valloc_percpu): Use same code for up and smp.
(_stp_per_cpu_ptr): New macro.
* user/alloc.c: Ditto.
* map.c: Use _stp_map_cpu_ptr().
* map-stat.c: Ditto.
* pmap-gen.c: Ditto.
* runtime.h: Include alloc.c
* user/runtime.h: Ditto.
kevinrs [Mon, 28 Nov 2005 19:09:43 +0000 (19:09 +0000)]
* commented pciconfig_* system calls that failed to resolve to probe
points.
* commented reference to arg stack_start in clone, fork, vfork that
were unable to resolve properly.
* commented arg reference to pt_regs in execve, it is an unsupported
type.
* commented arg reference to union semun arg in semctl, it is an
unsupported type.
* This tapset tested for i386.
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.