-
-
Notifications
You must be signed in to change notification settings - Fork 163
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
Profiling support and coverage support #687
Comments
|
@akinomyoga I have heard good things about for C++. (I am using a mix of gdb and Eclipse now and not that happy with it, so I might experiment with different tools. It will become more important as more of Oil is in C++) In theory, recording the execution history for reversible debugging is possible with Oil since the state space of a shell is very small (e.g. everything is in But probably won't happen for a long time... we have to do many more basic things first :) But I suppose the idea is that you could run with it on all the time if it's cheap enough. I think the more conventional way of catching those errors is through unit tests. That is, I try not to create too many code paths in OSH that can't be reached by automated tests... That reminds me of #439, I want to use some kind of terminal testing, not just stdin byte streams. We probably can use similar techniques for both ble.sh and Oil, so if you have any ideas let me know. Is it possible to "tee" the terminal and then replay it into ble.sh? I played with |
Thank you for the information! I think it will be very useful if a similar thing is available for shells.
Unfortunately,
Yes. I agree. Strange behavior that cannot be reproduced easily rarely occurs. It is something like only once or twice per year in the daily use of shells. So it is important that it's cheap because I don't want to make it enabled all the time if it is slow.
Yes. I agree. The reason that But I think this is a good chance to supplement unit tests of
Yes, that is also a difficult point. For the test, the user input stream can be provided, but the output terminal sequences can vary depending on
Hm, what does "replay into ble.sh" mean?
|
I'm not sure why, but out of the blue just now I thought native coverage support might be an interesting lever for both OSH and Oil, especially since the mechanisms for backfilling it are so clumsy/hackish. If project-x has a few bits of bash that OSH chokes on, native support for things like coverage and profiling can provide the clear value proposition for why it's worth their time to update them for OSH-compatibility. Even if their main target is still bash, making a few small changes and adding OSH to the shells their test suite runs in sounds like a nice trade for something like high-quality granular coverage reports. |
There are (almost) no tests for
ble.sh
. My feeling is that only 5-10% is covered by the tests for the vim mode but I'm not sure actually.The most time consuming part is to find the way to reproduce the buggy behavior. When I encounter some strange behavior in interactive session, sometimes the behavior cannot be easily reproduced. But I don't know what is the good way to deal with such problems.
The second time consuming part is to identify the bottleneck. Shell scripts are generally slow so it is very important to find the bottleneck for optimization of the scripts. I want the feature of profiling, i.e., measure the time of each function. I sometimes try to measure the time by embedding some codes in shell scripts, but the measuring logic itself consumes the time so that it is hard to measure the actual time. We need some native mechanism (i.e., not shell scripts) for profiling.
Another annoying thing in debugging interactive sessions is that the error messages from Bash and the output of
ble.sh
are both output to the terminal, so they overwrite each other. So I need to redirect the error messages or debugging messages to a file or a different TTY.Also if one can set some breaking points, it will be useful for debugging the scripts.
Edit: Also, a native support for coverage measurement is useful. For example, coverage analysis using the output of
set -x
is tricky and not so reliable.Originally posted by @akinomyoga in #653 (comment)
The text was updated successfully, but these errors were encountered: