Commit 0aa15077 authored by Andrew Gallatin's avatar Andrew Gallatin
Browse files

pmcstat: fix log analysis

pmcstat has been broken for analyzing logs since D35342 / b6e28991.

This is because the pmc for the first CPU is not added when reading logs
because unlike its clones, its event id is not invalid. That causes us
to fail the assertion at lib/libpmcstat/libpmcstat_logging.c:293
when encountering samples from cpu0.

Fix this by removing the check that the PMC is invalid

Reviewed by: tsoome
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D35709
parent ee2324aa
...@@ -1187,8 +1187,7 @@ main(int argc, char **argv) ...@@ -1187,8 +1187,7 @@ main(int argc, char **argv)
*/ */
STAILQ_FOREACH(ev, &args.pa_events, ev_next) { STAILQ_FOREACH(ev, &args.pa_events, ev_next) {
if (ev->ev_pmcid == PMC_ID_INVALID && if (pmc_allocate(ev->ev_spec, ev->ev_mode,
pmc_allocate(ev->ev_spec, ev->ev_mode,
ev->ev_flags, ev->ev_cpu, &ev->ev_pmcid, ev->ev_flags, ev->ev_cpu, &ev->ev_pmcid,
ev->ev_count) < 0) ev->ev_count) < 0)
err(EX_OSERR, err(EX_OSERR,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment