perf c2c: Introduce c2c_add_stats function
authorJiri Olsa <jolsa@kernel.org>
Thu, 22 Sep 2016 15:36:31 +0000 (17:36 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 19 Oct 2016 16:18:31 +0000 (13:18 -0300)
Introducing c2c_add_stats function helper to cumulate c2c_stats.

Original-patch-by: Dick Fowles <rfowles@redhat.com>
Original-patch-by: Don Zickus <dzickus@redhat.com>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Joe Mario <jmario@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1474558645-19956-4-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/mem-events.c
tools/perf/util/mem-events.h

index 502fcee919736e9ebdf017a262779b86e1ffce77..e50773286ef62d46495fbc479c76c65ac9bebafb 100644 (file)
@@ -366,3 +366,33 @@ int c2c_decode_stats(struct c2c_stats *stats, struct mem_info *mi)
 #undef P
        return err;
 }
+
+void c2c_add_stats(struct c2c_stats *stats, struct c2c_stats *add)
+{
+       stats->nr_entries       += add->nr_entries;
+
+       stats->locks            += add->locks;
+       stats->store            += add->store;
+       stats->st_uncache       += add->st_uncache;
+       stats->st_noadrs        += add->st_noadrs;
+       stats->st_l1hit         += add->st_l1hit;
+       stats->st_l1miss        += add->st_l1miss;
+       stats->load             += add->load;
+       stats->ld_excl          += add->ld_excl;
+       stats->ld_shared        += add->ld_shared;
+       stats->ld_uncache       += add->ld_uncache;
+       stats->ld_io            += add->ld_io;
+       stats->ld_miss          += add->ld_miss;
+       stats->ld_noadrs        += add->ld_noadrs;
+       stats->ld_fbhit         += add->ld_fbhit;
+       stats->ld_l1hit         += add->ld_l1hit;
+       stats->ld_l2hit         += add->ld_l2hit;
+       stats->ld_llchit        += add->ld_llchit;
+       stats->lcl_hitm         += add->lcl_hitm;
+       stats->rmt_hitm         += add->rmt_hitm;
+       stats->rmt_hit          += add->rmt_hit;
+       stats->lcl_dram         += add->lcl_dram;
+       stats->rmt_dram         += add->rmt_dram;
+       stats->nomap            += add->nomap;
+       stats->noparse          += add->noparse;
+}
index e111a2a2b18f78cf9d0c36a2e7b4fd27ca1f9c7d..faf80403b51945f8184564bc7c1bfbef1f227236 100644 (file)
@@ -68,5 +68,6 @@ struct c2c_stats {
 
 struct hist_entry;
 int c2c_decode_stats(struct c2c_stats *stats, struct mem_info *mi);
+void c2c_add_stats(struct c2c_stats *stats, struct c2c_stats *add);
 
 #endif /* __PERF_MEM_EVENTS_H */