From 58fab0efe020a94deb33832080914d5af980ce5a Mon Sep 17 00:00:00 2001 From: Trishansh Bhardwaj Date: Fri, 21 Jan 2022 22:09:13 +0530 Subject: [PATCH] msm: camera: common: Add camera banner camera_banner contains compilation timestamp, which can be used to find mismatch between ramdump and symbols. CRs-Fixed: 3261129 Change-Id: I021f6f9417b227d07a4424f7522e27c8535b0363 Signed-off-by: Trishansh Bhardwaj --- .gitignore | 5 +++++ Makefile | 11 +++++++++++ drivers/camera_main.c | 6 ++++++ 3 files changed, 22 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..23071c5472 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +clangd* +.cache +compile_commands.json +cscope* +cam_generated_h diff --git a/Makefile b/Makefile index 1b53edbfa2..b8abb53c95 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,17 @@ KBUILD_OPTIONS += MODNAME=camera all: modules +CAMERA_COMPILE_TIME = $(shell date) +CAMERA_COMPILE_BY = $(shell whoami | sed 's/\\/\\\\/') +CAMERA_COMPILE_HOST = $(shell uname -n) + +cam_generated_h: $(shell find . -iname "*.c") $(shell find . -iname "*.h") $(shell find . -iname "*.mk") + echo '#define CAMERA_COMPILE_TIME "$(CAMERA_COMPILE_TIME)"' > cam_generated_h + echo '#define CAMERA_COMPILE_BY "$(CAMERA_COMPILE_BY)"' >> cam_generated_h + echo '#define CAMERA_COMPILE_HOST "$(CAMERA_COMPILE_HOST)"' >> cam_generated_h + +modules: cam_generated_h + modules dtbs: $(MAKE) -C $(KERNEL_SRC) M=$(M) modules $(KBUILD_OPTIONS) diff --git a/drivers/camera_main.c b/drivers/camera_main.c index 0786f85e53..58c8bc8233 100644 --- a/drivers/camera_main.c +++ b/drivers/camera_main.c @@ -60,6 +60,11 @@ #include "cam_csid_ppi100.h" #include "camera_main.h" +#include "cam_generated_h" + +char camera_banner[] = "Camera-Banner: (" CAMERA_COMPILE_BY "@" + CAMERA_COMPILE_HOST ") (" CAMERA_COMPILE_TIME ")"; + #ifdef CONFIG_CAM_PRESIL extern int cam_presil_framework_dev_init_from_main(void); extern void cam_presil_framework_dev_exit_from_main(void); @@ -285,6 +290,7 @@ static int camera_init(void) int rc; uint i, j, num_inits; + CAM_INFO(CAM_UTIL, "%s", camera_banner); rc = camera_verify_submodules(); if (rc) goto end_init;