mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 02:31:03 +00:00
tracer: gsttr-stats: add a fast path for tracer-entry matching
Extract the structure name from the string and only parse the full structure, if we are going to handle it.
This commit is contained in:
parent
3932b3f944
commit
5eeba8c979
1 changed files with 10 additions and 5 deletions
|
@ -77,13 +77,12 @@ class Stats(Analyzer):
|
|||
if event[Parser.F_FUNCTION]:
|
||||
return
|
||||
|
||||
try:
|
||||
s = Structure(event[Parser.F_MESSAGE])
|
||||
except ValueError:
|
||||
logger.warning("failed to parse: '%s'", event[Parser.F_MESSAGE])
|
||||
msg = event[Parser.F_MESSAGE]
|
||||
p = msg.find(',')
|
||||
if p == -1:
|
||||
return
|
||||
entry_name = s.name
|
||||
|
||||
entry_name = msg[:p]
|
||||
if self.classes:
|
||||
if not any([fnmatch(entry_name, c) for c in self.classes]):
|
||||
return
|
||||
|
@ -92,6 +91,12 @@ class Stats(Analyzer):
|
|||
if not record:
|
||||
return
|
||||
|
||||
try:
|
||||
s = Structure(msg)
|
||||
except ValueError:
|
||||
logger.warning("failed to parse: '%s'", msg)
|
||||
return
|
||||
|
||||
# aggregate event based on class
|
||||
for sk,sv in record['scope'].items():
|
||||
# look up bin by scope (or create new)
|
||||
|
|
Loading…
Reference in a new issue