Skip to contentSkip to conversation

kernelshark: fix compiling error in LatencyPlot.cpp

PATCH In review Jerome Marchand 2 participants 2 messages Jun 11, 2024 – Jun 15, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernelshark: fix compiling error in LatencyPlot.cpp

Include the <algorithm> header to use std::for_each.

Fixes the following compilation error:
kernel-shark/src/plugins/LatencyPlot.cpp: In function void draw_latency(kshark_cpp_argv*, int, int, int):
kernel-shark/src/plugins/LatencyPlot.cpp:306:14: error: for_each is not a member of std

  306 |         std::for_each(range.first, range.second, lamPlotLat);
      |              ^~~~~~~~
---
 src/plugins/LatencyPlot.cpp | 1 +
 1 file changed, 1 insertion(+)
src/plugins/LatencyPlot.cpp +1 -0
index d412917..5e3393b 100644
@@ -15,6 +15,7 @@
 // C++
 #include <unordered_map>
 #include <iostream>
+#include <algorithm>
 
 // KernelShark
 #include "plugins/latency_plot.h"
Signature · 1 line
2.45.2
#1 lore raw

The patch is applied. Thanks!

Yordan

Quoted 25 lines · Jerome Marchand

Include the <algorithm> header to use std::for_each.

Fixes the following compilation error:
kernel-shark/src/plugins/LatencyPlot.cpp: In function void draw_latency(kshark_cpp_argv*, int, int, int):
kernel-shark/src/plugins/LatencyPlot.cpp:306:14: error: for_each is not a member of std

   306 |         std::for_each(range.first, range.second, lamPlotLat);
       |              ^~~~~~~~
---
  src/plugins/LatencyPlot.cpp | 1 +
  1 file changed, 1 insertion(+)
src/plugins/LatencyPlot.cpp +1 -0
index d412917..5e3393b 100644
@@ -15,6 +15,7 @@
  // C++
  #include <unordered_map>
  #include <iostream>
+#include <algorithm>
 
  // KernelShark
  #include "plugins/latency_plot.h"