The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [GIT PULL] tracing: Updates for 6.3
@ 2023-02-20 20:44 Steven Rostedt
  2023-02-23 18:47 ` pr-tracker-bot
  0 siblings, 1 reply; 4+ messages in thread
From: Steven Rostedt @ 2023-02-20 20:44 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: LKML, Masami Hiramatsu, Arnd Bergmann, Bagas Sanjaya,
	Davidlohr Bueso, Jia-Ju Bai, Jianlin Lv, Linyu Yuan, Mark Rutland,
	Ross Zwisler, Song Shuai, Tom Rix, Tom Zanussi, Wang ShaoBo


Linus,

tracing updates for 6.3:

- Add function names as a way to filter function addresses

- Add sample module to test ftrace ops and dynamic trampolines

- Allow stack traces to be passed from beginning event to end event for
  synthetic events. This will allow seeing the stack trace of when a task is
  scheduled out and recorded when it gets scheduled back in.

- Add trace event helper __get_buf() to use as a temporary buffer when printing
  out trace event output.

- Add kernel command line to create trace instances on boot up.

- Add enabling of events to instances created at boot up.

- Add trace_array_puts() to write into instances.

- Allow boot instances to take a snapshot at the end of boot up.

- Allow live patch modules to include trace events

- Minor fixes and clean ups


Please pull the latest trace-v6.3 tree, which can be found at:


  git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
trace-v6.3

Tag SHA1: 58d2fb362d449573480ed049e6b9f4b65af8ca0c
Head SHA1: 7568a21e52f60930ba8ae7897c2521bdab3ef5a4


Arnd Bergmann (1):
      ftrace: sample: avoid open-coded 64-bit division

Bagas Sanjaya (1):
      tracing/histogram: Wrap remaining shell snippets in code blocks

Davidlohr Bueso (1):
      tracing/osnoise: No need for schedule_hrtimeout range

Jia-Ju Bai (1):
      tracing: Add NULL checks for buffer in ring_buffer_free_read_page()

Jianlin Lv (1):
      tracepoint: Allow livepatch module add trace event

Linyu Yuan (1):
      tracing: Acquire buffer from temparary trace sequence

Mark Rutland (1):
      ftrace: Add sample with custom ops

Ross Zwisler (1):
      tracing: Always use canonical ftrace path

Song Shuai (1):
      samples: ftrace: Include the nospec-branch.h only for x86

Steven Rostedt (Google) (16):
      tracing: Add a way to filter function addresses to function names
      tracing/selftests: Add test for event filtering on function name
      tracing: Simplify calculating entry size using struct_size()
      tracing: Allow stacktraces to be saved as histogram variables
      tracing: Allow synthetic events to pass around stacktraces
      tracing/histogram: Add stacktrace type
      tracing/histogram: Document variable stacktrace
      tracing/histogram: Add simple tests for stacktrace usage of synthetic events
      perf/tracing: Use stage6 of tracing to not duplicate macros
      bpf/tracing: Use stage6 of tracing to not duplicate macros
      tracing: Fix trace_event_raw_event_synth() if else statement
      tracing: Add creation of instances at boot command line
      tracing: Add enabling of events to boot instances
      tracing: Add trace_array_puts() to write into instance
      tracing: Allow boot instances to have snapshot buffers
      tracing: Add BUILD_BUG() to make sure stacktrace fits in strings

Tom Rix (1):
      samples: ftrace: Make some global variables static

Tom Zanussi (4):
      tracing/histogram: Don't use strlen to find length of stacktrace variables
      tracing/histogram: Fix a few problems with stacktrace variable printing
      tracing/histogram: Fix stacktrace key
      tracing/histogram: Fix stacktrace histogram Documententation

Wang ShaoBo (1):
      tracing: Remove unnecessary NULL assignment

----
 Documentation/admin-guide/kernel-parameters.txt    |  29 +++
 Documentation/trace/events.rst                     |  12 +
 Documentation/trace/histogram.rst                  | 242 ++++++++++++++++----
 include/linux/kernel.h                             |   2 +-
 include/linux/trace.h                              |  12 +
 include/linux/trace_seq.h                          |   5 +
 include/linux/tracepoint.h                         |   4 +-
 include/trace/bpf_probe.h                          |  45 +---
 include/trace/perf.h                               |  46 +---
 include/trace/stages/stage3_trace_output.h         |   3 +
 include/trace/stages/stage6_event_callback.h       |   3 +
 include/trace/stages/stage7_class_define.h         |   1 +
 kernel/trace/Kconfig                               |  20 +-
 kernel/trace/kprobe_event_gen_test.c               |   2 +-
 kernel/trace/ring_buffer.c                         |   9 +-
 kernel/trace/synth_event_gen_test.c                |   2 +-
 kernel/trace/trace.c                               | 164 ++++++++++++--
 kernel/trace/trace.h                               |   6 +
 kernel/trace/trace_events.c                        |  13 +-
 kernel/trace/trace_events_filter.c                 |  93 +++++++-
 kernel/trace/trace_events_hist.c                   | 126 +++++++++--
 kernel/trace/trace_events_synth.c                  |  90 +++++++-
 kernel/trace/trace_osnoise.c                       |   2 +-
 kernel/trace/trace_seq.c                           |  23 ++
 kernel/trace/trace_synth.h                         |   1 +
 kernel/tracepoint.c                                |   4 +-
 samples/Kconfig                                    |   7 +
 samples/Makefile                                   |   1 +
 samples/ftrace/Makefile                            |   1 +
 samples/ftrace/ftrace-direct-modify.c              |   2 +-
 samples/ftrace/ftrace-direct-multi-modify.c        |   2 +-
 samples/ftrace/ftrace-direct-multi.c               |   2 +-
 samples/ftrace/ftrace-direct-too.c                 |   2 +-
 samples/ftrace/ftrace-direct.c                     |   2 +-
 samples/ftrace/ftrace-ops.c                        | 252 +++++++++++++++++++++
 samples/user_events/example.c                      |   4 +-
 scripts/tracing/draw_functrace.py                  |   6 +-
 tools/lib/api/fs/tracing_path.c                    |   4 +-
 .../ftrace/test.d/filter/event-filter-function.tc  |  58 +++++
 .../inter-event/trigger-synthetic-event-stack.tc   |  24 ++
 .../inter-event/trigger-synthetic-event-syntax.tc  |   6 +
 tools/tracing/latency/latency-collector.c          |   2 +-
 42 files changed, 1113 insertions(+), 221 deletions(-)
 create mode 100644 samples/ftrace/ftrace-ops.c
 create mode 100644 tools/testing/selftests/ftrace/test.d/filter/event-filter-function.tc
 create mode 100644 tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-synthetic-event-stack.tc
---------------------------

^ permalink raw reply	[flat|nested] 4+ messages in thread
* [GIT PULL] tracing: Updates for 6.3
@ 2023-03-19 17:42 Steven Rostedt
  2023-03-19 17:53 ` pr-tracker-bot
  0 siblings, 1 reply; 4+ messages in thread
From: Steven Rostedt @ 2023-03-19 17:42 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: LKML, Masami Hiramatsu, Mark Rutland, Andrew Morton, Anton Gusev,
	Costa Shulyupin, Sung-hun Kim, Tero Kristo, Tom Rix,
	Vlastimil Babka


Linus,

Tracing fixes for 6.3:

- Fix setting affinity of hwlat threads in containers
  Using sched_set_affinity() has unwanted side effects when being
  called within a container. Use set_cpus_allowed_ptr() instead.

- Fix per cpu thread management of the hwlat tracer
  * Do not start per_cpu threads if one is already running for the CPU.
  * When starting per_cpu threads, do not clear the kthread variable
    as it may already be set to running per cpu threads

- Fix return value for test_gen_kprobe_cmd()
  On error the return value was overwritten by being set to
  the result of the call from kprobe_event_delete(), which would
  likely succeed, and thus have the function return success.

- Fix splice() reads from the trace file that was broken by
  36e2c7421f02 ("fs: don't allow splice read/write without explicit ops")

- Remove obsolete and confusing comment in ring_buffer.c
  The original design of the ring buffer used struct page flags
  for tricks to optimize, which was shortly removed due to them
  being tricks. But a comment for those tricks remained.

- Set local functions and variables to static


Please pull the latest trace-v6.3-rc2 tree, which can be found at:


  git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
trace-v6.3-rc2

Tag SHA1: a9d1f246972b628488204ffb45d0e97bef7f5ce6
Head SHA1: 71c7a30442b724717a30d5e7d1662ba4904eb3d4


Anton Gusev (1):
      tracing: Fix wrong return in kprobe_event_gen_test.c

Costa Shulyupin (1):
      tracing/hwlat: Replace sched_setaffinity with set_cpus_allowed_ptr

Sung-hun Kim (1):
      tracing: Make splice_read available again

Tero Kristo (2):
      trace/hwlat: Do not wipe the contents of per-cpu thread data
      trace/hwlat: Do not start per-cpu thread if it is already running

Tom Rix (2):
      tracing/osnoise: set several trace_osnoise.c variables storage-class-specifier to static
      ftrace: Set direct_ops storage-class-specifier to static

Vlastimil Babka (1):
      ring-buffer: remove obsolete comment for free_buffer_page()

----
 kernel/trace/ftrace.c                |  2 +-
 kernel/trace/kprobe_event_gen_test.c |  4 ++--
 kernel/trace/ring_buffer.c           |  4 ----
 kernel/trace/trace.c                 |  2 ++
 kernel/trace/trace_hwlat.c           | 11 ++++++-----
 kernel/trace/trace_osnoise.c         | 10 +++++-----
 6 files changed, 16 insertions(+), 17 deletions(-)
---------------------------
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index a47f7d93e32d..ec2897a76004 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -2503,7 +2503,7 @@ static void call_direct_funcs(unsigned long ip, unsigned long pip,
 	arch_ftrace_set_direct_caller(fregs, addr);
 }
 
-struct ftrace_ops direct_ops = {
+static struct ftrace_ops direct_ops = {
 	.func		= call_direct_funcs,
 	.flags		= FTRACE_OPS_FL_DIRECT | FTRACE_OPS_FL_SAVE_REGS
 			  | FTRACE_OPS_FL_PERMANENT,
diff --git a/kernel/trace/kprobe_event_gen_test.c b/kernel/trace/kprobe_event_gen_test.c
index 4850fdfe27f1..5a4b722b5045 100644
--- a/kernel/trace/kprobe_event_gen_test.c
+++ b/kernel/trace/kprobe_event_gen_test.c
@@ -146,7 +146,7 @@ static int __init test_gen_kprobe_cmd(void)
 	if (trace_event_file_is_valid(gen_kprobe_test))
 		gen_kprobe_test = NULL;
 	/* We got an error after creating the event, delete it */
-	ret = kprobe_event_delete("gen_kprobe_test");
+	kprobe_event_delete("gen_kprobe_test");
 	goto out;
 }
 
@@ -211,7 +211,7 @@ static int __init test_gen_kretprobe_cmd(void)
 	if (trace_event_file_is_valid(gen_kretprobe_test))
 		gen_kretprobe_test = NULL;
 	/* We got an error after creating the event, delete it */
-	ret = kprobe_event_delete("gen_kretprobe_test");
+	kprobe_event_delete("gen_kretprobe_test");
 	goto out;
 }
 
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index 071184324d18..3c7cd135333f 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -354,10 +354,6 @@ static void rb_init_page(struct buffer_data_page *bpage)
 	local_set(&bpage->commit, 0);
 }
 
-/*
- * Also stolen from mm/slob.c. Thanks to Mathieu Desnoyers for pointing
- * this issue out.
- */
 static void free_buffer_page(struct buffer_page *bpage)
 {
 	free_page((unsigned long)bpage->page);
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index fbb602a8b64b..4e9a7a952025 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -5164,6 +5164,8 @@ loff_t tracing_lseek(struct file *file, loff_t offset, int whence)
 static const struct file_operations tracing_fops = {
 	.open		= tracing_open,
 	.read		= seq_read,
+	.read_iter	= seq_read_iter,
+	.splice_read	= generic_file_splice_read,
 	.write		= tracing_write_stub,
 	.llseek		= tracing_lseek,
 	.release	= tracing_release,
diff --git a/kernel/trace/trace_hwlat.c b/kernel/trace/trace_hwlat.c
index d440ddd5fd8b..2f37a6e68aa9 100644
--- a/kernel/trace/trace_hwlat.c
+++ b/kernel/trace/trace_hwlat.c
@@ -339,7 +339,7 @@ static void move_to_next_cpu(void)
 	cpumask_clear(current_mask);
 	cpumask_set_cpu(next_cpu, current_mask);
 
-	sched_setaffinity(0, current_mask);
+	set_cpus_allowed_ptr(current, current_mask);
 	return;
 
  change_mode:
@@ -446,7 +446,7 @@ static int start_single_kthread(struct trace_array *tr)
 
 	}
 
-	sched_setaffinity(kthread->pid, current_mask);
+	set_cpus_allowed_ptr(kthread, current_mask);
 
 	kdata->kthread = kthread;
 	wake_up_process(kthread);
@@ -492,6 +492,10 @@ static int start_cpu_kthread(unsigned int cpu)
 {
 	struct task_struct *kthread;
 
+	/* Do not start a new hwlatd thread if it is already running */
+	if (per_cpu(hwlat_per_cpu_data, cpu).kthread)
+		return 0;
+
 	kthread = kthread_run_on_cpu(kthread_fn, NULL, cpu, "hwlatd/%u");
 	if (IS_ERR(kthread)) {
 		pr_err(BANNER "could not start sampling thread\n");
@@ -584,9 +588,6 @@ static int start_per_cpu_kthreads(struct trace_array *tr)
 	 */
 	cpumask_and(current_mask, cpu_online_mask, tr->tracing_cpumask);
 
-	for_each_online_cpu(cpu)
-		per_cpu(hwlat_per_cpu_data, cpu).kthread = NULL;
-
 	for_each_cpu(cpu, current_mask) {
 		retval = start_cpu_kthread(cpu);
 		if (retval)
diff --git a/kernel/trace/trace_osnoise.c b/kernel/trace/trace_osnoise.c
index 04f0fdae19a1..9176bb7a9bb4 100644
--- a/kernel/trace/trace_osnoise.c
+++ b/kernel/trace/trace_osnoise.c
@@ -217,7 +217,7 @@ struct osnoise_variables {
 /*
  * Per-cpu runtime information.
  */
-DEFINE_PER_CPU(struct osnoise_variables, per_cpu_osnoise_var);
+static DEFINE_PER_CPU(struct osnoise_variables, per_cpu_osnoise_var);
 
 /*
  * this_cpu_osn_var - Return the per-cpu osnoise_variables on its relative CPU
@@ -240,7 +240,7 @@ struct timerlat_variables {
 	u64			count;
 };
 
-DEFINE_PER_CPU(struct timerlat_variables, per_cpu_timerlat_var);
+static DEFINE_PER_CPU(struct timerlat_variables, per_cpu_timerlat_var);
 
 /*
  * this_cpu_tmr_var - Return the per-cpu timerlat_variables on its relative CPU
@@ -332,7 +332,7 @@ struct timerlat_sample {
 /*
  * Protect the interface.
  */
-struct mutex interface_lock;
+static struct mutex interface_lock;
 
 /*
  * Tracer data.
@@ -2239,8 +2239,8 @@ static struct trace_min_max_param osnoise_print_stack = {
 /*
  * osnoise/timerlat_period: min 100 us, max 1 s
  */
-u64 timerlat_min_period = 100;
-u64 timerlat_max_period = 1000000;
+static u64 timerlat_min_period = 100;
+static u64 timerlat_max_period = 1000000;
 static struct trace_min_max_param timerlat_period = {
 	.lock	= &interface_lock,
 	.val	= &osnoise_data.timerlat_period,

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-03-19 17:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-20 20:44 [GIT PULL] tracing: Updates for 6.3 Steven Rostedt
2023-02-23 18:47 ` pr-tracker-bot
  -- strict thread matches above, loose matches on Subject: below --
2023-03-19 17:42 Steven Rostedt
2023-03-19 17:53 ` pr-tracker-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox