sonic-sairedis
sonic-sairedis copied to clipboard
add support for "sai_dbg_generate_dump" API
This update adds support for the sai_dbg_gen_dump API, enabling the generation of a debug dump file by the SAI when there is no SAI failure. For scenarios involving SAI failures, a separate flow called dump_on_sai_failure is available.
An HLD will be publish soon with all relevant PRs
please make build success, after that i will review this
please rebase to latest master
please rebase to latest master
Done
add HLD PR: https://github.com/sonic-net/SONiC/pull/1846
@aviramd can you fix whitespaces issue:
Checkig for white spaces ...
../proxylib/Sai.h:195:
../syncd/VendorSai.h:218: _In_ const char *dump_file_name) override;
../syncd/Syncd.cpp:412:
../syncd/Syncd.cpp:434:
../lib/ClientSai.cpp:1566:
../lib/ClientSai.cpp:1568:
../lib/Sai.cpp:788: return SAI_STATUS_FAILURE;
../lib/RedisRemoteSaiInterface.cpp:1923:
../lib/RedisRemoteSaiInterface.cpp:1926:
../lib/RedisRemoteSaiInterface.cpp:1932: m_recorder->recordDbgGenDumpResponse(status);
../lib/RedisRemoteSaiInterface.cpp:1936: return SAI_STATUS_SUCCESS;
../lib/Recorder.h:262: _In_ sai_status_t status);
../lib/ClientServerSai.cpp:648:
../lib/ClientServerSai.h:183: _In_ const char *dump_file_name) override;
../lib/ServerSai.h:188: _In_ const char *dump_file_name) override;
../lib/ServerSai.h:301: _In_ const swss::KeyOpFieldsValuesTuple &kco);
../vslib/VirtualSwitchSaiInterface.h:196: _In_ const char *dump_file_name) override;
../vslib/VirtualSwitchSaiInterface.h:197:
../vslib/Sai.h:198:
../meta/SaiInterface.h:338:
../meta/SaiInterface.h:341:
../meta/Meta.cpp:1427:
ERROR: some files contain white spaces at the end of line, please fix
FAIL: checkwhitespace.sh
You will also need to add some unit tests to satisfy code coverage
i hink you made some mistake, you only touch test file
i hink you made some mistake, you only touch test file
Yes you are right , i am working to fix it
you can try build this on your local machine to check whether it will compile first
I have some git issues on my local machine I am working to solve it , please ignore the last commit
Is it possible to execute the sairedis unit test locally? if yes how?
Is it possible to execute the sairedis unit test locally? if yes how?
Yes, type make check in local console
just to clarify "sai_dbg_generate_dump" function was not implemented in the first place, since it's passing path to where to make dump, and OA an syncd are running in different docker containers, so path passed BY OA maybe invalid in syncd container
just to clarify "sai_dbg_generate_dump" function was not implemented in the first place, since it's passing path to where to make dump, and OA an syncd are running in different docker containers, so path passed BY OA maybe invalid in syncd container
In this high-level design (HLD), the application uses a fixed path, /var/log/dbg_gen_dump.log, which is guaranteed to always exist. However, I can modify the code in the syncd container so that, before calling the SAI API, it ensures the path exists and creates it locally within the syncd container if necessary.
to avoid so many push commits please test everything locally type "make" and "make check" to run unittests locally
to avoid so many push commits please test everything locally type "make" and "make check" to run unittests locally
Is this the correct procedure for testing?
- Build the target.
- Run sonic-slave-bookworm-user.
- Inside the slave container, navigate to sonic/src/sonic-sairedis/tests.
- Run "make check". Should I install any packages after entering the slave Docker container?
Also, after building the target, a cleanup occurs, and the make file (which is auto-generated during the build) gets deleted. How can I prevent this from happening?
no, you don't need to build entire docker you can locally ./configure --with-sai=vs locally on your machine
no, you don't need to build entire docker you can locally ./configure --with-sai=vs locally on your machine
Thank you for your support! I tried running the command locally, but I encountered the following error when execute "make":
"libtool: compile: g++ ... -c AttrKeyMap.cpp -fPIC -DPIC -o .libs/libsaimeta_la-AttrKeyMap.o In file included from AttrKeyMap.cpp:3: sai_serialize.h:18:10: fatal error: swss/logger.h: No such file or directory" Any advice on how to resolve this would be appreciated!
Yes you need to install swss-common library also from source
no, you don't need to build entire docker you can locally ./configure --with-sai=vs locally on your machine
Thank you very much, I can run the tests now with 'make check'. Is it also possible to test the code coverage locally? I ran the configure command with the --enable-code-coverage=yes option. if yes, where can I see the results
no, you don't need to build entire docker you can locally ./configure --with-sai=vs locally on your machine
Thank you very much, I can run the tests now with 'make check'. Is it also possible to test the code coverage locally? I ran the configure command with the --enable-code-coverage=yes option. if yes, where can I see the results
results are done in *gcno *gcna files, but they need to be processed, in azure pipeline gcovr results are colleted and then putt tohether, in pipeline output is done in json, and then module is preenting them in nice form on github, locally you can generate nice html, take a look gcovr help: https://gcovr.com/en/stable/output/html.html
/azp run
Azure Pipelines successfully started running 1 pipeline(s).
/azp run
Azure Pipelines successfully started running 1 pipeline(s).
/azp run
Azure Pipelines successfully started running 1 pipeline(s).
/azp run
Azure Pipelines successfully started running 1 pipeline(s).
code coverage shows that dbgdump in syncd is not tested