Skip to content

ui: restore every probe setting when loading a record config - #7348

Open
LalitMaganti wants to merge 1 commit into
mainfrom
dev/lalitm/record
Open

ui: restore every probe setting when loading a record config#7348
LalitMaganti wants to merge 1 commit into
mainfrom
dev/lalitm/record

Conversation

@LalitMaganti

@LalitMaganti LalitMaganti commented Sep 6, 2026

Copy link
Copy Markdown
Member

Fixes #7347

@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown

Selecting a preset (or a saved config) only overwrote the settings that
the config mentioned. Everything else kept whatever the user had last
set, because deserializeProbes() iterated the settings present in the
config rather than the settings the probes declare, and because a
setting's deserialize() ignored an input it didn't like instead of going
back to its default.

That is how #7347 happens: the "Advanced ftrace config" probe is not
part of any preset, but cpu_sched pulls it in as a dependency, so
re-selecting the default config left the ftrace buffer size and the
"resolve kernel symbols" toggle at the values the user had typed, and
they showed up in the generated TraceConfig. The same held for every
other probe outside the loaded config, whose stale values would come
back as soon as the probe was re-enabled, and for clearSession(), which
cleared nothing.

Make deserialize() total: it must always end up setting the value, using
the default when the serialized state is missing or malformed. For the
sliders, toggles and textareas that is what their setValue(undefined) &
co. already meant, so they just route through it. deserializeProbes()
then walks the settings each probe declares and hands each one the value
from the config or undefined, which restores the default.

This also fixes a second instance of the same bug: the Chrome presets
store their categories in the legacy list-only format, whose back-compat
path used to leave the tags, the presets and the privacy toggle at the
values from the previously loaded config.

Adds a test that reproduces #7347 through the generated TraceConfig,
plus a generic one asserting that loading a config lands on exactly the
same state as loading it on a fresh record page, whatever was there
before. It walks every registered probe and every setting, including
those of the disabled probes that serializeProbes() cannot see, so
probes added later are covered too, and it fails for any setting whose
deserialize() is not total.

Fixes: #7347
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.

UI: selecting default config doesn't clear all changes, like ftrace buffer_size_kb and symbolize_ksyms

1 participant