Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
where are my code page-ins?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

where are my code page-ins?



I'm tracing page faults in a Firefox library (XUL) with a simple DTrace script that looks for vnode page-ins [1]. This is on Snow Leopard 10.6.1, 64 bits.

I run the script like this 'dtrace -Zqws page-fault.d'.

I clear the cache beforehand by allocating 8Gb of memory (twice physical 4Gb) and touching every page [0].

The script produces a list of page faults [2] which I try to map to segments using the output from 'size -m -l XUL' [3]. Trouble is, I don't see code page ins (__TEXT, __text) at all!

When do my code pages get paged in and how can I track this?

	Thanks, Joel

---

[0] purge-cache.c

#include <sys/mman.h>
#include <fcntl.h>
#include <stdio.h>

static long SIZE = 8589934592L;

int main(int argc, char**argv)
{
char *result = mmap(0, SIZE, PROT_READ|PROT_WRITE, MAP_ANON| MAP_PRIVATE, -1, 0);
if (result != MAP_FAILED)
{
unsigned long i;


    for (i = 0; i < SIZE; i += 4096)
      result[i] = 1;
    return 0;
  }
  return 1;
}

[1] page-fault.d

fbt::vnode_pagein:entry
{
  self->v_name = stringof(((vnode_t)arg0)->v_name);
}

fbt::vnode_pagein:entry
/self->v_name == "XUL"/
{
  printf("vnode_pagein: %s, offset: %u, size: %u\n",
    self->v_name, arg3, arg4);
}

[2] Output from page-fault.d

vnode_pagein: XUL, offset: 19890176, size: 16384
vnode_pagein: XUL, offset: 19906560, size: 16384
vnode_pagein: XUL, offset: 19922944, size: 16384
vnode_pagein: XUL, offset: 19939328, size: 16384
vnode_pagein: XUL, offset: 19955712, size: 16384
vnode_pagein: XUL, offset: 20135936, size: 20480
vnode_pagein: XUL, offset: 20156416, size: 24576
vnode_pagein: XUL, offset: 20303872, size: 24576
vnode_pagein: XUL, offset: 20328448, size: 28672
vnode_pagein: XUL, offset: 20357120, size: 28672
vnode_pagein: XUL, offset: 20459520, size: 561152
vnode_pagein: XUL, offset: 20426752, size: 4096
vnode_pagein: XUL, offset: 20430848, size: 4096
vnode_pagein: XUL, offset: 20434944, size: 4096
vnode_pagein: XUL, offset: 20439040, size: 8192
vnode_pagein: XUL, offset: 19853312, size: 4096
vnode_pagein: XUL, offset: 20447232, size: 4096
vnode_pagein: XUL, offset: 20451328, size: 8192
vnode_pagein: XUL, offset: 14548992, size: 1048576
vnode_pagein: XUL, offset: 20385792, size: 8192
vnode_pagein: XUL, offset: 12963840, size: 1048576
vnode_pagein: XUL, offset: 8192, size: 1040384
vnode_pagein: XUL, offset: 11943936, size: 1019904
vnode_pagein: XUL, offset: 11333632, size: 610304
vnode_pagein: XUL, offset: 9469952, size: 1048576
vnode_pagein: XUL, offset: 1060864, size: 1048576
vnode_pagein: XUL, offset: 3645440, size: 1048576
vnode_pagein: XUL, offset: 4694016, size: 819200
vnode_pagein: XUL, offset: 2658304, size: 987136
vnode_pagein: XUL, offset: 5701632, size: 1048576
vnode_pagein: XUL, offset: 7528448, size: 1048576
vnode_pagein: XUL, offset: 20393984, size: 8192
vnode_pagein: XUL, offset: 20402176, size: 8192
vnode_pagein: XUL, offset: 19722240, size: 16384
vnode_pagein: XUL, offset: 19738624, size: 16384
vnode_pagein: XUL, offset: 19755008, size: 16384
vnode_pagein: XUL, offset: 19771392, size: 16384
vnode_pagein: XUL, offset: 19787776, size: 16384
vnode_pagein: XUL, offset: 19804160, size: 16384
vnode_pagein: XUL, offset: 19820544, size: 16384
vnode_pagein: XUL, offset: 19836928, size: 16384
vnode_pagein: XUL, offset: 19857408, size: 16384
vnode_pagein: XUL, offset: 19873792, size: 16384
vnode_pagein: XUL, offset: 20410368, size: 16384
vnode_pagein: XUL, offset: 19972096, size: 20480
vnode_pagein: XUL, offset: 19992576, size: 20480
vnode_pagein: XUL, offset: 20013056, size: 20480
vnode_pagein: XUL, offset: 20033536, size: 20480
vnode_pagein: XUL, offset: 20054016, size: 20480
vnode_pagein: XUL, offset: 20074496, size: 20480
vnode_pagein: XUL, offset: 20094976, size: 20480
vnode_pagein: XUL, offset: 20115456, size: 20480
vnode_pagein: XUL, offset: 20180992, size: 24576
vnode_pagein: XUL, offset: 20205568, size: 24576
vnode_pagein: XUL, offset: 20230144, size: 24576
vnode_pagein: XUL, offset: 20254720, size: 24576
vnode_pagein: XUL, offset: 20279296, size: 24576
vnode_pagein: XUL, offset: 14012416, size: 536576
vnode_pagein: XUL, offset: 10518528, size: 815104
vnode_pagein: XUL, offset: 8921088, size: 548864
vnode_pagein: XUL, offset: 2109440, size: 532480
vnode_pagein: XUL, offset: 5513216, size: 188416
vnode_pagein: XUL, offset: 6934528, size: 593920
vnode_pagein: XUL, offset: 6750208, size: 184320
vnode_pagein: XUL, offset: 2641920, size: 16384
vnode_pagein: XUL, offset: 1048576, size: 12288

[3] Segments and sections according to 'size -m -l XUL'

Segment __TEXT: 18673664 (vmaddr 0x0 fileoff 0)
	Section __text: 13477360 (addr 0x1470 offset 5232)
	Section __symbol_stub1: 9234 (addr 0xcdba60 offset 13482592)
	Section __stub_helper: 27718 (addr 0xcdde72 offset 13491826)
	Section __const: 1119212 (addr 0xce4ac0 offset 13519552)
	Section __cstring: 436667 (addr 0xdf5eb0 offset 14638768)
	Section __dof_mozilla: 2316 (addr 0xe60870 offset 15075440)
	Section __gcc_except_tab: 72218 (addr 0xe6117c offset 15077756)
	Section __unwind_info: 224100 (addr 0xe72bbc offset 15150012)
	Section __eh_frame: 3299552 (addr 0xea9720 offset 15374112)
	total 18668377
Segment __DATA: 1814528 (vmaddr 0x11cf000 fileoff 18673664)
	Section __nl_symbol_ptr: 1136 (addr 0x11cf000 offset 18673664)
	Section __la_symbol_ptr: 12312 (addr 0x11cf470 offset 18674800)
	Section __dyld: 16 (addr 0x11d2488 offset 18687112)
	Section __mod_init_func: 1504 (addr 0x11d2498 offset 18687128)
	Section __const: 1567536 (addr 0x11d2a80 offset 18688640)
	Section __cfstring: 3232 (addr 0x13515b0 offset 20256176)
	Section __objc_data: 1760 (addr 0x1352250 offset 20259408)
	Section __objc_msgrefs: 10208 (addr 0x1352930 offset 20261168)
	Section __objc_selrefs: 368 (addr 0x1355110 offset 20271376)
	Section __objc_classrefs: 1528 (addr 0x1355280 offset 20271744)
	Section __objc_superrefs: 160 (addr 0x1355878 offset 20273272)
	Section __objc_const: 12912 (addr 0x1355918 offset 20273432)
	Section __objc_classlist: 176 (addr 0x1358b88 offset 20286344)
	Section __objc_catlist: 56 (addr 0x1358c38 offset 20286520)
	Section __objc_protolist: 24 (addr 0x1358c70 offset 20286576)
	Section __objc_imageinfo: 8 (addr 0x1358c88 offset 20286600)
	Section __data: 106632 (addr 0x1358ca0 offset 20286624)
	Section __bss: 61412 (addr 0x1372d40 offset 0)
	Section __common: 29384 (addr 0x1381d40 offset 0)
	total 1810364
Segment __LINKEDIT: 19382272 (vmaddr 0x138a000 fileoff 20393984)
total 39870464

[4] Mapping of page-ins to segments

segment: __TEXT, size: 18673664, offset: 0
segment: __DATA, size: 1814528, offset: 18673664
segment: __LINKEDIT, size: 19382272, offset: 20393984
__DATA, __cfstring = 5 pages
__DATA, __cfstring = 5 pages
__DATA, __cfstring = 5 pages
__DATA, __cfstring = 5 pages
__DATA, __cfstring = 6 pages
__DATA, __cfstring = 6 pages
__DATA, __cfstring = 6 pages
__DATA, __cfstring = 6 pages
__DATA, __cfstring = 6 pages
__DATA, __objc_classlist = 6 pages
__LINKEDIT, __symtab = 6 pages
__LINKEDIT, __symtab = 7 pages
__LINKEDIT, __symtab = 7 pages
__LINKEDIT, __symtab = 2 pages
__LINKEDIT, __symtab = 2 pages
__DATA, __cfstring = 4 pages
__DATA, __cfstring = 4 pages
__DATA, __cfstring = 4 pages
__DATA, __cfstring = 4 pages
__DATA, __cfstring = 4 pages
__DATA, __cfstring = 4 pages
__DATA, __cfstring = 4 pages
__DATA, __cfstring = 4 pages
__DATA, __cfstring = 4 pages
__DATA, __cfstring = 4 pages
__DATA, __cfstring = 4 pages
__DATA, __cfstring = 4 pages
__DATA, __cfstring = 4 pages
__DATA, __cfstring = 4 pages
__DATA, __cfstring = 4 pages
__LINKEDIT, __symtab = 4 pages
__DATA, __cfstring = 5 pages
__DATA, __cfstring = 5 pages
__DATA, __cfstring = 5 pages
__DATA, __cfstring = 5 pages
__DATA, __cfstring = 5 pages
__LINKEDIT, __symtab = 8 pages
__TEXT, __cstring = 256 pages
__LINKEDIT, __symtab = 128 pages
__LINKEDIT, __symtab = 1 pages
__LINKEDIT, __symtab = 1 pages
__LINKEDIT, __symtab = 1 pages
__LINKEDIT, __symtab = 2 pages
__DATA, __cfstring = 1 pages
__LINKEDIT, __symtab = 1 pages
__LINKEDIT, __symtab = 2 pages
__LINKEDIT, __symtab = 2 pages
__TEXT, __symbol_stub1 = 256 pages
__LINKEDIT, __symtab = 9 pages
__TEXT, __symbol_stub1 = 254 pages
__TEXT, __cstring = 131 pages
__TEXT, __symbol_stub1 = 249 pages
__TEXT, __symbol_stub1 = 256 pages
__TEXT, __symbol_stub1 = 134 pages
__TEXT, __symbol_stub1 = 130 pages
__TEXT, __symbol_stub1 = 149 pages
__TEXT, __symbol_stub1 = 256 pages
__TEXT, __symbol_stub1 = 256 pages
__TEXT, __symbol_stub1 = 199 pages
__TEXT, __symbol_stub1 = 200 pages
__TEXT, __symbol_stub1 = 241 pages
__TEXT, __symbol_stub1 = 256 pages
__TEXT, __symbol_stub1 = 256 pages
__TEXT, __symbol_stub1 = 46 pages
__TEXT, __symbol_stub1 = 145 pages
__TEXT, __symbol_stub1 = 45 pages
__TEXT, __symbol_stub1 = 4 pages
__TEXT, __symbol_stub1 = 3 pages

---
firefox for android!
http://wagerlabs.com

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.