X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fcondition-internal.c;h=caab613aa733c8e534e36674f837e21561808b37;hb=a0377dfefe40662ba7d68617bce6ff467114136c;hp=c86bf540106031b674dde19c7931ac681f719be8;hpb=8dbb86b8a981917165030d3a7fbbc2cb932888ed;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/condition-internal.c b/src/bin/lttng-sessiond/condition-internal.c index c86bf5401..caab613aa 100644 --- a/src/bin/lttng-sessiond/condition-internal.c +++ b/src/bin/lttng-sessiond/condition-internal.c @@ -44,10 +44,7 @@ unsigned long lttng_condition_buffer_usage_hash( lttng_ht_seed); } if (condition->threshold_ratio.set) { - uint64_t val; - - val = condition->threshold_ratio.value * (double) UINT32_MAX; - hash ^= hash_key_u64(&val, lttng_ht_seed); + hash ^= hash_key_u64(&condition->threshold_ratio.value, lttng_ht_seed); } else if (condition->threshold_bytes.set) { uint64_t val; @@ -90,7 +87,7 @@ unsigned long lttng_condition_session_rotation_hash( struct lttng_condition_session_rotation, parent); condition_type = (unsigned long) condition->parent.type; hash = hash_key_ulong((void *) condition_type, lttng_ht_seed); - assert(condition->session_name); + LTTNG_ASSERT(condition->session_name); hash ^= hash_key_str(condition->session_name, lttng_ht_seed); return hash; } @@ -105,7 +102,7 @@ static unsigned long lttng_condition_event_rule_matches_hash( condition_type = (unsigned long) condition->type; condition_status = lttng_condition_event_rule_matches_get_rule( condition, &event_rule); - assert(condition_status == LTTNG_CONDITION_STATUS_OK); + LTTNG_ASSERT(condition_status == LTTNG_CONDITION_STATUS_OK); hash = hash_key_ulong((void *) condition_type, lttng_ht_seed); return hash ^ lttng_event_rule_hash(event_rule); @@ -130,7 +127,6 @@ unsigned long lttng_condition_hash(const struct lttng_condition *condition) case LTTNG_CONDITION_TYPE_EVENT_RULE_MATCHES: return lttng_condition_event_rule_matches_hash(condition); default: - //ERR("[notification-thread] Unexpected condition type caught"); abort(); } }