Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uptime: Support files in uptime #6400

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

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

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
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 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
Cargo.toml Outdated Show resolved Hide resolved
@AnirbanHalder654322 AnirbanHalder654322 marked this pull request as ready for review May 25, 2024 09:41
@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 5 times, most recently from 3eab879 to 64728d3 Compare May 26, 2024 18:11
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/tail/inotify-dir-recreate (fails in this run but passes in the 'main' branch)
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 3 times, most recently from 50bd31a to 7284dd3 Compare May 27, 2024 12:33
@AnirbanHalder654322 AnirbanHalder654322 marked this pull request as ready for review May 27, 2024 12:34
@AnirbanHalder654322
Copy link
Contributor Author

Changes summary since last review.

  1. Testing using file with dynamically created binary utmp records. Not testing for macos , since i don't have access to make to figure out creation of the binaries. Added a todo for anyone who owns a mac.
  2. Added utmpxname() detection since it returns an error in mac systems when the filename doesn't end up 'x'.
  3. Some lint stuff.

@AnirbanHalder654322 AnirbanHalder654322 marked this pull request as draft May 27, 2024 14:06
@AnirbanHalder654322 AnirbanHalder654322 marked this pull request as draft May 27, 2024 14:06
@AnirbanHalder654322 AnirbanHalder654322 marked this pull request as ready for review May 27, 2024 18:45
@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.

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.

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)

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)

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)

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