Skip to content

Commit ab9cb71

Browse files
authored
Merge pull request #133 from plasma-umass/housekeeping
Fix some minor code and style issues
2 parents ccaf581 + 19f55cb commit ab9cb71

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ install:: all
1515
@mkdir -p $(DESTDIR)$(man1dir)
1616
@$(RST2MAN) docs/coz.rst $(DESTDIR)$(man1dir)/coz.1
1717

18-
bench::
19-
@$(MAKE) -C benchmarks bench
18+
bench bench_small bench_large::
19+
@$(MAKE) -C benchmarks $@

common.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ SRCS ?= $(wildcard *.cpp) $(wildcard *.c)
3030
OBJS ?= $(addprefix obj/,$(patsubst %.cpp,%.o,$(patsubst %.c,%.o,$(SRCS))))
3131

3232
# Prevent errors if files named all, clean, distclean, bench, or test exist
33-
.PHONY: all clean distclean bench test
33+
.PHONY: all clean distclean bench bench_small bench_large test
3434

3535
# Targets to build recirsively into $(DIRS)
3636
RECURSIVE_TARGETS ?= all clean bench bench_large bench_small test install check

libcoz/inspect.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ unordered_map<string, uintptr_t> get_loaded_files() {
246246

247247
// If this is an executable mapping of an absolute path, include it
248248
if(perms[2] == 'x' && path[0] == '/') {
249-
result[path] = base;
249+
result[path] = base - offset;
250250
}
251251
}
252252

libcoz/perf.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ perf_event::perf_event(struct perf_event_attr& pe, pid_t pid, int cpu) :
7676
// If sampling, map the perf event file
7777
if(pe.sample_type != 0 && pe.sample_period != 0) {
7878
void* ring_buffer = mmap(NULL, MmapSize, PROT_READ | PROT_WRITE, MAP_SHARED, _fd, 0);
79-
REQUIRE(ring_buffer != MAP_FAILED) << "Failed to mmap perf event file";
79+
REQUIRE(ring_buffer != MAP_FAILED) << "Mapping perf_event ring buffer failed. "
80+
<< "Make sure the current user has permission to invoke the perf tool, and that "
81+
<< "the program being profiled does not use an excessive number of threads (>1000).\n";
8082

8183
_mapping = reinterpret_cast<struct perf_event_mmap_page*>(ring_buffer);
8284
}

libcoz/profiler.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,8 @@ void* profiler::start_profiler_thread(void* arg) {
466466
spinlock* l = (spinlock*)arg;
467467
profiler::get_instance().profiler_thread(*l);
468468
real::pthread_exit(nullptr);
469+
// Unreachable return silences compiler warning
470+
return nullptr;
469471
}
470472

471473
void profiler::samples_ready(int signum, siginfo_t* info, void* p) {

0 commit comments

Comments
 (0)