diff --git a/deps/ccommon/CMakeLists.txt b/deps/ccommon/CMakeLists.txt index 5490f42db..cd8e95a4b 100644 --- a/deps/ccommon/CMakeLists.txt +++ b/deps/ccommon/CMakeLists.txt @@ -40,7 +40,7 @@ endif() # version info set(${PROJECT_NAME}_VERSION_MAJOR 2) -set(${PROJECT_NAME}_VERSION_MINOR 0) +set(${PROJECT_NAME}_VERSION_MINOR 1) set(${PROJECT_NAME}_VERSION_PATCH 0) set(${PROJECT_NAME}_VERSION ${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH} diff --git a/deps/ccommon/ci/before-install.sh b/deps/ccommon/ci/before-install.sh index 9bcdb1c13..b5f49421a 100755 --- a/deps/ccommon/ci/before-install.sh +++ b/deps/ccommon/ci/before-install.sh @@ -9,7 +9,7 @@ TEMP="$(mktemp -d -t TEMP.XXXXXXX)" || die "failed to make tmpdir" cleanup() { [[ -n "${TEMP:-}" ]] && rm -rf "${TEMP}"; } trap cleanup EXIT -TOPLEVEL="$(cd "$(dirname "$(realpath "$0" >/dev/null || exit 1)")" && git rev-parse --show-toplevel)" || die 'failed to find TOPLEVEL' +TOPLEVEL="$(git -C "$(cd "$(dirname "$0")" >/dev/null || exit 1; pwd)" rev-parse --show-toplevel)" || die 'failed to find TOPLEVEL' if [[ -n "${RUST_ENABLED:-}" ]]; then curl https://sh.rustup.rs -sSf | sh -s -- -y diff --git a/deps/ccommon/include/cc_stats_log.h b/deps/ccommon/include/cc_stats_log.h new file mode 100644 index 000000000..b33972770 --- /dev/null +++ b/deps/ccommon/include/cc_stats_log.h @@ -0,0 +1,38 @@ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + + +#define STATS_LOG_FILE NULL /* default log file */ +#define STATS_LOG_NBUF 0 /* default log buf size */ + +/* name type default description */ +#define STATS_LOG_OPTION(ACTION) \ + ACTION( stats_log_file, OPTION_TYPE_STR, NULL, "file storing stats" )\ + ACTION( stats_log_nbuf, OPTION_TYPE_UINT, STATS_LOG_NBUF, "stats log buf size" ) + +typedef struct { + STATS_LOG_OPTION(OPTION_DECLARE) +} stats_log_options_st; + + +/* dump stats as CSV records into a log file, this allows metrics to be captured + * locally without setting up an observability infrastructure + */ +void stats_log_setup(stats_log_options_st *options); +void stats_log_teardown(void); + +void stats_log(struct metric metrics[], unsigned int nmetric); + +void stats_log_flush(void); + + +#ifdef __cplusplus +} +#endif + diff --git a/deps/ccommon/rust/cc_binding/build.rs b/deps/ccommon/rust/cc_binding/build.rs index 24aa3a204..abd96b883 100644 --- a/deps/ccommon/rust/cc_binding/build.rs +++ b/deps/ccommon/rust/cc_binding/build.rs @@ -57,7 +57,7 @@ for (k, v) in kvs { } fn main() { - println!("cargo:rustc-link-lib=static=ccommon-2.0.0"); + println!("cargo:rustc-link-lib=static=ccommon-2.1.0"); if cfg!(target_os = "macos") { println!("cargo:rustc-link-lib=framework=Security"); } diff --git a/deps/ccommon/src/cc_debug.c b/deps/ccommon/src/cc_debug.c index 7c766260b..c0fd85a78 100644 --- a/deps/ccommon/src/cc_debug.c +++ b/deps/ccommon/src/cc_debug.c @@ -20,7 +20,6 @@ #include #include #include -#include