Linux DTrace development list
 help / color / mirror / Atom feed
* [PATCH] bpf: be less picky about the content of bpf_helper_defs.h
@ 2024-05-06 19:05 Kris Van Hees
  2024-05-06 19:10 ` Nick Alcock
  2024-05-06 19:43 ` Eugene Loh
  0 siblings, 2 replies; 4+ messages in thread
From: Kris Van Hees @ 2024-05-06 19:05 UTC (permalink / raw)
  To: dtrace, dtrace-devel

There are small differences in the format of the BPF helper definitions
in bpf_helper_defs.h in libbpf headers.  This patch allows mkHelpers to
be more accepting of these differences.

Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
---
 include/mkHelpers | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/include/mkHelpers b/include/mkHelpers
index 1a7537ca..dc5e62c8 100755
--- a/include/mkHelpers
+++ b/include/mkHelpers
@@ -8,14 +8,15 @@ BEGIN {
 }
 
 $1 == "static" && /=/ && /[ \t]+[1-9][0-9]*[ \t]*;/ {
-	match($0, /[ \t]+[1-9][0-9]*[ \t]*;/);
-	id = substr($0, RSTART, RLENGTH - 1);
-	gsub(/[ \t]+/,"", id);
-	match($0, /\([ \t]*\*[ \t]*bpf_[_A-Za-z0-9]+/);
-	fn = substr($0, RSTART + 1, RLENGTH - 1);
-	sub(/[ \t]*\*[ \t]*bpf_/, "", fn);
+	if (match($0, /[ \t\*]bpf_[_A-Za-z0-9]+/) > 0) {
+		fn = substr($0, RSTART + 5, RLENGTH - 5);
 
-	print "#define BPF_FUNC_"fn " " id;
+		match($0, /[ \t]+[1-9][0-9]*[ \t]*;/);
+		id = substr($0, RSTART, RLENGTH - 1);
+		gsub(/[ \t]+/,"", id);
+
+		print "#define BPF_FUNC_"fn " " id;
+	}
 }
 
 END {
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-05-06 20:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-06 19:05 [PATCH] bpf: be less picky about the content of bpf_helper_defs.h Kris Van Hees
2024-05-06 19:10 ` Nick Alcock
2024-05-06 19:43 ` Eugene Loh
2024-05-06 20:33   ` Kris Van Hees

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox