From f09290442ccd9adc49b15f9828aa65c6f9cb3f90 Mon Sep 17 00:00:00 2001 From: Jiajie Chen Date: Wed, 20 Mar 2019 23:02:12 +0800 Subject: [PATCH] Add pkttop.sh, bump user and drivers version --- kernel/Cargo.lock | 2 +- tools/pkttop.sh | 17 +++++++++++++++++ user | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100755 tools/pkttop.sh diff --git a/kernel/Cargo.lock b/kernel/Cargo.lock index 6761aa4..53679e5 100644 --- a/kernel/Cargo.lock +++ b/kernel/Cargo.lock @@ -196,7 +196,7 @@ dependencies = [ [[package]] name = "isomorphic_drivers" version = "0.1.0" -source = "git+https://github.com/rcore-os/isomorphic_drivers#4a6546922bc5b1255631840f63d6b8b595b39de9" +source = "git+https://github.com/rcore-os/isomorphic_drivers#642e139b4c4a06a75d9530e9d60a33c514aea060" dependencies = [ "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "spin 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/tools/pkttop.sh b/tools/pkttop.sh new file mode 100755 index 0000000..9206098 --- /dev/null +++ b/tools/pkttop.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# https://www.unixteacher.org/blog/linux/display-packets-per-second-on-linux/ + +time="1" # one second +int="enp3s0f0" # network interface + +while true +do + txpkts_old="`cat /sys/class/net/$int/statistics/tx_packets`" # sent packets + rxpkts_old="`cat /sys/class/net/$int/statistics/tx_packets`" # recv packets + sleep $time + txpkts_new="`cat /sys/class/net/$int/statistics/tx_packets`" # sent packets + rxpkts_new="`cat /sys/class/net/$int/statistics/tx_packets`" # recv packets + txpkts="`expr $txpkts_new - $txpkts_old`" # evaluate expressions for sent packets + rxpkts="`expr $rxpkts_new - $rxpkts_old`" # evaluate expressions for recv packets + echo "tx $txpkts pkts/s - rx $rxpkts pkts/ on interface $int" +done diff --git a/user b/user index fae914b..4bcc820 160000 --- a/user +++ b/user @@ -1 +1 @@ -Subproject commit fae914b11b8de423d3b11f7259db03cf6cdf3d21 +Subproject commit 4bcc820a8b316c177cc5d82ee5edbbe0ac551814