Skip to content

plugins/amdgpu: Cleanup env variable handling#3014

Open
tursulin wants to merge 1 commit into
checkpoint-restore:criu-devfrom
tursulin:cleanup-envvar-handling
Open

plugins/amdgpu: Cleanup env variable handling#3014
tursulin wants to merge 1 commit into
checkpoint-restore:criu-devfrom
tursulin:cleanup-envvar-handling

Conversation

@tursulin
Copy link
Copy Markdown

@tursulin tursulin commented May 4, 2026

This is not saving a lot of lines, just two, but perhaps the pattern of:

  kfd_fw_version_check = getenv_bool("KFD_FW_VER_CHECK", true);

Is somewhat cleaner than:

  /* Default Values */
  kfd_fw_version_check = true;
...
  getenv_bool("KFD_FW_VER_CHECK", &kfd_fw_version_check); 

I also make the helpers static and demote parsing errors to warnings since the execution does continue.

I am locally toying with the idea of adding a new env variable to ignore gpu id hence I spotted this cleanup opportunity.

cc @fdavid-amd

It is a bit tidier to make the helpers return the value instead of passing
in the pointer, so lets make them take the default and return the overall
result, allowing the call sites to consolidate into a single line.

While at it we make the helpers static since they are not used outside the
file and demote the parsing errors to warning log messages since the
plugin does continue operating.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.22%. Comparing base (9a1453b) to head (9788da3).
⚠️ Report is 1 commits behind head on criu-dev.

Additional details and impacted files
@@             Coverage Diff              @@
##           criu-dev    #3014      +/-   ##
============================================
- Coverage     57.22%   57.22%   -0.01%     
============================================
  Files           154      154              
  Lines         40440    40441       +1     
  Branches       8863     8863              
============================================
  Hits          23142    23142              
- Misses        17034    17035       +1     
  Partials        264      264              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@avagin avagin requested a review from fdavid-amd May 6, 2026 00:00
@avagin avagin added the gpu/amd label May 6, 2026
@avagin
Copy link
Copy Markdown
Member

avagin commented May 6, 2026

LGTM

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants