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

Commit 66c6e29f authored by Ingo Molnar's avatar Ingo Molnar
Browse files

Merge branch 'tracing/core' of...

Merge branch 'tracing/core' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing into tracing/core
parents 6c347d43 117226d1
Loading
Loading
Loading
Loading
+27 −9
Original line number Diff line number Diff line
@@ -220,6 +220,29 @@ struct syscall_metadata *syscall_nr_to_meta(int nr)
	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)
{
	syscalls_metadata[num]->exit_id = id;
}

static struct syscall_metadata *find_syscall_meta(unsigned long syscall)
{
	struct syscall_metadata *start;
@@ -237,24 +260,19 @@ static struct syscall_metadata *find_syscall_meta(unsigned long syscall)
	return NULL;
}

void arch_init_ftrace_syscalls(void)
static int __init arch_init_ftrace_syscalls(void)
{
	struct syscall_metadata *meta;
	int i;
	static atomic_t refs;

	if (atomic_inc_return(&refs) != 1)
		goto out;
	syscalls_metadata = kzalloc(sizeof(*syscalls_metadata) * NR_syscalls,
				    GFP_KERNEL);
	if (!syscalls_metadata)
		goto out;
		return -ENOMEM;
	for (i = 0; i < NR_syscalls; i++) {
		meta = find_syscall_meta((unsigned long)sys_call_table[i]);
		syscalls_metadata[i] = meta;
	}
	return;
out:
	atomic_dec(&refs);
	return 0;
}
arch_initcall(arch_init_ftrace_syscalls);
#endif
+0 −7
Original line number Diff line number Diff line
@@ -28,13 +28,6 @@

#endif

/* FIXME: I don't want to stay hardcoded */
#ifdef CONFIG_X86_64
# define FTRACE_SYSCALL_MAX     299
#else
# define FTRACE_SYSCALL_MAX     337
#endif

#ifdef CONFIG_FUNCTION_TRACER
#define MCOUNT_ADDR		((long)(mcount))
#define MCOUNT_INSN_SIZE	5 /* sizeof mcount call */
+2 −0
Original line number Diff line number Diff line
@@ -345,6 +345,8 @@

#ifdef __KERNEL__

#define NR_syscalls 337

#define __ARCH_WANT_IPC_PARSE_VERSION
#define __ARCH_WANT_OLD_READDIR
#define __ARCH_WANT_OLD_STAT
+6 −0
Original line number Diff line number Diff line
@@ -688,6 +688,12 @@ __SYSCALL(__NR_perf_counter_open, sys_perf_counter_open)
#endif	/* __NO_STUBS */

#ifdef __KERNEL__

#ifndef COMPILE_OFFSETS
#include <asm/asm-offsets.h>
#define NR_syscalls (__NR_syscall_max + 1)
#endif

/*
 * "Conditional" syscalls
 *
+1 −0
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
 * This code generates raw asm output which is post-processed to extract
 * and format the required data.
 */
#define COMPILE_OFFSETS

#include <linux/crypto.h>
#include <linux/sched.h> 
Loading