• Jin Yao's avatar
    perf diff: Support hot streams comparison · 2a09a84c
    Jin Yao authored
    This patch enables perf-diff with "--stream" option.
    
    "--stream": Enable hot streams comparison
    
    Now let's see example.
    
    perf record -b ...      Generate perf.data.old with branch data
    perf record -b ...      Generate perf.data with branch data
    perf diff --stream
    
    [ Matched hot streams ]
    
    hot chain pair 1:
                cycles: 1, hits: 27.77%                  cycles: 1, hits: 9.24%
            ---------------------------              --------------------------
                          main div.c:39                           main div.c:39
                          main div.c:44                           main div.c:44
    
    hot chain pair 2:
               cycles: 34, hits: 20.06%                cycles: 27, hits: 16.98%
            ---------------------------              --------------------------
              __random_r random_r.c:360               __random_r random_r.c:360
              __random_r random_r.c:388               __random_r random_r.c:388
              __random_r random_r.c:388               __random_r random_r.c:388
              __random_r random_r.c:380               __random_r random_r.c:380
              __random_r random_r.c:357               __random_r random_r.c:357
                  __random random.c:293                   __random random.c:293
                  __random random.c:293                   __random random.c:293
                  __random random.c:291                   __random random.c:291
                  __random random.c:291                   __random random.c:291
                  __random random.c:291                   __random random.c:291
                  __random random.c:288                   __random random.c:288
                         rand rand.c:27                          rand rand.c:27
                         rand rand.c:26                          rand rand.c:26
                               rand@plt                                rand@plt
                               rand@plt                                rand@plt
                  compute_flag div.c:25                   compute_flag div.c:25
                  compute_flag div.c:22                   compute_flag div.c:22
                          main div.c:40                           main div.c:40
                          main div.c:40                           main div.c:40
                          main div.c:39                           main div.c:39
    
    hot chain pair 3:
                 cycles: 9, hits: 4.48%                  cycles: 6, hits: 4.51%
            ---------------------------              --------------------------
              __random_r random_r.c:360               __random_r random_r.c:360
              __random_r random_r.c:388               __random_r random_r.c:388
              __random_r random_r.c:388               __random_r random_r.c:388
              __random_r random_r.c:380               __random_r random_r.c:380
    
    [ Hot streams in old perf data only ]
    
    hot chain 1:
                cycles: 18, hits: 6.75%
             --------------------------
              __random_r random_r.c:360
              __random_r random_r.c:388
              __random_r random_r.c:388
              __random_r random_r.c:380
              __random_r random_r.c:357
                  __random random.c:293
                  __random random.c:293
                  __random random.c:291
                  __random random.c:291
                  __random random.c:291
                  __random random.c:288
                         rand rand.c:27
                         rand rand.c:26
                               rand@plt
                               rand@plt
                  compute_flag div.c:25
                  compute_flag div.c:22
                          main div.c:40
    
    hot chain 2:
                cycles: 29, hits: 2.78%
             --------------------------
                  compute_flag div.c:22
                          main div.c:40
                          main div.c:40
                          main div.c:39
    
    [ Hot streams in new perf data only ]
    
    hot chain 1:
                                                         cycles: 4, hits: 4.54%
                                                     --------------------------
                                                                  main div.c:42
                                                          compute_flag div.c:28
    
    hot chain 2:
                                                         cycles: 5, hits: 3.51%
                                                     --------------------------
                                                                  main div.c:39
                                                                  main div.c:44
                                                                  main div.c:42
                                                          compute_flag div.c:28
    Signed-off-by: default avatarJin Yao <yao.jin@linux.intel.com>
    Acked-by: default avatarJiri Olsa <jolsa@kernel.org>
    Link: https://lore.kernel.org/r/20201009022845.13141-8-yao.jin@linux.intel.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    2a09a84c
builtin-diff.c 46 KB