From ebe89ef77c8741f6654293a9f54a40057e20bab5 Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Wed, 11 Jun 2014 11:15:14 -0400 Subject: [PATCH] vars.exp: only parse out from first line of grep There can be multiple _stp_snprintf lines, in which case, the resulting values for vars and parms can hold the same variables multiple times, thus throwing off the test (see RHBZ1099757#c4). Fix this by only using the first line output from grep. --- testsuite/systemtap.base/vars.exp | 1 + 1 file changed, 1 insertion(+) diff --git a/testsuite/systemtap.base/vars.exp b/testsuite/systemtap.base/vars.exp index b07fcaab7..fef58e2f0 100644 --- a/testsuite/systemtap.base/vars.exp +++ b/testsuite/systemtap.base/vars.exp @@ -39,6 +39,7 @@ proc grab_C_statements { probe_point type } { set cmd [concat stap -p3 -e { "probe kernel.statement(\"$probe_point\") {print (\$\$$type)}" } \ | grep {"_stp_snprintf.*="} \ + | head -n 1 \ | sed -e {"s/^.*MAXSTRINGLEN, \"//"} -e "s/\".*$//"] catch {eval exec $cmd} out -- 2.43.5