Changeset 15014


Ignore:
Timestamp:
Oct 11, 2011, 5:49:23 PM (8 years ago)
Author:
rme
Message:

Add a few experimental DTrace probes to the lisp kernel on
Darwin x86 systems.

Location:
trunk/source/lisp-kernel
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/darwinx8632

    • Property svn:ignore set to
      probes.h
  • trunk/source/lisp-kernel/darwinx8632/Makefile

    r14990 r15014  
    3333M4FLAGS = -DDARWIN -DX86 -DX8632
    3434ASFLAGS = -arch i386 -g
    35 CDEFINES = -DDARWIN -DX86 -DX8632 -DSVN_REVISION=$(SVN_REVISION) -D_DARWIN_NO_64_BIT_INODE
     35CDEFINES = -DDARWIN -DX86 -DX8632 -DSVN_REVISION=$(SVN_REVISION) -D_DARWIN_NO_64_BIT_INODE -DUSE_DTRACE
    3636CDEBUG = -g
    3737COPT = -O2
     
    4545        $(M4) $(M4FLAGS) -I../ $< | $(AS) $(ASFLAGS) -o $@
    4646.c.o:
    47         $(CC) -include ../$(PLATFORM_H) -c -arch i386 $< $(CDEFINES) $(CDEBUG) $(COPT) $(MDYNAMIC_NO_PIC) $(WFORMAT) -mmacosx-version-min=$(OSVERSION) -isysroot $(SDKROOT) -o $@
     47        $(CC) -include ../$(PLATFORM_H) -c -arch i386 $< $(CDEFINES) \
     48        $(CDEBUG) $(COPT) $(MDYNAMIC_NO_PIC) $(WFORMAT) \
     49        -I. -mmacosx-version-min=$(OSVERSION) -isysroot $(SDKROOT) -o $@
    4850
    4951SPOBJ = x86-spjump32.o x86-spentry32.o x86-subprims32.o
     
    9193$(SPOBJ): $(SPINC)
    9294$(ASMOBJ): $(SPINC)
    93 $(COBJ): $(CHEADERS)
     95$(COBJ): $(CHEADERS) probes.h
    9496$(DEBUGOBJ): $(CHEADERS) lispdcmd.h
    9597
     98probes.h: probes.d
     99        dtrace -h -s $<
    96100
    97101
  • trunk/source/lisp-kernel/darwinx8664

    • Property svn:ignore set to
      probes.h
  • trunk/source/lisp-kernel/darwinx8664/Makefile

    r14990 r15014  
    5353ASFLAGS = -arch x86_64 -g
    5454CDEFINES = -DDARWIN -DX86 -DX8664 -DTCR_IN_GPR -DSVN_REVISION=$(SVN_REVISION) \
    55            -D_DARWIN_NO_64_BIT_INODE
     55           -D_DARWIN_NO_64_BIT_INODE -DUSE_DTRACE
    5656CDEBUG = -g
    5757COPT = -O2
     
    6666        $(CC) -include ../$(PLATFORM_H) -c $< -arch x86_64 $(CDEFINES) \
    6767        $(CDEBUG) $(COPT) $(WFORMAT) $(MDYNAMIC_NO_PIC) \
    68          -mmacosx-version-min=$(OSVERSION) -isysroot $(SDKROOT) -o $@
     68         -I. -mmacosx-version-min=$(OSVERSION) -isysroot $(SDKROOT) -o $@
    6969
    7070SPOBJ = x86-spjump64.o x86-spentry64.o x86-subprims64.o
     
    113113$(SPOBJ): $(SPINC)
    114114$(ASMOBJ): $(SPINC)
    115 $(COBJ): $(CHEADERS)
     115$(COBJ): $(CHEADERS) probes.h
    116116$(DEBUGOBJ): $(CHEADERS) lispdcmd.h
    117117
     118probes.h: probes.d
     119        dtrace -h -s $<
    118120
    119121thread_manager.o: thread_manager.c
  • trunk/source/lisp-kernel/gc-common.c

    r14619 r15014  
    14471447  }
    14481448
     1449#ifdef USE_DTRACE
     1450  if (GCephemeral_low) {
     1451    if (CCL_EGC_START_ENABLED()) {
     1452      natural bytes_used = area_dnode(oldfree, a->low) << dnode_shift;
     1453      unsigned generation = (from == g2_area) ? 2 : (from == g1_area) ? 1 : 0;
     1454      CCL_EGC_START(bytes_used, generation);
     1455    }
     1456  } else {
     1457    if (CCL_GC_START_ENABLED()) {
     1458      natural bytes_used = area_dnode(oldfree, a->low) << dnode_shift;
     1459      CCL_GC_START(bytes_used);
     1460    }
     1461  }
     1462#endif
     1463
    14491464  get_time(start);
    14501465
     
    17671782      long long justfreed = oldfree - a->active;
    17681783      *( (long long *) ptr_from_lispobj(((macptr *) ptr_from_lispobj(untag(val)))->address)) += justfreed;
     1784
     1785#ifdef USE_DTRACE
     1786      if (note == tenured_area) {
     1787        if (CCL_GC_FINISH_ENABLED()) {
     1788          natural bytes_freed = justfreed <= heap_segment_size ? 0 : justfreed;
     1789          CCL_GC_FINISH(bytes_freed);
     1790        }
     1791      } else {
     1792        if (CCL_EGC_FINISH_ENABLED()) {
     1793          natural bytes_freed = justfreed <= heap_segment_size ? 0 : justfreed;
     1794          unsigned generation = (from == g2_area) ? 2 : (from == g1_area) ? 1 : 0;
     1795          CCL_EGC_FINISH(bytes_freed, generation);
     1796        }
     1797      }
     1798#endif
     1799
    17691800      if (GCverbose) {
    17701801        char buf[16];
  • trunk/source/lisp-kernel/os-darwin.h

    r13638 r15014  
    2121
    2222#define SIG_KILL_THREAD SIGEMT
     23
     24#ifdef USE_DTRACE
     25#include "probes.h"
     26#endif
     27
  • trunk/source/lisp-kernel/thread_manager.c

    r14993 r15014  
    17381738  }
    17391739  destroy_semaphore(&activation.created); 
     1740
     1741#ifdef USE_DTRACE
     1742  if (CCL_CREATE_THREAD_ENABLED() && activation.tcr) {
     1743    CCL_CREATE_THREAD(activation.tcr->osid);
     1744  }
     1745#endif
     1746
    17401747  return TCR_TO_TSD(activation.tcr);
    17411748}
Note: See TracChangeset for help on using the changeset viewer.