Skip to contentSkip to conversation

Linux API for writing z/VM APPLDATA Monitor records.

S390 Martin Schwidefsky 1 participant 1 message Sep 12, 2006 s390

lore
Share & tools
lore
#0 lore raw

From: Melissa Howland <[email protected]>

[S390] Linux API for writing z/VM APPLDATA Monitor records.

This patch delivers a new Linux API in the form of a misc char device that is useable from user space and allows write access to the z/VM APPLDATA Monitor Records collected by the *MONITOR System Service of z/VM.

---

 arch/s390/defconfig           |    1 
 drivers/s390/Kconfig          |    6 
 drivers/s390/char/Makefile    |    1 
 drivers/s390/char/monwriter.c |  288 ++++++++++++++++++++++++++++++++++++++++++
 include/asm-s390/Kbuild       |    2 
 include/asm-s390/monwriter.h  |   32 ++++
 6 files changed, 329 insertions(+), 1 deletion(-)
arch/s390/defconfig +1 -0
diff -urpN linux-2.6/arch/s390/defconfig linux-2.6-patched/arch/s390/defconfig
@@ -428,6 +428,7 @@ CONFIG_S390_TAPE_34XX=m
 # CONFIG_VMLOGRDR is not set
 # CONFIG_VMCP is not set
 # CONFIG_MONREADER is not set
+CONFIG_MONWRITER=m
 
 #
 # Cryptographic devices
drivers/s390/char/Makefile +1 -0
diff -urpN linux-2.6/drivers/s390/char/Makefile linux-2.6-patched/drivers/s390/char/Makefile
@@ -28,3 +28,4 @@ obj-$(CONFIG_S390_TAPE) += tape.o tape_c
 obj-$(CONFIG_S390_TAPE_34XX) += tape_34xx.o
 obj-$(CONFIG_S390_TAPE_3590) += tape_3590.o
 obj-$(CONFIG_MONREADER) += monreader.o
+obj-$(CONFIG_MONWRITER) += monwriter.o
drivers/s390/char/monwriter.c +288 -0

288 lines not on this page · raw message

drivers/s390/Kconfig +6 -0
diff -urpN linux-2.6/drivers/s390/Kconfig linux-2.6-patched/drivers/s390/Kconfig
@@ -213,6 +213,12 @@ config MONREADER
 	help
 	  Character device driver for reading z/VM monitor service records
 
+config MONWRITER
+	tristate "API for writing z/VM monitor service records"
+	default "m"
+	help
+	  Character device driver for writing z/VM monitor service records
+
 endmenu
 
 menu "Cryptographic devices"
include/asm-s390/Kbuild +1 -1
diff -urpN linux-2.6/include/asm-s390/Kbuild linux-2.6-patched/include/asm-s390/Kbuild
@@ -1,4 +1,4 @@
 include include/asm-generic/Kbuild.asm
 
 unifdef-y += cmb.h debug.h
-header-y += dasd.h qeth.h tape390.h ucontext.h vtoc.h z90crypt.h
+header-y += dasd.h monwriter.h qeth.h tape390.h ucontext.h vtoc.h z90crypt.h
include/asm-s390/monwriter.h +32 -0
diff -urpN linux-2.6/include/asm-s390/monwriter.h linux-2.6-patched/include/asm-s390/monwriter.h
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2004, 2005 IBM Corporation
+ * Character device driver for writing z/VM APPLDATA monitor records
+ * Version 1.0
+ * Author(s): Melissa Howland <[email protected]>
+ *
+ */
+
+/* mon_function values */
+#define MONWRITE_START_INTERVAL	0x00 /* start interval recording */
+#define MONWRITE_STOP_INTERVAL	0x01 /* stop interval or config recording */
+#define MONWRITE_GEN_EVENT	0x02 /* generate event record */
+#define MONWRITE_START_CONFIG	0x03 /* start configuration recording */
+
+
+/* the header the app uses in its write() data */
+struct monwrite_hdr {
+	unsigned char mon_function;
+	unsigned short applid;
+	unsigned char record_num;
+	unsigned short version;
+	unsigned short release;
+	unsigned short mod_level;
+	unsigned short datalen;
+	unsigned char hdrlen;
+
+} __attribute__((packed));
+
+#define MON_MAX_BUFS		255
+#define MONWRITE_MAX_DATALEN	4024
+#define MON_HDRLEN		sizeof(struct monwrite_hdr)
+#define MON_HDRLEN_MIN		13