-
Notifications
You must be signed in to change notification settings - Fork 19.2k
Networking: support capturing all packets to a pcap file #30637
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
base: master
Are you sure you want to change the base?
Conversation
60ff2da
to
9a5660c
Compare
36d41f1
to
a6e3bdc
Compare
Regarding the Timing using the Lua script stats on Cube Orange suggests writing one byte takes about 10 microseconds which does not blow my socks off but is fine. Writing ten bytes also takes about 10 microseconds which matches my expectations of most of the time being locking and call overhead. Writing a sector takes about 4 milliseconds though, from the Lua thread at least, which is pretty bad. I merged this PR in to benchmark it and it seems to have shaved a couple microseconds off each call, but has had no effect on the sector write time, despite the fact that it's now writing four sectors at a time. Which is good as that means 4x the bandwidth. The FATFS docs suggest a buffer of at least one cluster, which is usually 32K bytes IIRC. But this is a lot of RAM to sacrifice for each file particularly on F4. Your API could be used to amortize the sector write time but we might have to make the buffer size a processor-specific define. I think 8K is too often to sync, it should be once per cluster. I wanted to modify the logger code to sync after the cluster size and also after a fixed time, but haven't got around to it. Ultimately I think it would be good to centralize the logic for streaming writing files (maybe with a new open code) but as it is doesn't quite feel right. Maybe I just need to sit with it more or see it as its own PR. I do have re-imaginings for |
Off by default; 1.2kB on CubeOrangePlus Plane (etc.) |
@tpwrules @peterbarker I've broken out the filesystem changes into #30671 for separate discussion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double-shuffle done?
yes. We use the 2.2 branch, here: |
allows for capture of ethernet or PPP traffic for debugging
enabled by default, but some users may want to save flash space
This allows capturing of all packets (ethernet or PPP) to a pcap file which can be read by wireshark
this is very useful for debugging tricky networking issues
tested on CubeOrange with BotbloxDroneNet and on Pixhawk6X
depends on: ArduPilot/lwip#4
this also includes a new set of buffered write operations for logging in AP_Filesystem, based on stdio-like API calls