diff options
| author | Lizzy Fleckenstein <lizzy@vlhl.dev> | 2026-04-02 02:30:53 +0200 |
|---|---|---|
| committer | Lizzy Fleckenstein <lizzy@vlhl.dev> | 2026-04-02 02:30:53 +0200 |
| commit | 27379f3940435397c9dae361a58d38c2e7adc0d4 (patch) | |
| tree | 84955af314067651c505e7fc9e8fd9200c9fde05 | |
| parent | 35da79157320d5524f16cfce7f8fd72d81d79a9c (diff) | |
| download | burstdog-27379f3940435397c9dae361a58d38c2e7adc0d4.tar.xz | |
tweak burst detection for multicore systems
| -rw-r--r-- | burstdog.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -14,8 +14,8 @@ // settings #define BURSTDOG_IV 10 // how often to wake up, per second -#define BURSTDOG_BURST 98 // cpu time percentage considered a burst -#define BURSTDOG_BURST_END 90 // cpu time percentage considered the end of a burst +#define BURSTDOG_BURST 120 // cpu time percentage considered a burst +#define BURSTDOG_BURST_END 100 // cpu time percentage considered the end of a burst #define BURSTDOG_SAMPLES 5 // how many samples a burst needs to persist for to be logged #define BURSTDOG_USE_TOTAL 1 // 0: consider processes individually 1: consider total cpu usage and log top processes #define BURSTDOG_CULPRITS 5 // for BURSTDOG_USE_TOTAL: how many processes are logged on burst @@ -279,12 +279,12 @@ int main(int argc, char **argv) uint64_t total = cpu_stats[0].total - cpu_stats[BURSTDOG_SAMPLES-1].total; uint64_t busy = cpu_stats[0].busy - cpu_stats[BURSTDOG_SAMPLES-1].busy; uint64_t share = nproc * busy * 100 / total; - uint64_t level = 2*share/BURSTDOG_BURST; bool do_log = false; - if (bursting && share < BURSTDOG_BURST_END) { + if (share < BURSTDOG_BURST_END) { bursting = 0; } else if (share >= BURSTDOG_BURST) { + uint64_t level = (share-BURSTDOG_BURST)/50+1; if (level > bursting) do_log = true; bursting = level; |
