Skip to content

DEBUG: debug.yml: enable FTrace settings in kernel cmdline#2155

Open
apateriy-qcom wants to merge 1 commit into
qualcomm-linux:masterfrom
apateriy-qcom:master
Open

DEBUG: debug.yml: enable FTrace settings in kernel cmdline#2155
apateriy-qcom wants to merge 1 commit into
qualcomm-linux:masterfrom
apateriy-qcom:master

Conversation

@apateriy-qcom
Copy link
Copy Markdown

@apateriy-qcom apateriy-qcom commented May 11, 2026

Add FTrace kernel cmdline options to ci/debug.yml for debug builds to enable tracing from early boot.

Problem

FTrace is off by default. On debug builds, timing-sensitive events (scheduler latency, IRQ storms, thermal throttling, clock/regulator transitions) happen during early init — before userspace can enable
tracing — and are lost.

Changes

  • Adds a cmdline section to local_conf_header in ci/debug.yml that appends FTrace options to KERNEL_CMDLINE_EXTRA for debug builds only.
  • The event list is stored in KERNEL_CMDLINE_EXTRA_FTRACE and referenced via ${KERNEL_CMDLINE_EXTRA_FTRACE} to keep the assignment readable.

FTrace Options

Option Reason
trace_event Captures timer, IRQ, workqueue, scheduler, clock, CPU frequency, regulator, thermal, and RPMh events — the subsystems most relevant to platform debug
trace_buf_size=5M Increases per-CPU ring buffer from 1 MB to 5 MB to reduce data loss under high-frequency event bursts
ftrace=tracing_on Enables the tracer at boot so early-init events are not missed

Impact

Debug builds only — no effect on release or performance builds.

@vkraleti
Copy link
Copy Markdown
Contributor

Please check and follow the same commit message pattern followed in this repository <file name>: <high level description>
Also commit message doesn't really mention the reason for the change.

@ricardosalveti
Copy link
Copy Markdown
Contributor

Please justify why you need these options in your commit message, and explain them as well.

@github-actions
Copy link
Copy Markdown

Test run workflow

Test jobs for commit 6974685

qcom-distro
Pass: 201 | Fail: 0 | Total: 229
qcom-distro_linux-qcom-6.18
Pass: 6 | Fail: 1 | Total: 7
nodistro
Pass: 9 | Fail: 0 | Total: 9

@test-reporting-app
Copy link
Copy Markdown

test-reporting-app Bot commented May 11, 2026

Test Results

   63 files    286 suites   2h 59m 52s ⏱️
   96 tests    89 ✅  1 💤 6 ❌
2 685 runs  2 661 ✅ 18 💤 6 ❌

For more details on these failures, see this check.

Results for commit 83c8d5e.

♻️ This comment has been updated with latest results.

Comment thread ci/debug.yml Outdated
DEBUG_BUILD = "1"

cmdline: |
KERNEL_CMDLINE_EXTRA:append = " trace_event=timer:timer_expire_entry,timer:timer_expire_exit,timer:hrtimer_cancel,timer:hrtimer_expire_entry,timer:hrtimer_expire_exit,timer:hrtimer_init,timer:hrtimer_start,irq:*,workqueue:*,sched:sched_migrate_task,sched:sched_pi_setprio,sched:sched_switch,sched:sched_wakeup,sched:sched_wakeup_new,power:clock_set_rate,power:clock_enable,power:clock_disable,power:cpu_frequency,regulator:*,thermal:thermal_zone_trip,thermal:thermal_temperature,thermal:cdev_update,rpmh:rpmh_send_msg trace_buf_size=5M ftrace=tracing_on"
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.

Given that the line is very long, use a new variable for it.

KERNEL_CMDLINE_EXTRA_FTRACE = "trace_event=..."
KERNEL_CMDLINE_EXTRA:append = " ${KERNEL_CMDLINE_EXTRA_FTRACE}"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

yes. Done. Thanks.

@apateriy-qcom apateriy-qcom force-pushed the master branch 2 times, most recently from 9386e40 to 83c8d5e Compare May 11, 2026 15:08
@apateriy-qcom
Copy link
Copy Markdown
Author

Please justify why you need these options in your commit message, and explain them as well.

added the reason in commit message and PR description.

ricardosalveti
ricardosalveti previously approved these changes May 11, 2026
@github-actions
Copy link
Copy Markdown

Test run workflow

Test jobs for commit 83c8d5e

qcom-distro
Pass: 212 | Fail: 1 | Total: 231
qcom-distro_linux-qcom-6.18
Pass: 6 | Fail: 1 | Total: 7
nodistro
Pass: 9 | Fail: 0 | Total: 9

Copy link
Copy Markdown
Contributor

@lumag lumag left a comment

Choose a reason for hiding this comment

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

I understand the intention, but for me it feels like having too special command line in a generic build.

Also, some (older) bootloaders might cut the command line. Please move the enablement options to the beginning of the line so that they are never cut off.

FTrace is off by default. On debug builds, timing-sensitive events
(scheduler latency, IRQ storms, thermal throttling, clock/regulator
transitions) happen during early init before userspace can enable
tracing, and are lost.

Enable the following FTrace options via KERNEL_CMDLINE_EXTRA:

- ftrace=tracing_on: enables the tracer at boot so early-init events
  are not missed
- trace_buf_size=5M: increases per-CPU ring buffer from 1 MB to 5 MB
  to reduce data loss under high-frequency event bursts
- trace_event: captures timer, IRQ, workqueue, scheduler, clock, CPU
  frequency, regulator, thermal, and RPMh events

ftrace=tracing_on and trace_buf_size=5M are placed at the beginning of
the cmdline so they are processed even if older bootloaders truncate
the kernel command line.

The event list is stored in KERNEL_CMDLINE_EXTRA_FTRACE and appended
to KERNEL_CMDLINE_EXTRA to keep the assignment readable.

These options apply to debug builds only and have no effect on release
or performance builds.

Signed-off-by: Anurag Pateriya <apateriy@qti.qualcomm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants