scx_layered: Remove LoadLedger from stats

Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>
This commit is contained in:
Daniel Hodges 2024-10-02 05:47:05 -07:00
parent 2518c99bf2
commit e48e675cff
2 changed files with 3 additions and 7 deletions

View File

@ -1886,12 +1886,10 @@ impl<'a, 'b> Scheduler<'a, 'b> {
cpus_ranges: &mut Vec<(usize, usize)>,
) -> Result<SysStats> {
let bstats = &stats.bpf_stats;
let load_ledger = load_agg.calculate();
let mut sys_stats = SysStats::new(stats, bstats, &load_ledger, self.cpu_pool.fallback_cpu)?;
let mut sys_stats = SysStats::new(stats, bstats, self.cpu_pool.fallback_cpu)?;
for (lidx, (spec, layer)) in self.layer_specs.iter().zip(self.layers.iter()).enumerate() {
let layer_stats = LayerStats::new(lidx, layer, &load_ledger, stats, bstats, cpus_ranges[lidx]);
let layer_stats = LayerStats::new(lidx, layer, stats, bstats, cpus_ranges[lidx]);
sys_stats.layers.insert(spec.name.to_string(), layer_stats);
cpus_ranges[lidx] = (layer.nr_cpus, layer.nr_cpus);
}

View File

@ -18,7 +18,6 @@ use log::warn;
use scx_stats::prelude::*;
use scx_stats_derive::stat_doc;
use scx_stats_derive::Stats;
use scx_utils::LoadLedger;
use serde::Deserialize;
use serde::Serialize;
@ -152,7 +151,6 @@ impl LayerStats {
pub fn new(
lidx: usize,
layer: &Layer,
load_ledger: &LoadLedger,
stats: &Stats,
bstats: &BpfStats,
nr_cpus_range: (usize, usize),
@ -380,7 +378,7 @@ pub struct SysStats {
}
impl SysStats {
pub fn new(stats: &Stats, bstats: &BpfStats, load_ledger: &LoadLedger, fallback_cpu: usize) -> Result<Self> {
pub fn new(stats: &Stats, bstats: &BpfStats, fallback_cpu: usize) -> Result<Self> {
let lsum = |idx| stats.bpf_stats.lstats_sums[idx as usize];
let total = lsum(bpf_intf::layer_stat_idx_LSTAT_SEL_LOCAL)
+ lsum(bpf_intf::layer_stat_idx_LSTAT_ENQ_WAKEUP)