Build directory search lists once instead of parsing strings#290
Open
quic-parihar wants to merge 1 commit intoqualcomm:developmentfrom
Open
Build directory search lists once instead of parsing strings#290quic-parihar wants to merge 1 commit intoqualcomm:developmentfrom
quic-parihar wants to merge 1 commit intoqualcomm:developmentfrom
Conversation
337158e to
89d3060
Compare
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. Signed-off-by: Abhinav Parihar <parihar@qti.qualcomm.com>
89d3060 to
431f7d8
Compare
ekanshibu
requested changes
Feb 18, 2026
| FARF(RUNTIME_RPC_LOW, "Entering %s", __func__); | ||
|
|
||
| pthread_mutex_lock(&global_dirlist_mt); | ||
|
|
Contributor
There was a problem hiding this comment.
too many empty lines in this function
| #define DELIM ";" | ||
|
|
||
| /** | ||
| * Helper function to add a path to a global directory list |
Contributor
There was a problem hiding this comment.
function header is not proper
| }; | ||
|
|
||
| /** | ||
| * @brief Try to open a file from the global directory list |
Contributor
There was a problem hiding this comment.
follow the standard commenting guideline
| /** | ||
| * @brief Structure to hold a single directory path in the global list | ||
| */ | ||
| struct dir_path_node { |
Contributor
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; |
Contributor
There was a problem hiding this comment.
should this be VENDOR_DSP_LOCATION instead of VENDOR_DOM_LOCATION
| } | ||
|
|
||
| if (path_len > 0) { | ||
| strncpy(single_path, path_start, path_len); |
Contributor
There was a problem hiding this comment.
can path_len become >=PATH_MAX?
| @@ -5,6 +5,7 @@ | |||
| #define __APPS_STD_INTERNAL_H__ | |||
|
|
|||
Contributor
There was a problem hiding this comment.
Can this be split into multiple commits
| use_avs_list = 1; | ||
| } | ||
|
|
||
| if (use_global_list) { |
Contributor
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.