This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Fix build on older Linux kernel versions
ClosedPublic

Authored by kongyi on Jun 28 2022, 12:35 AM.

Details

Summary

PERF_COUNT_SW_DUMMY is introduced in Linux 3.12.

Diff Detail

Event Timeline

kongyi created this revision.Jun 28 2022, 12:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 28 2022, 12:35 AM
kongyi requested review of this revision.Jun 28 2022, 12:35 AM
jj10306 accepted this revision.Jun 28 2022, 5:13 AM

Thanks for fixing this!

@wallace perhaps in a followup diff we can add support for these older versions of Linux by just using an arbitrary PERF_COUNT_SW config to get access to the metadata page that contains the TSC conversion parameters? AFAIK the IntelPT code is the only code that uses this logic, so this doesn't really matter since kernel support for IntelPT was added in version 4.2, but if people want to use this logic in another context then this small change of supporting older kernel versions could be nice!

This revision is now accepted and ready to land.Jun 28 2022, 5:13 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJun 28 2022, 5:24 AM

thanks a good point, Jakob. Let's keep it in mind. Maybe we can bootcamp that

@kongyi thanks for fixing this!