1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-31 02:00:45 +00:00

ftrace: Set top-level buffer size

trace-cmd start -B devlib -b 42 will set the buffer size for the
"devlib" ftrace instance but will not set the buffer size of the
top-level buffer.

Unfortunately, some events still end up in the top-level buffer
regardless of any configuration such as the "print" event. This can lead
to lost events because the buffer size was too small.

Avoid that by using the buffer size for both top-level and devlib's
instance.
This commit is contained in:
Douglas Raillard 2023-04-14 17:50:08 +01:00 committed by Marc Bonnici
parent 0a910071f8
commit e0c53d0999

View File

@ -240,6 +240,17 @@ class FtraceCollector(CollectorBase):
def reset(self): def reset(self):
self.target.execute('{} reset -B devlib'.format(self.target_binary), self.target.execute('{} reset -B devlib'.format(self.target_binary),
as_root=True, timeout=TIMEOUT) as_root=True, timeout=TIMEOUT)
# trace-cmd start will not set the top-level buffer size if passed -B
# parameter, but unfortunately some events still end up there (e.g.
# print event). So we still need to set that size, otherwise the buffer
# might be too small and some event lost.
if self.buffer_size is not None:
self.target.write_value(
self.target.path.join(self.tracing_path, 'buffer_size_kb'),
self.buffer_size
)
if self.functions: if self.functions:
self.target.write_value(self.function_profile_file, 0, verify=False) self.target.write_value(self.function_profile_file, 0, verify=False)
self._reset_needed = False self._reset_needed = False