Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1505017

[PATCH 02/52] perf c2c: Introduce c2c_add_stats function

From Arnaldo Carvalho de Melo <acme@kernel.org>
Newsgroups linux.kernel
Subject [PATCH 02/52] perf c2c: Introduce c2c_add_stats function
Date 2016-10-20 17:20 +0200
Message-ID <sunir-T1-51@gated-at.bofh.it> (permalink)
References <sun8J-Pf-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Jiri Olsa <jolsa@kernel.org>

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 | 30 ++++++++++++++++++++++++++++++
 tools/perf/util/mem-events.h |  1 +
 2 files changed, 31 insertions(+)

diff --git a/tools/perf/util/mem-events.c b/tools/perf/util/mem-events.c
index 502fcee91973..e50773286ef6 100644
--- a/tools/perf/util/mem-events.c
+++ b/tools/perf/util/mem-events.c
@@ -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;
+}
diff --git a/tools/perf/util/mem-events.h b/tools/perf/util/mem-events.h
index e111a2a2b18f..faf80403b519 100644
--- a/tools/perf/util/mem-events.h
+++ b/tools/perf/util/mem-events.h
@@ -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 */
-- 
2.7.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[GIT PULL 00/52] New Tool: perf c2c Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-10-20 17:20 +0200
  [PATCH 16/52] perf c2c report: Add hitm related dimension keys Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-10-20 17:20 +0200
  [PATCH 29/52] perf c2c report: Add 'node' sort key Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-10-20 17:20 +0200
  [PATCH 26/52] perf c2c report: Add 'pid' sort key Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-10-20 17:20 +0200
  [PATCH 02/52] perf c2c: Introduce c2c_add_stats function Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-10-20 17:20 +0200
  [PATCH 45/52] perf c2c report: Recalc width of global sort entries Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-10-20 17:20 +0200
  [PATCH 30/52] perf c2c report: Add stats related sort keys Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-10-20 17:20 +0200
  [PATCH 27/52] perf c2c report: Add 'tid' sort key Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-10-20 17:20 +0200
  [PATCH 50/52] perf c2c: Add man page and credits Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-10-20 17:20 +0200
  [PATCH 31/52] perf c2c report: Add 'cpucnt' sort key Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-10-20 17:20 +0200
  [PATCH 19/52] perf c2c report: Add llc and remote loads related dimension keys Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-10-20 17:20 +0200
  [PATCH 39/52] perf c2c report: Add shared cachelines stats stdio output Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-10-20 17:20 +0200
  [PATCH 10/52] perf c2c report: Add cacheline hists processing Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-10-20 17:20 +0200
  [PATCH 23/52] perf c2c report: Add hitm percent sort key Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-10-20 17:20 +0200
  [PATCH 05/52] perf c2c: Add report subcommand Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-10-20 17:20 +0200
  [PATCH 04/52] perf c2c: Add record subcommand Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-10-20 17:20 +0200
  [PATCH 15/52] perf c2c report: Add 'iaddr' dimension key Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-10-20 17:20 +0200
  Re: [GIT PULL 00/52] New Tool: perf c2c Kim Phillips <kim.phillips@arm.com> - 2016-10-21 01:10 +0200
    [PATCH] perf c2c report: Properly check data presence in rb_tree loop Jiri Olsa <jolsa@redhat.com> - 2016-10-21 02:20 +0200
      Re: [PATCH] perf c2c report: Properly check data presence in  rb_tree loop Kim Phillips <kim.phillips@arm.com> - 2016-10-21 21:30 +0200
      [tip:perf/core] perf c2c report: Add main TUI browser tip-bot for Jiri Olsa <tipbot@zytor.com> - 2016-10-22 11:00 +0200
    Re: [GIT PULL 00/52] New Tool: perf c2c Jiri Olsa <jolsa@redhat.com> - 2016-10-21 02:30 +0200
  Re: [GIT PULL 00/52] New Tool: perf c2c Ingo Molnar <mingo@kernel.org> - 2016-10-22 10:30 +0200
    Re: [GIT PULL 00/52] New Tool: perf c2c Jiri Olsa <jolsa@redhat.com> - 2016-10-23 13:10 +0200
      Re: [GIT PULL 00/52] New Tool: perf c2c Andi Kleen <andi@firstfloor.org> - 2016-10-24 01:50 +0200
        Re: [GIT PULL 00/52] New Tool: perf c2c Jiri Olsa <jolsa@redhat.com> - 2016-10-24 08:40 +0200
      Re: [GIT PULL 00/52] New Tool: perf c2c Ingo Molnar <mingo@kernel.org> - 2016-10-24 11:30 +0200
        Re: [GIT PULL 00/52] New Tool: perf c2c Jiri Olsa <jolsa@redhat.com> - 2016-10-24 11:50 +0200

csiph-web