]> sourceware.org Git - systemtap.git/log
systemtap.git
11 years agoData object (-d) cannot be empty.
Mark Wielaard [Tue, 12 Feb 2013 16:05:07 +0000 (17:05 +0100)]
Data object (-d) cannot be empty.

11 years agostap: Add shorthand option --dyninst for --runtime=dyninst
Josh Stone [Mon, 11 Feb 2013 22:30:48 +0000 (14:30 -0800)]
stap: Add shorthand option --dyninst for --runtime=dyninst

* cmdline.cxx: Define --dyninst as LONG_OPT_RUNTIME_DYNINST.
* session.cxx (systemtap_session::parse_cmdline_runtime): Pull out the
  code to set the runtime option.
  (systemtap_session::parse_cmdline): Use parse_cmdline_runtime for both
  LONG_OPT_RUNTIME and LONG_OPT_RUNTIME_DYNINST.
  (systemtap_session::usage): Document --dyninst.
* man/stap.1: Document --dyninst.

11 years agostapdyn documentation updates
Josh Stone [Mon, 11 Feb 2013 22:09:45 +0000 (14:09 -0800)]
stapdyn documentation updates

* stapdyn/README: Refresh with more current information.
* man/error::pass5.7stap: Add a note about Dyninst vs exceptions.

11 years agostapdyn: Initialize _stp_random_u from /dev/urandom
Josh Stone [Sat, 9 Feb 2013 01:59:53 +0000 (17:59 -0800)]
stapdyn: Initialize _stp_random_u from /dev/urandom

11 years agostapdyn: Validate that probe flags are known
Josh Stone [Fri, 8 Feb 2013 20:58:56 +0000 (12:58 -0800)]
stapdyn: Validate that probe flags are known

If we see unknown flags, we don't want to do the wrong thing with a
probe.  So just warn about it and move on without it.

* runtime/dyninst/stapdyn.h: Introduce STAPDYN_PROBE_ALL_FLAGS combining
  all the currently-known flags.  Also, shift the values of the utracey
  flags to leave some room for more uprobey flags.
* stapdyn/dynprobe.cxx (dynprobe_location::validate): New, make sanity
  check on the probe.  For now, this just means checking that the flags
  are within those we know about.

11 years agoPR11334: last-minute character class tweaks.
Serguei Makarov [Fri, 8 Feb 2013 19:24:22 +0000 (14:24 -0500)]
PR11334: last-minute character class tweaks.

These fix a couple of errors in how small inverted character classes were handled.
e.g. [^a] and such

11 years agostap-report: don't heartlessly destroy incoming $PATH
Frank Ch. Eigler [Fri, 8 Feb 2013 12:32:53 +0000 (07:32 -0500)]
stap-report: don't heartlessly destroy incoming $PATH

11 years agoerror::pass5, mention more permission-related causes for failure
Frank Ch. Eigler [Thu, 7 Feb 2013 20:37:57 +0000 (15:37 -0500)]
error::pass5, mention more permission-related causes for failure

11 years agostapdyn: Make sure interprocess maps share hash seeds
Josh Stone [Fri, 8 Feb 2013 00:43:21 +0000 (16:43 -0800)]
stapdyn: Make sure interprocess maps share hash seeds

We were using a random stap_hash_seed that was initialized separately in
each process.  This meant that different processes would compute
different hashes for the same keys.  Now the hash seed is stored in the
shared memory, so all participating processes can use maps together.

* runtime/dyninst/common_session_state.h: Add the hash seed to struct
  stp_runtime_session, and provide _stap_hash_seed() to read it.
  Initialize it one time only in stp_session_init().
* runtime/dyninst/runtime.h: Define the former stap_hash_seed to use
  _stap_hash_seed() from shared memory instead.
* testsuite/systemtap.maps/map_hash_interprocess.*: Test the specific
  interprocess, manually-keyed conditions that revealed the bug.

11 years agostapdyn: Seed _stp_random_u with more "precision"
Josh Stone [Thu, 7 Feb 2013 23:42:47 +0000 (15:42 -0800)]
stapdyn: Seed _stp_random_u with more "precision"

Use clock_gettime() rather than time().  It's still not necessarily
great to seed from a time-based source, but at least nanosecond
resolution is a little better.

11 years agoPR14706: Add proto-exec support in stapdyn
Josh Stone [Thu, 7 Feb 2013 21:02:30 +0000 (13:02 -0800)]
PR14706: Add proto-exec support in stapdyn

This adds preliminary support for stapdyn to follow execs, but the code
it instrument the new process is currently blocked out.  I'm seeing
dyninst hang during loadLibrary, waiting for IRPC, but haven't yet
figured out why.

* stapdyn/mutatee.cxx (mutatee_freezer): New helper to automatically
  stop a process and then continue it when leaving that scope.
  (mutatee::begin_callback): Use a mutatee_freezer.
  (mutatee::thread_callback): Use a mutatee_freezer.
  (mutatee::copy_forked_instrumentation): Use two mutatee_freezers.
  (mutatee::instrument_dynprobes): Support a flag to indicate this is
  post-exec, so first run any process.end probes from before exec.
  (mutatee::exec_reset_instrumentation): New, clear all members that are
  invalidated by the process exec.
* stapdyn/mutator.cxx (g_exec_callback): New global callback for execs.
  (mutator::exec_callback): New specific callback for execs.  Clear old
  instrumentation, then instrument it anew (buggy, #if 0 for now).

11 years agoFix typo in sdt_misc.exp to avoid error for unsupported test.
William Cohen [Thu, 7 Feb 2013 18:31:52 +0000 (13:31 -0500)]
Fix typo in sdt_misc.exp to avoid error for unsupported test.

11 years agoClean up mutatee::stop_execution() logic.
David Smith [Thu, 7 Feb 2013 17:52:06 +0000 (11:52 -0600)]
Clean up mutatee::stop_execution() logic.

* stapdyn/mutatee.cxx (mutatee): Removed unneeded 'patch' argument.
  (stop_execution): Remove logic that waited on the process to stop, since
  process->stopExecution() is synchronous.
* stapdyn/mutatee.h: Update prototypes.
* stapdyn/mutator.cxx: Update mutatee constructor calls.

11 years agoPR11334: regex example tweaked to take a parameter
Serguei Makarov [Thu, 7 Feb 2013 15:21:08 +0000 (10:21 -0500)]
PR11334: regex example tweaked to take a parameter

11 years agostap-report: collect all output on stdout, not stderr
Frank Ch. Eigler [Thu, 7 Feb 2013 15:21:31 +0000 (10:21 -0500)]
stap-report: collect all output on stdout, not stderr

11 years agoRemove a stray space in _stp_saved_errno
Josh Stone [Wed, 6 Feb 2013 23:16:33 +0000 (15:16 -0800)]
Remove a stray space in _stp_saved_errno

11 years agoAUTHORS bump
Frank Ch. Eigler [Wed, 6 Feb 2013 22:30:51 +0000 (17:30 -0500)]
AUTHORS bump

11 years agostap-report: add nss+etc to rpm version list
Frank Ch. Eigler [Wed, 6 Feb 2013 21:08:08 +0000 (16:08 -0500)]
stap-report: add nss+etc to rpm version list

11 years agoSave and restore 'errno' in dyninst probes.
David Smith [Wed, 6 Feb 2013 22:18:23 +0000 (16:18 -0600)]
Save and restore 'errno' in dyninst probes.

* tapsets.cxx (common_probe_entryfn_prologue): In dyninst mode, save errno
  at the start of the probe.
  (common_probe_entryfn_epilogue): In dyninst mode, restore errno at the
  end of the probe.

11 years agoWarn about unbalanced attempts to shutdown NSS.
Dave Brolley [Wed, 6 Feb 2013 21:29:44 +0000 (16:29 -0500)]
Warn about unbalanced attempts to shutdown NSS.

Warn about attempts to shut down NSS against a certificate database
which has not been initialized.

11 years agoEnsure that NSS has been initialized before attempting to shut it down.
Jiri Horky [Wed, 6 Feb 2013 21:26:41 +0000 (16:26 -0500)]
Ensure that NSS has been initialized before attempting to shut it down.

11 years agoMerge branch 'master' of ssh://sourceware.org/git/systemtap
David Smith [Wed, 6 Feb 2013 21:07:48 +0000 (15:07 -0600)]
Merge branch 'master' of ssh://sourceware.org/git/systemtap

11 years agoPR14574 partial fix: Add dyninst support to warnings2.exp.
David Smith [Wed, 6 Feb 2013 21:07:24 +0000 (15:07 -0600)]
PR14574 partial fix: Add dyninst support to warnings2.exp.

11 years agoPR11334: add regex.stp to systemtap.examples
Serguei Makarov [Wed, 6 Feb 2013 21:03:42 +0000 (16:03 -0500)]
PR11334: add regex.stp to systemtap.examples

11 years agoPR14574 partial fix: Add dyninst testcase support.
David Smith [Wed, 6 Feb 2013 20:32:21 +0000 (14:32 -0600)]
PR14574 partial fix: Add dyninst testcase support.

* testsuite/systemtap.base/unresolved-struct-typedef.exp: Add dyninst
  support.
* testsuite/systemtap.base/uprobes.exp: Ditto.
* testsuite/systemtap.base/utf_pretty.exp: Ditto.
* testsuite/systemtap.base/utf_user.exp: Ditto.
* testsuite/systemtap.base/utf_user_trunc.exp: Ditto.
* testsuite/systemtap.base/vta-test.exp: Ditto.

11 years agoAccess user strings with 'user_string_*' in systemtap.base/utf_user.stp.
David Smith [Wed, 6 Feb 2013 20:27:52 +0000 (14:27 -0600)]
Access user strings with 'user_string_*' in systemtap.base/utf_user.stp.

11 years agoPR14574 partial fix: Add dyninst testcase support.
David Smith [Wed, 6 Feb 2013 15:28:59 +0000 (09:28 -0600)]
PR14574 partial fix: Add dyninst testcase support.

* testsuite/systemtap.base/rand.exp: Add dyninst support.
* testsuite/systemtap.base/sdt.exp: Ditto.
* testsuite/systemtap.base/sdt_misc.exp: Ditto.
* testsuite/systemtap.base/sdt_va_args.exp: Ditto.
* testsuite/systemtap.base/simple.exp: Ditto.
* testsuite/systemtap.base/stmt_rel_user.exp: Ditto.
* testsuite/systemtap.base/suppress-time-limit.exp: Ditto.
* testsuite/systemtap.base/tri.exp: Ditto.
* testsuite/systemtap.base/trycatch.exp: Ditto.

11 years agoAdd kprobe.function.call, and squash nd_syscall.exit.return
Josh Stone [Tue, 5 Feb 2013 21:17:16 +0000 (13:17 -0800)]
Add kprobe.function.call, and squash nd_syscall.exit.return

* tapsets.cxx (register_standard_tapsets): Bind kprobe .call variants.
* man/stapprobes.3stap: Document this new possibility.
* tapset/linux/nd_syscalls.stp: Use .call to make sure that alias
  suffixes can't tack a .return on nd_syscall.exit and .exit_group.

11 years agoDisregard all pass-2 errors in listing mode
Josh Stone [Tue, 5 Feb 2013 20:34:13 +0000 (12:34 -0800)]
Disregard all pass-2 errors in listing mode

* elaborate.cxx (semantic_pass): In listing mode, the only rc we care
  about is whether any probes were discovered.

11 years agoAdd [nd_]syscall.ustat32.return
Josh Stone [Tue, 5 Feb 2013 19:31:37 +0000 (11:31 -0800)]
Add [nd_]syscall.ustat32.return

This adds the proper .return aliases for the syscall.ustat32 entry
aliases, rather than having them as part of syscall.ustat.return, so
way the entry/return probes are properly balanced.  It also makes sure
that wildcards like syscall.ustat** don't end up in an incomplete
ustat.return probe due to implicit alias suffixes.

I considered wrapping this with version-compatibility checks, but IMO
the former behavior was broken enough that it isn't worth it.

* tapset/linux/syscalls2.stp: Split out syscall.ustat32.return.
* tapset/linux/nd_syscalls2.stp: Split out nd_syscall.ustat32.return.
* testsuite/buildok/syscalls2-detailed.stp: Test ustat32.return.
* testsuite/buildok/nd_syscalls2-detailed.stp: Test ustat32.return.

11 years agoPR11334: use systemtap error reporting for regex functionality
Serguei Makarov [Tue, 5 Feb 2013 21:00:52 +0000 (16:00 -0500)]
PR11334: use systemtap error reporting for regex functionality

11 years agoIndented and cleaned up testsuite/systemtap.base/sdt_misc.exp.
David Smith [Tue, 5 Feb 2013 20:26:04 +0000 (14:26 -0600)]
Indented and cleaned up testsuite/systemtap.base/sdt_misc.exp.

11 years agoGet syscall tapsets working on ppc64 RHEL4 by providing missing defines.
David Smith [Tue, 5 Feb 2013 18:58:12 +0000 (12:58 -0600)]
Get syscall tapsets working on ppc64 RHEL4 by providing missing defines.

* tapset/linux/powerpc/aux_syscalls.stp: Add missing PTRACE_* defines.

11 years agoAs part of PR11955, update the signal-handle.stp buildok testcase.
David Smith [Mon, 4 Feb 2013 18:54:22 +0000 (12:54 -0600)]
As part of PR11955, update the signal-handle.stp buildok testcase.

* testsuite/buildok/signal-handle.stp: Handle 'oldset_addr' and 'regs'
  deprecation.

11 years agoFix up documention comment for signal.send.return so docproc can parse it.
William Cohen [Mon, 4 Feb 2013 15:45:09 +0000 (10:45 -0500)]
Fix up documention comment for signal.send.return so docproc can parse it.

11 years agore2c: don't implement strndup
Frank Ch. Eigler [Fri, 1 Feb 2013 20:51:59 +0000 (15:51 -0500)]
re2c: don't implement strndup

Linux has had it forever; drop the conditional and fallback
implementation.

11 years agoperf.counter probe warnings.
Stan Cox [Fri, 1 Feb 2013 19:58:21 +0000 (14:58 -0500)]
perf.counter probe warnings.

* tapset-perfmon.cxx (statement_counter): New.
  (perf_builder::build):  Add nonempty block warning. Add if..next to block.

11 years agoSmall RHEL4 compile fix.
David Smith [Fri, 1 Feb 2013 17:12:32 +0000 (11:12 -0600)]
Small RHEL4 compile fix.

11 years agoFixed PR11955 by updating the signal tapset.
David Smith [Fri, 1 Feb 2013 17:01:40 +0000 (11:01 -0600)]
Fixed PR11955 by updating the signal tapset.

* tapset/linux/signal.stp (signal.send): Now uses the 'signal_generate'
  tracepoint where available. Deprecated the 'send2queue' variable.
  (signal.send.return): Deprecated.
  (signal.handle): Now uses the 'signal_deliver' tracepoint where
  available. Deprecated the 'oldset_addr' and 'regs' variables.
  (signal.handle.return): Deprecated.
* testsuite/buildok/signal-detailed.stp: Updated with 'signal.send',
  'signal.send.return', and 'signal.handle.return' deprecations.
* NEWS: Added deprecation notes.

11 years agostap.1: stats arrays do support %; drop comment about its absence
Frank Ch. Eigler [Fri, 1 Feb 2013 16:06:12 +0000 (11:06 -0500)]
stap.1: stats arrays do support %; drop comment about its absence

11 years agostap.1 man page: reword/remention array % (wrapping) decoration
Frank Ch. Eigler [Fri, 1 Feb 2013 15:56:32 +0000 (10:56 -0500)]
stap.1 man page: reword/remention array % (wrapping) decoration

11 years ago(PR6971) Mark the nd_syscall.exp tests as kfails on ia64.
David Smith [Thu, 31 Jan 2013 22:36:35 +0000 (16:36 -0600)]
(PR6971) Mark the nd_syscall.exp tests as kfails on ia64.

* testsuite/systemtap.syscall/nd_syscall.exp (test_procedure): Make the
  tests as kfails for ia64.

11 years agoPR11576: simplify runtime *perf_counters[] widget
Frank Ch. Eigler [Thu, 31 Jan 2013 17:29:36 +0000 (12:29 -0500)]
PR11576: simplify runtime *perf_counters[] widget

Take away unnecessary indirection; *long[] -> *long.

11 years agoNEWS: don't forget re2c project acknowledgement
Serguei Makarov [Thu, 31 Jan 2013 16:09:35 +0000 (11:09 -0500)]
NEWS: don't forget re2c project acknowledgement

11 years agoPR14574 partial: Let stapdyn tests run despite the kernel
Josh Stone [Thu, 31 Jan 2013 02:52:09 +0000 (18:52 -0800)]
PR14574 partial: Let stapdyn tests run despite the kernel

Some tests are guarded by [uprobes_p] or [uretprobes_p] before they're
allowed to run, but --runtime=dyninst cares not for such features.
Rework these tests so the kernel features are more tightly considered
only right before running in kernel mode.

11 years agoPR14705: Modify SDT semaphores in stapdyn
Josh Stone [Wed, 30 Jan 2013 20:20:41 +0000 (12:20 -0800)]
PR14705: Modify SDT semaphores in stapdyn

For SDT probes which are guarded by a semaphore, stapdyn needs to update
the value to show when the probes are active.

* stapdyn/mutatee.h (mutatee::semaphores): New vector of variables in
  this mutatee which represent active semaphores.
* stapdyn/mutatee.cxx (mutatee::update_semaphores): New, used to
  increment or decrement the value of semaphores in this mutatee.
  (mutatee::instrument_dynprobe_target): When a probe has a semaphore,
  create a variable representation of it.
  (mutatee::instrument_object_dynprobes): Increment semaphores in bulk.
  (mutatee::copy_forked_instrumentation): Copy semaphore variables too.
  (mutatee::remove_instrumentation): Decrement semaphores in bulk.
* tapsets.cxx (sdt_query::handle_query_module): Calculate the difference
  in load addresses between .text and .data as semaphore_load_offset.
  (sdt_query::record_semaphore): Subtract the semaphore_load_offset for
  dyninst to get a file-based offset of the semaphore.

11 years agonetfilter tapset: fix arp ar_tha & ar_tpa fields
Frank Ch. Eigler [Thu, 31 Jan 2013 00:20:43 +0000 (19:20 -0500)]
netfilter tapset: fix arp ar_tha & ar_tpa fields

There was a typo in decoding the arp packets that duplicated source &
target addresses.

11 years agoAdd better cleanup to a setjmp.exp and statement.exp.
David Smith [Wed, 30 Jan 2013 21:11:48 +0000 (15:11 -0600)]
Add better cleanup to a setjmp.exp and statement.exp.

* testsuite/systemtap.base/setjmp.exp: Cleanup test programs. Allow the
  user to override this using the '-v' vebose flag.
* testsuite/systemtap.base/statement.exp: Ditto.

11 years agotestuite: comment typo fix
Frank Ch. Eigler [Wed, 30 Jan 2013 16:39:09 +0000 (11:39 -0500)]
testuite: comment typo fix

11 years agoPR15080 fixed by handling signal_wake_up_state() replacing signal_wake_up().
David Smith [Wed, 30 Jan 2013 16:29:29 +0000 (10:29 -0600)]
PR15080 fixed by handling signal_wake_up_state() replacing signal_wake_up().

* runtime/stp_utrace.c (stp_signal_wake_up): New function.
  (utrace_init): Lookup the address of signal_wake_up_state().
  (utrace_control): Call stp_signal_wake_up().
* buildrun.cxx (compile_pass): Add export test for 'signal_wake_up_state'.
* runtime/linux/runtime.h: Added 'kallsyms_signal_wake_up_state' declaration.
* tapset/linux/signal.stp: Handle signal_wake_up_state() replacing
  signal_wake_up() in newer kernels for the 'signal.wakeup' probe alias.

11 years agoerror::pass4 man page: menton STAP_ARG* changes
Frank Ch. Eigler [Wed, 30 Jan 2013 15:59:07 +0000 (10:59 -0500)]
error::pass4 man page: menton STAP_ARG* changes

11 years agotestsuite: conditionalize client-server tests on feature: NSS
Frank Ch. Eigler [Wed, 30 Jan 2013 14:41:34 +0000 (09:41 -0500)]
testsuite: conditionalize client-server tests on feature: NSS

* testsuite/lib/systemtap.exp (nss_p): New test proc.
  (dyninst_p): Switch to globals instead of $env().
  (setup_server): Use it.
* testsuite/systemtap.server/*.exp: Do an [nss_p] test early on.

11 years agotestsuite: fix semko/badregex01.stp so it passes parseok
Frank Ch. Eigler [Wed, 30 Jan 2013 00:11:32 +0000 (19:11 -0500)]
testsuite: fix semko/badregex01.stp so it passes parseok

11 years agotestsuite: pass -w to tracepoints.exp pass-5 test
Frank Ch. Eigler [Tue, 29 Jan 2013 23:59:17 +0000 (18:59 -0500)]
testsuite: pass -w to tracepoints.exp pass-5 test

... since it may print warnings that we don't want to see

11 years agotestsuite: tweak bz10078 test case to use noinline functions
Frank Ch. Eigler [Tue, 29 Jan 2013 22:03:42 +0000 (17:03 -0500)]
testsuite: tweak bz10078 test case to use noinline functions

11 years agotestsuite: fix systemtap.examples/check.exp to properly CHDIR back & forth
Frank Ch. Eigler [Tue, 29 Jan 2013 21:25:03 +0000 (16:25 -0500)]
testsuite: fix systemtap.examples/check.exp to properly CHDIR back & forth

A failed test_check fragment (such as from virtualization/*.meta)
could result in loss of the original pwd=$builddir/testsuite, because
the loop neglected to restore the old pwd ($curdir) before
"continue"'ing.  We now save & restore $pwd outside the loop in
addition to the intra-loop cwd twitchery.

11 years agoexamples index regen
Frank Ch. Eigler [Tue, 29 Jan 2013 21:24:54 +0000 (16:24 -0500)]
examples index regen

11 years agoPR12231: use literal_string parsers/types in @perf() parameters
Frank Ch. Eigler [Tue, 29 Jan 2013 17:10:25 +0000 (12:10 -0500)]
PR12231: use literal_string parsers/types in @perf() parameters

Type-casting is so passe.

11 years agore2c: fix some possibly-uninit-variable compiler warnings
Frank Ch. Eigler [Tue, 29 Jan 2013 17:09:12 +0000 (12:09 -0500)]
re2c: fix some possibly-uninit-variable compiler warnings

11 years agotestsuite: use [uretprobes_p] in more tests
Frank Ch. Eigler [Tue, 29 Jan 2013 16:52:38 +0000 (11:52 -0500)]
testsuite: use [uretprobes_p] in more tests

11 years agotestsuite: new utrace_orig_p conditional
Frank Ch. Eigler [Tue, 29 Jan 2013 15:51:42 +0000 (10:51 -0500)]
testsuite: new utrace_orig_p conditional

... needed for itrace tests

11 years agostap-report: make selinux state queries conditional on presence of those executables
Frank Ch. Eigler [Tue, 29 Jan 2013 15:51:14 +0000 (10:51 -0500)]
stap-report: make selinux state queries conditional on presence of those executables

11 years agotestsuite: introduce [uretprobe_p]
Frank Ch. Eigler [Tue, 29 Jan 2013 15:27:52 +0000 (10:27 -0500)]
testsuite: introduce [uretprobe_p]

Some test cases assume presence of uretprobes_p, inferred from uprobes_p.
With this new predicate, they can check for uretprobes support proper.

11 years agoPR11334: docs -- NEWS, langref, stap.1
Serguei Makarov [Mon, 28 Jan 2013 22:45:49 +0000 (17:45 -0500)]
PR11334: docs -- NEWS, langref, stap.1

11 years agofix regex_query class definition
Serguei Makarov [Mon, 28 Jan 2013 22:01:15 +0000 (17:01 -0500)]
fix regex_query class definition

11 years agotypofix parse_literal_string()
Serguei Makarov [Mon, 28 Jan 2013 21:18:13 +0000 (16:18 -0500)]
typofix parse_literal_string()

11 years agoPR11334: testsuite tweaks for merge
Serguei Makarov [Fri, 25 Jan 2013 19:18:06 +0000 (14:18 -0500)]
PR11334: testsuite tweaks for merge

Keeping the separate re2c-migrate testsuite at the moment.

(I tried putting together a systemtap script with the testsuite,
but it winds up being too unwieldy, and I couldn't figure out
a good way to be able to switch it to 'one Expect test per regex'
mode on demand. Will get rid of separate regcomp testsuite once
I figure it out.)

11 years agoPR11334: create separate parse_literal_string() to avoid typecasting.
Serguei Makarov [Fri, 25 Jan 2013 18:59:15 +0000 (13:59 -0500)]
PR11334: create separate parse_literal_string() to avoid typecasting.

11 years agoPR11334: add basic backslash escaping step to regex parser
Serguei Makarov [Fri, 25 Jan 2013 18:21:28 +0000 (13:21 -0500)]
PR11334: add basic backslash escaping step to regex parser

The SystemTap parser preserves string literal backslashes
to pass them on to the C parser, so stapregex needs to do
its own escaping.

11 years agoPR11334: fix character grouping before postfix ops
Serguei Makarov [Fri, 25 Jan 2013 15:21:05 +0000 (10:21 -0500)]
PR11334: fix character grouping before postfix ops

Previous version of regex parser incorrectly grouped e.g. ab+ as (ab)+.
This patch fixes that problem.

11 years agoadd appropriate copyblurbs to all re2c files
Serguei Makarov [Thu, 24 Jan 2013 16:05:44 +0000 (11:05 -0500)]
add appropriate copyblurbs to all re2c files

11 years agostapregexp code-gen: emit #undef YY* 's to undo generated #define YY*'s
Frank Ch. Eigler [Tue, 22 Jan 2013 20:21:20 +0000 (15:21 -0500)]
stapregexp code-gen: emit #undef YY* 's to undo generated #define YY*'s

11 years agore2c compilation warning->error fixes for f17 (gcc 4.7)
Frank Ch. Eigler [Tue, 22 Jan 2013 19:22:21 +0000 (14:22 -0500)]
re2c compilation warning->error fixes for f17 (gcc 4.7)

11 years agoPR11334: support for ^ and $ anchoring operators
Serguei Makarov [Mon, 21 Jan 2013 20:17:27 +0000 (15:17 -0500)]
PR11334: support for ^ and $ anchoring operators

11 years agoPR11334 partial support: ^ anchoring operator
Serguei Makarov [Mon, 21 Jan 2013 19:15:00 +0000 (14:15 -0500)]
PR11334 partial support: ^ anchoring operator

$ is not yet completely implemented

11 years agore2c cleanup: debug option for codeGen process
Serguei Makarov [Mon, 21 Jan 2013 16:09:48 +0000 (11:09 -0500)]
re2c cleanup: debug option for codeGen process

11 years agore2c-cleanup: some helpful comments in re2c-dfa
Serguei Makarov [Mon, 21 Jan 2013 16:03:43 +0000 (11:03 -0500)]
re2c-cleanup: some helpful comments in re2c-dfa

11 years agore2c cleanup: cleanup stapregex.h, add potential courtesyblurb
Serguei Makarov [Wed, 16 Jan 2013 16:46:42 +0000 (11:46 -0500)]
re2c cleanup: cleanup stapregex.h, add potential courtesyblurb

11 years agore2c cleanup: re2c-globals -- ditch the pile of type aliases
Serguei Makarov [Wed, 16 Jan 2013 16:27:58 +0000 (11:27 -0500)]
re2c cleanup: re2c-globals -- ditch the pile of type aliases

11 years agore2c cleanup: rename regcomp.cxx regcomp.h to stapregex.cxx stapregex.h
Serguei Makarov [Wed, 16 Jan 2013 15:39:55 +0000 (10:39 -0500)]
re2c cleanup: rename regcomp.cxx regcomp.h to stapregex.cxx stapregex.h

11 years agore2c cleanup: get rid of *_STANDALONE
Serguei Makarov [Tue, 15 Jan 2013 22:28:10 +0000 (17:28 -0500)]
re2c cleanup: get rid of *_STANDALONE

11 years agore2c cleanup: get rid of regtranslate.cc
Serguei Makarov [Tue, 15 Jan 2013 22:22:01 +0000 (17:22 -0500)]
re2c cleanup: get rid of regtranslate.cc

11 years agore2c cleanup: file layout -- create re2c-emit.cxx
Serguei Makarov [Tue, 15 Jan 2013 22:17:20 +0000 (17:17 -0500)]
re2c cleanup: file layout -- create re2c-emit.cxx

11 years agore2c cleanup: file layout -- create re2c-regex.cxx re2c-regex.h
Serguei Makarov [Tue, 15 Jan 2013 22:02:21 +0000 (17:02 -0500)]
re2c cleanup: file layout -- create re2c-regex.cxx re2c-regex.h

11 years agore2c cleanup: file layout -- create re2c-dfa.cxx re2c-dfa.h
Serguei Makarov [Tue, 15 Jan 2013 21:43:24 +0000 (16:43 -0500)]
re2c cleanup: file layout -- create re2c-dfa.cxx re2c-dfa.h

11 years agore2c cleanup: file layout -- create re2c-globals.h re2c-globals.cxx
Serguei Makarov [Tue, 15 Jan 2013 20:06:57 +0000 (15:06 -0500)]
re2c cleanup: file layout -- create re2c-globals.h re2c-globals.cxx

11 years agoPR11334: declutter re2c -- get rid of stream_lc.h
Serguei Makarov [Thu, 10 Jan 2013 22:55:53 +0000 (17:55 -0500)]
PR11334: declutter re2c -- get rid of stream_lc.h

Note that the deletion of file_info is no big loss -- it was just
used to print a bunch of #line directives which have no relevance
to the output of a SystemTap script (and in fact would make pass-4
errors much more confusing by throwing off the line count!).

in directory re2c-migrate:

* stream_lc.h: delete file.
* token.h: delete stream_lc.h include.
(Token::Token): delete constructors that use file_info as an input.
* globals.cc, globals.h: delete stream_lc.h include and file_info stuff.
* code.cc: add missing includes.
(Rule::emit): do not print file_info stuff.
(basic_null_streambuf, basic_null_stream, null_streambuf, null_stream): moved from stream_lc.h.
(DFA::emit): do not print file_info stuff.
(<<): delete overloading for file_info.
* re.h (RuleLine): delete class.
* scanner.h (Scanner): no longer inherit from line_number.

11 years agoPR11334: fix regtest.cxx re: emit_matchop renaming.
Serguei Makarov [Thu, 10 Jan 2013 22:48:18 +0000 (17:48 -0500)]
PR11334: fix regtest.cxx re: emit_matchop renaming.

* regtest.cxx (main): use emit_matchop_start and emit_matchop_end.

11 years agoPR11334: minimal testcase for basic regex match operator
Serguei Makarov [Fri, 4 Jan 2013 20:02:49 +0000 (15:02 -0500)]
PR11334: minimal testcase for basic regex match operator

* testsuite/systemtap.base/regex.stp: new file.
* testsuite/systemtap.base/regex.exp: new file.

11 years agoPR11334: support for very-basic regex match operator in script
Serguei Makarov [Fri, 4 Jan 2013 16:32:18 +0000 (11:32 -0500)]
PR11334: support for very-basic regex match operator in script

* session.h (systemtap_session::dfas, systemtap_session::dfa_counter): new fields.
* session.cxx (systemtap_session::systemtap_session): correctly initialize dfa_counter in constructors.
* re2c-migrate/regcomp.h (class stapdfa): remove dummy stapdfa() constructor.
(emit_matchop): remove function.
(emit_matchop_start, emit_matchop_end): new function.
(regex_to_stapdfa): mistake fixes.
* re2c-migrate/regcomp.cxx (class stapdfa): ditto.
(emit_matchop): remove function.
(emit_matchop_start, emit_matchop_end): new function.
(regex_to_stapdfa): mistake fixes.
* re2c-migrate/actions.cc (Scanner::getRange): get rid of warnings.
* elaborate.cxx (class regex_collecting_visitor): new visitor to populate dfas.
(gen_dfa_table): new function.
(semantic_pass): add call to gen_dfa_table().
* translate.cxx (c_unparser::visit_regex_query): add actual match invocation.
(translate_pass): generate regex matching functions.
* Makefile.am, Makefile.in: add regcomp stuff to main stap compilation.
* re2c-migrate/translate.cc moved to re2c-migrate/regtranslate.cc
  (to avoid Makefile naming conflict).
* re2c-migrate/Makefile.am, re2c-migrate/Makefile.in: update for regtranslate renaming.

11 years agoPR11334: improved prepending of .*
Serguei Makarov [Wed, 12 Dec 2012 17:27:20 +0000 (12:27 -0500)]
PR11334: improved prepending of .*

Compile .* and store it as a regex, instead of prepending to the regex string.
(The previous commit's method can cause oddball test failures.)

* re2c-migrate/regcomp.h (class stapdfa): declare padRE to hold AST for ".*".
* re2c-migrate/regcomp.cxx (stapdfa::padRE): new static variable.
(stapdfa::stapdfa): prepend padRE (".*") unless the RegExp obviously begins with ^.
* re2c-migrate/re.h (class RegExp): add 'anchored' field.
(class AltOp, CatOp, CloseOp): set 'anchored' field correctly.
* re2c-migrate/actions.cc (RuleOp::RuleOp): set 'anchored' field correctly.
(mkAlt): set 'anchored' field correctly for returned expression.

11 years agoPR11334: A couple of tests for ^ and $ it wouldn't do to forget.
Serguei Makarov [Wed, 12 Dec 2012 17:21:13 +0000 (12:21 -0500)]
PR11334: A couple of tests for ^ and $ it wouldn't do to forget.

11 years agoPR11334: basic fix for left-anchored matches
Serguei Makarov [Tue, 11 Dec 2012 16:12:17 +0000 (11:12 -0500)]
PR11334: basic fix for left-anchored matches

Prepend .* by default so the regex match can start at any point in the string.

* re2c-migrate/regcomp.cxx (stapdfa::stapdfa): prepend ".*" to re.

11 years agoPR11334: fix read-past-the-end error for .* and similar
Serguei Makarov [Tue, 4 Dec 2012 16:55:02 +0000 (11:55 -0500)]
PR11334: fix read-past-the-end error for .* and similar

Solved by the simple expedient of fixing the off-by-one error that caused
YYFILL to abort the match before the terminating '\0' could be returned,
and changing mkDot() (responsible for creating '.' regex) to forbid '\0'.

NOTE: This will have to be revisited due to reliance on explicit '\0'
matching. Namely, a tricky regex *might* try to break things by trying
to match '[s\0]*' or such. This will not read forbidden memory (YYFILL
is too airtight for that), but the match outcome will not be what one
would expect. So we should keep in mind that the regex syntax should
not allow '\0' as a regex match character.

* re2c-migrate/actions.cc (mkDot); detect '\0' instead of '\n' as string end.
* re2c-migrate/regcomp.cxx (emit_declaration): tweak YYFILL to include '\0'.
* re2c-migrate/regcomp.base/regtest.in.0: additional test case.

11 years agoPR11334: Forgot regtest.in.1 in previous commit due to overly-broad .gitignore :(
Serguei Makarov [Mon, 3 Dec 2012 21:27:56 +0000 (16:27 -0500)]
PR11334: Forgot regtest.in.1 in previous commit due to overly-broad .gitignore :(

11 years agoPR11334: regex test script & initial data
Serguei Makarov [Mon, 3 Dec 2012 21:21:16 +0000 (16:21 -0500)]
PR11334: regex test script & initial data

Run the testsuite using 'make check' in <build>/re2c-migrate.
Then watch the astounding 71 passes to 102 failures rate! :-P

Subsequently, of course, this stuff will be merged into the main testsuite.

* re2c-migrate/Makefile.am: rudimentary dejagnu testsuite in regcomp.base/.
* re2c-migrate/Makefile.in: regenerated from Makefile.am.
* re2c-migrate/regcomp.base/regtest.exp: new file.
* re2c-migrate/regcomp.base/regtest.in.0: new file (basic tests).
* re2c-migrate/regcomp.base/regtest.in.1: new file (glibc tests).
* re2c-migrate/config/unix.exp: new file (temporary shim to stop
dejagnu complaining).
* re2c-migrate/regtest.cxx (main): emit required answer codes according
to glibc tests.

11 years agoPR11334: custom regex parser & generation wrapper
Serguei Makarov [Tue, 27 Nov 2012 18:59:02 +0000 (13:59 -0500)]
PR11334: custom regex parser & generation wrapper

Further progress -- this one emits code that correctly returns 1 or 0
depending on whether the regex correctly matched or not.

TODO -- re2c seems to anchor the regex on the left of the string, so
to allow a match throughout the string we need to put .* (or similar)
on the front of the regex.

TODO -- .* and similar fail to match due to expecting '\n' to terminate
the string. This is an assumption of re2c which can be fixed.

11 years agoPR 11334: ugly hacky regcomp.cxx progress
Serguei Makarov [Thu, 15 Nov 2012 19:24:28 +0000 (14:24 -0500)]
PR 11334: ugly hacky regcomp.cxx progress

Added a RuleOp to trigger { return 1; } on match success.
Added very early outline of regtest.cxx which emits a simple test program.

Next steps:
- polish up regtest.cxx and add a driver.
- trigger { return 0; } on match failure.
- currently, the matching seems to be anchored at the beginning of the string.
  re2c can do unanchored matching, however, so I need to enable that.

11 years agoPR11334: partial progress to wrapping re2c in regcomp.cxx.
Serguei Makarov [Wed, 7 Nov 2012 18:47:49 +0000 (13:47 -0500)]
PR11334: partial progress to wrapping re2c in regcomp.cxx.

To test out, cd build/re2c-migrate/, run make, and use ./regtest.
Lots of ommissions currently, and a known bug where re2c eats the first
character of the regexp at some point between the AST and the code output,
so this commit is definitely useful only as a status update...

11 years agoPR11334: initial commit of code from re2c
Serguei Makarov [Tue, 6 Nov 2012 19:37:23 +0000 (14:37 -0500)]
PR11334: initial commit of code from re2c

This page took 0.063634 seconds and 5 git commands to generate.