mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-10 22:10:21 +02:00
remove unused (system vm profile)
* module/Makefile.am: * module/system/vm/profile.scm: Remove (system vm profile). We use statprof.
This commit is contained in:
parent
f1ee6d54d2
commit
7c42238610
2 changed files with 1 additions and 65 deletions
|
@ -311,13 +311,13 @@ SYSTEM_SOURCES = \
|
|||
system/vm/frame.scm \
|
||||
system/vm/instruction.scm \
|
||||
system/vm/objcode.scm \
|
||||
system/vm/profile.scm \
|
||||
system/vm/program.scm \
|
||||
system/vm/trace.scm \
|
||||
system/vm/vm.scm \
|
||||
system/foreign.scm \
|
||||
system/xref.scm \
|
||||
system/repl/debug.scm \
|
||||
system/repl/hook-state.scm \
|
||||
system/repl/error-handling.scm \
|
||||
system/repl/common.scm \
|
||||
system/repl/command.scm \
|
||||
|
|
|
@ -1,64 +0,0 @@
|
|||
;;; Guile VM profiler
|
||||
|
||||
;; Copyright (C) 2001 Free Software Foundation, Inc.
|
||||
|
||||
;;; This library is free software; you can redistribute it and/or
|
||||
;;; modify it under the terms of the GNU Lesser General Public
|
||||
;;; License as published by the Free Software Foundation; either
|
||||
;;; version 3 of the License, or (at your option) any later version.
|
||||
;;;
|
||||
;;; This library is distributed in the hope that it will be useful,
|
||||
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
;;; Lesser General Public License for more details.
|
||||
;;;
|
||||
;;; You should have received a copy of the GNU Lesser General Public
|
||||
;;; License along with this library; if not, write to the Free Software
|
||||
;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
;;; Code:
|
||||
|
||||
(define-module (system vm profile)
|
||||
#:use-module (system vm vm)
|
||||
#:use-module (ice-9 format)
|
||||
#:export (vm-profile))
|
||||
|
||||
(define (vm-profile vm objcode . opts)
|
||||
(let ((flag (vm-option vm 'debug)))
|
||||
(dynamic-wind
|
||||
(lambda ()
|
||||
(set-vm-option! vm 'debug #t)
|
||||
(set-vm-option! vm 'profile-data '())
|
||||
(add-hook! (vm-next-hook vm) profile-next)
|
||||
(add-hook! (vm-enter-hook vm) profile-enter)
|
||||
(add-hook! (vm-exit-hook vm) profile-exit))
|
||||
(lambda ()
|
||||
(vm-load vm objcode)
|
||||
(print-result vm))
|
||||
(lambda ()
|
||||
(set-vm-option! vm 'debug flag)
|
||||
(remove-hook! (vm-next-hook vm) profile-next)
|
||||
(remove-hook! (vm-enter-hook vm) profile-enter)
|
||||
(remove-hook! (vm-exit-hook vm) profile-exit)))))
|
||||
|
||||
(define (profile-next vm)
|
||||
(set-vm-option! vm 'profile-data
|
||||
(cons (vm-fetch-code vm) (vm-option vm 'profile-data))))
|
||||
|
||||
(define (profile-enter vm)
|
||||
#f)
|
||||
|
||||
(define (profile-exit vm)
|
||||
#f)
|
||||
|
||||
(define (print-result vm . opts)
|
||||
(do ((data (vm-option vm 'profile-data) (cdr data))
|
||||
(summary '() (let ((inst (caar data)))
|
||||
(assq-set! summary inst
|
||||
(1+ (or (assq-ref summary inst) 0))))))
|
||||
((null? data)
|
||||
(display "Count Instruction\n")
|
||||
(display "----- -----------\n")
|
||||
(for-each (lambda (entry)
|
||||
(format #t "~5@A ~A\n" (cdr entry) (car entry)))
|
||||
(sort summary (lambda (e1 e2) (> (cdr e1) (cdr e2))))))))
|
Loading…
Add table
Add a link
Reference in a new issue