Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
aarch64: Save and restore VFP registers on update_mem_regions()
It seems to overwrite aarch64 VFP registers while recording args in string format. Here is the test program and the preparation. $ cat float.c #include <stdio.h> float float_add(float a, float b) { return a + b; } int main(int argc, char *argv[]) { double c; c = float_add(-0.1, 0.2); fprintf(stderr, "%lf\n", c); return c > 0; } $ gcc -pg float.c $ uftrace -A fprintf@arg2 -F main a.out 0.100000 # DURATION TID FUNCTION [ 1047] | main() { 1.198 us [ 1047] | float_add(); 95.104 us [ 1047] | fprintf(0xaaaab814ca48); 109.843 us [ 1047] | } /* main */ However, the return value of 'float_add' is overwritten by some garbage value if uftrace records a function in string format. $ uftrace -A fprintf@arg2/s -F main a.out 121362470815289747852695694937146665636545397707008516 ... 912.000000 # DURATION TID FUNCTION [ 1058] | main() { 1.250 us [ 1058] | float_add(); 1.278 ms [ 1058] | fprintf("%lf\n"); 1.292 ms [ 1058] | } /* main */ This patch protects the context by saving d0-d7 registers before calling it, and it makes the result correct. Signed-off-by: Honggyu Kim <honggyu.kp@gmail.com>
- Loading branch information