Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Add FW dump with new SAI implementation (#1338)" #4

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions clear/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ def get_routing_stack():
proc = subprocess.Popen(command,
stdout=subprocess.PIPE,
shell=True,
text=True,
stderr=subprocess.STDOUT)
text=True)
stdout = proc.communicate()[0]
proc.wait()
result = stdout.rstrip('\n')
Expand Down
11 changes: 5 additions & 6 deletions scripts/generate_dump
Original file line number Diff line number Diff line change
Expand Up @@ -711,12 +711,11 @@ collect_mellanox() {
${CMD_PREFIX}docker exec syncd tar Ccf $(dirname $sai_dump_filename) - $(basename $sai_dump_filename) | tar Cxf /tmp/ -
save_file $sai_dump_filename sai_sdk_dump true

file_list_string=$(${CMD_PREFIX}docker exec -it syncd ls -l /tmp | grep sdkdump | awk '{print $9}' | tr -d '\r')
file_list_array=( $file_list_string )
for element in "${file_list_array[@]}"
do
docker cp syncd:/tmp/$element /tmp
save_file /tmp/$element sai_sdk_dump true
local mst_dump_filename="/tmp/mstdump"
local max_dump_count="3"
for i in $(seq 1 $max_dump_count); do
${CMD_PREFIX}/usr/bin/mstdump /dev/mst/mt*conf0 > "${mst_dump_filename}${i}"
save_file "${mst_dump_filename}${i}" mstdump true
done
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/route_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def filter_out_local_interfaces(keys):
:return keys filtered out of local
"""
rt = []
local_if_re = ['eth0', 'lo', 'docker0', 'Loopback\d+']
local_if_re = ['eth0', 'lo', 'docker0', 'tun0', 'Loopback\d+']

db = swsscommon.DBConnector(APPL_DB_NAME, 0)
tbl = swsscommon.Table(db, 'ROUTE_TABLE')
Expand Down
13 changes: 8 additions & 5 deletions scripts/storyteller
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ regex_dict = {
'crash' : 'what\|unexpected exception\|notify_OA_about_syncd_exception\|SIG\|not expected',
'interface' : 'updatePortOperStatus\|Configure .* to',
'lag' : 'link becomes\|addLag',
'reboot' : 'BOOT\|rc.local\|old_config\|minigraph.xml\|Rebooting\|reboot\|executeOperationsOnAsic\|getAsicView\|dumpVidToAsicOperatioId',
'reboot' : 'BOOT\|rc.local\|old_config\|minigraph.xml\|Rebooting\|reboot\|executeOperationsOnAsic\|getAsicView\|dumpVidToAsicOperatioId\|neighbor_adv\|Pausing\|shutdown\|warm',
'service' : 'Starting\|Stopping\|Started\|Stopped',
}


def exec_cmd(cmd):
out = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True, text=True)
# Use universal_newlines (instead of text) so that this tool can work with any python versions.
out = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True, universal_newlines=True)
stdout, stderr = out.communicate()
return out.returncode, stdout, stderr

Expand All @@ -37,9 +38,9 @@ def build_options(after=0, before=0, context=0):
return ' '.join(x for x in options)


def find_log(log, regex, after=0, before=0, context=0):
def find_log(logpath, log, regex, after=0, before=0, context=0):
options = build_options(after, before, context)
cmd = 'ls -rt /var/log/{}* | xargs zgrep -a {} "{}"'.format(log, options, regex)
cmd = 'ls -rt {}/{}* | xargs zgrep -a {} "{}"'.format(logpath, log, options, regex)
_, out, _ = exec_cmd(cmd)
'''
Opportunity to improve:
Expand All @@ -66,6 +67,8 @@ def main():
type=str, required=False, default='syslog')
parser.add_argument('-c', '--category', help='Categories: bgp, crash, interface, lag, reboot, service Specify multiple categories as c1,c2,c3; default: reboot',
type=str, required=False, default='reboot')
parser.add_argument('-p', '--logpath', help='log file path, e.g. /var/log; default: /var/log',
type=str, required=False, default='/var/log')
parser.add_argument('-A', '--after', help='Show N lines after match',
type=int, required=False, default=0)
parser.add_argument('-B', '--before', help='Show N lines before match',
Expand All @@ -78,7 +81,7 @@ def main():
log = args.log
reg = build_regex(args.category)

find_log(log, reg, args.after, args.before, args.context)
find_log(args.logpath, log, reg, args.after, args.before, args.context)


if __name__ == '__main__':
Expand Down
3 changes: 1 addition & 2 deletions show/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ def get_routing_stack():
proc = subprocess.Popen(command,
stdout=subprocess.PIPE,
shell=True,
text=True,
stderr=subprocess.STDOUT)
text=True)
stdout = proc.communicate()[0]
proc.wait()
result = stdout.rstrip('\n')
Expand Down