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-01 17:07:57 +03:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2012-01-20 23:52:23 +04:00
|
|
|
#undef TRACE_SYSTEM
|
|
|
|
#define TRACE_SYSTEM sunrpc
|
|
|
|
|
|
|
|
#if !defined(_TRACE_SUNRPC_H) || defined(TRACE_HEADER_MULTI_READ)
|
|
|
|
#define _TRACE_SUNRPC_H
|
|
|
|
|
|
|
|
#include <linux/sunrpc/sched.h>
|
|
|
|
#include <linux/sunrpc/clnt.h>
|
2014-10-28 21:24:12 +03:00
|
|
|
#include <linux/sunrpc/svc.h>
|
2014-10-28 21:24:14 +03:00
|
|
|
#include <linux/sunrpc/xprtsock.h>
|
2014-11-21 22:19:31 +03:00
|
|
|
#include <linux/sunrpc/svc_xprt.h>
|
2013-09-04 20:16:23 +04:00
|
|
|
#include <net/tcp_states.h>
|
|
|
|
#include <linux/net.h>
|
2012-01-20 23:52:23 +04:00
|
|
|
#include <linux/tracepoint.h>
|
|
|
|
|
2012-02-06 19:08:08 +04:00
|
|
|
DECLARE_EVENT_CLASS(rpc_task_status,
|
|
|
|
|
|
|
|
TP_PROTO(struct rpc_task *task),
|
|
|
|
|
|
|
|
TP_ARGS(task),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2013-09-05 06:09:50 +04:00
|
|
|
__field(unsigned int, task_id)
|
|
|
|
__field(unsigned int, client_id)
|
2012-02-06 19:08:08 +04:00
|
|
|
__field(int, status)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2013-09-05 06:09:50 +04:00
|
|
|
__entry->task_id = task->tk_pid;
|
|
|
|
__entry->client_id = task->tk_client->cl_clid;
|
2012-02-06 19:08:08 +04:00
|
|
|
__entry->status = task->tk_status;
|
|
|
|
),
|
|
|
|
|
2018-01-03 23:38:33 +03:00
|
|
|
TP_printk("task:%u@%u status=%d",
|
2013-09-05 06:09:50 +04:00
|
|
|
__entry->task_id, __entry->client_id,
|
|
|
|
__entry->status)
|
2012-02-06 19:08:08 +04:00
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(rpc_task_status, rpc_call_status,
|
|
|
|
TP_PROTO(struct rpc_task *task),
|
|
|
|
|
|
|
|
TP_ARGS(task)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(rpc_task_status, rpc_bind_status,
|
|
|
|
TP_PROTO(struct rpc_task *task),
|
|
|
|
|
|
|
|
TP_ARGS(task)
|
|
|
|
);
|
|
|
|
|
|
|
|
TRACE_EVENT(rpc_connect_status,
|
2018-03-16 17:33:44 +03:00
|
|
|
TP_PROTO(const struct rpc_task *task),
|
2012-02-06 19:08:08 +04:00
|
|
|
|
2018-03-16 17:33:44 +03:00
|
|
|
TP_ARGS(task),
|
2012-02-06 19:08:08 +04:00
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2013-09-05 06:09:50 +04:00
|
|
|
__field(unsigned int, task_id)
|
|
|
|
__field(unsigned int, client_id)
|
2012-02-06 19:08:08 +04:00
|
|
|
__field(int, status)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2013-09-05 06:09:50 +04:00
|
|
|
__entry->task_id = task->tk_pid;
|
|
|
|
__entry->client_id = task->tk_client->cl_clid;
|
2018-03-16 17:33:44 +03:00
|
|
|
__entry->status = task->tk_status;
|
2012-02-06 19:08:08 +04:00
|
|
|
),
|
|
|
|
|
2018-01-03 23:38:33 +03:00
|
|
|
TP_printk("task:%u@%u status=%d",
|
2013-09-05 06:09:50 +04:00
|
|
|
__entry->task_id, __entry->client_id,
|
|
|
|
__entry->status)
|
2012-02-06 19:08:08 +04:00
|
|
|
);
|
|
|
|
|
2017-11-03 20:46:14 +03:00
|
|
|
TRACE_EVENT(rpc_request,
|
|
|
|
TP_PROTO(const struct rpc_task *task),
|
|
|
|
|
|
|
|
TP_ARGS(task),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(unsigned int, task_id)
|
|
|
|
__field(unsigned int, client_id)
|
|
|
|
__field(int, version)
|
|
|
|
__field(bool, async)
|
|
|
|
__string(progname, task->tk_client->cl_program->name)
|
|
|
|
__string(procname, rpc_proc_name(task))
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->task_id = task->tk_pid;
|
|
|
|
__entry->client_id = task->tk_client->cl_clid;
|
|
|
|
__entry->version = task->tk_client->cl_vers;
|
|
|
|
__entry->async = RPC_IS_ASYNC(task);
|
|
|
|
__assign_str(progname, task->tk_client->cl_program->name)
|
|
|
|
__assign_str(procname, rpc_proc_name(task))
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("task:%u@%u %sv%d %s (%ssync)",
|
|
|
|
__entry->task_id, __entry->client_id,
|
|
|
|
__get_str(progname), __entry->version,
|
|
|
|
__get_str(procname), __entry->async ? "a": ""
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2012-01-20 23:52:23 +04:00
|
|
|
DECLARE_EVENT_CLASS(rpc_task_running,
|
|
|
|
|
2018-03-16 17:33:44 +03:00
|
|
|
TP_PROTO(const struct rpc_task *task, const void *action),
|
2012-01-20 23:52:23 +04:00
|
|
|
|
2018-03-16 17:33:44 +03:00
|
|
|
TP_ARGS(task, action),
|
2012-01-20 23:52:23 +04:00
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2013-09-05 06:09:50 +04:00
|
|
|
__field(unsigned int, task_id)
|
|
|
|
__field(unsigned int, client_id)
|
2012-01-20 23:52:23 +04:00
|
|
|
__field(const void *, action)
|
|
|
|
__field(unsigned long, runstate)
|
|
|
|
__field(int, status)
|
|
|
|
__field(unsigned short, flags)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2018-03-16 17:33:44 +03:00
|
|
|
__entry->client_id = task->tk_client ?
|
|
|
|
task->tk_client->cl_clid : -1;
|
2013-09-05 06:09:50 +04:00
|
|
|
__entry->task_id = task->tk_pid;
|
2012-01-20 23:52:23 +04:00
|
|
|
__entry->action = action;
|
|
|
|
__entry->runstate = task->tk_runstate;
|
|
|
|
__entry->status = task->tk_status;
|
|
|
|
__entry->flags = task->tk_flags;
|
|
|
|
),
|
|
|
|
|
2014-03-07 09:27:57 +04:00
|
|
|
TP_printk("task:%u@%d flags=%4.4x state=%4.4lx status=%d action=%pf",
|
2013-09-05 06:09:50 +04:00
|
|
|
__entry->task_id, __entry->client_id,
|
2012-01-20 23:52:23 +04:00
|
|
|
__entry->flags,
|
|
|
|
__entry->runstate,
|
|
|
|
__entry->status,
|
|
|
|
__entry->action
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(rpc_task_running, rpc_task_begin,
|
|
|
|
|
2018-03-16 17:33:44 +03:00
|
|
|
TP_PROTO(const struct rpc_task *task, const void *action),
|
2012-01-20 23:52:23 +04:00
|
|
|
|
2018-03-16 17:33:44 +03:00
|
|
|
TP_ARGS(task, action)
|
2012-01-20 23:52:23 +04:00
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(rpc_task_running, rpc_task_run_action,
|
|
|
|
|
2018-03-16 17:33:44 +03:00
|
|
|
TP_PROTO(const struct rpc_task *task, const void *action),
|
2012-01-20 23:52:23 +04:00
|
|
|
|
2018-03-16 17:33:44 +03:00
|
|
|
TP_ARGS(task, action)
|
2012-01-20 23:52:23 +04:00
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(rpc_task_running, rpc_task_complete,
|
|
|
|
|
2018-03-16 17:33:44 +03:00
|
|
|
TP_PROTO(const struct rpc_task *task, const void *action),
|
2012-01-20 23:52:23 +04:00
|
|
|
|
2018-03-16 17:33:44 +03:00
|
|
|
TP_ARGS(task, action)
|
2012-01-20 23:52:23 +04:00
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
DECLARE_EVENT_CLASS(rpc_task_queued,
|
|
|
|
|
2018-03-16 17:33:44 +03:00
|
|
|
TP_PROTO(const struct rpc_task *task, const struct rpc_wait_queue *q),
|
2012-01-20 23:52:23 +04:00
|
|
|
|
2018-03-16 17:33:44 +03:00
|
|
|
TP_ARGS(task, q),
|
2012-01-20 23:52:23 +04:00
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2013-09-05 06:09:50 +04:00
|
|
|
__field(unsigned int, task_id)
|
|
|
|
__field(unsigned int, client_id)
|
2012-01-20 23:52:23 +04:00
|
|
|
__field(unsigned long, timeout)
|
|
|
|
__field(unsigned long, runstate)
|
|
|
|
__field(int, status)
|
|
|
|
__field(unsigned short, flags)
|
2012-02-06 19:31:35 +04:00
|
|
|
__string(q_name, rpc_qname(q))
|
2012-01-20 23:52:23 +04:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2018-03-16 17:33:44 +03:00
|
|
|
__entry->client_id = task->tk_client ?
|
|
|
|
task->tk_client->cl_clid : -1;
|
2013-09-05 06:09:50 +04:00
|
|
|
__entry->task_id = task->tk_pid;
|
2012-01-20 23:52:23 +04:00
|
|
|
__entry->timeout = task->tk_timeout;
|
|
|
|
__entry->runstate = task->tk_runstate;
|
|
|
|
__entry->status = task->tk_status;
|
|
|
|
__entry->flags = task->tk_flags;
|
2012-02-06 19:31:35 +04:00
|
|
|
__assign_str(q_name, rpc_qname(q));
|
2012-01-20 23:52:23 +04:00
|
|
|
),
|
|
|
|
|
2018-01-23 17:32:35 +03:00
|
|
|
TP_printk("task:%u@%d flags=%4.4x state=%4.4lx status=%d timeout=%lu queue=%s",
|
2013-09-05 06:09:50 +04:00
|
|
|
__entry->task_id, __entry->client_id,
|
2012-01-20 23:52:23 +04:00
|
|
|
__entry->flags,
|
|
|
|
__entry->runstate,
|
|
|
|
__entry->status,
|
|
|
|
__entry->timeout,
|
2012-02-06 19:31:35 +04:00
|
|
|
__get_str(q_name)
|
2012-01-20 23:52:23 +04:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(rpc_task_queued, rpc_task_sleep,
|
|
|
|
|
2018-03-16 17:33:44 +03:00
|
|
|
TP_PROTO(const struct rpc_task *task, const struct rpc_wait_queue *q),
|
2012-01-20 23:52:23 +04:00
|
|
|
|
2018-03-16 17:33:44 +03:00
|
|
|
TP_ARGS(task, q)
|
2012-01-20 23:52:23 +04:00
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(rpc_task_queued, rpc_task_wakeup,
|
|
|
|
|
2018-03-16 17:33:44 +03:00
|
|
|
TP_PROTO(const struct rpc_task *task, const struct rpc_wait_queue *q),
|
2012-01-20 23:52:23 +04:00
|
|
|
|
2018-03-16 17:33:44 +03:00
|
|
|
TP_ARGS(task, q)
|
2012-01-20 23:52:23 +04:00
|
|
|
|
|
|
|
);
|
|
|
|
|
2018-03-16 17:33:49 +03:00
|
|
|
TRACE_EVENT(rpc_stats_latency,
|
|
|
|
|
|
|
|
TP_PROTO(
|
|
|
|
const struct rpc_task *task,
|
|
|
|
ktime_t backlog,
|
|
|
|
ktime_t rtt,
|
|
|
|
ktime_t execute
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(task, backlog, rtt, execute),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(u32, xid)
|
|
|
|
__field(int, version)
|
|
|
|
__string(progname, task->tk_client->cl_program->name)
|
|
|
|
__string(procname, rpc_proc_name(task))
|
|
|
|
__field(unsigned long, backlog)
|
|
|
|
__field(unsigned long, rtt)
|
|
|
|
__field(unsigned long, execute)
|
|
|
|
__string(addr,
|
|
|
|
task->tk_xprt->address_strings[RPC_DISPLAY_ADDR])
|
|
|
|
__string(port,
|
|
|
|
task->tk_xprt->address_strings[RPC_DISPLAY_PORT])
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->xid = be32_to_cpu(task->tk_rqstp->rq_xid);
|
|
|
|
__entry->version = task->tk_client->cl_vers;
|
|
|
|
__assign_str(progname, task->tk_client->cl_program->name)
|
|
|
|
__assign_str(procname, rpc_proc_name(task))
|
|
|
|
__entry->backlog = ktime_to_us(backlog);
|
|
|
|
__entry->rtt = ktime_to_us(rtt);
|
|
|
|
__entry->execute = ktime_to_us(execute);
|
|
|
|
__assign_str(addr,
|
|
|
|
task->tk_xprt->address_strings[RPC_DISPLAY_ADDR]);
|
|
|
|
__assign_str(port,
|
|
|
|
task->tk_xprt->address_strings[RPC_DISPLAY_PORT]);
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("peer=[%s]:%s xid=0x%08x %sv%d %s backlog=%lu rtt=%lu execute=%lu",
|
|
|
|
__get_str(addr), __get_str(port), __entry->xid,
|
|
|
|
__get_str(progname), __entry->version, __get_str(procname),
|
|
|
|
__entry->backlog, __entry->rtt, __entry->execute)
|
|
|
|
);
|
|
|
|
|
2015-03-27 23:53:03 +03:00
|
|
|
/*
|
|
|
|
* First define the enums in the below macros to be exported to userspace
|
|
|
|
* via TRACE_DEFINE_ENUM().
|
|
|
|
*/
|
|
|
|
#undef EM
|
|
|
|
#undef EMe
|
|
|
|
#define EM(a, b) TRACE_DEFINE_ENUM(a);
|
|
|
|
#define EMe(a, b) TRACE_DEFINE_ENUM(a);
|
|
|
|
|
|
|
|
#define RPC_SHOW_SOCKET \
|
|
|
|
EM( SS_FREE, "FREE" ) \
|
|
|
|
EM( SS_UNCONNECTED, "UNCONNECTED" ) \
|
|
|
|
EM( SS_CONNECTING, "CONNECTING," ) \
|
|
|
|
EM( SS_CONNECTED, "CONNECTED," ) \
|
|
|
|
EMe(SS_DISCONNECTING, "DISCONNECTING" )
|
|
|
|
|
2013-09-04 20:16:23 +04:00
|
|
|
#define rpc_show_socket_state(state) \
|
2015-03-27 23:53:03 +03:00
|
|
|
__print_symbolic(state, RPC_SHOW_SOCKET)
|
|
|
|
|
|
|
|
RPC_SHOW_SOCKET
|
|
|
|
|
|
|
|
#define RPC_SHOW_SOCK \
|
|
|
|
EM( TCP_ESTABLISHED, "ESTABLISHED" ) \
|
|
|
|
EM( TCP_SYN_SENT, "SYN_SENT" ) \
|
|
|
|
EM( TCP_SYN_RECV, "SYN_RECV" ) \
|
|
|
|
EM( TCP_FIN_WAIT1, "FIN_WAIT1" ) \
|
|
|
|
EM( TCP_FIN_WAIT2, "FIN_WAIT2" ) \
|
|
|
|
EM( TCP_TIME_WAIT, "TIME_WAIT" ) \
|
|
|
|
EM( TCP_CLOSE, "CLOSE" ) \
|
|
|
|
EM( TCP_CLOSE_WAIT, "CLOSE_WAIT" ) \
|
|
|
|
EM( TCP_LAST_ACK, "LAST_ACK" ) \
|
|
|
|
EM( TCP_LISTEN, "LISTEN" ) \
|
|
|
|
EMe( TCP_CLOSING, "CLOSING" )
|
2013-09-04 20:16:23 +04:00
|
|
|
|
|
|
|
#define rpc_show_sock_state(state) \
|
2015-03-27 23:53:03 +03:00
|
|
|
__print_symbolic(state, RPC_SHOW_SOCK)
|
|
|
|
|
|
|
|
RPC_SHOW_SOCK
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Now redefine the EM() and EMe() macros to map the enums to the strings
|
|
|
|
* that will be printed in the output.
|
|
|
|
*/
|
|
|
|
#undef EM
|
|
|
|
#undef EMe
|
|
|
|
#define EM(a, b) {a, b},
|
|
|
|
#define EMe(a, b) {a, b}
|
2013-09-04 20:16:23 +04:00
|
|
|
|
|
|
|
DECLARE_EVENT_CLASS(xs_socket_event,
|
|
|
|
|
|
|
|
TP_PROTO(
|
|
|
|
struct rpc_xprt *xprt,
|
|
|
|
struct socket *socket
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(xprt, socket),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(unsigned int, socket_state)
|
|
|
|
__field(unsigned int, sock_state)
|
|
|
|
__field(unsigned long long, ino)
|
|
|
|
__string(dstaddr,
|
|
|
|
xprt->address_strings[RPC_DISPLAY_ADDR])
|
|
|
|
__string(dstport,
|
|
|
|
xprt->address_strings[RPC_DISPLAY_PORT])
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
struct inode *inode = SOCK_INODE(socket);
|
|
|
|
__entry->socket_state = socket->state;
|
|
|
|
__entry->sock_state = socket->sk->sk_state;
|
|
|
|
__entry->ino = (unsigned long long)inode->i_ino;
|
|
|
|
__assign_str(dstaddr,
|
|
|
|
xprt->address_strings[RPC_DISPLAY_ADDR]);
|
|
|
|
__assign_str(dstport,
|
|
|
|
xprt->address_strings[RPC_DISPLAY_PORT]);
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
|
|
|
"socket:[%llu] dstaddr=%s/%s "
|
|
|
|
"state=%u (%s) sk_state=%u (%s)",
|
|
|
|
__entry->ino, __get_str(dstaddr), __get_str(dstport),
|
|
|
|
__entry->socket_state,
|
|
|
|
rpc_show_socket_state(__entry->socket_state),
|
|
|
|
__entry->sock_state,
|
|
|
|
rpc_show_sock_state(__entry->sock_state)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
#define DEFINE_RPC_SOCKET_EVENT(name) \
|
|
|
|
DEFINE_EVENT(xs_socket_event, name, \
|
|
|
|
TP_PROTO( \
|
|
|
|
struct rpc_xprt *xprt, \
|
|
|
|
struct socket *socket \
|
|
|
|
), \
|
|
|
|
TP_ARGS(xprt, socket))
|
|
|
|
|
|
|
|
DECLARE_EVENT_CLASS(xs_socket_event_done,
|
|
|
|
|
|
|
|
TP_PROTO(
|
|
|
|
struct rpc_xprt *xprt,
|
|
|
|
struct socket *socket,
|
|
|
|
int error
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_ARGS(xprt, socket, error),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(int, error)
|
|
|
|
__field(unsigned int, socket_state)
|
|
|
|
__field(unsigned int, sock_state)
|
|
|
|
__field(unsigned long long, ino)
|
|
|
|
__string(dstaddr,
|
|
|
|
xprt->address_strings[RPC_DISPLAY_ADDR])
|
|
|
|
__string(dstport,
|
|
|
|
xprt->address_strings[RPC_DISPLAY_PORT])
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
struct inode *inode = SOCK_INODE(socket);
|
|
|
|
__entry->socket_state = socket->state;
|
|
|
|
__entry->sock_state = socket->sk->sk_state;
|
|
|
|
__entry->ino = (unsigned long long)inode->i_ino;
|
|
|
|
__entry->error = error;
|
|
|
|
__assign_str(dstaddr,
|
|
|
|
xprt->address_strings[RPC_DISPLAY_ADDR]);
|
|
|
|
__assign_str(dstport,
|
|
|
|
xprt->address_strings[RPC_DISPLAY_PORT]);
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk(
|
|
|
|
"error=%d socket:[%llu] dstaddr=%s/%s "
|
|
|
|
"state=%u (%s) sk_state=%u (%s)",
|
|
|
|
__entry->error,
|
|
|
|
__entry->ino, __get_str(dstaddr), __get_str(dstport),
|
|
|
|
__entry->socket_state,
|
|
|
|
rpc_show_socket_state(__entry->socket_state),
|
|
|
|
__entry->sock_state,
|
|
|
|
rpc_show_sock_state(__entry->sock_state)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
#define DEFINE_RPC_SOCKET_EVENT_DONE(name) \
|
|
|
|
DEFINE_EVENT(xs_socket_event_done, name, \
|
|
|
|
TP_PROTO( \
|
|
|
|
struct rpc_xprt *xprt, \
|
|
|
|
struct socket *socket, \
|
|
|
|
int error \
|
|
|
|
), \
|
|
|
|
TP_ARGS(xprt, socket, error))
|
|
|
|
|
|
|
|
DEFINE_RPC_SOCKET_EVENT(rpc_socket_state_change);
|
|
|
|
DEFINE_RPC_SOCKET_EVENT_DONE(rpc_socket_connect);
|
2013-12-31 22:39:22 +04:00
|
|
|
DEFINE_RPC_SOCKET_EVENT_DONE(rpc_socket_error);
|
2013-09-04 20:16:23 +04:00
|
|
|
DEFINE_RPC_SOCKET_EVENT_DONE(rpc_socket_reset_connection);
|
|
|
|
DEFINE_RPC_SOCKET_EVENT(rpc_socket_close);
|
|
|
|
DEFINE_RPC_SOCKET_EVENT(rpc_socket_shutdown);
|
|
|
|
|
2014-10-28 21:24:13 +03:00
|
|
|
DECLARE_EVENT_CLASS(rpc_xprt_event,
|
|
|
|
TP_PROTO(struct rpc_xprt *xprt, __be32 xid, int status),
|
|
|
|
|
|
|
|
TP_ARGS(xprt, xid, status),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2017-10-20 17:35:18 +03:00
|
|
|
__field(u32, xid)
|
2014-10-28 21:24:13 +03:00
|
|
|
__field(int, status)
|
|
|
|
__string(addr, xprt->address_strings[RPC_DISPLAY_ADDR])
|
|
|
|
__string(port, xprt->address_strings[RPC_DISPLAY_PORT])
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2017-10-20 17:35:18 +03:00
|
|
|
__entry->xid = be32_to_cpu(xid);
|
2014-10-28 21:24:13 +03:00
|
|
|
__entry->status = status;
|
|
|
|
__assign_str(addr, xprt->address_strings[RPC_DISPLAY_ADDR]);
|
|
|
|
__assign_str(port, xprt->address_strings[RPC_DISPLAY_PORT]);
|
|
|
|
),
|
|
|
|
|
2017-10-20 17:35:18 +03:00
|
|
|
TP_printk("peer=[%s]:%s xid=0x%08x status=%d", __get_str(addr),
|
|
|
|
__get_str(port), __entry->xid,
|
2014-10-28 21:24:13 +03:00
|
|
|
__entry->status)
|
|
|
|
);
|
|
|
|
|
2018-01-03 23:38:25 +03:00
|
|
|
DEFINE_EVENT(rpc_xprt_event, xprt_timer,
|
|
|
|
TP_PROTO(struct rpc_xprt *xprt, __be32 xid, int status),
|
|
|
|
TP_ARGS(xprt, xid, status));
|
|
|
|
|
2014-10-28 21:24:13 +03:00
|
|
|
DEFINE_EVENT(rpc_xprt_event, xprt_lookup_rqst,
|
|
|
|
TP_PROTO(struct rpc_xprt *xprt, __be32 xid, int status),
|
|
|
|
TP_ARGS(xprt, xid, status));
|
|
|
|
|
|
|
|
DEFINE_EVENT(rpc_xprt_event, xprt_transmit,
|
|
|
|
TP_PROTO(struct rpc_xprt *xprt, __be32 xid, int status),
|
|
|
|
TP_ARGS(xprt, xid, status));
|
|
|
|
|
|
|
|
DEFINE_EVENT(rpc_xprt_event, xprt_complete_rqst,
|
|
|
|
TP_PROTO(struct rpc_xprt *xprt, __be32 xid, int status),
|
|
|
|
TP_ARGS(xprt, xid, status));
|
|
|
|
|
2018-03-16 17:33:55 +03:00
|
|
|
TRACE_EVENT(xprt_ping,
|
|
|
|
TP_PROTO(const struct rpc_xprt *xprt, int status),
|
|
|
|
|
|
|
|
TP_ARGS(xprt, status),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(int, status)
|
|
|
|
__string(addr, xprt->address_strings[RPC_DISPLAY_ADDR])
|
|
|
|
__string(port, xprt->address_strings[RPC_DISPLAY_PORT])
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->status = status;
|
|
|
|
__assign_str(addr, xprt->address_strings[RPC_DISPLAY_ADDR]);
|
|
|
|
__assign_str(port, xprt->address_strings[RPC_DISPLAY_PORT]);
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("peer=[%s]:%s status=%d",
|
|
|
|
__get_str(addr), __get_str(port), __entry->status)
|
|
|
|
);
|
|
|
|
|
2014-10-28 21:24:13 +03:00
|
|
|
TRACE_EVENT(xs_tcp_data_ready,
|
|
|
|
TP_PROTO(struct rpc_xprt *xprt, int err, unsigned int total),
|
|
|
|
|
|
|
|
TP_ARGS(xprt, err, total),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(int, err)
|
|
|
|
__field(unsigned int, total)
|
|
|
|
__string(addr, xprt ? xprt->address_strings[RPC_DISPLAY_ADDR] :
|
|
|
|
"(null)")
|
|
|
|
__string(port, xprt ? xprt->address_strings[RPC_DISPLAY_PORT] :
|
|
|
|
"(null)")
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->err = err;
|
|
|
|
__entry->total = total;
|
|
|
|
__assign_str(addr, xprt ?
|
|
|
|
xprt->address_strings[RPC_DISPLAY_ADDR] : "(null)");
|
|
|
|
__assign_str(port, xprt ?
|
|
|
|
xprt->address_strings[RPC_DISPLAY_PORT] : "(null)");
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("peer=[%s]:%s err=%d total=%u", __get_str(addr),
|
|
|
|
__get_str(port), __entry->err, __entry->total)
|
|
|
|
);
|
|
|
|
|
2014-10-28 21:24:14 +03:00
|
|
|
#define rpc_show_sock_xprt_flags(flags) \
|
|
|
|
__print_flags(flags, "|", \
|
|
|
|
{ TCP_RCV_LAST_FRAG, "TCP_RCV_LAST_FRAG" }, \
|
|
|
|
{ TCP_RCV_COPY_FRAGHDR, "TCP_RCV_COPY_FRAGHDR" }, \
|
|
|
|
{ TCP_RCV_COPY_XID, "TCP_RCV_COPY_XID" }, \
|
|
|
|
{ TCP_RCV_COPY_DATA, "TCP_RCV_COPY_DATA" }, \
|
|
|
|
{ TCP_RCV_READ_CALLDIR, "TCP_RCV_READ_CALLDIR" }, \
|
|
|
|
{ TCP_RCV_COPY_CALLDIR, "TCP_RCV_COPY_CALLDIR" }, \
|
|
|
|
{ TCP_RPC_REPLY, "TCP_RPC_REPLY" })
|
|
|
|
|
|
|
|
TRACE_EVENT(xs_tcp_data_recv,
|
|
|
|
TP_PROTO(struct sock_xprt *xs),
|
|
|
|
|
|
|
|
TP_ARGS(xs),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__string(addr, xs->xprt.address_strings[RPC_DISPLAY_ADDR])
|
|
|
|
__string(port, xs->xprt.address_strings[RPC_DISPLAY_PORT])
|
2017-10-20 17:35:18 +03:00
|
|
|
__field(u32, xid)
|
2014-10-28 21:24:14 +03:00
|
|
|
__field(unsigned long, flags)
|
|
|
|
__field(unsigned long, copied)
|
|
|
|
__field(unsigned int, reclen)
|
|
|
|
__field(unsigned long, offset)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__assign_str(addr, xs->xprt.address_strings[RPC_DISPLAY_ADDR]);
|
|
|
|
__assign_str(port, xs->xprt.address_strings[RPC_DISPLAY_PORT]);
|
2017-10-20 17:35:18 +03:00
|
|
|
__entry->xid = be32_to_cpu(xs->tcp_xid);
|
2014-10-28 21:24:14 +03:00
|
|
|
__entry->flags = xs->tcp_flags;
|
|
|
|
__entry->copied = xs->tcp_copied;
|
|
|
|
__entry->reclen = xs->tcp_reclen;
|
|
|
|
__entry->offset = xs->tcp_offset;
|
|
|
|
),
|
|
|
|
|
2017-10-20 17:35:18 +03:00
|
|
|
TP_printk("peer=[%s]:%s xid=0x%08x flags=%s copied=%lu reclen=%u offset=%lu",
|
|
|
|
__get_str(addr), __get_str(port), __entry->xid,
|
2014-10-28 21:24:14 +03:00
|
|
|
rpc_show_sock_xprt_flags(__entry->flags),
|
|
|
|
__entry->copied, __entry->reclen, __entry->offset)
|
|
|
|
);
|
|
|
|
|
2014-11-19 15:51:16 +03:00
|
|
|
#define show_rqstp_flags(flags) \
|
|
|
|
__print_flags(flags, "|", \
|
|
|
|
{ (1UL << RQ_SECURE), "RQ_SECURE"}, \
|
|
|
|
{ (1UL << RQ_LOCAL), "RQ_LOCAL"}, \
|
2014-11-19 15:51:17 +03:00
|
|
|
{ (1UL << RQ_USEDEFERRAL), "RQ_USEDEFERRAL"}, \
|
2014-11-19 15:51:18 +03:00
|
|
|
{ (1UL << RQ_DROPME), "RQ_DROPME"}, \
|
2014-11-21 22:19:28 +03:00
|
|
|
{ (1UL << RQ_SPLICE_OK), "RQ_SPLICE_OK"}, \
|
sunrpc: convert to lockless lookup of queued server threads
Testing has shown that the pool->sp_lock can be a bottleneck on a busy
server. Every time data is received on a socket, the server must take
that lock in order to dequeue a thread from the sp_threads list.
Address this problem by eliminating the sp_threads list (which contains
threads that are currently idle) and replacing it with a RQ_BUSY flag in
svc_rqst. This allows us to walk the sp_all_threads list under the
rcu_read_lock and find a suitable thread for the xprt by doing a
test_and_set_bit.
Note that we do still have a potential atomicity problem however with
this approach. We don't want svc_xprt_do_enqueue to set the
rqst->rq_xprt pointer unless a test_and_set_bit of RQ_BUSY returned
zero (which indicates that the thread was idle). But, by the time we
check that, the bit could be flipped by a waking thread.
To address this, we acquire a new per-rqst spinlock (rq_lock) and take
that before doing the test_and_set_bit. If that returns false, then we
can set rq_xprt and drop the spinlock. Then, when the thread wakes up,
it must set the bit under the same spinlock and can trust that if it was
already set then the rq_xprt is also properly set.
With this scheme, the case where we have an idle thread no longer needs
to take the highly contended pool->sp_lock at all, and that removes the
bottleneck.
That still leaves one issue: What of the case where we walk the whole
sp_all_threads list and don't find an idle thread? Because the search is
lockess, it's possible for the queueing to race with a thread that is
going to sleep. To address that, we queue the xprt and then search again.
If we find an idle thread at that point, we can't attach the xprt to it
directly since that might race with a different thread waking up and
finding it. All we can do is wake the idle thread back up and let it
attempt to find the now-queued xprt.
Signed-off-by: Jeff Layton <jlayton@primarydata.com>
Tested-by: Chris Worley <chris.worley@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
2014-11-21 22:19:30 +03:00
|
|
|
{ (1UL << RQ_VICTIM), "RQ_VICTIM"}, \
|
|
|
|
{ (1UL << RQ_BUSY), "RQ_BUSY"})
|
2014-11-19 15:51:14 +03:00
|
|
|
|
2014-10-28 21:24:12 +03:00
|
|
|
TRACE_EVENT(svc_recv,
|
|
|
|
TP_PROTO(struct svc_rqst *rqst, int status),
|
|
|
|
|
|
|
|
TP_ARGS(rqst, status),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2017-10-20 17:35:18 +03:00
|
|
|
__field(u32, xid)
|
2014-10-28 21:24:12 +03:00
|
|
|
__field(int, status)
|
2014-11-19 15:51:14 +03:00
|
|
|
__field(unsigned long, flags)
|
2017-10-11 00:31:42 +03:00
|
|
|
__dynamic_array(unsigned char, addr, rqst->rq_addrlen)
|
2014-10-28 21:24:12 +03:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2017-10-20 17:35:18 +03:00
|
|
|
__entry->xid = status > 0 ? be32_to_cpu(rqst->rq_xid) : 0;
|
2014-10-28 21:24:12 +03:00
|
|
|
__entry->status = status;
|
2014-11-19 15:51:14 +03:00
|
|
|
__entry->flags = rqst->rq_flags;
|
2017-10-11 00:31:42 +03:00
|
|
|
memcpy(__get_dynamic_array(addr),
|
|
|
|
&rqst->rq_addr, rqst->rq_addrlen);
|
2014-10-28 21:24:12 +03:00
|
|
|
),
|
|
|
|
|
2017-11-18 22:22:04 +03:00
|
|
|
TP_printk("addr=%pIScp xid=0x%08x status=%d flags=%s",
|
2017-10-11 00:31:42 +03:00
|
|
|
(struct sockaddr *)__get_dynamic_array(addr),
|
2017-10-20 17:35:18 +03:00
|
|
|
__entry->xid, __entry->status,
|
2014-11-19 15:51:14 +03:00
|
|
|
show_rqstp_flags(__entry->flags))
|
2014-10-28 21:24:12 +03:00
|
|
|
);
|
|
|
|
|
2016-06-24 17:55:46 +03:00
|
|
|
DECLARE_EVENT_CLASS(svc_rqst_event,
|
|
|
|
|
|
|
|
TP_PROTO(struct svc_rqst *rqst),
|
|
|
|
|
|
|
|
TP_ARGS(rqst),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2017-10-20 17:35:18 +03:00
|
|
|
__field(u32, xid)
|
2016-06-24 17:55:46 +03:00
|
|
|
__field(unsigned long, flags)
|
|
|
|
__dynamic_array(unsigned char, addr, rqst->rq_addrlen)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2017-10-20 17:35:18 +03:00
|
|
|
__entry->xid = be32_to_cpu(rqst->rq_xid);
|
2016-06-24 17:55:46 +03:00
|
|
|
__entry->flags = rqst->rq_flags;
|
|
|
|
memcpy(__get_dynamic_array(addr),
|
|
|
|
&rqst->rq_addr, rqst->rq_addrlen);
|
|
|
|
),
|
|
|
|
|
2017-10-20 17:35:18 +03:00
|
|
|
TP_printk("addr=%pIScp rq_xid=0x%08x flags=%s",
|
2016-06-24 17:55:46 +03:00
|
|
|
(struct sockaddr *)__get_dynamic_array(addr),
|
2017-10-20 17:35:18 +03:00
|
|
|
__entry->xid,
|
2016-06-24 17:55:46 +03:00
|
|
|
show_rqstp_flags(__entry->flags))
|
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(svc_rqst_event, svc_defer,
|
|
|
|
TP_PROTO(struct svc_rqst *rqst),
|
|
|
|
TP_ARGS(rqst));
|
|
|
|
|
|
|
|
DEFINE_EVENT(svc_rqst_event, svc_drop,
|
|
|
|
TP_PROTO(struct svc_rqst *rqst),
|
|
|
|
TP_ARGS(rqst));
|
|
|
|
|
2014-10-28 21:24:12 +03:00
|
|
|
DECLARE_EVENT_CLASS(svc_rqst_status,
|
|
|
|
|
|
|
|
TP_PROTO(struct svc_rqst *rqst, int status),
|
|
|
|
|
|
|
|
TP_ARGS(rqst, status),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2017-10-20 17:35:18 +03:00
|
|
|
__field(u32, xid)
|
2014-10-28 21:24:12 +03:00
|
|
|
__field(int, status)
|
2014-11-19 15:51:14 +03:00
|
|
|
__field(unsigned long, flags)
|
2017-10-11 00:31:42 +03:00
|
|
|
__dynamic_array(unsigned char, addr, rqst->rq_addrlen)
|
2014-10-28 21:24:12 +03:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2017-10-20 17:35:18 +03:00
|
|
|
__entry->xid = be32_to_cpu(rqst->rq_xid);
|
2014-10-28 21:24:12 +03:00
|
|
|
__entry->status = status;
|
2014-11-19 15:51:14 +03:00
|
|
|
__entry->flags = rqst->rq_flags;
|
2017-10-11 00:31:42 +03:00
|
|
|
memcpy(__get_dynamic_array(addr),
|
|
|
|
&rqst->rq_addr, rqst->rq_addrlen);
|
2014-10-28 21:24:12 +03:00
|
|
|
),
|
|
|
|
|
2017-10-20 17:35:18 +03:00
|
|
|
TP_printk("addr=%pIScp rq_xid=0x%08x status=%d flags=%s",
|
2017-10-11 00:31:42 +03:00
|
|
|
(struct sockaddr *)__get_dynamic_array(addr),
|
2017-11-18 22:22:04 +03:00
|
|
|
__entry->xid,
|
2014-11-19 15:51:14 +03:00
|
|
|
__entry->status, show_rqstp_flags(__entry->flags))
|
2014-10-28 21:24:12 +03:00
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(svc_rqst_status, svc_process,
|
|
|
|
TP_PROTO(struct svc_rqst *rqst, int status),
|
|
|
|
TP_ARGS(rqst, status));
|
|
|
|
|
|
|
|
DEFINE_EVENT(svc_rqst_status, svc_send,
|
|
|
|
TP_PROTO(struct svc_rqst *rqst, int status),
|
|
|
|
TP_ARGS(rqst, status));
|
|
|
|
|
2014-11-21 22:19:31 +03:00
|
|
|
#define show_svc_xprt_flags(flags) \
|
|
|
|
__print_flags(flags, "|", \
|
|
|
|
{ (1UL << XPT_BUSY), "XPT_BUSY"}, \
|
|
|
|
{ (1UL << XPT_CONN), "XPT_CONN"}, \
|
|
|
|
{ (1UL << XPT_CLOSE), "XPT_CLOSE"}, \
|
|
|
|
{ (1UL << XPT_DATA), "XPT_DATA"}, \
|
|
|
|
{ (1UL << XPT_TEMP), "XPT_TEMP"}, \
|
|
|
|
{ (1UL << XPT_DEAD), "XPT_DEAD"}, \
|
|
|
|
{ (1UL << XPT_CHNGBUF), "XPT_CHNGBUF"}, \
|
|
|
|
{ (1UL << XPT_DEFERRED), "XPT_DEFERRED"}, \
|
|
|
|
{ (1UL << XPT_OLD), "XPT_OLD"}, \
|
|
|
|
{ (1UL << XPT_LISTENER), "XPT_LISTENER"}, \
|
|
|
|
{ (1UL << XPT_CACHE_AUTH), "XPT_CACHE_AUTH"}, \
|
|
|
|
{ (1UL << XPT_LOCAL), "XPT_LOCAL"})
|
|
|
|
|
|
|
|
TRACE_EVENT(svc_xprt_do_enqueue,
|
|
|
|
TP_PROTO(struct svc_xprt *xprt, struct svc_rqst *rqst),
|
|
|
|
|
|
|
|
TP_ARGS(xprt, rqst),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(struct svc_xprt *, xprt)
|
2015-08-27 07:31:33 +03:00
|
|
|
__field(int, pid)
|
|
|
|
__field(unsigned long, flags)
|
2016-06-24 17:55:44 +03:00
|
|
|
__dynamic_array(unsigned char, addr, xprt != NULL ?
|
|
|
|
xprt->xpt_remotelen : 0)
|
2014-11-21 22:19:31 +03:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->xprt = xprt;
|
2015-08-27 07:31:33 +03:00
|
|
|
__entry->pid = rqst? rqst->rq_task->pid : 0;
|
2016-06-24 17:55:44 +03:00
|
|
|
if (xprt) {
|
|
|
|
memcpy(__get_dynamic_array(addr),
|
|
|
|
&xprt->xpt_remote,
|
|
|
|
xprt->xpt_remotelen);
|
|
|
|
__entry->flags = xprt->xpt_flags;
|
|
|
|
} else
|
|
|
|
__entry->flags = 0;
|
2014-11-21 22:19:31 +03:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("xprt=0x%p addr=%pIScp pid=%d flags=%s", __entry->xprt,
|
2016-06-24 17:55:44 +03:00
|
|
|
__get_dynamic_array_len(addr) != 0 ?
|
|
|
|
(struct sockaddr *)__get_dynamic_array(addr) : NULL,
|
2015-08-27 07:31:33 +03:00
|
|
|
__entry->pid, show_svc_xprt_flags(__entry->flags))
|
2014-11-21 22:19:31 +03:00
|
|
|
);
|
|
|
|
|
2016-06-24 17:55:45 +03:00
|
|
|
DECLARE_EVENT_CLASS(svc_xprt_event,
|
2014-11-21 22:19:31 +03:00
|
|
|
TP_PROTO(struct svc_xprt *xprt),
|
|
|
|
|
|
|
|
TP_ARGS(xprt),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(struct svc_xprt *, xprt)
|
|
|
|
__field(unsigned long, flags)
|
2016-06-24 17:55:44 +03:00
|
|
|
__dynamic_array(unsigned char, addr, xprt != NULL ?
|
|
|
|
xprt->xpt_remotelen : 0)
|
2014-11-21 22:19:31 +03:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2016-06-24 17:55:44 +03:00
|
|
|
__entry->xprt = xprt;
|
|
|
|
if (xprt) {
|
|
|
|
memcpy(__get_dynamic_array(addr),
|
|
|
|
&xprt->xpt_remote,
|
|
|
|
xprt->xpt_remotelen);
|
|
|
|
__entry->flags = xprt->xpt_flags;
|
|
|
|
} else
|
|
|
|
__entry->flags = 0;
|
2014-11-21 22:19:31 +03:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("xprt=0x%p addr=%pIScp flags=%s", __entry->xprt,
|
2016-06-24 17:55:44 +03:00
|
|
|
__get_dynamic_array_len(addr) != 0 ?
|
|
|
|
(struct sockaddr *)__get_dynamic_array(addr) : NULL,
|
2014-11-21 22:19:31 +03:00
|
|
|
show_svc_xprt_flags(__entry->flags))
|
|
|
|
);
|
|
|
|
|
2016-06-24 17:55:45 +03:00
|
|
|
DEFINE_EVENT(svc_xprt_event, svc_xprt_dequeue,
|
|
|
|
TP_PROTO(struct svc_xprt *xprt),
|
|
|
|
TP_ARGS(xprt));
|
|
|
|
|
|
|
|
DEFINE_EVENT(svc_xprt_event, svc_xprt_no_write_space,
|
|
|
|
TP_PROTO(struct svc_xprt *xprt),
|
|
|
|
TP_ARGS(xprt));
|
|
|
|
|
2014-11-21 22:19:31 +03:00
|
|
|
TRACE_EVENT(svc_wake_up,
|
|
|
|
TP_PROTO(int pid),
|
|
|
|
|
|
|
|
TP_ARGS(pid),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(int, pid)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->pid = pid;
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("pid=%d", __entry->pid)
|
|
|
|
);
|
|
|
|
|
|
|
|
TRACE_EVENT(svc_handle_xprt,
|
|
|
|
TP_PROTO(struct svc_xprt *xprt, int len),
|
|
|
|
|
|
|
|
TP_ARGS(xprt, len),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
|
|
|
__field(struct svc_xprt *, xprt)
|
|
|
|
__field(int, len)
|
2015-08-27 07:31:33 +03:00
|
|
|
__field(unsigned long, flags)
|
2016-06-24 17:55:44 +03:00
|
|
|
__dynamic_array(unsigned char, addr, xprt != NULL ?
|
|
|
|
xprt->xpt_remotelen : 0)
|
2014-11-21 22:19:31 +03:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
|
|
|
__entry->xprt = xprt;
|
|
|
|
__entry->len = len;
|
2016-06-24 17:55:44 +03:00
|
|
|
if (xprt) {
|
|
|
|
memcpy(__get_dynamic_array(addr),
|
|
|
|
&xprt->xpt_remote,
|
|
|
|
xprt->xpt_remotelen);
|
|
|
|
__entry->flags = xprt->xpt_flags;
|
|
|
|
} else
|
|
|
|
__entry->flags = 0;
|
2014-11-21 22:19:31 +03:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_printk("xprt=0x%p addr=%pIScp len=%d flags=%s", __entry->xprt,
|
2016-06-24 17:55:44 +03:00
|
|
|
__get_dynamic_array_len(addr) != 0 ?
|
|
|
|
(struct sockaddr *)__get_dynamic_array(addr) : NULL,
|
2015-08-27 07:31:33 +03:00
|
|
|
__entry->len, show_svc_xprt_flags(__entry->flags))
|
2014-11-21 22:19:31 +03:00
|
|
|
);
|
2016-06-24 17:55:46 +03:00
|
|
|
|
|
|
|
|
|
|
|
DECLARE_EVENT_CLASS(svc_deferred_event,
|
|
|
|
TP_PROTO(struct svc_deferred_req *dr),
|
|
|
|
|
|
|
|
TP_ARGS(dr),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2017-10-20 17:35:18 +03:00
|
|
|
__field(u32, xid)
|
2016-06-24 17:55:46 +03:00
|
|
|
__dynamic_array(unsigned char, addr, dr->addrlen)
|
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2017-10-20 17:35:18 +03:00
|
|
|
__entry->xid = be32_to_cpu(*(__be32 *)(dr->args +
|
|
|
|
(dr->xprt_hlen>>2)));
|
2016-06-24 17:55:46 +03:00
|
|
|
memcpy(__get_dynamic_array(addr), &dr->addr, dr->addrlen);
|
|
|
|
),
|
|
|
|
|
2017-10-20 17:35:18 +03:00
|
|
|
TP_printk("addr=%pIScp xid=0x%08x",
|
2016-06-24 17:55:46 +03:00
|
|
|
(struct sockaddr *)__get_dynamic_array(addr),
|
2017-10-20 17:35:18 +03:00
|
|
|
__entry->xid)
|
2016-06-24 17:55:46 +03:00
|
|
|
);
|
|
|
|
|
|
|
|
DEFINE_EVENT(svc_deferred_event, svc_drop_deferred,
|
|
|
|
TP_PROTO(struct svc_deferred_req *dr),
|
|
|
|
TP_ARGS(dr));
|
|
|
|
DEFINE_EVENT(svc_deferred_event, svc_revisit_deferred,
|
|
|
|
TP_PROTO(struct svc_deferred_req *dr),
|
|
|
|
TP_ARGS(dr));
|
2012-01-20 23:52:23 +04:00
|
|
|
#endif /* _TRACE_SUNRPC_H */
|
|
|
|
|
|
|
|
#include <trace/define_trace.h>
|