Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env stap
- global bytes_flushed, flush_count, hits, misses, start
- probe process("/home/evan/code/bitcoin/src/bitcoind").mark("cache__flush_start") {
- start = gettimeofday_us()
- bytes_flushed += $arg1
- flush_count++
- printf("> flush %d bytes\n", $arg1)
- }
- probe process("/home/evan/code/bitcoin/src/bitcoind").mark("cache__flush_end") {
- t = gettimeofday_us() - start
- printf("< flush (%d micros)\n", t)
- }
- probe process("/home/evan/code/bitcoin/src/bitcoind").mark("cache__hit") {
- hits++
- }
- probe process("/home/evan/code/bitcoin/src/bitcoind").mark("cache__miss") {
- misses++
- }
- probe timer.sec(10) {
- if (hits || misses)
- printf("hit rate: %d / %d\n", hits, hits + misses)
- }
- probe begin {
- printf("monitoring for coin flushes...\n")
- }
- probe end {
- printf("total flushes: %d\n", flush_count)
- printf("total bytes flushed: %d\n", bytes_flushed)
- printf("hit rate: %d / %d\n", hits, misses)
- }
Add Comment
Please, Sign In to add comment