[rt] Update to 4.14.8-rt9

This commit is contained in:
Salvatore Bonaccorso 2018-01-05 10:53:38 +01:00
parent f5474829b9
commit f587f7242e
387 changed files with 974 additions and 830 deletions

3
debian/changelog vendored
View File

@ -11,6 +11,9 @@ linux (4.14.8-1) UNRELEASED; urgency=medium
* [arm64] Backport patch from linux-next to support SMP on tegra210
systems.
[ Salvatore Bonaccorso ]
* [rt] Update to 4.14.8-rt9
-- Ben Hutchings <ben@decadent.org.uk> Thu, 28 Dec 2017 01:18:05 +0000
linux (4.14.7-1) unstable; urgency=medium

View File

@ -0,0 +1,76 @@
From: Anna-Maria Gleixner <anna-maria@linutronix.de>
Date: Fri, 22 Dec 2017 15:51:12 +0100
Subject: [PATCH 1/4] timer: Use deferrable base independent of
base::nohz_active
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
During boot and before base::nohz_active is set in the timer bases, deferrable
timers are enqueued into the standard timer base. This works correctly as
long as base::nohz_active is false.
Once it base::nohz_active is set and a timer which was enqueued before that
is accessed the lock selector code choses the lock of the deferred
base. This causes unlocked access to the standard base and in case the
timer is removed it does not clear the pending flag in the standard base
bitmap which causes get_next_timer_interrupt() to return bogus values.
To prevent that, the deferrable timers must be enqueued in the deferrable
base, even when base::nohz_active is not set. Those deferrable timers also
need to be expired unconditional.
Fixes: 500462a9de65 ("timers: Switch to a non-cascading wheel")
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Cc: rt@linutronix.de
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
kernel/time/timer.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/kernel/time/timer.c b/kernel/time/timer.c
index f2674a056c26..fdfaf4f3bcfa 100644
--- a/kernel/time/timer.c
+++ b/kernel/time/timer.c
@@ -814,11 +814,10 @@ static inline struct timer_base *get_timer_cpu_base(u32 tflags, u32 cpu)
struct timer_base *base = per_cpu_ptr(&timer_bases[BASE_STD], cpu);
/*
- * If the timer is deferrable and nohz is active then we need to use
- * the deferrable base.
+ * If the timer is deferrable and NO_HZ_COMMON is set then we need
+ * to use the deferrable base.
*/
- if (IS_ENABLED(CONFIG_NO_HZ_COMMON) && base->nohz_active &&
- (tflags & TIMER_DEFERRABLE))
+ if (IS_ENABLED(CONFIG_NO_HZ_COMMON) && (tflags & TIMER_DEFERRABLE))
base = per_cpu_ptr(&timer_bases[BASE_DEF], cpu);
return base;
}
@@ -828,11 +827,10 @@ static inline struct timer_base *get_timer_this_cpu_base(u32 tflags)
struct timer_base *base = this_cpu_ptr(&timer_bases[BASE_STD]);
/*
- * If the timer is deferrable and nohz is active then we need to use
- * the deferrable base.
+ * If the timer is deferrable and NO_HZ_COMMON is set then we need
+ * to use the deferrable base.
*/
- if (IS_ENABLED(CONFIG_NO_HZ_COMMON) && base->nohz_active &&
- (tflags & TIMER_DEFERRABLE))
+ if (IS_ENABLED(CONFIG_NO_HZ_COMMON) && (tflags & TIMER_DEFERRABLE))
base = this_cpu_ptr(&timer_bases[BASE_DEF]);
return base;
}
@@ -1644,7 +1642,7 @@ static __latent_entropy void run_timer_softirq(struct softirq_action *h)
base->must_forward_clk = false;
__run_timers(base);
- if (IS_ENABLED(CONFIG_NO_HZ_COMMON) && base->nohz_active)
+ if (IS_ENABLED(CONFIG_NO_HZ_COMMON))
__run_timers(this_cpu_ptr(&timer_bases[BASE_DEF]));
}
--
2.15.1

View File

@ -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.6-rt7.tar.xz
Date: Wed, 20 Dec 2017 17:12:50 +0100
Subject: [PATCH 01/29] 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.8-rt9.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
@ -15,14 +15,15 @@ high performance networking which tends to disable the timer migration
functionality.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
include/linux/hrtimer.h | 4 -
include/linux/hrtimer.h | 4 --
kernel/time/hrtimer.c | 17 ++------
kernel/time/tick-internal.h | 19 +++++----
kernel/time/tick-sched.c | 2
kernel/time/timer.c | 91 ++++++++++++++++++++++----------------------
5 files changed, 65 insertions(+), 68 deletions(-)
kernel/time/tick-internal.h | 19 ++++++---
kernel/time/tick-sched.c | 2 -
kernel/time/timer.c | 85 ++++++++++++++++++++++----------------------
5 files changed, 62 insertions(+), 65 deletions(-)
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@ -224,25 +225,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
return;
/*
@@ -817,7 +829,7 @@ static inline struct timer_base *get_tim
* If the timer is deferrable and nohz is active then we need to use
* the deferrable base.
*/
- if (IS_ENABLED(CONFIG_NO_HZ_COMMON) && base->nohz_active &&
+ if (is_timers_nohz_active() &&
(tflags & TIMER_DEFERRABLE))
base = per_cpu_ptr(&timer_bases[BASE_DEF], cpu);
return base;
@@ -831,7 +843,7 @@ static inline struct timer_base *get_tim
* If the timer is deferrable and nohz is active then we need to use
* the deferrable base.
*/
- if (IS_ENABLED(CONFIG_NO_HZ_COMMON) && base->nohz_active &&
+ if (is_timers_nohz_active() &&
(tflags & TIMER_DEFERRABLE))
base = this_cpu_ptr(&timer_bases[BASE_DEF]);
return base;
@@ -842,21 +854,20 @@ static inline struct timer_base *get_tim
@@ -840,21 +852,20 @@ static inline struct timer_base *get_tim
return get_timer_cpu_base(tflags, tflags & TIMER_CPUMASK);
}
@ -270,7 +253,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
unsigned long jnow;
/*
@@ -880,16 +891,8 @@ static inline void forward_timer_base(st
@@ -878,16 +889,8 @@ static inline void forward_timer_base(st
base->clk = jnow;
else
base->clk = base->next_expiry;
@ -288,16 +271,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
/*
@@ -1644,7 +1647,7 @@ static __latent_entropy void run_timer_s
base->must_forward_clk = false;
__run_timers(base);
- if (IS_ENABLED(CONFIG_NO_HZ_COMMON) && base->nohz_active)
+ if (is_timers_nohz_active())
__run_timers(this_cpu_ptr(&timer_bases[BASE_DEF]));
}
@@ -1658,7 +1661,7 @@ void run_local_timers(void)
@@ -1656,7 +1659,7 @@ void run_local_timers(void)
hrtimer_run_queues();
/* Raise the softirq only if required. */
if (time_before(jiffies, base->clk)) {

View File

@ -1,8 +1,8 @@
From: Tom Zanussi <tom.zanussi@linux.intel.com>
Date: Wed, 6 Dec 2017 16:37:42 -0600
Date: Thu, 21 Dec 2017 10:02:23 -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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.

View 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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
On Tue, 5 Sep 2017 16:57:52 -0500
Tom Zanussi <tom.zanussi@linux.intel.com> wrote:

View File

@ -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.6-rt7.tar.xz
Date: Wed, 20 Dec 2017 17:12:51 +0100
Subject: [PATCH 02/29] hrtimer: Correct blantanly wrong comment
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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.
@ -14,6 +14,7 @@ callback is running.
Reported-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
kernel/time/hrtimer.c | 6 +++---

View File

@ -0,0 +1,53 @@
From: Thomas Gleixner <tglx@linutronix.de>
Date: Fri, 22 Dec 2017 15:51:13 +0100
Subject: [PATCH 2/4] nohz: Prevent erroneous tick stop invocations
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
The conditions in irq_exit() to invoke tick_nohz_irq_exit() are:
if ((idle_cpu(cpu) && !need_resched()) || tick_nohz_full_cpu(cpu))
This is too permissive in various aspects:
1) If need_resched() is set, then the tick cannot be stopped whether
the CPU is idle or in nohz full mode.
2) If need_resched() is not set, but softirqs are pending then this is an
indication that the softirq code punted and delegated the execution to
softirqd. need_resched() is not true because the current interrupted
task takes precedence over softirqd.
Invoking tick_nohz_irq_exit() in these cases can cause an endless loop of
timer interrupts because the timer wheel contains an expired timer, but
softirqs are not yet executed. So it returns an immediate expiry request,
which causes the timer to fire immediately again. Lather, rinse and
repeat....
Prevent that by making the conditions proper and only allow invokation when
in idle or nohz full mode and neither need_resched() nor
local_softirq_pending() are set.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
kernel/softirq.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/softirq.c b/kernel/softirq.c
index 4e09821f9d9e..6d260b1229a1 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -381,7 +381,8 @@ static inline void tick_irq_exit(void)
int cpu = smp_processor_id();
/* Make sure that timer wheel updates are propagated */
- if ((idle_cpu(cpu) && !need_resched()) || tick_nohz_full_cpu(cpu)) {
+ if ((idle_cpu(cpu) || tick_nohz_full_cpu(cpu)) &&
+ !need_resched() && !local_softirq_pending()) {
if (!in_interrupt())
tick_nohz_irq_exit();
}
--
2.15.1

View File

@ -1,7 +1,7 @@
From: Tom Zanussi <tom.zanussi@linux.intel.com>
Date: Wed, 6 Dec 2017 16:37:43 -0600
Date: Thu, 21 Dec 2017 10:02:24 -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
Add a line for the log2 modifier, to keep it aligned with
tracing/README.

View File

@ -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
In order to make future changes where we need to call
tracing_set_clock() from within an event command, the order of

View File

@ -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.6-rt7.tar.xz
Date: Wed, 20 Dec 2017 17:12:52 +0100
Subject: [PATCH 03/29] hrtimer: Fix kerneldoc for struct hrtimer_cpu_base
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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
@ -9,7 +9,6 @@ members to the struct definition and document the purpose of
expires_next more precisely.
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
include/linux/hrtimer.h | 8 ++++----

View File

@ -0,0 +1,45 @@
From: Thomas Gleixner <tglx@linutronix.de>
Date: Fri, 22 Dec 2017 15:51:14 +0100
Subject: [PATCH 3/4] timer: Invoke timer_start_debug() where it makes sense
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
The timer start debug function is called before the proper timer base is
set. As a consequence the trace data contains the stale CPU and flags
values.
Call the debug function after setting the new base and flags.
Fixes: 500462a9de65 ("timers: Switch to a non-cascading wheel")
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Cc: rt@linutronix.de
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
kernel/time/timer.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/time/timer.c b/kernel/time/timer.c
index fdfaf4f3bcfa..a4d095e1010e 100644
--- a/kernel/time/timer.c
+++ b/kernel/time/timer.c
@@ -982,8 +982,6 @@ __mod_timer(struct timer_list *timer, unsigned long expires, bool pending_only)
if (!ret && pending_only)
goto out_unlock;
- debug_activate(timer, expires);
-
new_base = get_target_base(base, timer->flags);
if (base != new_base) {
@@ -1007,6 +1005,8 @@ __mod_timer(struct timer_list *timer, unsigned long expires, bool pending_only)
}
}
+ debug_activate(timer, expires);
+
timer->expires = expires;
/*
* If 'idx' was calculated above and the base time did not advance
--
2.15.1

View File

@ -1,7 +1,7 @@
From: Vedang Patel <vedang.patel@intel.com>
Date: Wed, 6 Dec 2017 16:37:44 -0600
Date: Thu, 21 Dec 2017 10:02:25 -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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

View File

@ -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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

View File

@ -1,8 +1,8 @@
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
Date: Wed, 20 Dec 2017 17:12:53 +0100
Subject: [PATCH 04/29] 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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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
@ -17,7 +17,6 @@ schedule_hrtimeout_range_clock().
No functional change.
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
include/linux/hrtimer.h | 2 +-

View File

@ -0,0 +1,45 @@
From: Thomas Gleixner <tglx@linutronix.de>
Date: Fri, 22 Dec 2017 15:51:15 +0100
Subject: [PATCH 4/4] timerqueue: Document return values of
timerqueue_add/del()
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
The return values of timerqueue_add/del() are not documented in the kernel doc
comment. Add proper documentation.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: rt@linutronix.de
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
lib/timerqueue.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/lib/timerqueue.c b/lib/timerqueue.c
index 4a720ed4fdaf..0d54bcbc8170 100644
--- a/lib/timerqueue.c
+++ b/lib/timerqueue.c
@@ -33,8 +33,9 @@
* @head: head of timerqueue
* @node: timer node to be added
*
- * Adds the timer node to the timerqueue, sorted by the
- * node's expires value.
+ * Adds the timer node to the timerqueue, sorted by the node's expires
+ * value. Returns true if the newly added timer is the first expiring timer in
+ * the queue.
*/
bool timerqueue_add(struct timerqueue_head *head, struct timerqueue_node *node)
{
@@ -70,7 +71,8 @@ EXPORT_SYMBOL_GPL(timerqueue_add);
* @head: head of timerqueue
* @node: timer node to be removed
*
- * Removes the timer node from the timerqueue.
+ * Removes the timer node from the timerqueue. Returns true if the queue is
+ * not empty after the remove.
*/
bool timerqueue_del(struct timerqueue_head *head, struct timerqueue_node *node)
{
--
2.15.1

View File

@ -1,7 +1,7 @@
From: Vedang Patel <vedang.patel@intel.com>
Date: Wed, 6 Dec 2017 16:37:45 -0600
Date: Thu, 21 Dec 2017 10:02:26 -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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

View File

@ -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
Lookups inflate the hitcount, making it essentially useless. Only
inserts and updates should really affect the hitcount anyway, so

View File

@ -1,14 +1,13 @@
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.6-rt7.tar.xz
Date: Wed, 20 Dec 2017 17:12:54 +0100
Subject: [PATCH 05/29] hrtimer: Fix hrtimer function description
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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
is not considered, when a hrtimer is initialized.
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
include/linux/hrtimer.h | 6 +++---

View File

@ -1,8 +1,8 @@
From: Tom Zanussi <tom.zanussi@linux.intel.com>
Date: Wed, 6 Dec 2017 16:37:46 -0600
Date: Thu, 21 Dec 2017 10:02:27 -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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
@ -70,7 +70,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
(EVENT_FILE_FL_SOFT_DISABLED | EVENT_FILE_FL_FILTERED)) &&
(entry = this_cpu_read(trace_buffered_event))) {
/* Try to use the per cpu buffer first */
@@ -6297,6 +6297,37 @@ static int tracing_clock_open(struct ino
@@ -6286,6 +6286,37 @@ static int tracing_clock_open(struct ino
return ret;
}

View File

@ -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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.

View File

@ -1,8 +1,8 @@
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
Date: Wed, 20 Dec 2017 17:12:55 +0100
Subject: [PATCH 06/29] hrtimer: Ensure POSIX compliance (relative
CLOCK_REALTIME hrtimers)
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
POSIX specification defines, that relative CLOCK_REALTIME timers are not
affected by clock modifications. Those timers have to use CLOCK_MONOTONIC
@ -18,7 +18,6 @@ comparing with HRTIMER_MODE_ABS.
Fixes: 597d0275736d ("timers: Framework for identifying pinned timers")
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
kernel/time/hrtimer.c | 7 ++++++-

View File

@ -1,8 +1,8 @@
From: Tom Zanussi <tom.zanussi@linux.intel.com>
Date: Wed, 6 Dec 2017 16:37:47 -0600
Date: Thu, 21 Dec 2017 10:02:28 -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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

View File

@ -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
traceprobe_probes_write() and traceprobe_command() actually contain
nothing that ties them to kprobes - the code is generically useful for

View File

@ -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.6-rt7.tar.xz
Date: Wed, 20 Dec 2017 17:12:56 +0100
Subject: [PATCH 07/29] hrtimer: Cleanup hrtimer_mode enum
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
It's not obvious that the HRTIMER_MODE variants are bit combinations
because all modes are hard coded constants.
@ -12,7 +12,6 @@ modes which combine bits.
While at it get rid of the ugly tail comments.
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
include/linux/hrtimer.h | 16 +++++++++++-----

View File

@ -1,7 +1,7 @@
From: Tom Zanussi <tom.zanussi@linux.intel.com>
Date: Wed, 6 Dec 2017 16:37:48 -0600
Date: Thu, 21 Dec 2017 10:02:29 -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
Add a new option flag indicating whether or not the ring buffer is in
'absolute timestamp' mode.
@ -57,7 +57,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Directory for the Hardware Latency Detector.
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -4531,6 +4531,9 @@ static const char readme_msg[] =
@@ -4520,6 +4520,9 @@ static const char readme_msg[] =
#ifdef CONFIG_X86_64
" x86-tsc: TSC cycle counter\n"
#endif
@ -67,7 +67,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
"\n trace_marker\t\t- Writes into this file writes into the kernel buffer\n"
"\n trace_marker_raw\t\t- Writes into this file writes binary data into the kernel buffer\n"
" tracing_cpumask\t- Limit which CPUs to trace\n"
@@ -6298,6 +6301,40 @@ static int tracing_clock_open(struct ino
@@ -6287,6 +6290,40 @@ static int tracing_clock_open(struct ino
return ret;
}
@ -108,7 +108,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
int tracing_set_time_stamp_abs(struct trace_array *tr, bool abs)
{
int ret = 0;
@@ -6576,6 +6613,13 @@ static const struct file_operations trac
@@ -6565,6 +6602,13 @@ static const struct file_operations trac
.write = tracing_clock_write,
};
@ -122,7 +122,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
#ifdef CONFIG_TRACER_SNAPSHOT
static const struct file_operations snapshot_fops = {
.open = tracing_snapshot_open,
@@ -7903,6 +7947,9 @@ init_tracer_tracefs(struct trace_array *
@@ -7892,6 +7936,9 @@ init_tracer_tracefs(struct trace_array *
trace_create_file("tracing_on", 0644, d_tracer,
tr, &rb_simple_fops);

View File

@ -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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

View File

@ -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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

View File

@ -1,8 +1,8 @@
From: Tom Zanussi <tom.zanussi@linux.intel.com>
Date: Wed, 6 Dec 2017 16:37:49 -0600
Date: Thu, 21 Dec 2017 10:02:30 -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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.

View File

@ -1,8 +1,8 @@
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
Date: Wed, 20 Dec 2017 17:12:57 +0100
Subject: [PATCH 08/29] 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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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
@ -13,7 +13,6 @@ HRTIMER_MODE_PINNED is not evaluated in hrtimer_init() call. But for the
sake of completeness print all given modes.
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
include/trace/events/timer.h | 20 ++++++++++++++++----

View File

@ -1,8 +1,8 @@
From: Tom Zanussi <tom.zanussi@linux.intel.com>
Date: Wed, 6 Dec 2017 16:37:50 -0600
Date: Thu, 21 Dec 2017 10:02:31 -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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.

View File

@ -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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

View File

@ -1,8 +1,8 @@
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
Date: Wed, 20 Dec 2017 17:12:58 +0100
Subject: [PATCH 09/29] 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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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
@ -11,7 +11,6 @@ PINNED to non PINNED.
Add the mode information.
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
include/trace/events/timer.h | 13 ++++++++-----

View File

@ -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.6-rt7.tar.xz
Date: Wed, 20 Dec 2017 17:12:59 +0100
Subject: [PATCH 10/29] hrtimer: Switch for loop to _ffs() evaluation
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
Looping over all clock bases to find active bits is suboptimal if not all
bases are active.
@ -12,7 +12,6 @@ Peter Zijlstra.
Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
kernel/time/hrtimer.c | 31 +++++++++++++++++++++----------
@ -27,15 +26,15 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+static struct hrtimer_clock_base *
+__next_base(struct hrtimer_cpu_base *cpu_base, unsigned int *active)
+{
+ struct hrtimer_clock_base *base = NULL;
+ unsigned int idx;
+
+ if (*active) {
+ unsigned int idx = __ffs(*active);
+ *active &= ~(1U << idx);
+ base = &cpu_base->clock_base[idx];
+ }
+ if (!*active)
+ return NULL;
+
+ return base;
+ idx = __ffs(*active);
+ *active &= ~(1U << idx);
+
+ return &cpu_base->clock_base[idx];
+}
+
+#define for_each_active_base(base, cpu_base, active) \

View File

@ -1,7 +1,7 @@
From: Tom Zanussi <tom.zanussi@linux.intel.com>
Date: Wed, 6 Dec 2017 16:37:51 -0600
Date: Thu, 21 Dec 2017 10:02:32 -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
This will make it easier to add variables, and makes the parsing code
cleaner regardless.

View File

@ -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.6-rt7.tar.xz
Date: Wed, 20 Dec 2017 17:13:00 +0100
Subject: [PATCH 11/29] hrtimer: Store running timer in hrtimer_clock_base
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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.
@ -27,7 +27,6 @@ looking at the number of cache lines involved for the frequently used
clocks.
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
include/linux/hrtimer.h | 20 +++++++++-----------

View File

@ -1,7 +1,7 @@
From: Tom Zanussi <tom.zanussi@linux.intel.com>
Date: Wed, 6 Dec 2017 16:37:52 -0600
Date: Thu, 21 Dec 2017 10:02:33 -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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

View File

@ -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.6-rt7.tar.xz
Date: Wed, 20 Dec 2017 17:13:01 +0100
Subject: [PATCH 12/29] hrtimer: Make room in struct hrtimer_cpu_base
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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
@ -14,7 +14,6 @@ Make them unsigned short to create room for the new struct member. No
functional change.
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
include/linux/hrtimer.h | 4 ++--

View File

@ -1,8 +1,8 @@
From: Tom Zanussi <tom.zanussi@linux.intel.com>
Date: Wed, 6 Dec 2017 16:37:53 -0600
Date: Thu, 21 Dec 2017 10:02:34 -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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

View File

@ -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.6-rt7.tar.xz
Date: Wed, 20 Dec 2017 17:13:02 +0100
Subject: [PATCH 13/29] hrtimer: Reduce conditional code (hres_active)
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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
@ -16,7 +16,6 @@ conditionals into common functions, which ensures dead code elimination.
Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
include/linux/hrtimer.h | 20 ++++++++------------

View File

@ -1,7 +1,7 @@
From: Tom Zanussi <tom.zanussi@linux.intel.com>
Date: Wed, 6 Dec 2017 16:37:54 -0600
Date: Thu, 21 Dec 2017 10:02:35 -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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.

View File

@ -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.6-rt7.tar.xz
Date: Wed, 20 Dec 2017 17:13:03 +0100
Subject: [PATCH 14/29] hrtimer: Use accesor functions instead of direct access
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
__hrtimer_hres_active() is now available unconditionally. Replace the
direct access to hrtimer_cpu_base.hres_active.
@ -9,7 +9,6 @@ direct access to hrtimer_cpu_base.hres_active.
No functional change.
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
kernel/time/hrtimer.c | 4 ++--

View File

@ -1,7 +1,7 @@
From: Tom Zanussi <tom.zanussi@linux.intel.com>
Date: Wed, 6 Dec 2017 16:37:55 -0600
Date: Thu, 21 Dec 2017 10:02:36 -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
Appending .usecs onto a common_timestamp field will cause the
timestamp value to be in microseconds instead of the default
@ -50,7 +50,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
/*
* trace_parser_get_init - gets the buffer for trace parser
*/
@@ -4710,8 +4718,9 @@ static const char readme_msg[] =
@@ -4699,8 +4707,9 @@ static const char readme_msg[] =
"\t .sym display an address as a symbol\n"
"\t .sym-offset display an address as a symbol and offset\n"
"\t .execname display a common_pid as a program name\n"

View File

@ -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.6-rt7.tar.xz
Date: Wed, 20 Dec 2017 17:13:04 +0100
Subject: [PATCH 15/29] hrtimer: Make the remote enqueue check unconditional
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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
@ -22,7 +22,6 @@ hrtimer_cpu_base.expires_next yet. This will be changed with later patches
which further reduce the #ifdef zoo in this code.
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
include/linux/hrtimer.h | 6 +++---

View File

@ -1,7 +1,7 @@
From: Tom Zanussi <tom.zanussi@linux.intel.com>
Date: Wed, 6 Dec 2017 16:37:56 -0600
Date: Thu, 21 Dec 2017 10:02:37 -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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.
@ -37,8 +37,8 @@ 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>
---
kernel/trace/trace_events_hist.c | 372 ++++++++++++++++++++++++++++++++++-----
1 file changed, 332 insertions(+), 40 deletions(-)
kernel/trace/trace_events_hist.c | 370 ++++++++++++++++++++++++++++++++++-----
1 file changed, 331 insertions(+), 39 deletions(-)
--- a/kernel/trace/trace_events_hist.c
+++ b/kernel/trace/trace_events_hist.c
@ -606,8 +606,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, rec, rbe);
+ hist_val = hist_field->fn(hist_field, rbe, rec);
hist_val = hist_field->fn(hist_field, rec, rbe);
+ if (hist_field->flags & HIST_FIELD_FL_VAR) {
+ var_idx = hist_field->var.idx;
+ tracing_map_set_var(elt, var_idx, hist_val);
@ -619,7 +618,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+ for_each_hist_key_field(i, hist_data) {
+ hist_field = hist_data->fields[i];
+ if (hist_field->flags & HIST_FIELD_FL_VAR) {
+ hist_val = hist_field->fn(hist_field, rbe, rec);
+ hist_val = hist_field->fn(hist_field, rec, rbe);
+ var_idx = hist_field->var.idx;
+ tracing_map_set_var(elt, var_idx, hist_val);
+ }

View File

@ -1,8 +1,8 @@
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
Date: Wed, 20 Dec 2017 17:13:05 +0100
Subject: [PATCH 16/29] 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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
hrtimer_cpu_base.next_timer stores the pointer to the next expiring timer
in a cpu base.
@ -24,7 +24,6 @@ marginal as it's just a store on an already dirtied cacheline.
No functional change.
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
include/linux/hrtimer.h | 4 ++--

View File

@ -1,8 +1,8 @@
From: Tom Zanussi <tom.zanussi@linux.intel.com>
Date: Wed, 6 Dec 2017 16:37:57 -0600
Date: Thu, 21 Dec 2017 10:02:38 -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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

View File

@ -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.6-rt7.tar.xz
Date: Wed, 20 Dec 2017 17:13:06 +0100
Subject: [PATCH 17/29] hrtimer: Make hrtimer_reprogramm() unconditional
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
hrtimer_reprogram() needs to be available unconditionally for softirq based
hrtimers. Move the function and all required struct members out of the
@ -13,7 +13,6 @@ increases the text size for the CONFIG_HIGH_RES_TIMERS=n case, but avoids
replication of that code for the upcoming softirq based hrtimers support.
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
include/linux/hrtimer.h | 6 +-

View File

@ -1,7 +1,7 @@
From: Tom Zanussi <tom.zanussi@linux.intel.com>
Date: Wed, 6 Dec 2017 16:37:58 -0600
Date: Thu, 21 Dec 2017 10:02:39 -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
Move get_hist_field_flags() to make it more easily accessible for new
code (and keep the move separate from new functionality).

View File

@ -1,8 +1,8 @@
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()
Date: Wed, 20 Dec 2017 17:13:07 +0100
Subject: [PATCH 18/29] hrtimer: Make hrtimer_force_reprogramm()
unconditionally available
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
hrtimer_force_reprogram() needs to be available unconditionally for softirq
based hrtimers. Move the function and all required struct members out of
@ -18,7 +18,6 @@ for the upcoming softirq based hrtimers support. Most of the code gets
eliminated in the CONFIG_HIGH_RES_TIMERS=n case by the compiler.
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
kernel/time/hrtimer.c | 58 ++++++++++++++++++++++++--------------------------

View File

@ -1,7 +1,7 @@
From: Tom Zanussi <tom.zanussi@linux.intel.com>
Date: Wed, 6 Dec 2017 16:37:59 -0600
Date: Thu, 21 Dec 2017 10:02:40 -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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

View File

@ -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.6-rt7.tar.xz
Date: Wed, 20 Dec 2017 17:13:08 +0100
Subject: [PATCH 19/29] hrtimer: Unify handling of hrtimer remove
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
When the first hrtimer on the current CPU is removed,
hrtimer_force_reprogram() is invoked but only when
@ -35,7 +35,6 @@ except the effective reprogramming part, which gets eliminated by the
compiler in the CONFIG_HIGH_RES_TIMERS=n case.
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
kernel/time/hrtimer.c | 10 ++++------

View File

@ -1,7 +1,7 @@
From: Tom Zanussi <tom.zanussi@linux.intel.com>
Date: Wed, 6 Dec 2017 16:38:00 -0600
Date: Thu, 21 Dec 2017 10:02:41 -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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.
@ -52,7 +52,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+static int hist_trigger_elt_data_alloc(struct tracing_map_elt *elt)
{
struct hist_trigger_data *hist_data = elt->map->private_data;
+ unsigned int size = TASK_COMM_LEN + 1;
+ unsigned int size = TASK_COMM_LEN;
+ struct hist_elt_data *elt_data;
struct hist_field *key_field;
unsigned int i;

View File

@ -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.6-rt7.tar.xz
Date: Wed, 20 Dec 2017 17:13:09 +0100
Subject: [PATCH 20/29] hrtimer: Unify handling of remote enqueue
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
hrtimer_reprogram() is conditionally invoked from hrtimer_start_range_ns()
when hrtimer_cpu_base.hres_active is true.
@ -47,7 +47,6 @@ Confine the timers_nohz_active static key to timer.c which is the only user
now.
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
kernel/time/hrtimer.c | 18 ++++++------------

View File

@ -1,8 +1,8 @@
From: Tom Zanussi <tom.zanussi@linux.intel.com>
Date: Wed, 6 Dec 2017 16:38:01 -0600
Date: Thu, 21 Dec 2017 10:02:42 -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
Some accessor functions, such as for variable references, require
access to a corrsponding tracing_map_elt.
@ -186,7 +186,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, rbe, rec);
- hist_val = hist_field->fn(hist_field, rec, rbe);
+ hist_val = hist_field->fn(hist_field, elt, rbe, rec);
if (hist_field->flags & HIST_FIELD_FL_VAR) {
var_idx = hist_field->var.idx;
@ -195,7 +195,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
for_each_hist_key_field(i, hist_data) {
hist_field = hist_data->fields[i];
if (hist_field->flags & HIST_FIELD_FL_VAR) {
- hist_val = hist_field->fn(hist_field, rbe, rec);
- hist_val = hist_field->fn(hist_field, rec, rbe);
+ hist_val = hist_field->fn(hist_field, elt, rbe, rec);
var_idx = hist_field->var.idx;
tracing_map_set_var(elt, var_idx, hist_val);

View File

@ -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.6-rt7.tar.xz
Date: Wed, 20 Dec 2017 17:13:10 +0100
Subject: [PATCH 21/29] hrtimer: Make remote enqueue decision less restrictive
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
The current decision whether a timer can be queued on a remote CPU checks
for timer->expiry <= remote_cpu_base.expires_next.
@ -14,7 +14,6 @@ So its safe to allow enqueuing timers with the same expiry time as the
first expiring timer on a remote CPU base.
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
kernel/time/hrtimer.c | 2 +-

View File

@ -1,7 +1,7 @@
From: Tom Zanussi <tom.zanussi@linux.intel.com>
Date: Wed, 6 Dec 2017 16:38:02 -0600
Date: Thu, 21 Dec 2017 10:02:43 -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
Future support for synthetic events requires hist_field 'type'
information, so add a field for that.

View File

@ -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.6-rt7.tar.xz
Date: Wed, 20 Dec 2017 17:13:11 +0100
Subject: [PATCH 22/29] hrtimer: Remove base argument from hrtimer_reprogram()
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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
@ -19,7 +19,6 @@ Instead of handing in timer and timer->base as an argument remove the base
argument from hrtimer_reprogram() and retrieve the clock base internally.
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
kernel/time/hrtimer.c | 6 +++---

View File

@ -1,8 +1,8 @@
From: Tom Zanussi <tom.zanussi@linux.intel.com>
Date: Wed, 6 Dec 2017 16:38:03 -0600
Date: Thu, 21 Dec 2017 10:02:44 -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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
@ -27,13 +27,13 @@ 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 | 673 +++++++++++++++++++++++++++++++++++-
kernel/trace/trace_events_hist.c | 660 +++++++++++++++++++++++++++++++++++-
kernel/trace/trace_events_trigger.c | 6
4 files changed, 668 insertions(+), 16 deletions(-)
4 files changed, 655 insertions(+), 16 deletions(-)
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -7804,6 +7804,7 @@ static int instance_mkdir(const char *na
@@ -7793,6 +7793,7 @@ static int instance_mkdir(const char *na
INIT_LIST_HEAD(&tr->systems);
INIT_LIST_HEAD(&tr->events);
@ -41,7 +41,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
if (allocate_trace_buffers(tr, trace_buf_size) < 0)
goto out_free_tr;
@@ -8554,6 +8555,7 @@ ssize_t trace_parse_run_command(struct f
@@ -8543,6 +8544,7 @@ ssize_t trace_parse_run_command(struct f
INIT_LIST_HEAD(&global_trace.systems);
INIT_LIST_HEAD(&global_trace.events);
@ -315,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 +529,150 @@ static struct hist_field *find_var(struc
@@ -313,10 +529,137 @@ static struct hist_field *find_var(struc
return NULL;
}
@ -326,36 +326,23 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+{
+ struct hist_trigger_data *var_hist_data;
+ struct hist_var_data *var_data;
+ struct trace_event_call *call;
+ struct trace_event_file *file, *found = NULL;
+ const char *name;
+
+ if (system)
+ return find_event_file(tr, system, event_name);
+
+ 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);
+
+ if (!system || !event_name) {
+ if (find_var(var_hist_data, file, var_name)) {
+ if (found) {
+ return NULL;
+ }
+ if (find_var_field(var_hist_data, var_name)) {
+ if (found)
+ return NULL;
+
+ found = file;
+ }
+ continue;
+ found = file;
+ }
+
+ if (strcmp(event_name, name) != 0)
+ continue;
+ if (strcmp(system, call->class->system) != 0)
+ continue;
+
+ found = file;
+ break;
+ }
+
+ return found;
@ -466,7 +453,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
static const char *hist_field_name(struct hist_field *field,
unsigned int level)
{
@@ -331,8 +687,20 @@ static const char *hist_field_name(struc
@@ -331,8 +674,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";
@ -489,7 +476,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
if (field_name == NULL)
field_name = "";
@@ -638,6 +1006,8 @@ static char *expr_str(struct hist_field
@@ -638,6 +993,8 @@ static char *expr_str(struct hist_field
return expr;
}
@ -498,7 +485,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]);
@@ -660,6 +1030,8 @@ static char *expr_str(struct hist_field
@@ -660,6 +1017,8 @@ static char *expr_str(struct hist_field
return NULL;
}
@ -507,7 +494,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]);
@@ -739,6 +1111,11 @@ static struct hist_field *create_hist_fi
@@ -739,6 +1098,11 @@ static struct hist_field *create_hist_fi
if (flags & HIST_FIELD_FL_EXPR)
goto out; /* caller will populate */
@ -519,7 +506,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);
@@ -832,6 +1209,142 @@ static void destroy_hist_fields(struct h
@@ -832,6 +1196,142 @@ static void destroy_hist_fields(struct h
}
}
@ -662,7 +649,7 @@ 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)
@@ -888,10 +1401,40 @@ struct hist_field *parse_atom(struct his
@@ -888,10 +1388,40 @@ struct hist_field *parse_atom(struct his
struct trace_event_file *file, char *str,
unsigned long *flags, char *var_name)
{
@ -703,7 +690,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
field = parse_field(hist_data, file, str, flags);
if (IS_ERR(field)) {
ret = PTR_ERR(field);
@@ -1063,6 +1606,9 @@ static struct hist_field *parse_expr(str
@@ -1063,6 +1593,9 @@ static struct hist_field *parse_expr(str
goto free;
}
@ -713,7 +700,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
expr->operands[0] = operand1;
expr->operands[1] = operand2;
expr->operator = field_op;
@@ -1235,6 +1781,12 @@ static int create_key_field(struct hist_
@@ -1235,6 +1768,12 @@ static int create_key_field(struct hist_
goto out;
}
@ -726,7 +713,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
key_size = hist_field->size;
}
@@ -1573,6 +2125,7 @@ create_hist_data(unsigned int map_bits,
@@ -1573,6 +2112,7 @@ create_hist_data(unsigned int map_bits,
hist_data->attrs = attrs;
hist_data->remove = remove;
@ -734,7 +721,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
ret = create_hist_fields(hist_data, file);
if (ret)
@@ -1595,12 +2148,6 @@ create_hist_data(unsigned int map_bits,
@@ -1595,12 +2135,6 @@ create_hist_data(unsigned int map_bits,
ret = create_tracing_map_fields(hist_data);
if (ret)
goto free;
@ -747,7 +734,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
out:
return hist_data;
free:
@@ -1615,12 +2162,17 @@ create_hist_data(unsigned int map_bits,
@@ -1615,12 +2149,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,
@ -766,7 +753,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);
@@ -1672,6 +2224,7 @@ static void event_hist_trigger(struct ev
@@ -1672,6 +2211,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];
@ -774,7 +761,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;
@@ -1711,9 +2264,15 @@ static void event_hist_trigger(struct ev
@@ -1711,9 +2251,15 @@ static void event_hist_trigger(struct ev
if (use_compound_key)
key = compound_key;
@ -792,7 +779,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
}
static void hist_trigger_stacktrace_print(struct seq_file *m,
@@ -1930,8 +2489,11 @@ static void hist_field_print(struct seq_
@@ -1930,8 +2476,11 @@ static void hist_field_print(struct seq_
if (hist_field->flags & HIST_FIELD_FL_TIMESTAMP)
seq_puts(m, "common_timestamp");
@ -805,7 +792,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
if (hist_field->flags) {
const char *flags_str = get_hist_field_flags(hist_field);
@@ -2071,7 +2633,11 @@ static void event_hist_trigger_free(stru
@@ -2071,7 +2620,11 @@ static void event_hist_trigger_free(stru
if (!data->ref) {
if (data->name)
del_named_trigger(data);
@ -817,7 +804,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
destroy_hist_data(hist_data);
}
}
@@ -2284,23 +2850,55 @@ static int hist_register_trigger(char *g
@@ -2284,23 +2837,55 @@ static int hist_register_trigger(char *g
goto out;
}
@ -877,7 +864,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)
@@ -2333,11 +2931,30 @@ static void hist_unregister_trigger(char
@@ -2333,11 +2918,30 @@ static void hist_unregister_trigger(char
}
}
@ -908,7 +895,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;
@@ -2413,6 +3030,11 @@ static int event_hist_trigger_func(struc
@@ -2413,6 +3017,11 @@ static int event_hist_trigger_func(struc
}
if (remove) {
@ -920,7 +907,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;
@@ -2430,14 +3052,33 @@ static int event_hist_trigger_func(struc
@@ -2430,14 +3039,33 @@ static int event_hist_trigger_func(struc
goto out_free;
} else if (ret < 0)
goto out_free;

View File

@ -1,13 +1,12 @@
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.6-rt7.tar.xz
Date: Wed, 20 Dec 2017 17:13:12 +0100
Subject: [PATCH 23/29] hrtimer: Split hrtimer_start_range_ns()
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
Preparatory patch for softirq based hrtimers to avoid code duplication. No
functional change.
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
kernel/time/hrtimer.c | 44 ++++++++++++++++++++++++--------------------

View File

@ -1,7 +1,7 @@
From: Tom Zanussi <tom.zanussi@linux.intel.com>
Date: Wed, 6 Dec 2017 16:38:04 -0600
Date: Thu, 21 Dec 2017 10:02:45 -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
Add a hook for executing extra actions whenever a histogram entry is
added or updated.
@ -62,7 +62,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
};
static u64 hist_field_timestamp(struct hist_field *hist_field,
@@ -777,6 +796,9 @@ static void destroy_hist_trigger_attrs(s
@@ -764,6 +783,9 @@ static void destroy_hist_trigger_attrs(s
for (i = 0; i < attrs->n_assignments; i++)
kfree(attrs->assignment_str[i]);
@ -72,7 +72,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
kfree(attrs->name);
kfree(attrs->sort_key_str);
kfree(attrs->keys_str);
@@ -784,6 +806,16 @@ static void destroy_hist_trigger_attrs(s
@@ -771,6 +793,16 @@ static void destroy_hist_trigger_attrs(s
kfree(attrs);
}
@ -89,7 +89,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
static int parse_assignment(char *str, struct hist_trigger_attrs *attrs)
{
int ret = 0;
@@ -867,8 +899,9 @@ static struct hist_trigger_attrs *parse_
@@ -854,8 +886,9 @@ static struct hist_trigger_attrs *parse_
else if (strcmp(str, "clear") == 0)
attrs->clear = true;
else {
@ -101,7 +101,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
}
}
@@ -2056,11 +2089,55 @@ static int create_sort_keys(struct hist_
@@ -2043,11 +2076,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);
}
@@ -2127,6 +2204,10 @@ create_hist_data(unsigned int map_bits,
@@ -2114,6 +2191,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;
@@ -2218,6 +2299,20 @@ static inline void add_to_key(char *comp
@@ -2205,6 +2286,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)
{
@@ -2273,6 +2368,9 @@ static void event_hist_trigger(struct ev
@@ -2260,6 +2355,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,
@@ -3059,6 +3157,10 @@ static int event_hist_trigger_func(struc
@@ -3046,6 +3144,10 @@ static int event_hist_trigger_func(struc
if (has_hist_vars(hist_data))
save_hist_vars(hist_data);

View File

@ -1,13 +1,12 @@
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.6-rt7.tar.xz
Date: Wed, 20 Dec 2017 17:13:13 +0100
Subject: [PATCH 24/29] hrtimer: Split __hrtimer_get_next_event()
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
Preparatory patch for softirq based hrtimers to avoid code duplication. No
functional change.
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
kernel/time/hrtimer.c | 20 ++++++++++++++++----

View File

@ -1,7 +1,7 @@
From: Tom Zanussi <tom.zanussi@linux.intel.com>
Date: Wed, 6 Dec 2017 16:38:05 -0600
Date: Thu, 21 Dec 2017 10:02:46 -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
Synthetic events are user-defined events generated from hist trigger
variables saved from one or more other events.
@ -305,7 +305,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+ /* parameter values */
+ if (se->fields[i]->is_string) {
+ trace_seq_printf(s, print_fmt, se->fields[i]->name,
+ (char *)(long)entry->fields[n_u64],
+ (char *)&entry->fields[n_u64],
+ i == se->n_fields - 1 ? "" : " ");
+ n_u64 += STR_VAR_LEN_MAX / sizeof(u64);
+ } else {
@ -894,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,
@@ -2974,6 +3788,28 @@ static int hist_trigger_enable(struct ev
@@ -2961,6 +3775,28 @@ static int hist_trigger_enable(struct ev
return ret;
}
@ -923,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)
{
@@ -3049,6 +3885,8 @@ static void hist_unreg_all(struct trace_
@@ -3036,6 +3872,8 @@ static void hist_unreg_all(struct trace_
{
struct event_trigger_data *test, *n;
struct hist_trigger_data *hist_data;
@ -932,7 +932,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
if (hist_file_check_refs(file))
return;
@@ -3058,6 +3896,14 @@ static void hist_unreg_all(struct trace_
@@ -3045,6 +3883,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);
@ -947,7 +947,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
update_cond_flag(file);
if (hist_data->enable_timestamps)
tracing_set_time_stamp_abs(file->tr, false);
@@ -3076,6 +3922,8 @@ static int event_hist_trigger_func(struc
@@ -3063,6 +3909,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;
@ -956,7 +956,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
bool remove = false;
char *trigger;
int ret = 0;
@@ -3106,10 +3954,11 @@ static int event_hist_trigger_func(struc
@@ -3093,10 +3941,11 @@ static int event_hist_trigger_func(struc
trigger_ops = cmd_ops->get_trigger_ops(cmd, trigger);
@ -970,7 +970,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
trigger_data->count = -1;
trigger_data->ops = trigger_ops;
@@ -3128,12 +3977,23 @@ static int event_hist_trigger_func(struc
@@ -3115,12 +3964,23 @@ static int event_hist_trigger_func(struc
}
if (remove) {
@ -994,7 +994,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
ret = 0;
goto out_free;
}
@@ -3169,6 +4029,13 @@ static int event_hist_trigger_func(struc
@@ -3156,6 +4016,13 @@ static int event_hist_trigger_func(struc
if (ret)
goto out_unreg;
@ -1008,7 +1008,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
/* Just return zero, not the number of registered triggers */
ret = 0;
out:
@@ -3341,3 +4208,31 @@ static __init void unregister_trigger_hi
@@ -3328,3 +4195,31 @@ static __init void unregister_trigger_hi
return ret;
}

View File

@ -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.6-rt7.tar.xz
Date: Wed, 20 Dec 2017 17:13:14 +0100
Subject: [PATCH 25/29] hrtimer: Use irqsave/irqrestore around __run_hrtimer()
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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
@ -18,7 +18,6 @@ interrupt enabled state when called from softirq context.
Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
kernel/time/hrtimer.c | 31 ++++++++++++++++++-------------

View File

@ -1,7 +1,7 @@
From: Tom Zanussi <tom.zanussi@linux.intel.com>
Date: Wed, 6 Dec 2017 16:38:06 -0600
Date: Thu, 21 Dec 2017 10:02:47 -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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
@ -76,7 +76,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
};
struct synth_field {
@@ -1444,6 +1460,7 @@ static struct hist_field *find_event_var
@@ -1431,6 +1447,7 @@ static struct hist_field *find_event_var
struct hist_elt_data {
char *comm;
u64 *var_ref_vals;
@ -84,7 +84,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
};
static u64 hist_field_var_ref(struct hist_field *hist_field,
@@ -1748,6 +1765,11 @@ static inline void save_comm(char *comm,
@@ -1735,6 +1752,11 @@ static inline void save_comm(char *comm,
static void hist_elt_data_free(struct hist_elt_data *elt_data)
{
@ -96,8 +96,8 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
kfree(elt_data->comm);
kfree(elt_data);
}
@@ -1765,7 +1787,7 @@ static int hist_trigger_elt_data_alloc(s
unsigned int size = TASK_COMM_LEN + 1;
@@ -1752,7 +1774,7 @@ static int hist_trigger_elt_data_alloc(s
unsigned int size = TASK_COMM_LEN;
struct hist_elt_data *elt_data;
struct hist_field *key_field;
- unsigned int i;
@ -105,7 +105,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
elt_data = kzalloc(sizeof(*elt_data), GFP_KERNEL);
if (!elt_data)
@@ -1784,6 +1806,18 @@ static int hist_trigger_elt_data_alloc(s
@@ -1771,6 +1793,18 @@ static int hist_trigger_elt_data_alloc(s
}
}
@ -124,7 +124,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
elt->private_data = elt_data;
return 0;
@@ -2486,6 +2520,470 @@ static struct hist_field *parse_expr(str
@@ -2473,6 +2507,470 @@ static struct hist_field *parse_expr(str
return ERR_PTR(ret);
}
@ -595,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] =
@@ -2941,6 +3439,16 @@ static int create_actions(struct hist_tr
@@ -2928,6 +3426,16 @@ static int create_actions(struct hist_tr
return ret;
}
@ -612,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)
@@ -2951,6 +3459,8 @@ static void destroy_hist_data(struct his
@@ -2938,6 +3446,8 @@ static void destroy_hist_data(struct his
tracing_map_destroy(hist_data->map);
destroy_actions(hist_data);
@ -621,7 +621,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
kfree(hist_data);
}
@@ -3087,6 +3597,8 @@ static void hist_trigger_elt_update(stru
@@ -3074,6 +3584,8 @@ static void hist_trigger_elt_update(stru
tracing_map_set_var(elt, var_idx, hist_val);
}
}
@ -630,7 +630,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
}
static inline void add_to_key(char *compound_key, void *key,
@@ -3533,6 +4045,21 @@ static int event_hist_trigger_init(struc
@@ -3520,6 +4032,21 @@ static int event_hist_trigger_init(struc
return 0;
}
@ -652,7 +652,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
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
@@ -3537,6 +4064,8 @@ static void event_hist_trigger_free(stru
remove_hist_vars(hist_data);

View File

@ -1,8 +1,8 @@
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
Date: Wed, 20 Dec 2017 17:13:15 +0100
Subject: [PATCH 26/29] 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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
hrtimer callback functions are always executed in hard interrupt
context. Users of hrtimer which need their timer function to be executed
@ -18,7 +18,6 @@ HRTIMER_MODE_SOFT and the matching combinations with the ABS/REL/PINNED
bits and update the decoding of hrtimer_mode in tracepoints.
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
include/linux/hrtimer.h | 14 ++++++++++++++

View File

@ -1,7 +1,7 @@
From: Tom Zanussi <tom.zanussi@linux.intel.com>
Date: Wed, 6 Dec 2017 16:38:07 -0600
Date: Thu, 21 Dec 2017 10:02:48 -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
Add an 'onmatch(matching.event).<synthetic_event_name>(param list)'
hist trigger action which is invoked with the set of variables or
@ -126,7 +126,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
return found;
}
@@ -1439,6 +1470,37 @@ static struct hist_field *find_file_var(
@@ -1426,6 +1457,37 @@ static struct hist_field *find_file_var(
return NULL;
}
@ -164,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,
@@ -1448,6 +1510,14 @@ static struct hist_field *find_event_var
@@ -1435,6 +1497,14 @@ static struct hist_field *find_event_var
struct hist_field *hist_field = NULL;
struct trace_event_file *file;
@ -179,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;
@@ -1639,11 +1709,21 @@ static void destroy_hist_trigger_attrs(s
@@ -1626,11 +1696,21 @@ static void destroy_hist_trigger_attrs(s
static int parse_action(char *str, struct hist_trigger_attrs *attrs)
{
@ -202,7 +202,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
return ret;
}
@@ -2648,7 +2728,7 @@ find_synthetic_field_var(struct hist_tri
@@ -2635,7 +2715,7 @@ find_synthetic_field_var(struct hist_tri
*
* Return: The variable created for the field.
*/
@ -211,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)
{
@@ -2761,7 +2841,7 @@ create_field_var_hist(struct hist_trigge
@@ -2748,7 +2828,7 @@ create_field_var_hist(struct hist_trigge
return event_var;
}
@ -220,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)
{
@@ -2932,7 +3012,7 @@ static struct field_var *create_field_va
@@ -2919,7 +2999,7 @@ static struct field_var *create_field_va
*
* Return: The variable created for the field.
*/
@ -229,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)
{
@@ -2956,6 +3036,27 @@ create_target_field_var(struct hist_trig
@@ -2943,6 +3023,27 @@ create_target_field_var(struct hist_trig
return create_field_var(target_hist_data, file, var_name);
}
@ -257,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)
@@ -2975,8 +3076,8 @@ static void destroy_field_vars(struct hi
@@ -2962,8 +3063,8 @@ static void destroy_field_vars(struct hi
destroy_field_var(hist_data->field_vars[i]);
}
@ -268,7 +268,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
{
hist_data->field_vars[hist_data->n_field_vars++] = field_var;
@@ -2984,6 +3085,304 @@ void save_field_var(struct hist_trigger_
@@ -2971,6 +3072,304 @@ void save_field_var(struct hist_trigger_
hist_data->n_field_var_str++;
}
@ -573,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] =
@@ -3408,18 +3807,39 @@ static void destroy_actions(struct hist_
@@ -3395,18 +3794,39 @@ static void destroy_actions(struct hist_
for (i = 0; i < hist_data->n_actions; i++) {
struct action_data *data = hist_data->actions[i];
@ -614,7 +614,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
}
return ret;
@@ -3434,11 +3854,50 @@ static int create_actions(struct hist_tr
@@ -3421,11 +3841,50 @@ static int create_actions(struct hist_tr
for (i = 0; i < hist_data->attrs->n_actions; i++) {
data = hist_data->actions[i];
@ -665,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;
@@ -3461,6 +3920,7 @@ static void destroy_hist_data(struct his
@@ -3448,6 +3907,7 @@ static void destroy_hist_data(struct his
destroy_actions(hist_data);
destroy_field_vars(hist_data);
destroy_field_var_hists(hist_data);
@ -673,7 +673,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
kfree(hist_data);
}
@@ -4019,6 +4479,8 @@ static int event_hist_trigger_print(stru
@@ -4006,6 +4466,8 @@ static int event_hist_trigger_print(stru
}
seq_printf(m, ":size=%u", (1 << hist_data->map->map_bits));

View File

@ -1,8 +1,8 @@
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
Date: Wed, 20 Dec 2017 17:13:16 +0100
Subject: [PATCH 27/29] 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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
The softirq based hrtimer can utilize most of the existing hrtimers
functions, but need to operate on a different data set.
@ -12,7 +12,6 @@ can be selected. Fixup the existing callers and hand in the ACTIVE_HARD
mask.
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
kernel/time/hrtimer.c | 38 +++++++++++++++++++++++++++++---------

View File

@ -1,7 +1,7 @@
From: Tom Zanussi <tom.zanussi@linux.intel.com>
Date: Wed, 6 Dec 2017 16:38:08 -0600
Date: Thu, 21 Dec 2017 10:02:49 -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
Add an 'onmax(var).save(field,...)' hist trigger action which is
invoked whenever an event exceeds the current maximum.
@ -86,7 +86,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
};
};
@@ -1714,7 +1726,8 @@ static int parse_action(char *str, struc
@@ -1701,7 +1713,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;
@@ -1886,7 +1899,7 @@ static int hist_trigger_elt_data_alloc(s
@@ -1873,7 +1886,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;
@@ -2907,6 +2920,15 @@ static void update_field_vars(struct his
@@ -2894,6 +2907,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)
@@ -3036,6 +3058,227 @@ create_target_field_var(struct hist_trig
@@ -3023,6 +3045,227 @@ create_target_field_var(struct hist_trig
return create_field_var(target_hist_data, file, var_name);
}
@ -349,7 +349,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
static void onmatch_destroy(struct action_data *data)
{
unsigned int i;
@@ -3120,39 +3363,6 @@ static int check_synth_field(struct synt
@@ -3107,39 +3350,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)
@@ -3809,6 +4019,8 @@ static void destroy_actions(struct hist_
@@ -3796,6 +4006,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);
}
@@ -3834,6 +4046,15 @@ static int parse_actions(struct hist_tri
@@ -3821,6 +4033,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;
@@ -3859,12 +4080,48 @@ static int create_actions(struct hist_tr
@@ -3846,12 +4067,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)
@@ -3895,6 +4152,8 @@ static void print_actions_spec(struct se
@@ -3882,6 +4139,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>
}
}
@@ -4276,6 +4535,8 @@ hist_trigger_entry_print(struct seq_file
@@ -4263,6 +4522,8 @@ hist_trigger_entry_print(struct seq_file
}
}

View 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.6-rt7.tar.xz
Date: Wed, 20 Dec 2017 17:13:17 +0100
Subject: [PATCH 28/29] hrtimer: Implement support for softirq based hrtimers
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
hrtimer callbacks are always invoked in hard interrupt context. Several
users in tree require soft interrupt context for their callbacks and
@ -32,12 +32,11 @@ processing the regular processing is resumed.
Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
include/linux/hrtimer.h | 21 +++--
kernel/time/hrtimer.c | 201 ++++++++++++++++++++++++++++++++++++++++--------
2 files changed, 186 insertions(+), 36 deletions(-)
kernel/time/hrtimer.c | 198 +++++++++++++++++++++++++++++++++++++++++-------
2 files changed, 188 insertions(+), 31 deletions(-)
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@ -112,36 +111,17 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
const enum hrtimer_mode mode)
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -68,6 +68,9 @@
#define HRTIMER_ACTIVE_SOFT (HRTIMER_ACTIVE_HARD << MASK_SHIFT)
#define HRTIMER_ACTIVE_ALL (HRTIMER_ACTIVE_SOFT | HRTIMER_ACTIVE_HARD)
+/* Define for debug mode check */
+#define HRTIMER_MODECHECK true
+
/*
* The timer bases:
*
@@ -411,8 +414,17 @@ static inline void debug_hrtimer_init(st
@@ -411,7 +411,8 @@ static inline void debug_hrtimer_init(st
debug_object_init(timer, &hrtimer_debug_descr);
}
-static inline void debug_hrtimer_activate(struct hrtimer *timer)
+static inline void debug_hrtimer_activate(struct hrtimer *timer,
+ enum hrtimer_mode mode,
+ bool modecheck)
+ enum hrtimer_mode mode)
{
+ /*
+ * Check whether the HRTIMER_MODE_SOFT bit and hrtimer.is_soft
+ * match, when a timer is started via__hrtimer_start_range_ns().
+ */
+ if (modecheck)
+ WARN_ON_ONCE(!(mode & HRTIMER_MODE_SOFT) ^ !timer->is_soft);
+
debug_object_activate(timer, &hrtimer_debug_descr);
}
@@ -444,8 +456,11 @@ void destroy_hrtimer_on_stack(struct hrt
@@ -444,8 +445,10 @@ void destroy_hrtimer_on_stack(struct hrt
EXPORT_SYMBOL_GPL(destroy_hrtimer_on_stack);
#else
@ -149,25 +129,20 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
static inline void debug_hrtimer_init(struct hrtimer *timer) { }
-static inline void debug_hrtimer_activate(struct hrtimer *timer) { }
+static inline void debug_hrtimer_activate(struct hrtimer *timer,
+ enum hrtimer_mode mode,
+ bool modecheck) { }
+ enum hrtimer_mode mode) { }
static inline void debug_hrtimer_deactivate(struct hrtimer *timer) { }
#endif
@@ -458,9 +473,10 @@ debug_init(struct hrtimer *timer, clocki
}
@@ -460,7 +463,7 @@ debug_init(struct hrtimer *timer, clocki
static inline void debug_activate(struct hrtimer *timer,
- enum hrtimer_mode mode)
+ enum hrtimer_mode mode,
+ bool modecheck)
enum hrtimer_mode mode)
{
- debug_hrtimer_activate(timer);
+ debug_hrtimer_activate(timer, mode, modecheck);
+ debug_hrtimer_activate(timer, mode);
trace_hrtimer_start(timer, mode);
}
@@ -487,7 +503,6 @@ static struct hrtimer_clock_base *
@@ -487,7 +490,6 @@ static struct hrtimer_clock_base *
#define for_each_active_base(base, cpu_base, active) \
while ((base = __next_base((cpu_base), &(active))))
@ -175,7 +150,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
static ktime_t __hrtimer_next_event_base(struct hrtimer_cpu_base *cpu_base,
unsigned int active,
ktime_t expires_next)
@@ -504,7 +519,10 @@ static ktime_t __hrtimer_next_event_base
@@ -504,7 +506,10 @@ static ktime_t __hrtimer_next_event_base
expires = ktime_sub(hrtimer_get_expires(timer), base->offset);
if (expires < expires_next) {
expires_next = expires;
@ -187,7 +162,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
}
}
/*
@@ -521,25 +539,42 @@ static ktime_t __hrtimer_next_event_base
@@ -521,25 +526,42 @@ static ktime_t __hrtimer_next_event_base
* Recomputes cpu_base::*next_timer and returns the earliest expires_next but
* does not set cpu_base::*expires_next, that is done by hrtimer_reprogram.
*
@ -196,11 +171,12 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+ * hrtimer_run_softirq(), hrtimer_update_softirq_timer() will re-add these bases.
+ *
+ * Therefore softirq values are those from the HRTIMER_ACTIVE_SOFT clock bases.
+ * The !softirq values are the minima across HRTIMER_ACTIVE, unless an actual
+ * The !softirq values are the minima across HRTIMER_ACTIVE_ALL, unless an actual
+ * softirq is pending, in which case they're the minima of HRTIMER_ACTIVE_HARD.
+ *
* @active_mask must be one of:
* - HRTIMER_ACTIVE,
- * - HRTIMER_ACTIVE,
+ * - HRTIMER_ACTIVE_ALL,
* - HRTIMER_ACTIVE_SOFT, or
* - HRTIMER_ACTIVE_HARD.
*/
@ -236,7 +212,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
static inline ktime_t hrtimer_update_base(struct hrtimer_cpu_base *base)
{
@@ -547,8 +582,14 @@ static inline ktime_t hrtimer_update_bas
@@ -547,8 +569,14 @@ static inline ktime_t hrtimer_update_bas
ktime_t *offs_boot = &base->clock_base[HRTIMER_BASE_BOOTTIME].offset;
ktime_t *offs_tai = &base->clock_base[HRTIMER_BASE_TAI].offset;
@ -252,7 +228,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
}
/*
@@ -575,7 +616,23 @@ hrtimer_force_reprogram(struct hrtimer_c
@@ -575,7 +603,23 @@ hrtimer_force_reprogram(struct hrtimer_c
{
ktime_t expires_next;
@ -277,7 +253,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
if (skip_equal && expires_next == cpu_base->expires_next)
return;
@@ -702,7 +759,7 @@ static inline void retrigger_next_event(
@@ -702,7 +746,7 @@ static inline void retrigger_next_event(
*
* Called with interrupts disabled and base->cpu_base.lock held
*/
@ -286,7 +262,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
{
struct hrtimer_cpu_base *cpu_base = this_cpu_ptr(&hrtimer_bases);
struct hrtimer_clock_base *base = timer->base;
@@ -711,6 +768,28 @@ static void hrtimer_reprogram(struct hrt
@@ -711,6 +755,37 @@ static void hrtimer_reprogram(struct hrt
WARN_ON_ONCE(hrtimer_get_expires_tv64(timer) < 0);
/*
@ -297,16 +273,25 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+ expires = 0;
+
+ if (timer->is_soft) {
+ if (cpu_base->softirq_activated)
+ /*
+ * soft hrtimer could be started on a remote CPU. In this
+ * case softirq_expires_next needs to be updated on the
+ * remote CPU. The soft hrtimer will not expire before the
+ * first hard hrtimer on the remote CPU -
+ * hrtimer_check_target() prevents this case.
+ */
+ struct hrtimer_cpu_base *timer_cpu_base = base->cpu_base;
+
+ if (timer_cpu_base->softirq_activated)
+ return;
+
+ if (!ktime_before(expires, cpu_base->softirq_expires_next))
+ if (!ktime_before(expires, timer_cpu_base->softirq_expires_next))
+ return;
+
+ cpu_base->softirq_next_timer = timer;
+ cpu_base->softirq_expires_next = expires;
+ timer_cpu_base->softirq_next_timer = timer;
+ timer_cpu_base->softirq_expires_next = expires;
+
+ if (!ktime_before(expires, cpu_base->expires_next) ||
+ if (!ktime_before(expires, timer_cpu_base->expires_next) ||
+ !reprogram)
+ return;
+ }
@ -315,7 +300,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
* If the timer is not on the current cpu, we cannot reprogram
* the other cpus clock event device.
*/
@@ -727,13 +806,6 @@ static void hrtimer_reprogram(struct hrt
@@ -727,13 +802,6 @@ static void hrtimer_reprogram(struct hrt
if (cpu_base->in_hrtirq)
return;
@ -329,20 +314,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
if (expires >= cpu_base->expires_next)
return;
@@ -868,9 +940,10 @@ EXPORT_SYMBOL_GPL(hrtimer_forward);
*/
static int enqueue_hrtimer(struct hrtimer *timer,
struct hrtimer_clock_base *base,
- enum hrtimer_mode mode)
+ enum hrtimer_mode mode,
+ bool modecheck)
{
- debug_activate(timer, mode);
+ debug_activate(timer, mode, modecheck);
base->cpu_base->active_bases |= 1 << base->index;
@@ -961,6 +1034,31 @@ static inline ktime_t hrtimer_update_low
@@ -961,6 +1029,31 @@ static inline ktime_t hrtimer_update_low
return tim;
}
@ -361,7 +333,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+ * hrtimer expires at the same time than the next hard
+ * hrtimer. cpu_base->softirq_expires_next needs to be updated!
+ */
+ if (!reprogram || expires == KTIME_MAX)
+ if (expires == KTIME_MAX)
+ return;
+
+ /*
@ -374,16 +346,14 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
static int __hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
u64 delta_ns, const enum hrtimer_mode mode,
struct hrtimer_clock_base *base)
@@ -980,7 +1078,7 @@ static int __hrtimer_start_range_ns(stru
/* Switch the timer base, if necessary: */
new_base = switch_hrtimer_base(timer, base, mode & HRTIMER_MODE_PINNED);
@@ -982,13 +1075,15 @@ static int __hrtimer_start_range_ns(stru
- return enqueue_hrtimer(timer, new_base, mode);
+ return enqueue_hrtimer(timer, new_base, mode, HRTIMER_MODECHECK);
return enqueue_hrtimer(timer, new_base, mode);
}
+
/**
* hrtimer_start_range_ns - (re)start an hrtimer
@@ -988,7 +1086,8 @@ static int __hrtimer_start_range_ns(stru
* @timer: the timer to be added
* @tim: expiry time
* @delta_ns: "slack" range for the timer
* @mode: timer mode: absolute (HRTIMER_MODE_ABS) or
@ -393,7 +363,16 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
*/
void hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim,
u64 delta_ns, const enum hrtimer_mode mode)
@@ -999,7 +1098,7 @@ void hrtimer_start_range_ns(struct hrtim
@@ -996,10 +1091,16 @@ void hrtimer_start_range_ns(struct hrtim
struct hrtimer_clock_base *base;
unsigned long flags;
+ /*
+ * Check whether the HRTIMER_MODE_SOFT bit and hrtimer.is_soft
+ * match.
+ */
+ WARN_ON_ONCE(!(mode & HRTIMER_MODE_SOFT) ^ !timer->is_soft);
+
base = lock_hrtimer_base(timer, &flags);
if (__hrtimer_start_range_ns(timer, tim, delta_ns, mode, base))
@ -402,7 +381,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
unlock_hrtimer_base(timer, &flags);
}
@@ -1098,7 +1197,7 @@ u64 hrtimer_get_next_event(void)
@@ -1098,7 +1199,7 @@ u64 hrtimer_get_next_event(void)
raw_spin_lock_irqsave(&cpu_base->lock, flags);
if (!__hrtimer_hres_active(cpu_base))
@ -411,17 +390,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
raw_spin_unlock_irqrestore(&cpu_base->lock, flags);
@@ -1256,7 +1355,8 @@ static void __run_hrtimer(struct hrtimer
*/
if (restart != HRTIMER_NORESTART &&
!(timer->state & HRTIMER_STATE_ENQUEUED))
- enqueue_hrtimer(timer, base, HRTIMER_MODE_ABS);
+ enqueue_hrtimer(timer, base, HRTIMER_MODE_ABS,
+ !HRTIMER_MODECHECK);
/*
* Separate the ->running assignment from the ->state assignment.
@@ -1308,6 +1408,23 @@ static void __hrtimer_run_queues(struct
@@ -1308,6 +1409,23 @@ static void __hrtimer_run_queues(struct
}
}
@ -445,7 +414,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
#ifdef CONFIG_HIGH_RES_TIMERS
/*
@@ -1338,10 +1455,16 @@ void hrtimer_interrupt(struct clock_even
@@ -1338,10 +1456,16 @@ void hrtimer_interrupt(struct clock_even
*/
cpu_base->expires_next = KTIME_MAX;
@ -463,7 +432,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
/*
* Store the new expiry value so the migration code can verify
* against it.
@@ -1445,6 +1568,13 @@ void hrtimer_run_queues(void)
@@ -1445,6 +1569,13 @@ void hrtimer_run_queues(void)
raw_spin_lock_irqsave(&cpu_base->lock, flags);
now = hrtimer_update_base(cpu_base);
@ -477,7 +446,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
__hrtimer_run_queues(cpu_base, now, flags, HRTIMER_ACTIVE_HARD);
raw_spin_unlock_irqrestore(&cpu_base->lock, flags);
}
@@ -1626,6 +1756,7 @@ int hrtimers_prepare_cpu(unsigned int cp
@@ -1626,6 +1757,7 @@ int hrtimers_prepare_cpu(unsigned int cp
cpu_base->cpu = cpu;
cpu_base->hres_active = 0;
cpu_base->expires_next = KTIME_MAX;
@ -485,17 +454,20 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
return 0;
}
@@ -1657,7 +1788,8 @@ static void migrate_hrtimer_list(struct
* sort out already expired timers and reprogram the
* event device.
*/
- enqueue_hrtimer(timer, new_base, HRTIMER_MODE_ABS);
+ enqueue_hrtimer(timer, new_base, HRTIMER_MODE_ABS,
+ !HRTIMER_MODECHECK);
}
}
@@ -1669,6 +1801,12 @@ int hrtimers_dead_cpu(unsigned int scpu)
BUG_ON(cpu_online(scpu));
tick_cancel_sched_timer(scpu);
@@ -1684,6 +1816,12 @@ int hrtimers_dead_cpu(unsigned int scpu)
+ /*
+ * this BH disable ensures that raise_softirq_irqoff() does
+ * not wakeup ksoftirqd (and acquire the pi-lock) while
+ * holding the cpu_base lock
+ */
+ local_bh_disable();
local_irq_disable();
old_base = &per_cpu(hrtimer_bases, scpu);
new_base = this_cpu_ptr(&hrtimer_bases);
@@ -1684,12 +1822,19 @@ int hrtimers_dead_cpu(unsigned int scpu)
&new_base->clock_base[i]);
}
@ -508,7 +480,14 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
raw_spin_unlock(&old_base->lock);
raw_spin_unlock(&new_base->lock);
@@ -1698,6 +1836,7 @@ int hrtimers_dead_cpu(unsigned int scpu)
/* Check, if we got expired work to do */
__hrtimer_peek_ahead_timers();
local_irq_enable();
+ local_bh_enable();
return 0;
}
@@ -1698,6 +1843,7 @@ int hrtimers_dead_cpu(unsigned int scpu)
void __init hrtimers_init(void)
{
hrtimers_prepare_cpu(smp_processor_id());

View File

@ -1,8 +1,8 @@
From: Tom Zanussi <tom.zanussi@linux.intel.com>
Date: Wed, 6 Dec 2017 16:38:09 -0600
Date: Thu, 21 Dec 2017 10:02:50 -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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
@@ -5177,7 +5177,7 @@ static int event_hist_trigger_func(struc
@@ -5164,7 +5164,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)
@@ -5186,10 +5186,37 @@ static int event_hist_trigger_func(struc
@@ -5173,10 +5173,37 @@ static int event_hist_trigger_func(struc
if (glob[0] == '!')
remove = true;

View File

@ -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.6-rt7.tar.xz
Date: Wed, 20 Dec 2017 17:13:18 +0100
Subject: [PATCH 29/29] hrtimer: Implement SOFT/HARD clock base selection
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
All prerequisites to handle hrtimers for expiry in either hard or soft
interrupt context are in place.
@ -10,7 +10,6 @@ Add the missing bit in hrtimer_init() which associates the timer to the
hard or the soft irq clock base.
Signed-off-by: Anna-Maria Gleixner <anna-maria@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
kernel/time/hrtimer.c | 15 +++++++++++----
@ -18,7 +17,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -1220,8 +1220,9 @@ static inline int hrtimer_clockid_to_bas
@@ -1222,8 +1222,9 @@ static inline int hrtimer_clockid_to_bas
static void __hrtimer_init(struct hrtimer *timer, clockid_t clock_id,
enum hrtimer_mode mode)
{
@ -29,7 +28,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
memset(timer, 0, sizeof(struct hrtimer));
@@ -1235,7 +1236,8 @@ static void __hrtimer_init(struct hrtime
@@ -1237,7 +1238,8 @@ static void __hrtimer_init(struct hrtime
if (clock_id == CLOCK_REALTIME && mode & HRTIMER_MODE_REL)
clock_id = CLOCK_MONOTONIC;
@ -39,7 +38,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
timer->base = &cpu_base->clock_base[base];
timerqueue_init(&timer->node);
}
@@ -1244,8 +1246,13 @@ static void __hrtimer_init(struct hrtime
@@ -1246,8 +1248,13 @@ static void __hrtimer_init(struct hrtime
* hrtimer_init - initialize a timer to the given clock
* @timer: the timer to be initialized
* @clock_id: the clock to be used

View File

@ -1,7 +1,7 @@
From: Tom Zanussi <tom.zanussi@linux.intel.com>
Date: Wed, 6 Dec 2017 16:38:10 -0600
Date: Thu, 21 Dec 2017 10:02:51 -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
A common key to use in a histogram is the cpuid - add a new cpu
'synthetic' field named 'cpu' for that purpose.
@ -64,7 +64,7 @@ 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,
@@ -1619,6 +1630,8 @@ static const char *hist_field_name(struc
@@ -1606,6 +1617,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";
@ -73,7 +73,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
else if (field->flags & HIST_FIELD_FL_EXPR ||
field->flags & HIST_FIELD_FL_VAR_REF) {
if (field->system) {
@@ -2124,6 +2137,15 @@ static struct hist_field *create_hist_fi
@@ -2111,6 +2124,15 @@ static struct hist_field *create_hist_fi
goto out;
}
@ -89,7 +89,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
if (WARN_ON_ONCE(!field))
goto out;
@@ -2358,7 +2380,9 @@ parse_field(struct hist_trigger_data *hi
@@ -2345,7 +2367,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;
@ -100,7 +100,7 @@ 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);
@@ -4634,6 +4658,8 @@ static void hist_field_print(struct seq_
@@ -4621,6 +4645,8 @@ static void hist_field_print(struct seq_
if (hist_field->flags & HIST_FIELD_FL_TIMESTAMP)
seq_puts(m, "common_timestamp");

View File

@ -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
Switch the timer to HRTIMER_MODE_SOFT, which executed the timer
callback in softirq context and remove the hrtimer_tasklet.

View File

@ -1,8 +1,8 @@
From: Tom Zanussi <tom.zanussi@linux.intel.com>
Date: Wed, 6 Dec 2017 16:38:11 -0600
Date: Thu, 21 Dec 2017 10:02:52 -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
Add support for alias=$somevar where alias can be used as
onmatch.xxx($alias).
@ -37,7 +37,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
};
struct var_defs {
@@ -1626,7 +1627,8 @@ static const char *hist_field_name(struc
@@ -1613,7 +1614,8 @@ static const char *hist_field_name(struc
if (field->field)
field_name = field->field->name;
@ -47,7 +47,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
field_name = hist_field_name(field->operands[0], ++level);
else if (field->flags & HIST_FIELD_FL_TIMESTAMP)
field_name = "common_timestamp";
@@ -2095,7 +2097,7 @@ static struct hist_field *create_hist_fi
@@ -2082,7 +2084,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) {
@@ -2395,6 +2397,28 @@ parse_field(struct hist_trigger_data *hi
@@ -2382,6 +2384,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)
@@ -2428,6 +2452,13 @@ struct hist_field *parse_atom(struct his
@@ -2415,6 +2439,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
@@ -2532,6 +2563,26 @@ static int check_expr_operands(struct hi
@@ -2519,6 +2550,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;
@@ -4661,7 +4712,8 @@ static void hist_field_print(struct seq_
@@ -4648,7 +4699,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) {

View File

@ -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
Switch the timer to HRTIMER_MODE_SOFT, which executed the timer
callback in softirq context and remove the hrtimer_tasklet.

View File

@ -1,8 +1,8 @@
From: Tom Zanussi <tom.zanussi@linux.intel.com>
Date: Wed, 6 Dec 2017 16:38:12 -0600
Date: Thu, 21 Dec 2017 10:02:53 -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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,8 +27,8 @@ 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 | 156 +++++++++++++++++++++++++++++++++++---
2 files changed, 164 insertions(+), 12 deletions(-)
kernel/trace/trace_events_hist.c | 159 ++++++++++++++++++++++++++++++++++----
2 files changed, 166 insertions(+), 13 deletions(-)
--- a/Documentation/trace/histogram.txt
+++ b/Documentation/trace/histogram.txt
@ -127,15 +127,19 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
static LIST_HEAD(synth_event_list);
static DEFINE_MUTEX(synth_event_mutex);
@@ -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) {
+ hist_err_event("Variable name not unique, need to use fully qualified name (subsys.event.var) for variable: ", system, event_name, var_name);
return NULL;
}
@@ -1452,8 +1511,10 @@ static struct trace_event_file *find_var
continue;
@@ -1515,6 +1575,7 @@ find_match_var(struct hist_trigger_data
if (find_var_field(var_hist_data, var_name)) {
- if (found)
+ if (found) {
+ hist_err_event("Variable name not unique, need to use fully qualified name (subsys.event.var) for variable: ", system, event_name, var_name);
return NULL;
+ }
found = file;
}
@@ -1502,6 +1563,7 @@ find_match_var(struct hist_trigger_data
hist_field = find_file_var(file, var_name);
if (hist_field) {
if (found) {
@ -143,7 +147,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
return ERR_PTR(-EINVAL);
}
@@ -1798,6 +1859,7 @@ static int parse_assignment(char *str, s
@@ -1785,6 +1847,7 @@ static int parse_assignment(char *str, s
char *assignment;
if (attrs->n_assignments == TRACING_MAP_VARS_MAX) {
@ -151,7 +155,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
ret = -EINVAL;
goto out;
}
@@ -2340,6 +2402,10 @@ static struct hist_field *parse_var_ref(
@@ -2327,6 +2390,10 @@ static struct hist_field *parse_var_ref(
if (var_field)
ref_field = create_var_ref(var_field, system, event_name);
@ -162,7 +166,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
return ref_field;
}
@@ -2584,8 +2650,10 @@ static int check_expr_operands(struct hi
@@ -2571,8 +2638,10 @@ static int check_expr_operands(struct hi
}
if ((operand1_flags & HIST_FIELD_FL_TIMESTAMP_USECS) !=
@ -174,7 +178,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
return 0;
}
@@ -2831,12 +2899,17 @@ create_field_var_hist(struct hist_trigge
@@ -2818,12 +2887,17 @@ create_field_var_hist(struct hist_trigge
char *cmd;
int ret;
@ -193,7 +197,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
ret = PTR_ERR(file);
return ERR_PTR(ret);
}
@@ -2848,8 +2921,11 @@ create_field_var_hist(struct hist_trigge
@@ -2835,8 +2909,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);
@ -206,7 +210,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,
@@ -2908,6 +2984,8 @@ create_field_var_hist(struct hist_trigge
@@ -2895,6 +2972,8 @@ create_field_var_hist(struct hist_trigge
kfree(cmd);
kfree(var_hist->cmd);
kfree(var_hist);
@ -215,7 +219,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
return ERR_PTR(ret);
}
@@ -2919,6 +2997,8 @@ create_field_var_hist(struct hist_trigge
@@ -2906,6 +2985,8 @@ create_field_var_hist(struct hist_trigge
if (IS_ERR_OR_NULL(event_var)) {
kfree(var_hist->cmd);
kfree(var_hist);
@ -224,7 +228,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
return ERR_PTR(-EINVAL);
}
@@ -3055,18 +3135,21 @@ static struct field_var *create_field_va
@@ -3042,18 +3123,21 @@ static struct field_var *create_field_va
int ret = 0;
if (hist_data->n_field_vars >= SYNTH_FIELDS_MAX) {
@ -246,7 +250,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
kfree(val);
ret = PTR_ERR(var);
goto err;
@@ -3209,13 +3292,17 @@ static int onmax_create(struct hist_trig
@@ -3196,13 +3280,17 @@ static int onmax_create(struct hist_trig
int ret = 0;
onmax_var_str = data->onmax.var_str;
@ -266,7 +270,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);
@@ -3235,6 +3322,7 @@ static int onmax_create(struct hist_trig
@@ -3222,6 +3310,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)) {
@ -274,7 +278,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
ret = PTR_ERR(max_var);
goto out;
}
@@ -3249,6 +3337,7 @@ static int onmax_create(struct hist_trig
@@ -3236,6 +3325,7 @@ static int onmax_create(struct hist_trig
field_var = create_target_field_var(hist_data, NULL, NULL, param);
if (IS_ERR(field_var)) {
@ -282,7 +286,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
ret = PTR_ERR(field_var);
kfree(param);
goto out;
@@ -3281,6 +3370,7 @@ static int parse_action_params(char *par
@@ -3268,6 +3358,7 @@ static int parse_action_params(char *par
param = strstrip(param);
if (strlen(param) < 2) {
@ -290,7 +294,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
ret = -EINVAL;
goto out;
}
@@ -3456,6 +3546,9 @@ onmatch_find_var(struct hist_trigger_dat
@@ -3443,6 +3534,9 @@ onmatch_find_var(struct hist_trigger_dat
hist_field = find_event_var(hist_data, system, event, var);
}
@ -300,7 +304,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
return hist_field;
}
@@ -3523,6 +3616,7 @@ static int onmatch_create(struct hist_tr
@@ -3510,6 +3604,7 @@ static int onmatch_create(struct hist_tr
mutex_lock(&synth_event_mutex);
event = find_synth_event(data->onmatch.synth_event_name);
if (!event) {
@ -308,7 +312,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
mutex_unlock(&synth_event_mutex);
return -EINVAL;
}
@@ -3582,12 +3676,15 @@ static int onmatch_create(struct hist_tr
@@ -3569,12 +3664,15 @@ static int onmatch_create(struct hist_tr
continue;
}
@ -324,7 +328,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
ret = -EINVAL;
goto err;
}
@@ -3617,15 +3714,22 @@ static struct action_data *onmatch_parse
@@ -3604,15 +3702,22 @@ static struct action_data *onmatch_parse
return ERR_PTR(-ENOMEM);
match_event = strsep(&str, ")");
@ -350,7 +354,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
data->onmatch.match_event = kstrdup(match_event, GFP_KERNEL);
if (!data->onmatch.match_event) {
@@ -3640,12 +3744,16 @@ static struct action_data *onmatch_parse
@@ -3627,12 +3732,16 @@ static struct action_data *onmatch_parse
}
strsep(&str, ".");
@ -369,7 +373,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) {
@@ -3654,8 +3762,10 @@ static struct action_data *onmatch_parse
@@ -3641,8 +3750,10 @@ static struct action_data *onmatch_parse
}
params = strsep(&str, ")");
@ -381,7 +385,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
ret = parse_action_params(params, data);
if (ret)
@@ -3730,7 +3840,9 @@ static int create_var_field(struct hist_
@@ -3717,7 +3828,9 @@ static int create_var_field(struct hist_
if (WARN_ON(val_idx >= TRACING_MAP_VALS_MAX + TRACING_MAP_VARS_MAX))
return -EINVAL;
@ -391,7 +395,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
return -EINVAL;
}
@@ -3811,6 +3923,7 @@ static int create_key_field(struct hist_
@@ -3798,6 +3911,7 @@ static int create_key_field(struct hist_
}
if (hist_field->flags & HIST_FIELD_FL_VAR_REF) {
@ -399,7 +403,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
destroy_hist_field(hist_field, 0);
ret = -EINVAL;
goto out;
@@ -3924,11 +4037,13 @@ static int parse_var_defs(struct hist_tr
@@ -3911,11 +4025,13 @@ static int parse_var_defs(struct hist_tr
var_name = strsep(&field_str, "=");
if (!var_name || !field_str) {
@ -413,7 +417,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
ret = -EINVAL;
goto free;
}
@@ -4682,6 +4797,11 @@ static int hist_show(struct seq_file *m,
@@ -4669,6 +4785,11 @@ static int hist_show(struct seq_file *m,
hist_trigger_show(m, data, n++);
}
@ -425,7 +429,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
out_unlock:
mutex_unlock(&event_mutex);
@@ -5046,6 +5166,7 @@ static int hist_register_trigger(char *g
@@ -5033,6 +5154,7 @@ static int hist_register_trigger(char *g
if (named_data) {
if (!hist_trigger_match(data, named_data, named_data,
true)) {
@ -433,7 +437,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
ret = -EINVAL;
goto out;
}
@@ -5065,13 +5186,16 @@ static int hist_register_trigger(char *g
@@ -5052,13 +5174,16 @@ static int hist_register_trigger(char *g
test->paused = false;
else if (hist_data->attrs->clear)
hist_clear(test);
@ -451,7 +455,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
ret = -ENOENT;
goto out;
}
@@ -5258,6 +5382,11 @@ static int event_hist_trigger_func(struc
@@ -5245,6 +5370,11 @@ static int event_hist_trigger_func(struc
char *trigger, *p;
int ret = 0;
@ -463,7 +467,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
if (!param)
return -EINVAL;
@@ -5396,6 +5525,9 @@ static int event_hist_trigger_func(struc
@@ -5383,6 +5513,9 @@ static int event_hist_trigger_func(struc
/* Just return zero, not the number of registered triggers */
ret = 0;
out:

View File

@ -1,7 +1,7 @@
From: Tom Zanussi <tom.zanussi@linux.intel.com>
Date: Wed, 6 Dec 2017 16:38:13 -0600
Date: Thu, 21 Dec 2017 10:02:54 -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
Add background and details on inter-event hist triggers, including
hist variables, synthetic events, and actions.

View File

@ -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
Switch the timer to HRTIMER_MODE_SOFT, which executed the timer
callback in softirq context and remove the hrtimer_tasklet.

View File

@ -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
There are no more tasklet_hrtimer users of this interface.
Remove it.

View File

@ -1,7 +1,7 @@
From: Tom Zanussi <tom.zanussi@linux.intel.com>
Date: Wed, 6 Dec 2017 16:38:14 -0600
Date: Thu, 21 Dec 2017 10:02:55 -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
Allow tracing code outside of trace.c to access tracing_set_clock().
@ -19,7 +19,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -6230,7 +6230,7 @@ static int tracing_clock_show(struct seq
@@ -6219,7 +6219,7 @@ static int tracing_clock_show(struct seq
return 0;
}

View File

@ -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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

View File

@ -1,7 +1,7 @@
From: Tom Zanussi <tom.zanussi@linux.intel.com>
Date: Wed, 6 Dec 2017 16:38:15 -0600
Date: Thu, 21 Dec 2017 10:02:56 -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
The default clock if timestamps are used in a histogram is "global".
If timestamps aren't used, the clock is irrelevant.
@ -47,7 +47,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
bool pause;
bool cont;
bool clear;
@@ -1792,6 +1793,7 @@ static void destroy_hist_trigger_attrs(s
@@ -1780,6 +1781,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);
}
@@ -1847,6 +1849,19 @@ static int parse_assignment(char *str, s
@@ -1835,6 +1837,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);
@@ -1911,6 +1926,14 @@ static struct hist_trigger_attrs *parse_
@@ -1899,6 +1914,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);
@@ -4937,6 +4960,8 @@ static int event_hist_trigger_print(stru
@@ -4925,6 +4948,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,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
print_actions_spec(m, hist_data);
@@ -5204,7 +5229,6 @@ static int hist_register_trigger(char *g
@@ -5192,7 +5217,6 @@ static int hist_register_trigger(char *g
data->paused = true;
if (named_data) {
@ -107,7 +107,7 @@ Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
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
@@ -5204,10 +5228,22 @@ static int hist_register_trigger(char *g
goto out;
}

View File

@ -1,8 +1,8 @@
From: Tom Zanussi <tom.zanussi@linux.intel.com>
Date: Wed, 6 Dec 2017 16:38:16 -0600
Date: Thu, 21 Dec 2017 10:02:57 -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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

View File

@ -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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

View File

@ -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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

View File

@ -1,8 +1,8 @@
From: Tom Zanussi <tom.zanussi@linux.intel.com>
Date: Wed, 6 Dec 2017 16:38:17 -0600
Date: Thu, 21 Dec 2017 10:02:58 -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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

View File

@ -1,8 +1,8 @@
From: Rajvi Jingar <rajvi.jingar@intel.com>
Date: Wed, 6 Dec 2017 16:38:18 -0600
Date: Thu, 21 Dec 2017 10:02:59 -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
This adds inter-event hist triggers testcases which covers following:
- create/remove synthetic event

View File

@ -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
Probably happens on all ARM, with
CONFIG_PREEMPT_RT_FULL

View File

@ -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
Mart reported a deadlock in -RT in the call path:
hci_send_monitor_ctrl_event() -> hci_send_to_channel()

View File

@ -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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.

View File

@ -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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

View File

@ -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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

View File

@ -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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

View File

@ -1,7 +1,7 @@
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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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

View File

@ -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
The commit "memcontrol: Prevent scheduling while atomic in cgroup code"
fixed this issue:

View File

@ -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
We hit the following bug with 3.6-rt:

View File

@ -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
---
include/linux/preempt.h | 23 ++++++++

View File

@ -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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

View File

@ -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.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,

View File

@ -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.6-rt7.tar.xz
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.14/older/patches-4.14.8-rt9.tar.xz
Setup and remove the interrupt handler in clock event mode selection.
This avoids calling the (shared) interrupt handler when the device is

Some files were not shown because too many files have changed in this diff Show More