author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Sun, 16 Jul 2017 20:33:21 +0000 (22:33 +0200) | ||
committer | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Sun, 16 Jul 2017 20:33:21 +0000 (22:33 +0200) |
Conflicts:
src/dpdkevents.c
src/utils_dpdk.c
src/write_mongodb.c
src/dpdkevents.c
src/utils_dpdk.c
src/write_mongodb.c
13 files changed:
1 | 2 | |||
---|---|---|---|---|
src/apache.c | patch | | diff1 | | diff2 | | blob | history |
src/ascent.c | patch | | diff1 | | diff2 | | blob | history |
src/bind.c | patch | | diff1 | | diff2 | | blob | history |
src/curl.c | patch | | diff1 | | diff2 | | blob | history |
src/curl_json.c | patch | | diff1 | | diff2 | | blob | history |
src/curl_xml.c | patch | | diff1 | | diff2 | | blob | history |
src/dpdkevents.c | patch | | diff1 | | diff2 | | blob | history |
src/dpdkstat.c | patch | | diff1 | | diff2 | | blob | history |
src/nginx.c | patch | | diff1 | | diff2 | | blob | history |
src/snmp_agent.c | patch | | diff1 | | diff2 | | blob | history |
src/utils_dpdk.c | patch | | diff1 | | diff2 | | blob | history |
src/write_http.c | patch | | diff1 | | diff2 | | blob | history |
src/write_mongodb.c | patch | | diff1 | | diff2 | | blob | history |
diff --cc src/apache.c
Simple merge
diff --cc src/ascent.c
Simple merge
diff --cc src/bind.c
Simple merge
diff --cc src/curl.c
Simple merge
diff --cc src/curl_json.c
Simple merge
diff --cc src/curl_xml.c
Simple merge
diff --cc src/dpdkevents.c
Simple merge
diff --cc src/dpdkstat.c
Simple merge
diff --cc src/nginx.c
Simple merge
diff --cc src/snmp_agent.c
Simple merge
diff --cc src/utils_dpdk.c
index 4f9243ea03d3b5d5198fb0a5d1bbf8749eae5dee,4b246c9ecb870b19c2d9d3d588346556776c1ffe..77f596ebd7da7352efcb4e1d76b550505a80c61c
--- 1/src/utils_dpdk.c
--- 2/src/utils_dpdk.c
+++ b/src/utils_dpdk.c
DPDK_HELPER_TRACE(phc->shm_name);
- ssnprintf(phc->eal_config.coremask, DATA_MAX_NAME_LEN, "%s", "0xf");
- ssnprintf(phc->eal_config.memory_channels, DATA_MAX_NAME_LEN, "%s", "1");
- ssnprintf(phc->eal_config.file_prefix, DATA_MAX_NAME_LEN, "%s",
- DPDK_DEFAULT_RTE_CONFIG);
+ snprintf(phc->eal_config.coremask, DATA_MAX_NAME_LEN, "%s", "0xf");
+ snprintf(phc->eal_config.memory_channels, DATA_MAX_NAME_LEN, "%s", "1");
- snprintf(phc->eal_config.process_type, DATA_MAX_NAME_LEN, "%s", "secondary");
+ snprintf(phc->eal_config.file_prefix, DATA_MAX_NAME_LEN, "%s",
+ DPDK_DEFAULT_RTE_CONFIG);
}
int dpdk_helper_eal_config_set(dpdk_helper_ctx_t *phc, dpdk_eal_config_t *ec) {
status = cf_util_get_string_buffer(child, phc->eal_config.socket_memory,
sizeof(phc->eal_config.socket_memory));
DEBUG("dpdk_common: EAL:Socket memory %s", phc->eal_config.socket_memory);
- } else if (strcasecmp("ProcessType", child->key) == 0) {
- status = cf_util_get_string_buffer(child, phc->eal_config.process_type,
- sizeof(phc->eal_config.process_type));
- DEBUG("dpdk_common: EAL:Process type %s", phc->eal_config.process_type);
- } else if ((strcasecmp("FilePrefix", child->key) == 0) &&
- (child->values[0].type == OCONFIG_TYPE_STRING)) {
- snprintf(phc->eal_config.file_prefix, DATA_MAX_NAME_LEN,
- "/var/run/.%s_config", child->values[0].value.string);
- DEBUG("dpdk_common: EAL:File prefix %s", phc->eal_config.file_prefix);
+ } else if (strcasecmp("FilePrefix", child->key) == 0) {
+ char prefix[DATA_MAX_NAME_LEN];
+
+ status = cf_util_get_string_buffer(child, prefix, sizeof(prefix));
+ if (status == 0) {
- ssnprintf(phc->eal_config.file_prefix, DATA_MAX_NAME_LEN,
++ snprintf(phc->eal_config.file_prefix, DATA_MAX_NAME_LEN,
+ "/var/run/.%s_config", prefix);
+ DEBUG("dpdk_common: EAL:File prefix %s", phc->eal_config.file_prefix);
+ }
} else {
ERROR("dpdk_common: Invalid '%s' configuration option", child->key);
status = -EINVAL;
diff --cc src/write_http.c
Simple merge
diff --cc src/write_mongodb.c
index e1fb41fd9a500ee210bc3f91c630c05d0c8d79a3,37e34098f1769e73fb84128e287dfe23f357249f..46b6d865be2d569a76b56c28f8b44c4d3d347b5f
--- 1/src/write_mongodb.c
--- 2/src/write_mongodb.c
+++ b/src/write_mongodb.c
BSON_APPEND_UTF8(ret, "type_instance", vl->type_instance);
BSON_APPEND_ARRAY_BEGIN(ret, "values", &subarray); /* {{{ */
- for (int i = 0; i < ds->ds_num; i++) {
+ for (size_t i = 0; i < ds->ds_num; i++) {
char key[16];
- ssnprintf(key, sizeof(key), "%zu", i);
- snprintf(key, sizeof(key), "%i", i);
++ snprintf(key, sizeof(key), "%zu", i);
if (ds->ds[i].type == DS_TYPE_GAUGE)
BSON_APPEND_DOUBLE(&subarray, key, vl->values[i].gauge);
bson_append_array_end(ret, &subarray); /* }}} values */
BSON_APPEND_ARRAY_BEGIN(ret, "dstypes", &subarray); /* {{{ */
- for (int i = 0; i < ds->ds_num; i++) {
+ for (size_t i = 0; i < ds->ds_num; i++) {
char key[16];
- ssnprintf(key, sizeof(key), "%zu", i);
- snprintf(key, sizeof(key), "%i", i);
++ snprintf(key, sizeof(key), "%zu", i);
if (store_rates)
BSON_APPEND_UTF8(&subarray, key, "gauge");
bson_append_array_end(ret, &subarray); /* }}} dstypes */
BSON_APPEND_ARRAY_BEGIN(ret, "dsnames", &subarray); /* {{{ */
- for (int i = 0; i < ds->ds_num; i++) {
+ for (size_t i = 0; i < ds->ds_num; i++) {
char key[16];
- ssnprintf(key, sizeof(key), "%zu", i);
- snprintf(key, sizeof(key), "%i", i);
++ snprintf(key, sizeof(key), "%zu", i);
BSON_APPEND_UTF8(&subarray, key, ds->ds[i].name);
}
bson_append_array_end(ret, &subarray); /* }}} dsnames */