Skip to content

Commit

Permalink
Merge pull request #133 from plasma-umass/housekeeping
Browse files Browse the repository at this point in the history
Fix some minor code and style issues
  • Loading branch information
ccurtsinger authored Oct 8, 2019
2 parents ccaf581 + 19f55cb commit ab9cb71
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ install:: all
@mkdir -p $(DESTDIR)$(man1dir)
@$(RST2MAN) docs/coz.rst $(DESTDIR)$(man1dir)/coz.1

bench::
@$(MAKE) -C benchmarks bench
bench bench_small bench_large::
@$(MAKE) -C benchmarks $@
2 changes: 1 addition & 1 deletion common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ SRCS ?= $(wildcard *.cpp) $(wildcard *.c)
OBJS ?= $(addprefix obj/,$(patsubst %.cpp,%.o,$(patsubst %.c,%.o,$(SRCS))))

# Prevent errors if files named all, clean, distclean, bench, or test exist
.PHONY: all clean distclean bench test
.PHONY: all clean distclean bench bench_small bench_large test

# Targets to build recirsively into $(DIRS)
RECURSIVE_TARGETS ?= all clean bench bench_large bench_small test install check
Expand Down
2 changes: 1 addition & 1 deletion libcoz/inspect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ unordered_map<string, uintptr_t> get_loaded_files() {

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

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

_mapping = reinterpret_cast<struct perf_event_mmap_page*>(ring_buffer);
}
Expand Down
2 changes: 2 additions & 0 deletions libcoz/profiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,8 @@ void* profiler::start_profiler_thread(void* arg) {
spinlock* l = (spinlock*)arg;
profiler::get_instance().profiler_thread(*l);
real::pthread_exit(nullptr);
// Unreachable return silences compiler warning
return nullptr;
}

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

0 comments on commit ab9cb71

Please sign in to comment.