Commit 82049fe6 authored by Brendan Gregg's avatar Brendan Gregg Committed by GitHub

Merge pull request #89 from iovisor/bytecode

print BPF bytecode for debugging
parents 3ef877b8 7e7e13d6
...@@ -244,6 +244,9 @@ void AttachedProbe::load_prog() ...@@ -244,6 +244,9 @@ void AttachedProbe::load_prog()
close(new_stderr); close(new_stderr);
} }
if (bt_verbose)
log_level = 1;
// bpf_prog_load rejects colons in the probe name // bpf_prog_load rejects colons in the probe name
strncpy(name, probe_.name.c_str(), STRING_SIZE); strncpy(name, probe_.name.c_str(), STRING_SIZE);
namep = name; namep = name;
...@@ -271,6 +274,10 @@ void AttachedProbe::load_prog() ...@@ -271,6 +274,10 @@ void AttachedProbe::load_prog()
if (bt_verbose) if (bt_verbose)
std::cerr << std::endl << "Error log: " << std::endl << log_buf << std::endl; std::cerr << std::endl << "Error log: " << std::endl << log_buf << std::endl;
throw std::runtime_error("Error loading program: " + probe_.name + (bt_verbose ? "" : " (try -v)")); throw std::runtime_error("Error loading program: " + probe_.name + (bt_verbose ? "" : " (try -v)"));
} else {
if (bt_verbose) {
std::cout << std::endl << "Bytecode: " << std::endl << log_buf << std::endl;
}
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment