tests/utmpx: check logind timestamps and leader PIDs #16231
<!-- gnu-comment-bot -->
GNU testsuite comparison:
Skip an intermittent issue tests/misc/usage_vs_getopt (fails in this run but passes in the 'main' branch)
<!-- size-comment-bot -->
Binary size comparison:
Individual binary size comparison VS main (threshold: >=5% AND >=4 KB).
Total size of compared binaries: 155.61 MB (+224 KB, +0.14%)
Significant per-binary changes:
env 1.20 MB -> 1.28 MB (+80 KB, +6.51%)
Personally, I prefer the zbus-based approach because I find it allows for cleaner code.
Is this really needed? It would bever implemented at wasi side and we don't document same things for Windows.
You no nonger dlopen.
You no longer dlopen *.so.
<!-- __CODSPEED_PERFORMANCE_REPORT_COMMENT__ -->
Merging this PR will regress 3 benchmarks
<details>
<summary><b>2 warnings, 1 note</b></summary>
:warning: 118 benchmarks are dominated by system calls
> System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.
> Learn more about system calls
> See affected benchmarks
:warning: 5 benchmarks with a significant change ran on different hardware
> Their base and head results were measured on machines with a different CPU, core count or memory, so the changes might not come from the code. Run base and head on the same runner type.
> Learn more about Macro Runners
> See affected benchmarks
:information_source: 1 benchmark has no flamegraph
> The flamegraph wasn't generated: most of the time was spent in runtime internals, which would leave nothing useful to analyze.
> See affected benchmarks
</details>
⚡ 2 improved benchmarks ❌ 3 regressed benchmarks ✅ 408 untouched benchmarks ⏩ 70 skipped benchmarks[^skipped]
[!WARNING]
Please fix the performance issues or acknowledge them on CodSpeed.
Performance Changes
| | Mode | Benchmark | BASE | HEAD | Efficiency |
| --- | ---- | --------- | ------ | ------ | ---------- |
| ❌ | CPU Simulation | [` socket_addrs_direct[100000] ](https://app.codspeed.io/uutils/coreutils/branches/mattsu2020%3Ausers-zbus?uri=src%2Fuu%2Fhostname%2Fbenches%2Fhostname_bench.rs%3A%3Asocket_addrs_direct%255B100000%255D&runnerMode=Simulation&utm_source=github&utm_medium=comment-v2&utm_content=benchmark) | 105.3 µs | 132.9 µs | -20.78% |
| ❌ | Memory | [ cp_recursive_deep_tree[(120, 4)] ](https://app.codspeed.io/uutils/coreutils/branches/mattsu2020%3Ausers-zbus?uri=src%2Fuu%2Fcp%2Fbenches%2Fcp_bench.rs%3A%3Acp_recursive_deep_tree%255B%28120%252C%25204%29%255D&runnerMode=Memory&utm_source=github&utm_medium=comment-v2&utm_content=benchmark) | 670.5 KB | 788.5 KB | -14.97% |
| ❌ | CPU Simulation | [ hostname_ip_lookup[100000] ](https://app.codspeed.io/uutils/coreutils/branches/mattsu2020%3Ausers-zbus?uri=src%2Fuu%2Fhostname%2Fbenches%2Fhostname_bench.rs%3A%3Ahostname_ip_lookup%255B100000%255D&runnerMode=Simulation&utm_source=github&utm_medium=comment-v2&utm_content=benchmark) | 544 µs | 573.6 µs | -5.16% |
| ⚡ | Memory | [ socket_addrs_direct[100000] ](https://app.codspeed.io/uutils/coreutils/branches/mattsu2020%3Ausers-zbus?uri=src%2Fuu%2Fhostname%2Fbenches%2Fhostname_bench.rs%3A%3Asocket_addrs_direct%255B100000%255D&runnerMode=Memory&utm_source=github&utm_medium=comment-v2&utm_content=benchmark) | 68 KB | 8.6 KB | ×7.9 |
| ⚡ | Memory | [ hostname_ip_lookup[100000] ](https://app.codspeed.io/uutils/coreutils/branches/mattsu2020%3Ausers-zbus?uri=src%2Fuu%2Fhostname%2Fbenches%2Fhostname_bench.rs%3A%3Ahostname_ip_lookup%255B100000%255D&runnerMode=Memory&utm_source=github&utm_medium=comment-v2&utm_content=benchmark) | 159.7 KB | 100.3 KB | +59.19% |
[!TIP]
Investigate this regression by commenting @codspeedbot fix this regression` on this PR, or directly use the CodSpeed MCP with your agent.
---
<sub>Comparing <code>mattsu2020:users-zbus</code> (66dc25c) with <code>main</code> (dded1b5)</sub>
<a href="https://app.codspeed.io/uutils/coreutils/branches/mattsu2020%3Ausers-zbus?utm_source=github&utm_medium=comment-v2&utm_content=button">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://codspeed.io/pr-report/open-in-codspeed-dark.svg">
<source media="(prefers-color-scheme: light)" srcset="https://codspeed.io/pr-report/open-in-codspeed-light.svg">
<img alt="Open in CodSpeed" src="https://codspeed.io/pr-report/open-in-codspeed-light.svg" width="169" height="32">
</picture>
</a>
[^skipped]: 70 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.
Not needed. Delete it
I added this because the spell checker reported an error.
That's true. Delete the text.
I think we can use binaries provided by systemd itself at our test and remove unsafe dlopen.
I'm running some basic tests, but it looks like we can remove it.
Why both?
This is valid reason to bump our Rust at different PR. https://ubuntu.com/developers/docs/reference/availability/rust/
Ubuntu 22.04 tests the D-Bus fallback used by older systemd versions.
Ubuntu 24.04 tests direct access through newer sd-login APIs.
Both are needed to cover these different code paths.
If testing just one of them is sufficient, I'll consolidate them into one.
Is there any reason we can't upgrade to Rust 1.89?
If not, I'd prefer to upgrade to 1.89 first.
If we're aiming to align with Ubuntu, should we upgrade to Rust 1.93?
ubuntu-22.04 runner image is deprecated and will be retired in April 2027, how can we test it then?
Ubuntu's LTS support period is relatively short. How about using Debian instead? I think that could work.
GitHub does not provide it. Do we really need to care about legacy API?
We should support what user want to do at 1st.
I think it would be better to run CI/CD tests only on the latest version and remove the Ubuntu 22.04 image.
Since we already have unit tests in place, I believe this should be sufficient.
thanks for the patch!
The zbus part makes who and pinky 58% bigger, just for systemd < 254. See the comment on bus.rs.
Please also wait until #11579 and #16255 land, rebase on them, and squash everything into one commit.
this costs +58% on who and pinky (~700KB) only for systemd < 254, is it worth it?
printing ? there seems good enough to me
same conversion as line 454, could be dedup
now called twice, and unrelated to this PR, please drop it from here
I'm fine with that approach.
fixed it
fixed it
alphabetize please
alphabetize please
alphabetize please
alphabetize please
alphabetize please
alphabetize please
does each commit stand alone, or should they be squashed?
oech3
mattsu2020
Check the login time in
who -uandpinky, and the session leader PID inwho -u. Verify that each field displays?when sd-login cannot supply its value.Depends on #11579.