% Title % Name % Date
List
| this is a sample of output: | |
| root@percona-db-2:~# iperf -s -u -B 226.94.1.1 -i 1 | |
| ------------------------------------------------------------ | |
| Server listening on UDP port 5001 | |
| Binding to local address 226.94.1.1 | |
| Joining multicast group 226.94.1.1 | |
| Receiving 1470 byte datagrams | |
| UDP buffer size: 122 KByte (default) | |
| ------------------------------------------------------------ |
| sed -E -e 's/^/ /g' -e 's/^ --- ?//g' | pandoc -o listing.pdf - | |
| That expression is a cheap literate programming system for Markdown. | |
| Start commentary lines with '--- ' and they will be | |
| markdown-formatted, the rest will be code. (Uses Lua comment syntax.) | |
| Finally the right implementation of this idea: | |
| http://fresh.homeunix.net/~luke/misc/emacs/pbook.pdf (program) | |
| http://fresh.homeunix.net/~luke/misc/erlang/regtest.pdf (better example) |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
| /* Example of a library interposer: interpose on malloc(). | |
| * gcc -D_GNU_SOURCE -fPIC -O2 -Wall -o malloc_interposer.so -shared malloc_interposer.c -ldl | |
| * setenv LD_PRELOAD $cwd/malloc_interposer.so | |
| * run the app | |
| */ | |
| #include <stdio.h> | |
| #include <dlfcn.h> | |
| #include <string.h> |
| The MIT License (MIT) | |
| Copyright (c) 2015 J Kishore Kumar | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is | |
| furnished to do so, subject to the following conditions: |