linux/drivers/s390/cio/trace.h
Greg Kroah-Hartman b24413180f License cleanup: add SPDX GPL-2.0 license identifier to files with no license
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.

By default all files without license information are under the default
license of the kernel, which is GPL version 2.

Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier.  The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.

This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.

How this work was done:

Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
 - file had no licensing information it it.
 - file was a */uapi/* one with no licensing information in it,
 - file was a */uapi/* one with existing licensing information,

Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.

The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne.  Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.

The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed.  Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.

Criteria used to select files for SPDX license identifier tagging was:
 - Files considered eligible had to be source code files.
 - Make and config files were included as candidates if they contained >5
   lines of source
 - File already had some variant of a license header in it (even if <5
   lines).

All documentation files were explicitly excluded.

The following heuristics were used to determine which SPDX license
identifiers to apply.

 - when both scanners couldn't find any license traces, file was
   considered to have no license information in it, and the top level
   COPYING file license applied.

   For non */uapi/* files that summary was:

   SPDX license identifier                            # files
   ---------------------------------------------------|-------
   GPL-2.0                                              11139

   and resulted in the first patch in this series.

   If that file was a */uapi/* path one, it was "GPL-2.0 WITH
   Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:

   SPDX license identifier                            # files
   ---------------------------------------------------|-------
   GPL-2.0 WITH Linux-syscall-note                        930

   and resulted in the second patch in this series.

 - if a file had some form of licensing information in it, and was one
   of the */uapi/* ones, it was denoted with the Linux-syscall-note if
   any GPL family license was found in the file or had no licensing in
   it (per prior point).  Results summary:

   SPDX license identifier                            # files
   ---------------------------------------------------|------
   GPL-2.0 WITH Linux-syscall-note                       270
   GPL-2.0+ WITH Linux-syscall-note                      169
   ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
   ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
   LGPL-2.1+ WITH Linux-syscall-note                      15
   GPL-1.0+ WITH Linux-syscall-note                       14
   ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
   LGPL-2.0+ WITH Linux-syscall-note                       4
   LGPL-2.1 WITH Linux-syscall-note                        3
   ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
   ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1

   and that resulted in the third patch in this series.

 - when the two scanners agreed on the detected license(s), that became
   the concluded license(s).

 - when there was disagreement between the two scanners (one detected a
   license but the other didn't, or they both detected different
   licenses) a manual inspection of the file occurred.

 - In most cases a manual inspection of the information in the file
   resulted in a clear resolution of the license that should apply (and
   which scanner probably needed to revisit its heuristics).

 - When it was not immediately clear, the license identifier was
   confirmed with lawyers working with the Linux Foundation.

 - If there was any question as to the appropriate license identifier,
   the file was flagged for further research and to be revisited later
   in time.

In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.

Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights.  The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.

Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.

In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.

Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
 - a full scancode scan run, collecting the matched texts, detected
   license ids and scores
 - reviewing anything where there was a license detected (about 500+
   files) to ensure that the applied SPDX license was correct
 - reviewing anything where there was no detection but the patch license
   was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
   SPDX license was correct

This produced a worksheet with 20 files needing minor correction.  This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.

These .csv files were then reviewed by Greg.  Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected.  This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.)  Finally Greg ran the script using the .csv files to
generate the patches.

Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-02 11:10:55 +01:00

365 lines
9.4 KiB
C

/* SPDX-License-Identifier: GPL-2.0 */
/*
* Tracepoint header for the s390 Common I/O layer (CIO)
*
* Copyright IBM Corp. 2015
* Author(s): Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
*/
#include <linux/kernel.h>
#include <asm/crw.h>
#include <uapi/asm/chpid.h>
#include <uapi/asm/schid.h>
#include "cio.h"
#include "orb.h"
#undef TRACE_SYSTEM
#define TRACE_SYSTEM s390
#if !defined(_TRACE_S390_CIO_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_S390_CIO_H
#include <linux/tracepoint.h>
DECLARE_EVENT_CLASS(s390_class_schib,
TP_PROTO(struct subchannel_id schid, struct schib *schib, int cc),
TP_ARGS(schid, schib, cc),
TP_STRUCT__entry(
__field(u8, cssid)
__field(u8, ssid)
__field(u16, schno)
__field(u16, devno)
__field_struct(struct schib, schib)
__field(int, cc)
),
TP_fast_assign(
__entry->cssid = schid.cssid;
__entry->ssid = schid.ssid;
__entry->schno = schid.sch_no;
__entry->devno = schib->pmcw.dev;
__entry->schib = *schib;
__entry->cc = cc;
),
TP_printk("schid=%x.%x.%04x cc=%d ena=%d st=%d dnv=%d dev=%04x "
"lpm=0x%02x pnom=0x%02x lpum=0x%02x pim=0x%02x pam=0x%02x "
"pom=0x%02x chpids=%016llx",
__entry->cssid, __entry->ssid, __entry->schno, __entry->cc,
__entry->schib.pmcw.ena, __entry->schib.pmcw.st,
__entry->schib.pmcw.dnv, __entry->schib.pmcw.dev,
__entry->schib.pmcw.lpm, __entry->schib.pmcw.pnom,
__entry->schib.pmcw.lpum, __entry->schib.pmcw.pim,
__entry->schib.pmcw.pam, __entry->schib.pmcw.pom,
*((u64 *) __entry->schib.pmcw.chpid)
)
);
/**
* s390_cio_stsch - Store Subchannel instruction (STSCH) was performed
* @schid: Subchannel ID
* @schib: Subchannel-Information block
* @cc: Condition code
*/
DEFINE_EVENT(s390_class_schib, s390_cio_stsch,
TP_PROTO(struct subchannel_id schid, struct schib *schib, int cc),
TP_ARGS(schid, schib, cc)
);
/**
* s390_cio_msch - Modify Subchannel instruction (MSCH) was performed
* @schid: Subchannel ID
* @schib: Subchannel-Information block
* @cc: Condition code
*/
DEFINE_EVENT(s390_class_schib, s390_cio_msch,
TP_PROTO(struct subchannel_id schid, struct schib *schib, int cc),
TP_ARGS(schid, schib, cc)
);
/**
* s390_cio_tsch - Test Subchannel instruction (TSCH) was performed
* @schid: Subchannel ID
* @irb: Interruption-Response Block
* @cc: Condition code
*/
TRACE_EVENT(s390_cio_tsch,
TP_PROTO(struct subchannel_id schid, struct irb *irb, int cc),
TP_ARGS(schid, irb, cc),
TP_STRUCT__entry(
__field(u8, cssid)
__field(u8, ssid)
__field(u16, schno)
__field_struct(struct irb, irb)
__field(int, cc)
),
TP_fast_assign(
__entry->cssid = schid.cssid;
__entry->ssid = schid.ssid;
__entry->schno = schid.sch_no;
__entry->irb = *irb;
__entry->cc = cc;
),
TP_printk("schid=%x.%x.%04x cc=%d dcc=%d pno=%d fctl=0x%x actl=0x%x "
"stctl=0x%x dstat=0x%x cstat=0x%x",
__entry->cssid, __entry->ssid, __entry->schno, __entry->cc,
scsw_cc(&__entry->irb.scsw), scsw_pno(&__entry->irb.scsw),
scsw_fctl(&__entry->irb.scsw), scsw_actl(&__entry->irb.scsw),
scsw_stctl(&__entry->irb.scsw),
scsw_dstat(&__entry->irb.scsw), scsw_cstat(&__entry->irb.scsw)
)
);
/**
* s390_cio_tpi - Test Pending Interruption instruction (TPI) was performed
* @addr: Address of the I/O interruption code or %NULL
* @cc: Condition code
*/
TRACE_EVENT(s390_cio_tpi,
TP_PROTO(struct tpi_info *addr, int cc),
TP_ARGS(addr, cc),
TP_STRUCT__entry(
__field(int, cc)
__field_struct(struct tpi_info, tpi_info)
__field(u8, cssid)
__field(u8, ssid)
__field(u16, schno)
),
TP_fast_assign(
__entry->cc = cc;
if (cc != 0)
memset(&__entry->tpi_info, 0, sizeof(struct tpi_info));
else if (addr)
__entry->tpi_info = *addr;
else {
memcpy(&__entry->tpi_info, &S390_lowcore.subchannel_id,
sizeof(struct tpi_info));
}
__entry->cssid = __entry->tpi_info.schid.cssid;
__entry->ssid = __entry->tpi_info.schid.ssid;
__entry->schno = __entry->tpi_info.schid.sch_no;
),
TP_printk("schid=%x.%x.%04x cc=%d a=%d isc=%d type=%d",
__entry->cssid, __entry->ssid, __entry->schno, __entry->cc,
__entry->tpi_info.adapter_IO, __entry->tpi_info.isc,
__entry->tpi_info.type
)
);
/**
* s390_cio_ssch - Start Subchannel instruction (SSCH) was performed
* @schid: Subchannel ID
* @orb: Operation-Request Block
* @cc: Condition code
*/
TRACE_EVENT(s390_cio_ssch,
TP_PROTO(struct subchannel_id schid, union orb *orb, int cc),
TP_ARGS(schid, orb, cc),
TP_STRUCT__entry(
__field(u8, cssid)
__field(u8, ssid)
__field(u16, schno)
__field_struct(union orb, orb)
__field(int, cc)
),
TP_fast_assign(
__entry->cssid = schid.cssid;
__entry->ssid = schid.ssid;
__entry->schno = schid.sch_no;
__entry->orb = *orb;
__entry->cc = cc;
),
TP_printk("schid=%x.%x.%04x cc=%d", __entry->cssid, __entry->ssid,
__entry->schno, __entry->cc
)
);
DECLARE_EVENT_CLASS(s390_class_schid,
TP_PROTO(struct subchannel_id schid, int cc),
TP_ARGS(schid, cc),
TP_STRUCT__entry(
__field(u8, cssid)
__field(u8, ssid)
__field(u16, schno)
__field(int, cc)
),
TP_fast_assign(
__entry->cssid = schid.cssid;
__entry->ssid = schid.ssid;
__entry->schno = schid.sch_no;
__entry->cc = cc;
),
TP_printk("schid=%x.%x.%04x cc=%d", __entry->cssid, __entry->ssid,
__entry->schno, __entry->cc
)
);
/**
* s390_cio_csch - Clear Subchannel instruction (CSCH) was performed
* @schid: Subchannel ID
* @cc: Condition code
*/
DEFINE_EVENT(s390_class_schid, s390_cio_csch,
TP_PROTO(struct subchannel_id schid, int cc),
TP_ARGS(schid, cc)
);
/**
* s390_cio_hsch - Halt Subchannel instruction (HSCH) was performed
* @schid: Subchannel ID
* @cc: Condition code
*/
DEFINE_EVENT(s390_class_schid, s390_cio_hsch,
TP_PROTO(struct subchannel_id schid, int cc),
TP_ARGS(schid, cc)
);
/**
* s390_cio_xsch - Cancel Subchannel instruction (XSCH) was performed
* @schid: Subchannel ID
* @cc: Condition code
*/
DEFINE_EVENT(s390_class_schid, s390_cio_xsch,
TP_PROTO(struct subchannel_id schid, int cc),
TP_ARGS(schid, cc)
);
/**
* s390_cio_rsch - Resume Subchannel instruction (RSCH) was performed
* @schid: Subchannel ID
* @cc: Condition code
*/
DEFINE_EVENT(s390_class_schid, s390_cio_rsch,
TP_PROTO(struct subchannel_id schid, int cc),
TP_ARGS(schid, cc)
);
/**
* s390_cio_rchp - Reset Channel Path (RCHP) instruction was performed
* @chpid: Channel-Path Identifier
* @cc: Condition code
*/
TRACE_EVENT(s390_cio_rchp,
TP_PROTO(struct chp_id chpid, int cc),
TP_ARGS(chpid, cc),
TP_STRUCT__entry(
__field(u8, cssid)
__field(u8, id)
__field(int, cc)
),
TP_fast_assign(
__entry->cssid = chpid.cssid;
__entry->id = chpid.id;
__entry->cc = cc;
),
TP_printk("chpid=%x.%02x cc=%d", __entry->cssid, __entry->id,
__entry->cc
)
);
#define CHSC_MAX_REQUEST_LEN 64
#define CHSC_MAX_RESPONSE_LEN 64
/**
* s390_cio_chsc - Channel Subsystem Call (CHSC) instruction was performed
* @chsc: CHSC block
* @cc: Condition code
*/
TRACE_EVENT(s390_cio_chsc,
TP_PROTO(struct chsc_header *chsc, int cc),
TP_ARGS(chsc, cc),
TP_STRUCT__entry(
__field(int, cc)
__field(u16, code)
__field(u16, rcode)
__array(u8, request, CHSC_MAX_REQUEST_LEN)
__array(u8, response, CHSC_MAX_RESPONSE_LEN)
),
TP_fast_assign(
__entry->cc = cc;
__entry->code = chsc->code;
memcpy(&entry->request, chsc,
min_t(u16, chsc->length, CHSC_MAX_REQUEST_LEN));
chsc = (struct chsc_header *) ((char *) chsc + chsc->length);
__entry->rcode = chsc->code;
memcpy(&entry->response, chsc,
min_t(u16, chsc->length, CHSC_MAX_RESPONSE_LEN));
),
TP_printk("code=0x%04x cc=%d rcode=0x%04x", __entry->code,
__entry->cc, __entry->rcode)
);
/**
* s390_cio_interrupt - An I/O interrupt occurred
* @tpi_info: Address of the I/O interruption code
*/
TRACE_EVENT(s390_cio_interrupt,
TP_PROTO(struct tpi_info *tpi_info),
TP_ARGS(tpi_info),
TP_STRUCT__entry(
__field_struct(struct tpi_info, tpi_info)
__field(u8, cssid)
__field(u8, ssid)
__field(u16, schno)
),
TP_fast_assign(
__entry->tpi_info = *tpi_info;
__entry->cssid = __entry->tpi_info.schid.cssid;
__entry->ssid = __entry->tpi_info.schid.ssid;
__entry->schno = __entry->tpi_info.schid.sch_no;
),
TP_printk("schid=%x.%x.%04x isc=%d type=%d",
__entry->cssid, __entry->ssid, __entry->schno,
__entry->tpi_info.isc, __entry->tpi_info.type
)
);
/**
* s390_cio_adapter_int - An adapter interrupt occurred
* @tpi_info: Address of the I/O interruption code
*/
TRACE_EVENT(s390_cio_adapter_int,
TP_PROTO(struct tpi_info *tpi_info),
TP_ARGS(tpi_info),
TP_STRUCT__entry(
__field_struct(struct tpi_info, tpi_info)
),
TP_fast_assign(
__entry->tpi_info = *tpi_info;
),
TP_printk("isc=%d", __entry->tpi_info.isc)
);
/**
* s390_cio_stcrw - Store Channel Report Word (STCRW) was performed
* @crw: Channel Report Word
* @cc: Condition code
*/
TRACE_EVENT(s390_cio_stcrw,
TP_PROTO(struct crw *crw, int cc),
TP_ARGS(crw, cc),
TP_STRUCT__entry(
__field_struct(struct crw, crw)
__field(int, cc)
),
TP_fast_assign(
__entry->crw = *crw;
__entry->cc = cc;
),
TP_printk("cc=%d slct=%d oflw=%d chn=%d rsc=%d anc=%d erc=0x%x "
"rsid=0x%x",
__entry->cc, __entry->crw.slct, __entry->crw.oflw,
__entry->crw.chn, __entry->crw.rsc, __entry->crw.anc,
__entry->crw.erc, __entry->crw.rsid
)
);
#endif /* _TRACE_S390_CIO_H */
/* This part must be outside protection */
#undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH .
#undef TRACE_INCLUDE_FILE
#define TRACE_INCLUDE_FILE trace
#include <trace/define_trace.h>