Skip to content

Commit 6d2cc31

Browse files
authored
Merge pull request #40 from lightstep/jmacd/makefile_parallelism
Fix Makefile parallelism; Fix two benchmark client bugs
2 parents a483879 + 972cd1f commit 6d2cc31

File tree

3 files changed

+25
-17
lines changed

3 files changed

+25
-17
lines changed

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# by homebrew, see the commands to set PKG_CONFIG_PATH in build.sh.
55

66
AC_PREREQ([2.69])
7-
AC_INIT([lightstep-tracer-cpp], [0.33],
7+
AC_INIT([lightstep-tracer-cpp], [0.34],
88
[https://github.com/lightstep/lightstep-tracer-cpp/issues])
99
LT_INIT([disable-shared])
1010
AM_INIT_AUTOMAKE([1.14 foreign subdir-objects])

src/c++11/Makefile.am

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ PROTOC = @PROTOC@
99
# Lightstep Collector reporting:
1010
COLLECTOR_SRC = $(top_srcdir)/lightstep-tracer-common
1111
ENVOY_SRC = ./envoy
12-
PROTO_DIR = proto
12+
PROTO_DIR = ./proto
1313

1414
PROTO_SRC = \
1515
$(COLLECTOR_SRC)/collector.proto \
@@ -18,14 +18,17 @@ PROTO_SRC = \
1818
PROTO_GEN = \
1919
lightstep/collector.pb.h \
2020
lightstep/envoy_carrier.pb.h \
21-
proto/collector.pb.cc \
22-
proto/envoy_carrier.pb.cc
21+
$(PROTO_DIR)/collector.pb.cc \
22+
$(PROTO_DIR)/envoy_carrier.pb.cc
2323

24-
$(PROTO_GEN): $(PROTO_SRC) $(PROTOC)
24+
$(PROTO_DIR).stamp: $(PROTO_SRC)
2525
mkdir -p $(PROTO_DIR)
2626
$(PROTOC) --proto_path=$(COLLECTOR_SRC) --cpp_out=$(PROTO_DIR) $(COLLECTOR_SRC)/collector.proto
2727
$(PROTOC) --proto_path=$(ENVOY_SRC) --cpp_out=$(PROTO_DIR) $(ENVOY_SRC)/envoy_carrier.proto
28-
mv proto/*.h lightstep
28+
mv $(PROTO_DIR)/*.h lightstep
29+
touch $(PROTO_DIR).stamp
30+
31+
$(PROTO_GEN): $(PROTO_DIR).stamp
2932

3033
# Tell Automake that these files have to be generated first (also cleaned)
3134
BUILT_SOURCES = $(PROTO_GEN)
@@ -58,8 +61,8 @@ nobase_nodist_include_HEADERS = \
5861
lightstep/envoy_carrier.pb.h
5962

6063
nodist_liblightstep_core_cxx11_la_SOURCES = \
61-
proto/collector.pb.cc \
62-
proto/envoy_carrier.pb.cc
64+
$(PROTO_DIR)/collector.pb.cc \
65+
$(PROTO_DIR)/envoy_carrier.pb.cc
6366

6467
# Note: To set the protobuf library include and library flags, e.g.,
6568
#
@@ -81,20 +84,25 @@ EXTRA_DIST = \
8184
# ./configure --disable-grpc
8285
if ENABLE_GRPC
8386

84-
BUILT_SOURCES += $(GRPC_PROTO_GEN)
85-
CLEANFILES += $(GRPC_PROTO_GEN)
86-
8787
GRPC_PROTO_SRC = \
8888
$(COLLECTOR_SRC)/collector.proto
8989

9090
GRPC_PROTO_GEN = \
9191
lightstep/collector.grpc.pb.h \
92-
proto/collector.grpc.pb.cc
92+
$(PROTO_DIR)/collector.grpc.pb.cc
9393

94-
$(GRPC_PROTO_GEN): $(GRPC_PROTO_SRC) $(PROTOC)
94+
BUILT_SOURCES += $(GRPC_PROTO_GEN)
95+
CLEANFILES += $(GRPC_PROTO_GEN)
96+
97+
# TODO make grpc_cpp_plugin a configure option
98+
#
99+
$(PROTO_DIR).grpc.stamp: $(GRPC_PROTO_SRC)
95100
mkdir -p $(PROTO_DIR)
96101
$(PROTOC) --proto_path=$(COLLECTOR_SRC) --grpc_out=$(PROTO_DIR) --plugin=protoc-gen-grpc=`which grpc_cpp_plugin` $(COLLECTOR_SRC)/collector.proto
97-
mv proto/*.h lightstep
102+
mv $(PROTO_DIR)/*.h lightstep
103+
touch $(PROTO_DIR).grpc.stamp
104+
105+
$(GRPC_PROTO_GEN): $(PROTO_DIR).grpc.stamp
98106

99107
# LightStep gRPC recorder library
100108
lib_LTLIBRARIES += liblightstep_grpc_cxx11.la
@@ -106,7 +114,7 @@ nobase_nodist_include_HEADERS += \
106114
lightstep/collector.grpc.pb.h
107115

108116
nodist_liblightstep_grpc_cxx11_la_SOURCES = \
109-
proto/collector.grpc.pb.cc
117+
$(PROTO_DIR)/collector.grpc.pb.cc
110118

111119
# Note $(grpc_LIBS)++ shenanigans. The grpc C++ pkg-config input (grpc++.pc) uses
112120
# characters that are invalid to autoconf, so we can't find it. Instead, we locate

test/c++11/cppclient.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ void Test::test_body(const lightstep::Tracer& tracer,
121121
auto logn = static_cast<uint64_t>(control["NumLogs"].number_value());
122122
auto logsz = static_cast<uint64_t>(control["BytesPerLog"].number_value());
123123

124-
uint64_t sleep_debt = 0;
124+
int64_t sleep_debt = 0;
125125

126126
for (uint64_t i = 0; i < repeat; i++) {
127127
lightstep::Span span = tracer.StartSpan("span/test");
@@ -164,7 +164,7 @@ void Test::run_benchmark() {
164164
}
165165
lightstep::TimeStamp start = lightstep::Clock::now();
166166

167-
uint64_t sleep_nanos;
167+
uint64_t sleep_nanos = 0;
168168
uint64_t answer;
169169
// TODO concurrency test
170170
test_body(tracer, control, &sleep_nanos, &answer);

0 commit comments

Comments
 (0)