*
*/
-#include <assert.h>
#include <common/dynamic-buffer.h>
#include <common/error.h>
#include <common/hashtable/hashtable.h>
free(log_level_rule);
}
-LTTNG_HIDDEN
ssize_t lttng_log_level_rule_create_from_payload(
struct lttng_payload_view *view,
struct lttng_log_level_rule **_rule)
return ret;
}
-LTTNG_HIDDEN
int lttng_log_level_rule_serialize(const struct lttng_log_level_rule *rule,
struct lttng_payload *payload)
{
return ret;
}
-LTTNG_HIDDEN
bool lttng_log_level_rule_is_equal(const struct lttng_log_level_rule *a,
const struct lttng_log_level_rule *b)
{
return is_equal;
}
-LTTNG_HIDDEN
struct lttng_log_level_rule *lttng_log_level_rule_copy(
const struct lttng_log_level_rule *source)
{
struct lttng_log_level_rule *copy = NULL;
- assert(source);
+ LTTNG_ASSERT(source);
copy = zmalloc(sizeof(struct lttng_log_level_rule));
if (!copy) {
return copy;
}
-LTTNG_HIDDEN
void lttng_log_level_rule_to_loglevel(
const struct lttng_log_level_rule *log_level_rule,
enum lttng_loglevel_type *loglevel_type,
int *loglevel_value)
{
- assert(log_level_rule);
+ LTTNG_ASSERT(log_level_rule);
switch (log_level_rule->type) {
case LTTNG_LOG_LEVEL_RULE_TYPE_EXACTLY:
*loglevel_value = log_level_rule->level;
}
-LTTNG_HIDDEN
unsigned long lttng_log_level_rule_hash(
const struct lttng_log_level_rule *log_level_rule)
{
int log_level_value;
enum lttng_log_level_rule_type type;
- assert(log_level_rule);
+ LTTNG_ASSERT(log_level_rule);
type = lttng_log_level_rule_get_type(log_level_rule);
break;
}
- assert(llr_status == LTTNG_LOG_LEVEL_RULE_STATUS_OK);
+ LTTNG_ASSERT(llr_status == LTTNG_LOG_LEVEL_RULE_STATUS_OK);
hash = hash_key_ulong((void *) (unsigned long) type, lttng_ht_seed);
return hash;
}
-LTTNG_HIDDEN
enum lttng_error_code lttng_log_level_rule_mi_serialize(
const struct lttng_log_level_rule *rule,
struct mi_writer *writer)
const char *element_str = NULL;
int level;
- assert(rule);
- assert(writer);
+ LTTNG_ASSERT(rule);
+ LTTNG_ASSERT(writer);
switch (lttng_log_level_rule_get_type(rule)) {
case LTTNG_LOG_LEVEL_RULE_TYPE_EXACTLY:
break;
}
- assert(status == LTTNG_LOG_LEVEL_RULE_STATUS_OK);
+ LTTNG_ASSERT(status == LTTNG_LOG_LEVEL_RULE_STATUS_OK);
/* Open log level rule element. */
ret = mi_lttng_writer_open_element(