10000 Remove the last .c file: tools/bulk-echo-fast by bradjc · Pull Request #4412 · tock/tock · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Remove the last .c file: tools/bulk-echo-fast #4412

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

Merged
merged 1 commit into from
Apr 30, 2025
Merged

Conversation

bradjc
Copy link
Contributor
@bradjc bradjc commented Apr 23, 2025

Pull Request Overview

This is in C, and our only C code.

This is really just for vanity.

Testing Strategy

n/a

TODO or Help Wanted

Move to tock-archive?

Documentation Updated

  • Updated the relevant files in /docs, or no updates are required.

Formatting

  • Ran make prepush.

This is in C, and our only C code.
Copy link
Member
@ppannuto ppannuto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:/, is this test no longer useful? It seems like the code is all still valid...

Should it at least move to tock-archive? Or some tock-tools / tock-support / etc style repo?

Or maybe @alevy has opinions and tools on how to just automagically convert this C code to Rust? :)

@bradjc
Copy link
Contributor Author
bradjc commented Apr 24, 2025

I imagine the test still works, but we have a lot more USB code and end-to-end uses than we did when this was added.

@bradjc bradjc mentioned this pull request Apr 24, 2025
2 tasks
@alevy
Copy link
Member
alevy commented Apr 24, 2025

This should not be hard to re-write in Rust, fwiw. I do agree that it's not a very robust test relative to the amount of USB we actually have now. @charles37 will be working on USB tests on treadmill soon, which would likely supercede this anyway. Not sure when the last time someone ran this was...

@ppannuto
Copy link
Member

Looking in that directory and at this history for a second, there already is a bulk-echo test written in Rust. The original commit also included a C implementation because:

The tool bulk-echo does this in Rust with cross-platform features of
the libusb library, but is inefficient because it must use blocking
calls to do I/O. The alternate tool bulk-echo-fast is written in C
and uses a single call poll() to service its stdin and libusb file
descriptors. (For stdout, possibly-blocking I/O is used for
simplicity.)

Now, it's likely (especially with modern async) that the world has improved in Rust cross-platform USB since 2018, but it seems like we should do the work of porting the test to Rust (to prove that it can actually be done) before just deleting it :/

@alexandruradovici
Copy link
Contributor

I think porting it to nusb would be a good idea, as the crate seems to be portable and use async.

@bradjc
Copy link
Contributor Author
bradjc commented Apr 25, 2025

Yeah I guess so, but no one is going to bother to port this test no one uses.

@alevy
Copy link
Member
alevy commented Apr 28, 2025

I think basically @charles37 maybe should port it (as part of the Treadmill testing). As far as I'm concerned we can remove it for now I guess, since we can just look in the git history for it as a reference.

@alevy alevy added this pull request to the merge queue Apr 30, 2025
Merged via the queue into master with commit 422fcf6 Apr 30, 2025
21 checks passed
@alevy alevy deleted the rm-bulk-echo-fast branch April 30, 2025 03:05
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.

5 participants
0