Skip to content

Commit 986cae0

Browse files
committed
tracing: copy loader using a standard Makefile target
Use the XDP_LOADER makefile variable to copy the xdp_loader program to the tracing01-xdp-simple and tracing03-xdp-debug-print assignments. The previous version used the ../basic02-prog-by-name/xdp_loader path which may not exist. Using the XDP_LOADER variable builds the xdp_loader automatically. Signed-off-by: Anton Protopopov <a.s.protopopov@gmail.com>
1 parent 940eda5 commit 986cae0

4 files changed

Lines changed: 6 additions & 2 deletions

File tree

tracing01-xdp-simple/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
XDP_TARGETS := trace_prog_kern xdp_prog_kern
55
USER_TARGETS := trace_load_and_stats
66

7+
COPY_LOADER = xdp_loader
8+
79
LIBBPF_DIR = ../libbpf/src/
810
COMMON_DIR = ../common/
911

tracing01-xdp-simple/README.org

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ $ sudo ../testenv/testenv.sh setup --name veth-basic02
171171
Load the XDP program, tak produces aborted packets:
172172

173173
#+begin_example sh
174-
$ sudo ../basic02-prog-by-name/xdp_loader --dev veth-basic02 --force --progsec xdp_abort
174+
$ sudo ./xdp_loader --dev veth-basic02 --force --progsec xdp_abort
175175
#+end_example
176176

177177
and make some packets:

tracing03-xdp-debug-print/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
XDP_TARGETS := xdp_prog_kern
44
USER_TARGETS := trace_read
55

6+
COPY_LOADER = xdp_loader
7+
68
LLC ?= llc
79
CLANG ?= clang
810
CC := gcc

tracing03-xdp-debug-print/README.org

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Load XDP program from xdp_prog_kern.o that will print
9090
ethertnet header on every incoming packet:
9191

9292
#+begin_example sh
93-
$ sudo ../basic02-prog-by-name/xdp_loader --dev veth-basic02 --force --progsec xdp
93+
$ sudo ./xdp_loader --dev veth-basic02 --force --progsec xdp
9494
#+end_example
9595

9696
and make some packets:

0 commit comments

Comments
 (0)