Commit 76bfd3de authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull tracing updates from Steven Rostedt:
 "The majority of the changes are for fixes and clean ups.

  Notable changes:

   - Rework trace event triggers code to be easier to interact with.

   - Support for embedding bootconfig with the kernel (as suppose to
     having it embedded in initram). This is useful for embedded boards
     without initram disks.

   - Speed up boot by parallelizing the creation of tracefs files.

   - Allow absolute ring buffer timestamps handle timestamps that use
     more than 59 bits.

   - Added new tracing clock "TAI" (International Atomic Time)

   - Have weak functions show up in available_filter_function list as:
     __ftrace_invalid_address___<invalid-offset> instead of using the
     name of the function before it"

* tag 'trace-v5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: (52 commits)
  ftrace: Add FTRACE_MCOUNT_MAX_OFFSET to avoid adding weak function
  tracing: Fix comments for event_trigger_separate_filter()
  x86/traceponit: Fix comment about irq vector tracepoints
  x86,tracing: Remove unused headers
  ftrace: Clean up hash direct_functions on register failures
  tracing: Fix comments of create_filter()
  tracing: Disable kcov on trace_preemptirq.c
  tracing: Initialize integer variable to prevent garbage return value
  ftrace: Fix typo in comment
  ftrace: Remove return value of ftrace_arch_modify_*()
  tracing: Cleanup code by removing init "char *name"
  tracing: Change "char *" string form to "char []"
  tracing/timerlat: Do not wakeup the thread if the trace stops at the IRQ
  tracing/timerlat: Print stacktrace in the IRQ handler if needed
  tracing/timerlat: Notify IRQ new max latency only if stop tracing is set
  kprobes: Fix build errors with CONFIG_KRETPROBES=n
  tracing: Fix return value of trace_pid_write()
  tracing: Fix potential double free in create_var_ref()
  tracing: Use strim() to remove whitespace instead of doing it manually
  ftrace: Deal with error return code of the ftrace_process_locs() function
  ...
parents 09f73a1a b39181f7
Loading
Loading
Loading
Loading
+28 −3
Original line number Diff line number Diff line
@@ -158,9 +158,15 @@ Each key-value pair is shown in each line with following style::
Boot Kernel With a Boot Config
==============================

Since the boot configuration file is loaded with initrd, it will be added
to the end of the initrd (initramfs) image file with padding, size,
checksum and 12-byte magic word as below.
There are two options to boot the kernel with bootconfig: attaching the
bootconfig to the initrd image or embedding it in the kernel itself.

Attaching a Boot Config to Initrd
---------------------------------

Since the boot configuration file is loaded with initrd by default,
it will be added to the end of the initrd (initramfs) image file with
padding, size, checksum and 12-byte magic word as below.

[initrd][bootconfig][padding][size(le32)][checksum(le32)][#BOOTCONFIG\n]

@@ -196,6 +202,25 @@ To remove the config from the image, you can use -d option as below::
Then add "bootconfig" on the normal kernel command line to tell the
kernel to look for the bootconfig at the end of the initrd file.

Embedding a Boot Config into Kernel
-----------------------------------

If you can not use initrd, you can also embed the bootconfig file in the
kernel by Kconfig options. In this case, you need to recompile the kernel
with the following configs::

 CONFIG_BOOT_CONFIG_EMBED=y
 CONFIG_BOOT_CONFIG_EMBED_FILE="/PATH/TO/BOOTCONFIG/FILE"

``CONFIG_BOOT_CONFIG_EMBED_FILE`` requires an absolute path or a relative
path to the bootconfig file from source tree or object tree.
The kernel will embed it as the default bootconfig.

Just as when attaching the bootconfig to the initrd, you need ``bootconfig``
option on the kernel command line to enable the embedded bootconfig.

Note that even if you set this option, you can override the embedded
bootconfig by another bootconfig which attached to the initrd.

Kernel parameters via Boot Config
=================================
+12 −0
Original line number Diff line number Diff line
@@ -517,6 +517,18 @@ of ftrace. Here is a list of some of the key files:
		processing should be able to handle them. See comments in the
		ktime_get_boot_fast_ns() function for more information.

	tai:
		This is the tai clock (CLOCK_TAI) and is derived from the wall-
		clock time. However, this clock does not experience
		discontinuities and backwards jumps caused by NTP inserting leap
		seconds. Since the clock access is designed for use in tracing,
		side effects are possible. The clock access may yield wrong
		readouts in case the internal TAI offset is updated e.g., caused
		by setting the system time or using adjtimex() with an offset.
		These effects are rare and post processing should be able to
		handle them. See comments in the ktime_get_tai_fast_ns()
		function for more information.

	To set a clock, simply echo the clock name into this file::

	  # echo global > trace_clock
+3 −2
Original line number Diff line number Diff line
@@ -74,8 +74,9 @@ directory. The timerlat configs are:
 - stop_tracing_total_us: stop the system tracing if a
   timer latency at the *thread* context is higher than the configured
   value happens. Writing 0 disables this option.
 - print_stack: save the stack of the IRQ occurrence, and print
   it after the *thread context* event".
 - print_stack: save the stack of the IRQ occurrence. The stack is printed
   after the *thread context* event, or at the IRQ handler if *stop_tracing_us*
   is hit.

timerlat and osnoise
----------------------------
+3 −2
Original line number Diff line number Diff line
@@ -7517,6 +7517,7 @@ S: Maintained
F:	Documentation/admin-guide/bootconfig.rst
F:	fs/proc/bootconfig.c
F:	include/linux/bootconfig.h
F:	lib/bootconfig-data.S
F:	lib/bootconfig.c
F:	tools/bootconfig/*
F:	tools/bootconfig/scripts/*
@@ -20119,8 +20120,8 @@ M: Ingo Molnar <mingo@redhat.com>
S:	Maintained
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
F:	Documentation/trace/ftrace.rst
F:	arch/*/*/*/ftrace.h
F:	arch/*/kernel/ftrace.c
F:	arch/*/*/*/*ftrace*
F:	arch/*/*/*ftrace*
F:	fs/tracefs/
F:	include/*/ftrace.h
F:	include/linux/trace*.h
+2 −4
Original line number Diff line number Diff line
@@ -79,16 +79,14 @@ static unsigned long __ref adjust_address(struct dyn_ftrace *rec,
	return (unsigned long)&ftrace_regs_caller_from_init;
}

int ftrace_arch_code_modify_prepare(void)
void ftrace_arch_code_modify_prepare(void)
{
	return 0;
}

int ftrace_arch_code_modify_post_process(void)
void ftrace_arch_code_modify_post_process(void)
{
	/* Make sure any TLB misses during machine stop are cleared. */
	flush_tlb_all();
	return 0;
}

static unsigned long ftrace_call_replace(unsigned long pc, unsigned long addr,
Loading