From: falcovorbis <fal...@us...> - 2024-10-11 21:16:48
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via e883288299e92adb04a6ce21d2d9f7ec5e6f0d8d (commit) from ee2324f6fc2a1de27033539bd088913d869df4a3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit e883288299e92adb04a6ce21d2d9f7ec5e6f0d8d Author: Paul Cercueil <pa...@cr...> Date: Fri Oct 11 23:16:29 2024 +0200 perf_monitor: Improve perf_monitor_print() (#813) - Don't print anything if no perf monitor is present; - Print the monitors in reverse order, as the first ones in the .monitors section correspond to the last ones in a C file; - Print the line number after the function name, so that it is easy to differenciate perf monitors used within a single function. Signed-off-by: Paul Cercueil <pa...@cr...> ----------------------------------------------------------------------- Summary of changes: kernel/arch/dreamcast/kernel/perf_monitor.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/kernel/arch/dreamcast/kernel/perf_monitor.c b/kernel/arch/dreamcast/kernel/perf_monitor.c index bb596078..765a4a06 100644 --- a/kernel/arch/dreamcast/kernel/perf_monitor.c +++ b/kernel/arch/dreamcast/kernel/perf_monitor.c @@ -49,11 +49,12 @@ void perf_monitor_exit(void) { void perf_monitor_print(FILE *f) { struct perf_monitor *monitor; - fprintf(f, "Performance monitors:\n"); + if((uintptr_t)&_monitors_end != (uintptr_t)&_monitors_start) + fprintf(f, "Performance monitors:\n"); - for (monitor = &_monitors_start; monitor < &_monitors_end; monitor++) { - fprintf(f, "\t%s: %llu calls\n\t\t%llu ns (%f ns/call)\n\t\tevent 0: %llu (%f event/call)\n\t\tevent 1: %llu (%f event/call)\n", - monitor->fn, monitor->calls, monitor->time_ns, + for(monitor = &_monitors_end - 1; monitor >= &_monitors_start; monitor--) { + fprintf(f, "\t%s L%u: %llu calls\n\t\t%llu ns (%f ns/call)\n\t\tevent 0: %llu (%f event/call)\n\t\tevent 1: %llu (%f event/call)\n", + monitor->fn, monitor->line, monitor->calls, monitor->time_ns, monitor->calls ? (float)monitor->time_ns / (float)monitor->calls : 0.0f, monitor->event0, monitor->event0 ? (float)monitor->event0 / (float)monitor->calls : 0.0f, hooks/post-receive -- A pseudo Operating System for the Dreamcast. |