Skip to content

Wprof host/kernel and user-provided metadata support#59

Merged
anakryiko merged 5 commits intomasterfrom
wprof-meta
Apr 22, 2026
Merged

Wprof host/kernel and user-provided metadata support#59
anakryiko merged 5 commits intomasterfrom
wprof-meta

Conversation

@anakryiko
Copy link
Copy Markdown
Owner

And a bunch of small UX improvements.

Running ./wprof -R with no -T, -J, -I, or --req-list silently did
nothing. Detect this and report an error with the expected options.

Signed-off-by: Andrii Nakryiko <[email protected]>
Emit a warning early if euid != 0, since BPF operations require root.
Proceed anyway to let the user see the actual failure.

Signed-off-by: Andrii Nakryiko <[email protected]>
Add fmt_timestamp_ns() helper that formats a realtime_ns epoch value
as an ISO 8601 UTC timestamp (e.g., "2026-04-22T18:47:58.231Z"). Uses
gmtime() so the displayed time is timezone-independent.

Display the capture timestamp in --replay-info and emit it as
"timestamp" in the JSON header.

Signed-off-by: Andrii Nakryiko <[email protected]>
Allow attaching arbitrary key=value metadata to a recording via
repeatable -M/--metadata flag. Keys and values are trimmed of
whitespace. Hostname and kernel version are captured automatically.

Metadata is persisted as WEXTRA_METADATA extras in the data file,
displayed in --replay-info under a "Metadata:" section, and emitted
as a "metadata" JSON object in JSON trace output.

Signed-off-by: Andrii Nakryiko <[email protected]>
Emit capture-time extras (filters, utrace defs) as a JSON "extras"
array and metadata as a "metadata" object in the JSON header.

Signed-off-by: Andrii Nakryiko <[email protected]>
@anakryiko anakryiko merged commit 88b578d into master Apr 22, 2026
4 checks passed
@anakryiko anakryiko deleted the wprof-meta branch April 22, 2026 20:38
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