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

[debug dump util] Techsupport addition #1669

Merged
merged 7 commits into from
Sep 7, 2021

Conversation

vivekrnv
Copy link
Contributor

@vivekrnv vivekrnv commented Jun 11, 2021

Signed-off-by: Vivek Reddy Karri [email protected]

DEBUG DUMP UTIL PR SEQ: 4

NOTE: PLEASE MERGE #1668 BEFORE MERGING THIS

What I did

HLD for Dump Utility: HLD.
For More info on Tech Support Addition: TechSupport

How I did it

Module Names are retrieved by parsing the output of dump state --show command.

Eg:

root@sonic:~# dump state  --help
Usage: dump state [OPTIONS] MODULE IDENTIFIER

  Dump the redis-state of the identifier for the module specified

Options:
............
 -s, --show            Display Modules Available
............

root@sonic:~$ dump state --show
Module    Identifier
--------  ------------
copp      trap_id
port      port_name

How to verify it

root@sonic-dev:~# show techsupport --debug-dump
root@sonic-dev:~# tar -xvzf /var/dump/sonic_dump_sonic-dev-69_20210525_055031.tar.gz
root@sonic-dev:~/sonic_dump_sonic-dev-69_20210525_055031# ls -l dump/ | grep unified_view
drwxr-xr-x 2 root root    4096 May 25 06:05 unified_view_dump
root@sonic-dev:~/sonic_dump_sonic-dev-69_20210525_055031# cd dump/unified_view_dump/
root@sonic-dev:~/sonic_dump_sonic-dev-69_20210525_055031/dump/unified_view_dump# ls
copp  port
root@sonic-dev:~/sonic_dump_sonic-dev-69_20210525_055031/dump/unified_view_dump# cat port

"Ethernet192": {
        "CONFIG_DB": {
            "keys": [
                "PORT|Ethernet192"
            ],
            "tables_not_found": []
        },
        "APPL_DB": {
            "keys": [
                "PORT_TABLE:Ethernet192"
            ],
            "tables_not_found": []
        },
        "ASIC_DB": {
            "keys": [
                "ASIC_STATE:SAI_OBJECT_TYPE_HOSTIF:oid:0xd000000000585",
                "ASIC_STATE:SAI_OBJECT_TYPE_PORT:oid:0x10000000002f7"
            ],
            "tables_not_found": [],
            "vidtorid": {
                "oid:0xd000000000585": "oid:0x180000000d",
                "oid:0x10000000002f7": "oid:0x1350000000001"
            }
        },
        "STATE_DB": {
            "keys": [
                "PORT_TABLE|Ethernet192"
            ],
            "tables_not_found": []
        }
    },
    "Ethernet64": {
        "CONFIG_DB": {
            "keys": [
                "PORT|Ethernet64"
            ],
            "tables_not_found": []
        },
        "APPL_DB": {
            "keys": [
                "PORT_TABLE:Ethernet64"
            ],
            "tables_not_found": []
        },
        "ASIC_DB": {
            "keys": [
                "ASIC_STATE:SAI_OBJECT_TYPE_HOSTIF:oid:0xd000000000575",
                "ASIC_STATE:SAI_OBJECT_TYPE_PORT:oid:0x1000000000420"
            ],
            "tables_not_found": [],
            "vidtorid": {
                "oid:0xd000000000575": "oid:0x80000000d",
                "oid:0x1000000000420": "oid:0x1590000000001"
            }
        },
        "STATE_DB": {
            "keys": [
                "PORT_TABLE|Ethernet64"
            ],
            "tables_not_found": []
        }
    },
    <Truncated>

Previous command output (if the output of a command-line utility has changed)

New command output (if the output of a command-line utility has changed)

vivekrnv added 4 commits May 25, 2021 06:11
Signed-off-by: Vivek Reddy Karri <[email protected]>
Signed-off-by: Vivek Reddy Karri <[email protected]>
Signed-off-by: Vivek Reddy Karri <[email protected]>
Signed-off-by: Vivek Reddy Karri <[email protected]>
@vivekrnv
Copy link
Contributor Author

Request for 202106

Copy link
Contributor

@SuvarnaMeenakshi SuvarnaMeenakshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@vivekrnv
Copy link
Contributor Author

lgtm

Changes in latest commit: made the collection of debug dump configurable in techsupport and is not enabled by default

@liat-grozovik
Copy link
Collaborator

@SuvarnaMeenakshi can you approve and merge?

Signed-off-by: Vivek Reddy Karri <[email protected]>
Copy link
Contributor

@SuvarnaMeenakshi SuvarnaMeenakshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@vivekrnv
Copy link
Contributor Author

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vivekrnv
Copy link
Contributor Author

vivekrnv commented Sep 7, 2021

@SuvarnaMeenakshi, Can you sign-off this pr?

@SuvarnaMeenakshi SuvarnaMeenakshi merged commit 26e700a into sonic-net:master Sep 7, 2021
SuvarnaMeenakshi pushed a commit that referenced this pull request Nov 10, 2021
What I did
Implemented vlan and vlan_member modules for debug dump utility.

How I did it
Used infrastructure and followed examples in
#1666
#1667
#1668
#1669
#1670

How to verify it
On switch: dump state vlan <vlan_name>
dump state vlan_member '<vlan_name|<member_name>'
Unit test: pytest-3 dump_tests/module_tests/vlan_test.py (same test file covers both vlan and vlan_member)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants