Changeset 8227


Ignore:
Timestamp:
Jan 19, 2008, 11:31:44 PM (12 years ago)
Author:
gb
Message:

Report paging stats when gc verbose.

Location:
branches/1.1/ccl/lisp-kernel
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/1.1/ccl/lisp-kernel/gc.h

    r7137 r8227  
    106106#endif
    107107
     108#ifdef DARWIN
     109#include <mach/task_info.h>
     110typedef struct task_events_info paging_info;
     111#else
     112#ifndef WINDOWS
     113#include <sys/resource.h>
     114typedef struct rusage paging_info;
     115#endif
     116#endif
     117
     118#include <stdio.h>
     119
     120void sample_paging_info(paging_info *);
     121void report_paging_info_delta(FILE*, paging_info *, paging_info *);
    108122
    109123#define GC_TRAP_FUNCTION_IMMEDIATE_GC (-1)
  • branches/1.1/ccl/lisp-kernel/pmcl-kernel.c

    r7909 r8227  
    18851885
    18861886
     1887#ifdef DARWIN
     1888void
     1889sample_paging_info(paging_info *stats)
     1890{
     1891  mach_msg_type_number_t count = TASK_EVENTS_INFO_COUNT;
     1892
     1893  task_info(mach_task_self(),
     1894            TASK_EVENTS_INFO,
     1895            (task_info_t)stats,
     1896            &count);
     1897}
     1898
     1899void
     1900report_paging_info_delta(FILE *out, paging_info *start, paging_info *stop)
     1901{
     1902  fprintf(out,";;; %d soft faults, %d faults, %d pageins\n\n",
     1903          stop->cow_faults-start->cow_faults,
     1904          stop->faults-start->faults,
     1905          stop->pageins-start->pageins);
     1906}
     1907
     1908#else
     1909#ifndef WINDOWS
     1910void
     1911sample_paging_info(struct rusage *usage)
     1912{
     1913  getrusage(RUSAGE_SELF, rusage);
     1914}
     1915
     1916void
     1917report_paging_info_delta(FILE *out, paging_info *start, paging_info *stop)
     1918{
     1919  fprintf(out,";;; %d soft faults, %d faults, %d pageins\n\n",
     1920          stop->ru_minflt-start->ru_minflt,
     1921          stop->ru_majflt-start->ru_majflt,
     1922          stop->ru_nswap-start->ru_nswap);
     1923}
     1924
     1925#endif
     1926#endif
  • branches/1.1/ccl/lisp-kernel/x86-gc.c

    r7824 r8227  
    7474  } while (len >= 0);
    7575}
     76
    7677
    7778/* Heap sanity checking. */
     
    23892390  area *a = active_dynamic_area, *to = NULL, *from = NULL, *note = NULL;
    23902391  unsigned timeidx = 1;
     2392  paging_info paging_info_start;
    23912393  xframe_list *x;
    23922394  LispObj
     
    24422444  if (GCverbose) {
    24432445    char buf[16];
    2444    
     2446
     2447    sample_paging_info(&paging_info_start);
    24452448    comma_output_decimal(buf,16,area_dnode(oldfree,a->low) << dnode_shift);
    24462449    if (GCephemeral_low) {
     
    27402743      if (GCverbose) {
    27412744        char buf[16];
     2745        paging_info paging_info_stop;
     2746       
     2747        sample_paging_info(&paging_info_stop);
    27422748        if (justfreed <= heap_segment_size) {
    27432749          justfreed = 0;
     
    27472753          fprintf(stderr,";;; Finished full GC. %s bytes freed in %d.%06d s\n\n", buf, elapsed.tv_sec, elapsed.tv_usec);
    27482754        } else {
    2749           fprintf(stderr,";;; Finished EGC of generation %d. %s bytes freed in %d.%06d s\n\n",
     2755          fprintf(stderr,";;; Finished EGC of generation %d. %s bytes freed in %d.%06d s\n",
    27502756                  (from == g2_area) ? 2 : (from == g1_area) ? 1 : 0,
    27512757                  buf,
    27522758                  elapsed.tv_sec, elapsed.tv_usec);
    27532759        }
     2760        report_paging_info_delta(stderr, &paging_info_start, &paging_info_stop);
    27542761      }
    27552762    }
Note: See TracChangeset for help on using the changeset viewer.