]> sourceware.org Git - systemtap.git/commitdiff
vars.exp: only parse out from first line of grep
authorJonathan Lebon <jlebon@redhat.com>
Wed, 11 Jun 2014 15:15:14 +0000 (11:15 -0400)
committerJonathan Lebon <jlebon@redhat.com>
Wed, 11 Jun 2014 15:17:58 +0000 (11:17 -0400)
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

index b07fcaab74d5bd151c3bd670a88429186a9c940b..fef58e2f01fb7d0c170751b1530d19f8b3f2e84f 100644 (file)
@@ -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
 
This page took 0.029392 seconds and 5 git commands to generate.