Skip to content

Commit 1bc7ab0

Browse files
committed
Merge branch 'tristan957-fixes'
2 parents 706a9e0 + 3b43ad8 commit 1bc7ab0

24 files changed

+93
-75
lines changed

CMakeLists.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ if (${HDR_LOG_REQUIRED} AND NOT HDR_LOG_ENABLED)
4949
message(SEND_ERROR "HDR_LOG_REQUIRED=ON and unable to find zlib library")
5050
endif()
5151

52+
add_subdirectory(include)
5253
add_subdirectory(src)
5354

5455
option(HDR_HISTOGRAM_BUILD_PROGRAMS "Build tests and examples" ON)
@@ -70,10 +71,12 @@ configure_file(
7071
config.cmake.in
7172
${PROJECT_NAME}-config.cmake
7273
@ONLY)
73-
install(
74-
EXPORT ${PROJECT_NAME}-targets
75-
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
76-
NAMESPACE ${PROJECT_NAME}::)
74+
if(HDR_HISTOGRAM_INSTALL_SHARED OR HDR_HISTOGRAM_INSTALL_STATIC)
75+
install(
76+
EXPORT ${PROJECT_NAME}-targets
77+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
78+
NAMESPACE ${PROJECT_NAME}::)
79+
endif()
7780
install(
7881
FILES
7982
${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config.cmake

examples/hdr_decoder.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
#include <time.h>
1111
#include <errno.h>
1212
#include <string.h>
13-
14-
#include <hdr_histogram.h>
15-
#include <hdr_histogram_log.h>
13+
14+
#include <hdr/hdr_histogram.h>
15+
#include <hdr/hdr_histogram_log.h>
1616

1717
#if defined(_MSC_VER)
1818
#pragma warning(push)
@@ -71,7 +71,7 @@ int main(int argc, char** argv)
7171
{
7272
fprintf(stderr, "Failed to print histogram: %s\n", hdr_strerror(rc));
7373
return -1;
74-
}
74+
}
7575
}
7676

7777
return 0;

examples/hiccup.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
#include <stdlib.h>
1818
#include <unistd.h>
1919

20-
#include <hdr_histogram.h>
21-
#include <hdr_histogram_log.h>
22-
#include <hdr_interval_recorder.h>
23-
#include <hdr_time.h>
20+
#include <hdr/hdr_histogram.h>
21+
#include <hdr/hdr_histogram_log.h>
22+
#include <hdr/hdr_interval_recorder.h>
23+
#include <hdr/hdr_time.h>
2424

2525
static int64_t diff(struct timespec t0, struct timespec t1)
2626
{
@@ -36,7 +36,7 @@ static void* record_hiccups(void* thread_context)
3636
struct pollfd fd;
3737
struct timespec t0;
3838
struct timespec t1;
39-
struct itimerspec timeout;
39+
struct itimerspec timeout;
4040
struct hdr_interval_recorder* r = thread_context;
4141

4242
memset(&fd, 0, sizeof(struct pollfd));
@@ -140,7 +140,7 @@ int main(int argc, char** argv)
140140
if (!output)
141141
{
142142
fprintf(
143-
stderr, "Failed to open/create file: %s, %s",
143+
stderr, "Failed to open/create file: %s, %s",
144144
config.filename, strerror(errno));
145145

146146
return -1;
@@ -167,7 +167,7 @@ int main(int argc, char** argv)
167167
#pragma clang diagnostic push
168168
#pragma clang diagnostic ignored "-Wmissing-noreturn"
169169
while (true)
170-
{
170+
{
171171
sleep(config.interval);
172172

173173
inactive = hdr_interval_recorder_sample_and_recycle(&recorder, inactive);

include/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
set(HDR_HISTOGRAM_PUBLIC_HEADERS
2+
hdr/hdr_histogram.h
3+
hdr/hdr_histogram_log.h
4+
hdr/hdr_interval_recorder.h
5+
hdr/hdr_thread.h
6+
hdr/hdr_time.h
7+
hdr/hdr_writer_reader_phaser.h)
8+
9+
install(
10+
FILES ${HDR_HISTOGRAM_PUBLIC_HEADERS}
11+
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hdr)
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -159,27 +159,27 @@ bool hdr_record_values_atomic(struct hdr_histogram* h, int64_t value, int64_t co
159159
* Record a value in the histogram and backfill based on an expected interval.
160160
*
161161
* Records a value in the histogram, will round this value of to a precision at or better
162-
* than the significant_figure specified at contruction time. This is specifically used
162+
* than the significant_figure specified at construction time. This is specifically used
163163
* for recording latency. If the value is larger than the expected_interval then the
164164
* latency recording system has experienced co-ordinated omission. This method fills in the
165-
* values that would have occured had the client providing the load not been blocked.
165+
* values that would have occurred had the client providing the load not been blocked.
166166
167167
* @param h "This" pointer
168168
* @param value Value to add to the histogram
169169
* @param expected_interval The delay between recording values.
170170
* @return false if the value is larger than the highest_trackable_value and can't be recorded,
171171
* true otherwise.
172172
*/
173-
bool hdr_record_corrected_value(struct hdr_histogram* h, int64_t value, int64_t expexcted_interval);
173+
bool hdr_record_corrected_value(struct hdr_histogram* h, int64_t value, int64_t expected_interval);
174174

175175
/**
176176
* Record a value in the histogram and backfill based on an expected interval.
177177
*
178178
* Records a value in the histogram, will round this value of to a precision at or better
179-
* than the significant_figure specified at contruction time. This is specifically used
179+
* than the significant_figure specified at construction time. This is specifically used
180180
* for recording latency. If the value is larger than the expected_interval then the
181181
* latency recording system has experienced co-ordinated omission. This method fills in the
182-
* values that would have occured had the client providing the load not been blocked.
182+
* values that would have occurred had the client providing the load not been blocked.
183183
*
184184
* Will record this value atomically, however the whole structure may appear inconsistent
185185
* when read concurrently with this update. Do NOT mix calls to this method with calls
@@ -191,7 +191,7 @@ bool hdr_record_corrected_value(struct hdr_histogram* h, int64_t value, int64_t
191191
* @return false if the value is larger than the highest_trackable_value and can't be recorded,
192192
* true otherwise.
193193
*/
194-
bool hdr_record_corrected_value_atomic(struct hdr_histogram* h, int64_t value, int64_t expexcted_interval);
194+
bool hdr_record_corrected_value_atomic(struct hdr_histogram* h, int64_t value, int64_t expected_interval);
195195

196196
/**
197197
* Record a value in the histogram 'count' times. Applies the same correcting logic
@@ -504,7 +504,7 @@ int64_t hdr_next_non_equivalent_value(const struct hdr_histogram* h, int64_t val
504504
int64_t hdr_median_equivalent_value(const struct hdr_histogram* h, int64_t value);
505505

506506
/**
507-
* Used to reset counters after importing data manuallying into the histogram, used by the logging code
507+
* Used to reset counters after importing data manually into the histogram, used by the logging code
508508
* and other custom serialisation tools.
509509
*/
510510
void hdr_reset_internal_counters(struct hdr_histogram* h);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
#include <stdbool.h>
2828
#include <stdio.h>
2929

30-
#include "hdr_time.h"
31-
#include "hdr_histogram.h"
30+
#include <hdr/hdr_time.h>
31+
#include <hdr/hdr_histogram.h>
3232

3333
#ifdef __cplusplus
3434
extern "C" {
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
#ifndef HDR_INTERVAL_RECORDER_H
88
#define HDR_INTERVAL_RECORDER_H 1
99

10-
#include "hdr_writer_reader_phaser.h"
11-
#include "hdr_histogram.h"
10+
#include <hdr/hdr_writer_reader_phaser.h>
11+
#include <hdr/hdr_histogram.h>
1212

1313
HDR_ALIGN_PREFIX(8)
1414
struct hdr_interval_recorder
1515
{
1616
struct hdr_histogram* active;
1717
struct hdr_histogram* inactive;
1818
struct hdr_writer_reader_phaser phaser;
19-
}
19+
}
2020
HDR_ALIGN_SUFFIX(8);
2121

2222
#ifdef __cplusplus
File renamed without changes.

0 commit comments

Comments
 (0)