perf lock: Provide a host_env for session new
authorIan Rogers <irogers@google.com>
Sat, 13 Sep 2025 00:01:29 +0000 (17:01 -0700)
committerNamhyung Kim <namhyung@kernel.org>
Sat, 13 Sep 2025 00:53:03 +0000 (17:53 -0700)
commit7947ad15614ce897f47ce8ae123b82445d1861d0
tree0971d901fdf57e8db9304c6eecea0c08a8a31369
parenta5edf3550f4260504b7e0ab3d40d13ffe924b773
perf lock: Provide a host_env for session new

When "perf lock con" is run in a live mode, with no data file, a host
environment must be provided. Testing missed this as a failing assert
was creating the 1 line of expected stderr output.

  $ sudo perf lock con -ab true
  perf: util/session.c:195: __perf_session__new: Assertion `host_env != NULL' failed.
  Aborted

Fixes: 525a599badeeafba ("perf env: Remove global perf_env")
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/builtin-lock.c