|
| 1 | +# `gateway-sp-comms` |
| 2 | + |
| 3 | +Communicate with SPs across the management network. |
| 4 | + |
| 5 | +## DTrace Probes |
| 6 | + |
| 7 | +This crate currently provides three DTrace probes: receiving raw packets, |
| 8 | +receiving responses to requests, receiving serial console messages. |
| 9 | + |
| 10 | +Raw packets: |
| 11 | + |
| 12 | +``` |
| 13 | +% sudo dtrace -n 'gateway_sp_comms*:::recv_packet { printf("%s, %s", copyinstr(arg0), copyinstr(arg1)); tracemem(copyin(arg2, arg3), 128, arg3); }' |
| 14 | +dtrace: description 'gateway_sp_comms*:::recv_packet ' matched 1 probe |
| 15 | +CPU ID FUNCTION:NAME |
| 16 | + 6 2961 _ZN16gateway_sp_comms17management_switch9recv_task28_$u7b$$u7b$closure$u7d$$u7d$17h2bdb4a0aa5dcced5E:recv_packet {"ok":"127.0.0.1:23457"}, {"ok":1} |
| 17 | + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef |
| 18 | + 0: 01 00 00 00 01 73 70 33 00 00 00 00 00 00 00 00 .....sp3........ |
| 19 | + 10: 00 00 00 00 00 24 00 00 00 00 00 00 00 06 00 68 .....$.........h |
| 20 | + 20: 65 6c 6c 6f 0a ello. |
| 21 | +``` |
| 22 | + |
| 23 | +Responses: |
| 24 | + |
| 25 | +``` |
| 26 | +% sudo dtrace -n 'gateway_sp_comms*:::recv_response { printf("%s, %u, %s", copyinstr(arg0), arg1, copyinstr(arg2)); }' |
| 27 | +dtrace: description 'gateway_sp_comms*:::recv_response ' matched 1 probe |
| 28 | +CPU ID FUNCTION:NAME |
| 29 | + 5 2962 _ZN16gateway_sp_comms12recv_handler11RecvHandler15handle_response17h28a3ce4546c4e1bdE:recv_response {"ok":0}, 0, {"ok":{"Ok":{"IgnitionState":{"id":17,"flags":{"bits":3}}}}} |
| 30 | + 2 2962 _ZN16gateway_sp_comms12recv_handler11RecvHandler15handle_response17h28a3ce4546c4e1bdE:recv_response {"ok":1}, 1, {"ok":{"Ok":{"SpState":{"serial_number":[0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3]}}}} |
| 31 | +``` |
| 32 | + |
| 33 | +Serial console messages: |
| 34 | + |
| 35 | +``` |
| 36 | +% sudo dtrace -n 'gateway_sp_comms*:::recv_serial_console { printf("%u, %s, %u", arg0, copyinstr(arg0), arg2); tracemem(copyin(arg3, arg4), 128, arg4); }' |
| 37 | +dtrace: description 'gateway_sp_comms*:::recv_serial_console ' matched 1 probe |
| 38 | +CPU ID FUNCTION:NAME |
| 39 | + 2 2963 _ZN16gateway_sp_comms12recv_handler11RecvHandler21handle_serial_console17hba2bd6ac4422e295E:recv_serial_console 105553180037200, {"ok":1}, 42 |
| 40 | + 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef |
| 41 | + 0: 68 65 6c 6c 6f 21 0a hello!. |
| 42 | +``` |
| 43 | + |
| 44 | +TODO EXPAND |
0 commit comments