The source code(main.cpp) is in the my.rar. and the callgrind output are also 
in the my.rar.

Did you never receive it ?



-----邮件原件-----
发件人: John Reiser [mailto:jrei...@bitwagon.com] 
发送时间: 2017年5月12日 11:18
收件人: valgrind-users@lists.sourceforge.net
主题: Re: [Valgrind-users] hello there is a question about callgrind on the arm64.

>       In arm64:
> 
>          There is function name main’2. It meaning that there is recursive 
> cycle. And it annote the source failed.
> 
>       In x86_64:
> 
>       There is no  function name  main’2  only main., It mean that there is 
> no cycle.
> 
>       How can I resolve it?

Post here the source code to the smallest (shortest) program which does not 
behave like you expect.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech 
sites, Slashdot.org! http://sdm.link/slashdot 
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

char getCommon(char * argv) {
    char result = 0;
    result = argv[0];
    for(int i = 0; i < 2; i++ ) {
         if( argv[1] > 100 ) {
            result += argv[1] + 10;
         }

         if( argv[2] < 30 ) {
            result += argv[2] * 2;
         }
    }    

    return result;
}

char getCommon2(char * argv) {
    char result = 0;
    result = argv[0];
    for(int i = 0; i < 2; i++ ) { 
         if( argv[1] > 20 ) { 
            result += argv[1] + 10; 
         }   

         if( argv[2] < 110 ) { 
            result += argv[2] * 3;
         }   
    }    

    return result;
}


int main(int argc, char ** argv) {
    unsigned long i = 0;
    char * p = (char *)malloc(1024 * 1024);
    memset(p, 1, 1024 * 1024); 
#if 0
    for(int i = 0; i < 10; i++ ) { 
       for(int j = 0; j < 1024 * 1024 - 3; j++) {
            if(j % 10 == 0) { 
              p[j] = getCommon(p + j); 
            } else {
              p[j] = (getCommon2(p + j) + 20 ) >> 2  ; 
            }   
       }   
        memset(p, 1, 1024 * 1024);
   }
#endif
    
   for(int i = 0; i < 10; i++ ) {
       for(int j = 0; j < 1024 * 1024 - 3; j++) {
            if(j % 2 == 0) { 
              p[j] = getCommon(p + j);
            } else {
              p[j] = getCommon2(p + j);
            }
       }
        memset(p, 1, 1024 * 1024);
   }
   printf("p=%p\n", p); 
    return 0;
}
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to