You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[generate_dump] Optimize the execution time of 'show techsupport' CLI by paraller function execution (#2565)
- What I did
Optimize the execution time of the 'show techsupport' script.
- How I did it
The show techsupport CLI command calls the generate_dump bash script. In the script, there are a many functions that do the next scenario:
1. Run some CLI command
2. Save output from step 1 to the temporary file
3. Append the temporary file from step 2 to the `/var/dump/sonic_dump_XXXX.tar` file
4. Delete the temporary file from step 2
This PR will add the execution of these functions in parallel manner. Also, it will not spawn too many processes to not waste all CPU time.
- How to verify it
First test scenario
Run the `time show techsupport` CLI command and compare the execution time to the original script (with no parallelism), the execution time will be decreased by 10-20%.
Second test scenario
1. Stuck the FW by using next commands
a. mcra /dev/mst/mt52100_pci_cr0 0xa01e4 0x10
b. mcra /dev/mst/mt52100_pci_cr0 0xa05e4 0x10
c. mcra /dev/mst/mt52100_pci_cr0 0xa07e4 0x10
d. mcra /dev/mst/mt52100_pci_cr0 0xa09e4 0x10
e. mcra /dev/mst/mt52100_pci_cr0 0xa0be4 0x10
f. mcra /dev/mst/mt52100_pci_cr0 0xa0de4 0x10
g. mcra /dev/mst/mt52100_pci_cr0 0xa0fe4 0x10
2. Run the `time show techsupport` CLI command and compare the execution time to the original script (with no parallelism), the execution time will be decreased by up to 50% because inside the script we launch CLI commands with `timeout --foreground 5m`.
Signed-off-by: Vadym Hlushko <[email protected]>
0 commit comments