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
260 stars 38 forks source link

Fix deprecated this capture in hbt/src/mon/TraceCollector.h #202

Closed r-barnes closed 9 months ago

r-barnes commented 9 months ago

Summary: In the future LLVM will require that lambdas capture this explicitly. -Wdeprecated-this-capture checks for and enforces this now.

This diff adds an explicit this capture to a lambda to fix an issue that presents similarly to this:

   -> fbcode/path/to/my_file.cpp:66:47: error: implicit capture of 'this' with a capture default of '=' is deprecated [-Werror,-
Wdeprecated-this-capture]
   ->           detail::createIOWorkerProvider(evb, requestsRegistry_);
   ->                                               ^
   -> fbcode/path/to/my_file.cpp:61:30: note: add an explicit capture of 'this' to capture '*this' by reference
   ->   evb->runInEventBaseThread([=, self_weak = std::move(self_weak)]() {
   ->                              ^
   ->                               , this

Reviewed By: meyering

Differential Revision: D52279219

facebook-github-bot commented 9 months ago

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

facebook-github-bot commented 9 months ago

This pull request has been merged in facebookincubator/dynolog@6561e853f0aea6ed677f01a3b6785a67fb516235.