Commit 08b8bd69 authored by 4ast's avatar 4ast Committed by GitHub

Merge pull request #1102 from palmtenor/fixwarning

Fix compiler warning on redefined Macro
parents e2a03777 68a52b85
...@@ -136,6 +136,7 @@ StatusTuple BPFPerfBuffer::close_all_cpu() { ...@@ -136,6 +136,7 @@ StatusTuple BPFPerfBuffer::close_all_cpu() {
std::string errors; std::string errors;
bool has_error = false; bool has_error = false;
if (epfd_ >= 0) {
int close_res = close(epfd_); int close_res = close(epfd_);
epfd_ = -1; epfd_ = -1;
ep_events_.reset(); ep_events_.reset();
...@@ -143,6 +144,7 @@ StatusTuple BPFPerfBuffer::close_all_cpu() { ...@@ -143,6 +144,7 @@ StatusTuple BPFPerfBuffer::close_all_cpu() {
has_error = true; has_error = true;
errors += std::string(std::strerror(errno)) + "\n"; errors += std::string(std::strerror(errno)) + "\n";
} }
}
std::vector<int> opened_cpus; std::vector<int> opened_cpus;
for (auto it : cpu_readers_) for (auto it : cpu_readers_)
......
...@@ -13,7 +13,10 @@ ...@@ -13,7 +13,10 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
#ifndef _GNU_SOURCE
#define _GNU_SOURCE #define _GNU_SOURCE
#endif
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/mman.h> #include <sys/mman.h>
......
...@@ -244,7 +244,7 @@ void perf_reader_event_read(struct perf_reader *reader) { ...@@ -244,7 +244,7 @@ void perf_reader_event_read(struct perf_reader *reader) {
if (reader->lost_cb) { if (reader->lost_cb) {
reader->lost_cb(lost); reader->lost_cb(lost);
} else { } else {
fprintf(stderr, "Possibly lost " PRIu64 " samples\n", lost); fprintf(stderr, "Possibly lost %" PRIu64 " samples\n", lost);
} }
} else if (e->type == PERF_RECORD_SAMPLE) { } else if (e->type == PERF_RECORD_SAMPLE) {
if (reader->type == PERF_TYPE_TRACEPOINT) if (reader->type == PERF_TYPE_TRACEPOINT)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment