Changeset 13174 for trunk/source/library


Ignore:
Timestamp:
Nov 6, 2009, 10:18:51 PM (10 years ago)
Author:
gz
Message:

heap utilization tweaks:

Changed %MAP-AREAS to take an area or list of areas, rather than min/max area codes. Make it accept symbolic area names as well.

Made HEAP-UTILIZATION accept some new keyword args:

  • :AREA can be used to restrict the area or areas walked, as in %map-areas.
  • :CLASSES, if true, causes it to classify objects by actual class rather than typecode.
  • :SORT specifies the order in which to print results, default is by name
  • :UNIT can be one of :KB :MB or :GB to show sizes in units other than bytes.

Added COLLECT-HEAP-UTILIZATION, which returns a list of (type count logical-size physical-size) instead of printing anything.

Location:
trunk/source/library
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/library/chud-metering.lisp

    r13067 r13174  
    141141                             (functions (ccl::function-vector-to-function o))))
    142142                         ccl::area-dynamic
    143                          ccl::area-dynamic
    144143                         )))
    145144    (functions)))
     
    156155                           (when (typep o 'function)
    157156                             (functions o)))
    158                          ccl::area-dynamic
    159157                         ccl::area-dynamic
    160158                         )))
  • trunk/source/library/core-files.lisp

    r13167 r13174  
    269269     (- target::fulltag-symbol target::fulltag-nil)))
    270270
    271 (defun gc-area-name (code)
    272   (cond ((eq code area-void) :void)
    273         ((eq code area-cstack) :cstack)
    274         ((eq code area-vstack) :vstack)
    275         ((eq code area-tstack) :tstack)
    276         ((eq code area-readonly) :readonly)
    277         ((eq code area-watched) :watched)
    278         ((eq code area-managed-static) :managed-static)
    279         ((eq code area-static) :static)
    280         ((eq code area-dynamic) :dynamic)
    281         ((eql 0 (logand code (1- (ash 1 target::fixnum-shift))))
    282          (gc-area-name (ash code (- target::fixnum-shift))))
    283         (t code)))
    284 
    285 (defun gc-area-code (name)
    286   (case name
    287     (:void area-void)
    288     (:cstack area-cstack)
    289     (:vstack area-vstack)
    290     (:tstack area-tstack)
    291     (:readonly area-readonly)
    292     (:watched area-watched)
    293     (:managed-static area-managed-static)
    294     (:static area-static)
    295     (:dynamic area-dynamic)
    296     (t (if (and (fixnump name)
    297                 (<= area-readonly name area-dynamic))
    298          name
    299          (gc-area-code (require-type name '(member :void :cstack :vstack :tstack :readonly :managed-static :static :dynamic)))))))
    300 
     271(defun core-area-name (code)
     272  (or (heap-area-name code)
     273      (and (integerp code)
     274           (not (logtest code (1- (ash 1 target::fixnum-shift))))
     275           (heap-area-name (ash code (- target::fixnum-shift))))))
    301276
    302277(defx86lapfunction %%raw-obj ((address arg_z))
     
    359334(defun map-core-areas (function &key area)
    360335  (setq area (cond ((or (eq area t) (eq area nil)) nil)
    361                    ((consp area) (mapcar #'gc-area-code area))
    362                    (t (list (gc-area-code area)))))
     336                   ((consp area) (mapcar #'heap-area-code area))
     337                   (t (list (heap-area-code area)))))
    363338  (loop for area-ptr = (core-q (core-q (kernel-global-address 'all-areas)) target::area.succ)
    364339          then (core-q area-ptr target::area.succ)
     
    371346             #+debug
    372347             (format t "~& AREA at x~x, type = ~a low = x~x active = x~x (size = x~x out of x~x)"
    373                      area-ptr (gc-area-name code)
     348                     area-ptr (core-area-name code)
    374349                     (core-q area-ptr target::area.low)
    375350                     (core-q area-ptr target::area.active)
  • trunk/source/library/elf.lisp

    r13067 r13174  
    194194                                   #-x8664-target 'function)
    195195                        (functions (function-vector-to-function o))))
    196                     ccl::area-dynamic
    197196                    ccl::area-dynamic
    198197                    )))
Note: See TracChangeset for help on using the changeset viewer.