Code Review
/
csit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
telemetry: linux telemetry with perf-stat
[csit.git]
/
resources
/
tools
/
telemetry
/
bundle_bpf.py
diff --git
a/resources/tools/telemetry/bundle_bpf.py
b/resources/tools/telemetry/bundle_bpf.py
index
c376da9
..
58cfd5d
100644
(file)
--- a/
resources/tools/telemetry/bundle_bpf.py
+++ b/
resources/tools/telemetry/bundle_bpf.py
@@
-52,12
+52,15
@@
class BundleBpf:
self.obj = BPF(text=self.code)
self.obj = BPF(text=self.code)
- def attach(self, duration):
+
+ def attach(self, sample_period):
"""
Attach events to BPF.
"""
Attach events to BPF.
- :param duration: Trial duration.
- :type duration: int
+ :param sample_period: A "sampling" event is one that generates
+ an overflow notification every N events, where N is given by
+ sample_period.
+ :type sample_period: int
"""
try:
for event in self.events:
"""
try:
for event in self.events:
@@
-65,15
+68,16
@@
class BundleBpf:
ev_type=event[u"type"],
ev_config=event[u"name"],
fn_name=event[u"target"],
ev_type=event[u"type"],
ev_config=event[u"name"],
fn_name=event[u"target"],
- sample_period=
duration
+ sample_period=
sample_period
)
except AttributeError:
)
except AttributeError:
- getLogger("console_stderr").error(u"Could not attach BPF events!")
+ getLogger("console_stderr").error(f"Could not attach BPF event: "
+ f"{event[u'name']}")
sys.exit(Constants.err_linux_attach)
def detach(self):
"""
sys.exit(Constants.err_linux_attach)
def detach(self):
"""
- Det
t
ach events from BPF.
+ Detach events from BPF.
"""
try:
for event in self.events:
"""
try:
for event in self.events:
@@
-98,6
+102,9
@@
class BundleBpf:
for _, metric_list in self.metrics.items():
for metric in metric_list:
for _, metric_list in self.metrics.items():
for metric in metric_list:
+ if table_name != metric[u"name"]:
+ table_name = metric[u"name"]
+ text += f"{table_name}\n"
for (key, val) in self.obj.get_table(metric[u"name"]).items():
item = dict()
labels = dict()
for (key, val) in self.obj.get_table(metric[u"name"]).items():
item = dict()
labels = dict()