-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Introducing 'debugging' and 'profiling' options in sonic build-infra #1782
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,6 +86,14 @@ else | |
$(warning PASSWORD given on command line: could be visible to other users) | ||
endif | ||
|
||
ifeq ($(SONIC_DEBUGGING_ON),y) | ||
DEB_BUILD_OPTIONS_GENERIC := "nostrip" | ||
endif | ||
|
||
ifeq ($(SONIC_PROFILING_ON),y) | ||
DEB_BUILD_OPTIONS_GENERIC := "nostrip noopt" | ||
endif | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it possible to have both options enabled at the same time? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
ifeq ($(SONIC_BUILD_JOBS),) | ||
override SONIC_BUILD_JOBS := $(SONIC_CONFIG_BUILD_JOBS) | ||
endif | ||
|
@@ -116,6 +124,8 @@ $(info "ENABLE_ORGANIZATION_EXTENSIONS" : "$(ENABLE_ORGANIZATION_EXTENSIONS)") | |
$(info "HTTP_PROXY" : "$(HTTP_PROXY)") | ||
$(info "HTTPS_PROXY" : "$(HTTPS_PROXY)") | ||
$(info "ENABLE_SYSTEM_TELEMETRY" : "$(ENABLE_SYSTEM_TELEMETRY)") | ||
$(info "SONIC_DEBUGGING_ON" : "$(SONIC_DEBUGGING_ON)") | ||
$(info "SONIC_PROFILING_ON" : "$(SONIC_PROFILING_ON)") | ||
$(info ) | ||
|
||
############################################################################### | ||
|
@@ -201,7 +211,7 @@ $(addprefix $(DEBS_PATH)/, $(SONIC_MAKE_DEBS)) : $(DEBS_PATH)/% : .platform $$(a | |
# Apply series of patches if exist | ||
if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && QUILT_PATCHES=../$(notdir $($*_SRC_PATH)).patch quilt push -a; popd; fi | ||
# Build project and take package | ||
make DEST=$(shell pwd)/$(DEBS_PATH) -C $($*_SRC_PATH) $(shell pwd)/$(DEBS_PATH)/$* $(LOG) | ||
DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS_GENERIC}" make DEST=$(shell pwd)/$(DEBS_PATH) -C $($*_SRC_PATH) $(shell pwd)/$(DEBS_PATH)/$* $(LOG) | ||
# Clean up | ||
if [ -f $($*_SRC_PATH).patch/series ]; then pushd $($*_SRC_PATH) && quilt pop -a -f; popd; fi | ||
$(FOOTER) | ||
|
@@ -224,8 +234,8 @@ $(addprefix $(DEBS_PATH)/, $(SONIC_DPKG_DEBS)) : $(DEBS_PATH)/% : .platform $$(a | |
pushd $($*_SRC_PATH) $(LOG) | ||
[ ! -f ./autogen.sh ] || ./autogen.sh $(LOG) | ||
$(if $($*_DPKG_TARGET), | ||
DEB_BUILD_OPTIONS=$($*_DEB_BUILD_OPTIONS) dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --as-root -T$($*_DPKG_TARGET) $(LOG), | ||
DEB_BUILD_OPTIONS=$($*_DEB_BUILD_OPTIONS) dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) $(LOG) | ||
DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS_GENERIC} ${$*_DEB_BUILD_OPTIONS}" dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) --as-root -T$($*_DPKG_TARGET) $(LOG), | ||
DEB_BUILD_OPTIONS="${DEB_BUILD_OPTIONS_GENERIC} ${$*_DEB_BUILD_OPTIONS}" dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) $(LOG) | ||
) | ||
popd $(LOG) | ||
# Clean up | ||
|
There was a problem hiding this comment.
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 theSONIC_CONFIG_DEBUG
option at line 43, which installs helpful packages for debugging.There was a problem hiding this comment.
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/
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 likeSONIC_CONFIG_DEBUG_TOOLS
,SONIC_CONFIG_INSTALL_DEBUG_TOOLS
orSONIC_INSTALL_DEBUG_TOOLS
?There was a problem hiding this comment.
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