Browse Source

MT#55283 move stats struct defs to kernel module

These will be shared between userspace and kernel space and so the
definitions must be part of the kernel includes.

Change-Id: Iabf7a4ecff3638ea1765a6d7341bb24e9955b509
pull/1826/head
Richard Fuchs 2 years ago
parent
commit
7f07a5d24b
7 changed files with 41 additions and 30 deletions
  1. +1
    -0
      debian/ngcp-rtpengine-kernel-dkms.install
  2. +2
    -0
      el/rtpengine.spec
  3. +1
    -30
      include/media_socket.h
  4. +37
    -0
      kernel-module/common_stats.h
  5. +0
    -0
      kernel-module/interface_counter_stats_fields.inc
  6. +0
    -0
      kernel-module/interface_counter_stats_fields_dir.inc
  7. +0
    -0
      kernel-module/interface_sampled_stats_fields.inc

+ 1
- 0
debian/ngcp-rtpengine-kernel-dkms.install View File

@ -1,3 +1,4 @@
kernel-module/*.c usr/src/${env:DEB_SOURCE}-${env:DEB_VERSION_UPSTREAM}
kernel-module/*.h usr/src/${env:DEB_SOURCE}-${env:DEB_VERSION_UPSTREAM}
kernel-module/*.inc usr/src/${env:DEB_SOURCE}-${env:DEB_VERSION_UPSTREAM}
kernel-module/Makefile usr/src/${env:DEB_SOURCE}-${env:DEB_VERSION_UPSTREAM}

+ 2
- 0
el/rtpengine.spec View File

@ -174,6 +174,8 @@ install -D -p -m644 kernel-module/xt_RTPENGINE.c \
%{buildroot}%{_usrsrc}/%{name}-%{version}-%{release}/xt_RTPENGINE.c
install -D -p -m644 kernel-module/xt_RTPENGINE.h \
%{buildroot}%{_usrsrc}/%{name}-%{version}-%{release}/xt_RTPENGINE.h
install -D -p -m644 kernel-module/*.inc \
%{buildroot}%{_usrsrc}/%{name}-%{version}-%{release}/
install -D -p -m644 debian/ngcp-rtpengine-kernel-dkms.dkms %{buildroot}%{_usrsrc}/%{name}-%{version}-%{release}/dkms.conf
sed -i -e "s/#MODULE_VERSION#/%{version}-%{release}/g" %{buildroot}%{_usrsrc}/%{name}-%{version}-%{release}/dkms.conf
%if 0%{?with_transcoding} > 0


+ 1
- 30
include/media_socket.h View File

@ -15,6 +15,7 @@
#include "types.h"
#include "xt_RTPENGINE.h"
#include "common_stats.h"
struct media_packet;
struct transport_protocol;
@ -104,36 +105,6 @@ struct intf_spec {
struct intf_address local_address;
struct port_pool port_pool;
};
struct interface_counter_stats_dir {
#define F(n) atomic64 n;
#include "interface_counter_stats_fields_dir.inc"
#undef F
};
struct interface_counter_stats {
#define F(n) atomic64 n;
#include "interface_counter_stats_fields.inc"
#undef F
};
struct interface_sampled_stats_fields {
#define F(n) atomic64 n;
#include "interface_sampled_stats_fields.inc"
#undef F
};
struct interface_sampled_stats {
struct interface_sampled_stats_fields sums;
struct interface_sampled_stats_fields sums_squared;
struct interface_sampled_stats_fields counts;
};
struct interface_sampled_stats_avg {
struct interface_sampled_stats_fields avg;
struct interface_sampled_stats_fields stddev;
};
struct interface_stats_block {
struct interface_counter_stats_dir in,
out;
struct interface_counter_stats s;
struct interface_sampled_stats sampled;
};
struct interface_sampled_rate_stats {
GHashTable *ht;
struct interface_stats_block intv;


+ 37
- 0
kernel-module/common_stats.h View File

@ -0,0 +1,37 @@
#ifndef _RTPE_COMMON_STATS_H_
#define _RTPE_COMMON_STATS_H_
struct interface_counter_stats_dir {
#define F(n) atomic64 n;
#include "interface_counter_stats_fields_dir.inc"
#undef F
};
struct interface_counter_stats {
#define F(n) atomic64 n;
#include "interface_counter_stats_fields.inc"
#undef F
};
struct interface_sampled_stats_fields {
#define F(n) atomic64 n;
#include "interface_sampled_stats_fields.inc"
#undef F
};
struct interface_sampled_stats {
struct interface_sampled_stats_fields sums;
struct interface_sampled_stats_fields sums_squared;
struct interface_sampled_stats_fields counts;
};
struct interface_sampled_stats_avg {
struct interface_sampled_stats_fields avg;
struct interface_sampled_stats_fields stddev;
};
struct interface_stats_block {
struct interface_counter_stats_dir in,
out;
struct interface_counter_stats s;
struct interface_sampled_stats sampled;
};
#endif

include/interface_counter_stats_fields.inc → kernel-module/interface_counter_stats_fields.inc View File


include/interface_counter_stats_fields_dir.inc → kernel-module/interface_counter_stats_fields_dir.inc View File


include/interface_sampled_stats_fields.inc → kernel-module/interface_sampled_stats_fields.inc View File


Loading…
Cancel
Save