For more info check this issue.
Some use examples:
$ sudo latency_histogram.py -i eth0 -t src "dst port 26000"
$ sudo latency_histogram.py -i eth0 -t dst "src port 26000"
$ sudo latency_histogram.py -t dst --iface eth0 "src host 168.119.137.110"
$ sudo latency_histogram.py -t src --iface eth0 "dst host 168.119.137.110"
Example output:
Function shows calling new listns syscall (since 6.19 kernel) from Python.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| import argparse | |
| import csv | |
| import os.path | |
| import pathlib | |
| import maxminddb | |
| import netaddr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import socket | |
| STATUS_RESPONSE_HEADER = b'\xff\xff\xff\xffstatusResponse\n' | |
| def parse_server_vars(server_vars): | |
| if not server_vars.startswith(b'\\'): | |
| raise ValueError('Invalid server vars') | |
| values = server_vars.split(b'\\')[1:] | |
| return dict(zip(values[::2], values[1::2])) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /usr/local/bin/teleport -- gen_context(system_u:object_r:teleport_exec_t,s0) | |
| /var/lib/teleport(/.*)? gen_context(system_u:object_r:teleport_var_lib_t,s0) | |
| /var/run/teleport.pid -- gen_context(system_u:object_r:teleport_var_run_t,s0) | |
| /run/teleport.pid -- gen_context(system_u:object_r:teleport_var_run_t,s0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "io" | |
| "net" | |
| "net/http" | |
| "syscall" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cmake_minimum_required(VERSION 3.6) | |
| project(CORE) | |
| find_program(BASH bash HINTS /bin) | |
| find_package(ZLIB) | |
| if(NOT DEFINED BPFTOOL_PATH) | |
| set(BPFTOOL_PATH "${CMAKE_CURRENT_SOURCE_DIR}/bin/bpftool") | |
| endif() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -module(echo_server). | |
| -export([start/0, loop/2]). | |
| -define(LISTEN_PORT, 1234). | |
| start() -> | |
| listen(). | |
| listen() -> | |
| {ok, LSock} = gen_tcp:listen(?LISTEN_PORT, [binary, {active, false}, | |
| {reuseaddr, true}]), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ ./test | |
| 1.0 | |
| 0.1000 | |
| 0.112 | |
| 0.112 | |
| 2652 49490604 |
NewerOlder