~ chicken-core (chicken-5) 9663b2ea0eee0fc95c1f16d9491c1adab762498a
commit 9663b2ea0eee0fc95c1f16d9491c1adab762498a Author: felix <felix@call-with-current-continuation.org> AuthorDate: Wed Jul 6 08:19:59 2011 +0200 Commit: felix <felix@call-with-current-continuation.org> CommitDate: Wed Jul 6 08:19:59 2011 +0200 fixed percentage calculation in chicken-profile (thanks to megane) diff --git a/chicken-profile.scm b/chicken-profile.scm index ea906637..e5f65c1b 100644 --- a/chicken-profile.scm +++ b/chicken-profile.scm @@ -184,26 +184,30 @@ EOF (print "reading `" file "' ...\n") (let* ([data0 (with-input-from-file file read-profile)] [max-t (fold (lambda (t result) - (max (third t) result)) + (+ (third t) result)) 0 data0)] [data (sort (map - (lambda (t) (append t (let ((c (second t)) - (t (third t))) - (list (or (and c (> c 0) (/ t c)) - 0) - (or (and (> max-t 0) (* (/ t max-t) 100)) - 0) - )))) + (lambda (t) + (append + t + (let ((c (second t)) + (t (third t))) + (list (or (and c (> c 0) (/ t c)) + 0) + (or (and (> max-t 0) (* (/ t max-t) 100)) + 0) + )))) data0) sort-by)]) (if (< 0 top (length data)) (set! data (take data top))) (set! data (map (lambda (entry) + (pp entry) (let ([c (second entry)] [t (third entry)] - [a (cadddr entry)] - [p (list-ref entry 4)] ) + [a (fourth entry)] + [p (fifth entry)] ) (list (##sys#symbol->qualified-string (first entry)) (if (not c) "overflow" (number->string c)) (format-real (/ t 1000) seconds-digits) diff --git a/manual/Acknowledgements b/manual/Acknowledgements index 06755d3f..8c79cf48 100644 --- a/manual/Acknowledgements +++ b/manual/Acknowledgements @@ -27,18 +27,18 @@ Peter Keller, Brad Kind, Ron Kneusel, Matthias Koeppe, Krysztof Kowalczyk, Andre Kuehne, Todd R. Kueny Sr, Goran Krampe, David Krentzlin, Ben Kurtz, Micky Latowicki, John Lenz, Kirill Lisovsky, Juergen Lorenz, Kon Lovett, Lam Luu, Vitaly Magerya, Leonardo Valeri -Manera, Dennis Marti, Charles Martin, Bob McIsaac, Alain Mellan, Eric -Merrit, Perry Metzger, Scott G. Miller, Mikael, Karel Miklav, Bruce -Mitchener, Fadi Moukayed, Chris Moline, Eric E. Moore, Julian -Morrison, Dan Muresan, David N. Murray, "nicktick", Lars Nilsson, Ian -Oversby, "o.t.", Gene Pavlovsky, Levi Pearson, Jeronimo Pellegrini, -Nicolas Pelletier, Derrell Piper, Carlos Pita, Robin Lee Powell, Alan -Post, "Pupeno", Davide Puricelli, "presto", Doug Quale, Imran Rafique, -Eric Raible, Ivan Raikov, Santosh Rajan, Joel Reymont, Chris Roberts, -Eric Rochester, Paul Romanchenko, Andreas Rottman, David Rush, Lars -Rustemeier, Daniel Sadilek, Otavio Salvador, Burton Samograd, -"Sandro", Aleksej Saushev, Oskar Schirmer, Reed Sheridan, Ronald -Schroeder, Spencer Schumann, Ivan Shcheklein, Alex Shinn, Ivan +Manera, Dennis Marti, Charles Martin, Bob McIsaac, "megane", Alain +Mellan, Eric Merrit, Perry Metzger, Scott G. Miller, Mikael, Karel +Miklav, Bruce Mitchener, Fadi Moukayed, Chris Moline, Eric E. Moore, +Julian Morrison, Dan Muresan, David N. Murray, "nicktick", Lars +Nilsson, Ian Oversby, "o.t.", Gene Pavlovsky, Levi Pearson, Jeronimo +Pellegrini, Nicolas Pelletier, Derrell Piper, Carlos Pita, Robin Lee +Powell, Alan Post, "Pupeno", Davide Puricelli, "presto", Doug Quale, +Imran Rafique, Eric Raible, Ivan Raikov, Santosh Rajan, Joel Reymont, +Chris Roberts, Eric Rochester, Paul Romanchenko, Andreas Rottman, +David Rush, Lars Rustemeier, Daniel Sadilek, Otavio Salvador, Burton +Samograd, "Sandro", Aleksej Saushev, Oskar Schirmer, Reed Sheridan, +Ronald Schroeder, Spencer Schumann, Ivan Shcheklein, Alex Shinn, Ivan Shmakov, "Shmul", Tony Sidaway, Jeffrey B. Siegal, Andrey Sidorenko, Michele Simionato, Iruata Souza, Volker Stolz, Jon Strait, Dorai Sitaram, Robert Skeels, Jason Songhurst, Clifford Stein, David diff --git a/manual/Using the compiler b/manual/Using the compiler index 28f2373e..8949e9df 100644 --- a/manual/Using the compiler +++ b/manual/Using the compiler @@ -166,7 +166,7 @@ the source text should be read from standard input. ; -prelude EXPRESSIONS : Add {{EXPRESSIONS}} before all other toplevel expressions in the compiled file. This option may be given multiple times. Processing of this option takes place before processing of {{-prologue}}. ; -profile : -; -accumulate-profile : Instruments the source code to count procedure calls and execution times. After the program terminates (either via an explicit {{exit}} or implicitly), profiling statistics are written to a file named {{PROFILE.<randomnumber>}}. Each line of the generated file contains a list with the procedure name, the number of calls and the time spent executing it. Use the {{chicken-profile}} program to display the profiling information in a more user-friendly form. Enter {{chicken-profile}} with no arguments at the command line to get a list of available options. The {{-accumulate-profile}} option is similar to {{-profile}}, but the resulting profile information will be appended to any existing {{PROFILE}} file. {{chicken-profile}} will merge and sum up the accumulated timing information, if several entries for the same procedure calls exist. Only profiling information for global procedures will be collected. +; -accumulate-profile : Instruments the source code to count procedure calls and execution times. After the program terminates (either via an explicit {{exit}} or implicitly), profiling statistics are written to a file named {{PROFILE.<randomnumber>}}. Each line of the generated file contains a list with the procedure name, the number of calls and the time spent executing it. Use the {{chicken-profile}} program to display the profiling information in a more user-friendly form. Enter {{chicken-profile -help}} at the command line to get a list of available options. The {{-accumulate-profile}} option is similar to {{-profile}}, but the resulting profile information will be appended to any existing {{PROFILE}} file. {{chicken-profile}} will merge and sum up the accumulated timing information, if several entries for the same procedure calls exist. Only profiling information for global procedures will be collected. ; -profile-name FILENAME : Specifies name of the generated profile information (which defaults to {{PROFILE.<randomnumber>}}. Implies {{-profile}}.Trap