Mercurial > hg > xemacs-beta
comparison lisp/diagnose.el @ 5473:ac37a5f7e5be
Merge with trunk.
author | Mats Lidell <matsl@xemacs.org> |
---|---|
date | Thu, 17 Mar 2011 23:42:59 +0100 |
parents | 308d34e9f07d ed74d2ca7082 |
children | 3bc58dc9d688 |
comparison
equal
deleted
inserted
replaced
5472:e79980ee5efe | 5473:ac37a5f7e5be |
---|---|
143 (buffer-name (window-buffer x))) | 143 (buffer-name (window-buffer x))) |
144 (mapcan #'(lambda (fr) | 144 (mapcan #'(lambda (fr) |
145 (window-list fr t)) | 145 (window-list fr t)) |
146 (frame-list)) | 146 (frame-list)) |
147 16)) | 147 16)) |
148 (when-fboundp #'sort-numeric-fields | 148 (when-fboundp 'sort-numeric-fields |
149 (sort-numeric-fields -1 | 149 (sort-numeric-fields -1 |
150 (save-excursion | 150 (save-excursion |
151 (goto-char begin) | 151 (goto-char begin) |
152 (forward-line 3) | 152 (forward-line 3) |
153 (point)) | 153 (point)) |
177 ) | 177 ) |
178 (sixth (garbage-collect))) | 178 (sixth (garbage-collect))) |
179 (princ "\n") | 179 (princ "\n") |
180 (princ (format fmt "total" total)) | 180 (princ (format fmt "total" total)) |
181 (incf grandtotal total)) | 181 (incf grandtotal total)) |
182 (when-fboundp #'sort-numeric-fields | 182 (when-fboundp 'sort-numeric-fields |
183 (sort-numeric-fields -1 | 183 (sort-numeric-fields -1 |
184 (save-excursion | 184 (save-excursion |
185 (goto-char begin) | 185 (goto-char begin) |
186 (forward-line 2) | 186 (forward-line 2) |
187 (point)) | 187 (point)) |
285 (princ (format fmt "total" | 285 (princ (format fmt "total" |
286 total-count total-use total-use-overhead | 286 total-count total-use total-use-overhead |
287 total-non-lisp-use "")) | 287 total-non-lisp-use "")) |
288 (incf grandtotal total-use-with-overhead) | 288 (incf grandtotal total-use-with-overhead) |
289 (incf grandtotal total-non-lisp-use) | 289 (incf grandtotal total-non-lisp-use) |
290 (when-fboundp #'sort-numeric-fields | 290 (when-fboundp 'sort-numeric-fields |
291 (sort-numeric-fields -4 | 291 (sort-numeric-fields -4 |
292 (save-excursion | 292 (save-excursion |
293 (goto-char begin) | 293 (goto-char begin) |
294 (forward-line 4) | 294 (forward-line 4) |
295 (point)) | 295 (point)) |
308 | 308 |
309 (defun show-mc-alloc-memory-usage () | 309 (defun show-mc-alloc-memory-usage () |
310 "Show statistics about memory usage of the new allocator." | 310 "Show statistics about memory usage of the new allocator." |
311 (interactive) | 311 (interactive) |
312 (garbage-collect) | 312 (garbage-collect) |
313 (if-fboundp #'mc-alloc-memory-usage | 313 (if-fboundp 'mc-alloc-memory-usage |
314 (let* ((stats (mc-alloc-memory-usage)) | 314 (let* ((stats (mc-alloc-memory-usage)) |
315 (page-size (first stats)) | 315 (page-size (first stats)) |
316 (heap-sects (second stats)) | 316 (heap-sects (second stats)) |
317 (used-plhs (third stats)) | 317 (used-plhs (third stats)) |
318 (free-plhs (fourth stats)) | 318 (free-plhs (fourth stats)) |
461 | 461 |
462 | 462 |
463 (defun show-gc-stats () | 463 (defun show-gc-stats () |
464 "Show statistics about garbage collection cycles." | 464 "Show statistics about garbage collection cycles." |
465 (interactive) | 465 (interactive) |
466 (if-fboundp #'gc-stats | 466 (if-fboundp 'gc-stats |
467 (let ((buffer "*garbage collection statistics*") | 467 (let ((buffer "*garbage collection statistics*") |
468 (plist (gc-stats)) | 468 (plist (gc-stats)) |
469 (fmt "%-9s %16s %12s %12s %12s %12s\n")) | 469 (fmt "%-9s %16s %12s %12s %12s %12s\n")) |
470 (flet ((plist-get-stat (category field) | 470 (flet ((plist-get-stat (category field) |
471 (let ((stat (plist-get plist | 471 (let ((stat (plist-get plist |