Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1ec2772e authored by Martin Schwidefsky's avatar Martin Schwidefsky
Browse files

s390/diag: add a statistic for diagnose calls



Introduce /sys/debug/kernel/diag_stat with a statistic how many diagnose
calls have been done by each CPU in the system.

Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent acdc9fc9
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
#include <linux/string.h>
#include <linux/vmalloc.h>
#include <linux/mm.h>
#include <asm/diag.h>
#include <asm/ebcdic.h>
#include "hypfs.h"

@@ -336,7 +337,7 @@ static inline __u64 phys_cpu__ctidx(enum diag204_format type, void *hdr)

/* Diagnose 204 functions */

static int diag204(unsigned long subcode, unsigned long size, void *addr)
static inline int __diag204(unsigned long subcode, unsigned long size, void *addr)
{
	register unsigned long _subcode asm("0") = subcode;
	register unsigned long _size asm("1") = size;
@@ -351,6 +352,12 @@ static int diag204(unsigned long subcode, unsigned long size, void *addr)
	return _size;
}

static int diag204(unsigned long subcode, unsigned long size, void *addr)
{
	diag_stat_inc(DIAG_STAT_X204);
	return __diag204(subcode, size, addr);
}

/*
 * For the old diag subcode 4 with simple data format we have to use real
 * memory. If we use subcode 6 or 7 with extended data format, we can (and
@@ -505,6 +512,7 @@ static int diag224(void *ptr)
{
	int rc = -EOPNOTSUPP;

	diag_stat_inc(DIAG_STAT_X224);
	asm volatile(
		"	diag	%1,%2,0x224\n"
		"0:	lhi	%0,0x0\n"
+2 −0
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@

#include <linux/slab.h>
#include <linux/cpu.h>
#include <asm/diag.h>
#include <asm/hypfs.h>
#include "hypfs.h"

@@ -18,6 +19,7 @@
 */
static void diag0c(struct hypfs_diag0c_entry *entry)
{
	diag_stat_inc(DIAG_STAT_X00C);
	asm volatile (
		"	sam31\n"
		"	diag	%0,%0,0x0c\n"
+8 −1
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@
#include <linux/types.h>
#include <linux/uaccess.h>
#include <asm/compat.h>
#include <asm/diag.h>
#include <asm/sclp.h>
#include "hypfs.h"

@@ -22,7 +23,7 @@

#define DIAG304_CMD_MAX		2

static unsigned long hypfs_sprp_diag304(void *data, unsigned long cmd)
static inline unsigned long __hypfs_sprp_diag304(void *data, unsigned long cmd)
{
	register unsigned long _data asm("2") = (unsigned long) data;
	register unsigned long _rc asm("3");
@@ -34,6 +35,12 @@ static unsigned long hypfs_sprp_diag304(void *data, unsigned long cmd)
	return _rc;
}

static unsigned long hypfs_sprp_diag304(void *data, unsigned long cmd)
{
	diag_stat_inc(DIAG_STAT_X304);
	return __hypfs_sprp_diag304(data, cmd);
}

static void hypfs_sprp_free(const void *data)
{
	free_page((unsigned long) data);
+2 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/vmalloc.h>
#include <asm/diag.h>
#include <asm/ebcdic.h>
#include <asm/timex.h>
#include "hypfs.h"
@@ -66,6 +67,7 @@ static int diag2fc(int size, char* query, void *addr)
	memset(parm_list.aci_grp, 0x40, NAME_LEN);
	rc = -1;

	diag_stat_inc(DIAG_STAT_X2FC);
	asm volatile(
		"	diag    %0,%1,0x2fc\n"
		"0:\n"
+2 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@
#ifndef _ASM_S390_APPLDATA_H
#define _ASM_S390_APPLDATA_H

#include <asm/diag.h>
#include <asm/io.h>

#define APPLDATA_START_INTERVAL_REC	0x80
@@ -53,6 +54,7 @@ static inline int appldata_asm(struct appldata_product_id *id,
	parm_list.buffer_length = length;
	parm_list.product_id_addr = (unsigned long) id;
	parm_list.buffer_addr = virt_to_phys(buffer);
	diag_stat_inc(DIAG_STAT_X0DC);
	asm volatile(
		"	diag	%1,%0,0xdc"
		: "=d" (ry)
Loading