Improve BPF Loader reporting (#9202)

automerge
This commit is contained in:
Jack May 2020-03-31 18:18:44 -07:00 committed by GitHub
parent a61ddb6f61
commit 1e6b789bfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -185,17 +185,17 @@ pub fn process_instruction(
} }
}; };
info!("Call BPF program"); info!("Call BPF program {}", program.unsigned_key());
match vm.execute_program(parameter_bytes.as_slice(), &[], &[heap_region]) { match vm.execute_program(parameter_bytes.as_slice(), &[], &[heap_region]) {
Ok(status) => { Ok(status) => {
if status != SUCCESS { if status != SUCCESS {
let error: InstructionError = status.into(); let error: InstructionError = status.into();
warn!("BPF program failed: {}", error); warn!("BPF program {} failed: {}", program.unsigned_key(), error);
return Err(error); return Err(error);
} }
} }
Err(error) => { Err(error) => {
warn!("BPF program failed: {}", error); warn!("BPF program {} failed: {}", program.unsigned_key(), error);
return match error { return match error {
EbpfError::UserError(BPFError::HelperError( EbpfError::UserError(BPFError::HelperError(
HelperError::InstructionError(error), HelperError::InstructionError(error),
@ -206,7 +206,7 @@ pub fn process_instruction(
} }
} }
deserialize_parameters(parameter_accounts, &parameter_bytes)?; deserialize_parameters(parameter_accounts, &parameter_bytes)?;
info!("BPF program success"); info!("BPF program {} success", program.unsigned_key());
} else if !keyed_accounts.is_empty() { } else if !keyed_accounts.is_empty() {
match limited_deserialize(instruction_data)? { match limited_deserialize(instruction_data)? {
LoaderInstruction::Write { offset, bytes } => { LoaderInstruction::Write { offset, bytes } => {