Skip to content

Conversation

@AnirbanHalder654322
Copy link
Contributor

@AnirbanHalder654322 AnirbanHalder654322 commented May 14, 2024

Fixes #6393

Edit1 : I strace-d the whole thing , we seem to use more than 2x amount of read sys calls (will result in more than 100 extra read calls for very large iterations)compared to GNU uptime, which i believe is due to iter_all_records_from function in uucore::src::lib::features::utmpx

@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)

@AnirbanHalder654322 AnirbanHalder654322 marked this pull request as draft May 14, 2024 17:25
@AnirbanHalder654322 AnirbanHalder654322 force-pushed the support_files_in_uptime branch 3 times, most recently from 4fc2074 to 3a5ce83 Compare May 19, 2024 17:29
@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/timeout/timeout. tests/timeout/timeout is passing on 'main'. Maybe you have to rebase?

@AnirbanHalder654322 AnirbanHalder654322 force-pushed the support_files_in_uptime branch from ea305b8 to 3a5ce83 Compare May 19, 2024 18:44
@AnirbanHalder654322 AnirbanHalder654322 marked this pull request as ready for review May 19, 2024 18:49
@AnirbanHalder654322 AnirbanHalder654322 marked this pull request as draft May 22, 2024 13:58
@AnirbanHalder654322 AnirbanHalder654322 force-pushed the support_files_in_uptime branch 2 times, most recently from 76a5692 to 7dd90ba Compare May 25, 2024 09:02
@AnirbanHalder654322 AnirbanHalder654322 force-pushed the support_files_in_uptime branch from 7dd90ba to ce55ec1 Compare May 25, 2024 09:03
@AnirbanHalder654322 AnirbanHalder654322 force-pushed the support_files_in_uptime branch from ce55ec1 to de56e06 Compare May 25, 2024 09:30
@AnirbanHalder654322 AnirbanHalder654322 marked this pull request as ready for review May 25, 2024 09:41
@AnirbanHalder654322 AnirbanHalder654322 force-pushed the support_files_in_uptime branch from b5cab86 to de6a550 Compare May 25, 2024 10:50
@AnirbanHalder654322 AnirbanHalder654322 marked this pull request as draft May 25, 2024 11:54
@AnirbanHalder654322 AnirbanHalder654322 force-pushed the support_files_in_uptime branch 3 times, most recently from c6e9990 to 002edae Compare May 26, 2024 12:46
@AnirbanHalder654322 AnirbanHalder654322 force-pushed the support_files_in_uptime branch from 24e1430 to 1bc79d6 Compare May 28, 2024 10:39
@AnirbanHalder654322
Copy link
Contributor Author

AnirbanHalder654322 commented May 28, 2024

Changes since last push:

The test test_uptime::test_uptime_for_file_without_utmpx_records has been disabled for freebsd , our uucore::utmpx module uses utmpxname() sys call to set the file from which we iterate through, freebsd uses different sets of syscall which function somewhat similarly yet have differences. Comments have been added to the tests which may pass the CI but they don't function as intended.

@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/tail/inotify-dir-recreate (fails in this run but passes in the 'main' branch)

@AnirbanHalder654322
Copy link
Contributor Author

The failing CI tests are unrelated to my PR.

@github-actions
Copy link

github-actions bot commented Jun 1, 2024

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)

@AnirbanHalder654322 AnirbanHalder654322 force-pushed the support_files_in_uptime branch from 266de7b to 4a8c460 Compare June 2, 2024 13:09
@github-actions
Copy link

github-actions bot commented Jun 2, 2024

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)

@github-actions
Copy link

github-actions bot commented Jun 4, 2024

GNU testsuite comparison:

Skip an intermittent issue tests/tail/inotify-dir-recreate (fails in this run but passes in the 'main' branch)

@AnirbanHalder654322
Copy link
Contributor Author

@sylvestre does this require any more changes ?

@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/tail/inotify-dir-recreate (fails in this run but passes in the 'main' branch)

@github-actions
Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/timeout/timeout is no longer failing!

@AnirbanHalder654322
Copy link
Contributor Author

AnirbanHalder654322 commented Jun 21, 2024

Changes since last push:

  • Removed quick_error in favor of thiserror
  • Added some documentation on the added dependencies.
    The clippy error seems to be unrelated to my pr

@sylvestre sylvestre merged commit 2774274 into uutils:main Jun 22, 2024
@sylvestre
Copy link
Contributor

thanks!

naoNao89 added a commit to naoNao89/coreutils that referenced this pull request Oct 14, 2025
If utmpx BOOT_TIME is unavailable, derive boot time via sysctl CTL_KERN.KERN_BOOTTIME to reduce intermittent macOS failures (e.g., uutils#3621).

Context (blame/history):

- 2774274 ("uptime: Support files in uptime (uutils#6400)"): added macOS utmpxname validation and non-fatal 'unknown uptime' fallback with tests (tests/by-util/test_uptime.rs).

- 920d29f ("uptime: add support for OpenBSD using utmp"): reorganized uptime.rs and solidified utmp/utmpx-driven paths.
naoNao89 added a commit to naoNao89/coreutils that referenced this pull request Oct 14, 2025
If utmpx BOOT_TIME is unavailable, derive boot time via sysctl CTL_KERN.KERN_BOOTTIME to reduce intermittent macOS failures (e.g., uutils#3621).

Context (blame/history):

- 2774274 ("uptime: Support files in uptime (uutils#6400)"): added macOS utmpxname validation and non-fatal 'unknown uptime' fallback with tests (tests/by-util/test_uptime.rs).

- 920d29f ("uptime: add support for OpenBSD using utmp"): reorganized uptime.rs and solidified utmp/utmpx-driven paths.
naoNao89 added a commit to naoNao89/coreutils that referenced this pull request Oct 14, 2025
If utmpx BOOT_TIME is unavailable, derive boot time via sysctl CTL_KERN.KERN_BOOTTIME to reduce intermittent macOS failures (e.g., uutils#3621).

Context (blame/history):

- 2774274 ("uptime: Support files in uptime (uutils#6400)"): added macOS utmpxname validation and non-fatal 'unknown uptime' fallback with tests (tests/by-util/test_uptime.rs).

- 920d29f ("uptime: add support for OpenBSD using utmp"): reorganized uptime.rs and solidified utmp/utmpx-driven paths.
naoNao89 added a commit to naoNao89/coreutils that referenced this pull request Oct 14, 2025
If utmpx BOOT_TIME is unavailable, derive boot time via sysctl CTL_KERN.KERN_BOOTTIME to reduce intermittent macOS failures (e.g., uutils#3621).

Context (blame/history):

- 2774274 ("uptime: Support files in uptime (uutils#6400)"): added macOS utmpxname validation and non-fatal 'unknown uptime' fallback with tests (tests/by-util/test_uptime.rs).

- 920d29f ("uptime: add support for OpenBSD using utmp"): reorganized uptime.rs and solidified utmp/utmpx-driven paths.
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.

uptime: should accept a filename as argument

2 participants