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,12 +136,14 @@ StatusTuple BPFPerfBuffer::close_all_cpu() {
std::string errors;
bool has_error = false;
int close_res = close(epfd_);
epfd_ = -1;
ep_events_.reset();
if (close_res != 0) {
has_error = true;
errors += std::string(std::strerror(errno)) + "\n";
if (epfd_ >= 0) {
int close_res = close(epfd_);
epfd_ = -1;
ep_events_.reset();
if (close_res != 0) {
has_error = true;
errors += std::string(std::strerror(errno)) + "\n";
}
}
std::vector<int> opened_cpus;
......
......@@ -13,7 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/mman.h>
......
......@@ -244,7 +244,7 @@ void perf_reader_event_read(struct perf_reader *reader) {
if (reader->lost_cb) {
reader->lost_cb(lost);
} else {
fprintf(stderr, "Possibly lost " PRIu64 " samples\n", lost);
fprintf(stderr, "Possibly lost %" PRIu64 " samples\n", lost);
}
} else if (e->type == PERF_RECORD_SAMPLE) {
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