[sonic_debian_extension] install systemd-bootchart (#11047)

- Why I did it
Implemented sonic-net/SONiC#1001

- How I did it
Install systemd-bootchart tool and provide default config for it.

- How to verify it
Run build and verify systemd-bootchart is installed.

Signed-off-by: Stepan Blyschak <stepanb@nvidia.com>
This commit is contained in:
Stepan Blyshchak 2022-07-06 14:03:31 +03:00 committed by GitHub
parent 6f82935d8a
commit ef8675d7ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 42 additions and 3 deletions

View File

@ -43,6 +43,12 @@
# * ENABLE_AUTO_TECH_SUPPORT: Enable the configuration for event-driven techsupport & coredump mgmt feature # * ENABLE_AUTO_TECH_SUPPORT: Enable the configuration for event-driven techsupport & coredump mgmt feature
# * Default: y # * Default: y
# * Values: y,n # * Values: y,n
# * INCLUDE_BOOTCHART: Install SONiC bootchart
# * Default: y
# * Values: y,n
# * ENABLE_BOOTCHART: Enable SONiC bootchart
# * Default: n
# * Values: y,n
# #
############################################################################### ###############################################################################
@ -381,6 +387,8 @@ SONIC_BUILD_INSTRUCTION := make \
ENABLE_AUTO_TECH_SUPPORT=$(ENABLE_AUTO_TECH_SUPPORT) \ ENABLE_AUTO_TECH_SUPPORT=$(ENABLE_AUTO_TECH_SUPPORT) \
BUILD_MULTIASIC_KVM=$(BUILD_MULTIASIC_KVM) \ BUILD_MULTIASIC_KVM=$(BUILD_MULTIASIC_KVM) \
ENABLE_ASAN=$(ENABLE_ASAN) \ ENABLE_ASAN=$(ENABLE_ASAN) \
SONIC_INCLUDE_BOOTCHART=$(INCLUDE_BOOTCHART) \
SONIC_ENABLE_BOOTCHART=$(ENABLE_BOOTCHART) \
ENABLE_FIPS_FEATURE=$(ENABLE_FIPS_FEATURE) \ ENABLE_FIPS_FEATURE=$(ENABLE_FIPS_FEATURE) \
ENABLE_FIPS=$(ENABLE_FIPS) \ ENABLE_FIPS=$(ENABLE_FIPS) \
SONIC_SLAVE_DOCKER_DRIVER=$(SONIC_SLAVE_DOCKER_DRIVER) \ SONIC_SLAVE_DOCKER_DRIVER=$(SONIC_SLAVE_DOCKER_DRIVER) \

View File

@ -427,6 +427,18 @@ sudo chmod og-rw $FILESYSTEM_ROOT_ETC_SONIC/core_analyzer.rc.json
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install libffi-dev libssl-dev sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install libffi-dev libssl-dev
{% if include_bootchart == 'y' %}
sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install systemd-bootchart
sudo tee $FILESYSTEM_ROOT_ETC/systemd/bootchart.conf > /dev/null <<EOF
[Bootchart]
Samples=4500
Frequency=25
EOF
{% if enable_bootchart == 'y' %}
sudo LANG=C chroot $FILESYSTEM_ROOT systemctl enable systemd-bootchart
{% endif %}
{% endif %}
if [[ $CONFIGURED_ARCH == armhf ]]; then if [[ $CONFIGURED_ARCH == armhf ]]; then
# The azure-storage package depends on the cryptography package. Newer # The azure-storage package depends on the cryptography package. Newer
# versions of cryptography require the rust compiler, the correct version # versions of cryptography require the rust compiler, the correct version

View File

@ -228,6 +228,12 @@ ENABLE_ASAN ?= n
# reset default container registry from dockerhub to other # reset default container registry from dockerhub to other
DEFAULT_CONTAINER_REGISTRY ?= DEFAULT_CONTAINER_REGISTRY ?=
# INCLUDE_BOOTCHART - install systemd-bootchart
INCLUDE_BOOTCHART = y
# ENABLE_BOOTCHART - whether to enable systemd-bootchart on boot
ENABLE_BOOTCHART = n
# ENABLE_FIPS_FEATURE - support FIPS feature, only for amd64 or arm64, armhf not supported yet # ENABLE_FIPS_FEATURE - support FIPS feature, only for amd64 or arm64, armhf not supported yet
# ENABLE_FIPS - support FIPS flag, if enabled, no additional config requred for the image to support FIPS # ENABLE_FIPS - support FIPS flag, if enabled, no additional config requred for the image to support FIPS
ENABLE_FIPS_FEATURE ?= y ENABLE_FIPS_FEATURE ?= y

View File

@ -191,6 +191,15 @@ ifeq ($(SONIC_INCLUDE_MUX),y)
INCLUDE_MUX = y INCLUDE_MUX = y
endif endif
ifeq ($(SONIC_INCLUDE_BOOTCHART),y)
INCLUDE_BOOTCHART = y
endif
ifeq ($(SONIC_ENABLE_BOOTCHART),y)
ENABLE_BOOTCHART = y
endif
ifeq ($(ENABLE_ASAN),y) ifeq ($(ENABLE_ASAN),y)
ifneq ($(CONFIGURED_ARCH),amd64) ifneq ($(CONFIGURED_ARCH),amd64)
@echo "Disabling SWSS address sanitizer due to incompatible CPU architecture: $(CONFIGURED_ARCH)" @echo "Disabling SWSS address sanitizer due to incompatible CPU architecture: $(CONFIGURED_ARCH)"
@ -335,6 +344,8 @@ $(info "INCLUDE_P4RT" : "$(INCLUDE_P4RT)")
$(info "INCLUDE_KUBERNETES" : "$(INCLUDE_KUBERNETES)") $(info "INCLUDE_KUBERNETES" : "$(INCLUDE_KUBERNETES)")
$(info "INCLUDE_MACSEC" : "$(INCLUDE_MACSEC)") $(info "INCLUDE_MACSEC" : "$(INCLUDE_MACSEC)")
$(info "INCLUDE_MUX" : "$(INCLUDE_MUX)") $(info "INCLUDE_MUX" : "$(INCLUDE_MUX)")
$(info "INCLUDE_BOOTCHART : "$(INCLUDE_BOOTCHART)")
$(info "ENABLE_BOOTCHART : "$(ENABLE_BOOTCHART)")
$(info "ENABLE_FIPS_FEATURE" : "$(ENABLE_FIPS_FEATURE)") $(info "ENABLE_FIPS_FEATURE" : "$(ENABLE_FIPS_FEATURE)")
$(info "TELEMETRY_WRITABLE" : "$(TELEMETRY_WRITABLE)") $(info "TELEMETRY_WRITABLE" : "$(TELEMETRY_WRITABLE)")
$(info "ENABLE_AUTO_TECH_SUPPORT" : "$(ENABLE_AUTO_TECH_SUPPORT)") $(info "ENABLE_AUTO_TECH_SUPPORT" : "$(ENABLE_AUTO_TECH_SUPPORT)")
@ -1152,6 +1163,8 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \
$(shell [[ ! -z '$($(component)_VERSION)' && ! -z '$($(component)_NAME)' ]] && \ $(shell [[ ! -z '$($(component)_VERSION)' && ! -z '$($(component)_NAME)' ]] && \
echo $($(component)_NAME)==$($(component)_VERSION)))" echo $($(component)_NAME)==$($(component)_VERSION)))"
export include_mux="$(INCLUDE_MUX)" export include_mux="$(INCLUDE_MUX)"
export include_bootchart="$(INCLUDE_BOOTCHART)"
export enable_bootchart="$(ENABLE_BOOTCHART)"
$(foreach docker, $($*_DOCKERS),\ $(foreach docker, $($*_DOCKERS),\
export docker_image="$(docker)" export docker_image="$(docker)"
export docker_image_name="$(basename $(docker))" export docker_image_name="$(basename $(docker))"