-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
ftrace: Add function execution time support #3117
Conversation
Comment for "ftrace: Add function execution time support": |
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.
Reviewing "libutee: add headers for user-space to access sysregs":
Please see below. Also, you could name the header in the commit subject: s/add headers/add <arm_user_sysreg.h>/
.
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.
For commit "core: ftrace: Enable user-space access to counter regs":
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Ok.
Can you please point to changes where you see them as cleanups? |
Updated PR. |
Any further comments? |
Please address the comments you haven't addressed yet. |
I am not sure which comments you are referring too. If you are looking for generation of custom |
I stopped at the |
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.
A comment for the commit "libutee: add headers for user-space to access sysregs"
For "libutee: add headers for user-space to access sysregs":
|
Any further comments? |
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.
Some minor comments below, in any case:
For "ldelf: ftrace: pass ftrace buffer address to kernel" and "ftrace: Add function execution time support":
Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org>
Squashed and tags applied. |
@b49020 Testing on QEMU.
|
It works well for me on QEMU 64 bit. Did you applied TF-A patch while testing?
Will fix. |
I have tested QEMU 32 bit.
Which patch? I am using v2.0-507-g34efb683 as in current manifest.git. |
@jforissier I have tested this on QEMU 64 bit only for both 64 bit as well as 32 bit apps.
I was referring to https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/commit/?h=integration&id=43f999a7e35db5bdbb5af6dfc7efc46f6ecab443. But its needed for QEMU 64 bit only.
Now I could reproduce the issue. It seems that compiler isn't able to inline Please give it a retry. Also, I have fixed following:
|
Makes sense. It's working now. Another option would be to use the __noprof versions only in the profiling code. But that would be a bit more complicated, and we probably don't loose much by not profiling the register accessors globally. Should the same fix be applied to Feel free to add my:
...to "ftrace: Add function execution time support". |
Makes sense. Will add |
Squashed fix and applied tested-by tag. |
Thanks @b49020. Let's leave some time for @jenswi-linaro to review again. |
|
To enable function execution time support in function tracing output, user-space ftrace framework needs to access frequency register and physical counter register. So enable user-space access. Signed-off-by: Sumit Garg <sumit.garg@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
User space may require to access system registers like generic timer registers in case function tracing is enabled etc. So provide headers for user space to access sysregs. Signed-off-by: Sumit Garg <sumit.garg@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Enable support to pass ftrace buffer address to kernel during loading of particular TA. It is required to support function execution time feature since kernel needs to update timestamps in ftrace buffer during TA suspends for proper execution time. Signed-off-by: Sumit Garg <sumit.garg@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Add support to dump function execution time at corresponding function exit points in output ftrace buffer. To achieve proper function execution time we need to exclude TA suspend time from timestamps, so add corresponding support in TEE core. Also user mapping must be active to access ftrace buffer, so do that during TA resume. Signed-off-by: Sumit Garg <sumit.garg@linaro.org> Reviewed-by: Jerome Forissier <jerome.forissier@linaro.org> Tested-by: Jerome Forissier <jerome.forissier@linaro.org> (QEMU) Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Tag applied. |
This patch-set adds function execution time support and is in continuation of PR: #3080 with comments incorporated. So after this patch-set function graph would look something like:
Looking forward to your valuable feedback/comments.
Regards,
Sumit