-
Notifications
You must be signed in to change notification settings - Fork 3
/
tracer-base
executable file
·94 lines (89 loc) · 1.85 KB
/
tracer-base
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/bash
function exit_error() {
local msg="$1"; shift
local code="$1"; shift
if [ -z "$code" ]; then
code=1
fi
echo '{"recipient":{"type":"all","id":"all"},"user-object":{"error": "'$msg'"}}' >msgs/tx/error
echo "$msg"
exit $code
}
function dump_runtime() {
echo env:
env
echo
echo "args: $@"
echo
echo "pwd:"
/bin/pwd
echo
echo "ls -alR:"
ls -alR
echo
echo "hostname: `hostname`"
echo
echo filesystems:
mount
echo
echo "ls -l /dev/hugepages"
/bin/ls -l /dev/hugepages
echo
echo "/proc/meminfo"
cat /proc/meminfo
echo
echo DPDK devices:
if ! command -v dpdk-devbind.py >& /dev/null; then
dpdk-devbind -s
else
dpdk-devbind.py -s
fi
echo
echo netdevs:
ls -l /sys/class/net
echo
echo ip a:
ip a
echo
echo "per-node-hugepages:"
for n in 0 1; do
path="/sys/devices/system/node/node$n/hugepages/hugepages-1048576kB"
echo $path
for i in `/bin/ls -1 $path`; do
echo $i:
cat $path/$i
done
done
echo "cpumask"
taskset -pc $$
}
function validate_label() {
id=`echo $RS_CS_LABEL | awk -F- '{print $2}'`
re='^[1-9][0-9]*$'
if [[ ! "$id" =~ $re ]]; then
exit_error "ID from label $RS_CS_LABEL must a be a positive interger"
fi
}
function validate_sw_prereqs() {
local missing=""
local bail=0
echo "Checking for SW deps"
bin="getopt"
if $bin -V >/dev/null 2>&1; then
echo "Found $bin"
else
bail=1
missing+=" $bin"
fi
# ip does not like -h
bin="ip"
if $bin a >/dev/null 2>&1; then
echo "Found $bin"
else
bail=1
missing+=" $bin"
fi
if [ $bail -eq 1 ]; then
exit_error "Could not find bin: $missing"
fi
}