Skip to content

Commit

Permalink
Revert "test: Have manyprobes clean up uprobes"
Browse files Browse the repository at this point in the history
This reverts commit 8dedee6, and
also drops the pre-existing ugly echo kludge.

We have proper cleanup now.

Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
  • Loading branch information
nickalcock authored and kvanhees committed Feb 22, 2024
1 parent 4f528b1 commit 68bb9a0
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions test/unittest/usdt/tst.manyprobes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,7 @@ fi

script()
{
$dtrace -o D.output -c ./test -qs /dev/stdin <<EOF
BEGIN
{
/* Dump pid for the clean-up hack we use. */
printf("pid is %d\n", \$target);
}
$dtrace -c ./test -qs /dev/stdin <<EOF
manyprobes\$target:::test1, manyprobes\$target:::test750, manyprobes\$target:::test1999
{
printf("%s:%s:%s\n", probemod, probefunc, probename);
Expand All @@ -76,17 +71,4 @@ EOF
script
status=$?

# D.output has the pid we need for the clean-up hack. Display the output minus
# that pid information for checking with the .r results file. Once uprobe cleanup
# has been automated, the pid info and D.output will not be needed.
grep -v "pid is " D.output

# Here is the clean-up hack for uprobe_events until dtprobed does clean up.
# Find the events for the specified pid and eliminate them.
pid=`awk '/pid is / {print $3}' D.output`
uprobes=/sys/kernel/debug/tracing/uprobe_events
for x in `awk '/^p:dt_pid\/.* \/proc\/'$pid'\/map_files\// { sub("^p:", "-:"); print $1 }' $uprobes`; do
echo $x >> $uprobes
done

exit $status

0 comments on commit 68bb9a0

Please sign in to comment.