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

Introducing 'debugging' and 'profiling' options in sonic build-infra #1782

Merged
merged 3 commits into from
Jun 19, 2018

Conversation

rodnymolina
Copy link
Contributor

With these changes, user can now specify how debian packages will be built in regards to the presence of symbols and compiler-optimizations. I'm simply relying on DEB_BUILD_OPTIONS flags as indicated here: https://www.debian.org/doc/debian-policy/#debian-rules-and-deb-build-options

By default we will continue to build packages as is the case today.

Example after compilation with debugging OFF
============================================

rmolina@server04:~/wsp_gitli_Apr_30_2018/sonic-buildimage$ #find src/ -type f -executable -exec file '{}' \; | egrep "executable,.* stripped" > ~/executable_stripped_files_before.txt

rmolina@server04:~/wsp_gitli_Jun_2_2018/sonic-buildimage$ egrep "src\/sonic-*" ~/executable_stripped_files_before.txt | egrep ", stripped"
src/sonic-swss/debian/swss/usr/bin/swssconfig: ELF 64-bit LSB  executable, x86-64, version 1 (GNU/Linux), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=38a4858d3c9c479e89b0ec4a4d8acbf6f19795c7, stripped
src/sonic-swss/debian/swss/usr/bin/orchagent: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=33c611d547817f786942685f8495654b680cfe66, stripped
src/sonic-swss/debian/swss/usr/bin/teamsyncd: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=696f44f38f3c2e7acd88acdc51220f210c72ae99, stripped
src/sonic-swss/debian/swss/usr/bin/neighsyncd: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=d9bf4097548830a795488db9dbe26dbf4f0e194b, stripped
src/sonic-swss/debian/swss/usr/bin/intfmgrd: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=09ef06341bc7748d62ad926479373726a191acf0, stripped
src/sonic-swss/debian/swss/usr/bin/swssplayer: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=685c29e90bf4a080ca104da3f11ee4bc8e21dbc1, stripped
src/sonic-swss/debian/swss/usr/bin/portsyncd: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=5089a919e03fb842e10e23ef4be77d4add215e32, stripped
src/sonic-swss/debian/swss/usr/bin/fpmsyncd: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=4cb4cdebda61921c3367584e965bb5d230466b42, stripped
src/sonic-swss/debian/swss/usr/bin/routeresync: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=5a161cfa375e0bba789068e7c661e160b18b8615, stripped
src/sonic-swss/debian/swss/usr/bin/vlanmgrd: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=a4c0b8b6ee8984da6827aa15fc305257ca868326, stripped
src/sonic-swss/debian/swss/usr/bin/buffermgrd: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=607d8d2cef930ccf89d649c895000c09dda59139, stripped
src/sonic-swss/debian/swss/usr/bin/intfsyncd: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=08d323095731fdae0667dd9b155090ecf8ef4804, stripped
src/sonic-linux-kernel/linux-3.16.51/debian/build/build_amd64_none_amd64/arch/x86/boot/compressed/vmlinux.bin: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), statically linked, BuildID[sha1]=613f30030d61a0b7e46f6631c76489533ffe5d81, stripped
src/sonic-sairedis/debian/syncd-rpc/usr/bin/syncd: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=05b889a134292f7f200352ec90742c72414c880a, stripped
src/sonic-sairedis/debian/syncd-rpc/usr/bin/syncd_request_shutdown: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=aa6dd0376c90c8c9fd4da8ba55c464d0bae4e102, stripped
src/sonic-sairedis/debian/syncd-rpc/usr/bin/saiplayer: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=174554fd3857460d09e3207d65b792f786367c93, stripped
src/sonic-sairedis/debian/syncd-rpc/usr/bin/saidump: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=36588b3870e7b579fba99101433c397a8f32cd9f, stripped
src/sonic-sairedis/debian/syncd-rpc/usr/bin/saisdkdump: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=4eaa3369298343a69729228f7aa81a1b6e9c2843, stripped
src/sonic-swss-common/debian/libswsscommon/usr/bin/swssloglevel: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=82aeca06ad2c54384fd98ce79c6c98d12f7bfec9, stripped

Example after compilation with debugging ON
============================================

rmolina@server04:~/wsp_gitli_Jun_2_2018/sonic-buildimage$ find src/ -type f -executable -exec file '{}' \; | egrep "executable,.* stripped" > ~/executable_stripped_files_after.txt

rmolina@server04:~/wsp_gitli_Jun_2_2018/sonic-buildimage$ egrep "src\/sonic-*" ~/executable_stripped_files_after.txt | egrep ", stripped"
src/sonic-linux-kernel/linux-3.16.51/debian/build/build_amd64_none_amd64/arch/x86/boot/compressed/vmlinux.bin: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), statically linked,

With these changes, user can now specify how debian packages will be built in regards to the presence of symbols and compiler-optimizations. I'm simply relying on DEB_BUILD_OPTIONS flags as indicated here: https://www.debian.org/doc/debian-policy/#debian-rules-and-deb-build-options

By default we will continue to build packages as is the case today.

Example after compilation with debugging OFF
============================================

rmolina@server04:~/wsp_gitli_Apr_30_2018/sonic-buildimage$ #find src/ -type f -executable -exec file '{}' \; | egrep "executable,.* stripped" > ~/executable_stripped_files_before.txt

rmolina@server04:~/wsp_gitli_Jun_2_2018/sonic-buildimage$ egrep "src\/sonic-*" ~/executable_stripped_files_before.txt | egrep ", stripped"
src/sonic-swss/debian/swss/usr/bin/swssconfig: ELF 64-bit LSB  executable, x86-64, version 1 (GNU/Linux), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=38a4858d3c9c479e89b0ec4a4d8acbf6f19795c7, stripped
src/sonic-swss/debian/swss/usr/bin/orchagent: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=33c611d547817f786942685f8495654b680cfe66, stripped
src/sonic-swss/debian/swss/usr/bin/teamsyncd: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=696f44f38f3c2e7acd88acdc51220f210c72ae99, stripped
src/sonic-swss/debian/swss/usr/bin/neighsyncd: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=d9bf4097548830a795488db9dbe26dbf4f0e194b, stripped
src/sonic-swss/debian/swss/usr/bin/intfmgrd: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=09ef06341bc7748d62ad926479373726a191acf0, stripped
src/sonic-swss/debian/swss/usr/bin/swssplayer: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=685c29e90bf4a080ca104da3f11ee4bc8e21dbc1, stripped
src/sonic-swss/debian/swss/usr/bin/portsyncd: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=5089a919e03fb842e10e23ef4be77d4add215e32, stripped
src/sonic-swss/debian/swss/usr/bin/fpmsyncd: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=4cb4cdebda61921c3367584e965bb5d230466b42, stripped
src/sonic-swss/debian/swss/usr/bin/routeresync: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=5a161cfa375e0bba789068e7c661e160b18b8615, stripped
src/sonic-swss/debian/swss/usr/bin/vlanmgrd: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=a4c0b8b6ee8984da6827aa15fc305257ca868326, stripped
src/sonic-swss/debian/swss/usr/bin/buffermgrd: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=607d8d2cef930ccf89d649c895000c09dda59139, stripped
src/sonic-swss/debian/swss/usr/bin/intfsyncd: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=08d323095731fdae0667dd9b155090ecf8ef4804, stripped
src/sonic-linux-kernel/linux-3.16.51/debian/build/build_amd64_none_amd64/arch/x86/boot/compressed/vmlinux.bin: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), statically linked, BuildID[sha1]=613f30030d61a0b7e46f6631c76489533ffe5d81, stripped
src/sonic-sairedis/debian/syncd-rpc/usr/bin/syncd: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=05b889a134292f7f200352ec90742c72414c880a, stripped
src/sonic-sairedis/debian/syncd-rpc/usr/bin/syncd_request_shutdown: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=aa6dd0376c90c8c9fd4da8ba55c464d0bae4e102, stripped
src/sonic-sairedis/debian/syncd-rpc/usr/bin/saiplayer: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=174554fd3857460d09e3207d65b792f786367c93, stripped
src/sonic-sairedis/debian/syncd-rpc/usr/bin/saidump: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=36588b3870e7b579fba99101433c397a8f32cd9f, stripped
src/sonic-sairedis/debian/syncd-rpc/usr/bin/saisdkdump: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=4eaa3369298343a69729228f7aa81a1b6e9c2843, stripped
src/sonic-swss-common/debian/libswsscommon/usr/bin/swssloglevel: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=82aeca06ad2c54384fd98ce79c6c98d12f7bfec9, stripped

Example after compilation with debugging ON
============================================

rmolina@server04:~/wsp_gitli_Jun_2_2018/sonic-buildimage$ find src/ -type f -executable -exec file '{}' \; | egrep "executable,.* stripped" > ~/executable_stripped_files_after.txt

rmolina@server04:~/wsp_gitli_Jun_2_2018/sonic-buildimage$ egrep "src\/sonic-*" ~/executable_stripped_files_after.txt | egrep ", stripped"
src/sonic-linux-kernel/linux-3.16.51/debian/build/build_amd64_none_amd64/arch/x86/boot/compressed/vmlinux.bin: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), statically linked,
ifeq ($(SONIC_PROFILING_ON),y)
DEB_BUILD_OPTIONS_GENERIC := "nostrip noopt"
endif

Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to have both options enabled at the same time?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why would you want to do that? 'profiling' option is a superset of 'debugging' one, so i can't think about a use-case to enable both. Let me know if i didn't understand your question correctly.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the concern is that the 'profiling' option is a superset of 'debugging, yet there is nothing preventing someone from enabling both. Maybe just enhance the comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it. I'll clarify that in rules/config. Basically, if you enable both options, then only the 'superset' one (profiling) will be activated, as this one appears in slave.mk after 'debugging' option -- i placed them in this order on purpose.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Btw, just as an indication of how much larger sonic-broadcom.bin would get with 'debugging' option turned on: we are seeing an increment from the current ~420MB to ~495MB, which in our case definitely pays off to make our life easier at t-shooting time -- in fact we left 'debugging' option enabled by default.

rules/config Outdated
# Debugging option allows sonic debian packages to get built including symbols
# information. Profiling option, disables compiler optimizations (-O0) as well
# as includes symbols information too.
#SONIC_DEBUGGING_ON = y
Copy link
Contributor

@jleveque jleveque Jun 13, 2018

Choose a reason for hiding this comment

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

I feel as though SONIC_DEBUGGING_ON is a bit confusing, as we also have the SONIC_CONFIG_DEBUG option at line 43, which installs helpful packages for debugging.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What about adding a better a description for SONIC_CONFIG_DEBUG option too? i can do something like: s/install debug packages/Install linux debugging tools/

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or we can also change SONIC_DEBUGGING_ON to something else. Let me know if have a better name for this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe change SONIC_CONFIG_DEBUG to something like SONIC_CONFIG_DEBUG_TOOLS, SONIC_CONFIG_INSTALL_DEBUG_TOOLS or SONIC_INSTALL_DEBUG_TOOLS?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will go ahead with this one: SONIC_INSTALL_DEBUG_TOOLS

Just to double-check, I went ahead and activated the new SONIC_INSTALL_DEBUG_TOOLS option (which replaces old SONIC_CONFIG_DEBUG one), and built a new image to verify that everything is working fine (debugging tools are being added to all dockers).
rules/config Outdated
@@ -56,5 +56,13 @@ SONIC_ROUTING_STACK = quagga
# Enable Origanization Extensions - Specific to the deployment scenarios of the Organization
ENABLE_ORGANIZATION_EXTENSIONS = y

# Debugging option allows sonic debian packages to get built including symbols
# information. Profiling option, disables compiler optimizations (-O0) as well
# as includes symbols information. Being 'profiling' option a superset of
Copy link
Contributor

Choose a reason for hiding this comment

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

Being 'profiling' option is a superset... [Missing "is"]

@jleveque jleveque merged commit b5f153b into sonic-net:master Jun 19, 2018
qiluo-msft pushed a commit that referenced this pull request Aug 31, 2021
)

7041400 [config reload] Call systemctl reset-failed for snmp,telemetry,mgmt-framework services (#1773) (#1786)
399d370 Fix logic in RIF counters print (#1732)
8329544 [vnet_route_check] don't hardcode prefix length of /24 (#1756)
193b028 [neighbor-advertiser] delete the tunnel maps appropriately (#1663)
2c82bcf [neighbor_advertiser] Use existing tunnel if present for creating tunnel mappings (#1589)
8e22960 [202012][Config] Update config command of Kdump. (#1778)
be3e5c6 [show][config] cli refactor for muxcable with abstract class implementation from vendors (#1722) (#1782)
lguohan pushed a commit that referenced this pull request Sep 2, 2021
Commits on Aug 17, 2021
[VS Test] Skip flaky tests (#1875) f501e1c
Skipping another flaky test temporarily (#1878) 15a014b

Commits on Aug 18, 2021
Change rif_rates.lua and port_rates.lua scripts to calculate rates co… ed867b1

Commits on Aug 20, 2021
[ACL] Match TCP protocol while matching TCP_FLAG (#1854) 756471a

Commits on Aug 23, 2021
[macsecmgrd] MACsec XPN changes (#1821) 4bf3d61

Commits on Aug 24, 2021
[ci]: fix artifacts download from swss-common and sairedis (#1882) 12f0ee7

Commits on Aug 26, 2021
[gearbox] Set port speed to SAI_PORT_ATTR_SPEED for gearbox (#1785) fc6cd81
[fpmsyncd][MPLS] updates for MPLS plus AZP libnl3 install (#1871) 76e3406

Commits on Aug 27, 2021
Fix vs test failure in test_buffer_traditional (#1881) db9ca83

Commits on Aug 31, 2021
[buffer orch] Bugfix: Don't query counter SAI_BUFFER_POOL_STAT_XOFF_R… 3d6b1f0

Commits on Sep 01, 2021
[pbh]: Add PBH OA (#1782) eb79ca4 

Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
lguohan added a commit to lguohan/sonic-buildimage that referenced this pull request Sep 10, 2021
retreat two commits which cause warm reboot regression

* eb79ca4 2021-09-01 | [pbh]: Add PBH OA (sonic-net#1782) [Nazarii Hnydyn]
* 3d6b1f0 2021-08-31 | [buffer orch] Bugfix: Don't query counter SAI_BUFFER_POOL_STAT_XOFF_ROOM_WATERMARK_BYTES on a pool where it is not supported (sonic-net#1857) [Stephen Sun]

Signed-off-by: Guohan Lu <lguohan@gmail.com>
lguohan added a commit that referenced this pull request Sep 11, 2021
Fix #8722

retreat two commits which cause warm reboot regression

* eb79ca4 2021-09-01 | [pbh]: Add PBH OA (#1782) [Nazarii Hnydyn]
* 3d6b1f0 2021-08-31 | [buffer orch] Bugfix: Don't query counter SAI_BUFFER_POOL_STAT_XOFF_ROOM_WATERMARK_BYTES on a pool where it is not supported (#1857) [Stephen Sun]

Signed-off-by: Guohan Lu <lguohan@gmail.com>
theasianpianist pushed a commit to theasianpianist/sonic-buildimage that referenced this pull request Feb 5, 2022
* [pbh]: Add PBH OA.
* [pbh]: Helper and PBH Container

Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants