Skip to contentSkip to conversation

selftests-add-test-of-pmu-instruction-counting-on-powerpc.patch removed from -mm tree

merged [email protected] 1 participant 1 message Aug 15, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Subject: [merged] selftests-add-test-of-pmu-instruction-counting-on-powerpc.patch removed from -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Thu, 15 Aug 2013 13:20:42 -0700

The patch titled
Subject: selftests: add test of PMU instruction counting on powerpc
has been removed from the -mm tree. Its filename was
selftests-add-test-of-pmu-instruction-counting-on-powerpc.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Michael Ellerman <[email protected]>
Subject: selftests: add test of PMU instruction counting on powerpc

Add a test of instruction counting using the PMU on powerpc.

Although the bulk of the code is architecture agnostic, the code needs to run a precisely sized loop which is implemented in assembler.

Cc Anton Blanchard <[email protected]>
Cc Jeremy Kerr <[email protected]>
Cc Michael Neuling <[email protected]>
Cc Benjamin Herrenschmidt <[email protected]>

---

 tools/testing/selftests/powerpc/Makefile                 |    2 
 tools/testing/selftests/powerpc/pmu/Makefile             |   23 +
 tools/testing/selftests/powerpc/pmu/count_instructions.c |  135 ++++++++++
 tools/testing/selftests/powerpc/pmu/event.c              |  105 +++++++
 tools/testing/selftests/powerpc/pmu/event.h              |   39 ++
 tools/testing/selftests/powerpc/pmu/loop.S               |   46 +++
 6 files changed, 349 insertions(+), 1 deletion(-)
tools/testing/selftests/powerpc/Makefile renamed from tools/testing/selftests/powerpc/Makefile~selftests-add-test-of-pmu-instruction-counting-on-powerpc +1 -1
diff -puN tools/testing/selftests/powerpc/Makefile~selftests-add-test-of-pmu-instruction-counting-on-powerpc tools/testing/selftests/powerpc/Makefile
@@ -13,7 +13,7 @@ CFLAGS := -Wall -O2 -flto -Wall -Werror
 
 export CC CFLAGS
 
-TARGETS =
+TARGETS = pmu
 
 endif
 
tools/testing/selftests/powerpc/pmu/Makefile new file +23 -0
diff -puN /dev/null tools/testing/selftests/powerpc/pmu/Makefile
@@ -0,0 +1,23 @@
+noarg:
+	$(MAKE) -C ../
+
+PROGS := count_instructions
+EXTRA_SOURCES := ../harness.c event.c
+
+all: $(PROGS)
+
+$(PROGS): $(EXTRA_SOURCES)
+
+# loop.S can only be built 64-bit
+count_instructions: loop.S count_instructions.c $(EXTRA_SOURCES)
+	$(CC) $(CFLAGS) -m64 -o $@ $^
+
+run_tests: all
+	@-for PROG in $(PROGS); do \
+		./$$PROG; \
+	done;
+
+clean:
+	rm -f $(PROGS) loop.o
+
+.PHONY: all run_tests clean
tools/testing/selftests/powerpc/pmu/count_instructions.c new file +135 -0

135 lines not on this page · raw message

tools/testing/selftests/powerpc/pmu/event.c new file +105 -0

105 lines not on this page · raw message

tools/testing/selftests/powerpc/pmu/event.h new file +39 -0
diff -puN /dev/null tools/testing/selftests/powerpc/pmu/event.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2013, Michael Ellerman, IBM Corp.
+ * Licensed under GPLv2.
+ */
+
+#ifndef _SELFTESTS_POWERPC_PMU_EVENT_H
+#define _SELFTESTS_POWERPC_PMU_EVENT_H
+
+#include <unistd.h>
+#include <linux/perf_event.h>
+
+#include "utils.h"
+
+
+struct event {
+	struct perf_event_attr attr;
+	char *name;
+	int fd;
+	/* This must match the read_format we use */
+	struct {
+		u64 value;
+		u64 running;
+		u64 enabled;
+	} result;
+};
+
+void event_init(struct event *e, u64 config);
+void event_init_named(struct event *e, u64 config, char *name);
+void event_init_opts(struct event *e, u64 config, int type, char *name);
+int event_open_with_options(struct event *e, pid_t pid, int cpu, int group_fd);
+int event_open_with_group(struct event *e, int group_fd);
+int event_open(struct event *e);
+void event_close(struct event *e);
+int event_reset(struct event *e);
+int event_read(struct event *e);
+void event_report_justified(struct event *e, int name_width, int result_width);
+void event_report(struct event *e);
+
+#endif /* _SELFTESTS_POWERPC_PMU_EVENT_H */
tools/testing/selftests/powerpc/pmu/loop.S new file +46 -0

46 lines not on this page · raw message

_

Patches currently in -mm which might be from [email protected] are

linux-next.patch