facebookincubator / dynolog

Dynolog is a telemetry daemon for performance monitoring and tracing. It exports metrics from different components in the system like the linux kernel, CPU, disks, Intel PT, GPUs etc. Dynolog also integrates with pytorch and can trigger traces for distributed training applications.
MIT License
227 stars 34 forks source link

Fix indirect include that breaks with gcc 12 #170

Closed zwood-meta closed 11 months ago

zwood-meta commented 11 months ago

Summary: When testing the open source build, an error was found when building with GCC 12. This error stems from an indirect header inclusion that works in GCC 11, but is no longer available in GCC 12. The build error in GCC 12 is:

FAILED: hbt/src/perf_event/tests/CMakeFiles/CpuEventsGroupTest.dir/CpuEventsGroupTest.cpp.o
...
hbt/src/perf_event/CpuEventsGroup.h:407:16: error: ‘exchange’ is not a member of ‘std’
  407 |       : t(std::exchange(other.t, nullptr)) {
      |                ^~~~~~~~

This diff fixes the issue by directly including the <utility> header for the usage of std::exchange in the CpuEventsGroup.h file.

Differential Revision: D48089821

facebook-github-bot commented 11 months ago

This pull request was exported from Phabricator. Differential Revision: D48089821

facebook-github-bot commented 11 months ago

This pull request was exported from Phabricator. Differential Revision: D48089821

facebook-github-bot commented 11 months ago

This pull request was exported from Phabricator. Differential Revision: D48089821

facebook-github-bot commented 11 months ago

This pull request has been merged in facebookincubator/dynolog@4544ba7fefd65424d0b404075c3701d12abcc3a2.