Skip to content

Commit

Permalink
explicit warning when source won't be saved (iovisor#2267)
Browse files Browse the repository at this point in the history
explicit warning when source won't be saved
  • Loading branch information
teroz authored and yonghong-song committed Mar 12, 2019
1 parent ba41501 commit ef14cfb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cc/api/BPF.cc
Original file line number Diff line number Diff line change
Expand Up @@ -560,8 +560,10 @@ StatusTuple BPF::load_func(const std::string& func_name, bpf_prog_type type,
if (fd < 0)
return StatusTuple(-1, "Failed to load %s: %d", func_name.c_str(), fd);

bpf_module_->annotate_prog_tag(
int ret = bpf_module_->annotate_prog_tag(
func_name, fd, reinterpret_cast<struct bpf_insn*>(func_start), func_size);
if (ret < 0)
fprintf(stderr, "WARNING: cannot get prog tag, ignore saving source with program tag\n");
funcs_[func_name] = fd;
return StatusTuple(0);
}
Expand Down

0 comments on commit ef14cfb

Please sign in to comment.