瀏覽代碼

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 <[email protected]>
Trishansh Bhardwaj 3 年之前
父節點
當前提交
58fab0efe0
共有 3 個文件被更改,包括 22 次插入0 次删除
  1. 5 0
      .gitignore
  2. 11 0
      Makefile
  3. 6 0
      drivers/camera_main.c

+ 5 - 0
.gitignore

@@ -0,0 +1,5 @@
+clangd*
+.cache
+compile_commands.json
+cscope*
+cam_generated_h

+ 11 - 0
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)
 

+ 6 - 0
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;