vector<probe_point*> chain;
collect_derivation_pp_chain (chain);
- for (int i=chain.size()-1; i>=0; i--)
+ // NB: we actually start looking from the second-to-last item, so the user's
+ // direct input is not considered. Input like 'kernel.function("init_once")'
+ // will thus be listed with the resolved @file:line too, disambiguating the
+ // distinct functions by this name, and matching our historical behavior.
+ for (int i=chain.size()-2; i>=0; i--)
{
probe_point pp_copy (* chain [i]);
// drop any ?/! denotations that would confuse a glob-char search
eof { fail $test }
}
catch { close }; catch { wait }
+
+set test init_once-glob
+spawn stap -l {kernel.function("init_once*")}
+expect {
+ -re {kernel.function."init_once@fs/inode.c:\d+".\r\n} { pass $test }
+ -re {^[^\r\n]*\r\n} { exp_continue }
+ timeout { fail $test }
+ eof { fail $test }
+}
+catch { close }; catch { wait }
+
+set test init_once-noglob
+spawn stap -l {kernel.function("init_once")}
+expect {
+ -re {kernel.function."init_once@fs/inode.c:\d+".\r\n} { pass $test }
+ -re {^[^\r\n]*\r\n} { exp_continue }
+ timeout { fail $test }
+ eof { fail $test }
+}
+catch { close }; catch { wait }
+
+set test begin-glob
+spawn stap -l {begin*}
+expect {
+ -re {begin\r\n} { pass $test }
+ -re {^[^\r\n]*\r\n} { exp_continue }
+ timeout { fail $test }
+ eof { fail $test }
+}
+catch { close }; catch { wait }
+
+set test begin-noglob
+spawn stap -l {begin}
+expect {
+ -re {begin\r\n} { pass $test }
+ -re {^[^\r\n]*\r\n} { exp_continue }
+ timeout { fail $test }
+ eof { fail $test }
+}
+catch { close }; catch { wait }