Skip to contentSkip to conversation

2.6.17-rc6 perfmon2 patch for review: new generic files

PATCH In review Stephane Eranian 1 participant 1 message Jun 15, 2006 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 10/16 2.6.17-rc6 perfmon2 patch for review: new generic files

This patch contains the new generic files.

lib/carta_random32.c +29 -0
@@ -0,0 +1,29 @@
+/*
+ * Fast, simple, yet decent quality random number generator based on
+ * a paper by David G. Carta ("Two Fast Implementations of the
+ * `Minimal Standard' Random Number Generator," Communications of the
+ * ACM, January, 1990).
+ *
+ * Copyright (c) 2002-2005 Hewlett-Packard Development Company, L.P.
+ *	Contributed by David Mosberger-Tang <[email protected]>
+ */
+#include <linux/types.h>
+#include <linux/module.h>
+#include <linux/perfmon.h>
+
+#ifndef __HAVE_ARCH_CARTA_RANDOM32
+u64 carta_random32 (u64 seed)
+{
+#       define A 16807
+#       define M ((u32) 1 << 31)
+        u64 s, prod = A * seed, p, q;
+
+        p = (prod >> 31) & (M - 1);
+        q = (prod >>  0) & (M - 1);
+        s = p + q;
+        if (s >= M)
+                s -= M - 1;
+        return s;
+}
+EXPORT_SYMBOL(carta_random32);
+#endif
perfmon/Makefile +7 -0
@@ -0,0 +1,7 @@
+#
+# Copyright (c) 2005-2006 Hewlett-Packard Development Company, L.P.
+# Contributed by Stephane Eranian <[email protected]>
+#
+obj-$(CONFIG_PERFMON) = perfmon.o perfmon_res.o perfmon_fmt.o perfmon_pmu.o \
+   perfmon_sysfs.o perfmon_syscalls.o perfmon_file.o perfmon_ctxsw.o \
+   perfmon_intr.o perfmon_dfl_smpl.o perfmon_kapi.o perfmon_sets.o
perfmon/perfmon.c +2571 -0

2,571 lines not on this page · raw message

perfmon/perfmon_ctxsw.c +381 -0

381 lines not on this page · raw message

perfmon/perfmon_pmu.c +419 -0

12 lines not on this page · raw message

perfmon/perfmon_res.c +278 -0

278 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.