Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 713490e0 authored by Ingo Molnar's avatar Ingo Molnar
Browse files

Merge branch 'tracing/core' into perf/core



Merge reason: to add event filter support we need the following
commits from the tracing tree:

 3f6fe06d: tracing/filters: Unify the regex parsing helpers
 1889d209: tracing/filters: Provide basic regex support
 737f453f: tracing/filters: Cleanup useless headers

Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parents c4dc775f 1beee96b
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -779,6 +779,13 @@ and is between 256 and 4096 characters. It is defined in the file
			by the set_ftrace_notrace file in the debugfs
			tracing directory.

	ftrace_graph_filter=[function-list]
			[FTRACE] Limit the top level callers functions traced
			by the function graph tracer at boot up.
			function-list is a comma separated list of functions
			that can be changed at run time by the
			set_graph_function file in the debugfs tracing directory.

	gamecon.map[2|3]=
			[HW,JOY] Multisystem joystick and NES/SNES/PSX pad
			support via parallel port (up to 5 devices per port)
+11 −2
Original line number Diff line number Diff line
@@ -213,10 +213,19 @@ If you can't trace NMI functions, then skip this option.
<details to be filled>


HAVE_FTRACE_SYSCALLS
HAVE_SYSCALL_TRACEPOINTS
---------------------

<details to be filled>
You need very few things to get the syscalls tracing in an arch.

- Have a NR_syscalls variable in <asm/unistd.h> that provides the number
  of syscalls supported by the arch.
- Implement arch_syscall_addr() that resolves a syscall address from a
  syscall number.
- Support the TIF_SYSCALL_TRACEPOINT thread flags
- Put the trace_sys_enter() and trace_sys_exit() tracepoints calls from ptrace
  in the ptrace syscalls tracing path.
- Tag this arch as HAVE_SYSCALL_TRACEPOINTS.


HAVE_FTRACE_MCOUNT_RECORD
+2 −65
Original line number Diff line number Diff line
@@ -203,73 +203,10 @@ unsigned long prepare_ftrace_return(unsigned long ip, unsigned long parent)

#ifdef CONFIG_FTRACE_SYSCALLS

extern unsigned long __start_syscalls_metadata[];
extern unsigned long __stop_syscalls_metadata[];
extern unsigned int sys_call_table[];

static struct syscall_metadata **syscalls_metadata;

struct syscall_metadata *syscall_nr_to_meta(int nr)
{
	if (!syscalls_metadata || nr >= NR_syscalls || nr < 0)
		return NULL;

	return syscalls_metadata[nr];
}

int syscall_name_to_nr(char *name)
{
	int i;

	if (!syscalls_metadata)
		return -1;
	for (i = 0; i < NR_syscalls; i++)
		if (syscalls_metadata[i])
			if (!strcmp(syscalls_metadata[i]->name, name))
				return i;
	return -1;
}

void set_syscall_enter_id(int num, int id)
{
	syscalls_metadata[num]->enter_id = id;
}

void set_syscall_exit_id(int num, int id)
unsigned long __init arch_syscall_addr(int nr)
{
	syscalls_metadata[num]->exit_id = id;
}

static struct syscall_metadata *find_syscall_meta(unsigned long syscall)
{
	struct syscall_metadata *start;
	struct syscall_metadata *stop;
	char str[KSYM_SYMBOL_LEN];

	start = (struct syscall_metadata *)__start_syscalls_metadata;
	stop = (struct syscall_metadata *)__stop_syscalls_metadata;
	kallsyms_lookup(syscall, NULL, NULL, NULL, str);

	for ( ; start < stop; start++) {
		if (start->name && !strcmp(start->name + 3, str + 3))
			return start;
	}
	return NULL;
}

static int __init arch_init_ftrace_syscalls(void)
{
	struct syscall_metadata *meta;
	int i;
	syscalls_metadata = kzalloc(sizeof(*syscalls_metadata) * NR_syscalls,
				    GFP_KERNEL);
	if (!syscalls_metadata)
		return -ENOMEM;
	for (i = 0; i < NR_syscalls; i++) {
		meta = find_syscall_meta((unsigned long)sys_call_table[i]);
		syscalls_metadata[i] = meta;
	}
	return 0;
	return (unsigned long)sys_call_table[nr];
}
arch_initcall(arch_init_ftrace_syscalls);
#endif
+2 −5
Original line number Diff line number Diff line
@@ -1185,17 +1185,14 @@ END(ftrace_graph_caller)

.globl return_to_handler
return_to_handler:
	pushl $0
	pushl %eax
	pushl %ecx
	pushl %edx
	movl %ebp, %eax
	call ftrace_return_to_handler
	movl %eax, 0xc(%esp)
	movl %eax, %ecx
	popl %edx
	popl %ecx
	popl %eax
	ret
	jmp *%ecx
#endif

.section .rodata,"a"
+3 −3
Original line number Diff line number Diff line
@@ -155,11 +155,11 @@ GLOBAL(return_to_handler)

	call ftrace_return_to_handler

	movq %rax, 16(%rsp)
	movq %rax, %rdi
	movq 8(%rsp), %rdx
	movq (%rsp), %rax
	addq $16, %rsp
	retq
	addq $24, %rsp
	jmp *%rdi
#endif


Loading