diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 10:06:00 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 10:06:00 +0000 |
commit | b15a952c52a6825376d3e7f6c1bf5c886c6d8b74 (patch) | |
tree | 1500f2f8f276908a36d8126cb632c0d6b1276764 /debian/patches-rt/0226-trace-Add-migrate-disabled-counter-to-tracing-output.patch | |
parent | Adding upstream version 5.10.209. (diff) | |
download | linux-debian.tar.xz linux-debian.zip |
Adding debian version 5.10.209-2.debian/5.10.209-2debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/patches-rt/0226-trace-Add-migrate-disabled-counter-to-tracing-output.patch')
-rw-r--r-- | debian/patches-rt/0226-trace-Add-migrate-disabled-counter-to-tracing-output.patch | 123 |
1 files changed, 123 insertions, 0 deletions
diff --git a/debian/patches-rt/0226-trace-Add-migrate-disabled-counter-to-tracing-output.patch b/debian/patches-rt/0226-trace-Add-migrate-disabled-counter-to-tracing-output.patch new file mode 100644 index 000000000..23ba35a68 --- /dev/null +++ b/debian/patches-rt/0226-trace-Add-migrate-disabled-counter-to-tracing-output.patch @@ -0,0 +1,123 @@ +From 61f802c21cb2e063c6e8b39e9f497f2d38440b5a Mon Sep 17 00:00:00 2001 +From: Thomas Gleixner <tglx@linutronix.de> +Date: Sun, 17 Jul 2011 21:56:42 +0200 +Subject: [PATCH 226/323] trace: Add migrate-disabled counter to tracing output +Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.204-rt100.tar.xz + +Signed-off-by: Thomas Gleixner <tglx@linutronix.de> +--- + include/linux/trace_events.h | 2 ++ + kernel/trace/trace.c | 26 +++++++++++++++++++------- + kernel/trace/trace_events.c | 1 + + kernel/trace/trace_output.c | 5 +++++ + 4 files changed, 27 insertions(+), 7 deletions(-) + +diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h +index 2fea9fcd4d4e..2151524a10f0 100644 +--- a/include/linux/trace_events.h ++++ b/include/linux/trace_events.h +@@ -69,6 +69,7 @@ struct trace_entry { + unsigned char flags; + unsigned char preempt_count; + int pid; ++ unsigned char migrate_disable; + }; + + #define TRACE_EVENT_TYPE_MAX \ +@@ -157,6 +158,7 @@ static inline void tracing_generic_entry_update(struct trace_entry *entry, + unsigned int trace_ctx) + { + entry->preempt_count = trace_ctx & 0xff; ++ entry->migrate_disable = (trace_ctx >> 8) & 0xff; + entry->pid = current->pid; + entry->type = type; + entry->flags = trace_ctx >> 16; +diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c +index 5d6730589823..02dffb1862b8 100644 +--- a/kernel/trace/trace.c ++++ b/kernel/trace/trace.c +@@ -2575,6 +2575,15 @@ enum print_line_t trace_handle_return(struct trace_seq *s) + } + EXPORT_SYMBOL_GPL(trace_handle_return); + ++static unsigned short migration_disable_value(void) ++{ ++#if defined(CONFIG_SMP) && defined(CONFIG_PREEMPT_RT) ++ return current->migration_disabled; ++#else ++ return 0; ++#endif ++} ++ + unsigned int tracing_gen_ctx_irq_test(unsigned int irqs_status) + { + unsigned int trace_flags = irqs_status; +@@ -2593,7 +2602,8 @@ unsigned int tracing_gen_ctx_irq_test(unsigned int irqs_status) + trace_flags |= TRACE_FLAG_NEED_RESCHED; + if (test_preempt_need_resched()) + trace_flags |= TRACE_FLAG_PREEMPT_RESCHED; +- return (trace_flags << 16) | (pc & 0xff); ++ return (trace_flags << 16) | (pc & 0xff) | ++ (migration_disable_value() & 0xff) << 8; + } + + struct ring_buffer_event * +@@ -3856,9 +3866,10 @@ static void print_lat_help_header(struct seq_file *m) + "# | / _----=> need-resched \n" + "# || / _---=> hardirq/softirq \n" + "# ||| / _--=> preempt-depth \n" +- "# |||| / delay \n" +- "# cmd pid ||||| time | caller \n" +- "# \\ / ||||| \\ | / \n"); ++ "# |||| / _-=> migrate-disable \n" ++ "# ||||| / delay \n" ++ "# cmd pid |||||| time | caller \n" ++ "# \\ / |||||| \\ | / \n"); + } + + static void print_event_info(struct array_buffer *buf, struct seq_file *m) +@@ -3896,9 +3907,10 @@ static void print_func_help_header_irq(struct array_buffer *buf, struct seq_file + seq_printf(m, "# %.*s / _----=> need-resched\n", prec, space); + seq_printf(m, "# %.*s| / _---=> hardirq/softirq\n", prec, space); + seq_printf(m, "# %.*s|| / _--=> preempt-depth\n", prec, space); +- seq_printf(m, "# %.*s||| / delay\n", prec, space); +- seq_printf(m, "# TASK-PID %.*s CPU# |||| TIMESTAMP FUNCTION\n", prec, " TGID "); +- seq_printf(m, "# | | %.*s | |||| | |\n", prec, " | "); ++ seq_printf(m, "# %.*s||| / _-=> migrate-disable\n", prec, space); ++ seq_printf(m, "# %.*s|||| / delay\n", prec, space); ++ seq_printf(m, "# TASK-PID %.*s CPU# ||||| TIMESTAMP FUNCTION\n", prec, " TGID "); ++ seq_printf(m, "# | | %.*s | ||||| | |\n", prec, " | "); + } + + void +diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c +index df64b92c5edc..636fb7df3714 100644 +--- a/kernel/trace/trace_events.c ++++ b/kernel/trace/trace_events.c +@@ -184,6 +184,7 @@ static int trace_define_common_fields(void) + __common_field(unsigned char, flags); + __common_field(unsigned char, preempt_count); + __common_field(int, pid); ++ __common_field(unsigned char, migrate_disable); + + return ret; + } +diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c +index 94b0991717b6..b3619b21217c 100644 +--- a/kernel/trace/trace_output.c ++++ b/kernel/trace/trace_output.c +@@ -497,6 +497,11 @@ int trace_print_lat_fmt(struct trace_seq *s, struct trace_entry *entry) + else + trace_seq_putc(s, '.'); + ++ if (entry->migrate_disable) ++ trace_seq_printf(s, "%x", entry->migrate_disable); ++ else ++ trace_seq_putc(s, '.'); ++ + return !trace_seq_has_overflowed(s); + } + +-- +2.43.0 + |