[DTrace-devel] [PATCH 3/4] bpf: improve parsing bpf_helper_defs.h

Elena Zannoni elena.zannoni at oracle.com
Sat May 25 02:10:04 UTC 2024


Thanks Kris!

Reviewed-by: Elena Zannoni <elena.zannoni at oracle.com> 


On 5/24/24 17:57, Kris Van Hees wrote:
> The parsing of bpf_helper_defs.h to get names of BPF helpers and their
> associated values needed tweaking.
> 
> Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
> ---
>  include/mkHelpers | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/include/mkHelpers b/include/mkHelpers
> index dc5e62c8..96d5ea53 100755
> --- a/include/mkHelpers
> +++ b/include/mkHelpers
> @@ -8,8 +8,9 @@ BEGIN {
>  }
>  
>  $1 == "static" && /=/ && /[ \t]+[1-9][0-9]*[ \t]*;/ {
> -	if (match($0, /[ \t\*]bpf_[_A-Za-z0-9]+/) > 0) {
> -		fn = substr($0, RSTART + 5, RLENGTH - 5);
> +	if (match($0, /[ \t\*]bpf_[_A-Za-z0-9]+[ \t]*\)/) > 0) {
> +		fn = substr($0, RSTART + 5, RLENGTH - 6);
> +		sub(/[ \t]+/, "", fn);
>  
>  		match($0, /[ \t]+[1-9][0-9]*[ \t]*;/);
>  		id = substr($0, RSTART, RLENGTH - 1);




More information about the DTrace-devel mailing list