kern/init.c
[KERNBASE, +oo]: kernel space
KERNBASE: 0xF0000000
[KERNBASE-4MB, KERNBASE]: kernel stack
[MEMORY MAP IO]
#! /usr/bin/env stap | |
# usage: | |
# stap tools/offcpu-cost.stp -x ${pid} -D MAXSKIPPED=1000000 -t -v -w -T 1 | |
global MAX_PROBE_NUM = 10000 # max context-switch number | |
global cur_probe_num = 0 | |
global begin_sleep_time | |
global delta |
#include <iostream> | |
#include <unordered_map> | |
#include <vector> | |
#include <stdint.h> | |
#include <sys/time.h> | |
using namespace std; | |
int main() { |
#! /usr/bin/env stap | |
probe kernel.statement("do_generic_file_read@mm/filemap.c:1772") { | |
printf("%s[%d] %s %ld:\n", execname(), tid(), pp(), $index); | |
} | |
probe kernel.function("submit_bio@block/blk-core.c") { | |
printf("%s[%d] %s i_sector:%lu, size:%u\n", execname(), tid(), pp(), $bio->bi_sector, $bio->bi_size); | |
} |
echo 1 > /proc/sys/vm/drop_caches | |
#dd if=data/cache.block.1 bs=4096k count=3000000 of=/dev/null iflag=direct & | |
#dd if=data/cache.block.2 bs=4096k count=3000000 of=/dev/null iflag=direct & | |
dd if=data/cache.block.1 bs=4096k count=3000000 of=/dev/null & | |
dd if=data/cache.block.2 bs=4096k count=3000000 of=/dev/null & |