I am writing a document about a page crash and trying to get some specific numbers to work, so I wrote a simple program that reads 12 * 1024 * 1024 bytes of data. Easy:
int main()
{
FILE*in = fopen("data.bin", "rb");
int i;
int total=0;
for(i=0; i<1024*1024*12; i++)
total += fgetc(in);
printf("%d\n", total);
}
So yes, it goes through and reads the whole file. The problem is that I need a dtrace sensor that will fire 1536 times during this process (12M / 8k). Even if I count all fbt: mach_kernel: vm_fault *: probes and all vminfo: probes, I cannot find 500, so I know that I cannot find the correct probes.
Does anyone know where I can find dtrace sensors that trigger when a page crashes from disk?
UPDATE:
In the event that the problem was that some smart prefetch occurred in the stdio functions, I tried the following:
int main()
{
int in = open("data.bin", O_RDONLY | O_NONBLOCK);
int i;
int total=0;
char buf[128];
for(i=0; i<1024*1024*12; i++)
{
read(in, buf, 1);
total += buf[0];
}
printf("%d\n", total);
}
(42- , 10 , , ), , .
- (char int.) , , 0,0 .