Build directory search lists once instead of parsing strings#290
Build directory search lists once instead of parsing strings#290quic-parihar wants to merge 3 commits intoqualcomm:developmentfrom
Conversation
337158e to
89d3060
Compare
89d3060 to
431f7d8
Compare
src/apps_std_imp.c
Outdated
| FARF(RUNTIME_RPC_LOW, "Entering %s", __func__); | ||
|
|
||
| pthread_mutex_lock(&global_dirlist_mt); | ||
|
|
There was a problem hiding this comment.
too many empty lines in this function
src/apps_std_imp.c
Outdated
| #define DELIM ";" | ||
|
|
||
| /** | ||
| * Helper function to add a path to a global directory list |
There was a problem hiding this comment.
function header is not proper
| }; | ||
|
|
||
| /** | ||
| * @brief Try to open a file from the global directory list |
There was a problem hiding this comment.
follow the standard commenting guideline
inc/apps_std_internal.h
Outdated
| /** | ||
| * @brief Structure to hold a single directory path in the global list | ||
| */ | ||
| struct dir_path_node { |
There was a problem hiding this comment.
if this is used only in apps_std_imp.c, better to move this there
| } | ||
| } | ||
| if (nErr) { | ||
| absNameLen = strlen(VENDOR_DOM_LOCATION) + shell_absNameLen + 1; |
There was a problem hiding this comment.
should this be VENDOR_DSP_LOCATION instead of VENDOR_DOM_LOCATION
There was a problem hiding this comment.
no it will be VENDOR_DOM_LOCATION, abs name is carrying vendor DSP + subsystem name
src/fastrpc_config_parser.c
Outdated
| } | ||
|
|
||
| if (path_len > 0) { | ||
| strncpy(single_path, path_start, path_len); |
There was a problem hiding this comment.
can path_len become >=PATH_MAX?
| @@ -5,6 +5,7 @@ | |||
| #define __APPS_STD_INTERNAL_H__ | |||
|
|
|||
There was a problem hiding this comment.
Can this be split into multiple commits
There was a problem hiding this comment.
yes will do that
| use_avs_list = 1; | ||
| } | ||
|
|
||
| if (use_global_list) { |
There was a problem hiding this comment.
this is confusing, you check for use_global_list and then pass use_avs_list to the function
There was a problem hiding this comment.
removing avs specific things altogether. We didn't find any use for them
431f7d8 to
fc06976
Compare
Convert ADSP library search paths from concatenated env/config strings into persistent QList-backed directory lists built at init time. This removes repeated parsing of ';' delimited path strings on every fopen call and avoids reconstructing combined search paths for each lookup. The new logic initializes global directory list during apps_std_init(). Paths from environment variables and config files are parsed once and stored as individual nodes. All file lookup APIs are updated to walk this list directly instead of reparsing a flat string. This improves efficiency, reduces string and handling complexity. Legacy behavior is preserved for custom environment variables that do not match the standard ADSP_* and DSP_* path names. Also update open_shell() to use the global list instead of constructing a temporary ";" delimited directory list. Signed-off-by: Abhinav Parihar <parihar@qti.qualcomm.com>
Previously, while parsing DSP library paths from the config YAML, we only prefixed CONFIG_BASE_DIR (/usr/share/qcom) to the first path. This caused subsequent relative paths to be left unresolved, leading to incomplete search coverage and potential library load failures. Update the parsing logic to: - Iterate over all semicolon-separated entries in dsp_lib_paths. - Prefix CONFIG_BASE_DIR to every relative path Signed-off-by: Abhinav Parihar <parihar@qti.qualcomm.com>
This patch removes Windows-style CRLF line terminators and converts the file to Unix-style LF line endings. No functional changes are made; this only normalizes formatting to match the project's coding conventions. Signed-off-by: Abhinav Parihar <parihar@qti.qualcomm.com>
fc06976 to
7df7879
Compare
|
Fixes: #270 |
Convert ADSP library and AVS search paths from concatenated env/config strings into persistent QList-backed directory lists built at init time. This removes repeated parsing of ';'-delimited path strings on every fopen call and avoids reconstructing combined search paths for each lookup.
The new logic initializes two global directory lists (library and AVS) during apps_std_init(). Paths from environment variables and config files are parsed once and stored as individual nodes. All file lookup APIs are updated to walk these lists directly instead of reparsing a flat string.
This improves efficiency, reduces string and handling complexity. Legacy behavior is preserved for custom environment variables that do not match the standard ADSP_* and DSP_* path names.
Also update open_shell() to use the global list instead of constructing a temporary ";"-delimited directory list.