Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools/trace-parser: Add Rust trace.dat parser #2166

Conversation

douglas-raillard-arm
Copy link
Contributor

FEATURE

@douglas-raillard-arm douglas-raillard-arm force-pushed the _home_pr90383 branch 30 times, most recently from 4ec9117 to 399137b Compare January 17, 2024 12:04
@douglas-raillard-arm douglas-raillard-arm force-pushed the _home_pr90383 branch 8 times, most recently from fc9d40f to 0c0ac4e Compare January 19, 2024 18:49
BREAKING CHANGE

cpumask fields cannot be handled in a uniform way between all parsers,
so remove any attempts at doing so.  Since the new default trace-dump
parser has direct support for them, drop the sanitization.

The new format for cpumask values is an iterable of booleans where each
position corresponds to one bit, starting from CPU 0, e.g. [True, False,
False] for the cpumask 0b100
FIX

Clear the flag in the file that states that some events were dropped.
This avoids parsing to fail because of dropped events detection.
FIX

Fix buffer name parsing so that we do not accidentally consume part of
the comm field.
@douglas-raillard-arm douglas-raillard-arm force-pushed the _home_pr90383 branch 5 times, most recently from fd1c665 to 46cfc71 Compare January 26, 2024 16:09
FEATURE

Switch the parser for trace.dat format to the new trace-dump parser.

Also make a number of changes to the parsing infrastructure:
* New trace-id parser metadata that is used instead of md5 checksum when
  available.

* Meta events are now tried directly before their source event, so the
  parser has a chance to handle that directly. This is critical for
  trace_printk@ performance as the new parser handles it natively.

* TraceParserBase subclasses are now used as a context manager when
  costly operation such as event parsing (always) or metadata querying
  (only when the result is really needed). This allows the parser to
  correctly manage its resources, while allowing cheap metadata
  gathering to happen as part of the constructor if needed.

* A number of fixes such as minimzation of parsing attempts if an event
  is known to not be parseable.

* available-events metadata are now cached in the trace cache.

* Removed the multiprocessing parsing from lisa.trace.Trace. This is
  effectively useless with the new parser (which is parallel on its own)
  and avoids pitfalls of forking Python process (sluggish import time or
  crashy/illegal libc calls after fork, pick your poison)

If need be, the old parser is still available and can be used as:

    Trace(..., parser=TxtTraceParser.from_dat)

However, it is not expected that the old parser has any use beyond some
meta events (userspace@...) so if you have problems with the new one,
please open a bug report with the trace.dat.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant