Skip to content

[Bug]: parsing kernel esstra data is very slow #39

@tbird20d

Description

@tbird20d

Mandatory confirmtion

Description

When working with the data for a Linux kernel, the 'esstra' utility is quite slow. It takes about 6 minutes for 'esstra show vmlinux'.

for example: 'time esstra show vmlinux' gave a result of 6m37s, or 397 seconds to perform that operation.
Note that this is with output piped to /dev/null, and on a vmlinux image that is in the kernel's filesystem cache.
It is slower (see below) in other circumstances.

The size of the esstra data for my kernel is approx. 155 megabytes (155583207 to be exact)
A direct objcopy of this data from the vmlinux file takes only 14 seconds.
(e.g. time objcopy --dump-section .esstra=vmlinux.esstra-data vmlinux)

This is the same command that is used to extract the raw data from the file in the 'esstra' utility.
The other operations on the data performed for an 'esstra show' command are decode and parse.
I haven't measured internally to see how much time each of these takes, but my guess would be
that the parse operation is the slow one.
Possibly there is a more efficient yaml parser available which might solve this problem.

I thought that 'esstra show -r vmlinux' (showing only the raw, unparsed data) would be faster, but it is not
IMHO the esstra code should be restructured so that only the objcopy (and not the decode and parsed) are
performed when using the '-r' option to just show the raw esstra data.

Version of ESSTRA

v0.4.0-15-geaade66

Environment

Ubuntu 24.04, using esstra on a Linux kernel build.

Steps to reproduce

$ time esstra show -r vmlinux
...

  • File: version-timestamp.c
    SHA1: 'fbc84274f45d849495c2bff3eb25260e51e9641c'

real 8m7.341s
user 7m41.788s
sys 0m13.693s

Console logs, visual proof, etc.

No response

Expected results

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions