-
Notifications
You must be signed in to change notification settings - Fork 0
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
Support for tracing the mcount function on RISC-V 64-bit architectures #18
Support for tracing the mcount function on RISC-V 64-bit architectures #18
Conversation
1db036e
to
e8cd34b
Compare
Hi @gichoel, Thanks very much for your work! I will first ask you to change the commit message titles as a first step. The commit titles need to be changed because "for riscv64 architecture" part is unnecessarily repeated for every commits. Then the commit messages can be changed from arch: Update 'arch/riscv64/mcount.S' for riscv64 architecture
arch: Update 'cmds/record.c' for riscv64 architecture
Arch: Add 'arch/riscv64/plthook.S' for riscv64 architecture
arch: Add 'arch/riscv64/mcount-support.c' for riscv64 architecture
arch: Update 'utils/compiler.h' for riscv64 architecture
arch: Add 'arch/riscv64/mcount.S' for riscv64 architecture
arch: Add 'arch/riscv64/cpuinfo.c' for riscv64 architecture
arch: Add 'arch/riscv64/Makefile' for riscv64 architecture
arch: Add 'arch/riscv64/mcount-arch.h' for riscv64 architecture to
However, now the titles only show "Add" and "Update". I think those messages do not provide any useful information. Please rewrite the commit title and messages then I will have a look inside again. In addition, the last commit e8cd34b doesn't have to be in a separate patch so please squash it into a proper commit. |
bff910e
to
4e26849
Compare
Fix a small typo in uftrace.md manpage. Signed-off-by: Seong Jin Kim <mirusu400@naver.com>
Retranslate the latest `uftrace.md` in Korean Signed-off-by: Seong Jin Kim <mirusu400@naver.com>
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.
Thanks for the update.
You've already split the patches down into piece by piece logically. However, each patch must make the build successful. The current build fails at the initial patch.
$ make
make[1]: Nothing to be done for '/home/user/work/uftrace/arch/riscv64/uftrace.o'.
LINK uftrace
/usr/bin/ld: /home/user/work/uftrace/utils/perf.o: in function `setup_perf_record':
/home/user/work/uftrace/utils/perf.c:74: undefined reference to `read_memory_barrier'
/usr/bin/ld: /home/user/work/uftrace/utils/perf.c:72: undefined reference to `full_memory_barrier'
collect2: error: ld returned 1 exit status
make: *** [Makefile:336: /home/user/work/uftrace/uftrace] Error 1
I would suggest you to add skeleton structure so that the compilation done first at the initial patch, then build up the internal logic one by one.
In addition, I've left a few more comments below.
utils/compiler.h
Outdated
@@ -37,6 +37,14 @@ | |||
#endif | |||
#endif | |||
|
|||
//TODO: Requires implementation for RISC-V 64bit architecture |
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.
Do not use //
comment, use /* ... */
comment instead.
In addition, please add an empty space after //
so //TODO
should be /* TODO: ... */
.
Hmm... That's very strange. Because I had already added the skeleton structure to the part of the commit called
@honggyukim A commit from mirusu400 came in in the middle of this PR, and after thinking about what could have gone wrong, I finally remembered that the commit time of "utils/compiler.h" was later than the rest of the code. So I cloned the point in time before mirusu400 pushed "utils/compiler.h", and it looks like "utils/compiler.h" disappeared because mirusu400 pushed his work here. I 'git push --force' the re-commit in my local environment, so it was fine. |
I will reapply and upload the feedback regarding annotations along with the fix for |
c3a0da0
to
9bef646
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.
Hmm... That's very strange.
Because I had already added the skeleton structure to the part of the commit called arch/riscv64: Update 'utils/compiler.h' to fix compilation errors
Your first commit doesn't have utils/compiler.h
so the compilation fails. What I asked was to make each patch makes the build successful. The build is successful only when the e96ecba is introduced.
9bef6468 arch/riscv64: Resolve 'Unsupported macine ...' error output <- build OK
e96ecbaa arch/riscv64: Add 'plthook.S' to resolve compile errors <- build OK
b8305343 arch/riscv64: Add 'mcount-support.c' to resolve compile errors <- build fail
66d8f6db arch/riscv64: Update 'utils/compiler.h' to resolve compile errors <- build fail
e96f5eed arch/riscv64: Add 'mcount.S' to support tracking based on mcount func <- build fail
e7449a89 arch/riscv64: Add 'cpuinfo.c' for get architecture-dependent CPU Info <- build fail
13d37f9d arch/riscv64: Add 'Makefile' for compiling architecture-dependent code <- build fail
061e911f arch/riscv64: Add 'mcount-arch.h' for declare register info for an arch <- build fail
But you don't have to change all the patches if you feel it's tricky to handle because anyway the riscv64 build fails even before having this PR.
If you think about doing git bisect
in the future, you will understand why I asked this.
arch/riscv64/mcount-support.c
Outdated
/* | ||
* TODO: | ||
* This was implemented as a meaningless value because we focused on | ||
* successful builds with no compilation errors. | ||
* | ||
* Therefore, it should be modified for future RISC-V 64-bit | ||
* architectures. | ||
*/ |
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.
Please fix the alignment for the comment.
Before:
/*
* TODO: ...
*/
After:
/*
* TODO: ...
*/
In addition, I think the same and long comment doesn't have to be repeated multiple times. You can just make it shorter as follows.
/* TODO: not implemented yet. */
Anyone can easily understand the meaning.
arch/riscv64/mcount-support.c
Outdated
/* | ||
* TODO: | ||
* This was implemented as a meaningless value because we focused on | ||
* successful builds with no compilation errors. | ||
* | ||
* Therefore, it should be modified for future RISC-V 64-bit | ||
* architectures. | ||
*/ |
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.
Ditto.
arch/riscv64/mcount-support.c
Outdated
/* | ||
* TODO: | ||
* This was implemented as a meaningless value because we focused on | ||
* successful builds with no compilation errors. | ||
* | ||
* Therefore, it should be modified for future RISC-V 64-bit | ||
* architectures. | ||
*/ |
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.
Ditto.
arch/riscv64/mcount-support.c
Outdated
/* | ||
* TODO: | ||
* This was implemented as a meaningless value because we focused on | ||
* successful builds with no compilation errors. | ||
* | ||
* Therefore, it should be modified for future RISC-V 64-bit | ||
* architectures. | ||
*/ |
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.
Ditto.
arch/riscv64/mcount-support.c
Outdated
/* | ||
* TODO: | ||
* This was implemented as a meaningless value because we focused on | ||
* successful builds with no compilation errors. | ||
* | ||
* Therefore, it should be modified for future RISC-V 64-bit | ||
* architectures. | ||
*/ |
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.
Ditto.
Signed-off-by: SangGyuLee <239lsg239@gmail.com>
The missing options -Z *SIZE*, \--size-filter=*SIZE*, -L LOCATION' '--loc-filter=LOCATION' and '--with-syms=DIR' are translated and added to man pages in Korean. Signed-off-by: Jeonghwan In <jhpc0128@naver.com>
The function add_trigger has been replaced with update_trigger, rendering it unnecessary. This commit removes the now-unused add_trigger function. Signed-off-by: Soyeon Park <sypark9646@gmail.com>
Hmmm... I still don't have a clear understanding of git bisect, but I understand that it's used to find when things aren't working as they should (e.g. build failures). Also, I think what I missed is that all commits must individually succeed in the build, but the commits for the RISC-V porting must be reflected until the last one to succeed in the build. I'll fix the commits to reflect this and re-upload them. |
Revised the uftrace-dump.md manual to include the missing = sign in the description of the --depth option. Signed-off-by: SeokMin Kwon <ksm012015@naver.com>
83298ac
to
0c2bf2a
Compare
This is a commit to ensure a successful build in a RISC-V 64bit environment, no functional behavior is implemented. Signed-off-by: Gichoel Choi <gichoel3101@gmail.com>
This is a commit to support tracing for mcount functioin in 'mcount.S'. Info : When compiling the target program with gcc, you need to add '-O0' or add '-fno-omit-frame-pointer' as an option because it will disable frame pointers when optimization options are enabled. Signed-off-by: Gichoel Choi <gichoel3101@gmail.com>
This is a commit to get CPU information using the '/proc/cpuinfo' file in a RISC-V 64bit environment. Signed-off-by: Gichoel Choi <gichoel3101@gmail.com>
0c2bf2a
to
1b13502
Compare
You must properly rebase your patches. The current PR brings many other unrelated commits together. |
There's still a lot I don't know about git, so I didn't know why someone else's commit went up, but I think I know now. The problem was that I had run a So at this point I was thinking of closing the PR and reposting it to namhyung/uftrace as we discussed before, would that be okay? |
Yes, please upload a PR in the @namhyung's upstream uftrace repo. |
This is a porting effort to support tracing with the mcount function in the RISC-V 64-bit architecture environment.