-
Notifications
You must be signed in to change notification settings - Fork 349
Logger abi check #3195
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
Logger abi check #3195
Changes from all commits
5c6a8ae
a7cf0fd
b89b649
1eca05b
f14274a
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 |
|---|---|---|
|
|
@@ -59,6 +59,34 @@ if(NOT SOF_TAG) | |
| set(SOF_TAG 0) | ||
| endif() | ||
|
|
||
| # Calculate source hash value, used to check ldc file and firmware compatibility | ||
| if(EXISTS ${CMAKE_SOURCE_DIR}/.git/) | ||
| # list tracked files from src directory | ||
| execute_process(COMMAND git ls-files src | ||
| WORKING_DIRECTORY ${SOF_ROOT_SOURCE_DIRECTORY} | ||
| OUTPUT_FILE tracked_file_list | ||
| ) | ||
| # calculate hash of each listed files (from file version saved in file system) | ||
| execute_process(COMMAND git hash-object --stdin-paths | ||
| WORKING_DIRECTORY ${SOF_ROOT_SOURCE_DIRECTORY} | ||
| INPUT_FILE tracked_file_list | ||
| OUTPUT_FILE tracked_file_hash_list | ||
| ) | ||
| # then calculate single hash of previously calculated hash list | ||
| execute_process(COMMAND git hash-object --stdin | ||
| WORKING_DIRECTORY ${SOF_ROOT_SOURCE_DIRECTORY} | ||
| OUTPUT_STRIP_TRAILING_WHITESPACE | ||
| INPUT_FILE tracked_file_hash_list | ||
| OUTPUT_VARIABLE SOF_SRC_HASH_LONG | ||
| ) | ||
| file(REMOVE tracked_file_list tracked_file_hash_list) | ||
| string(SUBSTRING ${SOF_SRC_HASH_LONG} 0 8 SOF_SRC_HASH) | ||
| message(STATUS "Source content hash: ${SOF_SRC_HASH}") | ||
| else() | ||
| set(SOF_SRC_HASH ${GIT_LOG_HASH}) | ||
| message(WARNING "Source content hash can't be calculated, use GIT_LOG_HASH") | ||
| endif() | ||
|
|
||
|
||
| # for SOF_BUILD | ||
| include(${CMAKE_CURRENT_LIST_DIR}/version-build-counter.cmake) | ||
|
|
||
|
|
@@ -69,6 +97,8 @@ function(sof_check_version_h) | |
| "#define SOF_MICRO ${SOF_MICRO}\n" | ||
| "#define SOF_TAG \"${SOF_TAG}\"\n" | ||
| "#define SOF_BUILD ${SOF_BUILD}\n" | ||
| "#define SOF_GIT_TAG \"${GIT_TAG}\"\n" | ||
| "#define SOF_SRC_HASH 0x${SOF_SRC_HASH}\n" | ||
| ) | ||
|
|
||
| if(EXISTS "${VERSION_H_PATH}") | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,6 +24,9 @@ | |
| #include <sof/trace/dma-trace.h> | ||
| #include <ipc/topology.h> | ||
| #include <ipc/trace.h> | ||
| #include <kernel/abi.h> | ||
| #include <user/abi_dbg.h> | ||
| #include <version.h> | ||
|
|
||
| #include <errno.h> | ||
| #include <stddef.h> | ||
|
|
@@ -335,6 +338,11 @@ int dma_trace_enable(struct dma_trace_data *d) | |
| d->enabled = 1; | ||
| schedule_task(&d->dmat_work, DMA_TRACE_PERIOD, DMA_TRACE_PERIOD); | ||
|
|
||
| /* it should be the very first sent log for easily identification */ | ||
| tr_info(&dt_tr, "FW ABI 0x%x DBG ABI 0x%x tag " SOF_GIT_TAG " src hash 0x%x (ldc hash " META_QUOTE(SOF_SRC_HASH) ")", | ||
| SOF_ABI_VERSION, SOF_ABI_DBG_VERSION, SOF_SRC_HASH); | ||
|
Collaborator
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. @ktrzcinx do you remember why you put both
Member
Author
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. They differ in case of using incompatible
Collaborator
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. Thanks @ktrzcinx !
Answering that part of my own question: they do but only when forcing |
||
| trace_flush(); | ||
|
|
||
| out: | ||
| platform_shared_commit(d, sizeof(*d)); | ||
|
|
||
|
|
||
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.
"Use" is imperative mood.