]> sourceware.org Git - systemtap.git/commitdiff
PR27820 tapset/bpf/logging.stp: implement abort() tapset function
authorSerhei Makarov <me@serhei.io>
Wed, 14 Jul 2021 15:52:11 +0000 (11:52 -0400)
committerSerguei Makarov <smakarov@redhat.com>
Wed, 14 Jul 2021 15:59:36 +0000 (11:59 -0400)
A more obsessively accurate implementation would add a check
equivalent to if (c->aborted) to the start of each probe,
but it would be an imperfect solution in any case.

tapset/bpf/logging.stp

index d13b43151dfbe27c716857005483d79c3501c35b..dd5506cbd4afefb8fcac4e1eb1db1d7720aadf9e 100644 (file)
@@ -22,9 +22,13 @@ function exit () { /* unprivileged */ /* bpf */
 
 %(systemtap_v >= "4.0" %?
 function abort () { /* unprivileged */ /* bpf */
-  printf("ERROR: abort() not supported in eBPF backend\n")
-  exit()
-  /* TODO PR27820: need to abort the execution flow immediately -- consider using terminate statement */
+  // TODO PR27820: There may be a delay between setting exit status
+  // and stapbpf.cxx disabling the probes. This could be solved
+  // at the cost of setting a global var and adding a check to the
+  // start of every probe.
+  _set_exit_status()
+  _send_exit_msg()
+  _terminate()
 }
 %)
 
This page took 0.028019 seconds and 5 git commands to generate.