Introducing 'debugging' and 'profiling' options in sonic build-infra#1782
Introducing 'debugging' and 'profiling' options in sonic build-infra#1782jleveque merged 3 commits intosonic-net:masterfrom
Conversation
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 | ||
|
|
There was a problem hiding this comment.
Is it possible to have both options enabled at the same time?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
| # 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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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/
There was a problem hiding this comment.
Or we can also change SONIC_DEBUGGING_ON to something else. Let me know if have a better name for this.
There was a problem hiding this comment.
Maybe change SONIC_CONFIG_DEBUG to something like SONIC_CONFIG_DEBUG_TOOLS, SONIC_CONFIG_INSTALL_DEBUG_TOOLS or SONIC_INSTALL_DEBUG_TOOLS?
There was a problem hiding this comment.
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
|
|
||
| # 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 |
There was a problem hiding this comment.
Being 'profiling' option is a superset... [Missing "is"]
) 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)
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
* [pbh]: Add PBH OA. * [pbh]: Helper and PBH Container Signed-off-by: Nazarii Hnydyn <[email protected]>
<!--
Please make sure you've read and understood our contributing guidelines:
https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md
** Make sure all your commits include a signature generated with `git
commit -s` **
If this is a bug fix, make sure your description includes "fixes #xxxx",
or
"closes #xxxx" or "resolves #xxxx"
Please provide the following information:
-->
#### Why I did it
To bring in latest fix for BRCM SAI
##### Work item tracking
- Microsoft ADO **(32398635)**:
#### How I did it
Pulled in following commits-
1. updated sai release version to 11.2.37.1
[SAI_BRANCH rel_ocp_sai_11_2] [CSP CS00012419987] Fabric link quality
and RQP_PACKET_REASSEMBLY interrupts
Root Cause: False data cell drop alert introduced.
2. updated sai release version to 11.2.38.1
[SAI_BRANCH rel_ocp_sai_11_2] [CSP CS00012420395
CS00012426701]backport SONIC-109437 to rel_ocp_sai_11_2: fix the
issue-Knet TX pkt was forwarded to wrong egress port after speed change
#### How to verify it
Verified on lab setup using sonic chassis
<!--
If PR needs to be backported, then the PR must be tested against the
base branch and the earliest backport release branch and provide tested
image version on these two branches. For example, if the PR is requested
for master, 202211 and 202012, then the requester needs to provide test
results on master and 202012.
-->
#### Which release branch to backport (provide reason below if selected)
<!--
- Note we only backport fixes to a release branch, *not* features!
- Please also provide a reason for the backporting below.
- e.g.
- [x] 202006
-->
- [ ] 201811
- [ ] 201911
- [ ] 202006
- [ ] 202012
- [ ] 202106
- [ ] 202111
- [ ] 202205
- [ ] 202211
#### Tested branch (Please provide the tested image version)
<!--
- Please provide tested image version
- e.g.
- [x] 20201231.100
-->
- [ ] <!-- image version 1 -->
- [ ] <!-- image version 2 -->
#### Description for the changelog
<!--
Write a short (one line) summary that describes the changes in this
pull request for inclusion in the changelog:
-->
<!--
Ensure to add label/tag for the feature raised. example - PR#2174 under
sonic-utilities repo. where, Generic Config and Update feature has been
labelled as GCU.
-->
#### Link to config_db schema for YANG module changes
<!--
Provide a link to config_db schema for the table for which YANG model
is defined
Link should point to correct section on
https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-yang-models/doc/Configuration.md
-->
#### A picture of a cute animal (not mandatory but encouraged)
Co-authored-by: Arvindsrinivasan Lakshmi Narasimhan <[email protected]>
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.