summaryrefslogtreecommitdiff
path: root/tools/perf/util/xyarray.c
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2017-08-11 16:26:16 -0700
committerArnaldo Carvalho de Melo <acme@redhat.com>2017-08-22 11:51:28 -0300
commitd74be47673676eded2f0bb8274e752bed32c42d8 (patch)
tree2711d906813ca52a32d2595b6f55fd27704fc529 /tools/perf/util/xyarray.c
parentba63f76e22ee723819c8cec86b31f7ea3182b2ed (diff)
perf xyarray: Save max_x, max_y
Save the original array dimensions in xyarrays, so that users can retrieve them later. Add some inline functions to access these fields. Signed-off-by: Andi Kleen <ak@linux.intel.com> Acked-by: Jiri Olsa <jolsa@kernel.org> Link: http://lkml.kernel.org/r/20170811232634.30465-1-andi@firstfloor.org [ As noticed by Jiri, fix up namespacing: xy__method() -> xyarray__method() ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/xyarray.c')
-rw-r--r--tools/perf/util/xyarray.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/perf/util/xyarray.c b/tools/perf/util/xyarray.c
index 7251fdbabced..c8f415d9877b 100644
--- a/tools/perf/util/xyarray.c
+++ b/tools/perf/util/xyarray.c
@@ -12,6 +12,8 @@ struct xyarray *xyarray__new(int xlen, int ylen, size_t entry_size)
xy->entry_size = entry_size;
xy->row_size = row_size;
xy->entries = xlen * ylen;
+ xy->max_x = xlen;
+ xy->max_y = ylen;
}
return xy;