Bug 12210 - Allow extra suffixes on alias expansion
Summary: Allow extra suffixes on alias expansion
Status: RESOLVED FIXED
Alias: None
Product: systemtap
Classification: Unclassified
Component: translator (show other bugs)
Version: unspecified
: P2 enhancement
Target Milestone: ---
Assignee: Serguei Makarov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-11 23:26 UTC by Josh Stone
Modified: 2012-07-06 13:37 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Josh Stone 2010-11-11 23:26:47 UTC
We should allow instantiations of probe aliases to have trailing components, suffixes, that apply to the underlying probepoints.  For example, "syscall.open.return.maxactive(N)" would apply that maxactive component to "sys_open" and "compat_sys_open" underneath.  This would also allow a probe like "syscall.open" to work with para-callgraph, as both ".call" and ".return" will be valid.

It gets a little tricky when an alias is named the same as something that could also be a shorter alias with a suffix.  So "syscall.open.return" should match only the exact full alias, and not "(syscall.open).return", the entry alias with a new suffix.

It's even trickier when wildcards are involved - we probably want "syscall.open.*" to expand to "(syscall.open).call" and "syscall.open.return", but still not "(syscall.open).return".  When doubled as "syscall.open**", I think the same policy will still work out.
Comment 1 Serguei Makarov 2012-06-20 15:03:27 UTC
The question also was raised on IRC whether we want to support something along the following lines:

  probe foo = begin { }
  probe foo(-3) { }

Namely, the suffix might simply consist of a parameter that is passed on to the underlying probes in the alias.
Comment 2 Serguei Makarov 2012-06-22 19:56:21 UTC
> It's even trickier when wildcards are involved - we probably want
> "syscall.open.*" to expand to "(syscall.open).call" and "syscall.open.return",
> but still not "(syscall.open).return".  When doubled as "syscall.open**", I
> think the same policy will still work out.

Clarification -- however, a wildcard such as syscall.open.return.m*(1) which would ordinarily have no expansions needs to be passed along as a suffix.
Comment 3 Serguei Makarov 2012-06-29 14:23:46 UTC
Basic implementation of the feature is in the repository; probably going to close this bug in a bit. Some follow up issues for polishing at the edges:

PR14279 - properly expand wildcards in stap -l and pn() (also affects pre-alias suffix language features)
PR14310 - better error messages on recursive alias suffix expansion
PR14311 - always report alternatives & positions in probe point error messages
PR14312 - use alias suffixes in existing systemtap.examples
PR14313 - rewrite alias example in langref.tex

The first two bugs are, in my opinion, a prerequisite to any modification of the alias suffix behaviour that allows a wildcard expansion to match both *ordinary* probe points *and* suffixes (instead of only matching suffixes when it can't find any ordinary probe points, as it does currently).
Comment 4 Serguei Makarov 2012-06-29 14:27:09 UTC
(In reply to comment #3)
> PR14279 - properly expand wildcards in stap -l and pn() (also affects pre-alias
> suffix language features)

Sorry, that should have actually been PR14297...
Comment 5 Serguei Makarov 2012-07-06 13:37:46 UTC
Anyhow, going to mark this problem resolved and get to work on the follow-ups...