* move `ExecuteTimings` from `runtime::bank` to `program_runtime::timings` (cherry picked from commit7d32909e17
) # Conflicts: # core/Cargo.toml # ledger/Cargo.toml # programs/bpf/Cargo.lock * Add execute metrics (cherry picked from commitb25e4a200b
) * Add metrics for executor creation (cherry picked from commit848b6dfbdd
) * Add helper macro for `AddAssign`ing with saturating arithmetic (cherry picked from commitdeb9344e49
) * Use saturating_add_assign macro (cherry picked from commit72fc6096a0
) * Consolidate process instruction execution timings to own struct (cherry picked from commit390ef0fbcd
) Co-authored-by: Trent Nelson <trent@solana.com> Co-authored-by: Carl Lin <carl@solana.com>
This commit is contained in:
@ -19,12 +19,10 @@ use {
|
||||
perf_libs,
|
||||
},
|
||||
solana_poh::poh_recorder::{BankStart, PohRecorder, PohRecorderError, TransactionRecorder},
|
||||
solana_program_runtime::timings::ExecuteTimings,
|
||||
solana_runtime::{
|
||||
accounts_db::ErrorCounters,
|
||||
bank::{
|
||||
Bank, ExecuteTimings, TransactionBalancesSet, TransactionCheckResult,
|
||||
TransactionExecutionResult,
|
||||
},
|
||||
bank::{Bank, TransactionBalancesSet, TransactionCheckResult, TransactionExecutionResult},
|
||||
bank_utils,
|
||||
cost_model::CostModel,
|
||||
transaction_batch::TransactionBatch,
|
||||
|
@ -6,10 +6,8 @@
|
||||
use {
|
||||
solana_ledger::blockstore::Blockstore,
|
||||
solana_measure::measure::Measure,
|
||||
solana_runtime::{
|
||||
bank::{Bank, ExecuteTimings},
|
||||
cost_model::CostModel,
|
||||
},
|
||||
solana_program_runtime::timings::ExecuteTimings,
|
||||
solana_runtime::{bank::Bank, cost_model::CostModel},
|
||||
solana_sdk::timing::timestamp,
|
||||
std::{
|
||||
sync::{
|
||||
@ -71,8 +69,12 @@ impl CostUpdateServiceTiming {
|
||||
}
|
||||
|
||||
pub enum CostUpdate {
|
||||
FrozenBank { bank: Arc<Bank> },
|
||||
ExecuteTiming { execute_timings: ExecuteTimings },
|
||||
FrozenBank {
|
||||
bank: Arc<Bank>,
|
||||
},
|
||||
ExecuteTiming {
|
||||
execute_timings: Box<ExecuteTimings>,
|
||||
},
|
||||
}
|
||||
|
||||
pub type CostUpdateReceiver = Receiver<CostUpdate>;
|
||||
|
@ -81,45 +81,133 @@ impl ReplaySlotStats {
|
||||
i64
|
||||
),
|
||||
(
|
||||
"serialize_us",
|
||||
"execute_details_serialize_us",
|
||||
self.execute_timings.details.serialize_us,
|
||||
i64
|
||||
),
|
||||
(
|
||||
"create_vm_us",
|
||||
"execute_details_create_vm_us",
|
||||
self.execute_timings.details.create_vm_us,
|
||||
i64
|
||||
),
|
||||
(
|
||||
"execute_inner_us",
|
||||
"execute_details_execute_inner_us",
|
||||
self.execute_timings.details.execute_us,
|
||||
i64
|
||||
),
|
||||
(
|
||||
"deserialize_us",
|
||||
"execute_details_deserialize_us",
|
||||
self.execute_timings.details.deserialize_us,
|
||||
i64
|
||||
),
|
||||
(
|
||||
"changed_account_count",
|
||||
"execute_details_get_or_create_executor_us",
|
||||
self.execute_timings.details.get_or_create_executor_us,
|
||||
i64
|
||||
),
|
||||
(
|
||||
"execute_details_changed_account_count",
|
||||
self.execute_timings.details.changed_account_count,
|
||||
i64
|
||||
),
|
||||
(
|
||||
"total_account_count",
|
||||
"execute_details_total_account_count",
|
||||
self.execute_timings.details.total_account_count,
|
||||
i64
|
||||
),
|
||||
(
|
||||
"total_data_size",
|
||||
"execute_details_total_data_size",
|
||||
self.execute_timings.details.total_data_size,
|
||||
i64
|
||||
),
|
||||
(
|
||||
"data_size_changed",
|
||||
"execute_details_data_size_changed",
|
||||
self.execute_timings.details.data_size_changed,
|
||||
i64
|
||||
),
|
||||
(
|
||||
"execute_details_create_executor_register_syscalls_us",
|
||||
self.execute_timings
|
||||
.details
|
||||
.create_executor_register_syscalls_us,
|
||||
i64
|
||||
),
|
||||
(
|
||||
"execute_details_create_executor_load_elf_us",
|
||||
self.execute_timings.details.create_executor_load_elf_us,
|
||||
i64
|
||||
),
|
||||
(
|
||||
"execute_details_create_executor_verify_code_us",
|
||||
self.execute_timings.details.create_executor_verify_code_us,
|
||||
i64
|
||||
),
|
||||
(
|
||||
"execute_details_create_executor_jit_compile_us",
|
||||
self.execute_timings.details.create_executor_jit_compile_us,
|
||||
i64
|
||||
),
|
||||
(
|
||||
"execute_accessories_feature_set_clone_us",
|
||||
self.execute_timings
|
||||
.execute_accessories
|
||||
.feature_set_clone_us,
|
||||
i64
|
||||
),
|
||||
(
|
||||
"execute_accessories_compute_budget_process_transaction_us",
|
||||
self.execute_timings
|
||||
.execute_accessories
|
||||
.compute_budget_process_transaction_us,
|
||||
i64
|
||||
),
|
||||
(
|
||||
"execute_accessories_get_executors_us",
|
||||
self.execute_timings.execute_accessories.get_executors_us,
|
||||
i64
|
||||
),
|
||||
(
|
||||
"execute_accessories_process_message_us",
|
||||
self.execute_timings.execute_accessories.process_message_us,
|
||||
i64
|
||||
),
|
||||
(
|
||||
"execute_accessories_update_executors_us",
|
||||
self.execute_timings.execute_accessories.update_executors_us,
|
||||
i64
|
||||
),
|
||||
(
|
||||
"execute_accessories_process_instructions_total_us",
|
||||
self.execute_timings
|
||||
.execute_accessories
|
||||
.process_instructions
|
||||
.total_us,
|
||||
i64
|
||||
),
|
||||
(
|
||||
"execute_accessories_process_instructions_verify_caller_us",
|
||||
self.execute_timings
|
||||
.execute_accessories
|
||||
.process_instructions
|
||||
.verify_caller_us,
|
||||
i64
|
||||
),
|
||||
(
|
||||
"execute_accessories_process_instructions_process_executable_chain_us",
|
||||
self.execute_timings
|
||||
.execute_accessories
|
||||
.process_instructions
|
||||
.process_executable_chain_us,
|
||||
i64
|
||||
),
|
||||
(
|
||||
"execute_accessories_process_instructions_verify_callee_us",
|
||||
self.execute_timings
|
||||
.execute_accessories
|
||||
.process_instructions
|
||||
.verify_callee_us,
|
||||
i64
|
||||
),
|
||||
);
|
||||
|
||||
let mut per_pubkey_timings: Vec<_> = self
|
||||
|
@ -39,13 +39,14 @@ use {
|
||||
solana_measure::measure::Measure,
|
||||
solana_metrics::inc_new_counter_info,
|
||||
solana_poh::poh_recorder::{PohRecorder, GRACE_TICKS_FACTOR, MAX_GRACE_SLOTS},
|
||||
solana_program_runtime::timings::ExecuteTimings,
|
||||
solana_rpc::{
|
||||
optimistically_confirmed_bank_tracker::{BankNotification, BankNotificationSender},
|
||||
rpc_subscriptions::RpcSubscriptions,
|
||||
},
|
||||
solana_runtime::{
|
||||
accounts_background_service::AbsRequestSender,
|
||||
bank::{Bank, ExecuteTimings, NewBankOptions},
|
||||
bank::{Bank, NewBankOptions},
|
||||
bank_forks::BankForks,
|
||||
commitment::BlockCommitmentCache,
|
||||
vote_sender_types::ReplayVoteSender,
|
||||
@ -2170,7 +2171,9 @@ impl ReplayStage {
|
||||
// send accumulated excute-timings to cost_update_service
|
||||
if !execute_timings.details.per_program_timings.is_empty() {
|
||||
cost_update_sender
|
||||
.send(CostUpdate::ExecuteTiming { execute_timings })
|
||||
.send(CostUpdate::ExecuteTiming {
|
||||
execute_timings: Box::new(execute_timings),
|
||||
})
|
||||
.unwrap_or_else(|err| warn!("cost_update_sender failed: {:?}", err));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user