Skip to content

schedule: zephyr_dp_sched_app: fix build error in release builds#10954

Open
kv2019i wants to merge 1 commit into
thesofproject:mainfrom
kv2019i:202606-fix-ptl-prod-build
Open

schedule: zephyr_dp_sched_app: fix build error in release builds#10954
kv2019i wants to merge 1 commit into
thesofproject:mainfrom
kv2019i:202606-fix-ptl-prod-build

Conversation

@kv2019i

@kv2019i kv2019i commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

Release build fail when building with DP user-space implementation. Build fails as CONFIG_THREAD_MAX_NAME_LEN is not defined. Problem not affecting when building with debug enabled, and/or configurations where the feature is disabled.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a release-build compilation failure in the Zephyr DP user-space scheduler path by avoiding use of a thread-name-length Kconfig symbol when thread naming support is disabled.

Changes:

  • Guard DP thread naming code with #ifdef CONFIG_THREAD_NAME to prevent referencing CONFIG_THREAD_MAX_NAME_LEN when unavailable.

Comment on lines 414 to 423
static void scheduler_dp_thread_name_set(k_tid_t thread_id, struct processing_module *mod)
{
#ifdef CONFIG_THREAD_NAME
char name[CONFIG_THREAD_MAX_NAME_LEN];

snprintf(name, sizeof(name), "DP:%#x", mod->dev->ipc_config.id);

k_thread_name_set(thread_id, name);
#endif
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in V2.

@jsarha jsarha left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stupid that due to lacking CONFIG_THREAD_MAX_NAME_LEN definition we need to ifdef code out, bu it is what it is.

@lyakh lyakh left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

release builds don't define CONFIG_THREAD_NAME? Any particular reason for that?

Release builds fail when building with DP user-space implementation.
Build fails as CONFIG_THREAD_MAX_NAME_LEN is not defined. Problem
not affecting when building with debug enabled, and/or configurations
where the feature is disabled.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
@kv2019i kv2019i force-pushed the 202606-fix-ptl-prod-build branch from 3ee77a4 to 1c2850d Compare June 25, 2026 09:54
@kv2019i

kv2019i commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator Author

@jsarha wrote:

Stupid that due to lacking CONFIG_THREAD_MAX_NAME_LEN definition we need to ifdef code out, bu it is what it is.

A bit but makes sense as the k_thread_name_set() is a no-op so we'd be wasting cycles crafting a string in this case. Added a comment to clarify in V2.

@kv2019i

kv2019i commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator Author

@lyakh wrote:

release builds don't define CONFIG_THREAD_NAME? Any particular reason for that?

Thread name has been a debugging feature so far. @jsarha enabled it for thread analyzer (not a default option) and in SOF; it is only indirectly enabeld via CONFIG_DEBUG enabling coredump and Zephyr coredump code enabling thread info.

Somebody would have to look into cost if enabling for all configs. It seems to affect logging code and potentially elsewhere, but not looked into the cost in detail.

@kv2019i

kv2019i commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator Author

V2:

  • CI failed so had to repush
  • fixed the copilot review comment about unused parameters and added one clarifying comment

@lgirdwood

Copy link
Copy Markdown
Member

@lrudyX good to merge ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants