You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this commit implements a custom signal handling probe
which will be triggered when the specified signal is
sent to the bpftrace process. the default behavior of
printing maps on `SIGUSR1` is removed.
```
bpftrace:signal:SIGUSR1 {
print("hello");
}
```
Also trigger functions and extra checks for the special probes
are removed as BPF_PROG_TYPE_RAW_TRACEPOINT was added in 4.17 kernel:
torvalds/linux@a0fe3e5
The oldest LTS kernel still in service is 4.19, so we are free
to assume BPF_PROG_TYPE_RAW_TRACEPOINT is always available
Copy file name to clipboardExpand all lines: man/adoc/bpftrace.adoc
+21-7Lines changed: 21 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2874,6 +2874,11 @@ Most providers also support a short name which can be used instead of the full n
2874
2874
| Built-in events
2875
2875
| Kernel/User
2876
2876
2877
+
| <<probes-self, `self`>>
2878
+
| -
2879
+
| Built-in events
2880
+
| Kernel/User
2881
+
2877
2882
| <<probes-hardware, `hardware`>>
2878
2883
| `h`
2879
2884
| Processor-level events
@@ -2952,6 +2957,22 @@ END {
2952
2957
}
2953
2958
----
2954
2959
2960
+
[#probes-self]
2961
+
=== self
2962
+
2963
+
.variants
2964
+
* `self:signal:SIGUSR1`
2965
+
2966
+
These are special built-in events provided by the bpftrace runtime.
2967
+
The trigger function is called by the bpftrace runtime when the bpftrace process receives specific events, such as a `SIGUSR1` signal.
2968
+
When multiple signal handlers are attached to the same signal, only the first one is used.
2969
+
2970
+
----
2971
+
self:signal:SIGUSR1 {
2972
+
print("abc");
2973
+
}
2974
+
----
2975
+
2955
2976
[#probes-hardware]
2956
2977
=== hardware
2957
2978
@@ -4087,13 +4108,6 @@ will print this on exit:
4087
4108
@a: 0
4088
4109
```
4089
4110
4090
-
If you want to get a snapshot of your maps while the script is running, you can send the running bpftrace process a `SIGUSR1` signal. bpftrace will then print all maps to stdout. Example:
0 commit comments