aboutsummaryrefslogtreecommitdiffstats
path: root/resources
diff options
context:
space:
mode:
authorpmikus <peter.mikus@protonmail.ch>2022-11-30 14:46:10 +0000
committerpmikus <peter.mikus@protonmail.ch>2022-12-06 07:12:09 +0000
commit5466cc69f18a480dbff7e39d28abbbccf683ba2f (patch)
tree1ec87291b32aa79dc2f6a48b7a3533548f5ed61b /resources
parentbfbdfaedb044b7643b81f47e76285baedfee9e25 (diff)
feat(telemetry): Add telemetry export
Signed-off-by: pmikus <peter.mikus@protonmail.ch> Change-Id: Ibb8a59fd4e08bc736494c7ab18e689a55f7a98dc
Diffstat (limited to 'resources')
-rw-r--r--resources/libraries/python/TelemetryUtil.py138
-rw-r--r--resources/libraries/python/model/ExportResult.py9
-rw-r--r--resources/libraries/robot/performance/performance_actions.robot6
-rw-r--r--resources/libraries/robot/performance/performance_utils.robot5
-rw-r--r--resources/templates/telemetry/vpp_clear_stats.yaml64
-rw-r--r--resources/templates/telemetry/vpp_runtime.yaml347
-rw-r--r--resources/templates/telemetry/vpp_show_stats.yaml60
-rw-r--r--resources/templates/telemetry/vpp_test_teardown.yaml60
-rw-r--r--resources/templates/telemetry/vppctl_clear_stats.yaml64
-rw-r--r--resources/templates/telemetry/vppctl_runtime.yaml306
-rw-r--r--resources/templates/telemetry/vppctl_show_stats.yaml60
-rw-r--r--resources/templates/telemetry/vppctl_test_teardown.yaml60
-rw-r--r--resources/tools/telemetry/bundle_perf_stat.py8
-rw-r--r--resources/tools/telemetry/bundle_vppctl.py6
-rw-r--r--resources/tools/telemetry/constants.py1
-rw-r--r--resources/tools/telemetry/metrics.py8
16 files changed, 452 insertions, 750 deletions
diff --git a/resources/libraries/python/TelemetryUtil.py b/resources/libraries/python/TelemetryUtil.py
index c978441d72..70efa13fff 100644
--- a/resources/libraries/python/TelemetryUtil.py
+++ b/resources/libraries/python/TelemetryUtil.py
@@ -13,131 +13,87 @@
"""Telemetry utility."""
-from robot.api import logger
-from time import sleep
-
+from resources.libraries.python.model.ExportResult import append_telemetry
from resources.libraries.python.Constants import Constants
-from resources.libraries.python.VppCounters import VppCounters
-from resources.libraries.python.OptionString import OptionString
-from resources.libraries.python.ssh import exec_cmd, exec_cmd_no_error
+from resources.libraries.python.ssh import exec_cmd_no_error
from resources.libraries.python.topology import NodeType
-__all__ = [u"TelemetryUtil"]
+__all__ = ["TelemetryUtil"]
class TelemetryUtil:
"""Class contains methods for telemetry utility."""
@staticmethod
- def perf_stat(node, cpu_list=None, duration=1):
- """Get perf stat read for duration.
-
- :param node: Node in the topology.
- :param cpu_list: CPU List as a string separated by comma.
- :param duration: Measure time in seconds.
- :type node: dict
- :type cpu_list: str
- :type duration: int
- """
- if cpu_list:
- cpu_list = list(dict.fromkeys(cpu_list.split(u",")))
- cpu_list = ",".join(str(cpu) for cpu in cpu_list)
-
- cmd_opts = OptionString(prefix=u"--")
- cmd_opts.add(u"no-aggr")
- cmd_opts.add_with_value_if(
- u"cpu", cpu_list, cpu_list
- )
- cmd_opts.add_if(
- u"all-cpus", not(cpu_list)
- )
- cmd_opts.add_with_value_if(
- u"event", f"'{{{Constants.PERF_STAT_EVENTS}}}'",
- Constants.PERF_STAT_EVENTS
- )
- cmd_opts.add_with_value(
- u"interval-print", 1000
- )
- cmd_opts.add_with_value(
- u"field-separator", u"';'"
- )
-
- cmd_base = OptionString()
- cmd_base.add(f"perf stat")
- cmd_base.extend(cmd_opts)
- cmd_base.add(u"--")
- cmd_base.add_with_value(u"sleep", int(duration))
-
- exec_cmd(node, cmd_base, sudo=True)
-
- @staticmethod
- def perf_stat_on_all_duts(nodes, cpu_list=None, duration=1):
- """Get perf stat read for duration on all DUTs.
-
- :param nodes: Nodes in the topology.
- :param cpu_list: CPU List.
- :param duration: Measure time in seconds.
- :type nodes: dict
- :type cpu_list: str
- :type duration: int
- """
- for node in nodes.values():
- if node[u"type"] == NodeType.DUT:
- TelemetryUtil.perf_stat(
- node, cpu_list=cpu_list, duration=duration
- )
-
- @staticmethod
- def run_telemetry(node, profile, hook=None):
- """Get telemetry stat read for duration.
+ def _run_telemetry(
+ node, profile, sid=None, spath=None, oload="", export=False):
+ """Get telemetry read on node.
:param node: Node in the topology.
:param profile: Telemetry configuration profile.
- :param hook: Process ID or socket path (optional).
+ :param sid: Socket ID used to describe recipient side of socket.
+ :param spath: Socket path.
+ :param oload: Telemetry offered load, unique within the test (optional).
+ :param export: If false, do not attempt JSON export (default false).
:type node: dict
:type profile: str
- :type hook: str
+ :type sid: str
+ :type spath: str
+ :type oload: str
+ :type export: bool
"""
- config = u""
+ config = ""
config += f"{Constants.REMOTE_FW_DIR}/"
config += f"{Constants.RESOURCES_TPL_TELEMETRY}/"
config += f"{profile}"
- cd_cmd = u""
+ cd_cmd = ""
cd_cmd += f"sh -c \"cd {Constants.REMOTE_FW_DIR}/"
cd_cmd += f"{Constants.RESOURCES_TOOLS}"
- bin_cmd = f"python3 -m telemetry --config {config} --hook {hook}\""
- hostname = node[u"host"]
-
+ if spath:
+ bin_cmd = f"python3 -m telemetry --config {config} --hook {spath}\""
+ else:
+ bin_cmd = f"python3 -m telemetry --config {config}\""
exec_cmd_no_error(node, f"{cd_cmd} && {bin_cmd}", sudo=True)
+
+ if not export:
+ return
+
+ hostname = exec_cmd_no_error(node, "hostname")[0].strip()
stdout, _ = exec_cmd_no_error(
- node, u"cat /tmp/metric.prom", sudo=True, log_stdout_err=False
- )
- logger.info(
- u"# TYPE target info\n"
- u"# HELP target Target metadata\n"
- f"target_info{{hostname=\"{hostname}\",hook=\"{hook}\"}} 1\n"
- f"{stdout}"
+ node, "cat /tmp/metric.prom", sudo=True, log_stdout_err=False
)
+ prefix = "{"
+ prefix += f"hostname=\"{hostname}\","
+ if sid:
+ prefix += f"hook=\"{sid}\","
+ prefix += f"oload=\"{oload}\","
+ for line in stdout.splitlines():
+ if line and not line.startswith("#"):
+ append_telemetry(
+ prefix.join(line.rsplit("{", 1)).replace("\"", "'")
+ )
- @staticmethod
- def run_telemetry_on_all_duts(nodes, profile):
- """Get telemetry stat read on all DUTs.
+ def run_telemetry_on_all_duts(self, nodes, profile, oload="", export=False):
+ """Get telemetry read on all DUTs.
:param nodes: Nodes in the topology.
:param profile: Telemetry configuration profile.
- :param hooks: Dict of Process IDs or socket paths (optional).
+ :param oload: Telemetry offered load, unique within the test (optional).
+ :param export: If false, do not attempt JSON export (default false).
:type nodes: dict
:type profile: str
- :type hooks: dict
+ :type oload: str
+ :type export: bool
"""
for node in nodes.values():
- if node[u"type"] == NodeType.DUT:
+ if node["type"] == NodeType.DUT:
try:
- for socket in node[u"sockets"][u"CLI"].values():
- TelemetryUtil.run_telemetry(
- node, profile=profile, hook=socket
+ for sid, spath in node["sockets"]["CLI"].items():
+ self._run_telemetry(
+ node, profile=profile, sid=sid, spath=spath,
+ oload=oload, export=export
)
except IndexError:
pass
diff --git a/resources/libraries/python/model/ExportResult.py b/resources/libraries/python/model/ExportResult.py
index dbe2914565..31840c9deb 100644
--- a/resources/libraries/python/model/ExportResult.py
+++ b/resources/libraries/python/model/ExportResult.py
@@ -210,3 +210,12 @@ def export_ndrpdr_latency(text, latency):
if len(latency) < 2:
return
_add_latency(result_node, percent, u"reverse", latency[1])
+
+def append_telemetry(telemetry_item):
+ """Append telemetry entry to proper place so it is dumped into json.
+
+ :param telemetry_item: Telemetry entry.
+ :type telemetry_item: str
+ """
+ data = get_export_data()
+ data[u"telemetry"].append(telemetry_item)
diff --git a/resources/libraries/robot/performance/performance_actions.robot b/resources/libraries/robot/performance/performance_actions.robot
index 40f0bc9999..0404ce2a52 100644
--- a/resources/libraries/robot/performance/performance_actions.robot
+++ b/resources/libraries/robot/performance/performance_actions.robot
@@ -95,6 +95,7 @@
| | ... | ramp_up_rate=${ramp_up_rate}
| | Run Telemetry On All DUTs
| | ... | ${nodes} | profile=vppctl_runtime.yaml
+| | ... | oload=${telemetry_oload} | export=${True}
| | Stop traffic on tg
| Additional Statistics Action For bpf-runtime
@@ -131,6 +132,7 @@
| | ... | ramp_up_rate=${ramp_up_rate}
| | Run Telemetry On All DUTs
| | ... | ${nodes} | profile=bpf_runtime.yaml
+| | ... | oload=${telemetry_oload} | export=${False}
| | Stop traffic on tg
| Additional Statistics Action For perf-stat-runtime
@@ -167,6 +169,7 @@
| | ... | ramp_up_rate=${ramp_up_rate}
| | Run Telemetry On All DUTs
| | ... | ${nodes} | profile=perf_stat_runtime.yaml
+| | ... | oload=${telemetry_oload} | export=${False}
| | Stop traffic on tg
| Additional Statistics Action For vpp-runtime-iperf3
@@ -192,6 +195,7 @@
| | | ... | affinity=${iperf_client_affinity}
| | Run Telemetry On All DUTs
| | ... | ${nodes} | profile=vppctl_runtime.yaml
+| | ... | oload=${telemetry_oload} | export=${True}
| | iPerf Client Stop Remote Exec | ${nodes['${iperf_client_node}']} | ${pids}
| Additional Statistics Action For noop
@@ -206,6 +210,7 @@
| |
| | Run Telemetry On All DUTs
| | ... | ${nodes} | profile=vppctl_clear_stats.yaml
+| | ... | export=${False}
| Additional Statistics Action For vpp-enable-packettrace
| | [Documentation]
@@ -227,3 +232,4 @@
| |
| | Run Telemetry On All DUTs
| | ... | ${nodes} | profile=vppctl_show_stats.yaml
+| | ... | export=${False}
diff --git a/resources/libraries/robot/performance/performance_utils.robot b/resources/libraries/robot/performance/performance_utils.robot
index 47c76661cb..1eb6710eff 100644
--- a/resources/libraries/robot/performance/performance_utils.robot
+++ b/resources/libraries/robot/performance/performance_utils.robot
@@ -113,6 +113,7 @@
| | ... | ${average} | ${stdev}
| | Set Test Variable | \${rate for teardown} | ${lower}
| | # Stats at the discovered critical rate.
+| | Set Test Variable | ${telemetry_oload} | plr
| | Send traffic at specified rate
| | ... | rate=${lower}
| | ... | trial_duration=${1.0}
@@ -196,12 +197,14 @@
| | ${pdr} = | Set Variable | ${result[1].measured_low.target_tr}
| | ${ndr} = | Set Variable | ${result[0].measured_low.target_tr}
| | # We expect NDR and PDR to have different-looking stats.
+| | Set Test Variable | ${telemetry_oload} | pdr
| | Send traffic at specified rate
| | ... | rate=${pdr}
| | ... | trial_duration=${1.0}
| | ... | trial_multiplicity=${1}
| | ... | use_latency=${use_latency}
| | ... | duration_limit=${1.0}
+| | Set Test Variable | ${telemetry_oload} | ndr
| | Run Keyword If | ${ndr} != ${pdr}
| | ... | Send traffic at specified rate
| | ... | rate=${ndr}
@@ -627,7 +630,6 @@
| | ... | transaction_scale=${transaction_scale}
| | ... | transaction_type=${transaction_type}
| | ... | use_latency=${use_latency}
-| | # TODO: Ramp-up?
| Stop Running Traffic
| | [Documentation]
@@ -672,6 +674,7 @@
| | ${unit} = | Set Variable If | """_cps""" in """${transaction_type}"""
| | ... | cps | pps
| | # The following also sets \${rate_for_teardown}
+| | Set Test Variable | ${telemetry_oload} | mrr
| | ${results} = | Send traffic at specified rate
| | ... | rate=${max_rate}
| | ... | trial_duration=${trial_duration}
diff --git a/resources/templates/telemetry/vpp_clear_stats.yaml b/resources/templates/telemetry/vpp_clear_stats.yaml
index 2188588827..72c20604ee 100644
--- a/resources/templates/telemetry/vpp_clear_stats.yaml
+++ b/resources/templates/telemetry/vpp_clear_stats.yaml
@@ -41,40 +41,50 @@ programs:
gauge:
- name: calls
documentation: Number of calls total
+ namespace: vpp
+ subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
- thread_lcore
- name: vectors
documentation: Number of vectors total
+ namespace: vpp
+ subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
- thread_lcore
- name: suspends
documentation: Number of suspends total
+ namespace: vpp
+ subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
- thread_lcore
- name: clocks
documentation: Number of clocks total
+ namespace: vpp
+ subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
- thread_lcore
- name: vectors_calls
documentation: Number of vectors per call
+ namespace: vpp
+ subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
@@ -86,66 +96,92 @@ programs:
gauge:
- name: rx_packets
documentation: Number of received packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: rx_bytes
documentation: Number of received bytes for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: rx_error
documentation: Number of errors on interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: tx_packets
documentation: Number of transitted packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: tx_bytes
documentation: Number of transitted bytes for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: tx_error
documentation: Number of errors on interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: drops
documentation: Number of dropped packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: punt
documentation: Number of punted packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: ip4
documentation: Number of IPv4 packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: ip6
documentation: Number of IPv6 packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: mpls
documentation: Number of MPLS packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: rx_no_buf
documentation: Number of out of buffer RX packets on interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: rx_miss
documentation: Number of missed RX packets on interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
@@ -156,31 +192,43 @@ programs:
gauge:
- name: rx_frames
documentation: Number of RX frames for interface
+ namespace: vpp
+ subsystem: hardware
labelnames:
- name
- index
- name: rx_bytes
documentation: Number of RX bytes for interface
+ namespace: vpp
+ subsystem: hardware
labelnames:
- name
- index
- name: tx_frames
documentation: Number of TX frames for interface
+ namespace: vpp
+ subsystem: hardware
labelnames:
- name
- index
- name: tx_bytes
documentation: Number of TX bytes for interface
+ namespace: vpp
+ subsystem: hardware
labelnames:
- name
- index
- name: rx_missed
documentation: Number of missed RX packets on interface
+ namespace: vpp
+ subsystem: hardware
labelnames:
- name
- index
- name: tx_missed
documentation: Number of missed TX packets on interface
+ namespace: vpp
+ subsystem: hardware
labelnames:
- name
- index
@@ -191,6 +239,8 @@ programs:
gauge:
- name: node_counter
documentation: Node counter
+ namespace: vpp
+ subsystem: node
labelnames:
- name
- reason
@@ -204,12 +254,16 @@ programs:
gauge:
- name: calls
documentation: Load operations
+ namespace: vpp
+ subsystem: perfmon
labelnames:
- name
- thread_name
- thread_id
- name: packets
documentation: Load operations
+ namespace: vpp
+ subsystem: perfmon
labelnames:
- name
- thread_name
diff --git a/resources/templates/telemetry/vpp_runtime.yaml b/resources/templates/telemetry/vpp_runtime.yaml
index b9a2368981..d7beb23cc6 100644
--- a/resources/templates/telemetry/vpp_runtime.yaml
+++ b/resources/templates/telemetry/vpp_runtime.yaml
@@ -38,24 +38,13 @@ scheduler:
programs:
- name: bundle_vpp
metrics:
- info:
- - name: version
- documentation: VPP version
- namespace: vpp
- subsystem: version
- labelnames:
- - version
- code: |
- show version
- - name: bundle_vpp
- metrics:
gauge:
- name: calls
documentation: Number of calls total
namespace: vpp
subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
@@ -65,7 +54,7 @@ programs:
namespace: vpp
subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
@@ -75,7 +64,7 @@ programs:
namespace: vpp
subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
@@ -85,7 +74,7 @@ programs:
namespace: vpp
subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
@@ -95,7 +84,7 @@ programs:
namespace: vpp
subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
@@ -107,166 +96,12 @@ programs:
- name: bundle_vpp
metrics:
gauge:
- - name: rx_packets
- documentation: Number of received packets for interface
- namespace: vpp
- subsystem: interface
- labelnames:
- - name
- - index
- - name: rx_bytes
- documentation: Number of received bytes for interface
- namespace: vpp
- subsystem: interface
- labelnames:
- - name
- - index
- - name: rx_error
- documentation: Number of errors on interface
- namespace: vpp
- subsystem: interface
- labelnames:
- - name
- - index
- - name: tx_packets
- documentation: Number of transitted packets for interface
- namespace: vpp
- subsystem: interface
- labelnames:
- - name
- - index
- - name: tx_bytes
- documentation: Number of transitted bytes for interface
- namespace: vpp
- subsystem: interface
- labelnames:
- - name
- - index
- - name: tx_error
- documentation: Number of errors on interface
- namespace: vpp
- subsystem: interface
- labelnames:
- - name
- - index
- - name: drops
- documentation: Number of dropped packets for interface
- namespace: vpp
- subsystem: interface
- labelnames:
- - name
- - index
- - name: punt
- documentation: Number of punted packets for interface
- namespace: vpp
- subsystem: interface
- labelnames:
- - name
- - index
- - name: ip4
- documentation: Number of IPv4 packets for interface
- namespace: vpp
- subsystem: interface
- labelnames:
- - name
- - index
- - name: ip6
- documentation: Number of IPv6 packets for interface
- namespace: vpp
- subsystem: interface
- labelnames:
- - name
- - index
- - name: mpls
- documentation: Number of MPLS packets for interface
- namespace: vpp
- subsystem: interface
- labelnames:
- - name
- - index
- - name: rx_no_buf
- documentation: Number of out of buffer RX packets on interface
- namespace: vpp
- subsystem: interface
- labelnames:
- - name
- - index
- - name: rx_miss
- documentation: Number of missed RX packets on interface
- namespace: vpp
- subsystem: interface
- labelnames:
- - name
- - index
- code: |
- clear interfaces
- wait {duration}
- show interface
- - name: bundle_vpp
- metrics:
- gauge:
- - name: node_counter
- documentation: Node counter
- namespace: vpp
- subsystem: counters
- labelnames:
- - name
- - reason
- - severity
- - thread_name
- - thread_id
- code: |
- clear node counters
- wait {duration}
- show node counters verbose
- - name: bundle_vpp
- metrics:
- gauge:
- - name: context_switches
- documentation: Per-thread context switches
- namespace: vpp
- subsystem: context_switches
- labelnames:
- - name
- - id
- code: |
- perfmon reset
- perfmon start bundle context-switches
- wait {duration}
- perfmon stop
- show perfmon statistics
- - name: bundle_vpp
- metrics:
- gauge:
- - name: minor_page_faults
- documentation: Per-thread page faults (minor)
- namespace: vpp
- subsystem: page_faults
- labelnames:
- - name
- - id
- - name: major_page_faults
- documentation: Per-thread page faults (major)
- namespace: vpp
- subsystem: page_faults
- labelnames:
- - name
- - id
- code: |
- perfmon reset
- perfmon start bundle page-faults
- wait {duration}
- perfmon stop
- show perfmon statistics
- - name: bundle_vpp
- metrics:
- gauge:
- name: calls
documentation: Instructions/packet, cycles/packet and IPC (calls)
namespace: vpp
subsystem: inst_and_clock
labelnames:
- - name
+ - node_name
- thread_name
- thread_id
- name: packets
@@ -274,7 +109,7 @@ programs:
namespace: vpp
subsystem: inst_and_clock
labelnames:
- - name
+ - node_name
- thread_name
- thread_id
- name: packets_per_call
@@ -282,7 +117,7 @@ programs:
namespace: vpp
subsystem: inst_and_clock
labelnames:
- - name
+ - node_name
- thread_name
- thread_id
- name: clocks_per_packets
@@ -290,7 +125,7 @@ programs:
namespace: vpp
subsystem: inst_and_clock
labelnames:
- - name
+ - node_name
- thread_name
- thread_id
- name: instructions_per_packets
@@ -298,7 +133,7 @@ programs:
namespace: vpp
subsystem: inst_and_clock
labelnames:
- - name
+ - node_name
- thread_name
- thread_id
- name: ipc
@@ -306,7 +141,7 @@ programs:
namespace: vpp
subsystem: inst_and_clock
labelnames:
- - name
+ - node_name
- thread_name
- thread_id
code: |
@@ -323,7 +158,7 @@ programs:
namespace: vpp
subsystem: cache_hierarchy
labelnames:
- - name
+ - node_name
- thread_name
- thread_id
- name: l1_miss
@@ -331,7 +166,7 @@ programs:
namespace: vpp
subsystem: cache_hierarchy
labelnames:
- - name
+ - node_name
- thread_name
- thread_id
- name: l2_hit
@@ -339,7 +174,7 @@ programs:
namespace: vpp
subsystem: cache_hierarchy
labelnames:
- - name
+ - node_name
- thread_name
- thread_id
- name: l2_miss
@@ -347,7 +182,7 @@ programs:
namespace: vpp
subsystem: cache_hierarchy
labelnames:
- - name
+ - node_name
- thread_name
- thread_id
- name: l3_hit
@@ -355,7 +190,7 @@ programs:
namespace: vpp
subsystem: cache_hierarchy
labelnames:
- - name
+ - node_name
- thread_name
- thread_id
- name: l3_miss
@@ -363,7 +198,7 @@ programs:
namespace: vpp
subsystem: cache_hierarchy
labelnames:
- - name
+ - node_name
- thread_name
- thread_id
code: |
@@ -372,151 +207,3 @@ programs:
wait {duration}
perfmon stop
show perfmon statistics
- - name: bundle_vpp
- metrics:
- gauge:
- - name: calls
- documentation: Load operations (calls)
- namespace: vpp
- subsystem: load_blocks
- labelnames:
- - name
- - thread_name
- - thread_id
- - name: packets
- documentation: Load operations (packets)
- namespace: vpp
- subsystem: load_blocks
- labelnames:
- - name
- - thread_name
- - thread_id
- code: |
- perfmon reset
- perfmon start bundle load-blocks
- wait {duration}
- perfmon stop
- show perfmon statistics
- - name: bundle_vpp
- metrics:
- gauge:
- - name: branches_per_call
- documentation: Branches/call
- namespace: vpp
- subsystem: branch_mispred
- labelnames:
- - name
- - thread_name
- - thread_id
- - name: branches_per_packet
- documentation: Branches/packet
- namespace: vpp
- subsystem: branch_mispred
- labelnames:
- - name
- - thread_name
- - thread_id
- - name: taken_per_call
- documentation: Taken/call
- namespace: vpp
- subsystem: branch_mispred
- labelnames:
- - name
- - thread_name
- - thread_id
- - name: taken_per_packet
- documentation: Taken/packet
- namespace: vpp
- subsystem: branch_mispred
- labelnames:
- - name
- - thread_name
- - thread_id
- - name: mis_predictions
- documentation: Mis-predictions
- namespace: vpp
- subsystem: branch_mispred
- labelnames:
- - name
- - thread_name
- - thread_id
- code: |
- perfmon reset
- perfmon start bundle branch-mispred
- wait {duration}
- perfmon stop
- show perfmon statistics
- - name: bundle_vpp
- metrics:
- gauge:
- - name: lvl0
- documentation: Branches/call
- namespace: vpp
- subsystem: power_licensing
- labelnames:
- - name
- - thread_name
- - thread_id
- - name: lvl1
- documentation: Branches/packet
- namespace: vpp
- subsystem: power_licensing
- labelnames:
- - name
- - thread_name
- - thread_id
- - name: lvl2
- documentation: Taken/call
- namespace: vpp
- subsystem: power_licensing
- labelnames:
- - name
- - thread_name
- - thread_id
- - name: throttle
- documentation: Taken/packet
- namespace: vpp
- subsystem: power_licensing
- labelnames:
- - name
- - thread_name
- - thread_id
- code: |
- perfmon reset
- perfmon start bundle power-licensing
- wait {duration}
- perfmon stop
- show perfmon statistics
- - name: bundle_vpp
- metrics:
- gauge:
- - name: runtime
- documentation: RunTime
- namespace: vpp
- subsystem: memory_bandwidth
- labelnames:
- - name
- - name: reads_mbs
- documentation: Reads (MB/s)
- namespace: vpp
- subsystem: memory_bandwidth
- labelnames:
- - name
- - name: writes_mbs
- documentation: Writes (MB/s)
- namespace: vpp
- subsystem: memory_bandwidth
- labelnames:
- - name
- - name: total_mbs
- documentation: Total (MB/s)
- namespace: vpp
- subsystem: memory_bandwidth
- labelnames:
- - name
- code: |
- perfmon reset
- perfmon start bundle memory-bandwidth
- wait {duration}
- perfmon stop
- show perfmon statistics
diff --git a/resources/templates/telemetry/vpp_show_stats.yaml b/resources/templates/telemetry/vpp_show_stats.yaml
index dc900e6386..626839f410 100644
--- a/resources/templates/telemetry/vpp_show_stats.yaml
+++ b/resources/templates/telemetry/vpp_show_stats.yaml
@@ -41,40 +41,50 @@ programs:
counter:
- name: calls
documentation: Number of calls total
+ namespace: vpp
+ subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
- thread_lcore
- name: vectors
documentation: Number of vectors total
+ namespace: vpp
+ subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
- thread_lcore
- name: suspends
documentation: Number of suspends total
+ namespace: vpp
+ subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
- thread_lcore
- name: clocks
documentation: Number of clocks total
+ namespace: vpp
+ subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
- thread_lcore
- name: vectors_calls
documentation: Number of vectors per call
+ namespace: vpp
+ subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
@@ -86,66 +96,92 @@ programs:
counter:
- name: rx_packets
documentation: Number of received packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: rx_bytes
documentation: Number of received bytes for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: rx_error
documentation: Number of errors on interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: tx_packets
documentation: Number of transitted packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: tx_bytes
documentation: Number of transitted bytes for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: tx_error
documentation: Number of errors on interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: drops
documentation: Number of dropped packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: punt
documentation: Number of punted packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: ip4
documentation: Number of IPv4 packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: ip6
documentation: Number of IPv6 packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: mpls
documentation: Number of MPLS packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: rx_no_buf
documentation: Number of out of buffer RX packets on interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: rx_miss
documentation: Number of missed RX packets on interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
@@ -156,31 +192,43 @@ programs:
gauge:
- name: rx_frames
documentation: Number of RX frames for interface
+ namespace: vpp
+ subsystem: hardware
labelnames:
- name
- index
- name: rx_bytes
documentation: Number of RX bytes for interface
+ namespace: vpp
+ subsystem: hardware
labelnames:
- name
- index
- name: tx_frames
documentation: Number of TX frames for interface
+ namespace: vpp
+ subsystem: hardware
labelnames:
- name
- index
- name: tx_bytes
documentation: Number of TX bytes for interface
+ namespace: vpp
+ subsystem: hardware
labelnames:
- name
- index
- name: rx_missed
documentation: Number of missed RX packets on interface
+ namespace: vpp
+ subsystem: hardware
labelnames:
- name
- index
- name: tx_missed
documentation: Number of missed TX packets on interface
+ namespace: vpp
+ subsystem: hardware
labelnames:
- name
- index
@@ -191,6 +239,8 @@ programs:
counter:
- name: node_counter
documentation: Node counter
+ namespace: vpp
+ subsystem: node
labelnames:
- name
- reason
diff --git a/resources/templates/telemetry/vpp_test_teardown.yaml b/resources/templates/telemetry/vpp_test_teardown.yaml
index 37618bb852..ac096526ce 100644
--- a/resources/templates/telemetry/vpp_test_teardown.yaml
+++ b/resources/templates/telemetry/vpp_test_teardown.yaml
@@ -41,40 +41,50 @@ programs:
counter:
- name: calls
documentation: Number of calls total
+ namespace: vpp
+ subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
- thread_lcore
- name: vectors
documentation: Number of vectors total
+ namespace: vpp
+ subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
- thread_lcore
- name: suspends
documentation: Number of suspends total
+ namespace: vpp
+ subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
- thread_lcore
- name: clocks
documentation: Number of clocks total
+ namespace: vpp
+ subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
- thread_lcore
- name: vectors_calls
documentation: Number of vectors per call
+ namespace: vpp
+ subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
@@ -86,66 +96,92 @@ programs:
counter:
- name: rx_packets
documentation: Number of received packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: rx_bytes
documentation: Number of received bytes for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: rx_error
documentation: Number of errors on interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: tx_packets
documentation: Number of transitted packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: tx_bytes
documentation: Number of transitted bytes for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: tx_error
documentation: Number of errors on interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: drops
documentation: Number of dropped packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: punt
documentation: Number of punted packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: ip4
documentation: Number of IPv4 packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: ip6
documentation: Number of IPv6 packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: mpls
documentation: Number of MPLS packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: rx_no_buf
documentation: Number of out of buffer RX packets on interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: rx_miss
documentation: Number of missed RX packets on interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
@@ -156,31 +192,43 @@ programs:
gauge:
- name: rx_frames
documentation: Number of RX frames for interface
+ namespace: vpp
+ subsystem: hardware
labelnames:
- name
- index
- name: rx_bytes
documentation: Number of RX bytes for interface
+ namespace: vpp
+ subsystem: hardware
labelnames:
- name
- index
- name: tx_frames
documentation: Number of TX frames for interface
+ namespace: vpp
+ subsystem: hardware
labelnames:
- name
- index
- name: tx_bytes
documentation: Number of TX bytes for interface
+ namespace: vpp
+ subsystem: hardware
labelnames:
- name
- index
- name: rx_missed
documentation: Number of missed RX packets on interface
+ namespace: vpp
+ subsystem: hardware
labelnames:
- name
- index
- name: tx_missed
documentation: Number of missed TX packets on interface
+ namespace: vpp
+ subsystem: hardware
labelnames:
- name
- index
@@ -191,6 +239,8 @@ programs:
counter:
- name: node_counter
documentation: Node counter
+ namespace: vpp
+ subsystem: node
labelnames:
- name
- reason
diff --git a/resources/templates/telemetry/vppctl_clear_stats.yaml b/resources/templates/telemetry/vppctl_clear_stats.yaml
index 7c5124eb03..b23081e4f2 100644
--- a/resources/templates/telemetry/vppctl_clear_stats.yaml
+++ b/resources/templates/telemetry/vppctl_clear_stats.yaml
@@ -41,40 +41,50 @@ programs:
gauge:
- name: calls
documentation: Number of calls total
+ namespace: vpp
+ subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
- thread_lcore
- name: vectors
documentation: Number of vectors total
+ namespace: vpp
+ subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
- thread_lcore
- name: suspends
documentation: Number of suspends total
+ namespace: vpp
+ subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
- thread_lcore
- name: clocks
documentation: Number of clocks total
+ namespace: vpp
+ subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
- thread_lcore
- name: vectors_calls
documentation: Number of vectors per call
+ namespace: vpp
+ subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
@@ -86,66 +96,92 @@ programs:
gauge:
- name: rx_packets
documentation: Number of received packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: rx_bytes
documentation: Number of received bytes for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: rx_error
documentation: Number of errors on interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: tx_packets
documentation: Number of transitted packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: tx_bytes
documentation: Number of transitted bytes for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: tx_error
documentation: Number of errors on interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: drops
documentation: Number of dropped packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: punt
documentation: Number of punted packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: ip4
documentation: Number of IPv4 packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: ip6
documentation: Number of IPv6 packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: mpls
documentation: Number of MPLS packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: rx_no_buf
documentation: Number of out of buffer RX packets on interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: rx_miss
documentation: Number of missed RX packets on interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
@@ -156,31 +192,43 @@ programs:
gauge:
- name: rx_frames
documentation: Number of RX frames for interface
+ namespace: vpp
+ subsystem: hardware
labelnames:
- name
- index
- name: rx_bytes
documentation: Number of RX bytes for interface
+ namespace: vpp
+ subsystem: hardware
labelnames:
- name
- index
- name: tx_frames
documentation: Number of TX frames for interface
+ namespace: vpp
+ subsystem: hardware
labelnames:
- name
- index
- name: tx_bytes
documentation: Number of TX bytes for interface
+ namespace: vpp
+ subsystem: hardware
labelnames:
- name
- index
- name: rx_missed
documentation: Number of missed RX packets on interface
+ namespace: vpp
+ subsystem: hardware
labelnames:
- name
- index
- name: tx_missed
documentation: Number of missed TX packets on interface
+ namespace: vpp
+ subsystem: hardware
labelnames:
- name
- index
@@ -191,6 +239,8 @@ programs:
gauge:
- name: node_counter
documentation: Node counter
+ namespace: vpp
+ subsystem: node
labelnames:
- name
- reason
@@ -204,12 +254,16 @@ programs:
gauge:
- name: calls
documentation: Load operations
+ namespace: vpp
+ subsystem: perfmon
labelnames:
- name
- thread_name
- thread_id
- name: packets
documentation: Load operations
+ namespace: vpp
+ subsystem: perfmon
labelnames:
- name
- thread_name
diff --git a/resources/templates/telemetry/vppctl_runtime.yaml b/resources/templates/telemetry/vppctl_runtime.yaml
index d8ff734e84..2ac72c0b8a 100644
--- a/resources/templates/telemetry/vppctl_runtime.yaml
+++ b/resources/templates/telemetry/vppctl_runtime.yaml
@@ -38,24 +38,13 @@ scheduler:
programs:
- name: bundle_vppctl
metrics:
- info:
- - name: version
- documentation: VPP version
- namespace: vpp
- subsystem: version
- labelnames:
- - version
- code: |
- vppctl -s {socket} show version
- - name: bundle_vppctl
- metrics:
gauge:
- name: calls
documentation: Number of calls total
namespace: vpp
subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
@@ -65,7 +54,7 @@ programs:
namespace: vpp
subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
@@ -75,7 +64,7 @@ programs:
namespace: vpp
subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
@@ -85,7 +74,7 @@ programs:
namespace: vpp
subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
@@ -95,7 +84,7 @@ programs:
namespace: vpp
subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
@@ -107,166 +96,12 @@ programs:
- name: bundle_vppctl
metrics:
gauge:
- - name: rx_packets
- documentation: Number of received packets for interface
- namespace: vpp
- subsystem: interface
- labelnames:
- - name
- - index
- - name: rx_bytes
- documentation: Number of received bytes for interface
- namespace: vpp
- subsystem: interface
- labelnames:
- - name
- - index
- - name: rx_error
- documentation: Number of errors on interface
- namespace: vpp
- subsystem: interface
- labelnames:
- - name
- - index
- - name: tx_packets
- documentation: Number of transitted packets for interface
- namespace: vpp
- subsystem: interface
- labelnames:
- - name
- - index
- - name: tx_bytes
- documentation: Number of transitted bytes for interface
- namespace: vpp
- subsystem: interface
- labelnames:
- - name
- - index
- - name: tx_error
- documentation: Number of errors on interface
- namespace: vpp
- subsystem: interface
- labelnames:
- - name
- - index
- - name: drops
- documentation: Number of dropped packets for interface
- namespace: vpp
- subsystem: interface
- labelnames:
- - name
- - index
- - name: punt
- documentation: Number of punted packets for interface
- namespace: vpp
- subsystem: interface
- labelnames:
- - name
- - index
- - name: ip4
- documentation: Number of IPv4 packets for interface
- namespace: vpp
- subsystem: interface
- labelnames:
- - name
- - index
- - name: ip6
- documentation: Number of IPv6 packets for interface
- namespace: vpp
- subsystem: interface
- labelnames:
- - name
- - index
- - name: mpls
- documentation: Number of MPLS packets for interface
- namespace: vpp
- subsystem: interface
- labelnames:
- - name
- - index
- - name: rx_no_buf
- documentation: Number of out of buffer RX packets on interface
- namespace: vpp
- subsystem: interface
- labelnames:
- - name
- - index
- - name: rx_miss
- documentation: Number of missed RX packets on interface
- namespace: vpp
- subsystem: interface
- labelnames:
- - name
- - index
- code: |
- vppctl -s {socket} clear interfaces
- sleep {duration}
- vppctl -s {socket} show interface
- - name: bundle_vppctl
- metrics:
- gauge:
- - name: node_counter
- documentation: Node counter
- namespace: vpp
- subsystem: counters
- labelnames:
- - name
- - reason
- - severity
- - thread_name
- - thread_id
- code: |
- vppctl -s {socket} clear node counters
- sleep {duration}
- vppctl -s {socket} show node counters verbose
- - name: bundle_vppctl
- metrics:
- gauge:
- - name: context_switches
- documentation: Per-thread context switches
- namespace: vpp
- subsystem: context_switches
- labelnames:
- - name
- - id
- code: |
- vppctl -s {socket} perfmon reset
- vppctl -s {socket} perfmon start bundle context-switches
- sleep {duration}
- vppctl -s {socket} perfmon stop
- vppctl -s {socket} show perfmon statistics
- - name: bundle_vppctl
- metrics:
- gauge:
- - name: minor_page_faults
- documentation: Per-thread page faults (minor)
- namespace: vpp
- subsystem: page_faults
- labelnames:
- - name
- - id
- - name: major_page_faults
- documentation: Per-thread page faults (major)
- namespace: vpp
- subsystem: page_faults
- labelnames:
- - name
- - id
- code: |
- vppctl -s {socket} perfmon reset
- vppctl -s {socket} perfmon start bundle page-faults
- sleep {duration}
- vppctl -s {socket} perfmon stop
- vppctl -s {socket} show perfmon statistics
- - name: bundle_vppctl
- metrics:
- gauge:
- name: calls
documentation: Instructions/packet, cycles/packet and IPC (calls)
namespace: vpp
subsystem: inst_and_clock
labelnames:
- - name
+ - node_name
- thread_name
- thread_id
- name: packets
@@ -274,7 +109,7 @@ programs:
namespace: vpp
subsystem: inst_and_clock
labelnames:
- - name
+ - node_name
- thread_name
- thread_id
- name: packets_per_call
@@ -282,7 +117,7 @@ programs:
namespace: vpp
subsystem: inst_and_clock
labelnames:
- - name
+ - node_name
- thread_name
- thread_id
- name: clocks_per_packets
@@ -290,7 +125,7 @@ programs:
namespace: vpp
subsystem: inst_and_clock
labelnames:
- - name
+ - node_name
- thread_name
- thread_id
- name: instructions_per_packets
@@ -298,7 +133,7 @@ programs:
namespace: vpp
subsystem: inst_and_clock
labelnames:
- - name
+ - node_name
- thread_name
- thread_id
- name: ipc
@@ -306,7 +141,7 @@ programs:
namespace: vpp
subsystem: inst_and_clock
labelnames:
- - name
+ - node_name
- thread_name
- thread_id
code: |
@@ -323,7 +158,7 @@ programs:
namespace: vpp
subsystem: cache_hierarchy
labelnames:
- - name
+ - node_name
- thread_name
- thread_id
- name: l1_miss
@@ -331,7 +166,7 @@ programs:
namespace: vpp
subsystem: cache_hierarchy
labelnames:
- - name
+ - node_name
- thread_name
- thread_id
- name: l2_hit
@@ -339,7 +174,7 @@ programs:
namespace: vpp
subsystem: cache_hierarchy
labelnames:
- - name
+ - node_name
- thread_name
- thread_id
- name: l2_miss
@@ -347,7 +182,7 @@ programs:
namespace: vpp
subsystem: cache_hierarchy
labelnames:
- - name
+ - node_name
- thread_name
- thread_id
- name: l3_hit
@@ -355,7 +190,7 @@ programs:
namespace: vpp
subsystem: cache_hierarchy
labelnames:
- - name
+ - node_name
- thread_name
- thread_id
- name: l3_miss
@@ -363,7 +198,7 @@ programs:
namespace: vpp
subsystem: cache_hierarchy
labelnames:
- - name
+ - node_name
- thread_name
- thread_id
code: |
@@ -372,110 +207,3 @@ programs:
sleep {duration}
vppctl -s {socket} perfmon stop
vppctl -s {socket} show perfmon statistics
- - name: bundle_vppctl
- metrics:
- gauge:
- - name: calls
- documentation: Load operations (calls)
- namespace: vpp
- subsystem: load_blocks
- labelnames:
- - name
- - thread_name
- - thread_id
- - name: packets
- documentation: Load operations (packets)
- namespace: vpp
- subsystem: load_blocks
- labelnames:
- - name
- - thread_name
- - thread_id
- code: |
- vppctl -s {socket} perfmon reset
- vppctl -s {socket} perfmon start bundle load-blocks
- sleep {duration}
- vppctl -s {socket} perfmon stop
- vppctl -s {socket} show perfmon statistics
- - name: bundle_vppctl
- metrics:
- gauge:
- - name: branches_per_call
- documentation: Branches/call
- namespace: vpp
- subsystem: branch_mispred
- labelnames:
- - name
- - thread_name
- - thread_id
- - name: branches_per_packet
- documentation: Branches/packet
- namespace: vpp
- subsystem: branch_mispred
- labelnames:
- - name
- - thread_name
- - thread_id
- - name: taken_per_call
- documentation: Taken/call
- namespace: vpp
- subsystem: branch_mispred
- labelnames:
- - name
- - thread_name
- - thread_id
- - name: taken_per_packet
- documentation: Taken/packet
- namespace: vpp
- subsystem: branch_mispred
- labelnames:
- - name
- - thread_name
- - thread_id
- - name: mis_predictions
- documentation: Mis-predictions
- namespace: vpp
- subsystem: branch_mispred
- labelnames:
- - name
- - thread_name
- - thread_id
- code: |
- vppctl -s {socket} perfmon reset
- vppctl -s {socket} perfmon start bundle branch-mispred
- sleep {duration}
- vppctl -s {socket} perfmon stop
- vppctl -s {socket} show perfmon statistics
- - name: bundle_vppctl
- metrics:
- gauge:
- - name: runtime
- documentation: RunTime
- namespace: vpp
- subsystem: memory_bandwidth
- labelnames:
- - name
- - name: reads_mbs
- documentation: Reads (MB/s)
- namespace: vpp
- subsystem: memory_bandwidth
- labelnames:
- - name
- - name: writes_mbs
- documentation: Writes (MB/s)
- namespace: vpp
- subsystem: memory_bandwidth
- labelnames:
- - name
- - name: total_mbs
- documentation: Total (MB/s)
- namespace: vpp
- subsystem: memory_bandwidth
- labelnames:
- - name
- code: |
- vppctl -s {socket} perfmon reset
- vppctl -s {socket} perfmon start bundle memory-bandwidth
- sleep {duration}
- vppctl -s {socket} perfmon stop
- vppctl -s {socket} show perfmon statistics
diff --git a/resources/templates/telemetry/vppctl_show_stats.yaml b/resources/templates/telemetry/vppctl_show_stats.yaml
index 83bb746773..9f5a0240a1 100644
--- a/resources/templates/telemetry/vppctl_show_stats.yaml
+++ b/resources/templates/telemetry/vppctl_show_stats.yaml
@@ -41,40 +41,50 @@ programs:
counter:
- name: calls
documentation: Number of calls total
+ namespace: vpp
+ subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
- thread_lcore
- name: vectors
documentation: Number of vectors total
+ namespace: vpp
+ subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
- thread_lcore
- name: suspends
documentation: Number of suspends total
+ namespace: vpp
+ subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
- thread_lcore
- name: clocks
documentation: Number of clocks total
+ namespace: vpp
+ subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
- thread_lcore
- name: vectors_calls
documentation: Number of vectors per call
+ namespace: vpp
+ subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
@@ -86,66 +96,92 @@ programs:
counter:
- name: rx_packets
documentation: Number of received packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: rx_bytes
documentation: Number of received bytes for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: rx_error
documentation: Number of errors on interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: tx_packets
documentation: Number of transitted packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: tx_bytes
documentation: Number of transitted bytes for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: tx_error
documentation: Number of errors on interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: drops
documentation: Number of dropped packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: punt
documentation: Number of punted packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: ip4
documentation: Number of IPv4 packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: ip6
documentation: Number of IPv6 packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: mpls
documentation: Number of MPLS packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: rx_no_buf
documentation: Number of out of buffer RX packets on interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: rx_miss
documentation: Number of missed RX packets on interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
@@ -156,31 +192,43 @@ programs:
gauge:
- name: rx_frames
documentation: Number of RX frames for interface
+ namespace: vpp
+ subsystem: hardware
labelnames:
- name
- index
- name: rx_bytes
documentation: Number of RX bytes for interface
+ namespace: vpp
+ subsystem: hardware
labelnames:
- name
- index
- name: tx_frames
documentation: Number of TX frames for interface
+ namespace: vpp
+ subsystem: hardware
labelnames:
- name
- index
- name: tx_bytes
documentation: Number of TX bytes for interface
+ namespace: vpp
+ subsystem: hardware
labelnames:
- name
- index
- name: rx_missed
documentation: Number of missed RX packets on interface
+ namespace: vpp
+ subsystem: hardware
labelnames:
- name
- index
- name: tx_missed
documentation: Number of missed TX packets on interface
+ namespace: vpp
+ subsystem: hardware
labelnames:
- name
- index
@@ -191,6 +239,8 @@ programs:
counter:
- name: node_counter
documentation: Node counter
+ namespace: vpp
+ subsystem: node
labelnames:
- name
- reason
diff --git a/resources/templates/telemetry/vppctl_test_teardown.yaml b/resources/templates/telemetry/vppctl_test_teardown.yaml
index 10f2077137..e8458f7198 100644
--- a/resources/templates/telemetry/vppctl_test_teardown.yaml
+++ b/resources/templates/telemetry/vppctl_test_teardown.yaml
@@ -41,40 +41,50 @@ programs:
counter:
- name: calls
documentation: Number of calls total
+ namespace: vpp
+ subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
- thread_lcore
- name: vectors
documentation: Number of vectors total
+ namespace: vpp
+ subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
- thread_lcore
- name: suspends
documentation: Number of suspends total
+ namespace: vpp
+ subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
- thread_lcore
- name: clocks
documentation: Number of clocks total
+ namespace: vpp
+ subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
- thread_lcore
- name: vectors_calls
documentation: Number of vectors per call
+ namespace: vpp
+ subsystem: runtime
labelnames:
- - name
+ - node_name
- state
- thread_name
- thread_id
@@ -86,66 +96,92 @@ programs:
counter:
- name: rx_packets
documentation: Number of received packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: rx_bytes
documentation: Number of received bytes for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: rx_error
documentation: Number of errors on interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: tx_packets
documentation: Number of transitted packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: tx_bytes
documentation: Number of transitted bytes for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: tx_error
documentation: Number of errors on interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: drops
documentation: Number of dropped packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: punt
documentation: Number of punted packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: ip4
documentation: Number of IPv4 packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: ip6
documentation: Number of IPv6 packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: mpls
documentation: Number of MPLS packets for interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: rx_no_buf
documentation: Number of out of buffer RX packets on interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
- name: rx_miss
documentation: Number of missed RX packets on interface
+ namespace: vpp
+ subsystem: interface
labelnames:
- name
- index
@@ -156,31 +192,43 @@ programs:
gauge:
- name: rx_frames
documentation: Number of RX frames for interface
+ namespace: vpp
+ subsystem: hardware
labelnames:
- name
- index
- name: rx_bytes
documentation: Number of RX bytes for interface
+ namespace: vpp
+ subsystem: hardware
labelnames:
- name
- index
- name: tx_frames
documentation: Number of TX frames for interface
+ namespace: vpp
+ subsystem: hardware
labelnames:
- name
- index
- name: tx_bytes
documentation: Number of TX bytes for interface
+ namespace: vpp
+ subsystem: hardware
labelnames:
- name
- index
- name: rx_missed
documentation: Number of missed RX packets on interface
+ namespace: vpp
+ subsystem: hardware
labelnames:
- name
- index
- name: tx_missed
documentation: Number of missed TX packets on interface
+ namespace: vpp
+ subsystem: hardware
labelnames:
- name
- index
@@ -191,6 +239,8 @@ programs:
counter:
- name: node_counter
documentation: Node counter
+ namespace: vpp
+ subsystem: node
labelnames:
- name
- reason
diff --git a/resources/tools/telemetry/bundle_perf_stat.py b/resources/tools/telemetry/bundle_perf_stat.py
index 17afbe0824..471dd07b18 100644
--- a/resources/tools/telemetry/bundle_perf_stat.py
+++ b/resources/tools/telemetry/bundle_perf_stat.py
@@ -91,10 +91,16 @@ class BundlePerfStat:
def detach(self):
+ """
+ Detach function.
+ """
pass
def fetch_data(self):
- pass
+ """
+ Fetch data function.
+ """
+ pass
def process_data(self):
"""
diff --git a/resources/tools/telemetry/bundle_vppctl.py b/resources/tools/telemetry/bundle_vppctl.py
index 5334237496..d0ee3754c7 100644
--- a/resources/tools/telemetry/bundle_vppctl.py
+++ b/resources/tools/telemetry/bundle_vppctl.py
@@ -30,7 +30,7 @@ M_RUN_SEPARATOR = (
r"(-)+"
)
M_RUN_NODES = (
- r"(?P<name>\S+)\s+"
+ r"(?P<node_name>\S+)\s+"
r"(?P<state>\S+\s\S+|\S+)\s+"
r"(?P<calls>\d+)\s+"
r"(?P<vectors>\d+)\s+"
@@ -284,7 +284,7 @@ class BundleVppctl:
item = dict()
labels = dict()
item["name"] = metric
- labels["name"] = nodes["name"]
+ labels["node_name"] = nodes["node_name"]
labels["state"] = nodes["state"]
try:
labels["thread_name"] = thread["thread_name"]
@@ -364,7 +364,7 @@ class BundleVppctl:
item = dict()
labels = dict()
item["name"] = metric
- labels["name"] = node["node_name"]
+ labels["node_name"] = node["node_name"]
labels["thread_name"] = thread["thread_name"]
labels["thread_id"] = thread["thread_id"]
item["labels"] = labels
diff --git a/resources/tools/telemetry/constants.py b/resources/tools/telemetry/constants.py
index 5363ddeaa4..d5641ede2d 100644
--- a/resources/tools/telemetry/constants.py
+++ b/resources/tools/telemetry/constants.py
@@ -50,4 +50,3 @@ class Constants:
# Could not successfuly run perf stat command
err_linux_perf_stat = 53
-
diff --git a/resources/tools/telemetry/metrics.py b/resources/tools/telemetry/metrics.py
index 7a22acfd1b..27fad89a5c 100644
--- a/resources/tools/telemetry/metrics.py
+++ b/resources/tools/telemetry/metrics.py
@@ -104,7 +104,7 @@ class Metric:
u"Sample", [u"name", u"labels", u"value", u"timestamp"]
)
- if not re.compile(r"^[a-zA-Z_:][a-zA-Z0-9_:]*$").match(name):
+ if not re.compile(r"^[a-zA-Z._:][a-zA-Z0-9._:]*$").match(name):
raise ValueError(f"Invalid metric name: {name}!")
if typ not in self.metric_types:
raise ValueError(f"Invalid metric type: {typ}!")
@@ -210,11 +210,11 @@ class MetricBase:
:rasies ValueError: If name does not conform with naming conventions.
"""
full_name = u""
- full_name += f"{namespace}_" if namespace else u""
- full_name += f"{subsystem}_" if subsystem else u""
+ full_name += f"{namespace}." if namespace else u""
+ full_name += f"{subsystem}." if subsystem else u""
full_name += name
- if not re.compile(r"^[a-zA-Z_:][a-zA-Z0-9_:]*$").match(full_name):
+ if not re.compile(r"^[a-zA-Z._:][a-zA-Z0-9._:]*$").match(full_name):
raise ValueError(
f"Invalid metric name: {full_name}!"
)
span class="o">*bi0 = ~0; } else { *next0 = next_drop; *error0 = IP4_ERROR_REASS_DUPLICATE_FRAGMENT; } } } always_inline uword ip4_reassembly (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame) { u32 *from = vlib_frame_vector_args (frame); u32 n_left_from, n_left_to_next, *to_next, next_index; ip4_reass_main_t *rm = &ip4_reass_main; n_left_from = frame->n_vectors; next_index = node->cached_next_index; static u32 *vec_drop_timeout = NULL; // indexes of buffers which timed out static u32 *vec_drop_overlap = NULL; // indexes of buffers which were discarded due to overlap static u32 *vec_drop_compress = NULL; // indexes of buffers dicarded due to buffer compression while (n_left_from > 0 || vec_len (vec_drop_timeout) > 0 || vec_len (vec_drop_overlap) > 0) { vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next); while (vec_len (vec_drop_timeout) > 0 && n_left_to_next > 0) { u32 bi = vec_pop (vec_drop_timeout); vlib_buffer_t *b = vlib_get_buffer (vm, bi); b->error = node->errors[IP4_ERROR_REASS_TIMEOUT]; to_next[0] = bi; to_next += 1; n_left_to_next -= 1; vlib_validate_buffer_enqueue_x1 (vm, node, next_index, to_next, n_left_to_next, bi, IP4_REASSEMBLY_NEXT_DROP); IP4_REASS_DEBUG_BUFFER (bi, enqueue_drop_timeout); ASSERT (rm->buffers_n > 0); --rm->buffers_n; } while (vec_len (vec_drop_overlap) > 0 && n_left_to_next > 0) { u32 bi = vec_pop (vec_drop_overlap); vlib_buffer_t *b = vlib_get_buffer (vm, bi); b->error = node->errors[IP4_ERROR_REASS_DUPLICATE_FRAGMENT]; to_next[0] = bi; to_next += 1; n_left_to_next -= 1; vlib_validate_buffer_enqueue_x1 (vm, node, next_index, to_next, n_left_to_next, bi, IP4_REASSEMBLY_NEXT_DROP); IP4_REASS_DEBUG_BUFFER (bi, enqueue_drop_duplicate_fragment); ASSERT (rm->buffers_n > 0); --rm->buffers_n; } while (vec_len (vec_drop_compress) > 0 && n_left_to_next > 0) { u32 bi = vec_pop (vec_drop_compress); vlib_buffer_t *b = vlib_get_buffer (vm, bi); b->error = node->errors[IP4_ERROR_NONE]; to_next[0] = bi; to_next += 1; n_left_to_next -= 1; vlib_validate_buffer_enqueue_x1 (vm, node, next_index, to_next, n_left_to_next, bi, IP4_REASSEMBLY_NEXT_DROP); IP4_REASS_DEBUG_BUFFER (bi, enqueue_drop_compress); ASSERT (rm->buffers_n > 0); --rm->buffers_n; } while (n_left_from > 0 && n_left_to_next > 0) { u32 bi0; vlib_buffer_t *b0; u32 next0; //, error0; bi0 = from[0]; b0 = vlib_get_buffer (vm, bi0); ip4_header_t *ip0 = vlib_buffer_get_current (b0); ip4_reass_key_t k; k.src.as_u32 = ip0->src_address.as_u32; k.dst.as_u32 = ip0->dst_address.as_u32; k.xx_id = vnet_buffer (b0)->sw_if_index[VLIB_RX]; k.frag_id = ip0->fragment_id; k.proto = ip0->protocol; k.unused = 0; ip4_reass_t *reass = ip4_reass_find_or_create (vm, rm, &k, &vec_drop_timeout); u32 error0 = IP4_ERROR_NONE; if (reass) { ip4_reass_update (vm, node, rm, reass, &bi0, &next0, &error0, &vec_drop_overlap, &vec_drop_compress, IP4_REASSEMBLY_NEXT_INPUT, IP4_REASSEMBLY_NEXT_DROP); } else { next0 = IP4_REASSEMBLY_NEXT_DROP; error0 = IP4_ERROR_REASS_LIMIT_REACHED; } b0->error = node->errors[error0]; if (bi0 != ~0) { to_next[0] = bi0; to_next += 1; n_left_to_next -= 1; vlib_validate_buffer_enqueue_x1 (vm, node, next_index, to_next, n_left_to_next, bi0, next0); IP4_REASS_DEBUG_BUFFER (bi0, enqueue_next); } from += 1; n_left_from -= 1; } vlib_put_next_frame (vm, node, next_index, n_left_to_next); } return frame->n_vectors; } static char *ip4_reassembly_error_strings[] = { #define _(sym, string) string, foreach_ip4_error #undef _ }; /* *INDENT-OFF* */ VLIB_REGISTER_NODE (ip4_reass_node, static) = { .function = ip4_reassembly, .name = "ip4-reassembly", .vector_size = sizeof (u32), .format_trace = format_ip4_reass_trace, .n_errors = ARRAY_LEN (ip4_reassembly_error_strings), .error_strings = ip4_reassembly_error_strings, .n_next_nodes = IP4_REASSEMBLY_N_NEXT, .next_nodes = { [IP4_REASSEMBLY_NEXT_INPUT] = "ip4-input", [IP4_REASSEMBLY_NEXT_DROP] = "ip4-drop", }, }; /* *INDENT-ON* */ VLIB_NODE_FUNCTION_MULTIARCH (ip4_reass_node, ip4_reassembly) static u32 ip4_reass_get_nbuckets () { ip4_reass_main_t *rm = &ip4_reass_main; u32 nbuckets; u8 i; nbuckets = (u32) (rm->max_reass_n / IP4_REASS_HT_LOAD_FACTOR); for (i = 0; i < 31; i++) if ((1 << i) >= nbuckets) break; nbuckets = 1 << i; return nbuckets; } typedef enum { IP4_EVENT_CONFIG_CHANGED = 1, } ip4_reass_event_t; typedef struct { int failure; clib_bihash_24_8_t *new_hash; } ip4_rehash_cb_ctx; void ip4_rehash_cb (clib_bihash_kv_24_8_t * kv, void *_ctx) { ip4_rehash_cb_ctx *ctx = _ctx; if (clib_bihash_add_del_24_8 (ctx->new_hash, kv, 1)) { ctx->failure = 1; } } vnet_api_error_t ip4_reass_set (u32 timeout_ms, u32 max_reassemblies, u32 expire_walk_interval_ms) { u32 old_nbuckets = ip4_reass_get_nbuckets (); ip4_reass_main.timeout_ms = timeout_ms; ip4_reass_main.timeout = (f64) timeout_ms / (f64) MSEC_PER_SEC; ip4_reass_main.max_reass_n = max_reassemblies; ip4_reass_main.expire_walk_interval_ms = expire_walk_interval_ms; vlib_process_signal_event (ip4_reass_main.vlib_main, ip4_reass_main.ip4_reass_expire_node_idx, IP4_EVENT_CONFIG_CHANGED, 0); u32 new_nbuckets = ip4_reass_get_nbuckets (); if (ip4_reass_main.max_reass_n > 0 && new_nbuckets > 1 && new_nbuckets != old_nbuckets) { clib_bihash_24_8_t new_hash; memset (&new_hash, 0, sizeof (new_hash)); ip4_rehash_cb_ctx ctx; ctx.failure = 0; ctx.new_hash = &new_hash; clib_bihash_init_24_8 (&new_hash, "ip4-reass", new_nbuckets, new_nbuckets * 1024); clib_bihash_foreach_key_value_pair_24_8 (&ip4_reass_main.hash, ip4_rehash_cb, &ctx); if (ctx.failure) { clib_bihash_free_24_8 (&new_hash); return -1; } else { clib_bihash_free_24_8 (&ip4_reass_main.hash); clib_memcpy (&ip4_reass_main.hash, &new_hash, sizeof (ip4_reass_main.hash)); } } return 0; } vnet_api_error_t ip4_reass_get (u32 * timeout_ms, u32 * max_reassemblies, u32 * expire_walk_interval_ms) { *timeout_ms = ip4_reass_main.timeout_ms; *max_reassemblies = ip4_reass_main.max_reass_n; *expire_walk_interval_ms = ip4_reass_main.expire_walk_interval_ms; return 0; } clib_error_t * ip4_reass_init_function (vlib_main_t * vm) { ip4_reass_main_t *rm = &ip4_reass_main; clib_error_t *error = 0; u32 nbuckets; rm->vlib_main = vm; rm->vnet_main = vnet_get_main (); rm->reass_n = 0; pool_alloc (rm->pool, rm->max_reass_n); ip4_reass_set (IP4_REASS_TIMEOUT_DEFAULT_MS, IP4_REASS_MAX_REASSEMBLIES_DEAFULT, IP4_REASS_EXPIRE_WALK_INTERVAL_DEFAULT_MS); nbuckets = ip4_reass_get_nbuckets (); clib_bihash_init_24_8 (&rm->hash, "ip4-reass", nbuckets, nbuckets * 1024); vlib_node_t *node = vlib_get_node_by_name (vm, (u8 *) "ip4-drop"); ASSERT (node); rm->ip4_drop_idx = node->index; node = vlib_get_node_by_name (vm, (u8 *) "ip4-reassembly-expire-walk"); ASSERT (node); rm->ip4_reass_expire_node_idx = node->index; return error; } VLIB_INIT_FUNCTION (ip4_reass_init_function); static uword ip4_reass_walk_expired (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * f) { ip4_reass_main_t *rm = &ip4_reass_main; uword event_type, *event_data = 0; while (true) { vlib_process_wait_for_event_or_clock (vm, (f64) rm->expire_walk_interval_ms / (f64) MSEC_PER_SEC); event_type = vlib_process_get_events (vm, &event_data); switch (event_type) { case ~0: /* no events => timeout */ /* nothing to do here */ break; case IP4_EVENT_CONFIG_CHANGED: break; default: clib_warning ("BUG: event type 0x%wx", event_type); break; } f64 now = vlib_time_now (vm); ip4_reass_t *reass; u32 *vec_drop_timeout = NULL; int *pool_indexes_to_free = NULL; int index; /* *INDENT-OFF* */ pool_foreach_index (index, rm->pool, ({ reass = pool_elt_at_index (rm->pool, index); if (now > reass->last_heard + rm->timeout) { vec_add1 (pool_indexes_to_free, index); } })); /* *INDENT-ON* */ int *i; /* *INDENT-OFF* */ vec_foreach (i, pool_indexes_to_free) { ip4_reass_t *reass = pool_elt_at_index (rm->pool, i[0]); ip4_reass_on_timeout (vm, rm, reass, &vec_drop_timeout); ip4_reass_free (rm, reass); } /* *INDENT-ON* */ while (vec_len (vec_drop_timeout) > 0) { vlib_frame_t *f = vlib_get_frame_to_node (vm, rm->ip4_drop_idx); u32 *to_next = vlib_frame_vector_args (f); u32 n_left_to_next = VLIB_FRAME_SIZE - f->n_vectors; u32 n_trace = 0; while (vec_len (vec_drop_timeout) > 0 && n_left_to_next > 0) { u32 bi = vec_pop (vec_drop_timeout); vlib_buffer_t *b = vlib_get_buffer (vm, bi); if (PREDICT_FALSE (b->flags & VLIB_BUFFER_IS_TRACED)) { if (pool_is_free_index (vm->trace_main.trace_buffer_pool, b->trace_index)) { /* the trace is gone, don't trace this buffer anymore */ b->flags &= ~VLIB_BUFFER_IS_TRACED; } else { ++n_trace; } } b->error = node->errors[IP4_ERROR_REASS_TIMEOUT]; to_next[0] = bi; ++f->n_vectors; to_next += 1; n_left_to_next -= 1; IP4_REASS_DEBUG_BUFFER (bi, enqueue_drop_timeout_walk); ASSERT (rm->buffers_n > 0); --rm->buffers_n; } if (PREDICT_FALSE (n_trace > 0)) { f->flags |= VLIB_FRAME_TRACE; } vlib_put_frame_to_node (vm, rm->ip4_drop_idx, f); } vec_free (pool_indexes_to_free); vec_free (vec_drop_timeout); if (event_data) { _vec_len (event_data) = 0; } } return 0; } static vlib_node_registration_t ip4_reass_expire_node; /* *INDENT-OFF* */ VLIB_REGISTER_NODE (ip4_reass_expire_node, static) = { .function = ip4_reass_walk_expired, .type = VLIB_NODE_TYPE_PROCESS, .name = "ip4-reassembly-expire-walk", .format_trace = format_ip4_reass_trace, .n_errors = ARRAY_LEN (ip4_reassembly_error_strings), .error_strings = ip4_reassembly_error_strings, }; /* *INDENT-ON* */ static u8 * format_ip4_reass_key (u8 * s, va_list * args) { ip4_reass_key_t *key = va_arg (*args, ip4_reass_key_t *); s = format (s, "xx_id: %u, src: %U, dst: %U, frag_id: %u, proto: %u", key->xx_id, format_ip4_address, &key->src, format_ip4_address, &key->dst, clib_net_to_host_u16 (key->frag_id), key->proto); return s; } static u8 * format_ip4_reass (u8 * s, va_list * args) { vlib_main_t *vm = va_arg (*args, vlib_main_t *); ip4_reass_t *reass = va_arg (*args, ip4_reass_t *); s = format (s, "ID: %u, key: %U\n first_bi: %u, data_len: %u, " "last_packet_octet: %u, trace_op_counter: %u\n", reass->id, format_ip4_reass_key, &reass->key, reass->first_bi, reass->data_len, reass->last_packet_octet, reass->trace_op_counter); u32 bi = reass->first_bi; u32 counter = 0; while (~0 != bi) { vlib_buffer_t *b = vlib_get_buffer (vm, bi); vnet_buffer_opaque_t *vnb = vnet_buffer (b); s = format (s, " #%03u: range: [%u, %u], bi: %u, off: %d, len: %u, " "fragment[%u, %u]\n", counter, vnb->ip.reass.range_first, vnb->ip.reass.range_last, bi, ip4_reass_buffer_get_data_offset_no_check (b), ip4_reass_buffer_get_data_len_no_check (b), vnb->ip.reass.fragment_first, vnb->ip.reass.fragment_last); if (b->flags & VLIB_BUFFER_NEXT_PRESENT) { bi = b->next_buffer; } else { bi = ~0; } } return s; } static clib_error_t * show_ip4_reass (vlib_main_t * vm, unformat_input_t * input, CLIB_UNUSED (vlib_cli_command_t * lmd)) { ip4_reass_main_t *rm = &ip4_reass_main; vlib_cli_output (vm, "---------------------"); vlib_cli_output (vm, "IP4 reassembly status"); vlib_cli_output (vm, "---------------------"); if (unformat (input, "details")) { ip4_reass_t *reass; /* *INDENT-OFF* */ pool_foreach (reass, rm->pool, { vlib_cli_output (vm, "%U", format_ip4_reass, vm, reass); }); /* *INDENT-ON* */ } vlib_cli_output (vm, "---------------------"); vlib_cli_output (vm, "Current IP4 reassemblies count: %lu\n", rm->reass_n); vlib_cli_output (vm, "Maximum configured concurrent IP4 reassemblies: %lu\n", (long unsigned) rm->max_reass_n); vlib_cli_output (vm, "Buffers in use: %lu\n", (long unsigned) rm->buffers_n); return 0; } /* *INDENT-OFF* */ VLIB_CLI_COMMAND (show_ip4_reassembly_cmd, static) = { .path = "show ip4-reassembly", .short_help = "show ip4-reassembly [details]", .function = show_ip4_reass, }; /* *INDENT-ON* */ /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */