aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/xyarray.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2011-01-04 08:10:28 +0100
committerIngo Molnar <mingo@elte.hu>2011-01-04 08:10:28 +0100
commit928585536ff5a8f320e60efc60e2b7ef2a5f548d (patch)
tree5b12281a00ec049e8c35f1fb2810e111b22c90c0 /tools/perf/util/xyarray.h
parentcc2221969906a166a638aecdbae84a3d0462719e (diff)
parentd854861c4292a4e675a5d3bfd862c5f7421c81e8 (diff)
downloadkernel_samsung_smdk4412-928585536ff5a8f320e60efc60e2b7ef2a5f548d.zip
kernel_samsung_smdk4412-928585536ff5a8f320e60efc60e2b7ef2a5f548d.tar.gz
kernel_samsung_smdk4412-928585536ff5a8f320e60efc60e2b7ef2a5f548d.tar.bz2
Merge branch 'perf/test' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux-2.6 into perf/core
Diffstat (limited to 'tools/perf/util/xyarray.h')
-rw-r--r--tools/perf/util/xyarray.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/perf/util/xyarray.h b/tools/perf/util/xyarray.h
new file mode 100644
index 0000000..c488a07
--- /dev/null
+++ b/tools/perf/util/xyarray.h
@@ -0,0 +1,20 @@
+#ifndef _PERF_XYARRAY_H_
+#define _PERF_XYARRAY_H_ 1
+
+#include <sys/types.h>
+
+struct xyarray {
+ size_t row_size;
+ size_t entry_size;
+ char contents[];
+};
+
+struct xyarray *xyarray__new(int xlen, int ylen, size_t entry_size);
+void xyarray__delete(struct xyarray *xy);
+
+static inline void *xyarray__entry(struct xyarray *xy, int x, int y)
+{
+ return &xy->contents[x * xy->row_size + y * xy->entry_size];
+}
+
+#endif /* _PERF_XYARRAY_H_ */