Skip to content

Commit

Permalink
chore: remove pritn code (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
takehaya authored Oct 4, 2024
1 parent 4d00f19 commit 376d781
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions lib/Sys/Ebpf/Loader.pm
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,6 @@ sub load_bpf_program {
warn "Log buffer content:\n", $attrs->{log_buf}, "\n";
die "BPF program load failed: $!\n";
}
print "BPF program loaded successfully with FD: $fd\n";

return $fd;
}

Expand Down Expand Up @@ -259,15 +257,11 @@ sub apply_map_relocations {
}
if ( defined $map_fd ) {

# # 指定されたオフセット位置にある `lddw` 命令(16バイト)を取得
# 指定されたオフセット位置にある `lddw` 命令(16バイト)を取得
my $bpf_insn
= substr( $self->{reader}->{raw_elf_data}, $r_offset, 16 )
; # 16バイトを取得
my $bpf_insn_len = length($bpf_insn);
print "Before relocation (offset $r_offset): "
. unpack( 'H*', $bpf_insn )
. "\n"; # デバッグ出力

my ( $high, $low )
= Sys::Ebpf::Asm::deserialize_128bit_instruction($bpf_insn);

Expand All @@ -287,12 +281,6 @@ sub apply_map_relocations {
# 書き換えた後の命令を出力
my $after_bpf_insn
= substr( $self->{reader}->{raw_elf_data}, $r_offset, 16 );
print "After relocation (offset $r_offset): "
. unpack( 'H*', $after_bpf_insn )
. "\n"; # デバッグ出力
}
else {
print "No matching map found for symbol: $sym_name\n";
}
}
}
Expand Down Expand Up @@ -322,7 +310,6 @@ sub load_bpf {
}

# リロケーションを適用
print ".rel" . $section_name . "\n";
my $reloc_section = $bpfelf->{relocations}{ ".rel" . $section_name };
my $prob_section
= find_symbol_table_from_name( $bpfelf->{sections}, $section_name );
Expand Down

0 comments on commit 376d781

Please sign in to comment.