MT#55283 eliminate `basic_stats` struct

Pointless.

Change-Id: Idf546106115ca136f2c77bb13008bb561bd0173d
pull/1826/head
Richard Fuchs 2 years ago
parent 2c425bc47e
commit 2698e53948

@ -1776,11 +1776,11 @@ static void __stream_consume_stats(struct packet_stream *ps, const struct rtpeng
continue; continue;
struct ssrc_entry_call *parent = ssrc_ctx->parent; struct ssrc_entry_call *parent = ssrc_ctx->parent;
if (!stats_info->ssrc_stats[u].basic_stats.packets) // no change if (!stats_info->ssrc_stats[u].packets) // no change
continue; continue;
atomic64_add(&ssrc_ctx->packets, stats_info->ssrc_stats[u].basic_stats.packets); atomic64_add(&ssrc_ctx->packets, stats_info->ssrc_stats[u].packets);
atomic64_add(&ssrc_ctx->octets, stats_info->ssrc_stats[u].basic_stats.bytes); atomic64_add(&ssrc_ctx->octets, stats_info->ssrc_stats[u].bytes);
parent->packets_lost += stats_info->ssrc_stats[u].total_lost; // XXX should be atomic? parent->packets_lost += stats_info->ssrc_stats[u].total_lost; // XXX should be atomic?
atomic64_set(&ssrc_ctx->last_seq, stats_info->ssrc_stats[u].ext_seq); atomic64_set(&ssrc_ctx->last_seq, stats_info->ssrc_stats[u].ext_seq);
parent->jitter = stats_info->ssrc_stats[u].jitter; parent->jitter = stats_info->ssrc_stats[u].jitter;
@ -1811,8 +1811,8 @@ static void __stream_consume_stats(struct packet_stream *ps, const struct rtpeng
if (ssrc_ctx) { if (ssrc_ctx) {
parent = ssrc_ctx->parent; parent = ssrc_ctx->parent;
atomic64_add(&ssrc_ctx->packets, stats_info->ssrc_stats[u].basic_stats.packets); atomic64_add(&ssrc_ctx->packets, stats_info->ssrc_stats[u].packets);
atomic64_add(&ssrc_ctx->octets, stats_info->ssrc_stats[u].basic_stats.bytes); atomic64_add(&ssrc_ctx->octets, stats_info->ssrc_stats[u].bytes);
} }
mutex_unlock(&sink->out_lock); mutex_unlock(&sink->out_lock);

@ -1864,8 +1864,8 @@ static void target_retrieve_stats(struct rtpengine_target *g, struct rtpengine_s
i->ssrc[u] = g->target.ssrc[u]; i->ssrc[u] = g->target.ssrc[u];
i->ssrc_stats[u] = g->ssrc_stats[u]; i->ssrc_stats[u] = g->ssrc_stats[u];
g->ssrc_stats[u].basic_stats.packets = 0; g->ssrc_stats[u].packets = 0;
g->ssrc_stats[u].basic_stats.bytes = 0; g->ssrc_stats[u].bytes = 0;
g->ssrc_stats[u].total_lost = 0; g->ssrc_stats[u].total_lost = 0;
} }
@ -5226,8 +5226,8 @@ static void rtp_stats(struct rtpengine_target *g, struct rtp_parsed *rtp, s64 ar
spin_lock_irqsave(&g->ssrc_stats_lock, flags); spin_lock_irqsave(&g->ssrc_stats_lock, flags);
s->basic_stats.packets++; s->packets++;
s->basic_stats.bytes += rtp->payload_len; s->bytes += rtp->payload_len;
s->timestamp = ts; s->timestamp = ts;
// track sequence numbers and lost frames // track sequence numbers and lost frames

@ -17,12 +17,9 @@ struct xt_rtpengine_info {
unsigned int id; unsigned int id;
}; };
struct rtpengine_rtp_stats { struct rtpengine_ssrc_stats {
uint64_t packets; uint64_t packets;
uint64_t bytes; uint64_t bytes;
};
struct rtpengine_ssrc_stats {
struct rtpengine_rtp_stats basic_stats;
uint32_t timestamp; uint32_t timestamp;
uint32_t ext_seq; uint32_t ext_seq;
uint32_t lost_bits; // sliding bitfield, [0] = ext_seq uint32_t lost_bits; // sliding bitfield, [0] = ext_seq

Loading…
Cancel
Save