From adffcc6773ad34d46a75f2083a8daa9eba9745d8 Mon Sep 17 00:00:00 2001 From: Corwin Date: Tue, 22 Mar 2022 22:08:59 +0000 Subject: [PATCH] add comment on profiler --- agb/src/interrupt.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/agb/src/interrupt.rs b/agb/src/interrupt.rs index 7ca8bdb7..111e777f 100644 --- a/agb/src/interrupt.rs +++ b/agb/src/interrupt.rs @@ -362,6 +362,14 @@ mod tests { } #[must_use] +/// The behaviour of this function is undefined in the sense that it will output +/// some information in some way that can be interpreted in a way to give some +/// profiling information. What it outputs, how it outputs it, and how to +/// interpret it are all subject to change at any time. +/// +/// With that out of the way, the current version will, in mgba, output the +/// program counter at regular intervals. This can be used to see hot functions +/// using, for example, addr2line. pub fn profiler(timer: &mut crate::timer::Timer, period: u16) -> InterruptHandler { timer.set_interrupt(true); timer.set_overflow_amount(period);