start new:
tmux
start new with session name:
tmux new -s myname
| #include <math.h> | |
| #include <algorithm> | |
| #include <string> | |
| #include <pmmintrin.h> | |
| using namespace std;typedef float R; | |
| #define _W 79 | |
| #define _H 39 | |
| #define EP 0.01f | |
| #define OP operator | |
| #define C const |
| 1> l(dyntrace). | |
| {module,dyntrace} | |
| 2> erlang:trace_pattern({'_','_','_'}, [{'_', [], [{return_trace}]}], [local]). %% For function_call info | |
| 3> erlang:trace_pattern({'_','_','_'}, [{'_', [], [{exception_trace}]}], [local]). %% For exception info | |
| 4> erlang:trace(all, true, [call,'receive', send, {tracer,dyntrace,[]}]). %% Trace function calls with dyntrace (i.e. LTTng) and messaging | |
| 26 | |
| 5> erlang:now(). %% Or whatever function call you want to trace. See the traces coming in LTTng log. |
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
| #!/usr/bin/env escript | |
| -include_lib("kernel/include/inet.hrl"). | |
| -include_lib("kernel/include/inet_sctp.hrl"). | |
| main([Protocol, IP, Port, Len, Cnt]) -> | |
| bench(list_to_atom(Protocol), inet:parse_address(IP), | |
| list_to_integer(Port), list_to_integer(Len), list_to_integer(Cnt)); | |
| main(_) -> | |
| io:format("invalid arguments~n~n"), |