Skip to content

Commit

Permalink
Merge pull request #22 from Alan-Jowett/lpm_improvements
Browse files Browse the repository at this point in the history
Include PDBs for .sys
  • Loading branch information
Alan-Jowett authored Jan 31, 2024
2 parents 4892929 + ba64986 commit 07efe43
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
11 changes: 11 additions & 0 deletions bpf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,19 @@ function(convert_to_native file_name out_name option)
COMMENT "Copying BPF object ${bpf_sys_file_path} to output directory"
POST_BUILD)

# Copy the .pdb file to the output directory as part of post build
add_custom_command(
OUTPUT ${bpf_pdb_file_output_path}
COMMAND ${CMAKE_COMMAND} -E copy ${bpf_pdb_file_path} ${bpf_pdb_file_output_path}
DEPENDS ${bpf_pdb_file_path}
COMMENT "Copying BPF object ${bpf_pdb_file_path} to output directory"
POST_BUILD)

# Add a custom target that depends on the .sys file
add_custom_target(${bpf_sys_file_name}_out ALL DEPENDS ${bpf_sys_file_output_path} SOURCES ${bpf_sys_file_path})

# Add a custom target that depends on the .pdb file
add_custom_target(${bpf_pdb_file_name}_out ALL DEPENDS ${bpf_pdb_file_output_path} SOURCES ${bpf_pdb_file_path})
endfunction()

configure_file(
Expand Down
4 changes: 0 additions & 4 deletions bpf/lpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ SEC("sockops/update") int update(void* ctx)
ipv4_route route_key = {32, 0};

if (!test_route) {

bpf_printk("Failed to lookup route %d\n", key);
return 1;
}
route_key = *test_route;
Expand All @@ -149,8 +147,6 @@ SEC("sockops/replace") int replace(void* ctx)
ipv4_route route_key = {32, 0};

if (!test_route) {

bpf_printk("Failed to lookup route %d\n", key);
return 1;
}
route_key = *test_route;
Expand Down

0 comments on commit 07efe43

Please sign in to comment.