[rt] Update to 4.14.6-rt7
This commit is contained in:
parent
9e0441b20a
commit
285e1090f2
|
@ -509,6 +509,16 @@ linux (4.14.7-1) UNRELEASED; urgency=medium
|
|||
[ Vagrant Cascadian ]
|
||||
* [armhf, arm64] Backport patches from 4.15.x to support dwmac-sun8i.
|
||||
|
||||
[ Ben Hutchings ]
|
||||
* [rt] Update to 4.14.6-rt7:
|
||||
- hrtimer: account for migrated timers
|
||||
- crypto: mcryptd: protect the per-CPU queue with a lock
|
||||
- tracing: Update inter-event hist trigger support to v7:
|
||||
+ Rename virtual "$common_timestamp" field to "common_timestamp"
|
||||
+ Fix use-after-free in trigger removal
|
||||
- mm/slub: close possible memory-leak in kmem_cache_alloc_bulk()
|
||||
- crypto: limit more FPU-enabled sections
|
||||
|
||||
-- Salvatore Bonaccorso <carnil@debian.org> Sun, 03 Dec 2017 10:18:39 +0100
|
||||
|
||||
linux (4.14.2-1) unstable; urgency=medium
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Thomas Gleixner <tglx@linutronix.de>
|
||||
Date: Thu, 23 Nov 2017 16:38:42 +0100
|
||||
Subject: [PATCH 01/36] timers: Use static keys for migrate_enable/nohz_active
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
The members migrate_enable and nohz_active in the timer/hrtimer per CPU
|
||||
bases have been introduced to avoid accessing global variables for these
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 17 Nov 2017 14:32:40 -0600
|
||||
Date: Wed, 6 Dec 2017 16:37:42 -0600
|
||||
Subject: [PATCH 01/37] tracing: Move hist trigger Documentation to
|
||||
histogram.txt
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
The hist trigger Documentation takes up a large part of events.txt -
|
||||
since it will be getting even larger, move it to a separate file.
|
||||
|
|
|
@ -2,7 +2,7 @@ From: Steven Rostedt <rostedt@goodmis.org>
|
|||
Date: Fri, 22 Sep 2017 14:58:15 -0500
|
||||
Subject: [PATCH 01/42] tracing: Steve's unofficial trace_recursive_lock()
|
||||
patch
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
On Tue, 5 Sep 2017 16:57:52 -0500
|
||||
Tom Zanussi <tom.zanussi@linux.intel.com> wrote:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Thomas Gleixner <tglx@linutronix.de>
|
||||
Date: Thu, 23 Nov 2017 16:38:43 +0100
|
||||
Subject: [PATCH 02/36] hrtimer: Correct blantanly wrong comment
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
The protection of a hrtimer which runs its callback against migration to a
|
||||
different CPU has nothing to do with hard interrupt context.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 17 Nov 2017 14:32:41 -0600
|
||||
Date: Wed, 6 Dec 2017 16:37:43 -0600
|
||||
Subject: [PATCH 02/37] tracing: Add Documentation for log2 modifier
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
Add a line for the log2 modifier, to keep it aligned with
|
||||
tracing/README.
|
||||
|
|
|
@ -2,7 +2,7 @@ From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
|
|||
Date: Fri, 22 Sep 2017 14:58:16 -0500
|
||||
Subject: [PATCH 02/42] tracing: Reverse the order of trace_types_lock and
|
||||
event_mutex
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
In order to make future changes where we need to call
|
||||
tracing_set_clock() from within an event command, the order of
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Anna-Maria Gleixner <anna-maria@linutronix.de>
|
||||
Date: Sun, 22 Oct 2017 23:39:40 +0200
|
||||
Subject: [PATCH 03/36] hrtimer: Fix kerneldoc for struct hrtimer_cpu_base
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
The sequence '/**' marks the start of a struct description. Add the
|
||||
missing second asterisk. While at it adapt the ordering of the struct
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Vedang Patel <vedang.patel@intel.com>
|
||||
Date: Fri, 17 Nov 2017 14:32:42 -0600
|
||||
Date: Wed, 6 Dec 2017 16:37:44 -0600
|
||||
Subject: [PATCH 03/37] tracing: Add support to detect and avoid duplicates
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
A duplicate in the tracing_map hash table is when 2 different entries
|
||||
have the same key and, as a result, the key_hash. This is possible due
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 22 Sep 2017 14:58:17 -0500
|
||||
Subject: [PATCH 03/42] tracing: Exclude 'generic fields' from histograms
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
There are a small number of 'generic fields' (comm/COMM/cpu/CPU) that
|
||||
are found by trace_find_event_field() but are only meant for
|
||||
|
|
|
@ -2,7 +2,7 @@ From: Anna-Maria Gleixner <anna-maria@linutronix.de>
|
|||
Date: Sun, 22 Oct 2017 23:39:41 +0200
|
||||
Subject: [PATCH 04/36] hrtimer: Cleanup clock argument in
|
||||
schedule_hrtimeout_range_clock()
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
schedule_hrtimeout_range_clock() uses an integer for the clock id
|
||||
instead of the predefined type "clockid_t". The ID of the clock is
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Vedang Patel <vedang.patel@intel.com>
|
||||
Date: Fri, 17 Nov 2017 14:32:43 -0600
|
||||
Date: Wed, 6 Dec 2017 16:37:45 -0600
|
||||
Subject: [PATCH 04/37] tracing: Remove code which merges duplicates
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
We now have the logic to detect and remove duplicates in the
|
||||
tracing_map hash table. The code which merges duplicates in the
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 22 Sep 2017 14:58:18 -0500
|
||||
Subject: [PATCH 04/42] tracing: Remove lookups from tracing_map hitcount
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
Lookups inflate the hitcount, making it essentially useless. Only
|
||||
inserts and updates should really affect the hitcount anyway, so
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Anna-Maria Gleixner <anna-maria@linutronix.de>
|
||||
Date: Sun, 22 Oct 2017 23:39:42 +0200
|
||||
Subject: [PATCH 05/36] hrtimer: Fix hrtimer function description
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
The hrtimer_start[_range_ns]() starts a timer reliable on this CPU only
|
||||
when HRTIMER_MODE_PINNED is set. Furthermore the HRTIMER_MODE_PINNED mode
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 17 Nov 2017 14:32:44 -0600
|
||||
Date: Wed, 6 Dec 2017 16:37:46 -0600
|
||||
Subject: [PATCH 05/37] ring-buffer: Add interface for setting absolute time
|
||||
stamps
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
Define a new function, tracing_set_time_stamp_abs(), which can be used
|
||||
to enable or disable the use of absolute timestamps rather than time
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 22 Sep 2017 14:58:19 -0500
|
||||
Subject: [PATCH 05/42] tracing: Increase tracing map KEYS_MAX size
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
The current default for the number of subkeys in a compound key is 2,
|
||||
which is too restrictive. Increase it to a more realistic value of 3.
|
||||
|
|
|
@ -2,7 +2,7 @@ From: Anna-Maria Gleixner <anna-maria@linutronix.de>
|
|||
Date: Sun, 22 Oct 2017 23:39:43 +0200
|
||||
Subject: [PATCH 06/36] hrtimer: Ensure POSIX compliance (relative
|
||||
CLOCK_REALTIME hrtimers)
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
POSIX specification defines, that relative CLOCK_REALTIME timers are not
|
||||
affected by clock modifications. Those timers have to use CLOCK_MONOTONIC
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 17 Nov 2017 14:32:45 -0600
|
||||
Date: Wed, 6 Dec 2017 16:37:47 -0600
|
||||
Subject: [PATCH 06/37] ring-buffer: Redefine the unimplemented
|
||||
RINGBUF_TYPE_TIME_STAMP
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
RINGBUF_TYPE_TIME_STAMP is defined but not used, and from what I can
|
||||
gather was reserved for something like an absolute timestamp feature
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 22 Sep 2017 14:58:20 -0500
|
||||
Subject: [PATCH 06/42] tracing: Make traceprobe parsing code reusable
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
traceprobe_probes_write() and traceprobe_command() actually contain
|
||||
nothing that ties them to kprobes - the code is generically useful for
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Anna-Maria Gleixner <anna-maria@linutronix.de>
|
||||
Date: Sun, 22 Oct 2017 23:39:44 +0200
|
||||
Subject: [PATCH 07/36] hrtimer: Cleanup hrtimer_mode enum
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
It's not obvious that the HRTIMER_MODE variants are bit combinations
|
||||
because all modes are hard coded constants.
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 17 Nov 2017 14:32:46 -0600
|
||||
Date: Wed, 6 Dec 2017 16:37:48 -0600
|
||||
Subject: [PATCH 07/37] tracing: Add timestamp_mode trace file
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
Add a new option flag indicating whether or not the ring buffer is in
|
||||
'absolute timestamp' mode.
|
||||
|
||||
Currently this is only set/unset by hist triggers that make use of a
|
||||
$common_timestamp. As such, there's no reason to make this writeable
|
||||
common_timestamp. As such, there's no reason to make this writeable
|
||||
for users - its purpose is only to allow users to determine
|
||||
unequivocally whether or not the ring buffer is in that mode (although
|
||||
absolute timestamps can coexist with the normal delta timestamps, when
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 22 Sep 2017 14:58:21 -0500
|
||||
Subject: [PATCH 07/42] tracing: Clean up hist_field_flags enum
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
As we add more flags, specifying explicit integers for the flag values
|
||||
becomes more unwieldy and error-prone - switch them over to left-shift
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 22 Sep 2017 14:58:22 -0500
|
||||
Subject: [PATCH 08/42] tracing: Add hist_field_name() accessor
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
In preparation for hist_fields that won't be strictly based on
|
||||
trace_event_fields, add a new hist_field_name() accessor to allow that
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 17 Nov 2017 14:32:47 -0600
|
||||
Date: Wed, 6 Dec 2017 16:37:49 -0600
|
||||
Subject: [PATCH 08/37] tracing: Give event triggers access to
|
||||
ring_buffer_event
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
The ring_buffer event can provide a timestamp that may be useful to
|
||||
various triggers - pass it into the handlers for that purpose.
|
||||
|
|
|
@ -2,7 +2,7 @@ From: Anna-Maria Gleixner <anna-maria@linutronix.de>
|
|||
Date: Sun, 22 Oct 2017 23:39:45 +0200
|
||||
Subject: [PATCH 08/36] tracing/hrtimer: Take all clock bases and modes into
|
||||
account
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
So far only CLOCK_MONOTONIC and CLOCK_REALTIME were taken into account as
|
||||
well as HRTIMER_MODE_ABS/REL in hrtimer_init tracepoint. The query for
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 17 Nov 2017 14:32:48 -0600
|
||||
Date: Wed, 6 Dec 2017 16:37:50 -0600
|
||||
Subject: [PATCH 09/37] tracing: Add ring buffer event param to hist field
|
||||
functions
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
Some events such as timestamps require access to a ring_buffer_event
|
||||
struct; add a param so that hist field functions can access that.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 22 Sep 2017 14:58:23 -0500
|
||||
Subject: [PATCH 09/42] tracing: Reimplement log2
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
log2 as currently implemented applies only to u64 trace_event_field
|
||||
derived fields, and assumes that anything it's applied to is a u64
|
||||
|
|
|
@ -2,7 +2,7 @@ From: Anna-Maria Gleixner <anna-maria@linutronix.de>
|
|||
Date: Sun, 22 Oct 2017 23:39:46 +0200
|
||||
Subject: [PATCH 09/36] tracing/hrtimer: Print hrtimer mode in hrtimer_start
|
||||
tracepoint
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
The hrtimer_start tracepoint lacks the mode information. The mode is
|
||||
important because consecutive starts can switch from ABS to REL or from
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Anna-Maria Gleixner <anna-maria@linutronix.de>
|
||||
Date: Sun, 22 Oct 2017 23:39:47 +0200
|
||||
Subject: [PATCH 10/36] hrtimer: Switch for loop to _ffs() evaluation
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
Looping over all clock bases to find active bits is suboptimal if not all
|
||||
bases are active.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 17 Nov 2017 14:32:49 -0600
|
||||
Date: Wed, 6 Dec 2017 16:37:51 -0600
|
||||
Subject: [PATCH 10/37] tracing: Break out hist trigger assignment parsing
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
This will make it easier to add variables, and makes the parsing code
|
||||
cleaner regardless.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Anna-Maria Gleixner <anna-maria@linutronix.de>
|
||||
Date: Sun, 22 Oct 2017 23:39:48 +0200
|
||||
Subject: [PATCH 11/36] hrtimer: Store running timer in hrtimer_clock_base
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
The pointer to the currently running timer is stored in hrtimer_cpu_base
|
||||
before the base lock is dropped and the callback is invoked.
|
||||
|
|
|
@ -1,28 +1,30 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 17 Nov 2017 14:32:50 -0600
|
||||
Date: Wed, 6 Dec 2017 16:37:52 -0600
|
||||
Subject: [PATCH 11/37] tracing: Add hist trigger timestamp support
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
Add support for a timestamp event field. This is actually a 'pseudo-'
|
||||
event field in that it behaves like it's part of the event record, but
|
||||
is really part of the corresponding ring buffer event.
|
||||
|
||||
To make use of the timestamp field, users can specify
|
||||
"$common_timestamp" as a field name for any histogram. Note that this
|
||||
"common_timestamp" as a field name for any histogram. Note that this
|
||||
doesn't make much sense on its own either as either a key or value,
|
||||
but needs to be supported even so, since follow-on patches will add
|
||||
support for making use of this field in time deltas. The '$' is used
|
||||
as a prefix on the variable name to indicate that it's not a bona fide
|
||||
event field - so you won't find it in the event description - but
|
||||
rather it's a synthetic field that can be used like a real field).
|
||||
support for making use of this field in time deltas. The
|
||||
common_timestamp 'field' is not a bona fide event field - so you won't
|
||||
find it in the event description - but rather it's a synthetic field
|
||||
that can be used like a real field.
|
||||
|
||||
Note that the use of this field requires the ring buffer be put into
|
||||
'absolute timestamp' mode, which saves the complete timestamp for each
|
||||
event rather than an offset. This mode will be enabled if and only if
|
||||
a histogram makes use of the "$common_timestamp" field.
|
||||
a histogram makes use of the "common_timestamp" field.
|
||||
|
||||
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
|
||||
[kasan use-after-free fix]
|
||||
Signed-off-by: Vedang Patel <vedang.patel@intel.com>
|
||||
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
---
|
||||
kernel/trace/trace_events_hist.c | 94 +++++++++++++++++++++++++++++----------
|
||||
|
@ -64,7 +66,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
else if (field->flags & HIST_FIELD_FL_LOG2)
|
||||
field_name = hist_field_name(field->operands[0], ++level);
|
||||
+ else if (field->flags & HIST_FIELD_FL_TIMESTAMP)
|
||||
+ field_name = "$common_timestamp";
|
||||
+ field_name = "common_timestamp";
|
||||
|
||||
if (field_name == NULL)
|
||||
field_name = "";
|
||||
|
@ -89,7 +91,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
- if (!field || !field->size) {
|
||||
- ret = -EINVAL;
|
||||
- goto out;
|
||||
+ if (strcmp(field_name, "$common_timestamp") == 0) {
|
||||
+ if (strcmp(field_name, "common_timestamp") == 0) {
|
||||
+ flags |= HIST_FIELD_FL_TIMESTAMP;
|
||||
+ hist_data->enable_timestamps = true;
|
||||
+ } else {
|
||||
|
@ -110,7 +112,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
- ret = -EINVAL;
|
||||
- goto out;
|
||||
- }
|
||||
+ if (strcmp(field_name, "$common_timestamp") == 0) {
|
||||
+ if (strcmp(field_name, "common_timestamp") == 0) {
|
||||
+ flags |= HIST_FIELD_FL_TIMESTAMP;
|
||||
+ hist_data->enable_timestamps = true;
|
||||
+ key_size = sizeof(u64);
|
||||
|
@ -149,7 +151,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
|
||||
- seq_printf(m, "%s", field_name);
|
||||
+ if (hist_field->flags & HIST_FIELD_FL_TIMESTAMP)
|
||||
+ seq_puts(m, "$common_timestamp");
|
||||
+ seq_puts(m, "common_timestamp");
|
||||
+ else if (field_name)
|
||||
+ seq_printf(m, "%s", field_name);
|
||||
+
|
||||
|
@ -212,7 +214,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
if (trace_event_trigger_enable_disable(file, 1) < 0) {
|
||||
list_del_rcu(&data->list);
|
||||
update_cond_flag(file);
|
||||
@@ -1572,19 +1611,28 @@ static void hist_unregister_trigger(char
|
||||
@@ -1572,17 +1611,26 @@ static void hist_unregister_trigger(char
|
||||
|
||||
if (unregistered && test->ops->free)
|
||||
test->ops->free(test->ops, test);
|
||||
|
@ -234,10 +236,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
list_del_rcu(&test->list);
|
||||
trace_event_trigger_enable_disable(file, 0);
|
||||
update_cond_flag(file);
|
||||
if (test->ops->free)
|
||||
test->ops->free(test->ops, test);
|
||||
+ if (hist_data->enable_timestamps)
|
||||
+ tracing_set_time_stamp_abs(file->tr, false);
|
||||
if (test->ops->free)
|
||||
test->ops->free(test->ops, test);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Anna-Maria Gleixner <anna-maria@linutronix.de>
|
||||
Date: Sun, 22 Oct 2017 23:39:50 +0200
|
||||
Subject: [PATCH 12/36] hrtimer: Make room in struct hrtimer_cpu_base
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
The upcoming softirq based hrtimers support requires an additional field in
|
||||
the hrtimer_cpu_base struct, which would grow the struct size beyond a
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 17 Nov 2017 14:32:51 -0600
|
||||
Date: Wed, 6 Dec 2017 16:37:53 -0600
|
||||
Subject: [PATCH 12/37] tracing: Add per-element variable support to
|
||||
tracing_map
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
In order to allow information to be passed between trace events, add
|
||||
support for per-element variables to tracing_map. This provides a
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Anna-Maria Gleixner <anna-maria@linutronix.de>
|
||||
Date: Sun, 22 Oct 2017 23:39:51 +0200
|
||||
Subject: [PATCH 13/36] hrtimer: Reduce conditional code (hres_active)
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
The hrtimer_cpu_base struct has the CONFIG_HIGH_RES_TIMERS conditional
|
||||
struct member hres_active. All related functions to this member are
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 17 Nov 2017 14:32:52 -0600
|
||||
Date: Wed, 6 Dec 2017 16:37:54 -0600
|
||||
Subject: [PATCH 13/37] tracing: Add hist_data member to hist_field
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
Allow hist_data access via hist_field. Some users of hist_fields
|
||||
require or will require more access to the associated hist_data.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Anna-Maria Gleixner <anna-maria@linutronix.de>
|
||||
Date: Sun, 22 Oct 2017 23:39:52 +0200
|
||||
Subject: [PATCH 14/36] hrtimer: Use accesor functions instead of direct access
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
__hrtimer_hres_active() is now available unconditionally. Replace the
|
||||
direct access to hrtimer_cpu_base.hres_active.
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 17 Nov 2017 14:32:53 -0600
|
||||
Date: Wed, 6 Dec 2017 16:37:55 -0600
|
||||
Subject: [PATCH 14/37] tracing: Add usecs modifier for hist trigger timestamps
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
Appending .usecs onto a $common_timestamp field will cause the
|
||||
Appending .usecs onto a common_timestamp field will cause the
|
||||
timestamp value to be in microseconds instead of the default
|
||||
nanoseconds. A typical latency histogram using usecs would look like
|
||||
this:
|
||||
|
||||
# echo 'hist:keys=pid,prio:ts0=$common_timestamp.usecs ...
|
||||
# echo 'hist:keys=next_pid:wakeup_lat=$common_timestamp.usecs-$ts0 ...
|
||||
# echo 'hist:keys=pid,prio:ts0=common_timestamp.usecs ...
|
||||
# echo 'hist:keys=next_pid:wakeup_lat=common_timestamp.usecs-$ts0 ...
|
||||
|
||||
This also adds an external trace_clock_in_ns() to trace.c for the
|
||||
timestamp conversion.
|
||||
|
@ -29,7 +29,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
.syscall display a syscall id as a system call name
|
||||
.execname display a common_pid as a program name
|
||||
.log2 display log2 value rather than raw number
|
||||
+ .usecs display a $common_timestamp in microseconds
|
||||
+ .usecs display a common_timestamp in microseconds
|
||||
|
||||
Note that in general the semantics of a given field aren't
|
||||
interpreted when applying a modifier to it, but there are some
|
||||
|
@ -58,7 +58,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
- "\t .log2 display log2 value rather than raw number\n\n"
|
||||
+ "\t .syscall display a syscall id as a syscall name\n"
|
||||
+ "\t .log2 display log2 value rather than raw number\n"
|
||||
+ "\t .usecs display a $common_timestamp in microseconds\n\n"
|
||||
+ "\t .usecs display a common_timestamp in microseconds\n\n"
|
||||
"\t The 'pause' parameter can be used to pause an existing hist\n"
|
||||
"\t trigger or to start a hist trigger but not log any events\n"
|
||||
"\t until told to do so. 'continue' can be used to start or\n"
|
||||
|
@ -135,7 +135,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
ret = -EINVAL;
|
||||
goto out;
|
||||
@@ -643,6 +655,8 @@ static int create_key_field(struct hist_
|
||||
if (strcmp(field_name, "$common_timestamp") == 0) {
|
||||
if (strcmp(field_name, "common_timestamp") == 0) {
|
||||
flags |= HIST_FIELD_FL_TIMESTAMP;
|
||||
hist_data->enable_timestamps = true;
|
||||
+ if (flags & HIST_FIELD_FL_TIMESTAMP_USECS)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Anna-Maria Gleixner <anna-maria@linutronix.de>
|
||||
Date: Sun, 22 Oct 2017 23:39:53 +0200
|
||||
Subject: [PATCH 15/36] hrtimer: Make the remote enqueue check unconditional
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
hrtimer_cpu_base.expires_next is used to cache the next event armed in the
|
||||
timer hardware. The value is used to check whether an hrtimer can be
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 17 Nov 2017 14:32:54 -0600
|
||||
Date: Wed, 6 Dec 2017 16:37:56 -0600
|
||||
Subject: [PATCH 15/37] tracing: Add variable support to hist triggers
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
Add support for saving the value of a current event's event field by
|
||||
assigning it to a variable that can be read by a subsequent event.
|
||||
|
@ -12,23 +12,23 @@ to any event field.
|
|||
|
||||
Both keys and values can be saved and retrieved in this way:
|
||||
|
||||
# echo 'hist:keys=next_pid:vals=$ts0:ts0=$common_timestamp ...
|
||||
# echo 'hist:keys=next_pid:vals=$ts0:ts0=common_timestamp ...
|
||||
# echo 'hist:timer_pid=common_pid:key=$timer_pid ...'
|
||||
|
||||
If a variable isn't a key variable or prefixed with 'vals=', the
|
||||
associated event field will be saved in a variable but won't be summed
|
||||
as a value:
|
||||
|
||||
# echo 'hist:keys=next_pid:ts1=$common_timestamp:...
|
||||
# echo 'hist:keys=next_pid:ts1=common_timestamp:...
|
||||
|
||||
Multiple variables can be assigned at the same time:
|
||||
|
||||
# echo 'hist:keys=pid:vals=$ts0,$b,field2:ts0=$common_timestamp,b=field1 ...
|
||||
# echo 'hist:keys=pid:vals=$ts0,$b,field2:ts0=common_timestamp,b=field1 ...
|
||||
|
||||
Multiple (or single) variables can also be assigned at the same time
|
||||
using separate assignments:
|
||||
|
||||
# echo 'hist:keys=pid:vals=$ts0:ts0=$common_timestamp:b=field1:c=field2 ...
|
||||
# echo 'hist:keys=pid:vals=$ts0:ts0=common_timestamp:b=field1:c=field2 ...
|
||||
|
||||
Variables set as above can be used by being referenced from another
|
||||
event, as described in a subsequent patch.
|
||||
|
@ -645,7 +645,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+ seq_printf(m, "%s=", hist_field->var.name);
|
||||
+
|
||||
if (hist_field->flags & HIST_FIELD_FL_TIMESTAMP)
|
||||
seq_puts(m, "$common_timestamp");
|
||||
seq_puts(m, "common_timestamp");
|
||||
else if (field_name)
|
||||
@@ -1285,7 +1544,8 @@ static int event_hist_trigger_print(stru
|
||||
struct event_trigger_data *data)
|
||||
|
|
|
@ -2,7 +2,7 @@ From: Anna-Maria Gleixner <anna-maria@linutronix.de>
|
|||
Date: Sun, 22 Oct 2017 23:39:54 +0200
|
||||
Subject: [PATCH 16/36] hrtimer: Make hrtimer_cpu_base.next_timer handling
|
||||
unconditional
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
hrtimer_cpu_base.next_timer stores the pointer to the next expiring timer
|
||||
in a cpu base.
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 17 Nov 2017 14:32:55 -0600
|
||||
Date: Wed, 6 Dec 2017 16:37:57 -0600
|
||||
Subject: [PATCH 16/37] tracing: Account for variables in named trigger
|
||||
compatibility
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
Named triggers must also have the same set of variables in order to be
|
||||
considered compatible - update the trigger match test to account for
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Anna-Maria Gleixner <anna-maria@linutronix.de>
|
||||
Date: Sun, 22 Oct 2017 23:39:55 +0200
|
||||
Subject: [PATCH 17/36] hrtimer: Make hrtimer_reprogramm() unconditional
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
hrtimer_reprogram() needs to be available unconditionally for softirq based
|
||||
hrtimers. Move the function and all required struct members out of the
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 17 Nov 2017 14:32:56 -0600
|
||||
Date: Wed, 6 Dec 2017 16:37:58 -0600
|
||||
Subject: [PATCH 17/37] tracing: Move get_hist_field_flags()
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
Move get_hist_field_flags() to make it more easily accessible for new
|
||||
code (and keep the move separate from new functionality).
|
||||
|
|
|
@ -2,7 +2,7 @@ From: Anna-Maria Gleixner <anna-maria@linutronix.de>
|
|||
Date: Sun, 22 Oct 2017 23:39:56 +0200
|
||||
Subject: [PATCH 18/36] hrtimer: Make hrtimer_force_reprogramm()
|
||||
unconditionally available
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
hrtimer_force_reprogram() needs to be available unconditionally for softirq
|
||||
based hrtimers. Move the function and all required struct members out of
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 17 Nov 2017 14:32:57 -0600
|
||||
Date: Wed, 6 Dec 2017 16:37:59 -0600
|
||||
Subject: [PATCH 18/37] tracing: Add simple expression support to hist triggers
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
Add support for simple addition, subtraction, and unary expressions
|
||||
(-(expr) and expr, where expr = b-a, a+b, a+b+c) to hist triggers, in
|
||||
|
@ -17,8 +17,8 @@ parsing.
|
|||
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
---
|
||||
kernel/trace/trace_events_hist.c | 513 +++++++++++++++++++++++++++++++++------
|
||||
1 file changed, 440 insertions(+), 73 deletions(-)
|
||||
kernel/trace/trace_events_hist.c | 482 +++++++++++++++++++++++++++++++++------
|
||||
1 file changed, 409 insertions(+), 73 deletions(-)
|
||||
|
||||
--- a/kernel/trace/trace_events_hist.c
|
||||
+++ b/kernel/trace/trace_events_hist.c
|
||||
|
@ -98,13 +98,13 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
@@ -258,6 +303,8 @@ static const char *hist_field_name(struc
|
||||
field_name = hist_field_name(field->operands[0], ++level);
|
||||
else if (field->flags & HIST_FIELD_FL_TIMESTAMP)
|
||||
field_name = "$common_timestamp";
|
||||
field_name = "common_timestamp";
|
||||
+ else if (field->flags & HIST_FIELD_FL_EXPR)
|
||||
+ field_name = field->name;
|
||||
|
||||
if (field_name == NULL)
|
||||
field_name = "";
|
||||
@@ -519,6 +566,93 @@ static const char *get_hist_field_flags(
|
||||
@@ -519,6 +566,95 @@ static const char *get_hist_field_flags(
|
||||
return flags_str;
|
||||
}
|
||||
|
||||
|
@ -131,6 +131,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+ strcat(expr, subexpr);
|
||||
+ strcat(expr, ")");
|
||||
+
|
||||
+ kfree(subexpr);
|
||||
+
|
||||
+ return expr;
|
||||
+ }
|
||||
+
|
||||
|
@ -198,7 +200,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
static void destroy_hist_field(struct hist_field *hist_field,
|
||||
unsigned int level)
|
||||
{
|
||||
@@ -534,6 +668,7 @@ static void destroy_hist_field(struct hi
|
||||
@@ -534,6 +670,7 @@ static void destroy_hist_field(struct hi
|
||||
destroy_hist_field(hist_field->operands[i], level + 1);
|
||||
|
||||
kfree(hist_field->var.name);
|
||||
|
@ -206,7 +208,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
|
||||
kfree(hist_field);
|
||||
}
|
||||
@@ -554,6 +689,9 @@ static struct hist_field *create_hist_fi
|
||||
@@ -554,6 +691,9 @@ static struct hist_field *create_hist_fi
|
||||
|
||||
hist_field->hist_data = hist_data;
|
||||
|
||||
|
@ -216,66 +218,17 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
if (flags & HIST_FIELD_FL_HITCOUNT) {
|
||||
hist_field->fn = hist_field_counter;
|
||||
goto out;
|
||||
@@ -626,59 +764,323 @@ static void destroy_hist_fields(struct h
|
||||
@@ -626,6 +766,257 @@ static void destroy_hist_fields(struct h
|
||||
}
|
||||
}
|
||||
|
||||
-static int create_hitcount_val(struct hist_trigger_data *hist_data)
|
||||
+static char *field_name_from_var(struct hist_trigger_data *hist_data,
|
||||
+ char *var_name)
|
||||
{
|
||||
- hist_data->fields[HITCOUNT_IDX] =
|
||||
- create_hist_field(hist_data, NULL, HIST_FIELD_FL_HITCOUNT, NULL);
|
||||
- if (!hist_data->fields[HITCOUNT_IDX])
|
||||
- return -ENOMEM;
|
||||
+ char *name, *field;
|
||||
+ unsigned int i;
|
||||
|
||||
- hist_data->n_vals++;
|
||||
- hist_data->n_fields++;
|
||||
+ for (i = 0; i < hist_data->attrs->var_defs.n_vars; i++) {
|
||||
+ name = hist_data->attrs->var_defs.name[i];
|
||||
|
||||
- if (WARN_ON(hist_data->n_vals > TRACING_MAP_VALS_MAX))
|
||||
- return -EINVAL;
|
||||
+ if (strcmp(var_name, name) == 0) {
|
||||
+ field = hist_data->attrs->var_defs.expr[i];
|
||||
+ if (contains_operator(field))
|
||||
+ continue;
|
||||
+ return field;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
- return 0;
|
||||
+ return NULL;
|
||||
}
|
||||
|
||||
-static int __create_val_field(struct hist_trigger_data *hist_data,
|
||||
- unsigned int val_idx,
|
||||
- struct trace_event_file *file,
|
||||
- char *var_name, char *field_str,
|
||||
- unsigned long flags)
|
||||
+static char *local_field_var_ref(struct hist_trigger_data *hist_data,
|
||||
+ char *var_name)
|
||||
+{
|
||||
+ var_name++;
|
||||
+
|
||||
+ return field_name_from_var(hist_data, var_name);
|
||||
+}
|
||||
+
|
||||
+static struct ftrace_event_field *
|
||||
+parse_field(struct hist_trigger_data *hist_data, struct trace_event_file *file,
|
||||
+ char *field_str, unsigned long *flags)
|
||||
{
|
||||
struct ftrace_event_field *field = NULL;
|
||||
- char *field_name;
|
||||
- int ret = 0;
|
||||
+{
|
||||
+ struct ftrace_event_field *field = NULL;
|
||||
+ char *field_name, *modifier, *str;
|
||||
|
||||
- field_name = strsep(&field_str, ".");
|
||||
- if (field_str) {
|
||||
- if (strcmp(field_str, "hex") == 0)
|
||||
- flags |= HIST_FIELD_FL_HEX;
|
||||
+
|
||||
+ modifier = str = kstrdup(field_str, GFP_KERNEL);
|
||||
+ if (!modifier)
|
||||
+ return ERR_PTR(-ENOMEM);
|
||||
|
@ -297,27 +250,24 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+ *flags |= HIST_FIELD_FL_LOG2;
|
||||
+ else if (strcmp(modifier, "usecs") == 0)
|
||||
+ *flags |= HIST_FIELD_FL_TIMESTAMP_USECS;
|
||||
else {
|
||||
- ret = -EINVAL;
|
||||
+ else {
|
||||
+ field = ERR_PTR(-EINVAL);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
if (strcmp(field_name, "$common_timestamp") == 0) {
|
||||
- flags |= HIST_FIELD_FL_TIMESTAMP;
|
||||
+ goto out;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (strcmp(field_name, "common_timestamp") == 0) {
|
||||
+ *flags |= HIST_FIELD_FL_TIMESTAMP;
|
||||
hist_data->enable_timestamps = true;
|
||||
+ hist_data->enable_timestamps = true;
|
||||
+ if (*flags & HIST_FIELD_FL_TIMESTAMP_USECS)
|
||||
+ hist_data->attrs->ts_in_usecs = true;
|
||||
} else {
|
||||
field = trace_find_event_field(file->event_call, field_name);
|
||||
if (!field || !field->size) {
|
||||
- ret = -EINVAL;
|
||||
+ } else {
|
||||
+ field = trace_find_event_field(file->event_call, field_name);
|
||||
+ if (!field || !field->size) {
|
||||
+ field = ERR_PTR(-EINVAL);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
+ goto out;
|
||||
+ }
|
||||
+ }
|
||||
+ out:
|
||||
+ kfree(str);
|
||||
+
|
||||
|
@ -328,29 +278,22 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+ struct trace_event_file *file, char *str,
|
||||
+ unsigned long *flags, char *var_name)
|
||||
+{
|
||||
+ char *s;
|
||||
+ struct ftrace_event_field *field = NULL;
|
||||
+ struct hist_field *hist_field = NULL;
|
||||
+ int ret = 0;
|
||||
+
|
||||
+ s = local_field_var_ref(hist_data, str);
|
||||
+ if (s)
|
||||
+ str = s;
|
||||
+
|
||||
+ field = parse_field(hist_data, file, str, flags);
|
||||
+ if (IS_ERR(field)) {
|
||||
+ ret = PTR_ERR(field);
|
||||
+ goto out;
|
||||
+ }
|
||||
|
||||
- hist_data->fields[val_idx] = create_hist_field(hist_data, field, flags, var_name);
|
||||
- if (!hist_data->fields[val_idx]) {
|
||||
+
|
||||
+ hist_field = create_hist_field(hist_data, field, *flags, var_name);
|
||||
+ if (!hist_field) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
|
||||
+ ret = -ENOMEM;
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ return hist_field;
|
||||
+ out:
|
||||
+ return ERR_PTR(ret);
|
||||
|
@ -530,43 +473,54 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+ return ERR_PTR(ret);
|
||||
+}
|
||||
+
|
||||
+static int create_hitcount_val(struct hist_trigger_data *hist_data)
|
||||
+{
|
||||
+ hist_data->fields[HITCOUNT_IDX] =
|
||||
+ create_hist_field(hist_data, NULL, HIST_FIELD_FL_HITCOUNT, NULL);
|
||||
+ if (!hist_data->fields[HITCOUNT_IDX])
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ hist_data->n_vals++;
|
||||
+ hist_data->n_fields++;
|
||||
+
|
||||
+ if (WARN_ON(hist_data->n_vals > TRACING_MAP_VALS_MAX))
|
||||
+ return -EINVAL;
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int __create_val_field(struct hist_trigger_data *hist_data,
|
||||
+ unsigned int val_idx,
|
||||
+ struct trace_event_file *file,
|
||||
+ char *var_name, char *field_str,
|
||||
+ unsigned long flags)
|
||||
+{
|
||||
static int create_hitcount_val(struct hist_trigger_data *hist_data)
|
||||
{
|
||||
hist_data->fields[HITCOUNT_IDX] =
|
||||
@@ -648,37 +1039,17 @@ static int __create_val_field(struct his
|
||||
char *var_name, char *field_str,
|
||||
unsigned long flags)
|
||||
{
|
||||
- struct ftrace_event_field *field = NULL;
|
||||
- char *field_name;
|
||||
+ struct hist_field *hist_field;
|
||||
+ int ret = 0;
|
||||
+
|
||||
int ret = 0;
|
||||
|
||||
- field_name = strsep(&field_str, ".");
|
||||
- if (field_str) {
|
||||
- if (strcmp(field_str, "hex") == 0)
|
||||
- flags |= HIST_FIELD_FL_HEX;
|
||||
- else {
|
||||
- ret = -EINVAL;
|
||||
- goto out;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- if (strcmp(field_name, "common_timestamp") == 0) {
|
||||
- flags |= HIST_FIELD_FL_TIMESTAMP;
|
||||
- hist_data->enable_timestamps = true;
|
||||
- } else {
|
||||
- field = trace_find_event_field(file->event_call, field_name);
|
||||
- if (!field || !field->size) {
|
||||
- ret = -EINVAL;
|
||||
- goto out;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- hist_data->fields[val_idx] = create_hist_field(hist_data, field, flags, var_name);
|
||||
- if (!hist_data->fields[val_idx]) {
|
||||
- ret = -ENOMEM;
|
||||
+ hist_field = parse_expr(hist_data, file, field_str, flags, var_name, 0);
|
||||
+ if (IS_ERR(hist_field)) {
|
||||
+ ret = PTR_ERR(hist_field);
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
goto out;
|
||||
}
|
||||
|
||||
+ hist_data->fields[val_idx] = hist_field;
|
||||
+
|
||||
++hist_data->n_vals;
|
||||
++hist_data->n_fields;
|
||||
|
||||
@@ -765,8 +1167,8 @@ static int create_key_field(struct hist_
|
||||
@@ -765,8 +1136,8 @@ static int create_key_field(struct hist_
|
||||
struct trace_event_file *file,
|
||||
char *field_str)
|
||||
{
|
||||
|
@ -576,7 +530,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
unsigned long flags = 0;
|
||||
unsigned int key_size;
|
||||
int ret = 0;
|
||||
@@ -781,60 +1183,24 @@ static int create_key_field(struct hist_
|
||||
@@ -781,60 +1152,24 @@ static int create_key_field(struct hist_
|
||||
key_size = sizeof(unsigned long) * HIST_STACKTRACE_DEPTH;
|
||||
hist_field = create_hist_field(hist_data, NULL, flags, NULL);
|
||||
} else {
|
||||
|
@ -609,7 +563,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+ goto out;
|
||||
}
|
||||
|
||||
- if (strcmp(field_name, "$common_timestamp") == 0) {
|
||||
- if (strcmp(field_name, "common_timestamp") == 0) {
|
||||
- flags |= HIST_FIELD_FL_TIMESTAMP;
|
||||
- hist_data->enable_timestamps = true;
|
||||
- if (flags & HIST_FIELD_FL_TIMESTAMP_USECS)
|
||||
|
@ -646,7 +600,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
if (hist_data->key_size > HIST_KEY_SIZE_MAX) {
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
@@ -1419,7 +1785,8 @@ hist_trigger_entry_print(struct seq_file
|
||||
@@ -1419,7 +1754,8 @@ hist_trigger_entry_print(struct seq_file
|
||||
for (i = 1; i < hist_data->n_vals; i++) {
|
||||
field_name = hist_field_name(hist_data->fields[i], 0);
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Anna-Maria Gleixner <anna-maria@linutronix.de>
|
||||
Date: Sun, 22 Oct 2017 23:39:57 +0200
|
||||
Subject: [PATCH 19/36] hrtimer: Unify handling of hrtimer remove
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
When the first hrtimer on the current CPU is removed,
|
||||
hrtimer_force_reprogram() is invoked but only when
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 17 Nov 2017 14:32:58 -0600
|
||||
Date: Wed, 6 Dec 2017 16:38:00 -0600
|
||||
Subject: [PATCH 19/37] tracing: Generalize per-element hist trigger data
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
Up until now, hist triggers only needed per-element support for saving
|
||||
'comm' data, which was saved directly as a private data pointer.
|
||||
|
@ -106,7 +106,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
};
|
||||
|
||||
static const char *get_hist_field_flags(struct hist_field *hist_field)
|
||||
@@ -1512,21 +1532,6 @@ static int create_tracing_map_fields(str
|
||||
@@ -1481,21 +1501,6 @@ static int create_tracing_map_fields(str
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -128,7 +128,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
static struct hist_trigger_data *
|
||||
create_hist_data(unsigned int map_bits,
|
||||
struct hist_trigger_attrs *attrs,
|
||||
@@ -1552,8 +1557,7 @@ create_hist_data(unsigned int map_bits,
|
||||
@@ -1521,8 +1526,7 @@ create_hist_data(unsigned int map_bits,
|
||||
if (ret)
|
||||
goto free;
|
||||
|
||||
|
@ -138,7 +138,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
|
||||
hist_data->map = tracing_map_create(map_bits, hist_data->key_size,
|
||||
map_ops, hist_data);
|
||||
@@ -1741,7 +1745,13 @@ hist_trigger_entry_print(struct seq_file
|
||||
@@ -1710,7 +1714,13 @@ hist_trigger_entry_print(struct seq_file
|
||||
seq_printf(m, "%s: [%llx] %-55s", field_name,
|
||||
uval, str);
|
||||
} else if (key_field->flags & HIST_FIELD_FL_EXECNAME) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Anna-Maria Gleixner <anna-maria@linutronix.de>
|
||||
Date: Sun, 22 Oct 2017 23:39:58 +0200
|
||||
Subject: [PATCH 20/36] hrtimer: Unify handling of remote enqueue
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
hrtimer_reprogram() is conditionally invoked from hrtimer_start_range_ns()
|
||||
when hrtimer_cpu_base.hres_active is true.
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 17 Nov 2017 14:32:59 -0600
|
||||
Date: Wed, 6 Dec 2017 16:38:01 -0600
|
||||
Subject: [PATCH 20/37] tracing: Pass tracing_map_elt to hist_field accessor
|
||||
functions
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
Some accessor functions, such as for variable references, require
|
||||
access to a corrsponding tracing_map_elt.
|
||||
|
@ -182,7 +182,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
{
|
||||
struct hist_trigger_data *hist_data = hist_field->hist_data;
|
||||
struct trace_array *tr = hist_data->event_file->tr;
|
||||
@@ -1598,7 +1621,7 @@ static void hist_trigger_elt_update(stru
|
||||
@@ -1567,7 +1590,7 @@ static void hist_trigger_elt_update(stru
|
||||
|
||||
for_each_hist_val_field(i, hist_data) {
|
||||
hist_field = hist_data->fields[i];
|
||||
|
@ -191,7 +191,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
if (hist_field->flags & HIST_FIELD_FL_VAR) {
|
||||
var_idx = hist_field->var.idx;
|
||||
tracing_map_set_var(elt, var_idx, hist_val);
|
||||
@@ -1610,7 +1633,7 @@ static void hist_trigger_elt_update(stru
|
||||
@@ -1579,7 +1602,7 @@ static void hist_trigger_elt_update(stru
|
||||
for_each_hist_key_field(i, hist_data) {
|
||||
hist_field = hist_data->fields[i];
|
||||
if (hist_field->flags & HIST_FIELD_FL_VAR) {
|
||||
|
@ -200,7 +200,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
var_idx = hist_field->var.idx;
|
||||
tracing_map_set_var(elt, var_idx, hist_val);
|
||||
}
|
||||
@@ -1648,9 +1671,9 @@ static void event_hist_trigger(struct ev
|
||||
@@ -1617,9 +1640,9 @@ static void event_hist_trigger(struct ev
|
||||
bool use_compound_key = (hist_data->n_keys > 1);
|
||||
unsigned long entries[HIST_STACKTRACE_DEPTH];
|
||||
char compound_key[HIST_KEY_SIZE_MAX];
|
||||
|
@ -211,7 +211,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
u64 field_contents;
|
||||
void *key = NULL;
|
||||
unsigned int i;
|
||||
@@ -1671,7 +1694,7 @@ static void event_hist_trigger(struct ev
|
||||
@@ -1640,7 +1663,7 @@ static void event_hist_trigger(struct ev
|
||||
|
||||
key = entries;
|
||||
} else {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Anna-Maria Gleixner <anna-maria@linutronix.de>
|
||||
Date: Sun, 22 Oct 2017 23:39:59 +0200
|
||||
Subject: [PATCH 21/36] hrtimer: Make remote enqueue decision less restrictive
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
The current decision whether a timer can be queued on a remote CPU checks
|
||||
for timer->expiry <= remote_cpu_base.expires_next.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 17 Nov 2017 14:33:00 -0600
|
||||
Date: Wed, 6 Dec 2017 16:38:02 -0600
|
||||
Subject: [PATCH 21/37] tracing: Add hist_field 'type' field
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
Future support for synthetic events requires hist_field 'type'
|
||||
information, so add a field for that.
|
||||
|
@ -25,7 +25,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
struct hist_field *operands[HIST_FIELD_OPERANDS_MAX];
|
||||
struct hist_trigger_data *hist_data;
|
||||
struct hist_var var;
|
||||
@@ -712,6 +713,7 @@ static void destroy_hist_field(struct hi
|
||||
@@ -714,6 +715,7 @@ static void destroy_hist_field(struct hi
|
||||
|
||||
kfree(hist_field->var.name);
|
||||
kfree(hist_field->name);
|
||||
|
@ -33,7 +33,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
|
||||
kfree(hist_field);
|
||||
}
|
||||
@@ -737,6 +739,10 @@ static struct hist_field *create_hist_fi
|
||||
@@ -739,6 +741,10 @@ static struct hist_field *create_hist_fi
|
||||
|
||||
if (flags & HIST_FIELD_FL_HITCOUNT) {
|
||||
hist_field->fn = hist_field_counter;
|
||||
|
@ -44,7 +44,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
goto out;
|
||||
}
|
||||
|
||||
@@ -750,12 +756,18 @@ static struct hist_field *create_hist_fi
|
||||
@@ -752,12 +758,18 @@ static struct hist_field *create_hist_fi
|
||||
hist_field->fn = hist_field_log2;
|
||||
hist_field->operands[0] = create_hist_field(hist_data, field, fl, NULL);
|
||||
hist_field->size = hist_field->operands[0]->size;
|
||||
|
@ -63,7 +63,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
goto out;
|
||||
}
|
||||
|
||||
@@ -765,6 +777,11 @@ static struct hist_field *create_hist_fi
|
||||
@@ -767,6 +779,11 @@ static struct hist_field *create_hist_fi
|
||||
if (is_string_field(field)) {
|
||||
flags |= HIST_FIELD_FL_STRING;
|
||||
|
||||
|
@ -75,7 +75,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
if (field->filter_type == FILTER_STATIC_STRING)
|
||||
hist_field->fn = hist_field_string;
|
||||
else if (field->filter_type == FILTER_DYN_STRING)
|
||||
@@ -772,6 +789,12 @@ static struct hist_field *create_hist_fi
|
||||
@@ -774,6 +791,12 @@ static struct hist_field *create_hist_fi
|
||||
else
|
||||
hist_field->fn = hist_field_pstring;
|
||||
} else {
|
||||
|
@ -88,7 +88,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
hist_field->fn = select_value_fn(field->size,
|
||||
field->is_signed);
|
||||
if (!hist_field->fn) {
|
||||
@@ -981,6 +1004,11 @@ static struct hist_field *parse_unary(st
|
||||
@@ -950,6 +973,11 @@ static struct hist_field *parse_unary(st
|
||||
expr->operands[0] = operand1;
|
||||
expr->operator = FIELD_OP_UNARY_MINUS;
|
||||
expr->name = expr_str(expr, 0);
|
||||
|
@ -100,7 +100,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
|
||||
return expr;
|
||||
free:
|
||||
@@ -1070,6 +1098,11 @@ static struct hist_field *parse_expr(str
|
||||
@@ -1039,6 +1067,11 @@ static struct hist_field *parse_expr(str
|
||||
expr->operands[1] = operand2;
|
||||
expr->operator = field_op;
|
||||
expr->name = expr_str(expr, 0);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Anna-Maria Gleixner <anna-maria@linutronix.de>
|
||||
Date: Sun, 22 Oct 2017 23:40:00 +0200
|
||||
Subject: [PATCH 22/36] hrtimer: Remove base argument from hrtimer_reprogram()
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
hrtimer_reprogram() must have access to the hrtimer_clock_base of the new
|
||||
first expiring timer to access hrtimer_clock_base.offset for adjusting the
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 17 Nov 2017 14:33:01 -0600
|
||||
Date: Wed, 6 Dec 2017 16:38:03 -0600
|
||||
Subject: [PATCH 22/37] tracing: Add variable reference handling to hist
|
||||
triggers
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
Add the necessary infrastructure to allow the variables defined on one
|
||||
event to be referenced in another. This allows variables set by a
|
||||
|
@ -11,8 +11,8 @@ variable values saved by that previous event and the event fields of
|
|||
the current event. For example, here's how a latency can be
|
||||
calculated and saved into yet another variable named 'wakeup_lat':
|
||||
|
||||
# echo 'hist:keys=pid,prio:ts0=$common_timestamp ...
|
||||
# echo 'hist:keys=next_pid:wakeup_lat=$common_timestamp-$ts0 ...
|
||||
# echo 'hist:keys=pid,prio:ts0=common_timestamp ...
|
||||
# echo 'hist:keys=next_pid:wakeup_lat=common_timestamp-$ts0 ...
|
||||
|
||||
In the first event, the event's timetamp is saved into the variable
|
||||
ts0. In the next line, ts0 is subtracted from the second event's
|
||||
|
@ -27,9 +27,9 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
---
|
||||
kernel/trace/trace.c | 2
|
||||
kernel/trace/trace.h | 3
|
||||
kernel/trace/trace_events_hist.c | 632 ++++++++++++++++++++++++++++++++++--
|
||||
kernel/trace/trace_events_hist.c | 673 +++++++++++++++++++++++++++++++++++-
|
||||
kernel/trace/trace_events_trigger.c | 6
|
||||
4 files changed, 623 insertions(+), 20 deletions(-)
|
||||
4 files changed, 668 insertions(+), 16 deletions(-)
|
||||
|
||||
--- a/kernel/trace/trace.c
|
||||
+++ b/kernel/trace/trace.c
|
||||
|
@ -100,7 +100,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
};
|
||||
|
||||
static u64 hist_field_timestamp(struct hist_field *hist_field,
|
||||
@@ -271,6 +279,216 @@ static u64 hist_field_timestamp(struct h
|
||||
@@ -271,6 +279,214 @@ static u64 hist_field_timestamp(struct h
|
||||
return ts;
|
||||
}
|
||||
|
||||
|
@ -184,11 +184,9 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+ struct hist_field *found = NULL;
|
||||
+ struct hist_var_data *var_data;
|
||||
+
|
||||
+ found = find_var_ref(hist_data, hist_data, var_idx);
|
||||
+ if (found)
|
||||
+ return found;
|
||||
+
|
||||
+ list_for_each_entry(var_data, &tr->hist_vars, list) {
|
||||
+ if (var_data->hist_data == hist_data)
|
||||
+ continue;
|
||||
+ found = find_var_ref(var_data->hist_data, hist_data, var_idx);
|
||||
+ if (found)
|
||||
+ break;
|
||||
|
@ -317,7 +315,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
static struct hist_field *find_var_field(struct hist_trigger_data *hist_data,
|
||||
const char *var_name)
|
||||
{
|
||||
@@ -313,10 +531,148 @@ static struct hist_field *find_var(struc
|
||||
@@ -313,10 +529,150 @@ static struct hist_field *find_var(struc
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -335,6 +333,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+ list_for_each_entry(var_data, &tr->hist_vars, list) {
|
||||
+ var_hist_data = var_data->hist_data;
|
||||
+ file = var_hist_data->event_file;
|
||||
+ if (file == found)
|
||||
+ continue;
|
||||
+ call = file->event_call;
|
||||
+ name = trace_event_name(call);
|
||||
+
|
||||
|
@ -469,7 +469,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
@@ -331,8 +687,20 @@ static const char *hist_field_name(struc
|
||||
field_name = hist_field_name(field->operands[0], ++level);
|
||||
else if (field->flags & HIST_FIELD_FL_TIMESTAMP)
|
||||
field_name = "$common_timestamp";
|
||||
field_name = "common_timestamp";
|
||||
- else if (field->flags & HIST_FIELD_FL_EXPR)
|
||||
- field_name = field->name;
|
||||
+ else if (field->flags & HIST_FIELD_FL_EXPR ||
|
||||
|
@ -489,7 +489,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
|
||||
if (field_name == NULL)
|
||||
field_name = "";
|
||||
@@ -636,6 +1004,8 @@ static char *expr_str(struct hist_field
|
||||
@@ -638,6 +1006,8 @@ static char *expr_str(struct hist_field
|
||||
return expr;
|
||||
}
|
||||
|
||||
|
@ -498,7 +498,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
strcat(expr, hist_field_name(field->operands[0], 0));
|
||||
if (field->operands[0]->flags) {
|
||||
const char *flags_str = get_hist_field_flags(field->operands[0]);
|
||||
@@ -658,6 +1028,8 @@ static char *expr_str(struct hist_field
|
||||
@@ -660,6 +1030,8 @@ static char *expr_str(struct hist_field
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -507,7 +507,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
strcat(expr, hist_field_name(field->operands[1], 0));
|
||||
if (field->operands[1]->flags) {
|
||||
const char *flags_str = get_hist_field_flags(field->operands[1]);
|
||||
@@ -737,6 +1109,11 @@ static struct hist_field *create_hist_fi
|
||||
@@ -739,6 +1111,11 @@ static struct hist_field *create_hist_fi
|
||||
if (flags & HIST_FIELD_FL_EXPR)
|
||||
goto out; /* caller will populate */
|
||||
|
||||
|
@ -519,7 +519,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
if (flags & HIST_FIELD_FL_HITCOUNT) {
|
||||
hist_field->fn = hist_field_counter;
|
||||
hist_field->size = sizeof(u64);
|
||||
@@ -830,6 +1207,77 @@ static void destroy_hist_fields(struct h
|
||||
@@ -832,6 +1209,142 @@ static void destroy_hist_fields(struct h
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -594,30 +594,53 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+ return true;
|
||||
+}
|
||||
+
|
||||
static char *field_name_from_var(struct hist_trigger_data *hist_data,
|
||||
char *var_name)
|
||||
{
|
||||
@@ -841,7 +1289,7 @@ static char *field_name_from_var(struct
|
||||
|
||||
if (strcmp(var_name, name) == 0) {
|
||||
field = hist_data->attrs->var_defs.expr[i];
|
||||
- if (contains_operator(field))
|
||||
+static char *field_name_from_var(struct hist_trigger_data *hist_data,
|
||||
+ char *var_name)
|
||||
+{
|
||||
+ char *name, *field;
|
||||
+ unsigned int i;
|
||||
+
|
||||
+ for (i = 0; i < hist_data->attrs->var_defs.n_vars; i++) {
|
||||
+ name = hist_data->attrs->var_defs.name[i];
|
||||
+
|
||||
+ if (strcmp(var_name, name) == 0) {
|
||||
+ field = hist_data->attrs->var_defs.expr[i];
|
||||
+ if (contains_operator(field) || is_var_ref(field))
|
||||
continue;
|
||||
return field;
|
||||
}
|
||||
@@ -853,11 +1301,32 @@ static char *field_name_from_var(struct
|
||||
static char *local_field_var_ref(struct hist_trigger_data *hist_data,
|
||||
char *var_name)
|
||||
{
|
||||
+ continue;
|
||||
+ return field;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+static char *local_field_var_ref(struct hist_trigger_data *hist_data,
|
||||
+ char *system, char *event_name,
|
||||
+ char *var_name)
|
||||
+{
|
||||
+ struct trace_event_call *call;
|
||||
+
|
||||
+ if (system && event_name) {
|
||||
+ call = hist_data->event_file->event_call;
|
||||
+
|
||||
+ if (strcmp(system, call->class->system) != 0)
|
||||
+ return NULL;
|
||||
+
|
||||
+ if (strcmp(event_name, trace_event_name(call)) != 0)
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ if (!!system != !!event_name)
|
||||
+ return NULL;
|
||||
+
|
||||
+ if (!is_var_ref(var_name))
|
||||
+ return NULL;
|
||||
+
|
||||
var_name++;
|
||||
|
||||
return field_name_from_var(hist_data, var_name);
|
||||
}
|
||||
|
||||
+ var_name++;
|
||||
+
|
||||
+ return field_name_from_var(hist_data, var_name);
|
||||
+}
|
||||
+
|
||||
+static struct hist_field *parse_var_ref(struct hist_trigger_data *hist_data,
|
||||
+ char *system, char *event_name,
|
||||
+ char *var_name)
|
||||
|
@ -639,18 +662,15 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
static struct ftrace_event_field *
|
||||
parse_field(struct hist_trigger_data *hist_data, struct trace_event_file *file,
|
||||
char *field_str, unsigned long *flags)
|
||||
@@ -914,13 +1383,38 @@ struct hist_field *parse_atom(struct his
|
||||
@@ -888,10 +1401,40 @@ struct hist_field *parse_atom(struct his
|
||||
struct trace_event_file *file, char *str,
|
||||
unsigned long *flags, char *var_name)
|
||||
{
|
||||
- char *s;
|
||||
+ char *s, *ref_system = NULL, *ref_event = NULL, *ref_var = str;
|
||||
struct ftrace_event_field *field = NULL;
|
||||
struct hist_field *hist_field = NULL;
|
||||
int ret = 0;
|
||||
|
||||
- s = local_field_var_ref(hist_data, str);
|
||||
- if (s)
|
||||
+ s = strchr(str, '.');
|
||||
+ if (s) {
|
||||
+ s = strchr(++s, '.');
|
||||
|
@ -669,7 +689,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+ }
|
||||
+ }
|
||||
+
|
||||
+ s = local_field_var_ref(hist_data, ref_var);
|
||||
+ s = local_field_var_ref(hist_data, ref_system, ref_event, ref_var);
|
||||
+ if (!s) {
|
||||
+ hist_field = parse_var_ref(hist_data, ref_system, ref_event, ref_var);
|
||||
+ if (hist_field) {
|
||||
|
@ -678,10 +698,12 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+ return hist_field;
|
||||
+ }
|
||||
+ } else
|
||||
str = s;
|
||||
|
||||
+ str = s;
|
||||
+
|
||||
field = parse_field(hist_data, file, str, flags);
|
||||
@@ -1094,6 +1588,9 @@ static struct hist_field *parse_expr(str
|
||||
if (IS_ERR(field)) {
|
||||
ret = PTR_ERR(field);
|
||||
@@ -1063,6 +1606,9 @@ static struct hist_field *parse_expr(str
|
||||
goto free;
|
||||
}
|
||||
|
||||
|
@ -691,7 +713,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
expr->operands[0] = operand1;
|
||||
expr->operands[1] = operand2;
|
||||
expr->operator = field_op;
|
||||
@@ -1266,6 +1763,12 @@ static int create_key_field(struct hist_
|
||||
@@ -1235,6 +1781,12 @@ static int create_key_field(struct hist_
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
@ -704,7 +726,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
key_size = hist_field->size;
|
||||
}
|
||||
|
||||
@@ -1604,6 +2107,7 @@ create_hist_data(unsigned int map_bits,
|
||||
@@ -1573,6 +2125,7 @@ create_hist_data(unsigned int map_bits,
|
||||
|
||||
hist_data->attrs = attrs;
|
||||
hist_data->remove = remove;
|
||||
|
@ -712,7 +734,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
|
||||
ret = create_hist_fields(hist_data, file);
|
||||
if (ret)
|
||||
@@ -1626,12 +2130,6 @@ create_hist_data(unsigned int map_bits,
|
||||
@@ -1595,12 +2148,6 @@ create_hist_data(unsigned int map_bits,
|
||||
ret = create_tracing_map_fields(hist_data);
|
||||
if (ret)
|
||||
goto free;
|
||||
|
@ -725,7 +747,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
out:
|
||||
return hist_data;
|
||||
free:
|
||||
@@ -1646,12 +2144,17 @@ create_hist_data(unsigned int map_bits,
|
||||
@@ -1615,12 +2162,17 @@ create_hist_data(unsigned int map_bits,
|
||||
|
||||
static void hist_trigger_elt_update(struct hist_trigger_data *hist_data,
|
||||
struct tracing_map_elt *elt, void *rec,
|
||||
|
@ -744,7 +766,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
for_each_hist_val_field(i, hist_data) {
|
||||
hist_field = hist_data->fields[i];
|
||||
hist_val = hist_field->fn(hist_field, elt, rbe, rec);
|
||||
@@ -1703,6 +2206,7 @@ static void event_hist_trigger(struct ev
|
||||
@@ -1672,6 +2224,7 @@ static void event_hist_trigger(struct ev
|
||||
struct hist_trigger_data *hist_data = data->private_data;
|
||||
bool use_compound_key = (hist_data->n_keys > 1);
|
||||
unsigned long entries[HIST_STACKTRACE_DEPTH];
|
||||
|
@ -752,7 +774,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
char compound_key[HIST_KEY_SIZE_MAX];
|
||||
struct tracing_map_elt *elt = NULL;
|
||||
struct stack_trace stacktrace;
|
||||
@@ -1742,9 +2246,15 @@ static void event_hist_trigger(struct ev
|
||||
@@ -1711,9 +2264,15 @@ static void event_hist_trigger(struct ev
|
||||
if (use_compound_key)
|
||||
key = compound_key;
|
||||
|
||||
|
@ -770,10 +792,10 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
}
|
||||
|
||||
static void hist_trigger_stacktrace_print(struct seq_file *m,
|
||||
@@ -1961,8 +2471,11 @@ static void hist_field_print(struct seq_
|
||||
@@ -1930,8 +2489,11 @@ static void hist_field_print(struct seq_
|
||||
|
||||
if (hist_field->flags & HIST_FIELD_FL_TIMESTAMP)
|
||||
seq_puts(m, "$common_timestamp");
|
||||
seq_puts(m, "common_timestamp");
|
||||
- else if (field_name)
|
||||
+ else if (field_name) {
|
||||
+ if (hist_field->flags & HIST_FIELD_FL_VAR_REF)
|
||||
|
@ -783,7 +805,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
|
||||
if (hist_field->flags) {
|
||||
const char *flags_str = get_hist_field_flags(hist_field);
|
||||
@@ -2102,7 +2615,11 @@ static void event_hist_trigger_free(stru
|
||||
@@ -2071,7 +2633,11 @@ static void event_hist_trigger_free(stru
|
||||
if (!data->ref) {
|
||||
if (data->name)
|
||||
del_named_trigger(data);
|
||||
|
@ -795,7 +817,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
destroy_hist_data(hist_data);
|
||||
}
|
||||
}
|
||||
@@ -2315,23 +2832,55 @@ static int hist_register_trigger(char *g
|
||||
@@ -2284,23 +2850,55 @@ static int hist_register_trigger(char *g
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
@ -855,7 +877,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
static void hist_unregister_trigger(char *glob, struct event_trigger_ops *ops,
|
||||
struct event_trigger_data *data,
|
||||
struct trace_event_file *file)
|
||||
@@ -2364,11 +2913,30 @@ static void hist_unregister_trigger(char
|
||||
@@ -2333,11 +2931,30 @@ static void hist_unregister_trigger(char
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -886,7 +908,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
list_for_each_entry_safe(test, n, &file->triggers, list) {
|
||||
if (test->cmd_ops->trigger_type == ETT_EVENT_HIST) {
|
||||
hist_data = test->private_data;
|
||||
@@ -2444,6 +3012,11 @@ static int event_hist_trigger_func(struc
|
||||
@@ -2413,6 +3030,11 @@ static int event_hist_trigger_func(struc
|
||||
}
|
||||
|
||||
if (remove) {
|
||||
|
@ -898,7 +920,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
cmd_ops->unreg(glob+1, trigger_ops, trigger_data, file);
|
||||
ret = 0;
|
||||
goto out_free;
|
||||
@@ -2461,14 +3034,33 @@ static int event_hist_trigger_func(struc
|
||||
@@ -2430,14 +3052,33 @@ static int event_hist_trigger_func(struc
|
||||
goto out_free;
|
||||
} else if (ret < 0)
|
||||
goto out_free;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Anna-Maria Gleixner <anna-maria@linutronix.de>
|
||||
Date: Sun, 22 Oct 2017 23:40:01 +0200
|
||||
Subject: [PATCH 23/36] hrtimer: Split hrtimer_start_range_ns()
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
Preparatory patch for softirq based hrtimers to avoid code duplication. No
|
||||
functional change.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 17 Nov 2017 14:33:02 -0600
|
||||
Date: Wed, 6 Dec 2017 16:38:04 -0600
|
||||
Subject: [PATCH 23/37] tracing: Add hist trigger action hook
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
Add a hook for executing extra actions whenever a histogram entry is
|
||||
added or updated.
|
||||
|
@ -17,8 +17,8 @@ implemented on top of it in later patches.
|
|||
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
---
|
||||
kernel/trace/trace_events_hist.c | 108 +++++++++++++++++++++++++++++++++++++--
|
||||
1 file changed, 105 insertions(+), 3 deletions(-)
|
||||
kernel/trace/trace_events_hist.c | 106 ++++++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 104 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/kernel/trace/trace_events_hist.c
|
||||
+++ b/kernel/trace/trace_events_hist.c
|
||||
|
@ -101,7 +101,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
}
|
||||
}
|
||||
|
||||
@@ -2038,11 +2071,55 @@ static int create_sort_keys(struct hist_
|
||||
@@ -2056,11 +2089,55 @@ static int create_sort_keys(struct hist_
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -157,7 +157,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
kfree(hist_data);
|
||||
}
|
||||
|
||||
@@ -2109,6 +2186,10 @@ create_hist_data(unsigned int map_bits,
|
||||
@@ -2127,6 +2204,10 @@ create_hist_data(unsigned int map_bits,
|
||||
hist_data->remove = remove;
|
||||
hist_data->event_file = file;
|
||||
|
||||
|
@ -168,7 +168,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
ret = create_hist_fields(hist_data, file);
|
||||
if (ret)
|
||||
goto free;
|
||||
@@ -2200,6 +2281,20 @@ static inline void add_to_key(char *comp
|
||||
@@ -2218,6 +2299,20 @@ static inline void add_to_key(char *comp
|
||||
memcpy(compound_key + key_field->offset, key, size);
|
||||
}
|
||||
|
||||
|
@ -189,7 +189,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
static void event_hist_trigger(struct event_trigger_data *data, void *rec,
|
||||
struct ring_buffer_event *rbe)
|
||||
{
|
||||
@@ -2255,6 +2350,9 @@ static void event_hist_trigger(struct ev
|
||||
@@ -2273,6 +2368,9 @@ static void event_hist_trigger(struct ev
|
||||
return;
|
||||
|
||||
hist_trigger_elt_update(hist_data, elt, rec, rbe, var_ref_vals);
|
||||
|
@ -199,7 +199,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
}
|
||||
|
||||
static void hist_trigger_stacktrace_print(struct seq_file *m,
|
||||
@@ -3041,6 +3139,10 @@ static int event_hist_trigger_func(struc
|
||||
@@ -3059,6 +3157,10 @@ static int event_hist_trigger_func(struc
|
||||
if (has_hist_vars(hist_data))
|
||||
save_hist_vars(hist_data);
|
||||
|
||||
|
@ -210,13 +210,3 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
ret = tracing_map_init(hist_data->map);
|
||||
if (ret)
|
||||
goto out_unreg;
|
||||
@@ -3062,8 +3164,8 @@ static int event_hist_trigger_func(struc
|
||||
remove_hist_vars(hist_data);
|
||||
|
||||
kfree(trigger_data);
|
||||
-
|
||||
destroy_hist_data(hist_data);
|
||||
+
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Anna-Maria Gleixner <anna-maria@linutronix.de>
|
||||
Date: Sun, 22 Oct 2017 23:40:02 +0200
|
||||
Subject: [PATCH 24/36] hrtimer: Split __hrtimer_get_next_event()
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
Preparatory patch for softirq based hrtimers to avoid code duplication. No
|
||||
functional change.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 17 Nov 2017 14:33:03 -0600
|
||||
Date: Wed, 6 Dec 2017 16:38:05 -0600
|
||||
Subject: [PATCH 24/37] tracing: Add support for 'synthetic' events
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
Synthetic events are user-defined events generated from hist trigger
|
||||
variables saved from one or more other events.
|
||||
|
@ -50,8 +50,8 @@ Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
|
|||
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
|
||||
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
---
|
||||
kernel/trace/trace_events_hist.c | 908 ++++++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 906 insertions(+), 2 deletions(-)
|
||||
kernel/trace/trace_events_hist.c | 899 ++++++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 897 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/kernel/trace/trace_events_hist.c
|
||||
+++ b/kernel/trace/trace_events_hist.c
|
||||
|
@ -99,7 +99,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
struct action_data;
|
||||
|
||||
typedef void (*action_fn_t) (struct hist_trigger_data *hist_data,
|
||||
@@ -282,6 +308,803 @@ struct action_data {
|
||||
@@ -282,6 +308,794 @@ struct action_data {
|
||||
unsigned int var_ref_idx;
|
||||
};
|
||||
|
||||
|
@ -267,7 +267,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+ fmt = "%lu";
|
||||
+ else if (strcmp(type, "pid_t") == 0)
|
||||
+ fmt = "%d";
|
||||
+ else if (strchr(type, '[') != NULL)
|
||||
+ else if (synth_field_is_string(type))
|
||||
+ fmt = "%s";
|
||||
+
|
||||
+ return fmt;
|
||||
|
@ -356,7 +356,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+ strncpy(str_field, str_val, STR_VAR_LEN_MAX);
|
||||
+ n_u64 += STR_VAR_LEN_MAX / sizeof(u64);
|
||||
+ } else {
|
||||
+ entry->fields[i] = var_ref_vals[var_ref_idx + i];
|
||||
+ entry->fields[n_u64] = var_ref_vals[var_ref_idx + i];
|
||||
+ n_u64++;
|
||||
+ }
|
||||
+ }
|
||||
|
@ -666,6 +666,20 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+ return event;
|
||||
+}
|
||||
+
|
||||
+static void add_or_delete_synth_event(struct synth_event *event, int delete)
|
||||
+{
|
||||
+ if (delete)
|
||||
+ free_synth_event(event);
|
||||
+ else {
|
||||
+ mutex_lock(&synth_event_mutex);
|
||||
+ if (!find_synth_event(event->name))
|
||||
+ list_add(&event->list, &synth_event_list);
|
||||
+ else
|
||||
+ free_synth_event(event);
|
||||
+ mutex_unlock(&synth_event_mutex);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static int create_synth_event(int argc, char **argv)
|
||||
+{
|
||||
+ struct synth_field *field, *fields[SYNTH_FIELDS_MAX];
|
||||
|
@ -749,23 +763,10 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+ if (event) {
|
||||
+ if (delete_event) {
|
||||
+ ret = unregister_synth_event(event);
|
||||
+ if (!ret)
|
||||
+ free_synth_event(event);
|
||||
+ else {
|
||||
+ mutex_lock(&synth_event_mutex);
|
||||
+ if (!find_synth_event(event->name))
|
||||
+ list_add(&event->list, &synth_event_list);
|
||||
+ mutex_unlock(&synth_event_mutex);
|
||||
+ }
|
||||
+ add_or_delete_synth_event(event, !ret);
|
||||
+ } else {
|
||||
+ ret = register_synth_event(event);
|
||||
+ if (!ret) {
|
||||
+ mutex_lock(&synth_event_mutex);
|
||||
+ if (!find_synth_event(event->name))
|
||||
+ list_add(&event->list, &synth_event_list);
|
||||
+ mutex_unlock(&synth_event_mutex);
|
||||
+ } else
|
||||
+ free_synth_event(event);
|
||||
+ add_or_delete_synth_event(event, ret);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
|
@ -797,10 +798,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+ }
|
||||
+ }
|
||||
+
|
||||
+ list_for_each_entry_safe(event, e, &synth_event_list, list) {
|
||||
+ list_del(&event->list);
|
||||
+ list_add(&event->list, &release_events);
|
||||
+ }
|
||||
+ list_for_each_entry_safe(event, e, &synth_event_list, list)
|
||||
+ list_move(&event->list, &release_events);
|
||||
+
|
||||
+ mutex_unlock(&synth_event_mutex);
|
||||
+
|
||||
|
@ -808,15 +807,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+ list_del(&event->list);
|
||||
+
|
||||
+ ret = unregister_synth_event(event);
|
||||
+ if (ret == 0)
|
||||
+ free_synth_event(event);
|
||||
+ else {
|
||||
+ err = ret;
|
||||
+ mutex_lock(&synth_event_mutex);
|
||||
+ if (!find_synth_event(event->name))
|
||||
+ list_add(&event->list, &synth_event_list);
|
||||
+ mutex_unlock(&synth_event_mutex);
|
||||
+ }
|
||||
+ add_or_delete_synth_event(event, !ret);
|
||||
+ }
|
||||
+
|
||||
+ if (err)
|
||||
|
@ -903,7 +894,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
static u64 hist_field_timestamp(struct hist_field *hist_field,
|
||||
struct tracing_map_elt *elt,
|
||||
struct ring_buffer_event *rbe,
|
||||
@@ -2956,6 +3779,28 @@ static int hist_trigger_enable(struct ev
|
||||
@@ -2974,6 +3788,28 @@ static int hist_trigger_enable(struct ev
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -932,7 +923,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
static bool hist_trigger_check_refs(struct event_trigger_data *data,
|
||||
struct trace_event_file *file)
|
||||
{
|
||||
@@ -3031,6 +3876,8 @@ static void hist_unreg_all(struct trace_
|
||||
@@ -3049,6 +3885,8 @@ static void hist_unreg_all(struct trace_
|
||||
{
|
||||
struct event_trigger_data *test, *n;
|
||||
struct hist_trigger_data *hist_data;
|
||||
|
@ -941,7 +932,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
|
||||
if (hist_file_check_refs(file))
|
||||
return;
|
||||
@@ -3040,6 +3887,14 @@ static void hist_unreg_all(struct trace_
|
||||
@@ -3058,6 +3896,14 @@ static void hist_unreg_all(struct trace_
|
||||
hist_data = test->private_data;
|
||||
list_del_rcu(&test->list);
|
||||
trace_event_trigger_enable_disable(file, 0);
|
||||
|
@ -954,9 +945,9 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+ mutex_unlock(&synth_event_mutex);
|
||||
+
|
||||
update_cond_flag(file);
|
||||
if (test->ops->free)
|
||||
test->ops->free(test->ops, test);
|
||||
@@ -3058,6 +3913,8 @@ static int event_hist_trigger_func(struc
|
||||
if (hist_data->enable_timestamps)
|
||||
tracing_set_time_stamp_abs(file->tr, false);
|
||||
@@ -3076,6 +3922,8 @@ static int event_hist_trigger_func(struc
|
||||
struct hist_trigger_attrs *attrs;
|
||||
struct event_trigger_ops *trigger_ops;
|
||||
struct hist_trigger_data *hist_data;
|
||||
|
@ -965,7 +956,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
bool remove = false;
|
||||
char *trigger;
|
||||
int ret = 0;
|
||||
@@ -3088,10 +3945,11 @@ static int event_hist_trigger_func(struc
|
||||
@@ -3106,10 +3954,11 @@ static int event_hist_trigger_func(struc
|
||||
|
||||
trigger_ops = cmd_ops->get_trigger_ops(cmd, trigger);
|
||||
|
||||
|
@ -979,7 +970,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
|
||||
trigger_data->count = -1;
|
||||
trigger_data->ops = trigger_ops;
|
||||
@@ -3110,12 +3968,23 @@ static int event_hist_trigger_func(struc
|
||||
@@ -3128,12 +3977,23 @@ static int event_hist_trigger_func(struc
|
||||
}
|
||||
|
||||
if (remove) {
|
||||
|
@ -1003,7 +994,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
ret = 0;
|
||||
goto out_free;
|
||||
}
|
||||
@@ -3151,6 +4020,13 @@ static int event_hist_trigger_func(struc
|
||||
@@ -3169,6 +4029,13 @@ static int event_hist_trigger_func(struc
|
||||
if (ret)
|
||||
goto out_unreg;
|
||||
|
||||
|
@ -1017,7 +1008,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
/* Just return zero, not the number of registered triggers */
|
||||
ret = 0;
|
||||
out:
|
||||
@@ -3323,3 +4199,31 @@ static __init void unregister_trigger_hi
|
||||
@@ -3341,3 +4208,31 @@ static __init void unregister_trigger_hi
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Anna-Maria Gleixner <anna-maria@linutronix.de>
|
||||
Date: Sun, 22 Oct 2017 23:40:03 +0200
|
||||
Subject: [PATCH 25/36] hrtimer: Use irqsave/irqrestore around __run_hrtimer()
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
__run_hrtimer() is called with the hrtimer_cpu_base.lock held and
|
||||
interrupts disabled. Before invoking the timer callback the base lock is
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 17 Nov 2017 14:33:04 -0600
|
||||
Date: Wed, 6 Dec 2017 16:38:06 -0600
|
||||
Subject: [PATCH 25/37] tracing: Add support for 'field variables'
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
Users should be able to directly specify event fields in hist trigger
|
||||
'actions' rather than being forced to explicitly create a variable for
|
||||
|
@ -31,18 +31,18 @@ once a hist trigger is defined, variables can't be added to it later.
|
|||
echo 'wakeup_latency u64 lat; pid_t pid; int prio' >>
|
||||
/sys/kernel/debug/tracing/synthetic_events
|
||||
|
||||
echo 'hist:keys=pid:ts0=$common_timestamp.usecs >>
|
||||
echo 'hist:keys=pid:ts0=common_timestamp.usecs >>
|
||||
/sys/kernel/debug/tracing/events/sched/sched_waking/trigger
|
||||
|
||||
echo 'hist:keys=next_pid:wakeup_lat=$common_timestamp.usecs-$ts0:
|
||||
echo 'hist:keys=next_pid:wakeup_lat=common_timestamp.usecs-$ts0:
|
||||
onmatch(sched.sched_waking).wakeup_latency($wakeup_lat,next_pid,prio)
|
||||
>> /sys/kernel/debug/tracing/events/sched/sched_switch/trigger
|
||||
|
||||
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
---
|
||||
kernel/trace/trace_events_hist.c | 536 ++++++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 535 insertions(+), 1 deletion(-)
|
||||
kernel/trace/trace_events_hist.c | 531 ++++++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 530 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/kernel/trace/trace_events_hist.c
|
||||
+++ b/kernel/trace/trace_events_hist.c
|
||||
|
@ -63,13 +63,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
struct hist_trigger_data {
|
||||
struct hist_field *fields[HIST_FIELDS_MAX];
|
||||
unsigned int n_vals;
|
||||
@@ -274,6 +284,14 @@ struct hist_trigger_data {
|
||||
@@ -274,6 +284,12 @@ struct hist_trigger_data {
|
||||
|
||||
struct action_data *actions[HIST_ACTIONS_MAX];
|
||||
unsigned int n_actions;
|
||||
+
|
||||
+ struct hist_field *synth_var_refs[SYNTH_FIELDS_MAX];
|
||||
+ unsigned int n_synth_var_refs;
|
||||
+ struct field_var *field_vars[SYNTH_FIELDS_MAX];
|
||||
+ unsigned int n_field_vars;
|
||||
+ unsigned int n_field_var_str;
|
||||
|
@ -78,16 +76,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
};
|
||||
|
||||
struct synth_field {
|
||||
@@ -1387,6 +1405,8 @@ static struct trace_event_file *find_var
|
||||
list_for_each_entry(var_data, &tr->hist_vars, list) {
|
||||
var_hist_data = var_data->hist_data;
|
||||
file = var_hist_data->event_file;
|
||||
+ if (file == found)
|
||||
+ continue;
|
||||
call = file->event_call;
|
||||
name = trace_event_name(call);
|
||||
|
||||
@@ -1453,6 +1473,7 @@ static struct hist_field *find_event_var
|
||||
@@ -1444,6 +1460,7 @@ static struct hist_field *find_event_var
|
||||
struct hist_elt_data {
|
||||
char *comm;
|
||||
u64 *var_ref_vals;
|
||||
|
@ -95,7 +84,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
};
|
||||
|
||||
static u64 hist_field_var_ref(struct hist_field *hist_field,
|
||||
@@ -1757,6 +1778,11 @@ static inline void save_comm(char *comm,
|
||||
@@ -1748,6 +1765,11 @@ static inline void save_comm(char *comm,
|
||||
|
||||
static void hist_elt_data_free(struct hist_elt_data *elt_data)
|
||||
{
|
||||
|
@ -107,7 +96,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
kfree(elt_data->comm);
|
||||
kfree(elt_data);
|
||||
}
|
||||
@@ -1774,7 +1800,7 @@ static int hist_trigger_elt_data_alloc(s
|
||||
@@ -1765,7 +1787,7 @@ static int hist_trigger_elt_data_alloc(s
|
||||
unsigned int size = TASK_COMM_LEN + 1;
|
||||
struct hist_elt_data *elt_data;
|
||||
struct hist_field *key_field;
|
||||
|
@ -116,7 +105,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
|
||||
elt_data = kzalloc(sizeof(*elt_data), GFP_KERNEL);
|
||||
if (!elt_data)
|
||||
@@ -1793,6 +1819,18 @@ static int hist_trigger_elt_data_alloc(s
|
||||
@@ -1784,6 +1806,18 @@ static int hist_trigger_elt_data_alloc(s
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -135,7 +124,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
elt->private_data = elt_data;
|
||||
|
||||
return 0;
|
||||
@@ -2477,6 +2515,471 @@ static struct hist_field *parse_expr(str
|
||||
@@ -2486,6 +2520,470 @@ static struct hist_field *parse_expr(str
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
|
||||
|
@ -305,7 +294,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+ /* See if a synthetic field variable has already been created */
|
||||
+ event_var = find_synthetic_field_var(target_hist_data, subsys_name,
|
||||
+ event_name, field_name);
|
||||
+ if (event_var && !IS_ERR(event_var))
|
||||
+ if (!IS_ERR_OR_NULL(event_var))
|
||||
+ return event_var;
|
||||
+
|
||||
+ var_hist = kzalloc(sizeof(*var_hist), GFP_KERNEL);
|
||||
|
@ -367,8 +356,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+ /* If we can't find the variable, something went wrong */
|
||||
+ event_var = find_synthetic_field_var(target_hist_data, subsys_name,
|
||||
+ event_name, field_name);
|
||||
+ if (!event_var || IS_ERR(event_var)) {
|
||||
+ kfree(cmd);
|
||||
+ if (IS_ERR_OR_NULL(event_var)) {
|
||||
+ kfree(var_hist->cmd);
|
||||
+ kfree(var_hist);
|
||||
+ return ERR_PTR(-EINVAL);
|
||||
|
@ -607,7 +595,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
static int create_hitcount_val(struct hist_trigger_data *hist_data)
|
||||
{
|
||||
hist_data->fields[HITCOUNT_IDX] =
|
||||
@@ -2932,6 +3435,16 @@ static int create_actions(struct hist_tr
|
||||
@@ -2941,6 +3439,16 @@ static int create_actions(struct hist_tr
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -624,7 +612,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
static void destroy_hist_data(struct hist_trigger_data *hist_data)
|
||||
{
|
||||
if (!hist_data)
|
||||
@@ -2942,6 +3455,8 @@ static void destroy_hist_data(struct his
|
||||
@@ -2951,6 +3459,8 @@ static void destroy_hist_data(struct his
|
||||
tracing_map_destroy(hist_data->map);
|
||||
|
||||
destroy_actions(hist_data);
|
||||
|
@ -633,7 +621,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
|
||||
kfree(hist_data);
|
||||
}
|
||||
@@ -3078,6 +3593,8 @@ static void hist_trigger_elt_update(stru
|
||||
@@ -3087,6 +3597,8 @@ static void hist_trigger_elt_update(stru
|
||||
tracing_map_set_var(elt, var_idx, hist_val);
|
||||
}
|
||||
}
|
||||
|
@ -642,8 +630,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
}
|
||||
|
||||
static inline void add_to_key(char *compound_key, void *key,
|
||||
@@ -3824,6 +4341,21 @@ static bool hist_trigger_check_refs(stru
|
||||
return false;
|
||||
@@ -3533,6 +4045,21 @@ static int event_hist_trigger_init(struc
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static void unregister_field_var_hists(struct hist_trigger_data *hist_data)
|
||||
|
@ -661,22 +649,15 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+ }
|
||||
+}
|
||||
+
|
||||
static void hist_unregister_trigger(char *glob, struct event_trigger_ops *ops,
|
||||
struct event_trigger_data *data,
|
||||
struct trace_event_file *file)
|
||||
@@ -3839,6 +4371,7 @@ static void hist_unregister_trigger(char
|
||||
if (test->cmd_ops->trigger_type == ETT_EVENT_HIST) {
|
||||
if (!hist_trigger_match(data, test, named_data, false))
|
||||
continue;
|
||||
+ unregister_field_var_hists(test->private_data);
|
||||
unregistered = true;
|
||||
list_del_rcu(&test->list);
|
||||
trace_event_trigger_enable_disable(file, 0);
|
||||
@@ -3885,6 +4418,7 @@ static void hist_unreg_all(struct trace_
|
||||
list_for_each_entry_safe(test, n, &file->triggers, list) {
|
||||
if (test->cmd_ops->trigger_type == ETT_EVENT_HIST) {
|
||||
hist_data = test->private_data;
|
||||
+ unregister_field_var_hists(hist_data);
|
||||
list_del_rcu(&test->list);
|
||||
trace_event_trigger_enable_disable(file, 0);
|
||||
static void event_hist_trigger_free(struct event_trigger_ops *ops,
|
||||
struct event_trigger_data *data)
|
||||
{
|
||||
@@ -3550,6 +4077,8 @@ static void event_hist_trigger_free(stru
|
||||
|
||||
remove_hist_vars(hist_data);
|
||||
|
||||
+ unregister_field_var_hists(hist_data);
|
||||
+
|
||||
destroy_hist_data(hist_data);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ From: Anna-Maria Gleixner <anna-maria@linutronix.de>
|
|||
Date: Sun, 22 Oct 2017 23:40:04 +0200
|
||||
Subject: [PATCH 26/36] hrtimer: Add clock bases and hrtimer mode for soft irq
|
||||
context
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
hrtimer callback functions are always executed in hard interrupt
|
||||
context. Users of hrtimer which need their timer function to be executed
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 17 Nov 2017 14:33:05 -0600
|
||||
Date: Wed, 6 Dec 2017 16:38:07 -0600
|
||||
Subject: [PATCH 26/37] tracing: Add 'onmatch' hist trigger action support
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
Add an 'onmatch(matching.event).<synthetic_event_name>(param list)'
|
||||
hist trigger action which is invoked with the set of variables or
|
||||
|
@ -43,12 +43,21 @@ Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
|
|||
Signed-off-by: Rajvi Jingar <rajvi.jingar@intel.com>
|
||||
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
---
|
||||
kernel/trace/trace_events_hist.c | 472 +++++++++++++++++++++++++++++++++++++--
|
||||
1 file changed, 459 insertions(+), 13 deletions(-)
|
||||
kernel/trace/trace_events_hist.c | 488 +++++++++++++++++++++++++++++++++++++--
|
||||
1 file changed, 475 insertions(+), 13 deletions(-)
|
||||
|
||||
--- a/kernel/trace/trace_events_hist.c
|
||||
+++ b/kernel/trace/trace_events_hist.c
|
||||
@@ -323,7 +323,18 @@ typedef void (*action_fn_t) (struct hist
|
||||
@@ -285,6 +285,8 @@ struct hist_trigger_data {
|
||||
struct action_data *actions[HIST_ACTIONS_MAX];
|
||||
unsigned int n_actions;
|
||||
|
||||
+ struct hist_field *synth_var_refs[SYNTH_FIELDS_MAX];
|
||||
+ unsigned int n_synth_var_refs;
|
||||
struct field_var *field_vars[SYNTH_FIELDS_MAX];
|
||||
unsigned int n_field_vars;
|
||||
unsigned int n_field_var_str;
|
||||
@@ -321,7 +323,18 @@ typedef void (*action_fn_t) (struct hist
|
||||
|
||||
struct action_data {
|
||||
action_fn_t fn;
|
||||
|
@ -68,7 +77,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
};
|
||||
|
||||
static LIST_HEAD(synth_event_list);
|
||||
@@ -889,6 +900,21 @@ static struct synth_event *alloc_synth_e
|
||||
@@ -887,6 +900,21 @@ static struct synth_event *alloc_synth_e
|
||||
return event;
|
||||
}
|
||||
|
||||
|
@ -87,10 +96,10 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+ struct hist_trigger_data *hist_data;
|
||||
+};
|
||||
+
|
||||
static int create_synth_event(int argc, char **argv)
|
||||
static void add_or_delete_synth_event(struct synth_event *event, int delete)
|
||||
{
|
||||
struct synth_field *field, *fields[SYNTH_FIELDS_MAX];
|
||||
@@ -1139,11 +1165,6 @@ static u64 hist_field_timestamp(struct h
|
||||
if (delete)
|
||||
@@ -1128,11 +1156,6 @@ static u64 hist_field_timestamp(struct h
|
||||
return ts;
|
||||
}
|
||||
|
||||
|
@ -102,7 +111,22 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
static struct hist_field *
|
||||
check_field_for_var_ref(struct hist_field *hist_field,
|
||||
struct hist_trigger_data *var_data,
|
||||
@@ -1452,6 +1473,37 @@ static struct hist_field *find_file_var(
|
||||
@@ -1198,6 +1221,14 @@ static struct hist_field *find_var_ref(s
|
||||
return found;
|
||||
}
|
||||
|
||||
+ for (i = 0; i < hist_data->n_synth_var_refs; i++) {
|
||||
+ hist_field = hist_data->synth_var_refs[i];
|
||||
+ found = check_field_for_var_refs(hist_data, hist_field,
|
||||
+ var_data, var_idx, 0);
|
||||
+ if (found)
|
||||
+ return found;
|
||||
+ }
|
||||
+
|
||||
return found;
|
||||
}
|
||||
|
||||
@@ -1439,6 +1470,37 @@ static struct hist_field *find_file_var(
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -140,7 +164,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
static struct hist_field *find_event_var(struct hist_trigger_data *hist_data,
|
||||
char *system,
|
||||
char *event_name,
|
||||
@@ -1461,6 +1513,14 @@ static struct hist_field *find_event_var
|
||||
@@ -1448,6 +1510,14 @@ static struct hist_field *find_event_var
|
||||
struct hist_field *hist_field = NULL;
|
||||
struct trace_event_file *file;
|
||||
|
||||
|
@ -155,7 +179,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
file = find_var_file(tr, system, event_name, var_name);
|
||||
if (!file)
|
||||
return NULL;
|
||||
@@ -1652,11 +1712,21 @@ static void destroy_hist_trigger_attrs(s
|
||||
@@ -1639,11 +1709,21 @@ static void destroy_hist_trigger_attrs(s
|
||||
|
||||
static int parse_action(char *str, struct hist_trigger_attrs *attrs)
|
||||
{
|
||||
|
@ -178,7 +202,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
return ret;
|
||||
}
|
||||
|
||||
@@ -2643,7 +2713,7 @@ find_synthetic_field_var(struct hist_tri
|
||||
@@ -2648,7 +2728,7 @@ find_synthetic_field_var(struct hist_tri
|
||||
*
|
||||
* Return: The variable created for the field.
|
||||
*/
|
||||
|
@ -187,7 +211,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
create_field_var_hist(struct hist_trigger_data *target_hist_data,
|
||||
char *subsys_name, char *event_name, char *field_name)
|
||||
{
|
||||
@@ -2757,7 +2827,7 @@ create_field_var_hist(struct hist_trigge
|
||||
@@ -2761,7 +2841,7 @@ create_field_var_hist(struct hist_trigge
|
||||
return event_var;
|
||||
}
|
||||
|
||||
|
@ -196,7 +220,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
find_target_event_var(struct hist_trigger_data *hist_data,
|
||||
char *subsys_name, char *event_name, char *var_name)
|
||||
{
|
||||
@@ -2928,7 +2998,7 @@ static struct field_var *create_field_va
|
||||
@@ -2932,7 +3012,7 @@ static struct field_var *create_field_va
|
||||
*
|
||||
* Return: The variable created for the field.
|
||||
*/
|
||||
|
@ -205,7 +229,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
create_target_field_var(struct hist_trigger_data *target_hist_data,
|
||||
char *subsys_name, char *event_name, char *var_name)
|
||||
{
|
||||
@@ -2952,6 +3022,27 @@ create_target_field_var(struct hist_trig
|
||||
@@ -2956,6 +3036,27 @@ create_target_field_var(struct hist_trig
|
||||
return create_field_var(target_hist_data, file, var_name);
|
||||
}
|
||||
|
||||
|
@ -233,7 +257,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
static void destroy_field_var(struct field_var *field_var)
|
||||
{
|
||||
if (!field_var)
|
||||
@@ -2971,8 +3062,8 @@ static void destroy_field_vars(struct hi
|
||||
@@ -2975,8 +3076,8 @@ static void destroy_field_vars(struct hi
|
||||
destroy_field_var(hist_data->field_vars[i]);
|
||||
}
|
||||
|
||||
|
@ -244,7 +268,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
{
|
||||
hist_data->field_vars[hist_data->n_field_vars++] = field_var;
|
||||
|
||||
@@ -2980,6 +3071,298 @@ void save_field_var(struct hist_trigger_
|
||||
@@ -2984,6 +3085,304 @@ void save_field_var(struct hist_trigger_
|
||||
hist_data->n_field_var_str++;
|
||||
}
|
||||
|
||||
|
@ -404,6 +428,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+ mutex_unlock(&synth_event_mutex);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+ event->ref++;
|
||||
+ mutex_unlock(&synth_event_mutex);
|
||||
+
|
||||
+ var_ref_idx = hist_data->n_var_refs;
|
||||
|
@ -414,7 +439,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+ p = param = kstrdup(data->params[i], GFP_KERNEL);
|
||||
+ if (!param) {
|
||||
+ ret = -ENOMEM;
|
||||
+ goto out;
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
+ system = strsep(¶m, ".");
|
||||
|
@ -426,7 +451,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+ if (!param) {
|
||||
+ kfree(p);
|
||||
+ ret = -EINVAL;
|
||||
+ goto out;
|
||||
+ goto err;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
|
@ -442,7 +467,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+ if (!hist_field) {
|
||||
+ kfree(p);
|
||||
+ ret = -EINVAL;
|
||||
+ goto out;
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
+ if (check_synth_field(event, hist_field, field_pos) == 0) {
|
||||
|
@ -450,7 +475,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+ if (!var_ref) {
|
||||
+ kfree(p);
|
||||
+ ret = -ENOMEM;
|
||||
+ goto out;
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
+ save_synth_var_ref(hist_data, var_ref);
|
||||
|
@ -461,20 +486,25 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+
|
||||
+ kfree(p);
|
||||
+ ret = -EINVAL;
|
||||
+ goto out;
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
+ if (field_pos != event->n_fields) {
|
||||
+ ret = -EINVAL;
|
||||
+ goto out;
|
||||
+ goto err;
|
||||
+ }
|
||||
+
|
||||
+ data->fn = action_trace;
|
||||
+ data->onmatch.synth_event = event;
|
||||
+ data->onmatch.var_ref_idx = var_ref_idx;
|
||||
+ event->ref++;
|
||||
+ out:
|
||||
+ return ret;
|
||||
+ err:
|
||||
+ mutex_lock(&synth_event_mutex);
|
||||
+ event->ref--;
|
||||
+ mutex_unlock(&synth_event_mutex);
|
||||
+
|
||||
+ goto out;
|
||||
+}
|
||||
+
|
||||
+static struct action_data *onmatch_parse(struct trace_array *tr, char *str)
|
||||
|
@ -543,7 +573,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
static int create_hitcount_val(struct hist_trigger_data *hist_data)
|
||||
{
|
||||
hist_data->fields[HITCOUNT_IDX] =
|
||||
@@ -3404,18 +3787,39 @@ static void destroy_actions(struct hist_
|
||||
@@ -3408,18 +3807,39 @@ static void destroy_actions(struct hist_
|
||||
for (i = 0; i < hist_data->n_actions; i++) {
|
||||
struct action_data *data = hist_data->actions[i];
|
||||
|
||||
|
@ -584,7 +614,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
}
|
||||
|
||||
return ret;
|
||||
@@ -3430,11 +3834,50 @@ static int create_actions(struct hist_tr
|
||||
@@ -3434,11 +3854,50 @@ static int create_actions(struct hist_tr
|
||||
|
||||
for (i = 0; i < hist_data->attrs->n_actions; i++) {
|
||||
data = hist_data->actions[i];
|
||||
|
@ -635,7 +665,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
static void destroy_field_var_hists(struct hist_trigger_data *hist_data)
|
||||
{
|
||||
unsigned int i;
|
||||
@@ -3457,6 +3900,7 @@ static void destroy_hist_data(struct his
|
||||
@@ -3461,6 +3920,7 @@ static void destroy_hist_data(struct his
|
||||
destroy_actions(hist_data);
|
||||
destroy_field_vars(hist_data);
|
||||
destroy_field_var_hists(hist_data);
|
||||
|
@ -643,7 +673,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
|
||||
kfree(hist_data);
|
||||
}
|
||||
@@ -4015,6 +4459,8 @@ static int event_hist_trigger_print(stru
|
||||
@@ -4019,6 +4479,8 @@ static int event_hist_trigger_print(stru
|
||||
}
|
||||
seq_printf(m, ":size=%u", (1 << hist_data->map->map_bits));
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ From: Anna-Maria Gleixner <anna-maria@linutronix.de>
|
|||
Date: Sun, 22 Oct 2017 23:40:05 +0200
|
||||
Subject: [PATCH 27/36] hrtimer: Prepare handling of hard and softirq based
|
||||
hrtimers
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
The softirq based hrtimer can utilize most of the existing hrtimers
|
||||
functions, but need to operate on a different data set.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 17 Nov 2017 14:33:06 -0600
|
||||
Date: Wed, 6 Dec 2017 16:38:08 -0600
|
||||
Subject: [PATCH 27/37] tracing: Add 'onmax' hist trigger action support
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
Add an 'onmax(var).save(field,...)' hist trigger action which is
|
||||
invoked whenever an event exceeds the current maximum.
|
||||
|
@ -21,12 +21,12 @@ the timestamp difference is calculated. If the resulting latency
|
|||
exceeds the current maximum latency, the specified save() values are
|
||||
saved:
|
||||
|
||||
# echo 'hist:keys=pid:ts0=$common_timestamp.usecs \
|
||||
# echo 'hist:keys=pid:ts0=common_timestamp.usecs \
|
||||
if comm=="cyclictest"' >> \
|
||||
/sys/kernel/debug/tracing/events/sched/sched_wakeup/trigger
|
||||
|
||||
# echo 'hist:keys=next_pid:\
|
||||
wakeup_lat=$common_timestamp.usecs-$ts0:\
|
||||
wakeup_lat=common_timestamp.usecs-$ts0:\
|
||||
onmax($wakeup_lat).save(next_comm,prev_pid,prev_prio,prev_comm) \
|
||||
if next_comm=="cyclictest"' >> \
|
||||
/sys/kernel/debug/tracing/events/sched/sched_switch/trigger
|
||||
|
@ -86,7 +86,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
};
|
||||
};
|
||||
|
||||
@@ -1717,7 +1729,8 @@ static int parse_action(char *str, struc
|
||||
@@ -1714,7 +1726,8 @@ static int parse_action(char *str, struc
|
||||
if (attrs->n_actions >= HIST_ACTIONS_MAX)
|
||||
return ret;
|
||||
|
||||
|
@ -96,7 +96,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
attrs->action_str[attrs->n_actions] = kstrdup(str, GFP_KERNEL);
|
||||
if (!attrs->action_str[attrs->n_actions]) {
|
||||
ret = -ENOMEM;
|
||||
@@ -1889,7 +1902,7 @@ static int hist_trigger_elt_data_alloc(s
|
||||
@@ -1886,7 +1899,7 @@ static int hist_trigger_elt_data_alloc(s
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -105,7 +105,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
|
||||
size = STR_VAR_LEN_MAX;
|
||||
|
||||
@@ -2893,6 +2906,15 @@ static void update_field_vars(struct his
|
||||
@@ -2907,6 +2920,15 @@ static void update_field_vars(struct his
|
||||
hist_data->n_field_vars, 0);
|
||||
}
|
||||
|
||||
|
@ -121,7 +121,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
static struct hist_field *create_var(struct hist_trigger_data *hist_data,
|
||||
struct trace_event_file *file,
|
||||
char *name, int size, const char *type)
|
||||
@@ -3022,6 +3044,227 @@ create_target_field_var(struct hist_trig
|
||||
@@ -3036,6 +3058,227 @@ create_target_field_var(struct hist_trig
|
||||
return create_field_var(target_hist_data, file, var_name);
|
||||
}
|
||||
|
||||
|
@ -191,13 +191,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+static int onmax_create(struct hist_trigger_data *hist_data,
|
||||
+ struct action_data *data)
|
||||
+{
|
||||
+ struct trace_event_call *call = hist_data->event_file->event_call;
|
||||
+ struct trace_event_file *file = hist_data->event_file;
|
||||
+ struct hist_field *var_field, *ref_field, *max_var;
|
||||
+ unsigned int var_ref_idx = hist_data->n_var_refs;
|
||||
+ struct field_var *field_var;
|
||||
+ char *onmax_var_str, *param;
|
||||
+ const char *event_name;
|
||||
+ unsigned long flags;
|
||||
+ unsigned int i;
|
||||
+ int ret = 0;
|
||||
|
@ -207,7 +205,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+ return -EINVAL;
|
||||
+ onmax_var_str++;
|
||||
+
|
||||
+ event_name = trace_event_name(call);
|
||||
+ var_field = find_target_event_var(hist_data, NULL, NULL, onmax_var_str);
|
||||
+ if (!var_field)
|
||||
+ return -EINVAL;
|
||||
|
@ -303,8 +300,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+ return ERR_PTR(-ENOMEM);
|
||||
+
|
||||
+ onmax_var_str = strsep(&str, ")");
|
||||
+ if (!onmax_var_str || !str)
|
||||
+ return ERR_PTR(-EINVAL);
|
||||
+ if (!onmax_var_str || !str) {
|
||||
+ ret = -EINVAL;
|
||||
+ goto free;
|
||||
+ }
|
||||
+
|
||||
+ data->onmax.var_str = kstrdup(onmax_var_str, GFP_KERNEL);
|
||||
+ if (!data->onmax.var_str) {
|
||||
+ ret = -ENOMEM;
|
||||
|
@ -349,7 +349,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
static void onmatch_destroy(struct action_data *data)
|
||||
{
|
||||
unsigned int i;
|
||||
@@ -3106,39 +3349,6 @@ static int check_synth_field(struct synt
|
||||
@@ -3120,39 +3363,6 @@ static int check_synth_field(struct synt
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -389,7 +389,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
static struct hist_field *
|
||||
onmatch_find_var(struct hist_trigger_data *hist_data, struct action_data *data,
|
||||
char *system, char *event, char *var)
|
||||
@@ -3789,6 +3999,8 @@ static void destroy_actions(struct hist_
|
||||
@@ -3809,6 +4019,8 @@ static void destroy_actions(struct hist_
|
||||
|
||||
if (data->fn == action_trace)
|
||||
onmatch_destroy(data);
|
||||
|
@ -398,7 +398,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
else
|
||||
kfree(data);
|
||||
}
|
||||
@@ -3814,6 +4026,15 @@ static int parse_actions(struct hist_tri
|
||||
@@ -3834,6 +4046,15 @@ static int parse_actions(struct hist_tri
|
||||
break;
|
||||
}
|
||||
data->fn = action_trace;
|
||||
|
@ -414,7 +414,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
} else {
|
||||
ret = -EINVAL;
|
||||
break;
|
||||
@@ -3839,12 +4060,48 @@ static int create_actions(struct hist_tr
|
||||
@@ -3859,12 +4080,48 @@ static int create_actions(struct hist_tr
|
||||
ret = onmatch_create(hist_data, file, data);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
@ -463,7 +463,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
static void print_onmatch_spec(struct seq_file *m,
|
||||
struct hist_trigger_data *hist_data,
|
||||
struct action_data *data)
|
||||
@@ -3875,6 +4132,8 @@ static void print_actions_spec(struct se
|
||||
@@ -3895,6 +4152,8 @@ static void print_actions_spec(struct se
|
||||
|
||||
if (data->fn == action_trace)
|
||||
print_onmatch_spec(m, hist_data, data);
|
||||
|
@ -472,7 +472,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
}
|
||||
}
|
||||
|
||||
@@ -4256,6 +4515,8 @@ hist_trigger_entry_print(struct seq_file
|
||||
@@ -4276,6 +4535,8 @@ hist_trigger_entry_print(struct seq_file
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Anna-Maria Gleixner <anna-maria@linutronix.de>
|
||||
Date: Sun, 22 Oct 2017 23:40:06 +0200
|
||||
Subject: [PATCH 28/36] hrtimer: Implement support for softirq based hrtimers
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
hrtimer callbacks are always invoked in hard interrupt context. Several
|
||||
users in tree require soft interrupt context for their callbacks and
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 17 Nov 2017 14:33:07 -0600
|
||||
Date: Wed, 6 Dec 2017 16:38:09 -0600
|
||||
Subject: [PATCH 28/37] tracing: Allow whitespace to surround hist trigger
|
||||
filter
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
The existing code only allows for one space before and after the 'if'
|
||||
specifying the filter for a hist trigger. Add code to make that more
|
||||
|
@ -19,7 +19,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
|
||||
--- a/kernel/trace/trace_events_hist.c
|
||||
+++ b/kernel/trace/trace_events_hist.c
|
||||
@@ -5157,7 +5157,7 @@ static int event_hist_trigger_func(struc
|
||||
@@ -5177,7 +5177,7 @@ static int event_hist_trigger_func(struc
|
||||
struct synth_event *se;
|
||||
const char *se_name;
|
||||
bool remove = false;
|
||||
|
@ -28,7 +28,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
int ret = 0;
|
||||
|
||||
if (!param)
|
||||
@@ -5166,10 +5166,37 @@ static int event_hist_trigger_func(struc
|
||||
@@ -5186,10 +5186,37 @@ static int event_hist_trigger_func(struc
|
||||
if (glob[0] == '!')
|
||||
remove = true;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Anna-Maria Gleixner <anna-maria@linutronix.de>
|
||||
Date: Sun, 22 Oct 2017 23:40:07 +0200
|
||||
Subject: [PATCH 29/36] hrtimer: Implement SOFT/HARD clock base selection
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
All prerequisites to handle hrtimers for expiry in either hard or soft
|
||||
interrupt context are in place.
|
||||
|
|
|
@ -1,24 +1,21 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 17 Nov 2017 14:33:08 -0600
|
||||
Date: Wed, 6 Dec 2017 16:38:10 -0600
|
||||
Subject: [PATCH 29/37] tracing: Add cpu field for hist triggers
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
A common key to use in a histogram is the cpuid - add a new cpu
|
||||
'synthetic' field for that purpose. This field is named cpu rather
|
||||
than $cpu or $common_cpu because 'cpu' already exists as a special
|
||||
filter field and it makes more sense to match that rather than add
|
||||
another name for the same thing.
|
||||
'synthetic' field named 'cpu' for that purpose.
|
||||
|
||||
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
---
|
||||
Documentation/trace/histogram.txt | 17 +++++++++++++++++
|
||||
Documentation/trace/histogram.txt | 15 +++++++++++++++
|
||||
kernel/trace/trace_events_hist.c | 28 +++++++++++++++++++++++++++-
|
||||
2 files changed, 44 insertions(+), 1 deletion(-)
|
||||
2 files changed, 42 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/Documentation/trace/histogram.txt
|
||||
+++ b/Documentation/trace/histogram.txt
|
||||
@@ -172,6 +172,23 @@
|
||||
@@ -172,6 +172,21 @@
|
||||
The examples below provide a more concrete illustration of the
|
||||
concepts and typical usage patterns discussed above.
|
||||
|
||||
|
@ -30,11 +27,9 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+ they were actual event fields, but aren't really part of the event's
|
||||
+ field definition or format file. They are however available for any
|
||||
+ event, and can be used anywhere an actual event field could be.
|
||||
+ 'Special' field names are always prefixed with a '$' character to
|
||||
+ indicate that they're not normal fields (with the exception of
|
||||
+ 'cpu', for compatibility with existing filter usage):
|
||||
+ They are:
|
||||
+
|
||||
+ $common_timestamp u64 - timestamp (from ring buffer) associated
|
||||
+ common_timestamp u64 - timestamp (from ring buffer) associated
|
||||
+ with the event, in nanoseconds. May be
|
||||
+ modified by .usecs to have timestamps
|
||||
+ interpreted as microseconds.
|
||||
|
@ -52,7 +47,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
};
|
||||
|
||||
struct var_defs {
|
||||
@@ -1177,6 +1178,16 @@ static u64 hist_field_timestamp(struct h
|
||||
@@ -1168,6 +1169,16 @@ static u64 hist_field_timestamp(struct h
|
||||
return ts;
|
||||
}
|
||||
|
||||
|
@ -69,23 +64,23 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
static struct hist_field *
|
||||
check_field_for_var_ref(struct hist_field *hist_field,
|
||||
struct hist_trigger_data *var_data,
|
||||
@@ -1622,6 +1633,8 @@ static const char *hist_field_name(struc
|
||||
@@ -1619,6 +1630,8 @@ static const char *hist_field_name(struc
|
||||
field_name = hist_field_name(field->operands[0], ++level);
|
||||
else if (field->flags & HIST_FIELD_FL_TIMESTAMP)
|
||||
field_name = "$common_timestamp";
|
||||
field_name = "common_timestamp";
|
||||
+ else if (field->flags & HIST_FIELD_FL_CPU)
|
||||
+ field_name = "cpu";
|
||||
else if (field->flags & HIST_FIELD_FL_EXPR ||
|
||||
field->flags & HIST_FIELD_FL_VAR_REF) {
|
||||
if (field->system) {
|
||||
@@ -2125,6 +2138,15 @@ static struct hist_field *create_hist_fi
|
||||
@@ -2124,6 +2137,15 @@ static struct hist_field *create_hist_fi
|
||||
goto out;
|
||||
}
|
||||
|
||||
+ if (flags & HIST_FIELD_FL_CPU) {
|
||||
+ hist_field->fn = hist_field_cpu;
|
||||
+ hist_field->size = sizeof(int);
|
||||
+ hist_field->type = kstrdup("int", GFP_KERNEL);
|
||||
+ hist_field->type = kstrdup("unsigned int", GFP_KERNEL);
|
||||
+ if (!hist_field->type)
|
||||
+ goto free;
|
||||
+ goto out;
|
||||
|
@ -94,7 +89,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
if (WARN_ON_ONCE(!field))
|
||||
goto out;
|
||||
|
||||
@@ -2343,7 +2365,9 @@ parse_field(struct hist_trigger_data *hi
|
||||
@@ -2358,7 +2380,9 @@ parse_field(struct hist_trigger_data *hi
|
||||
hist_data->enable_timestamps = true;
|
||||
if (*flags & HIST_FIELD_FL_TIMESTAMP_USECS)
|
||||
hist_data->attrs->ts_in_usecs = true;
|
||||
|
@ -105,10 +100,10 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
field = trace_find_event_field(file->event_call, field_name);
|
||||
if (!field || !field->size) {
|
||||
field = ERR_PTR(-EINVAL);
|
||||
@@ -4614,6 +4638,8 @@ static void hist_field_print(struct seq_
|
||||
@@ -4634,6 +4658,8 @@ static void hist_field_print(struct seq_
|
||||
|
||||
if (hist_field->flags & HIST_FIELD_FL_TIMESTAMP)
|
||||
seq_puts(m, "$common_timestamp");
|
||||
seq_puts(m, "common_timestamp");
|
||||
+ else if (hist_field->flags & HIST_FIELD_FL_CPU)
|
||||
+ seq_puts(m, "cpu");
|
||||
else if (field_name) {
|
||||
|
|
|
@ -2,7 +2,7 @@ From: Thomas Gleixner <tglx@linutronix.de>
|
|||
Date: Thu, 23 Nov 2017 16:39:11 +0100
|
||||
Subject: [PATCH 30/36] can/bcm: Replace hrtimer_tasklet with softirq based
|
||||
hrtimer
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
Switch the timer to HRTIMER_MODE_SOFT, which executed the timer
|
||||
callback in softirq context and remove the hrtimer_tasklet.
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 17 Nov 2017 14:33:09 -0600
|
||||
Date: Wed, 6 Dec 2017 16:38:11 -0600
|
||||
Subject: [PATCH 30/37] tracing: Add hist trigger support for variable
|
||||
reference aliases
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
Add support for alias=$somevar where alias can be used as
|
||||
onmatch.xxx($alias).
|
||||
|
@ -14,7 +14,7 @@ event invocation is opaque or doesn't fit well stylistically with
|
|||
previous triggers, so creates an alias of $new_lat named $latency and
|
||||
uses that in the call instead:
|
||||
|
||||
# echo 'hist:keys=next_pid:new_lat=$common_timestamp.usecs' >
|
||||
# echo 'hist:keys=next_pid:new_lat=common_timestamp.usecs' >
|
||||
/sys/kernel/debug/tracing/events/sched/sched_switch/trigger
|
||||
|
||||
# echo 'hist:keys=pid:latency=$new_lat:
|
||||
|
@ -37,7 +37,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
};
|
||||
|
||||
struct var_defs {
|
||||
@@ -1629,7 +1630,8 @@ static const char *hist_field_name(struc
|
||||
@@ -1626,7 +1627,8 @@ static const char *hist_field_name(struc
|
||||
|
||||
if (field->field)
|
||||
field_name = field->field->name;
|
||||
|
@ -46,8 +46,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+ field->flags & HIST_FIELD_FL_ALIAS)
|
||||
field_name = hist_field_name(field->operands[0], ++level);
|
||||
else if (field->flags & HIST_FIELD_FL_TIMESTAMP)
|
||||
field_name = "$common_timestamp";
|
||||
@@ -2096,7 +2098,7 @@ static struct hist_field *create_hist_fi
|
||||
field_name = "common_timestamp";
|
||||
@@ -2095,7 +2097,7 @@ static struct hist_field *create_hist_fi
|
||||
|
||||
hist_field->hist_data = hist_data;
|
||||
|
||||
|
@ -56,7 +56,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
goto out; /* caller will populate */
|
||||
|
||||
if (flags & HIST_FIELD_FL_VAR_REF) {
|
||||
@@ -2380,6 +2382,28 @@ parse_field(struct hist_trigger_data *hi
|
||||
@@ -2395,6 +2397,28 @@ parse_field(struct hist_trigger_data *hi
|
||||
return field;
|
||||
}
|
||||
|
||||
|
@ -85,7 +85,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
struct hist_field *parse_atom(struct hist_trigger_data *hist_data,
|
||||
struct trace_event_file *file, char *str,
|
||||
unsigned long *flags, char *var_name)
|
||||
@@ -2413,6 +2437,13 @@ struct hist_field *parse_atom(struct his
|
||||
@@ -2428,6 +2452,13 @@ struct hist_field *parse_atom(struct his
|
||||
if (hist_field) {
|
||||
hist_data->var_refs[hist_data->n_var_refs] = hist_field;
|
||||
hist_field->var_ref_idx = hist_data->n_var_refs++;
|
||||
|
@ -99,7 +99,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
return hist_field;
|
||||
}
|
||||
} else
|
||||
@@ -2517,6 +2548,26 @@ static int check_expr_operands(struct hi
|
||||
@@ -2532,6 +2563,26 @@ static int check_expr_operands(struct hi
|
||||
unsigned long operand1_flags = operand1->flags;
|
||||
unsigned long operand2_flags = operand2->flags;
|
||||
|
||||
|
@ -126,7 +126,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
if ((operand1_flags & HIST_FIELD_FL_TIMESTAMP_USECS) !=
|
||||
(operand2_flags & HIST_FIELD_FL_TIMESTAMP_USECS))
|
||||
return -EINVAL;
|
||||
@@ -4641,7 +4692,8 @@ static void hist_field_print(struct seq_
|
||||
@@ -4661,7 +4712,8 @@ static void hist_field_print(struct seq_
|
||||
else if (hist_field->flags & HIST_FIELD_FL_CPU)
|
||||
seq_puts(m, "cpu");
|
||||
else if (field_name) {
|
||||
|
|
|
@ -2,7 +2,7 @@ From: Thomas Gleixner <tglx@linutronix.de>
|
|||
Date: Thu, 23 Nov 2017 16:39:12 +0100
|
||||
Subject: [PATCH 31/36] mac80211_hwsim: Replace hrtimer tasklet with softirq
|
||||
hrtimer
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
Switch the timer to HRTIMER_MODE_SOFT, which executed the timer
|
||||
callback in softirq context and remove the hrtimer_tasklet.
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 17 Nov 2017 14:33:10 -0600
|
||||
Date: Wed, 6 Dec 2017 16:38:12 -0600
|
||||
Subject: [PATCH 31/37] tracing: Add 'last error' error facility for hist
|
||||
triggers
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
With the addition of variables and actions, it's become necessary to
|
||||
provide more detailed error information to users about syntax errors.
|
||||
|
@ -27,12 +27,12 @@ Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
|
|||
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
---
|
||||
Documentation/trace/histogram.txt | 20 ++++
|
||||
kernel/trace/trace_events_hist.c | 167 +++++++++++++++++++++++++++++++++++---
|
||||
2 files changed, 174 insertions(+), 13 deletions(-)
|
||||
kernel/trace/trace_events_hist.c | 156 +++++++++++++++++++++++++++++++++++---
|
||||
2 files changed, 164 insertions(+), 12 deletions(-)
|
||||
|
||||
--- a/Documentation/trace/histogram.txt
|
||||
+++ b/Documentation/trace/histogram.txt
|
||||
@@ -190,6 +190,26 @@
|
||||
@@ -188,6 +188,26 @@
|
||||
interpreted as microseconds.
|
||||
cpu int - the cpu on which the event occurred.
|
||||
|
||||
|
@ -127,7 +127,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
static LIST_HEAD(synth_event_list);
|
||||
static DEFINE_MUTEX(synth_event_mutex);
|
||||
|
||||
@@ -1458,6 +1517,7 @@ static struct trace_event_file *find_var
|
||||
@@ -1455,6 +1514,7 @@ static struct trace_event_file *find_var
|
||||
if (!system || !event_name) {
|
||||
if (find_var(var_hist_data, file, var_name)) {
|
||||
if (found) {
|
||||
|
@ -135,7 +135,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1518,6 +1578,7 @@ find_match_var(struct hist_trigger_data
|
||||
@@ -1515,6 +1575,7 @@ find_match_var(struct hist_trigger_data
|
||||
hist_field = find_file_var(file, var_name);
|
||||
if (hist_field) {
|
||||
if (found) {
|
||||
|
@ -143,7 +143,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
|
||||
@@ -1801,6 +1862,7 @@ static int parse_assignment(char *str, s
|
||||
@@ -1798,6 +1859,7 @@ static int parse_assignment(char *str, s
|
||||
char *assignment;
|
||||
|
||||
if (attrs->n_assignments == TRACING_MAP_VARS_MAX) {
|
||||
|
@ -151,27 +151,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
@@ -2271,9 +2333,18 @@ static struct hist_field *create_var_ref
|
||||
return ref_field;
|
||||
}
|
||||
|
||||
+static bool is_common_field(char *var_name)
|
||||
+{
|
||||
+ if (strncmp(var_name, "$common_timestamp", strlen("$common_timestamp")) == 0)
|
||||
+ return true;
|
||||
+
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
static bool is_var_ref(char *var_name)
|
||||
{
|
||||
- if (!var_name || strlen(var_name) < 2 || var_name[0] != '$')
|
||||
+ if (!var_name || strlen(var_name) < 2 || var_name[0] != '$' ||
|
||||
+ is_common_field(var_name))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -2325,6 +2396,10 @@ static struct hist_field *parse_var_ref(
|
||||
@@ -2340,6 +2402,10 @@ static struct hist_field *parse_var_ref(
|
||||
if (var_field)
|
||||
ref_field = create_var_ref(var_field, system, event_name);
|
||||
|
||||
|
@ -182,7 +162,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
return ref_field;
|
||||
}
|
||||
|
||||
@@ -2569,8 +2644,10 @@ static int check_expr_operands(struct hi
|
||||
@@ -2584,8 +2650,10 @@ static int check_expr_operands(struct hi
|
||||
}
|
||||
|
||||
if ((operand1_flags & HIST_FIELD_FL_TIMESTAMP_USECS) !=
|
||||
|
@ -194,7 +174,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
|
||||
return 0;
|
||||
}
|
||||
@@ -2816,12 +2893,17 @@ create_field_var_hist(struct hist_trigge
|
||||
@@ -2831,12 +2899,17 @@ create_field_var_hist(struct hist_trigge
|
||||
char *cmd;
|
||||
int ret;
|
||||
|
||||
|
@ -213,7 +193,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
ret = PTR_ERR(file);
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
@@ -2833,8 +2915,11 @@ create_field_var_hist(struct hist_trigge
|
||||
@@ -2848,8 +2921,11 @@ create_field_var_hist(struct hist_trigge
|
||||
* yet a registered histogram so we can't use that.
|
||||
*/
|
||||
hist_data = find_compatible_hist(target_hist_data, file);
|
||||
|
@ -226,7 +206,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
|
||||
/* See if a synthetic field variable has already been created */
|
||||
event_var = find_synthetic_field_var(target_hist_data, subsys_name,
|
||||
@@ -2893,6 +2978,8 @@ create_field_var_hist(struct hist_trigge
|
||||
@@ -2908,6 +2984,8 @@ create_field_var_hist(struct hist_trigge
|
||||
kfree(cmd);
|
||||
kfree(var_hist->cmd);
|
||||
kfree(var_hist);
|
||||
|
@ -235,8 +215,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
return ERR_PTR(ret);
|
||||
}
|
||||
|
||||
@@ -2905,6 +2992,8 @@ create_field_var_hist(struct hist_trigge
|
||||
kfree(cmd);
|
||||
@@ -2919,6 +2997,8 @@ create_field_var_hist(struct hist_trigge
|
||||
if (IS_ERR_OR_NULL(event_var)) {
|
||||
kfree(var_hist->cmd);
|
||||
kfree(var_hist);
|
||||
+ hist_err_event("onmatch: Couldn't find synthetic variable: ",
|
||||
|
@ -244,7 +224,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
|
||||
@@ -3041,18 +3130,21 @@ static struct field_var *create_field_va
|
||||
@@ -3055,18 +3135,21 @@ static struct field_var *create_field_va
|
||||
int ret = 0;
|
||||
|
||||
if (hist_data->n_field_vars >= SYNTH_FIELDS_MAX) {
|
||||
|
@ -266,7 +246,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
kfree(val);
|
||||
ret = PTR_ERR(var);
|
||||
goto err;
|
||||
@@ -3197,14 +3289,18 @@ static int onmax_create(struct hist_trig
|
||||
@@ -3209,13 +3292,17 @@ static int onmax_create(struct hist_trig
|
||||
int ret = 0;
|
||||
|
||||
onmax_var_str = data->onmax.var_str;
|
||||
|
@ -277,7 +257,6 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+ }
|
||||
onmax_var_str++;
|
||||
|
||||
event_name = trace_event_name(call);
|
||||
var_field = find_target_event_var(hist_data, NULL, NULL, onmax_var_str);
|
||||
- if (!var_field)
|
||||
+ if (!var_field) {
|
||||
|
@ -287,7 +266,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
|
||||
flags = HIST_FIELD_FL_VAR_REF;
|
||||
ref_field = create_hist_field(hist_data, NULL, flags, NULL);
|
||||
@@ -3224,6 +3320,7 @@ static int onmax_create(struct hist_trig
|
||||
@@ -3235,6 +3322,7 @@ static int onmax_create(struct hist_trig
|
||||
data->onmax.max_var_ref_idx = var_ref_idx;
|
||||
max_var = create_var(hist_data, file, "max", sizeof(u64), "u64");
|
||||
if (IS_ERR(max_var)) {
|
||||
|
@ -295,7 +274,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
ret = PTR_ERR(max_var);
|
||||
goto out;
|
||||
}
|
||||
@@ -3238,6 +3335,7 @@ static int onmax_create(struct hist_trig
|
||||
@@ -3249,6 +3337,7 @@ static int onmax_create(struct hist_trig
|
||||
|
||||
field_var = create_target_field_var(hist_data, NULL, NULL, param);
|
||||
if (IS_ERR(field_var)) {
|
||||
|
@ -303,7 +282,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
ret = PTR_ERR(field_var);
|
||||
kfree(param);
|
||||
goto out;
|
||||
@@ -3270,6 +3368,7 @@ static int parse_action_params(char *par
|
||||
@@ -3281,6 +3370,7 @@ static int parse_action_params(char *par
|
||||
|
||||
param = strstrip(param);
|
||||
if (strlen(param) < 2) {
|
||||
|
@ -311,7 +290,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
@@ -3442,6 +3541,9 @@ onmatch_find_var(struct hist_trigger_dat
|
||||
@@ -3456,6 +3546,9 @@ onmatch_find_var(struct hist_trigger_dat
|
||||
hist_field = find_event_var(hist_data, system, event, var);
|
||||
}
|
||||
|
||||
|
@ -321,7 +300,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
return hist_field;
|
||||
}
|
||||
|
||||
@@ -3509,6 +3611,7 @@ static int onmatch_create(struct hist_tr
|
||||
@@ -3523,6 +3616,7 @@ static int onmatch_create(struct hist_tr
|
||||
mutex_lock(&synth_event_mutex);
|
||||
event = find_synth_event(data->onmatch.synth_event_name);
|
||||
if (!event) {
|
||||
|
@ -329,7 +308,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
mutex_unlock(&synth_event_mutex);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -3567,12 +3670,15 @@ static int onmatch_create(struct hist_tr
|
||||
@@ -3582,12 +3676,15 @@ static int onmatch_create(struct hist_tr
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -337,15 +316,15 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+ system, event_name, param);
|
||||
kfree(p);
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (field_pos != event->n_fields) {
|
||||
+ hist_err("onmatch: Param count doesn't match synthetic event field count: ", event->name);
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
goto err;
|
||||
}
|
||||
@@ -3597,15 +3703,22 @@ static struct action_data *onmatch_parse
|
||||
@@ -3617,15 +3714,22 @@ static struct action_data *onmatch_parse
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
match_event = strsep(&str, ")");
|
||||
|
@ -371,7 +350,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
|
||||
data->onmatch.match_event = kstrdup(match_event, GFP_KERNEL);
|
||||
if (!data->onmatch.match_event) {
|
||||
@@ -3620,12 +3733,16 @@ static struct action_data *onmatch_parse
|
||||
@@ -3640,12 +3744,16 @@ static struct action_data *onmatch_parse
|
||||
}
|
||||
|
||||
strsep(&str, ".");
|
||||
|
@ -390,7 +369,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
|
||||
data->onmatch.synth_event_name = kstrdup(synth_event_name, GFP_KERNEL);
|
||||
if (!data->onmatch.synth_event_name) {
|
||||
@@ -3634,8 +3751,10 @@ static struct action_data *onmatch_parse
|
||||
@@ -3654,8 +3762,10 @@ static struct action_data *onmatch_parse
|
||||
}
|
||||
|
||||
params = strsep(&str, ")");
|
||||
|
@ -402,7 +381,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
|
||||
ret = parse_action_params(params, data);
|
||||
if (ret)
|
||||
@@ -3710,7 +3829,9 @@ static int create_var_field(struct hist_
|
||||
@@ -3730,7 +3840,9 @@ static int create_var_field(struct hist_
|
||||
|
||||
if (WARN_ON(val_idx >= TRACING_MAP_VALS_MAX + TRACING_MAP_VARS_MAX))
|
||||
return -EINVAL;
|
||||
|
@ -412,7 +391,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -3791,6 +3912,7 @@ static int create_key_field(struct hist_
|
||||
@@ -3811,6 +3923,7 @@ static int create_key_field(struct hist_
|
||||
}
|
||||
|
||||
if (hist_field->flags & HIST_FIELD_FL_VAR_REF) {
|
||||
|
@ -420,7 +399,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
destroy_hist_field(hist_field, 0);
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
@@ -3904,11 +4026,13 @@ static int parse_var_defs(struct hist_tr
|
||||
@@ -3924,11 +4037,13 @@ static int parse_var_defs(struct hist_tr
|
||||
|
||||
var_name = strsep(&field_str, "=");
|
||||
if (!var_name || !field_str) {
|
||||
|
@ -434,7 +413,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
ret = -EINVAL;
|
||||
goto free;
|
||||
}
|
||||
@@ -4662,6 +4786,11 @@ static int hist_show(struct seq_file *m,
|
||||
@@ -4682,6 +4797,11 @@ static int hist_show(struct seq_file *m,
|
||||
hist_trigger_show(m, data, n++);
|
||||
}
|
||||
|
||||
|
@ -446,7 +425,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
out_unlock:
|
||||
mutex_unlock(&event_mutex);
|
||||
|
||||
@@ -5009,6 +5138,7 @@ static int hist_register_trigger(char *g
|
||||
@@ -5046,6 +5166,7 @@ static int hist_register_trigger(char *g
|
||||
if (named_data) {
|
||||
if (!hist_trigger_match(data, named_data, named_data,
|
||||
true)) {
|
||||
|
@ -454,7 +433,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
@@ -5028,13 +5158,16 @@ static int hist_register_trigger(char *g
|
||||
@@ -5065,13 +5186,16 @@ static int hist_register_trigger(char *g
|
||||
test->paused = false;
|
||||
else if (hist_data->attrs->clear)
|
||||
hist_clear(test);
|
||||
|
@ -472,7 +451,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
ret = -ENOENT;
|
||||
goto out;
|
||||
}
|
||||
@@ -5238,6 +5371,11 @@ static int event_hist_trigger_func(struc
|
||||
@@ -5258,6 +5382,11 @@ static int event_hist_trigger_func(struc
|
||||
char *trigger, *p;
|
||||
int ret = 0;
|
||||
|
||||
|
@ -484,7 +463,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
if (!param)
|
||||
return -EINVAL;
|
||||
|
||||
@@ -5376,6 +5514,9 @@ static int event_hist_trigger_func(struc
|
||||
@@ -5396,6 +5525,9 @@ static int event_hist_trigger_func(struc
|
||||
/* Just return zero, not the number of registered triggers */
|
||||
ret = 0;
|
||||
out:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 17 Nov 2017 14:33:11 -0600
|
||||
Date: Wed, 6 Dec 2017 16:38:13 -0600
|
||||
Subject: [PATCH 32/37] tracing: Add inter-event hist trigger Documentation
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
Add background and details on inter-event hist triggers, including
|
||||
hist variables, synthetic events, and actions.
|
||||
|
@ -10,12 +10,12 @@ Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
|
|||
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
|
||||
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
---
|
||||
Documentation/trace/histogram.txt | 382 ++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 382 insertions(+)
|
||||
Documentation/trace/histogram.txt | 381 ++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 381 insertions(+)
|
||||
|
||||
--- a/Documentation/trace/histogram.txt
|
||||
+++ b/Documentation/trace/histogram.txt
|
||||
@@ -1605,3 +1605,385 @@
|
||||
@@ -1603,3 +1603,384 @@
|
||||
Hits: 489
|
||||
Entries: 7
|
||||
Dropped: 0
|
||||
|
@ -80,12 +80,11 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+ - Trace events don't have a 'timestamp' associated with them, but
|
||||
+ there is an implicit timestamp saved along with an event in the
|
||||
+ underlying ftrace ring buffer. This timestamp is now exposed as a
|
||||
+ a synthetic field named '$common_timestamp' which can be used in
|
||||
+ histograms as if it were any other event field. Note that it has
|
||||
+ a '$' prefixed to it - this is meant to indicate that it isn't an
|
||||
+ actual field in the trace format but rather is a synthesized value
|
||||
+ that nonetheless can be used as if it were an actual field. By
|
||||
+ default it is in units of nanoseconds; appending '.usecs' to a
|
||||
+ a synthetic field named 'common_timestamp' which can be used in
|
||||
+ histograms as if it were any other event field; it isn't an actual
|
||||
+ field in the trace format but rather is a synthesized value that
|
||||
+ nonetheless can be used as if it were an actual field. By default
|
||||
+ it is in units of nanoseconds; appending '.usecs' to a
|
||||
+ common_timestamp field changes the units to microseconds.
|
||||
+
|
||||
+These features are decribed in more detail in the following sections.
|
||||
|
@ -116,7 +115,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+creates a variable named 'ts0' for a histogram entry with the key
|
||||
+'next_pid':
|
||||
+
|
||||
+ # echo 'hist:keys=next_pid:vals=$ts0:ts0=$common_timestamp ... >> \
|
||||
+ # echo 'hist:keys=next_pid:vals=$ts0:ts0=common_timestamp ... >> \
|
||||
+ event/trigger
|
||||
+
|
||||
+The ts0 variable can be accessed by any subsequent event having the
|
||||
|
@ -126,7 +125,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+the '$' sign. Thus for example, the ts0 variable above would be
|
||||
+referenced as '$ts0' in expressions.
|
||||
+
|
||||
+Because 'vals=' is used, the $common_timestamp variable value above
|
||||
+Because 'vals=' is used, the common_timestamp variable value above
|
||||
+will also be summed as a normal histogram value would (though for a
|
||||
+timestamp it makes little sense).
|
||||
+
|
||||
|
@ -138,35 +137,35 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+associated event field will be saved in a variable but won't be summed
|
||||
+as a value:
|
||||
+
|
||||
+ # echo 'hist:keys=next_pid:ts1=$common_timestamp ... >> event/trigger
|
||||
+ # echo 'hist:keys=next_pid:ts1=common_timestamp ... >> event/trigger
|
||||
+
|
||||
+Multiple variables can be assigned at the same time. The below would
|
||||
+result in both ts0 and b being created as variables, with both
|
||||
+common_timestamp and field1 additionally being summed as values:
|
||||
+
|
||||
+ # echo 'hist:keys=pid:vals=$ts0,$b:ts0=$common_timestamp,b=field1 ... >> \
|
||||
+ # echo 'hist:keys=pid:vals=$ts0,$b:ts0=common_timestamp,b=field1 ... >> \
|
||||
+ event/trigger
|
||||
+
|
||||
+Note that variable assignments can appear either preceding or
|
||||
+following their use. The command below behaves identically to the
|
||||
+command above:
|
||||
+
|
||||
+ # echo 'hist:keys=pid:ts0=$common_timestamp,b=field1:vals=$ts0,$b ... >> \
|
||||
+ # echo 'hist:keys=pid:ts0=common_timestamp,b=field1:vals=$ts0,$b ... >> \
|
||||
+ event/trigger
|
||||
+
|
||||
+Any number of variables not bound to a 'vals=' prefix can also be
|
||||
+assigned by simply separating them with colons. Below is the same
|
||||
+thing but without the values being summed in the histogram:
|
||||
+
|
||||
+ # echo 'hist:keys=pid:ts0=$common_timestamp:b=field1 ... >> event/trigger
|
||||
+ # echo 'hist:keys=pid:ts0=common_timestamp:b=field1 ... >> event/trigger
|
||||
+
|
||||
+Variables set as above can be referenced and used in expressions on
|
||||
+another event.
|
||||
+
|
||||
+For example, here's how a latency can be calculated:
|
||||
+
|
||||
+ # echo 'hist:keys=pid,prio:ts0=$common_timestamp ... >> event1/trigger
|
||||
+ # echo 'hist:keys=next_pid:wakeup_lat=$common_timestamp-$ts0 ... >> event2/trigger
|
||||
+ # echo 'hist:keys=pid,prio:ts0=common_timestamp ... >> event1/trigger
|
||||
+ # echo 'hist:keys=next_pid:wakeup_lat=common_timestamp-$ts0 ... >> event2/trigger
|
||||
+
|
||||
+In the first line above, the event's timetamp is saved into the
|
||||
+variable ts0. In the next line, ts0 is subtracted from the second
|
||||
|
@ -323,7 +322,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+ Next, we specify that whenever we see a sched_waking event for a
|
||||
+ cyclictest thread, save the timestamp in a 'ts0' variable:
|
||||
+
|
||||
+ # echo 'hist:keys=$saved_pid:saved_pid=pid:ts0=$common_timestamp.usecs \
|
||||
+ # echo 'hist:keys=$saved_pid:saved_pid=pid:ts0=common_timestamp.usecs \
|
||||
+ if comm=="cyclictest"' >> \
|
||||
+ /sys/kernel/debug/tracing/events/sched/sched_waking/trigger
|
||||
+
|
||||
|
@ -332,7 +331,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+ along with another variable and an event field to generate a
|
||||
+ wakeup_latency synthetic event:
|
||||
+
|
||||
+ # echo 'hist:keys=next_pid:wakeup_lat=$common_timestamp.usecs-$ts0:\
|
||||
+ # echo 'hist:keys=next_pid:wakeup_lat=common_timestamp.usecs-$ts0:\
|
||||
+ onmatch(sched.sched_waking).wakeup_latency($wakeup_lat,\
|
||||
+ $saved_pid,next_prio) if next_comm=="cyclictest"' >> \
|
||||
+ /sys/kernel/debug/tracing/events/sched/sched_switch/trigger
|
||||
|
@ -371,12 +370,12 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+ maximum latency, the values specified in the save() fields are
|
||||
+ recoreded:
|
||||
+
|
||||
+ # echo 'hist:keys=pid:ts0=$common_timestamp.usecs \
|
||||
+ # echo 'hist:keys=pid:ts0=common_timestamp.usecs \
|
||||
+ if comm=="cyclictest"' >> \
|
||||
+ /sys/kernel/debug/tracing/events/sched/sched_waking/trigger
|
||||
+
|
||||
+ # echo 'hist:keys=next_pid:\
|
||||
+ wakeup_lat=$common_timestamp.usecs-$ts0:\
|
||||
+ wakeup_lat=common_timestamp.usecs-$ts0:\
|
||||
+ onmax($wakeup_lat).save(next_comm,prev_pid,prev_prio,prev_comm) \
|
||||
+ if next_comm=="cyclictest"' >> \
|
||||
+ /sys/kernel/debug/tracing/events/sched/sched_switch/trigger
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Thomas Gleixner <tglx@linutronix.de>
|
||||
Date: Thu, 23 Nov 2017 16:39:13 +0100
|
||||
Subject: [PATCH 32/36] xfrm: Replace hrtimer tasklet with softirq hrtimer
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
Switch the timer to HRTIMER_MODE_SOFT, which executed the timer
|
||||
callback in softirq context and remove the hrtimer_tasklet.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Thomas Gleixner <tglx@linutronix.de>
|
||||
Date: Thu, 23 Nov 2017 16:39:14 +0100
|
||||
Subject: [PATCH 33/36] softirq: Remove tasklet_hrtimer
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
There are no more tasklet_hrtimer users of this interface.
|
||||
Remove it.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 17 Nov 2017 14:33:12 -0600
|
||||
Date: Wed, 6 Dec 2017 16:38:14 -0600
|
||||
Subject: [PATCH 33/37] tracing: Make tracing_set_clock() non-static
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
Allow tracing code outside of trace.c to access tracing_set_clock().
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Thomas Gleixner <tglx@linutronix.de>
|
||||
Date: Thu, 23 Nov 2017 16:39:15 +0100
|
||||
Subject: [PATCH 34/36] ALSA/dummy: Replace tasklet with softirq hrtimer
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
The tasklet is used to defer the execution of snd_pcm_period_elapsed() to
|
||||
the softirq context. Using the HRTIMER_MODE_SOFT mode invokes the timer
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 17 Nov 2017 14:33:13 -0600
|
||||
Date: Wed, 6 Dec 2017 16:38:15 -0600
|
||||
Subject: [PATCH 34/37] tracing: Add a clock attribute for hist triggers
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
The default clock if timestamps are used in a histogram is "global".
|
||||
If timestamps aren't used, the clock is irrelevant.
|
||||
|
@ -13,18 +13,18 @@ Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
|
|||
Signed-off-by: Rajvi Jingar <rajvi.jingar@intel.com>
|
||||
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
---
|
||||
Documentation/trace/histogram.txt | 11 ++++++++++-
|
||||
kernel/trace/trace_events_hist.c | 38 ++++++++++++++++++++++++++++++++++++--
|
||||
2 files changed, 46 insertions(+), 3 deletions(-)
|
||||
Documentation/trace/histogram.txt | 11 +++++++++
|
||||
kernel/trace/trace_events_hist.c | 42 +++++++++++++++++++++++++++++++++++---
|
||||
2 files changed, 49 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/Documentation/trace/histogram.txt
|
||||
+++ b/Documentation/trace/histogram.txt
|
||||
@@ -1674,7 +1674,16 @@ specification. In support of this overa
|
||||
default it is in units of nanoseconds; appending '.usecs' to a
|
||||
@@ -1671,7 +1671,16 @@ specification. In support of this overa
|
||||
it is in units of nanoseconds; appending '.usecs' to a
|
||||
common_timestamp field changes the units to microseconds.
|
||||
|
||||
-These features are decribed in more detail in the following sections.
|
||||
+A note on inter-event timestamps: If $common_timestamp is used in a
|
||||
+A note on inter-event timestamps: If common_timestamp is used in a
|
||||
+histogram, the trace buffer is automatically switched over to using
|
||||
+absolute timestamps and the "global" trace clock, in order to avoid
|
||||
+bogus timestamp differences with other clocks that aren't coherent
|
||||
|
@ -47,7 +47,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
bool pause;
|
||||
bool cont;
|
||||
bool clear;
|
||||
@@ -1795,6 +1796,7 @@ static void destroy_hist_trigger_attrs(s
|
||||
@@ -1792,6 +1793,7 @@ static void destroy_hist_trigger_attrs(s
|
||||
kfree(attrs->sort_key_str);
|
||||
kfree(attrs->keys_str);
|
||||
kfree(attrs->vals_str);
|
||||
|
@ -55,7 +55,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
kfree(attrs);
|
||||
}
|
||||
|
||||
@@ -1850,6 +1852,19 @@ static int parse_assignment(char *str, s
|
||||
@@ -1847,6 +1849,19 @@ static int parse_assignment(char *str, s
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
} else if (strncmp(str, "size=", strlen("size=")) == 0) {
|
||||
int map_bits = parse_map_size(str);
|
||||
|
||||
@@ -1914,6 +1929,14 @@ static struct hist_trigger_attrs *parse_
|
||||
@@ -1911,6 +1926,14 @@ static struct hist_trigger_attrs *parse_
|
||||
goto free;
|
||||
}
|
||||
|
||||
|
@ -90,7 +90,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
return attrs;
|
||||
free:
|
||||
destroy_hist_trigger_attrs(attrs);
|
||||
@@ -4926,6 +4949,8 @@ static int event_hist_trigger_print(stru
|
||||
@@ -4937,6 +4960,8 @@ static int event_hist_trigger_print(stru
|
||||
seq_puts(m, ".descending");
|
||||
}
|
||||
seq_printf(m, ":size=%u", (1 << hist_data->map->map_bits));
|
||||
|
@ -99,7 +99,15 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
|
||||
print_actions_spec(m, hist_data);
|
||||
|
||||
@@ -5188,10 +5213,19 @@ static int hist_register_trigger(char *g
|
||||
@@ -5204,7 +5229,6 @@ static int hist_register_trigger(char *g
|
||||
data->paused = true;
|
||||
|
||||
if (named_data) {
|
||||
- destroy_hist_data(data->private_data);
|
||||
data->private_data = named_data->private_data;
|
||||
set_named_trigger_data(data, named_data);
|
||||
data->ops = &event_hist_trigger_named_ops;
|
||||
@@ -5216,10 +5240,22 @@ static int hist_register_trigger(char *g
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
@ -117,6 +125,9 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
tracing_set_time_stamp_abs(file->tr, true);
|
||||
+ }
|
||||
+
|
||||
+ if (named_data)
|
||||
+ destroy_hist_data(hist_data);
|
||||
+
|
||||
+ ret++;
|
||||
out:
|
||||
return ret;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 17 Nov 2017 14:33:14 -0600
|
||||
Date: Wed, 6 Dec 2017 16:38:16 -0600
|
||||
Subject: [PATCH 35/37] tracing: Increase trace_recursive_lock() limit for
|
||||
synthetic events
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
Synthetic event generation needs to happen while the current event is
|
||||
still in progress, so add 1 to the trace_recursive_lock() recursion
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Thomas Gleixner <tglx@linutronix.de>
|
||||
Date: Thu, 23 Nov 2017 16:39:16 +0100
|
||||
Subject: [PATCH 35/36] usb/gadget/NCM: Replace tasklet with softirq hrtimer
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
The tx_tasklet tasklet is used in invoke the hrtimer (task_timer) in
|
||||
softirq context. This can be also achieved without the tasklet but
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Thomas Gleixner <tglx@linutronix.de>
|
||||
Date: Thu, 23 Nov 2017 16:39:17 +0100
|
||||
Subject: [PATCH 36/36] net/mvpp2: Replace tasklet with softirq hrtimer
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
The tx_done_tasklet tasklet is used in invoke the hrtimer
|
||||
(mvpp2_hr_timer_cb) in softirq context. This can be also achieved without
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
From: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Date: Fri, 17 Nov 2017 14:33:15 -0600
|
||||
Date: Wed, 6 Dec 2017 16:38:17 -0600
|
||||
Subject: [PATCH 36/37] tracing: Add inter-event blurb to HIST_TRIGGERS config
|
||||
option
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
So that users know that inter-event tracing is supported as part of
|
||||
the HIST_TRIGGERS option, include text to that effect in the help
|
||||
|
@ -11,18 +11,20 @@ text.
|
|||
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
|
||||
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
---
|
||||
kernel/trace/Kconfig | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
kernel/trace/Kconfig | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/kernel/trace/Kconfig
|
||||
+++ b/kernel/trace/Kconfig
|
||||
@@ -585,6 +585,9 @@ config HIST_TRIGGERS
|
||||
@@ -585,7 +585,10 @@ config HIST_TRIGGERS
|
||||
event activity as an initial guide for further investigation
|
||||
using more advanced tools.
|
||||
|
||||
- See Documentation/trace/events.txt.
|
||||
+ Inter-event tracing of quantities such as latencies is also
|
||||
+ supported using hist triggers under this option.
|
||||
+
|
||||
See Documentation/trace/events.txt.
|
||||
+ See Documentation/trace/histogram.txt.
|
||||
If in doubt, say N.
|
||||
|
||||
config MMIOTRACE_TEST
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
From: Rajvi Jingar <rajvi.jingar@intel.com>
|
||||
Date: Fri, 17 Nov 2017 14:33:16 -0600
|
||||
Date: Wed, 6 Dec 2017 16:38:18 -0600
|
||||
Subject: [PATCH 37/37] selftests: ftrace: Add inter-event hist triggers
|
||||
testcases
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
This adds inter-event hist triggers testcases which covers following:
|
||||
- create/remove synthetic event
|
||||
|
@ -96,8 +96,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+do_reset
|
||||
+
|
||||
+echo "Test extended error support"
|
||||
+echo 'hist:keys=pid:ts0=$common_timestamp.usecs if comm=="ping"' > events/sched/sched_wakeup/trigger
|
||||
+echo 'hist:keys=pid:ts0=$common_timestamp.usecs if comm=="ping"' >> events/sched/sched_wakeup/trigger &>/dev/null
|
||||
+echo 'hist:keys=pid:ts0=common_timestamp.usecs if comm=="ping"' > events/sched/sched_wakeup/trigger
|
||||
+echo 'hist:keys=pid:ts0=common_timestamp.usecs if comm=="ping"' >> events/sched/sched_wakeup/trigger &>/dev/null
|
||||
+if ! grep -q "ERROR:" events/sched/sched_wakeup/hist; then
|
||||
+ fail "Failed to generate extended error in histogram"
|
||||
+fi
|
||||
|
@ -140,8 +140,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+echo "Test field variable support"
|
||||
+
|
||||
+echo 'wakeup_latency u64 lat; pid_t pid; int prio; char comm[16]' > synthetic_events
|
||||
+echo 'hist:keys=comm:ts0=$common_timestamp.usecs if comm=="ping"' > events/sched/sched_waking/trigger
|
||||
+echo 'hist:keys=next_comm:wakeup_lat=$common_timestamp.usecs-$ts0:onmatch(sched.sched_waking).wakeup_latency($wakeup_lat,next_pid,sched.sched_waking.prio,next_comm) if next_comm=="ping"' > events/sched/sched_switch/trigger
|
||||
+echo 'hist:keys=comm:ts0=common_timestamp.usecs if comm=="ping"' > events/sched/sched_waking/trigger
|
||||
+echo 'hist:keys=next_comm:wakeup_lat=common_timestamp.usecs-$ts0:onmatch(sched.sched_waking).wakeup_latency($wakeup_lat,next_pid,sched.sched_waking.prio,next_comm) if next_comm=="ping"' > events/sched/sched_switch/trigger
|
||||
+echo 'hist:keys=pid,prio,comm:vals=lat:sort=pid,prio' > events/synthetic/wakeup_latency/trigger
|
||||
+
|
||||
+ping localhost -c 3
|
||||
|
@ -153,7 +153,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+ fail "Failed to create histogram with field variable"
|
||||
+fi
|
||||
+
|
||||
+echo '!hist:keys=next_comm:wakeup_lat=$common_timestamp.usecs-$ts0:onmatch(sched.sched_waking).wakeup_latency($wakeup_lat,next_pid,sched.sched_waking.prio,next_comm) if next_comm=="ping"' >> events/sched/sched_switch/trigger
|
||||
+echo '!hist:keys=next_comm:wakeup_lat=common_timestamp.usecs-$ts0:onmatch(sched.sched_waking).wakeup_latency($wakeup_lat,next_pid,sched.sched_waking.prio,next_comm) if next_comm=="ping"' >> events/sched/sched_switch/trigger
|
||||
+
|
||||
+if grep -q "synthetic_prio=prio" events/sched/sched_waking/hist; then
|
||||
+ fail "Failed to remove histogram with field variable"
|
||||
|
@ -203,13 +203,13 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+
|
||||
+echo "Test combined histogram"
|
||||
+
|
||||
+echo 'hist:keys=pid:ts0=$common_timestamp.usecs if comm=="ping"' > events/sched/sched_waking/trigger
|
||||
+echo 'hist:keys=pid:waking_lat=$common_timestamp.usecs-$ts0:onmatch(sched.sched_waking).waking_latency($waking_lat,pid) if comm=="ping"' > events/sched/sched_wakeup/trigger
|
||||
+echo 'hist:keys=pid:ts0=common_timestamp.usecs if comm=="ping"' > events/sched/sched_waking/trigger
|
||||
+echo 'hist:keys=pid:waking_lat=common_timestamp.usecs-$ts0:onmatch(sched.sched_waking).waking_latency($waking_lat,pid) if comm=="ping"' > events/sched/sched_wakeup/trigger
|
||||
+echo 'hist:keys=pid,lat:sort=pid,lat' > events/synthetic/waking_latency/trigger
|
||||
+
|
||||
+echo 'wakeup_latency u64 lat pid_t pid' >> synthetic_events
|
||||
+echo 'hist:keys=pid:ts1=$common_timestamp.usecs if comm=="ping"' >> events/sched/sched_wakeup/trigger
|
||||
+echo 'hist:keys=next_pid:wakeup_lat=$common_timestamp.usecs-$ts1:onmatch(sched.sched_wakeup).wakeup_latency($wakeup_lat,next_pid) if next_comm=="ping"' > events/sched/sched_switch/trigger
|
||||
+echo 'hist:keys=pid:ts1=common_timestamp.usecs if comm=="ping"' >> events/sched/sched_wakeup/trigger
|
||||
+echo 'hist:keys=next_pid:wakeup_lat=common_timestamp.usecs-$ts1:onmatch(sched.sched_wakeup).wakeup_latency($wakeup_lat,next_pid) if next_comm=="ping"' > events/sched/sched_switch/trigger
|
||||
+
|
||||
+echo 'waking+wakeup_latency u64 lat; pid_t pid' >> synthetic_events
|
||||
+echo 'hist:keys=pid,lat:sort=pid,lat:ww_lat=$waking_lat+$wakeup_lat:onmatch(synthetic.wakeup_latency).waking+wakeup_latency($ww_lat,pid)' >> events/synthetic/wakeup_latency/trigger
|
||||
|
@ -265,8 +265,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+echo "Test create histogram for synthetic event"
|
||||
+echo "Test histogram variables,simple expression support and onmatch action"
|
||||
+
|
||||
+echo 'hist:keys=pid:ts0=$common_timestamp.usecs if comm=="ping"' > events/sched/sched_wakeup/trigger
|
||||
+echo 'hist:keys=next_pid:wakeup_lat=$common_timestamp.usecs-$ts0:onmatch(sched.sched_wakeup).wakeup_latency($wakeup_lat,next_pid,next_comm) if next_comm=="ping"' > events/sched/sched_switch/trigger
|
||||
+echo 'hist:keys=pid:ts0=common_timestamp.usecs if comm=="ping"' > events/sched/sched_wakeup/trigger
|
||||
+echo 'hist:keys=next_pid:wakeup_lat=common_timestamp.usecs-$ts0:onmatch(sched.sched_wakeup).wakeup_latency($wakeup_lat,next_pid,next_comm) if next_comm=="ping"' > events/sched/sched_switch/trigger
|
||||
+echo 'hist:keys=comm,pid,lat:wakeup_lat=lat:sort=lat' > events/synthetic/wakeup_latency/trigger
|
||||
+ping localhost -c 5
|
||||
+if ! grep -q "ping" events/synthetic/wakeup_latency/hist; then
|
||||
|
@ -318,8 +318,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+echo "Test create histogram for synthetic event"
|
||||
+echo "Test histogram variables,simple expression support and onmatch-onmax action"
|
||||
+
|
||||
+echo 'hist:keys=pid:ts0=$common_timestamp.usecs if comm=="ping"' > events/sched/sched_wakeup/trigger
|
||||
+echo 'hist:keys=next_pid:wakeup_lat=$common_timestamp.usecs-$ts0:onmatch(sched.sched_wakeup).wakeup_latency($wakeup_lat,next_pid,next_comm):onmax($wakeup_lat).save(next_comm,prev_pid,prev_prio,prev_comm) if next_comm=="ping"' >> events/sched/sched_switch/trigger
|
||||
+echo 'hist:keys=pid:ts0=common_timestamp.usecs if comm=="ping"' > events/sched/sched_wakeup/trigger
|
||||
+echo 'hist:keys=next_pid:wakeup_lat=common_timestamp.usecs-$ts0:onmatch(sched.sched_wakeup).wakeup_latency($wakeup_lat,next_pid,next_comm):onmax($wakeup_lat).save(next_comm,prev_pid,prev_prio,prev_comm) if next_comm=="ping"' >> events/sched/sched_switch/trigger
|
||||
+echo 'hist:keys=comm,pid,lat:wakeup_lat=lat:sort=lat' > events/synthetic/wakeup_latency/trigger
|
||||
+ping localhost -c 5
|
||||
+if [ ! grep -q "ping" events/synthetic/wakeup_latency/hist -o ! grep -q "max:" events/sched/sched_switch/hist]; then
|
||||
|
@ -370,8 +370,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
+
|
||||
+echo "Test onmax action"
|
||||
+
|
||||
+echo 'hist:keys=pid:ts0=$common_timestamp.usecs if comm=="ping"' >> events/sched/sched_waking/trigger
|
||||
+echo 'hist:keys=next_pid:wakeup_lat=$common_timestamp.usecs-$ts0:onmax($wakeup_lat).save(next_comm,prev_pid,prev_prio,prev_comm) if next_comm=="ping"' >> events/sched/sched_switch/trigger
|
||||
+echo 'hist:keys=pid:ts0=common_timestamp.usecs if comm=="ping"' >> events/sched/sched_waking/trigger
|
||||
+echo 'hist:keys=next_pid:wakeup_lat=common_timestamp.usecs-$ts0:onmax($wakeup_lat).save(next_comm,prev_pid,prev_prio,prev_comm) if next_comm=="ping"' >> events/sched/sched_switch/trigger
|
||||
+ping localhost -c 3
|
||||
+if ! grep -q "max:" events/sched/sched_switch/hist; then
|
||||
+ fail "Failed to create onmax action inter-event histogram"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: "Yadi.hu" <yadi.hu@windriver.com>
|
||||
Date: Wed, 10 Dec 2014 10:32:09 +0800
|
||||
Subject: ARM: enable irq in translation/section permission fault handlers
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
Probably happens on all ARM, with
|
||||
CONFIG_PREEMPT_RT_FULL
|
||||
|
|
|
@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
Date: Thu, 21 Sep 2017 15:35:57 +0200
|
||||
Subject: Bluetooth: avoid recursive locking in
|
||||
hci_send_to_channel()
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
Mart reported a deadlock in -RT in the call path:
|
||||
hci_send_monitor_ctrl_event() -> hci_send_to_channel()
|
||||
|
@ -16,7 +16,7 @@ the readlock to be held.
|
|||
|
||||
Cc: Marcel Holtmann <marcel@holtmann.org>
|
||||
Cc: Johan Hedberg <johan.hedberg@intel.com>
|
||||
Cc: rt-stable@vger.kernel.org
|
||||
Cc: stable-rt@vger.kernel.org
|
||||
Fixes: 38ceaa00d02d ("Bluetooth: Add support for sending MGMT commands and events to monitor")
|
||||
Reported-by: Mart van de Wege <mvdwege@gmail.com>
|
||||
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
Date: Thu, 21 Mar 2013 19:01:05 +0100
|
||||
Subject: printk: Drop the logbuf_lock more often
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
The lock is hold with irgs off. The latency drops 500us+ on my arm bugs
|
||||
with a "full" buffer after executing "dmesg" on the shell.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Josh Cartwright <joshc@ni.com>
|
||||
Date: Thu, 11 Feb 2016 11:54:01 -0600
|
||||
Subject: KVM: arm/arm64: downgrade preempt_disable()d region to migrate_disable()
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
kvm_arch_vcpu_ioctl_run() disables the use of preemption when updating
|
||||
the vgic and timer states to prevent the calling task from migrating to
|
||||
|
|
|
@ -5,7 +5,7 @@ Cc: Anna Schumaker <anna.schumaker@netapp.com>,
|
|||
linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org,
|
||||
tglx@linutronix.de
|
||||
Subject: NFSv4: replace seqcount_t with a seqlock_t
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
The raw_write_seqcount_begin() in nfs4_reclaim_open_state() bugs me
|
||||
because it maps to preempt_disable() in -RT which I can't have at this
|
||||
|
@ -58,7 +58,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
|
||||
--- a/fs/nfs/nfs4proc.c
|
||||
+++ b/fs/nfs/nfs4proc.c
|
||||
@@ -2641,7 +2641,7 @@ static int _nfs4_open_and_get_state(stru
|
||||
@@ -2638,7 +2638,7 @@ static int _nfs4_open_and_get_state(stru
|
||||
unsigned int seq;
|
||||
int ret;
|
||||
|
||||
|
@ -67,7 +67,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
|
||||
ret = _nfs4_proc_open(opendata);
|
||||
if (ret != 0)
|
||||
@@ -2679,7 +2679,7 @@ static int _nfs4_open_and_get_state(stru
|
||||
@@ -2676,7 +2676,7 @@ static int _nfs4_open_and_get_state(stru
|
||||
|
||||
if (d_inode(dentry) == state->inode) {
|
||||
nfs_inode_attach_open_context(ctx);
|
||||
|
|
|
@ -2,7 +2,7 @@ From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|||
Date: Thu, 21 Sep 2017 14:25:13 +0200
|
||||
Subject: [PATCH] RCU: we need to skip that warning but only on sleeping
|
||||
locks
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
This check is okay for upstream. On RT we trigger this while blocking on
|
||||
sleeping lock. In this case, it is okay to schedule() within a RCU
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
Date: Thu, 23 Nov 2017 17:51:51 +0100
|
||||
Subject: [PATCH] Revert "fs: jbd2: pull your plug when waiting for space"
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
This reverts commit "fs: jbd2: pull your plug when waiting for space".
|
||||
This was a duct-tape fix which shouldn't be needed since commit
|
||||
"locking/rt-mutex: fix deadlock in device mapper / block-IO".
|
||||
|
||||
Cc: stable@vger.kernel.org
|
||||
Cc: stable-rt@vger.kernel.org
|
||||
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
---
|
||||
fs/jbd2/checkpoint.c | 2 --
|
||||
|
|
|
@ -2,7 +2,7 @@ From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
|
|||
Date: Wed, 22 Nov 2017 07:31:19 -0500
|
||||
Subject: [PATCH] Revert "memcontrol: Prevent scheduling while atomic in cgroup
|
||||
code"
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
The commit "memcontrol: Prevent scheduling while atomic in cgroup code"
|
||||
fixed this issue:
|
||||
|
@ -19,7 +19,7 @@ the calls to res_counter_uncharge() in drain_stock() to the lockless
|
|||
function page_counter_uncharge(). There is no more spin lock there and no
|
||||
more reason to have that local lock.
|
||||
|
||||
Cc: <stable@vger.kernel.org>
|
||||
Cc: <stable-rt@vger.kernel.org>
|
||||
Reported-by: Haiyang HY1 Tan <tanhy1@lenovo.com>
|
||||
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
|
||||
[bigeasy: That upstream commit appeared in v3.19 and the patch in
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Steven Rostedt <rostedt@goodmis.org>
|
||||
Date: Wed, 13 Feb 2013 09:26:05 -0500
|
||||
Subject: acpi/rt: Convert acpi_gbl_hardware lock back to a raw_spinlock_t
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
We hit the following bug with 3.6-rt:
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
Date: Sat, 27 May 2017 19:02:06 +0200
|
||||
Subject: kernel/sched/core: add migrate_disable()
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
---
|
||||
include/linux/preempt.h | 23 ++++++++
|
||||
|
@ -80,7 +80,7 @@ Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4
|
|||
* boot command line:
|
||||
--- a/kernel/sched/core.c
|
||||
+++ b/kernel/sched/core.c
|
||||
@@ -1023,7 +1023,15 @@ void set_cpus_allowed_common(struct task
|
||||
@@ -1022,7 +1022,15 @@ void set_cpus_allowed_common(struct task
|
||||
p->nr_cpus_allowed = cpumask_weight(new_mask);
|
||||
}
|
||||
|
||||
|
@ -97,7 +97,7 @@ Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4
|
|||
{
|
||||
struct rq *rq = task_rq(p);
|
||||
bool queued, running;
|
||||
@@ -1052,6 +1060,20 @@ void do_set_cpus_allowed(struct task_str
|
||||
@@ -1051,6 +1059,20 @@ void do_set_cpus_allowed(struct task_str
|
||||
set_curr_task(rq, p);
|
||||
}
|
||||
|
||||
|
@ -118,7 +118,7 @@ Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4
|
|||
/*
|
||||
* Change a given task's CPU affinity. Migrate the thread to a
|
||||
* proper CPU and schedule it away if the CPU it's executing on
|
||||
@@ -1110,9 +1132,16 @@ static int __set_cpus_allowed_ptr(struct
|
||||
@@ -1109,9 +1131,16 @@ static int __set_cpus_allowed_ptr(struct
|
||||
}
|
||||
|
||||
/* Can the task run on the task's current CPU? If so, we're done */
|
||||
|
@ -136,7 +136,7 @@ Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4
|
|||
dest_cpu = cpumask_any_and(cpu_valid_mask, new_mask);
|
||||
if (task_running(rq, p) || p->state == TASK_WAKING) {
|
||||
struct migration_arg arg = { p, dest_cpu };
|
||||
@@ -6760,3 +6789,100 @@ const u32 sched_prio_to_wmult[40] = {
|
||||
@@ -6759,3 +6788,100 @@ const u32 sched_prio_to_wmult[40] = {
|
||||
/* 10 */ 39045157, 49367440, 61356676, 76695844, 95443717,
|
||||
/* 15 */ 119304647, 148102320, 186737708, 238609294, 286331153,
|
||||
};
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
Date: Wed, 11 Oct 2017 17:43:49 +0200
|
||||
Subject: apparmor: use a locallock instead preempt_disable()
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
get_buffers() disables preemption which acts as a lock for the per-CPU
|
||||
variable. Since we can't disable preemption here on RT, a local_lock is
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Anders Roxell <anders.roxell@linaro.org>
|
||||
Date: Thu, 14 May 2015 17:52:17 +0200
|
||||
Subject: arch/arm64: Add lazy preempt support
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
arm64 is missing support for PREEMPT_RT. The main feature which is
|
||||
lacking is support for lazy preemption. The arch-specific entry code,
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Benedikt Spranger <b.spranger@linutronix.de>
|
||||
Date: Sat, 6 Mar 2010 17:47:10 +0100
|
||||
Subject: ARM: AT91: PIT: Remove irq handler when clock event is unused
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
Setup and remove the interrupt handler in clock event mode selection.
|
||||
This avoids calling the (shared) interrupt handler when the device is
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Thomas Gleixner <tglx@linutronix.de>
|
||||
Date: Sat, 1 May 2010 18:29:35 +0200
|
||||
Subject: ARM: at91: tclib: Default to tclib timer for RT
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
RT is not too happy about the shared timer interrupt in AT91
|
||||
devices. Default to tclib timer for RT.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
From: Frank Rowand <frank.rowand@am.sony.com>
|
||||
Date: Mon, 19 Sep 2011 14:51:14 -0700
|
||||
Subject: arm: Convert arm boot_lock to raw
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
The arm boot_lock is used by the secondary processor startup code. The locking
|
||||
task is the idle thread, which has idle->sched_class == &idle_sched_class.
|
||||
|
|
|
@ -0,0 +1,128 @@
|
|||
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
Date: Fri, 1 Dec 2017 10:42:03 +0100
|
||||
Subject: [PATCH] arm*: disable NEON in kernel mode
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
NEON in kernel mode is used by the crypto algorithms and raid6 code.
|
||||
While the raid6 code looks okay, the crypto algorithms do not: NEON
|
||||
is enabled on first invocation and may allocate/free/map memory before
|
||||
the NEON mode is disabled again.
|
||||
This needs to be changed until it can be enabled.
|
||||
On ARM NEON in kernel mode can be simply disabled. on ARM64 it needs to
|
||||
stay on due to possible EFI callbacks so here I disable each algorithm.
|
||||
|
||||
Cc: stable-rt@vger.kernel.org
|
||||
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
---
|
||||
arch/arm/Kconfig | 2 +-
|
||||
arch/arm64/crypto/Kconfig | 20 ++++++++++----------
|
||||
arch/arm64/crypto/crc32-ce-glue.c | 3 ++-
|
||||
3 files changed, 13 insertions(+), 12 deletions(-)
|
||||
|
||||
--- a/arch/arm/Kconfig
|
||||
+++ b/arch/arm/Kconfig
|
||||
@@ -2164,7 +2164,7 @@ config NEON
|
||||
|
||||
config KERNEL_MODE_NEON
|
||||
bool "Support for NEON in kernel mode"
|
||||
- depends on NEON && AEABI
|
||||
+ depends on NEON && AEABI && !PREEMPT_RT_BASE
|
||||
help
|
||||
Say Y to include support for NEON in kernel mode.
|
||||
|
||||
--- a/arch/arm64/crypto/Kconfig
|
||||
+++ b/arch/arm64/crypto/Kconfig
|
||||
@@ -19,19 +19,19 @@ config CRYPTO_SHA512_ARM64
|
||||
|
||||
config CRYPTO_SHA1_ARM64_CE
|
||||
tristate "SHA-1 digest algorithm (ARMv8 Crypto Extensions)"
|
||||
- depends on KERNEL_MODE_NEON
|
||||
+ depends on KERNEL_MODE_NEON && !PREEMPT_RT_BASE
|
||||
select CRYPTO_HASH
|
||||
select CRYPTO_SHA1
|
||||
|
||||
config CRYPTO_SHA2_ARM64_CE
|
||||
tristate "SHA-224/SHA-256 digest algorithm (ARMv8 Crypto Extensions)"
|
||||
- depends on KERNEL_MODE_NEON
|
||||
+ depends on KERNEL_MODE_NEON && !PREEMPT_RT_BASE
|
||||
select CRYPTO_HASH
|
||||
select CRYPTO_SHA256_ARM64
|
||||
|
||||
config CRYPTO_GHASH_ARM64_CE
|
||||
tristate "GHASH/AES-GCM using ARMv8 Crypto Extensions"
|
||||
- depends on KERNEL_MODE_NEON
|
||||
+ depends on KERNEL_MODE_NEON && !PREEMPT_RT_BASE
|
||||
select CRYPTO_HASH
|
||||
select CRYPTO_GF128MUL
|
||||
select CRYPTO_AES
|
||||
@@ -39,7 +39,7 @@ config CRYPTO_GHASH_ARM64_CE
|
||||
|
||||
config CRYPTO_CRCT10DIF_ARM64_CE
|
||||
tristate "CRCT10DIF digest algorithm using PMULL instructions"
|
||||
- depends on KERNEL_MODE_NEON && CRC_T10DIF
|
||||
+ depends on KERNEL_MODE_NEON && CRC_T10DIF && !PREEMPT_RT_BASE
|
||||
select CRYPTO_HASH
|
||||
|
||||
config CRYPTO_CRC32_ARM64_CE
|
||||
@@ -53,13 +53,13 @@ config CRYPTO_AES_ARM64
|
||||
|
||||
config CRYPTO_AES_ARM64_CE
|
||||
tristate "AES core cipher using ARMv8 Crypto Extensions"
|
||||
- depends on ARM64 && KERNEL_MODE_NEON
|
||||
+ depends on ARM64 && KERNEL_MODE_NEON && !PREEMPT_RT_BASE
|
||||
select CRYPTO_ALGAPI
|
||||
select CRYPTO_AES_ARM64
|
||||
|
||||
config CRYPTO_AES_ARM64_CE_CCM
|
||||
tristate "AES in CCM mode using ARMv8 Crypto Extensions"
|
||||
- depends on ARM64 && KERNEL_MODE_NEON
|
||||
+ depends on ARM64 && KERNEL_MODE_NEON && !PREEMPT_RT_BASE
|
||||
select CRYPTO_ALGAPI
|
||||
select CRYPTO_AES_ARM64_CE
|
||||
select CRYPTO_AES_ARM64
|
||||
@@ -67,7 +67,7 @@ config CRYPTO_AES_ARM64_CE_CCM
|
||||
|
||||
config CRYPTO_AES_ARM64_CE_BLK
|
||||
tristate "AES in ECB/CBC/CTR/XTS modes using ARMv8 Crypto Extensions"
|
||||
- depends on KERNEL_MODE_NEON
|
||||
+ depends on KERNEL_MODE_NEON && !PREEMPT_RT_BASE
|
||||
select CRYPTO_BLKCIPHER
|
||||
select CRYPTO_AES_ARM64_CE
|
||||
select CRYPTO_AES_ARM64
|
||||
@@ -75,7 +75,7 @@ config CRYPTO_AES_ARM64_CE_BLK
|
||||
|
||||
config CRYPTO_AES_ARM64_NEON_BLK
|
||||
tristate "AES in ECB/CBC/CTR/XTS modes using NEON instructions"
|
||||
- depends on KERNEL_MODE_NEON
|
||||
+ depends on KERNEL_MODE_NEON && !PREEMPT_RT_BASE
|
||||
select CRYPTO_BLKCIPHER
|
||||
select CRYPTO_AES_ARM64
|
||||
select CRYPTO_AES
|
||||
@@ -83,13 +83,13 @@ config CRYPTO_AES_ARM64_NEON_BLK
|
||||
|
||||
config CRYPTO_CHACHA20_NEON
|
||||
tristate "NEON accelerated ChaCha20 symmetric cipher"
|
||||
- depends on KERNEL_MODE_NEON
|
||||
+ depends on KERNEL_MODE_NEON && !PREEMPT_RT_BASE
|
||||
select CRYPTO_BLKCIPHER
|
||||
select CRYPTO_CHACHA20
|
||||
|
||||
config CRYPTO_AES_ARM64_BS
|
||||
tristate "AES in ECB/CBC/CTR/XTS modes using bit-sliced NEON algorithm"
|
||||
- depends on KERNEL_MODE_NEON
|
||||
+ depends on KERNEL_MODE_NEON && !PREEMPT_RT_BASE
|
||||
select CRYPTO_BLKCIPHER
|
||||
select CRYPTO_AES_ARM64_NEON_BLK
|
||||
select CRYPTO_AES_ARM64
|
||||
--- a/arch/arm64/crypto/crc32-ce-glue.c
|
||||
+++ b/arch/arm64/crypto/crc32-ce-glue.c
|
||||
@@ -206,7 +206,8 @@ static struct shash_alg crc32_pmull_algs
|
||||
|
||||
static int __init crc32_pmull_mod_init(void)
|
||||
{
|
||||
- if (IS_ENABLED(CONFIG_KERNEL_MODE_NEON) && (elf_hwcap & HWCAP_PMULL)) {
|
||||
+ if (IS_ENABLED(CONFIG_KERNEL_MODE_NEON) &&
|
||||
+ !IS_ENABLED(CONFIG_PREEMPT_RT_BASE) && (elf_hwcap & HWCAP_PMULL)) {
|
||||
crc32_pmull_algs[0].update = crc32_pmull_update;
|
||||
crc32_pmull_algs[1].update = crc32c_pmull_update;
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
Subject: arm: Enable highmem for rt
|
||||
From: Thomas Gleixner <tglx@linutronix.de>
|
||||
Date: Wed, 13 Feb 2013 11:03:11 +0100
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.1-rt3.tar.xz
|
||||
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
|
||||
|
||||
fixup highmem for ARM.
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue