-
Notifications
You must be signed in to change notification settings - Fork 328
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
target/riscv: dump_field() shouldn't always decode #951
Conversation
Prior to the change:
After the change:
|
ab35ffb
to
47af939
Compare
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.
I like this idea to reduce debug clutter.
src/target/riscv/riscv-013.c
Outdated
if (decode_out) | ||
out_text = decode_dmi(target, out_decoded, out_address, out_data) | ||
? out_decoded | ||
: "<no decoding available>"; |
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.
"no decoding available" sounds a bit odd. We could decode it if we wanted to. We (probably) have the relevant field information available to decode. How about ""?
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.
Addressed.
2adf33b
to
2b6b087
Compare
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.
This looks good to me.
As discussed, a more elaborate algorithm to detect validity of the incoming data could be implemented. Anyway, this change is still nice improvement over the current state.
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.
Minor feedback.
2b6b087
to
b6f3911
Compare
This
I don't care to see the prototype for dump_field() all the time. Please revert that. There is really no reason to mention the function name at all. It just needs to be something concise that we can easily ID as a RISC-V JTAG scan. |
1369ccb
to
edbd031
Compare
@timsifive, thank you for the catch! IMHO, this is quite interesting. The very line you quoted was not affected by my commit (it's a similar function for batch operations). I would like to leave log's format as consistent as possible, so I have just replaced |
Oh, I am building with clang. I switched because I was checking if something worked. I didn't realize that would cause this difference. |
Can you rebase this on top of the current |
Sometimes, the value from of some DMI scans has no meaning (e.g. when `op` is read). Such values should not be decoded. To make the dumps more consistent, `<no decoding available>` is printed when there is no decoding for a register. Change-Id: I415f06a5a80f2fc8fb8ab3f79132bdf0602c8ad6 Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
The reasoning for the change: * `__func__` is part of C99, `__PRETTY_FUNCTION__` is GNU extension. * `__PRETTY_FUNCTION__` is defined to be the same as `__func__` for C sources by GCC documentation but differ for C++ sources (full signature instead of just a name). * Currently Clang does support `__PRETTY_FUNCTION__`, though it uses GCC's C++ variant across C and C++. Therefore using `__PRETTY_FUNCTION__` creates confusion and does not provide any valueble information in the logs. Change-Id: Ie0db6d73f602784b6752a30911dcef3dd7ee4594
edbd031
to
00320fd
Compare
Done. |
Sometimes, the value from of some DMI scans has no meaning (e.g. when
op
is read). Such values should not be decoded. To make the dumps more consistent,<no decoding available>
is printed when there is no decoding for a register.Change-Id: I415f06a5a80f2fc8fb8ab3f79132bdf0602c8ad6