Checks: '-*,
bugprone-argument-comment,
bugprone-assert-side-effect,
+ bugprone-assignment-in-if-condition,
+ bugprone-bad-signal-to-kill-thread,
+ bugprone-bool-pointer-implicit-conversion,
+ bugprone-copy-constructor-init,
bugprone-dangling-handle,
+ bugprone-exception-escape,
+ bugprone-fold-init-type,
+ bugprone-forward-declaration-namespace,
+ bugprone-forwarding-reference-overload,
bugprone-inaccurate-erase,
+ bugprone-incorrect-roundings,
+ bugprone-infinite-loop,
+ bugprone-integer-division,
+ bugprone-macro-parentheses,
+ bugprone-macro-repeated-side-effects,
+ bugprone-misplaced-operator-in-strlen-in-alloc,
+ bugprone-misplaced-pointer-arithmetic-in-alloc,
+ bugprone-move-forwarding-reference,
+ bugprone-multiple-statement-macro,
+ bugprone-not-null-terminated-result,
+ bugprone-parent-virtual-call,
+ bugprone-posix-return,
+ bugprone-shared-ptr-array-mismatch,
+ bugprone-signal-handler,
+ bugprone-signed-char-misuse,
+ bugprone-sizeof-container,
+ bugprone-sizeof-expression,
+ bugprone-standalone-empty,
bugprone-string-constructor,
bugprone-string-integer-assignment,
+ bugprone-string-literal-with-embedded-nul,
+ bugprone-suspicious-enum-usage,
+ bugprone-suspicious-include,
+ bugprone-suspicious-memory-comparison
+ bugprone-suspicious-memset-usage,
+ bugprone-suspicious-missing-comma,
+ bugprone-suspicious-realloc-usage,
+ bugprone-suspicious-semicolon,
+ bugprone-suspicious-string-compare,
+ bugprone-swapped-arguments,
+ bugprone-terminating-continue,
+ bugprone-throw-keyword-missing,
+ bugprone-too-small-loop-variable,
+ bugprone-unchecked-optional-access
bugprone-undefined-memory-manipulation,
+ bugprone-undelegated-constructor,
+ bugprone-unhandled-exception-at-new,
+ bugprone-unhandled-self-assignment,
+ bugprone-unused-raii,
+ bugprone-unused-return-value,
+ bugprone-use-after-move,
+ bugprone-virtual-near-miss,
bugprone-unused-raii,
bugprone-use-after-move,
google-build-explicit-make-pair,
FormatStyle: 'file'
CheckOptions:
- key: bugprone-assert-side-effect.AssertMacros
- value: assert,LTTNG_ASSERT
\ No newline at end of file
+ value: assert,LTTNG_ASSERT
+ - key: bugprone-signed-char-misuse.CharTypdefsToIgnore
+ value: 'int8_t'
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <assert.h>
#define DEFAULT_DATA_AVAILABILITY_WAIT_TIME 200000 /* usec */
static void sighandler(int signal __attribute__((unused)))
{
- printf("Signal caught, exiting\n");
+ const char msg[] = "Signal caught, exiting\n";
+ const int ret = write(STDOUT_FILENO, msg, sizeof(msg));
+
+ assert(ret == 0); /* NOLINT assert is not async signal safe */
quit = 1;
}
}
#define crash_get_field(layout, map, name) \
- _crash_get_field(layout, (map) + (layout)->offset.name, layout->length.name)
+ _crash_get_field(layout, (map) + (layout)->offset.name, (layout)->length.name)
-#define crash_get_array_field(layout, map, array_name, idx, field_name) \
- _crash_get_field(layout, \
- (map) + (layout)->offset.array_name + \
- (idx * (layout)->stride.array_name) + \
- (layout)->offset.field_name, \
+#define crash_get_array_field(layout, map, array_name, idx, field_name) \
+ _crash_get_field(layout, \
+ (map) + (layout)->offset.array_name + \
+ ((idx) * (layout)->stride.array_name) + \
+ (layout)->offset.field_name, \
(layout)->length.field_name)
#define crash_get_hdr_raw_field(layout, hdr, name) ((hdr)->name)
* the data will be read at some point in time
* or wait to the end of the world :)
*/
- ret = lttng_write(live_conn_pipe[1], &conn, sizeof(conn));
+ ret = lttng_write(live_conn_pipe[1], &conn, sizeof(conn)); /* NOLINT sizeof
+ used on a
+ pointer. */
if (ret < 0) {
PERROR("write conn pipe");
connection_put(conn);
if (revents & LPOLLIN) {
struct relay_connection *conn;
- ret = lttng_read(live_conn_pipe[0], &conn, sizeof(conn));
+ ret = lttng_read(live_conn_pipe[0],
+ &conn,
+ sizeof(conn)); /* NOLINT sizeof used on a
+ pointer. */
if (ret < 0) {
goto error;
}
for (i = 0; i < (sizeof(long_options) / sizeof(struct option)) - 1; i++) {
/* Ignore if entry name is not fully matched. */
- if (strcmp(entry->name, long_options[i].name)) {
+ if (strcmp(entry->name, long_options[i].name) != 0) {
continue;
}
* the data will be read at some point in time
* or wait to the end of the world :)
*/
- ret = lttng_write(relay_conn_pipe[1], &new_conn, sizeof(new_conn));
+ ret = lttng_write(relay_conn_pipe[1], &new_conn, sizeof(new_conn)); /* NOLINT
+ sizeof
+ used
+ on a
+ pointer.
+ */
if (ret < 0) {
PERROR("write connection pipe");
connection_put(new_conn);
if (revents & LPOLLIN) {
struct relay_connection *conn;
- ret = lttng_read(relay_conn_pipe[0], &conn, sizeof(conn));
+ ret = lttng_read(relay_conn_pipe[0],
+ &conn,
+ sizeof(conn)); /* NOLINT sizeof used on a
+ pointer. */
if (ret < 0) {
goto error;
}
/* Adding the channel to the channel hash table. */
rcu_read_lock();
- if (strncmp(uchan->name, DEFAULT_METADATA_NAME, sizeof(uchan->name))) {
+ if (strncmp(uchan->name, DEFAULT_METADATA_NAME, sizeof(uchan->name)) != 0) {
lttng_ht_add_unique_str(usess->domain_global.channels, &uchan->node);
chan_published = true;
} else {
* adhered to.
*/
if (domain->type == LTTNG_DOMAIN_JUL) {
- if (strncmp(attr->name, DEFAULT_JUL_CHANNEL_NAME, LTTNG_SYMBOL_NAME_LEN)) {
+ if (strncmp(attr->name,
+ DEFAULT_JUL_CHANNEL_NAME,
+ LTTNG_SYMBOL_NAME_LEN - 1) != 0) {
ret_code = LTTNG_ERR_INVALID_CHANNEL_NAME;
goto error;
}
} else if (domain->type == LTTNG_DOMAIN_LOG4J) {
- if (strncmp(attr->name, DEFAULT_LOG4J_CHANNEL_NAME, LTTNG_SYMBOL_NAME_LEN)) {
+ if (strncmp(attr->name,
+ DEFAULT_LOG4J_CHANNEL_NAME,
+ LTTNG_SYMBOL_NAME_LEN - 1) != 0) {
ret_code = LTTNG_ERR_INVALID_CHANNEL_NAME;
goto error;
}
} else if (domain->type == LTTNG_DOMAIN_PYTHON) {
if (strncmp(attr->name,
DEFAULT_PYTHON_CHANNEL_NAME,
- LTTNG_SYMBOL_NAME_LEN)) {
+ LTTNG_SYMBOL_NAME_LEN - 1) != 0) {
ret_code = LTTNG_ERR_INVALID_CHANNEL_NAME;
goto error;
}
* name, return an error.
*/
if (domain == LTTNG_DOMAIN_JUL && *channel_name &&
- strcmp(channel_name, DEFAULT_JUL_CHANNEL_NAME)) {
+ strcmp(channel_name, DEFAULT_JUL_CHANNEL_NAME) != 0) {
ret = LTTNG_ERR_UST_CHAN_NOT_FOUND;
goto error;
} else if (domain == LTTNG_DOMAIN_LOG4J && *channel_name &&
- strcmp(channel_name, DEFAULT_LOG4J_CHANNEL_NAME)) {
+ strcmp(channel_name, DEFAULT_LOG4J_CHANNEL_NAME) != 0) {
ret = LTTNG_ERR_UST_CHAN_NOT_FOUND;
goto error;
}
namespace ctf2 {
class trace_environment_visitor : public lst::trace_class_environment_visitor {
public:
- trace_environment_visitor() = default;
+ trace_environment_visitor() = default; /* NOLINT clang-tidy 14 identifies this as a move
+ constructor. */
void visit(const lst::environment_field<int64_t>& field) override
{
class field_visitor : public lttng::sessiond::trace::field_visitor,
public lttng::sessiond::trace::type_visitor {
public:
- field_visitor() = default;
+ field_visitor() = default; /* NOLINT clang-tidy 14 identifies this as a move constructor. */
/* Only call once. */
json::json move_fragment()
cds_list_for_each_entry (kevent, &kchan->events_list.head, list) {
if (type != LTTNG_EVENT_ALL && kevent->type != type)
continue;
- if (event_name != nullptr && strcmp(event_name, kevent->event->name)) {
+ if (event_name != nullptr && strcmp(event_name, kevent->event->name) != 0) {
continue;
}
found++;
for (i = 0; i < (sizeof(long_options) / sizeof(struct option)) - 1; i++) {
/* Ignore if not fully matched. */
- if (strcmp(entry->name, long_options[i].name)) {
+ if (strcmp(entry->name, long_options[i].name) != 0) {
continue;
}
status = lttng_condition_buffer_usage_get_channel_name(condition, &condition_channel_name);
LTTNG_ASSERT((status == LTTNG_CONDITION_STATUS_OK) && condition_channel_name);
- if (strcmp(channel_info->session_info->name, condition_session_name)) {
+ if (strcmp(channel_info->session_info->name, condition_session_name) != 0) {
goto fail;
}
- if (strcmp(channel_info->name, condition_channel_name)) {
+ if (strcmp(channel_info->name, condition_channel_name) != 0) {
goto fail;
}
#include <inttypes.h>
#include <signal.h>
-#define LTTNG_SESSIOND_SIG_QS SIGRTMIN + 10
-#define LTTNG_SESSIOND_SIG_EXIT SIGRTMIN + 11
-#define LTTNG_SESSIOND_SIG_PENDING_ROTATION_CHECK SIGRTMIN + 12
-#define LTTNG_SESSIOND_SIG_SCHEDULED_ROTATION SIGRTMIN + 13
-
-#define UINT_TO_PTR(value) \
- ({ \
- LTTNG_ASSERT(value <= UINTPTR_MAX); \
- (void *) (uintptr_t) value; \
+#define LTTNG_SESSIOND_SIG_QS (SIGRTMIN + 10)
+#define LTTNG_SESSIOND_SIG_EXIT (SIGRTMIN + 11)
+#define LTTNG_SESSIOND_SIG_PENDING_ROTATION_CHECK (SIGRTMIN + 12)
+#define LTTNG_SESSIOND_SIG_SCHEDULED_ROTATION (SIGRTMIN + 13)
+
+#define UINT_TO_PTR(value) \
+ ({ \
+ LTTNG_ASSERT((value) <= UINTPTR_MAX); \
+ (void *) (uintptr_t) (value); \
})
-#define PTR_TO_UINT(ptr) ((uintptr_t) ptr)
+#define PTR_TO_UINT(ptr) ((uintptr_t) (ptr))
namespace {
/*
if (type != LTTNG_EVENT_ALL && ev->type != type) {
continue;
}
- if (strcmp(name, ev->event->name)) {
+ if (strcmp(name, ev->event->name) != 0) {
continue;
}
if ((ev->filter && !filter) || (!ev->filter && filter)) {
if (type != LTTNG_EVENT_ALL && ev->type != type) {
continue;
}
- if (strcmp(name, ev->event->name)) {
+ if (strcmp(name, ev->event->name) != 0) {
continue;
}
found = 1;
}
if (strncmp(uctx->ctx.u.perf_counter.name,
ctx->u.perf_counter.name,
- LTTNG_UST_ABI_SYM_NAME_LEN)) {
+ LTTNG_UST_ABI_SYM_NAME_LEN) != 0) {
return 0;
}
break;
case LTTNG_UST_ABI_CONTEXT_APP_CONTEXT:
LTTNG_ASSERT(uctx->ctx.u.app_ctx.provider_name);
LTTNG_ASSERT(uctx->ctx.u.app_ctx.ctx_name);
- if (strcmp(uctx->ctx.u.app_ctx.provider_name, ctx->u.app_ctx.provider_name) ||
- strcmp(uctx->ctx.u.app_ctx.ctx_name, ctx->u.app_ctx.ctx_name)) {
+ if (strcmp(uctx->ctx.u.app_ctx.provider_name, ctx->u.app_ctx.provider_name) != 0 ||
+ strcmp(uctx->ctx.u.app_ctx.ctx_name, ctx->u.app_ctx.ctx_name) != 0) {
return 0;
}
default:
class tsdl_trace_environment_visitor : public lst::trace_class_environment_visitor {
public:
- tsdl_trace_environment_visitor() : _environment{ "env {\n" }
- {
- }
+ tsdl_trace_environment_visitor() = default;
void visit(const lst::environment_field<int64_t>& field) override
{
}
private:
- std::string _environment;
+ std::string _environment{ "env {\n" };
};
} /* namespace */
case LTTNG_UST_ABI_CONTEXT_PERF_THREAD_COUNTER:
if (strncmp(key->u.perf_counter.name,
ctx->ctx.u.perf_counter.name,
- sizeof(key->u.perf_counter.name))) {
+ sizeof(key->u.perf_counter.name)) != 0) {
goto no_match;
}
break;
case LTTNG_UST_ABI_CONTEXT_APP_CONTEXT:
- if (strcmp(key->u.app_ctx.provider_name, ctx->ctx.u.app_ctx.provider_name) ||
- strcmp(key->u.app_ctx.ctx_name, ctx->ctx.u.app_ctx.ctx_name)) {
+ if (strcmp(key->u.app_ctx.provider_name, ctx->ctx.u.app_ctx.provider_name) != 0 ||
+ strcmp(key->u.app_ctx.ctx_name, ctx->ctx.u.app_ctx.ctx_name) != 0) {
goto no_match;
}
break;
lst::field_location::elements length_field_location_elements =
current_field_location_elements;
- length_field_location_elements.emplace_back(std::move(length_field_name));
+ length_field_location_elements.emplace_back(length_field_name);
lst::field_location length_field_location{ lookup_root,
std::move(length_field_location_elements) };
const auto& event_ref = *event;
/* Ownership transferred to _events hash table. */
- event.release();
+ (void) event.release();
/* Request next event id if the node was successfully added. */
event_id = event_ref.id;
}
/* String starts with $app. */
- if (strncmp(ctx, app_ctx_prefix, sizeof(app_ctx_prefix) - 1)) {
+ if (strncmp(ctx, app_ctx_prefix, sizeof(app_ctx_prefix) - 1) != 0) {
goto not_found;
}
switch (opt_event_type) {
case LTTNG_EVENT_ALL: /* Enable tracepoints and syscalls */
/* If event name differs from *, select tracepoint. */
- if (strcmp(ev->name, "*")) {
+ if (strcmp(ev->name, "*") != 0) {
ev->type = LTTNG_EVENT_TRACEPOINT;
}
break;
/* Action is not valid if this is not true. */
LTTNG_ASSERT(a->session_name);
LTTNG_ASSERT(b->session_name);
- if (strcmp(a->session_name, b->session_name)) {
+ if (strcmp(a->session_name, b->session_name) != 0) {
goto end;
}
/* Action is not valid if this is not true. */
LTTNG_ASSERT(a->session_name);
LTTNG_ASSERT(b->session_name);
- if (strcmp(a->session_name, b->session_name)) {
+ if (strcmp(a->session_name, b->session_name) != 0) {
goto end;
}
/* Action is not valid if this is not true. */
LTTNG_ASSERT(a->session_name);
LTTNG_ASSERT(b->session_name);
- if (strcmp(a->session_name, b->session_name)) {
+ if (strcmp(a->session_name, b->session_name) != 0) {
goto end;
}
/* Action is not valid if this is not true. */
LTTNG_ASSERT(a->session_name);
LTTNG_ASSERT(b->session_name);
- if (strcmp(a->session_name, b->session_name)) {
+ if (strcmp(a->session_name, b->session_name) != 0) {
goto end;
}
#define ARGPAR_ITEM_DESTROY_AND_RESET(_item) \
{ \
argpar_item_destroy(_item); \
- _item = NULL; \
+ ((_item)) = NULL; \
}
/// @}
/* Condition is not valid if this is not true. */
LTTNG_ASSERT(a->session_name);
LTTNG_ASSERT(b->session_name);
- if (strcmp(a->session_name, b->session_name)) {
+ if (strcmp(a->session_name, b->session_name) != 0) {
goto end;
}
LTTNG_ASSERT(a->channel_name);
LTTNG_ASSERT(b->channel_name);
- if (strcmp(a->channel_name, b->channel_name)) {
+ if (strcmp(a->channel_name, b->channel_name) != 0) {
goto end;
}
switch (size) {
case 1:
- ret = (uint64_t) *uint_view.data;
+ ret = (unsigned char) *uint_view.data;
break;
case sizeof(uint32_t):
{
LTTNG_ASSERT(a->session_name);
LTTNG_ASSERT(b->session_name);
- if (strcmp(a->session_name, b->session_name)) {
+ if (strcmp(a->session_name, b->session_name) != 0) {
goto end;
}
goto end;
}
- if (a->session_name && b->session_name && strcmp(a->session_name, b->session_name)) {
+ if (a->session_name && b->session_name && strcmp(a->session_name, b->session_name) != 0) {
goto end;
}
}
if (strcmp((const char *) consumer_output_node->name,
- config_element_consumer_output)) {
+ config_element_consumer_output) != 0) {
WARN("Invalid output type, expected %s node",
config_element_consumer_output);
ret = -LTTNG_ERR_LOAD_INVALID_CONFIG;
time_us_node = xmlFirstElementChild(child);
if (!time_us_node ||
strcmp((const char *) time_us_node->name,
- config_element_rotation_schedule_periodic_time_us)) {
+ config_element_rotation_schedule_periodic_time_us) != 0) {
ret = -LTTNG_ERR_LOAD_INVALID_CONFIG;
goto end;
}
bytes_node = xmlFirstElementChild(child);
if (!bytes_node ||
strcmp((const char *) bytes_node->name,
- config_element_rotation_schedule_size_threshold_bytes)) {
+ config_element_rotation_schedule_size_threshold_bytes) != 0) {
ret = -LTTNG_ERR_LOAD_INVALID_CONFIG;
goto end;
}
goto error;
}
- if (session_name && strcmp((char *) name, session_name)) {
+ if (session_name && strcmp((char *) name, session_name) != 0) {
/* This is not the session we are looking for */
ret = -LTTNG_ERR_NO_SESSION;
goto error;
/* Does the file end with .lttng? */
if (strcmp(DEFAULT_SESSION_CONFIG_FILE_EXTENSION,
result->d_name + file_name_len -
- sizeof(DEFAULT_SESSION_CONFIG_FILE_EXTENSION) + 1)) {
+ sizeof(DEFAULT_SESSION_CONFIG_FILE_EXTENSION) + 1) !=
+ 0) {
continue;
}
#include "consumer.hpp"
-#define LTTNG_CONSUMER_SIG_SWITCH SIGRTMIN + 10
-#define LTTNG_CONSUMER_SIG_TEARDOWN SIGRTMIN + 11
-#define LTTNG_CONSUMER_SIG_LIVE SIGRTMIN + 12
-#define LTTNG_CONSUMER_SIG_MONITOR SIGRTMIN + 13
-#define LTTNG_CONSUMER_SIG_EXIT SIGRTMIN + 14
+#define LTTNG_CONSUMER_SIG_SWITCH ((SIGRTMIN + 10))
+#define LTTNG_CONSUMER_SIG_TEARDOWN ((SIGRTMIN + 11))
+#define LTTNG_CONSUMER_SIG_LIVE ((SIGRTMIN + 12))
+#define LTTNG_CONSUMER_SIG_MONITOR ((SIGRTMIN + 13))
+#define LTTNG_CONSUMER_SIG_EXIT ((SIGRTMIN + 14))
#define CLOCKID CLOCK_MONOTONIC
LTTNG_ASSERT(pipe);
- (void) lttng_pipe_write(pipe, &null_stream, sizeof(null_stream));
+ (void) lttng_pipe_write(pipe, &null_stream, sizeof(null_stream)); /* NOLINT sizeof used on a
+ pointer. */
}
static void notify_health_quit_pipe(int *pipe)
pipe_len = lttng_pipe_read(ctx->consumer_metadata_pipe,
&stream,
- sizeof(stream));
- if (pipe_len < sizeof(stream)) {
+ sizeof(stream)); /* NOLINT sizeof
+ used on a
+ pointer. */
+ if (pipe_len < sizeof(stream)) { /* NOLINT sizeof used on a
+ pointer. */
if (pipe_len < 0) {
PERROR("read metadata stream");
}
ssize_t pipe_readlen;
DBG("consumer_data_pipe wake up");
- pipe_readlen = lttng_pipe_read(
- ctx->consumer_data_pipe, &new_stream, sizeof(new_stream));
- if (pipe_readlen < sizeof(new_stream)) {
+ pipe_readlen = lttng_pipe_read(ctx->consumer_data_pipe,
+ &new_stream,
+ sizeof(new_stream)); /* NOLINT sizeof used on
+ a pointer. */
+ if (pipe_readlen < sizeof(new_stream)) { /* NOLINT sizeof used on a pointer.
+ */
PERROR("Consumer data pipe");
/* Continue so we can at least handle the current stream(s). */
continue;
}
/* String starts with $app. */
- if (strncmp(str, app_ctx_prefix, sizeof(app_ctx_prefix) - 1)) {
+ if (strncmp(str, app_ctx_prefix, sizeof(app_ctx_prefix) - 1) != 0) {
goto not_found;
}
* than enough. We might end up with quantum computing in a cell phone when
* reaching this limit.
*/
-#define DEFAULT_STREAM_NAME_LEN LTTNG_SYMBOL_NAME_LEN + 8
+#define DEFAULT_STREAM_NAME_LEN (LTTNG_SYMBOL_NAME_LEN + 8)
/* Default channel attributes */
#define DEFAULT_CHANNEL_NAME "channel0"
#define DEFAULT_PYTHON_EVENT_COMPONENT "lttng_python"
#define DEFAULT_PYTHON_EVENT_NAME DEFAULT_PYTHON_EVENT_COMPONENT ":*"
-#define DEFAULT_CHANNEL_OVERWRITE -1
+#define DEFAULT_CHANNEL_OVERWRITE (-1)
#define DEFAULT_CHANNEL_TRACEFILE_SIZE CONFIG_DEFAULT_CHANNEL_TRACEFILE_SIZE
#define DEFAULT_CHANNEL_TRACEFILE_COUNT CONFIG_DEFAULT_CHANNEL_TRACEFILE_COUNT
/* Long check. */
LTTNG_ASSERT(a->pattern);
LTTNG_ASSERT(b->pattern);
- if (strcmp(a->pattern, b->pattern)) {
+ if (strcmp(a->pattern, b->pattern) != 0) {
goto end;
}
if (a->filter_expression && b->filter_expression) {
- if (strcmp(a->filter_expression, b->filter_expression)) {
+ if (strcmp(a->filter_expression, b->filter_expression) != 0) {
goto end;
}
} else if (!!a->filter_expression != !!b->filter_expression) {
/* Long check */
LTTNG_ASSERT(a->name);
LTTNG_ASSERT(b->name);
- if (strcmp(a->name, b->name)) {
+ if (strcmp(a->name, b->name) != 0) {
goto end;
}
LTTNG_ASSERT(a->pattern);
LTTNG_ASSERT(b->pattern);
- if (strcmp(a->pattern, b->pattern)) {
+ if (strcmp(a->pattern, b->pattern) != 0) {
goto end;
}
if (a->filter_expression && b->filter_expression) {
- if (strcmp(a->filter_expression, b->filter_expression)) {
+ if (strcmp(a->filter_expression, b->filter_expression) != 0) {
goto end;
}
} else if (!!a->filter_expression != !!b->filter_expression) {
/* Long check. */
LTTNG_ASSERT(a->pattern);
LTTNG_ASSERT(b->pattern);
- if (strcmp(a->pattern, b->pattern)) {
+ if (strcmp(a->pattern, b->pattern) != 0) {
goto end;
}
if (a->filter_expression && b->filter_expression) {
- if (strcmp(a->filter_expression, b->filter_expression)) {
+ if (strcmp(a->filter_expression, b->filter_expression) != 0) {
goto end;
}
} else if (!!a->filter_expression != !!b->filter_expression) {
/* uprobe is invalid if this is not true. */
LTTNG_ASSERT(a->name);
LTTNG_ASSERT(b->name);
- if (strcmp(a->name, b->name)) {
+ if (strcmp(a->name, b->name) != 0) {
goto end;
}
/* Long check. */
LTTNG_ASSERT(a->pattern);
LTTNG_ASSERT(b->pattern);
- if (strcmp(a->pattern, b->pattern)) {
+ if (strcmp(a->pattern, b->pattern) != 0) {
goto end;
}
if (a->filter_expression && b->filter_expression) {
- if (strcmp(a->filter_expression, b->filter_expression)) {
+ if (strcmp(a->filter_expression, b->filter_expression) != 0) {
goto end;
}
} else if (!!a->filter_expression != !!b->filter_expression) {
/* Long check. */
LTTNG_ASSERT(a->pattern);
LTTNG_ASSERT(b->pattern);
- if (strcmp(a->pattern, b->pattern)) {
+ if (strcmp(a->pattern, b->pattern) != 0) {
goto end;
}
if (a->filter_expression && b->filter_expression) {
- if (strcmp(a->filter_expression, b->filter_expression)) {
+ if (strcmp(a->filter_expression, b->filter_expression) != 0) {
goto end;
}
} else if (!!a->filter_expression != !!b->filter_expression) {
/* Long check. */
LTTNG_ASSERT(a->pattern);
LTTNG_ASSERT(b->pattern);
- if (strcmp(a->pattern, b->pattern)) {
+ if (strcmp(a->pattern, b->pattern) != 0) {
goto end;
}
if (a->filter_expression && b->filter_expression) {
- if (strcmp(a->filter_expression, b->filter_expression)) {
+ if (strcmp(a->filter_expression, b->filter_expression) != 0) {
goto end;
}
} else if (!!a->filter_expression != !!b->filter_expression) {
status = lttng_event_rule_user_tracepoint_get_name_pattern_exclusion_at_index(
_b, i, &exclusion_b);
LTTNG_ASSERT(status == LTTNG_EVENT_RULE_STATUS_OK);
- if (strcmp(exclusion_a, exclusion_b)) {
+ if (strcmp(exclusion_a, exclusion_b) != 0) {
goto end;
}
}
local_event->type = (enum lttng_event_type) event_comm->event_type;
local_event->loglevel_type = (enum lttng_loglevel_type) event_comm->loglevel_type;
local_event->loglevel = event_comm->loglevel;
- local_event->enabled = event_comm->enabled;
+ local_event->enabled = !!event_comm->enabled;
local_event->pid = event_comm->pid;
local_event->flags = (enum lttng_event_flag) event_comm->flags;
#include <urcu/rculfhash.h>
/* Tracker lock must be taken by the user. */
-#define TRACKED_COUNT(tracker) \
- (tracker->count.suspendable.active + tracker->count.suspendable.suspended + \
- tracker->count.unsuspendable)
+#define TRACKED_COUNT(tracker) \
+ ((tracker)->count.suspendable.active + (tracker)->count.suspendable.suspended + \
+ (tracker)->count.unsuspendable)
/* Tracker lock must be taken by the user. */
-#define ACTIVE_COUNT(tracker) (tracker->count.suspendable.active + tracker->count.unsuspendable)
+#define ACTIVE_COUNT(tracker) ((tracker)->count.suspendable.active + (tracker)->count.unsuspendable)
/* Tracker lock must be taken by the user. */
-#define SUSPENDED_COUNT(tracker) (tracker->count.suspendable.suspended)
+#define SUSPENDED_COUNT(tracker) ((tracker)->count.suspendable.suspended)
/* Tracker lock must be taken by the user. */
#define SUSPENDABLE_COUNT(tracker) \
- (tracker->count.suspendable.active + tracker->count.suspendable.suspended)
+ ((tracker)->count.suspendable.active + (tracker)->count.suspendable.suspended)
/* Tracker lock must be taken by the user. */
-#define UNSUSPENDABLE_COUNT(tracker) (tracker->count.unsuspendable)
+#define UNSUSPENDABLE_COUNT(tracker) ((tracker)->count.unsuspendable)
struct fd_tracker {
pthread_mutex_t lock;
* on, and rotates are much kinder to the top and bottom bits, so I used
* rotates.
*/
-#define mix(a, b, c) \
- { \
- a -= c; \
- a ^= rot(c, 4); \
- c += b; \
- b -= a; \
- b ^= rot(a, 6); \
- a += c; \
- c -= b; \
- c ^= rot(b, 8); \
- b += a; \
- a -= c; \
- a ^= rot(c, 16); \
- c += b; \
- b -= a; \
- b ^= rot(a, 19); \
- a += c; \
- c -= b; \
- c ^= rot(b, 4); \
- b += a; \
+#define mix(a, b, c) \
+ { \
+ (a) -= (c); \
+ (a) ^= rot(c, 4); \
+ (c) += (b); \
+ (b) -= (a); \
+ (b) ^= rot(a, 6); \
+ (a) += (c); \
+ (c) -= (b); \
+ (c) ^= rot(b, 8); \
+ (b) += (a); \
+ (a) -= (c); \
+ (a) ^= rot(c, 16); \
+ (c) += (b); \
+ (b) -= (a); \
+ (b) ^= rot(a, 19); \
+ (a) += (c); \
+ (c) -= (b); \
+ (c) ^= rot(b, 4); \
+ (b) += (a); \
}
/*
* 10 8 15 26 3 22 24
* 11 8 15 26 3 22 24
*/
-#define final(a, b, c) \
- { \
- c ^= b; \
- c -= rot(b, 14); \
- a ^= c; \
- a -= rot(c, 11); \
- b ^= a; \
- b -= rot(a, 25); \
- c ^= b; \
- c -= rot(b, 16); \
- a ^= c; \
- a -= rot(c, 4); \
- b ^= a; \
- b -= rot(a, 14); \
- c ^= b; \
- c -= rot(b, 24); \
+#define final(a, b, c) \
+ { \
+ (c) ^= (b); \
+ (c) -= rot(b, 14); \
+ (a) ^= (c); \
+ (a) -= rot(c, 11); \
+ (b) ^= (a); \
+ (b) -= rot(a, 25); \
+ (c) ^= (b); \
+ (c) -= rot(b, 16); \
+ (a) ^= (c); \
+ (a) -= rot(c, 4); \
+ (b) ^= (a); \
+ (b) -= rot(a, 14); \
+ (c) ^= (b); \
+ (c) -= rot(b, 24); \
}
/*
}
if (args->section) {
- if (strcmp(args->section, section)) {
+ if (strcmp(args->section, section) != 0) {
goto end;
}
}
health_code_update();
- ret_pipe_write = lttng_pipe_write(stream_pipe, &new_stream, sizeof(new_stream));
+ ret_pipe_write =
+ lttng_pipe_write(stream_pipe, &new_stream, sizeof(new_stream)); /* NOLINT
+ sizeof
+ used on a
+ pointer.
+ */
if (ret_pipe_write < 0) {
ERR("Consumer write %s stream to pipe %d",
new_stream->metadata_flag ? "metadata" : "data",
LTTNG_ASSERT(a->symbol_name);
LTTNG_ASSERT(b->symbol_name);
- if (strcmp(a->symbol_name, b->symbol_name)) {
+ if (strcmp(a->symbol_name, b->symbol_name) != 0) {
goto end;
}
#define NOTE_STAPSDT_SECTION_NAME ".note.stapsdt"
#define NOTE_STAPSDT_NAME "stapsdt"
#define NOTE_STAPSDT_TYPE 3
-#define MAX_SECTION_DATA_SIZE 512 * 1024 * 1024
+#define MAX_SECTION_DATA_SIZE (512 * 1024 * 1024)
#if BYTE_ORDER == LITTLE_ENDIAN
#define NATIVE_ELF_ENDIANNESS ELFDATA2LSB
#define NATIVE_ELF_ENDIANNESS ELFDATA2MSB
#endif
-#define next_4bytes_boundary(x) (typeof(x)) ((((uint64_t) x) + 3) & ~0x03)
-
-#define bswap(x) \
- do { \
- switch (sizeof(x)) { \
- case 8: \
- x = be64toh((uint64_t) x); \
- break; \
- case 4: \
- x = be32toh((uint32_t) x); \
- break; \
- case 2: \
- x = be16toh((uint16_t) x); \
- break; \
- case 1: \
- break; \
- default: \
- abort(); \
- } \
+#define next_4bytes_boundary(x) (typeof(x)) ((((uint64_t) (x)) + 3) & ~0x03)
+
+#define bswap(x) \
+ do { \
+ switch (sizeof(x)) { \
+ case 8: \
+ (x) = be64toh((uint64_t) (x)); \
+ break; \
+ case 4: \
+ (x) = be32toh((uint32_t) (x)); \
+ break; \
+ case 2: \
+ (x) = be16toh((uint16_t) (x)); \
+ break; \
+ case 1: \
+ break; \
+ default: \
+ abort(); \
+ } \
} while (0)
#define bswap_shdr(shdr) \
(dst_ehdr).e_shstrndx = (src_ehdr).e_shstrndx; \
} while (0)
-#define copy_sym(src_sym, dst_sym) \
- do { \
- dst_sym.st_name = src_sym.st_name; \
- dst_sym.st_info = src_sym.st_info; \
- dst_sym.st_other = src_sym.st_other; \
- dst_sym.st_shndx = src_sym.st_shndx; \
- dst_sym.st_value = src_sym.st_value; \
- dst_sym.st_size = src_sym.st_size; \
+#define copy_sym(src_sym, dst_sym) \
+ do { \
+ (dst_sym).st_name = (src_sym).st_name; \
+ (dst_sym).st_info = (src_sym).st_info; \
+ (dst_sym).st_other = (src_sym).st_other; \
+ (dst_sym).st_shndx = (src_sym).st_shndx; \
+ (dst_sym).st_value = (src_sym).st_value; \
+ (dst_sym).st_size = (src_sym).st_size; \
} while (0)
#ifndef ELFCLASSNUM
/* Event/Channel context */
#define LTTNG_KERNEL_ABI_OLD_CONTEXT_PADDING1 16
-#define LTTNG_KERNEL_ABI_OLD_CONTEXT_PADDING2 LTTNG_KERNEL_ABI_SYM_NAME_LEN + 32
+#define LTTNG_KERNEL_ABI_OLD_CONTEXT_PADDING2 ((LTTNG_KERNEL_ABI_SYM_NAME_LEN + 32))
struct lttng_kernel_abi_old_context {
enum lttng_kernel_abi_context_type ctx;
char padding[LTTNG_KERNEL_ABI_OLD_CONTEXT_PADDING1];
};
#define LTTNG_KERNEL_ABI_OLD_EVENT_PADDING1 16
-#define LTTNG_KERNEL_ABI_OLD_EVENT_PADDING2 LTTNG_KERNEL_ABI_SYM_NAME_LEN + 32
+#define LTTNG_KERNEL_ABI_OLD_EVENT_PADDING2 ((LTTNG_KERNEL_ABI_SYM_NAME_LEN + 32))
struct lttng_kernel_abi_old_event {
char name[LTTNG_KERNEL_ABI_SYM_NAME_LEN];
enum lttng_kernel_abi_instrumentation instrumentation;
/*
* kernel channel
*/
-#define LTTNG_KERNEL_ABI_OLD_CHANNEL_PADDING1 LTTNG_SYMBOL_NAME_LEN + 32
+#define LTTNG_KERNEL_ABI_OLD_CHANNEL_PADDING1 ((LTTNG_SYMBOL_NAME_LEN + 32))
struct lttng_kernel_abi_old_channel {
int overwrite; /* 1: overwrite, 0: discard */
uint64_t subbuf_size; /* bytes */
/* Event/Channel context */
#define LTTNG_KERNEL_ABI_CONTEXT_PADDING1 16
-#define LTTNG_KERNEL_ABI_CONTEXT_PADDING2 LTTNG_KERNEL_ABI_SYM_NAME_LEN + 32
+#define LTTNG_KERNEL_ABI_CONTEXT_PADDING2 ((LTTNG_KERNEL_ABI_SYM_NAME_LEN + 32))
struct lttng_kernel_abi_context {
enum lttng_kernel_abi_context_type ctx;
char padding[LTTNG_KERNEL_ABI_CONTEXT_PADDING1];
} LTTNG_PACKED;
#define LTTNG_KERNEL_ABI_EVENT_PADDING1 8
-#define LTTNG_KERNEL_ABI_EVENT_PADDING2 LTTNG_KERNEL_ABI_SYM_NAME_LEN + 32
+#define LTTNG_KERNEL_ABI_EVENT_PADDING2 ((LTTNG_KERNEL_ABI_SYM_NAME_LEN + 32))
struct lttng_kernel_abi_event {
char name[LTTNG_KERNEL_ABI_SYM_NAME_LEN];
enum lttng_kernel_abi_instrumentation instrumentation;
/*
* kernel channel
*/
-#define LTTNG_KERNEL_ABI_CHANNEL_PADDING1 LTTNG_SYMBOL_NAME_LEN + 32
+#define LTTNG_KERNEL_ABI_CHANNEL_PADDING1 ((LTTNG_SYMBOL_NAME_LEN + 32))
struct lttng_kernel_abi_channel {
uint64_t subbuf_size; /* bytes */
uint64_t num_subbuf; /* power of 2 */
* memory using malloc(), we must use generic accessors for compat in order to
* *not* use a function to access members and not the variable name.
*/
-#define LTTNG_REF(x) ((typeof(*x) *)(x))
+#define LTTNG_REF(x) ((typeof(*(x)) *) (x))
#ifdef NDEBUG
/*
T *zmalloc()
{
static_assert (can_malloc<T>::value, "type can be malloc'ed");
- return (T *) zmalloc_internal(sizeof(T));
+ return (T *) zmalloc_internal(sizeof(T)); /* NOLINT sizeof potentially used on a pointer. */
}
/*
T *calloc(size_t nmemb)
{
static_assert (can_malloc<T>::value, "type can be malloc'ed");
- return (T *) zmalloc_internal(nmemb * sizeof(T));
+ return (T *) zmalloc_internal(nmemb * sizeof(T)); /* NOLINT sizeof potentially used on a pointer. */
}
/*
#define member_sizeof(type, field) sizeof(((type *) 0)->field)
-#define ASSERT_LOCKED(lock) LTTNG_ASSERT(pthread_mutex_trylock(&lock))
+#define ASSERT_LOCKED(lock) LTTNG_ASSERT(pthread_mutex_trylock(&(lock)))
#define ASSERT_RCU_READ_LOCKED(lock) LTTNG_ASSERT(rcu_read_ongoing())
/* Attribute suitable to tag functions as having printf()-like arguments. */
/*
* Initialize an optional field as 'set' with a given value.
*/
-#define LTTNG_OPTIONAL_INIT_VALUE(val) { .is_set = 1, .value = val }
+#define LTTNG_OPTIONAL_INIT_VALUE(val) \
+ { \
+ .is_set = 1, .value = (val) \
+ }
/* Set the value of an optional field. */
#define LTTNG_OPTIONAL_SET(field_ptr, val) \
bool _error;
} LTTNG_PACKED;
-#define COMMAND_IN_FDS(data_ptr) \
- ({ \
- int *fds = NULL; \
- if (command_properties[data_ptr->cmd].in_fds_offset != -1) { \
- fds = (int *) ((char *) data_ptr + \
- command_properties[data_ptr->cmd].in_fds_offset); \
- } \
- fds; \
+#define COMMAND_IN_FDS(data_ptr) \
+ ({ \
+ int *fds = NULL; \
+ if (command_properties[(data_ptr)->cmd].in_fds_offset != -1) { \
+ fds = (int *) ((char *) (data_ptr) + \
+ command_properties[(data_ptr)->cmd].in_fds_offset); \
+ } \
+ fds; \
})
-#define COMMAND_OUT_FDS(cmd, ret_ptr) \
- ({ \
- int *fds = NULL; \
- if (command_properties[cmd].out_fds_offset != -1) { \
- fds = (int *) ((char *) ret_ptr + command_properties[cmd].out_fds_offset); \
- } \
- fds; \
+#define COMMAND_OUT_FDS(cmd, ret_ptr) \
+ ({ \
+ int *fds = NULL; \
+ if (command_properties[cmd].out_fds_offset != -1) { \
+ fds = (int *) ((char *) (ret_ptr) + \
+ command_properties[cmd].out_fds_offset); \
+ } \
+ fds; \
})
-#define COMMAND_IN_FD_COUNT(data_ptr) ({ command_properties[data_ptr->cmd].in_fd_count; })
+#define COMMAND_IN_FD_COUNT(data_ptr) ({ command_properties[(data_ptr)->cmd].in_fd_count; })
#define COMMAND_OUT_FD_COUNT(cmd) ({ command_properties[cmd].out_fd_count; })
-#define COMMAND_USE_CWD_FD(data_ptr) command_properties[data_ptr->cmd].use_cwd_fd
+#define COMMAND_USE_CWD_FD(data_ptr) command_properties[(data_ptr)->cmd].use_cwd_fd
struct run_as_command_properties {
/* Set to -1 when not applicable. */
* the creation of the next chunk. This happens if a rotation is
* performed while tracing is stopped.
*/
- if (!trace_chunk->path || strcmp(trace_chunk->path, DEFAULT_CHUNK_TMP_OLD_DIRECTORY)) {
+ if (!trace_chunk->path || strcmp(trace_chunk->path, DEFAULT_CHUNK_TMP_OLD_DIRECTORY) != 0) {
status = lttng_trace_chunk_rename_path_no_lock(trace_chunk,
DEFAULT_CHUNK_TMP_OLD_DIRECTORY);
if (status != LTTNG_TRACE_CHUNK_STATUS_OK) {
((as_type) (std::is_signed<as_type>::value ? (value_ptr)->u._signed : \
(value_ptr)->u._unsigned))
-#define SET_INTEGRAL_COMM_VALUE(comm_value, val) \
- if (std::is_signed<typeof(val)>::value) { \
- (comm_value)->u._signed = (typeof((comm_value)->u._signed)) val; \
- } else { \
- (comm_value)->u._unsigned = (typeof((comm_value)->u._unsigned)) val; \
+#define SET_INTEGRAL_COMM_VALUE(comm_value, val) \
+ if (std::is_signed<typeof(val)>::value) { \
+ (comm_value)->u._signed = (typeof((comm_value)->u._signed)) (val); \
+ } else { \
+ (comm_value)->u._unsigned = (typeof((comm_value)->u._unsigned)) (val); \
}
static inline bool is_virtual_process_attr(enum lttng_process_attr process_attr)
*/
class read_lock_guard {
public:
- read_lock_guard() : _guard(_lock)
- {
- }
+ read_lock_guard() = default;
read_lock_guard(const read_lock_guard &) = delete;
private:
details::read_lock _lock;
- std::lock_guard<details::read_lock> _guard;
+ std::lock_guard<details::read_lock> _guard{_lock};
};
using unique_read_lock = std::unique_lock<details::read_lock>;
LTTNG_ASSERT(a->function_name);
LTTNG_ASSERT(b->function_name);
- if (strcmp(a->function_name, b->function_name)) {
+ if (strcmp(a->function_name, b->function_name) != 0) {
goto end;
}
LTTNG_ASSERT(a->binary_path);
LTTNG_ASSERT(b->binary_path);
- if (strcmp(a->binary_path, b->binary_path)) {
+ if (strcmp(a->binary_path, b->binary_path) != 0) {
goto end;
}
LTTNG_ASSERT(a->probe_name);
LTTNG_ASSERT(b->probe_name);
- if (strcmp(a->probe_name, b->probe_name)) {
+ if (strcmp(a->probe_name, b->probe_name) != 0) {
goto end;
}
LTTNG_ASSERT(a->provider_name);
LTTNG_ASSERT(b->provider_name);
- if (strcmp(a->provider_name, b->provider_name)) {
+ if (strcmp(a->provider_name, b->provider_name) != 0) {
goto end;
}
LTTNG_ASSERT(a->binary_path);
LTTNG_ASSERT(b->binary_path);
- if (strcmp(a->binary_path, b->binary_path)) {
+ if (strcmp(a->binary_path, b->binary_path) != 0) {
goto end;
}
stream->globally_visible = 1;
cds_list_del_init(&stream->send_node);
- ret = lttng_pipe_write(stream_pipe, &stream, sizeof(stream));
+ ret = lttng_pipe_write(stream_pipe, &stream, sizeof(stream)); /* NOLINT sizeof used on a
+ pointer. */
if (ret < 0) {
ERR("Consumer write %s stream to pipe %d",
stream->metadata_flag ? "metadata" : "data",
#include <string.h>
#include <unistd.h>
-#define COPY_DOMAIN_PACKED(dst, src) \
- do { \
- struct lttng_domain _tmp_domain; \
- \
- lttng_ctl_copy_lttng_domain(&_tmp_domain, &src); \
- dst = _tmp_domain; \
+#define COPY_DOMAIN_PACKED(dst, src) \
+ do { \
+ struct lttng_domain _tmp_domain; \
+ \
+ lttng_ctl_copy_lttng_domain(&_tmp_domain, &(src)); \
+ (dst) = _tmp_domain; \
} while (0)
/* Socket to session daemon for communication */
return type;
}
-#define DEFINE_LTTNG_PROCESS_ATTR_VALUES_GETTER(value_type_name, value_type, expected_value_type) \
- enum lttng_process_attr_values_status \
- lttng_process_attr_values_get_##value_type_name##_at_index( \
- const struct lttng_process_attr_values *values, \
- unsigned int index, \
- value_type *out_value) \
- { \
- enum lttng_process_attr_values_status status = \
- LTTNG_PROCESS_ATTR_VALUES_STATUS_OK; \
- const struct process_attr_value *value; \
- \
- if (!values) { \
- status = LTTNG_PROCESS_ATTR_VALUES_STATUS_INVALID; \
- goto end; \
- } \
- \
- if (_lttng_process_attr_values_get_count(values) <= index) { \
- status = LTTNG_PROCESS_ATTR_VALUES_STATUS_INVALID; \
- goto end; \
- } \
- \
- value = lttng_process_attr_tracker_values_get_at_index(values, index); \
- if (value->type != LTTNG_PROCESS_ATTR_VALUE_TYPE_##expected_value_type) { \
- status = LTTNG_PROCESS_ATTR_VALUES_STATUS_INVALID_TYPE; \
- goto end; \
- } \
- *out_value = value->value.value_type_name; \
- end: \
- return status; \
+#define DEFINE_LTTNG_PROCESS_ATTR_VALUES_GETTER(value_type_name, value_type, expected_value_type) \
+ enum lttng_process_attr_values_status \
+ lttng_process_attr_values_get_##value_type_name##_at_index( \
+ const struct lttng_process_attr_values *values, \
+ unsigned int index, \
+ value_type *out_value) /* NOLINT clang-tidy sees value_type as a value and \
+ adds parentheses */ \
+ { \
+ enum lttng_process_attr_values_status status = \
+ LTTNG_PROCESS_ATTR_VALUES_STATUS_OK; \
+ const struct process_attr_value *value; \
+ \
+ if (!values) { \
+ status = LTTNG_PROCESS_ATTR_VALUES_STATUS_INVALID; \
+ goto end; \
+ } \
+ \
+ if (_lttng_process_attr_values_get_count(values) <= index) { \
+ status = LTTNG_PROCESS_ATTR_VALUES_STATUS_INVALID; \
+ goto end; \
+ } \
+ \
+ value = lttng_process_attr_tracker_values_get_at_index(values, index); \
+ if (value->type != LTTNG_PROCESS_ATTR_VALUE_TYPE_##expected_value_type) { \
+ status = LTTNG_PROCESS_ATTR_VALUES_STATUS_INVALID_TYPE; \
+ goto end; \
+ } \
+ *out_value = value->value.value_type_name; \
+ end: \
+ return status; \
}
DEFINE_LTTNG_PROCESS_ATTR_VALUES_GETTER(pid, pid_t, PID);
--- /dev/null
+Checks: '-*,llvm-twine-local'
const char *trigger_name = NULL;
lttng_trigger_get_name(trigger, &trigger_name);
- if (strcmp(trigger_name, expected_trigger_name)) {
+ if (strcmp(trigger_name, expected_trigger_name) != 0) {
/* Might match the end event trigger */
if (end_trigger_name != NULL &&
strcmp(trigger_name,
- end_trigger_name)) {
+ end_trigger_name) != 0) {
continue;
}
}
break;
}
- if (strcmp(file_contents, read_buf)) {
+ if (strcmp(file_contents, read_buf) != 0) {
content_ok = false;
diag("File content doesn't match the expectated string");
(void) close(fd);
#define HIGH_FD_COUNT LTTCOMM_MAX_SEND_FDS
#define MESSAGE_COUNT 4
-#define LARGE_PAYLOAD_SIZE 4 * 1024
+#define LARGE_PAYLOAD_SIZE (4 * 1024)
#define LARGE_PAYLOAD_RECV_SIZE 100
static const int TEST_COUNT = 37;