* [PATCH 0/4] use NR_syscalls instead of FTRACE_SYSCALL_MAX @ 2009-08-24 21:40 Jason Baron 2009-08-24 21:40 ` [PATCH 1/4] add NR_syscalls define for x86 Jason Baron ` (3 more replies) 0 siblings, 4 replies; 26+ messages in thread From: Jason Baron @ 2009-08-24 21:40 UTC (permalink / raw) To: linux-kernel, x86 Cc: lethal, fweisbec, mingo, laijs, rostedt, peterz, mathieu.desnoyers, jiayingz, mbligh, lizf, jistone, tglx, hpa hi, This series adds definitions for NR_syscalls for x86 and x86_64 and converts syscall events tracing to use NR_syscalls instead of FTRACE_SYSCALL_MAX. Note, the x86_64 NR_syscalls is defined in terms of __NR_syscall_max, and thus is dynamic (we don't need to update it when new syscalls are added). However, the x86 implementation adds a static define in unistd.h, at least for now. Patches are against the current -tip tree. So the x86 static define will need to be updated with a patch when integrated in the -next tree (which has additional syscalls). Also, Paul Mundt has said he will update sh architecture (to remove the FTRACE_SYSCALL_MAX definition). thanks, -Jason -add-nrsyscalls-32 -add-nrsyscalls-x8664 -convert-ftrace-nrsyscalls remove-ftrace-syscall-max arch/x86/include/asm/ftrace.h | 7 ------- arch/x86/include/asm/unistd_32.h | 2 ++ arch/x86/kernel/ftrace.c | 8 ++++---- include/linux/ftrace.h | 5 +++++ kernel/trace/trace_syscalls.c | 24 ++++++++++++------------ 5 files changed, 23 insertions(+), 23 deletions(-) ^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH 1/4] add NR_syscalls define for x86 2009-08-24 21:40 [PATCH 0/4] use NR_syscalls instead of FTRACE_SYSCALL_MAX Jason Baron @ 2009-08-24 21:40 ` Jason Baron 2009-08-24 22:05 ` Paul Mundt 2009-08-28 12:28 ` [tip:tracing/core] tracing: Define NR_syscalls for x86 (32) tip-bot for Jason Baron 2009-08-24 21:40 ` [PATCH 2/4] Add NR_syscalls for x86_64 Jason Baron ` (2 subsequent siblings) 3 siblings, 2 replies; 26+ messages in thread From: Jason Baron @ 2009-08-24 21:40 UTC (permalink / raw) To: linux-kernel, x86 Cc: lethal, fweisbec, mingo, laijs, rostedt, peterz, mathieu.desnoyers, jiayingz, mbligh, lizf, jistone, tglx, hpa Add a NR_syscalls #define for x86. This is used in the syscall events tracing code. Todo: make it dynamic like x86_64 Signed-off-by: Jason Baron <jbaron@redhat.com> --- arch/x86/include/asm/unistd_32.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/x86/include/asm/unistd_32.h b/arch/x86/include/asm/unistd_32.h index 732a307..8deaada 100644 --- a/arch/x86/include/asm/unistd_32.h +++ b/arch/x86/include/asm/unistd_32.h @@ -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 -- 1.6.2.5 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH 1/4] add NR_syscalls define for x86 2009-08-24 21:40 ` [PATCH 1/4] add NR_syscalls define for x86 Jason Baron @ 2009-08-24 22:05 ` Paul Mundt 2009-08-25 13:37 ` Jason Baron 2009-08-28 12:28 ` [tip:tracing/core] tracing: Define NR_syscalls for x86 (32) tip-bot for Jason Baron 1 sibling, 1 reply; 26+ messages in thread From: Paul Mundt @ 2009-08-24 22:05 UTC (permalink / raw) To: Jason Baron Cc: linux-kernel, x86, fweisbec, mingo, laijs, rostedt, peterz, mathieu.desnoyers, jiayingz, mbligh, lizf, jistone, tglx, hpa On Mon, Aug 24, 2009 at 05:40:14PM -0400, Jason Baron wrote: > Add a NR_syscalls #define for x86. This is used in the syscall events tracing > code. Todo: make it dynamic like x86_64 > > Signed-off-by: Jason Baron <jbaron@redhat.com> > > > --- > arch/x86/include/asm/unistd_32.h | 2 ++ > 1 files changed, 2 insertions(+), 0 deletions(-) > > diff --git a/arch/x86/include/asm/unistd_32.h b/arch/x86/include/asm/unistd_32.h > index 732a307..8deaada 100644 > --- a/arch/x86/include/asm/unistd_32.h > +++ b/arch/x86/include/asm/unistd_32.h > @@ -345,6 +345,8 @@ > > #ifdef __KERNEL__ > > +#define NR_syscalls 337 > + Syscalls start at 0 and end at 337, there are 338 syscalls, not 337. Hence the off-by-1 that I initially reported. NR_syscalls is always the last syscall + 1. ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 1/4] add NR_syscalls define for x86 2009-08-24 22:05 ` Paul Mundt @ 2009-08-25 13:37 ` Jason Baron 0 siblings, 0 replies; 26+ messages in thread From: Jason Baron @ 2009-08-25 13:37 UTC (permalink / raw) To: Paul Mundt Cc: linux-kernel, x86, fweisbec, mingo, laijs, rostedt, peterz, mathieu.desnoyers, jiayingz, mbligh, lizf, jistone, tglx, hpa On Tue, Aug 25, 2009 at 07:05:32AM +0900, Paul Mundt wrote: > On Mon, Aug 24, 2009 at 05:40:14PM -0400, Jason Baron wrote: > > Add a NR_syscalls #define for x86. This is used in the syscall events tracing > > code. Todo: make it dynamic like x86_64 > > > > Signed-off-by: Jason Baron <jbaron@redhat.com> > > > > > > --- > > arch/x86/include/asm/unistd_32.h | 2 ++ > > 1 files changed, 2 insertions(+), 0 deletions(-) > > > > diff --git a/arch/x86/include/asm/unistd_32.h b/arch/x86/include/asm/unistd_32.h > > index 732a307..8deaada 100644 > > --- a/arch/x86/include/asm/unistd_32.h > > +++ b/arch/x86/include/asm/unistd_32.h > > @@ -345,6 +345,8 @@ > > > > #ifdef __KERNEL__ > > > > +#define NR_syscalls 337 > > + > Syscalls start at 0 and end at 337, there are 338 syscalls, not 337. > Hence the off-by-1 that I initially reported. NR_syscalls is always the > last syscall + 1. right, as I explained in my 0/4 message, this patch is for the -tip tree, where 337 is correct, and needs to be adjusted for the -next tree to 338. thanks, -Jason ^ permalink raw reply [flat|nested] 26+ messages in thread
* [tip:tracing/core] tracing: Define NR_syscalls for x86 (32) 2009-08-24 21:40 ` [PATCH 1/4] add NR_syscalls define for x86 Jason Baron 2009-08-24 22:05 ` Paul Mundt @ 2009-08-28 12:28 ` tip-bot for Jason Baron 1 sibling, 0 replies; 26+ messages in thread From: tip-bot for Jason Baron @ 2009-08-28 12:28 UTC (permalink / raw) To: linux-tip-commits Cc: brueckner, mathieu.desnoyers, mingo, peterz, fweisbec, rostedt, heiko.carstens, tglx, jbaron, laijs, linux-kernel, hpa, jiayingz, lizf, lethal, jistone, mingo, mbligh Commit-ID: dd86dda24cc1dc70031a7d9250dc3c0c430a50e2 Gitweb: http://git.kernel.org/tip/dd86dda24cc1dc70031a7d9250dc3c0c430a50e2 Author: Jason Baron <jbaron@redhat.com> AuthorDate: Mon, 24 Aug 2009 17:40:14 -0400 Committer: Frederic Weisbecker <fweisbec@gmail.com> CommitDate: Wed, 26 Aug 2009 21:29:55 +0200 tracing: Define NR_syscalls for x86 (32) Add a NR_syscalls #define for x86. This is used in the syscall events tracing code. Todo: make it dynamic like x86_64. NR_syscalls is the usual name used to determine the number of syscalls supported by the current arch. We want to unify the use of this number across archs that support the syscall tracing. This also prepare to move some of the arch code to core code in the syscall tracing area. Signed-off-by: Jason Baron <jbaron@redhat.com> Cc: Paul Mundt <lethal@linux-sh.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Lai Jiangshan <laijs@cn.fujitsu.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> Cc: Jiaying Zhang <jiayingz@google.com> Cc: Martin Bligh <mbligh@google.com> Cc: Li Zefan <lizf@cn.fujitsu.com> Cc: Josh Stone <jistone@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: H. Peter Anwin <hpa@zytor.com> Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> LKML-Reference: <0f33c0f96d198fccc3ddd9ff7f5334ff5cb42706.1251146513.git.jbaron@redhat.com> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> --- arch/x86/include/asm/unistd_32.h | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/x86/include/asm/unistd_32.h b/arch/x86/include/asm/unistd_32.h index 732a307..8deaada 100644 --- a/arch/x86/include/asm/unistd_32.h +++ b/arch/x86/include/asm/unistd_32.h @@ -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 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 2/4] Add NR_syscalls for x86_64 2009-08-24 21:40 [PATCH 0/4] use NR_syscalls instead of FTRACE_SYSCALL_MAX Jason Baron 2009-08-24 21:40 ` [PATCH 1/4] add NR_syscalls define for x86 Jason Baron @ 2009-08-24 21:40 ` Jason Baron 2009-08-24 22:14 ` Frederic Weisbecker 2009-08-24 21:40 ` [PATCH 3/4] Convert event tracing code to NR_syscalls Jason Baron 2009-08-24 21:40 ` [PATCH 4/4] remove FTRACE_SYSCALL_MAX definitions Jason Baron 3 siblings, 1 reply; 26+ messages in thread From: Jason Baron @ 2009-08-24 21:40 UTC (permalink / raw) To: linux-kernel, x86 Cc: lethal, fweisbec, mingo, laijs, rostedt, peterz, mathieu.desnoyers, jiayingz, mbligh, lizf, jistone, tglx, hpa Add a dynamic definition of NR_syscalls for x86_64. This is used in the syscall events tracing code. Signed-off-by: Jason Baron <jbaron@redhat.com> --- include/linux/ftrace.h | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index dc3b132..3bd94ee 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h @@ -14,6 +14,11 @@ #include <asm/ftrace.h> +#ifdef CONFIG_X86_64 +#include <asm/asm-offsets.h> +#define NR_syscalls (__NR_syscall_max + 1) +#endif + #ifdef CONFIG_FUNCTION_TRACER extern int ftrace_enabled; -- 1.6.2.5 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH 2/4] Add NR_syscalls for x86_64 2009-08-24 21:40 ` [PATCH 2/4] Add NR_syscalls for x86_64 Jason Baron @ 2009-08-24 22:14 ` Frederic Weisbecker 2009-08-24 22:44 ` Steven Rostedt 0 siblings, 1 reply; 26+ messages in thread From: Frederic Weisbecker @ 2009-08-24 22:14 UTC (permalink / raw) To: Jason Baron Cc: linux-kernel, x86, lethal, mingo, laijs, rostedt, peterz, mathieu.desnoyers, jiayingz, mbligh, lizf, jistone, tglx, hpa On Mon, Aug 24, 2009 at 05:40:18PM -0400, Jason Baron wrote: > Add a dynamic definition of NR_syscalls for x86_64. This is used in the > syscall events tracing code. > > Signed-off-by: Jason Baron <jbaron@redhat.com> > > --- > include/linux/ftrace.h | 5 +++++ > 1 files changed, 5 insertions(+), 0 deletions(-) > > diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h > index dc3b132..3bd94ee 100644 > --- a/include/linux/ftrace.h > +++ b/include/linux/ftrace.h > @@ -14,6 +14,11 @@ > > #include <asm/ftrace.h> > > +#ifdef CONFIG_X86_64 > +#include <asm/asm-offsets.h> > +#define NR_syscalls (__NR_syscall_max + 1) > +#endif > + I'd rather see this in arch/x86/include/unistd_64.h, since NR_syscalls seems to be the defined in unistd.h in all archs. That also makes a unified way to retrieve this number for other users. > #ifdef CONFIG_FUNCTION_TRACER > > extern int ftrace_enabled; > -- > 1.6.2.5 > ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 2/4] Add NR_syscalls for x86_64 2009-08-24 22:14 ` Frederic Weisbecker @ 2009-08-24 22:44 ` Steven Rostedt 2009-08-25 13:40 ` Jason Baron 0 siblings, 1 reply; 26+ messages in thread From: Steven Rostedt @ 2009-08-24 22:44 UTC (permalink / raw) To: Frederic Weisbecker Cc: Jason Baron, linux-kernel, x86, lethal, mingo, laijs, peterz, mathieu.desnoyers, jiayingz, mbligh, lizf, jistone, tglx, hpa On Tue, 25 Aug 2009, Frederic Weisbecker wrote: > On Mon, Aug 24, 2009 at 05:40:18PM -0400, Jason Baron wrote: > > Add a dynamic definition of NR_syscalls for x86_64. This is used in the > > syscall events tracing code. > > > > Signed-off-by: Jason Baron <jbaron@redhat.com> > > > > --- > > include/linux/ftrace.h | 5 +++++ > > 1 files changed, 5 insertions(+), 0 deletions(-) > > > > diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h > > index dc3b132..3bd94ee 100644 > > --- a/include/linux/ftrace.h > > +++ b/include/linux/ftrace.h > > @@ -14,6 +14,11 @@ > > > > #include <asm/ftrace.h> > > > > +#ifdef CONFIG_X86_64 > > +#include <asm/asm-offsets.h> > > +#define NR_syscalls (__NR_syscall_max + 1) > > +#endif > > + > > > I'd rather see this in arch/x86/include/unistd_64.h, since > NR_syscalls seems to be the defined in unistd.h in all archs. > > That also makes a unified way to retrieve this number for > other users. > Yes, NR_syscalls should be included there. -- Steve ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 2/4] Add NR_syscalls for x86_64 2009-08-24 22:44 ` Steven Rostedt @ 2009-08-25 13:40 ` Jason Baron 2009-08-25 18:47 ` Jason Baron 0 siblings, 1 reply; 26+ messages in thread From: Jason Baron @ 2009-08-25 13:40 UTC (permalink / raw) To: Steven Rostedt Cc: Frederic Weisbecker, linux-kernel, x86, lethal, mingo, laijs, peterz, mathieu.desnoyers, jiayingz, mbligh, lizf, jistone, tglx, hpa On Mon, Aug 24, 2009 at 06:44:00PM -0400, Steven Rostedt wrote: > On Tue, 25 Aug 2009, Frederic Weisbecker wrote: > > > On Mon, Aug 24, 2009 at 05:40:18PM -0400, Jason Baron wrote: > > > Add a dynamic definition of NR_syscalls for x86_64. This is used in the > > > syscall events tracing code. > > > > > > Signed-off-by: Jason Baron <jbaron@redhat.com> > > > > > > --- > > > include/linux/ftrace.h | 5 +++++ > > > 1 files changed, 5 insertions(+), 0 deletions(-) > > > > > > diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h > > > index dc3b132..3bd94ee 100644 > > > --- a/include/linux/ftrace.h > > > +++ b/include/linux/ftrace.h > > > @@ -14,6 +14,11 @@ > > > > > > #include <asm/ftrace.h> > > > > > > +#ifdef CONFIG_X86_64 > > > +#include <asm/asm-offsets.h> > > > +#define NR_syscalls (__NR_syscall_max + 1) > > > +#endif > > > + > > > > > > I'd rather see this in arch/x86/include/unistd_64.h, since > > NR_syscalls seems to be the defined in unistd.h in all archs. > > > > That also makes a unified way to retrieve this number for > > other users. > > > > Yes, NR_syscalls should be included there. > > -- Steve right, for x86_64, unistd.h is included to generate __NR_syscall_max which is then used for NR_syscalls. So I did initially try it there, but there were dependency problems. I'll see what I can come up with... thanks, -Jason ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 2/4] Add NR_syscalls for x86_64 2009-08-25 13:40 ` Jason Baron @ 2009-08-25 18:47 ` Jason Baron 2009-08-25 19:04 ` Mathieu Desnoyers 2009-08-26 2:25 ` Steven Rostedt 0 siblings, 2 replies; 26+ messages in thread From: Jason Baron @ 2009-08-25 18:47 UTC (permalink / raw) To: Steven Rostedt Cc: Frederic Weisbecker, linux-kernel, x86, lethal, mingo, laijs, peterz, mathieu.desnoyers, jiayingz, mbligh, lizf, jistone, tglx, hpa On Tue, Aug 25, 2009 at 09:40:05AM -0400, Jason Baron wrote: > > > On Mon, Aug 24, 2009 at 05:40:18PM -0400, Jason Baron wrote: > > > > Add a dynamic definition of NR_syscalls for x86_64. This is used in the > > > > syscall events tracing code. > > > > > > > > Signed-off-by: Jason Baron <jbaron@redhat.com> > > > > > > > > --- > > > > include/linux/ftrace.h | 5 +++++ > > > > 1 files changed, 5 insertions(+), 0 deletions(-) > > > > > > > > diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h > > > > index dc3b132..3bd94ee 100644 > > > > --- a/include/linux/ftrace.h > > > > +++ b/include/linux/ftrace.h > > > > @@ -14,6 +14,11 @@ > > > > > > > > #include <asm/ftrace.h> > > > > > > > > +#ifdef CONFIG_X86_64 > > > > +#include <asm/asm-offsets.h> > > > > +#define NR_syscalls (__NR_syscall_max + 1) > > > > +#endif > > > > + > > > > > > > > > I'd rather see this in arch/x86/include/unistd_64.h, since > > > NR_syscalls seems to be the defined in unistd.h in all archs. > > > > > > That also makes a unified way to retrieve this number for > > > other users. > > > > > > > Yes, NR_syscalls should be included there. > > > > -- Steve > > right, for x86_64, unistd.h is included to generate __NR_syscall_max > which is then used for NR_syscalls. So I did initially try it there, but > there were dependency problems. I'll see what I can come up with... > > thanks, > > -Jason ok, since unistd_64.h is used to generate offsets.c, which eventually generates, asm/asm-offsets.h, which defines, __NR_syscall_max, we can't just put #define of NR_syscalls in unistd_64.h. However, it seems the only point in time that unistd_64.h can not depend upon __NR_syscall_max, is before asm/asm-offsets.h is defined. Thus, the patch below passes in a '-DCREATE_OFFSETS' during the creation of asm/asm-offsets.h, so that we do not include it before it exists. The patch is hacky but works. thoughts? Signed-off-by: Jason Baron <jbaron@redhat.com> --- Kbuild | 2 +- arch/x86/include/asm/unistd_64.h | 6 ++++++ scripts/Makefile.build | 4 ++++ 3 files changed, 11 insertions(+), 1 deletions(-) diff --git a/Kbuild b/Kbuild index f056b4f..5f43d4d 100644 --- a/Kbuild +++ b/Kbuild @@ -78,7 +78,7 @@ endef arch/$(SRCARCH)/kernel/asm-offsets.s: arch/$(SRCARCH)/kernel/asm-offsets.c \ $(obj)/$(bounds-file) FORCE $(Q)mkdir -p $(dir $@) - $(call if_changed_dep,cc_s_c) + $(call if_changed_dep,cc_s_c_define_offset) $(obj)/$(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s Kbuild $(call cmd,offsets) diff --git a/arch/x86/include/asm/unistd_64.h b/arch/x86/include/asm/unistd_64.h index 900e161..70c0c3d 100644 --- a/arch/x86/include/asm/unistd_64.h +++ b/arch/x86/include/asm/unistd_64.h @@ -688,6 +688,12 @@ __SYSCALL(__NR_perf_counter_open, sys_perf_counter_open) #endif /* __NO_STUBS */ #ifdef __KERNEL__ + +#ifndef CREATE_OFFSETS +#include <asm/asm-offsets.h> +#define NR_syscalls (__NR_syscall_max + 1) +#endif + /* * "Conditional" syscalls * diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 5c4b7a4..4177858 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -145,6 +145,10 @@ $(multi-objs-y:.o=.lst) : modname = $(modname-multi) quiet_cmd_cc_s_c = CC $(quiet_modtag) $@ cmd_cc_s_c = $(CC) $(c_flags) -fverbose-asm -S -o $@ $< +quiet_cmd_cc_s_c_define_offset = CC $(quiet_modtag) $@ +cmd_cc_s_c_define_offset = $(CC) $(c_flags) -DCREATE_OFFSETS \ + -fverbose-asm -S -o $@ $< + $(obj)/%.s: $(src)/%.c FORCE $(call if_changed_dep,cc_s_c) ^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH 2/4] Add NR_syscalls for x86_64 2009-08-25 18:47 ` Jason Baron @ 2009-08-25 19:04 ` Mathieu Desnoyers 2009-08-25 20:58 ` Jason Baron 2009-08-26 2:25 ` Steven Rostedt 1 sibling, 1 reply; 26+ messages in thread From: Mathieu Desnoyers @ 2009-08-25 19:04 UTC (permalink / raw) To: Jason Baron Cc: Steven Rostedt, Frederic Weisbecker, linux-kernel, x86, lethal, mingo, laijs, peterz, jiayingz, mbligh, lizf, jistone, tglx, hpa * Jason Baron (jbaron@redhat.com) wrote: > On Tue, Aug 25, 2009 at 09:40:05AM -0400, Jason Baron wrote: > > > > On Mon, Aug 24, 2009 at 05:40:18PM -0400, Jason Baron wrote: > > > > > Add a dynamic definition of NR_syscalls for x86_64. This is used in the > > > > > syscall events tracing code. > > > > > > > > > > Signed-off-by: Jason Baron <jbaron@redhat.com> > > > > > > > > > > --- > > > > > include/linux/ftrace.h | 5 +++++ > > > > > 1 files changed, 5 insertions(+), 0 deletions(-) > > > > > > > > > > diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h > > > > > index dc3b132..3bd94ee 100644 > > > > > --- a/include/linux/ftrace.h > > > > > +++ b/include/linux/ftrace.h > > > > > @@ -14,6 +14,11 @@ > > > > > > > > > > #include <asm/ftrace.h> > > > > > > > > > > +#ifdef CONFIG_X86_64 > > > > > +#include <asm/asm-offsets.h> > > > > > +#define NR_syscalls (__NR_syscall_max + 1) > > > > > +#endif > > > > > + > > > > > > > > > > > > I'd rather see this in arch/x86/include/unistd_64.h, since > > > > NR_syscalls seems to be the defined in unistd.h in all archs. > > > > > > > > That also makes a unified way to retrieve this number for > > > > other users. > > > > > > > > > > Yes, NR_syscalls should be included there. > > > > > > -- Steve > > > > right, for x86_64, unistd.h is included to generate __NR_syscall_max > > which is then used for NR_syscalls. So I did initially try it there, but > > there were dependency problems. I'll see what I can come up with... > > > > thanks, > > > > -Jason > > ok, since unistd_64.h is used to generate offsets.c, which eventually > generates, asm/asm-offsets.h, which defines, __NR_syscall_max, we can't > just put #define of NR_syscalls in unistd_64.h. However, it seems the > only point in time that unistd_64.h can not depend upon __NR_syscall_max, > is before asm/asm-offsets.h is defined. Thus, the patch below passes in > a '-DCREATE_OFFSETS' during the creation of asm/asm-offsets.h, so that > we do not include it before it exists. The patch is hacky but works. > thoughts? Ugh! My eyes hurt! What you are doing here is to basically put back the hardcoded NR_syscalls rather that using the build infrastructure already in place. If my memory serves me well, unistd_64.h generates __NR_syscall_max automatically by being included multiples times. Can we generalize this and make the information generated available in an automaticaly generated header instead ? It is saved in ams-offsets.h currently as "__NR_syscall_max". We could also save it somewhere else meant to be included by C code. Mathieu > > Signed-off-by: Jason Baron <jbaron@redhat.com> > > --- > > Kbuild | 2 +- > arch/x86/include/asm/unistd_64.h | 6 ++++++ > scripts/Makefile.build | 4 ++++ > 3 files changed, 11 insertions(+), 1 deletions(-) > > > diff --git a/Kbuild b/Kbuild > index f056b4f..5f43d4d 100644 > --- a/Kbuild > +++ b/Kbuild > @@ -78,7 +78,7 @@ endef > arch/$(SRCARCH)/kernel/asm-offsets.s: arch/$(SRCARCH)/kernel/asm-offsets.c \ > $(obj)/$(bounds-file) FORCE > $(Q)mkdir -p $(dir $@) > - $(call if_changed_dep,cc_s_c) > + $(call if_changed_dep,cc_s_c_define_offset) > > $(obj)/$(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s Kbuild > $(call cmd,offsets) > diff --git a/arch/x86/include/asm/unistd_64.h b/arch/x86/include/asm/unistd_64.h > index 900e161..70c0c3d 100644 > --- a/arch/x86/include/asm/unistd_64.h > +++ b/arch/x86/include/asm/unistd_64.h > @@ -688,6 +688,12 @@ __SYSCALL(__NR_perf_counter_open, sys_perf_counter_open) > #endif /* __NO_STUBS */ > > #ifdef __KERNEL__ > + > +#ifndef CREATE_OFFSETS > +#include <asm/asm-offsets.h> > +#define NR_syscalls (__NR_syscall_max + 1) > +#endif > + > /* > * "Conditional" syscalls > * > diff --git a/scripts/Makefile.build b/scripts/Makefile.build > index 5c4b7a4..4177858 100644 > --- a/scripts/Makefile.build > +++ b/scripts/Makefile.build > @@ -145,6 +145,10 @@ $(multi-objs-y:.o=.lst) : modname = $(modname-multi) > quiet_cmd_cc_s_c = CC $(quiet_modtag) $@ > cmd_cc_s_c = $(CC) $(c_flags) -fverbose-asm -S -o $@ $< > > +quiet_cmd_cc_s_c_define_offset = CC $(quiet_modtag) $@ > +cmd_cc_s_c_define_offset = $(CC) $(c_flags) -DCREATE_OFFSETS \ > + -fverbose-asm -S -o $@ $< > + > $(obj)/%.s: $(src)/%.c FORCE > $(call if_changed_dep,cc_s_c) > > > > > -- Mathieu Desnoyers OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68 ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 2/4] Add NR_syscalls for x86_64 2009-08-25 19:04 ` Mathieu Desnoyers @ 2009-08-25 20:58 ` Jason Baron 2009-08-25 23:28 ` Mathieu Desnoyers 2009-08-25 23:38 ` Frederic Weisbecker 0 siblings, 2 replies; 26+ messages in thread From: Jason Baron @ 2009-08-25 20:58 UTC (permalink / raw) To: Mathieu Desnoyers Cc: Steven Rostedt, Frederic Weisbecker, linux-kernel, x86, lethal, mingo, laijs, peterz, jiayingz, mbligh, lizf, jistone, tglx, hpa On Tue, Aug 25, 2009 at 03:04:15PM -0400, Mathieu Desnoyers wrote: > * Jason Baron (jbaron@redhat.com) wrote: > > On Tue, Aug 25, 2009 at 09:40:05AM -0400, Jason Baron wrote: > > > > > On Mon, Aug 24, 2009 at 05:40:18PM -0400, Jason Baron wrote: > > > > > > Add a dynamic definition of NR_syscalls for x86_64. This is used in the > > > > > > syscall events tracing code. > > > > > > > > > > > > Signed-off-by: Jason Baron <jbaron@redhat.com> > > > > > > > > > > > > --- > > > > > > include/linux/ftrace.h | 5 +++++ > > > > > > 1 files changed, 5 insertions(+), 0 deletions(-) > > > > > > > > > > > > diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h > > > > > > index dc3b132..3bd94ee 100644 > > > > > > --- a/include/linux/ftrace.h > > > > > > +++ b/include/linux/ftrace.h > > > > > > @@ -14,6 +14,11 @@ > > > > > > > > > > > > #include <asm/ftrace.h> > > > > > > > > > > > > +#ifdef CONFIG_X86_64 > > > > > > +#include <asm/asm-offsets.h> > > > > > > +#define NR_syscalls (__NR_syscall_max + 1) > > > > > > +#endif > > > > > > + > > > > > > > > > > > > > > > I'd rather see this in arch/x86/include/unistd_64.h, since > > > > > NR_syscalls seems to be the defined in unistd.h in all archs. > > > > > > > > > > That also makes a unified way to retrieve this number for > > > > > other users. > > > > > > > > > > > > > Yes, NR_syscalls should be included there. > > > > > > > > -- Steve > > > > > > right, for x86_64, unistd.h is included to generate __NR_syscall_max > > > which is then used for NR_syscalls. So I did initially try it there, but > > > there were dependency problems. I'll see what I can come up with... > > > > > > thanks, > > > > > > -Jason > > > > ok, since unistd_64.h is used to generate offsets.c, which eventually > > generates, asm/asm-offsets.h, which defines, __NR_syscall_max, we can't > > just put #define of NR_syscalls in unistd_64.h. However, it seems the > > only point in time that unistd_64.h can not depend upon __NR_syscall_max, > > is before asm/asm-offsets.h is defined. Thus, the patch below passes in > > a '-DCREATE_OFFSETS' during the creation of asm/asm-offsets.h, so that > > we do not include it before it exists. The patch is hacky but works. > > thoughts? > > Ugh! My eyes hurt! > sorry :) > What you are doing here is to basically put back the hardcoded > NR_syscalls rather that using the build infrastructure already in place. > no. NR_syscalls is not hardcoded by this patch. Its defined in terms of __NR_syscall_max which is dynamically generated by the kernel build. > If my memory serves me well, unistd_64.h generates __NR_syscall_max > automatically by being included multiples times. Can we generalize this > and make the information generated available in an automaticaly > generated header instead ? It is saved in ams-offsets.h currently as > "__NR_syscall_max". We could also save it somewhere else meant to be > included by C code. > > Mathieu > The request was to define NR_syscalls in unistd.h, since that is the historical Linux location for it. Adding another automatically generated header does not accomplish that. Even if I include that new file in unistd.h, I'm still going to have a circular dependency, and require a solution similar to what I've proposed. thanks, -Jason ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 2/4] Add NR_syscalls for x86_64 2009-08-25 20:58 ` Jason Baron @ 2009-08-25 23:28 ` Mathieu Desnoyers 2009-08-25 23:38 ` Frederic Weisbecker 1 sibling, 0 replies; 26+ messages in thread From: Mathieu Desnoyers @ 2009-08-25 23:28 UTC (permalink / raw) To: Jason Baron Cc: Steven Rostedt, Frederic Weisbecker, linux-kernel, x86, lethal, mingo, laijs, peterz, jiayingz, mbligh, lizf, jistone, tglx, hpa * Jason Baron (jbaron@redhat.com) wrote: > On Tue, Aug 25, 2009 at 03:04:15PM -0400, Mathieu Desnoyers wrote: > > * Jason Baron (jbaron@redhat.com) wrote: > > > On Tue, Aug 25, 2009 at 09:40:05AM -0400, Jason Baron wrote: > > > > > > On Mon, Aug 24, 2009 at 05:40:18PM -0400, Jason Baron wrote: > > > > > > > Add a dynamic definition of NR_syscalls for x86_64. This is used in the > > > > > > > syscall events tracing code. > > > > > > > > > > > > > > Signed-off-by: Jason Baron <jbaron@redhat.com> > > > > > > > > > > > > > > --- > > > > > > > include/linux/ftrace.h | 5 +++++ > > > > > > > 1 files changed, 5 insertions(+), 0 deletions(-) > > > > > > > > > > > > > > diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h > > > > > > > index dc3b132..3bd94ee 100644 > > > > > > > --- a/include/linux/ftrace.h > > > > > > > +++ b/include/linux/ftrace.h > > > > > > > @@ -14,6 +14,11 @@ > > > > > > > > > > > > > > #include <asm/ftrace.h> > > > > > > > > > > > > > > +#ifdef CONFIG_X86_64 > > > > > > > +#include <asm/asm-offsets.h> > > > > > > > +#define NR_syscalls (__NR_syscall_max + 1) > > > > > > > +#endif > > > > > > > + > > > > > > > > > > > > > > > > > > I'd rather see this in arch/x86/include/unistd_64.h, since > > > > > > NR_syscalls seems to be the defined in unistd.h in all archs. > > > > > > > > > > > > That also makes a unified way to retrieve this number for > > > > > > other users. > > > > > > > > > > > > > > > > Yes, NR_syscalls should be included there. > > > > > > > > > > -- Steve > > > > > > > > right, for x86_64, unistd.h is included to generate __NR_syscall_max > > > > which is then used for NR_syscalls. So I did initially try it there, but > > > > there were dependency problems. I'll see what I can come up with... > > > > > > > > thanks, > > > > > > > > -Jason > > > > > > ok, since unistd_64.h is used to generate offsets.c, which eventually > > > generates, asm/asm-offsets.h, which defines, __NR_syscall_max, we can't > > > just put #define of NR_syscalls in unistd_64.h. However, it seems the > > > only point in time that unistd_64.h can not depend upon __NR_syscall_max, > > > is before asm/asm-offsets.h is defined. Thus, the patch below passes in > > > a '-DCREATE_OFFSETS' during the creation of asm/asm-offsets.h, so that > > > we do not include it before it exists. The patch is hacky but works. > > > thoughts? > > > > Ugh! My eyes hurt! > > > > sorry :) > > > What you are doing here is to basically put back the hardcoded > > NR_syscalls rather that using the build infrastructure already in place. > > > > no. NR_syscalls is not hardcoded by this patch. Its defined in terms of > __NR_syscall_max which is dynamically generated by the kernel build. > > > If my memory serves me well, unistd_64.h generates __NR_syscall_max > > automatically by being included multiples times. Can we generalize this > > and make the information generated available in an automaticaly > > generated header instead ? It is saved in ams-offsets.h currently as > > "__NR_syscall_max". We could also save it somewhere else meant to be > > included by C code. > > > > Mathieu > > > > The request was to define NR_syscalls in unistd.h, since that is the > historical Linux location for it. Adding another automatically generated > header does not accomplish that. Even if I include that new file in > unistd.h, I'm still going to have a circular dependency, and require a > solution similar to what I've proposed. > OK, it may not be pretty, but it makes sense. :) Thanks, Mathieu > thanks, > > -Jason > -- Mathieu Desnoyers OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68 ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 2/4] Add NR_syscalls for x86_64 2009-08-25 20:58 ` Jason Baron 2009-08-25 23:28 ` Mathieu Desnoyers @ 2009-08-25 23:38 ` Frederic Weisbecker 1 sibling, 0 replies; 26+ messages in thread From: Frederic Weisbecker @ 2009-08-25 23:38 UTC (permalink / raw) To: Jason Baron, H. Peter Anwin, Thomas Gleixner, Ingo Molnar Cc: Mathieu Desnoyers, Steven Rostedt, linux-kernel, x86, lethal, laijs, peterz, jiayingz, mbligh, lizf, jistone On Tue, Aug 25, 2009 at 04:58:29PM -0400, Jason Baron wrote: > > Ugh! My eyes hurt! > > sorry :) > > > What you are doing here is to basically put back the hardcoded > > NR_syscalls rather that using the build infrastructure already in place. > > > > no. NR_syscalls is not hardcoded by this patch. Its defined in terms of > __NR_syscall_max which is dynamically generated by the kernel build. > > > If my memory serves me well, unistd_64.h generates __NR_syscall_max > > automatically by being included multiples times. Can we generalize this > > and make the information generated available in an automaticaly > > generated header instead ? It is saved in ams-offsets.h currently as > > "__NR_syscall_max". We could also save it somewhere else meant to be > > included by C code. > > > > Mathieu > > > > The request was to define NR_syscalls in unistd.h, since that is the > historical Linux location for it. Adding another automatically generated > header does not accomplish that. Even if I include that new file in > unistd.h, I'm still going to have a circular dependency, and require a > solution similar to what I've proposed. > > thanks, > > -Jason Hmm, yeah that's not easy to deal with. May be, to lower a bit the hacky impact of this patch, __NR_syscall_max should be at least replaced by NR_syscall in every x86-64 uses (also in asm-offsets.h), to standardize this variable name. Also, may be we could have an empty asm-offsets.h stub in the very beginning that can be filled later so that we could include it unconditionnaly from unistd_64.h ? It would be nice to have the opinion of an x86 maintainer about what to do. ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 2/4] Add NR_syscalls for x86_64 2009-08-25 18:47 ` Jason Baron 2009-08-25 19:04 ` Mathieu Desnoyers @ 2009-08-26 2:25 ` Steven Rostedt 2009-08-26 13:58 ` Jason Baron 1 sibling, 1 reply; 26+ messages in thread From: Steven Rostedt @ 2009-08-26 2:25 UTC (permalink / raw) To: Jason Baron Cc: Frederic Weisbecker, linux-kernel, x86, lethal, mingo, laijs, peterz, mathieu.desnoyers, jiayingz, mbligh, lizf, jistone, tglx, hpa On Tue, 25 Aug 2009, Jason Baron wrote: > On Tue, Aug 25, 2009 at 09:40:05AM -0400, Jason Baron wrote: > > > > right, for x86_64, unistd.h is included to generate __NR_syscall_max > > which is then used for NR_syscalls. So I did initially try it there, but > > there were dependency problems. I'll see what I can come up with... > > > > thanks, > > > > -Jason > > ok, since unistd_64.h is used to generate offsets.c, which eventually > generates, asm/asm-offsets.h, which defines, __NR_syscall_max, we can't > just put #define of NR_syscalls in unistd_64.h. However, it seems the Why not? A define is not a problem until it is used. Is something in asm-offsets.c using NR_syscalls? > only point in time that unistd_64.h can not depend upon __NR_syscall_max, > is before asm/asm-offsets.h is defined. Thus, the patch below passes in > a '-DCREATE_OFFSETS' during the creation of asm/asm-offsets.h, so that > we do not include it before it exists. The patch is hacky but works. > thoughts? > > Signed-off-by: Jason Baron <jbaron@redhat.com> > > --- > > Kbuild | 2 +- > arch/x86/include/asm/unistd_64.h | 6 ++++++ > scripts/Makefile.build | 4 ++++ > 3 files changed, 11 insertions(+), 1 deletions(-) > > > diff --git a/Kbuild b/Kbuild > index f056b4f..5f43d4d 100644 > --- a/Kbuild > +++ b/Kbuild > @@ -78,7 +78,7 @@ endef > arch/$(SRCARCH)/kernel/asm-offsets.s: arch/$(SRCARCH)/kernel/asm-offsets.c \ > $(obj)/$(bounds-file) FORCE > $(Q)mkdir -p $(dir $@) > - $(call if_changed_dep,cc_s_c) > + $(call if_changed_dep,cc_s_c_define_offset) > > $(obj)/$(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s Kbuild > $(call cmd,offsets) > diff --git a/arch/x86/include/asm/unistd_64.h b/arch/x86/include/asm/unistd_64.h > index 900e161..70c0c3d 100644 > --- a/arch/x86/include/asm/unistd_64.h > +++ b/arch/x86/include/asm/unistd_64.h > @@ -688,6 +688,12 @@ __SYSCALL(__NR_perf_counter_open, sys_perf_counter_open) > #endif /* __NO_STUBS */ > > #ifdef __KERNEL__ > + > +#ifndef CREATE_OFFSETS > +#include <asm/asm-offsets.h> > +#define NR_syscalls (__NR_syscall_max + 1) > +#endif > + > /* > * "Conditional" syscalls > * > diff --git a/scripts/Makefile.build b/scripts/Makefile.build > index 5c4b7a4..4177858 100644 > --- a/scripts/Makefile.build > +++ b/scripts/Makefile.build > @@ -145,6 +145,10 @@ $(multi-objs-y:.o=.lst) : modname = $(modname-multi) > quiet_cmd_cc_s_c = CC $(quiet_modtag) $@ > cmd_cc_s_c = $(CC) $(c_flags) -fverbose-asm -S -o $@ $< > > +quiet_cmd_cc_s_c_define_offset = CC $(quiet_modtag) $@ > +cmd_cc_s_c_define_offset = $(CC) $(c_flags) -DCREATE_OFFSETS \ > + -fverbose-asm -S -o $@ $< > + > $(obj)/%.s: $(src)/%.c FORCE > $(call if_changed_dep,cc_s_c) Ug, yuck yuck yuck. Sometimes "it works" is not good enough ;-) How about just adding in asm/unistd.h #ifdef __KERNEL__ # ifdef CONFIG_X86_32 # include "unistd_32.h" # else # include "unistd_64.h" +# define NR_syscalls (__NR_syscall_max + 1) # endif #else # ifdef __i386__ # include "unistd_32.h" # else # include "unistd_64.h" # endif #endif And if this is a problem because asm-offset_64.c includes asm/unistd.h, then make it just include unistd_64.h. Or am I missing something? -- Steve ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 2/4] Add NR_syscalls for x86_64 2009-08-26 2:25 ` Steven Rostedt @ 2009-08-26 13:58 ` Jason Baron 2009-08-26 14:39 ` Steven Rostedt 0 siblings, 1 reply; 26+ messages in thread From: Jason Baron @ 2009-08-26 13:58 UTC (permalink / raw) To: Steven Rostedt Cc: Frederic Weisbecker, linux-kernel, x86, lethal, mingo, laijs, peterz, mathieu.desnoyers, jiayingz, mbligh, lizf, jistone, tglx, hpa On Tue, Aug 25, 2009 at 10:25:52PM -0400, Steven Rostedt wrote: > On Tue, 25 Aug 2009, Jason Baron wrote: > > > On Tue, Aug 25, 2009 at 09:40:05AM -0400, Jason Baron wrote: > > > > > > right, for x86_64, unistd.h is included to generate __NR_syscall_max > > > which is then used for NR_syscalls. So I did initially try it there, but > > > there were dependency problems. I'll see what I can come up with... > > > > > > thanks, > > > > > > -Jason > > > > ok, since unistd_64.h is used to generate offsets.c, which eventually > > generates, asm/asm-offsets.h, which defines, __NR_syscall_max, we can't > > just put #define of NR_syscalls in unistd_64.h. However, it seems the > > Why not? A define is not a problem until it is used. Is something in > asm-offsets.c using NR_syscalls? > > > only point in time that unistd_64.h can not depend upon __NR_syscall_max, > > is before asm/asm-offsets.h is defined. Thus, the patch below passes in > > a '-DCREATE_OFFSETS' during the creation of asm/asm-offsets.h, so that > > we do not include it before it exists. The patch is hacky but works. > > thoughts? > > > > Signed-off-by: Jason Baron <jbaron@redhat.com> > > > > --- > > > > Kbuild | 2 +- > > arch/x86/include/asm/unistd_64.h | 6 ++++++ > > scripts/Makefile.build | 4 ++++ > > 3 files changed, 11 insertions(+), 1 deletions(-) > > > > > > diff --git a/Kbuild b/Kbuild > > index f056b4f..5f43d4d 100644 > > --- a/Kbuild > > +++ b/Kbuild > > @@ -78,7 +78,7 @@ endef > > arch/$(SRCARCH)/kernel/asm-offsets.s: arch/$(SRCARCH)/kernel/asm-offsets.c \ > > $(obj)/$(bounds-file) FORCE > > $(Q)mkdir -p $(dir $@) > > - $(call if_changed_dep,cc_s_c) > > + $(call if_changed_dep,cc_s_c_define_offset) > > > > $(obj)/$(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s Kbuild > > $(call cmd,offsets) > > diff --git a/arch/x86/include/asm/unistd_64.h b/arch/x86/include/asm/unistd_64.h > > index 900e161..70c0c3d 100644 > > --- a/arch/x86/include/asm/unistd_64.h > > +++ b/arch/x86/include/asm/unistd_64.h > > @@ -688,6 +688,12 @@ __SYSCALL(__NR_perf_counter_open, sys_perf_counter_open) > > #endif /* __NO_STUBS */ > > > > #ifdef __KERNEL__ > > + > > +#ifndef CREATE_OFFSETS > > +#include <asm/asm-offsets.h> > > +#define NR_syscalls (__NR_syscall_max + 1) > > +#endif > > + > > /* > > * "Conditional" syscalls > > * > > diff --git a/scripts/Makefile.build b/scripts/Makefile.build > > index 5c4b7a4..4177858 100644 > > --- a/scripts/Makefile.build > > +++ b/scripts/Makefile.build > > @@ -145,6 +145,10 @@ $(multi-objs-y:.o=.lst) : modname = $(modname-multi) > > quiet_cmd_cc_s_c = CC $(quiet_modtag) $@ > > cmd_cc_s_c = $(CC) $(c_flags) -fverbose-asm -S -o $@ $< > > > > +quiet_cmd_cc_s_c_define_offset = CC $(quiet_modtag) $@ > > +cmd_cc_s_c_define_offset = $(CC) $(c_flags) -DCREATE_OFFSETS \ > > + -fverbose-asm -S -o $@ $< > > + > > $(obj)/%.s: $(src)/%.c FORCE > > $(call if_changed_dep,cc_s_c) > > > Ug, yuck yuck yuck. Sometimes "it works" is not good enough ;-) > > How about just adding in asm/unistd.h > > #ifdef __KERNEL__ > # ifdef CONFIG_X86_32 > # include "unistd_32.h" > # else > # include "unistd_64.h" > +# define NR_syscalls (__NR_syscall_max + 1) > # endif > #else > # ifdef __i386__ > # include "unistd_32.h" > # else > # include "unistd_64.h" > # endif > #endif > > And if this is a problem because asm-offset_64.c includes asm/unistd.h, > then make it just include unistd_64.h. > > Or am I missing something? > > -- Steve > > ok, so using the above patch gives me: CC arch/x86/kernel/ftrace.o arch/x86/kernel/ftrace.c: In function ‘syscall_nr_to_meta’: arch/x86/kernel/ftrace.c:497:35: error: ‘__NR_syscall_max’ undeclared (first use in this function) arch/x86/kernel/ftrace.c:497:35: error: (Each undeclared identifier is reported only once arch/x86/kernel/ftrace.c:497:35: error: for each function it appears in.) arch/x86/kernel/ftrace.c: In function ‘syscall_name_to_nr’: arch/x86/kernel/ftrace.c:510:19: error: ‘__NR_syscall_max’ undeclared (first use in this function) arch/x86/kernel/ftrace.c: In function ‘arch_init_ftrace_syscalls’: arch/x86/kernel/ftrace.c:536:7: error: ‘__NR_syscall_max’ undeclared (first use in this function) make[2]: *** [arch/x86/kernel/ftrace.o] Error 1 make[1]: *** [arch/x86/kernel] Error 2 make: *** [arch/x86] Error 2 That is the the first time, I encounter a 'NR_syscalls' usage, we error, b/c unistd.h does not include 'asm/asm-offsets.h'. If I add an #include of 'asm/asm-offsets.h' to ftrace.c the compile is fine. But the point of this was to the 'NR_syscalls' definition just from the unistd.h file... I'll see if I can come up with a simpler patch. thanks, -Jason ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 2/4] Add NR_syscalls for x86_64 2009-08-26 13:58 ` Jason Baron @ 2009-08-26 14:39 ` Steven Rostedt 2009-08-26 16:09 ` Jason Baron 0 siblings, 1 reply; 26+ messages in thread From: Steven Rostedt @ 2009-08-26 14:39 UTC (permalink / raw) To: Jason Baron Cc: Frederic Weisbecker, linux-kernel, x86, lethal, mingo, laijs, peterz, mathieu.desnoyers, jiayingz, mbligh, lizf, jistone, tglx, hpa On Wed, 26 Aug 2009, Jason Baron wrote: > > > diff --git a/Kbuild b/Kbuild > > > index f056b4f..5f43d4d 100644 > > > --- a/Kbuild > > > +++ b/Kbuild > > > @@ -78,7 +78,7 @@ endef > > > arch/$(SRCARCH)/kernel/asm-offsets.s: arch/$(SRCARCH)/kernel/asm-offsets.c \ > > > $(obj)/$(bounds-file) FORCE > > > $(Q)mkdir -p $(dir $@) > > > - $(call if_changed_dep,cc_s_c) > > > + $(call if_changed_dep,cc_s_c_define_offset) > > > > > > $(obj)/$(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s Kbuild > > > $(call cmd,offsets) > > > diff --git a/arch/x86/include/asm/unistd_64.h b/arch/x86/include/asm/unistd_64.h > > > index 900e161..70c0c3d 100644 > > > --- a/arch/x86/include/asm/unistd_64.h > > > +++ b/arch/x86/include/asm/unistd_64.h > > > @@ -688,6 +688,12 @@ __SYSCALL(__NR_perf_counter_open, sys_perf_counter_open) > > > #endif /* __NO_STUBS */ > > > > > > #ifdef __KERNEL__ > > > + > > > +#ifndef CREATE_OFFSETS > > > +#include <asm/asm-offsets.h> > > > +#define NR_syscalls (__NR_syscall_max + 1) > > > +#endif > > > + > > > /* > > > * "Conditional" syscalls > > > * > > > diff --git a/scripts/Makefile.build b/scripts/Makefile.build > > > index 5c4b7a4..4177858 100644 > > > --- a/scripts/Makefile.build > > > +++ b/scripts/Makefile.build > > > @@ -145,6 +145,10 @@ $(multi-objs-y:.o=.lst) : modname = $(modname-multi) > > > quiet_cmd_cc_s_c = CC $(quiet_modtag) $@ > > > cmd_cc_s_c = $(CC) $(c_flags) -fverbose-asm -S -o $@ $< > > > > > > +quiet_cmd_cc_s_c_define_offset = CC $(quiet_modtag) $@ > > > +cmd_cc_s_c_define_offset = $(CC) $(c_flags) -DCREATE_OFFSETS \ > > > + -fverbose-asm -S -o $@ $< > > > + > > > $(obj)/%.s: $(src)/%.c FORCE > > > $(call if_changed_dep,cc_s_c) > > > > > > Ug, yuck yuck yuck. Sometimes "it works" is not good enough ;-) > > > > How about just adding in asm/unistd.h > > > > #ifdef __KERNEL__ > > # ifdef CONFIG_X86_32 > > # include "unistd_32.h" > > # else > > # include "unistd_64.h" > > +# define NR_syscalls (__NR_syscall_max + 1) > > # endif > > #else > > # ifdef __i386__ > > # include "unistd_32.h" > > # else > > # include "unistd_64.h" > > # endif > > #endif > > > > And if this is a problem because asm-offset_64.c includes asm/unistd.h, > > then make it just include unistd_64.h. > > > > Or am I missing something? > > > > -- Steve > > > > > > ok, so using the above patch gives me: > > CC arch/x86/kernel/ftrace.o > arch/x86/kernel/ftrace.c: In function ?syscall_nr_to_meta?: > arch/x86/kernel/ftrace.c:497:35: error: ?__NR_syscall_max? undeclared > (first use in this function) > arch/x86/kernel/ftrace.c:497:35: error: (Each undeclared identifier is > reported only once > arch/x86/kernel/ftrace.c:497:35: error: for each function it appears > in.) > arch/x86/kernel/ftrace.c: In function ?syscall_name_to_nr?: > arch/x86/kernel/ftrace.c:510:19: error: ?__NR_syscall_max? undeclared > (first use in this function) > arch/x86/kernel/ftrace.c: In function ?arch_init_ftrace_syscalls?: > arch/x86/kernel/ftrace.c:536:7: error: ?__NR_syscall_max? undeclared > (first use in this function) > make[2]: *** [arch/x86/kernel/ftrace.o] Error 1 > make[1]: *** [arch/x86/kernel] Error 2 > make: *** [arch/x86] Error 2 > > > That is the the first time, I encounter a 'NR_syscalls' usage, we error, b/c > unistd.h does not include 'asm/asm-offsets.h'. If I add an #include of > 'asm/asm-offsets.h' to ftrace.c the compile is fine. But the point of > this was to the 'NR_syscalls' definition just from the unistd.h file... > I'll see if I can come up with a simpler patch. Then add the asm/asm-offests.h to the x86_64 define in unistd.h and have the asm-offset_64.c only include the unistd_64.h file. Would that work? -- Steve ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 2/4] Add NR_syscalls for x86_64 2009-08-26 14:39 ` Steven Rostedt @ 2009-08-26 16:09 ` Jason Baron 2009-08-26 16:21 ` Steven Rostedt ` (2 more replies) 0 siblings, 3 replies; 26+ messages in thread From: Jason Baron @ 2009-08-26 16:09 UTC (permalink / raw) To: Steven Rostedt Cc: Frederic Weisbecker, linux-kernel, x86, lethal, mingo, laijs, peterz, mathieu.desnoyers, jiayingz, mbligh, lizf, jistone, tglx, hpa On Wed, Aug 26, 2009 at 10:39:26AM -0400, Steven Rostedt wrote: > On Wed, 26 Aug 2009, Jason Baron wrote: > > > > diff --git a/Kbuild b/Kbuild > > > > index f056b4f..5f43d4d 100644 > > > > --- a/Kbuild > > > > +++ b/Kbuild > > > > @@ -78,7 +78,7 @@ endef > > > > arch/$(SRCARCH)/kernel/asm-offsets.s: arch/$(SRCARCH)/kernel/asm-offsets.c \ > > > > $(obj)/$(bounds-file) FORCE > > > > $(Q)mkdir -p $(dir $@) > > > > - $(call if_changed_dep,cc_s_c) > > > > + $(call if_changed_dep,cc_s_c_define_offset) > > > > > > > > $(obj)/$(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s Kbuild > > > > $(call cmd,offsets) > > > > diff --git a/arch/x86/include/asm/unistd_64.h b/arch/x86/include/asm/unistd_64.h > > > > index 900e161..70c0c3d 100644 > > > > --- a/arch/x86/include/asm/unistd_64.h > > > > +++ b/arch/x86/include/asm/unistd_64.h > > > > @@ -688,6 +688,12 @@ __SYSCALL(__NR_perf_counter_open, sys_perf_counter_open) > > > > #endif /* __NO_STUBS */ > > > > > > > > #ifdef __KERNEL__ > > > > + > > > > +#ifndef CREATE_OFFSETS > > > > +#include <asm/asm-offsets.h> > > > > +#define NR_syscalls (__NR_syscall_max + 1) > > > > +#endif > > > > + > > > > /* > > > > * "Conditional" syscalls > > > > * > > > > diff --git a/scripts/Makefile.build b/scripts/Makefile.build > > > > index 5c4b7a4..4177858 100644 > > > > --- a/scripts/Makefile.build > > > > +++ b/scripts/Makefile.build > > > > @@ -145,6 +145,10 @@ $(multi-objs-y:.o=.lst) : modname = $(modname-multi) > > > > quiet_cmd_cc_s_c = CC $(quiet_modtag) $@ > > > > cmd_cc_s_c = $(CC) $(c_flags) -fverbose-asm -S -o $@ $< > > > > > > > > +quiet_cmd_cc_s_c_define_offset = CC $(quiet_modtag) $@ > > > > +cmd_cc_s_c_define_offset = $(CC) $(c_flags) -DCREATE_OFFSETS \ > > > > + -fverbose-asm -S -o $@ $< > > > > + > > > > $(obj)/%.s: $(src)/%.c FORCE > > > > $(call if_changed_dep,cc_s_c) > > > > > > > > > Ug, yuck yuck yuck. Sometimes "it works" is not good enough ;-) > > > > > > How about just adding in asm/unistd.h > > > > > > #ifdef __KERNEL__ > > > # ifdef CONFIG_X86_32 > > > # include "unistd_32.h" > > > # else > > > # include "unistd_64.h" > > > +# define NR_syscalls (__NR_syscall_max + 1) > > > # endif > > > #else > > > # ifdef __i386__ > > > # include "unistd_32.h" > > > # else > > > # include "unistd_64.h" > > > # endif > > > #endif > > > > > > And if this is a problem because asm-offset_64.c includes asm/unistd.h, > > > then make it just include unistd_64.h. > > > > > > Or am I missing something? > > > > > > -- Steve > > > > > > > > > > ok, so using the above patch gives me: > > > > CC arch/x86/kernel/ftrace.o > > arch/x86/kernel/ftrace.c: In function ?syscall_nr_to_meta?: > > arch/x86/kernel/ftrace.c:497:35: error: ?__NR_syscall_max? undeclared > > (first use in this function) > > arch/x86/kernel/ftrace.c:497:35: error: (Each undeclared identifier is > > reported only once > > arch/x86/kernel/ftrace.c:497:35: error: for each function it appears > > in.) > > arch/x86/kernel/ftrace.c: In function ?syscall_name_to_nr?: > > arch/x86/kernel/ftrace.c:510:19: error: ?__NR_syscall_max? undeclared > > (first use in this function) > > arch/x86/kernel/ftrace.c: In function ?arch_init_ftrace_syscalls?: > > arch/x86/kernel/ftrace.c:536:7: error: ?__NR_syscall_max? undeclared > > (first use in this function) > > make[2]: *** [arch/x86/kernel/ftrace.o] Error 1 > > make[1]: *** [arch/x86/kernel] Error 2 > > make: *** [arch/x86] Error 2 > > > > > > That is the the first time, I encounter a 'NR_syscalls' usage, we error, b/c > > unistd.h does not include 'asm/asm-offsets.h'. If I add an #include of > > 'asm/asm-offsets.h' to ftrace.c the compile is fine. But the point of > > this was to the 'NR_syscalls' definition just from the unistd.h file... > > I'll see if I can come up with a simpler patch. > > Then add the asm/asm-offests.h to the x86_64 define in unistd.h and have > the asm-offset_64.c only include the unistd_64.h file. Would that work? > > -- Steve > doesn't quite work, b/c the top of asm-offsets_64.c has a bunch of includes, such as: <linux/sched.h>, which in turn include unistd.h at a point in time where asm/asm-offests.h does not exist. However, a much simpler version of the previous patch I posted does do the trick, below. I hope this version is more palatable? thanks, -Jason Signed-off-by: Jason Baron <jbaron@redhat.com> diff --git a/arch/x86/include/asm/unistd_64.h b/arch/x86/include/asm/unistd_64.h index 900e161..b9f3c60 100644 --- a/arch/x86/include/asm/unistd_64.h +++ b/arch/x86/include/asm/unistd_64.h @@ -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 * diff --git a/arch/x86/kernel/asm-offsets_64.c b/arch/x86/kernel/asm-offsets_64.c index 898ecc4..4a6aeed 100644 --- a/arch/x86/kernel/asm-offsets_64.c +++ b/arch/x86/kernel/asm-offsets_64.c @@ -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> ^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH 2/4] Add NR_syscalls for x86_64 2009-08-26 16:09 ` Jason Baron @ 2009-08-26 16:21 ` Steven Rostedt 2009-08-26 16:29 ` Frederic Weisbecker 2009-08-26 16:24 ` Frederic Weisbecker 2009-08-28 12:28 ` [tip:tracing/core] tracing: Define " tip-bot for Jason Baron 2 siblings, 1 reply; 26+ messages in thread From: Steven Rostedt @ 2009-08-26 16:21 UTC (permalink / raw) To: Jason Baron Cc: Frederic Weisbecker, linux-kernel, x86, lethal, mingo, laijs, peterz, mathieu.desnoyers, jiayingz, mbligh, lizf, jistone, tglx, hpa On Wed, 26 Aug 2009, Jason Baron wrote: > On Wed, Aug 26, 2009 at 10:39:26AM -0400, Steven Rostedt wrote: > > On Wed, 26 Aug 2009, Jason Baron wrote: > > > > > diff --git a/Kbuild b/Kbuild > > > > > index f056b4f..5f43d4d 100644 > > > > > --- a/Kbuild > > > > > +++ b/Kbuild > > > > > @@ -78,7 +78,7 @@ endef > > > > > arch/$(SRCARCH)/kernel/asm-offsets.s: arch/$(SRCARCH)/kernel/asm-offsets.c \ > > > > > $(obj)/$(bounds-file) FORCE > > > > > $(Q)mkdir -p $(dir $@) > > > > > - $(call if_changed_dep,cc_s_c) > > > > > + $(call if_changed_dep,cc_s_c_define_offset) > > > > > > > > > > $(obj)/$(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s Kbuild > > > > > $(call cmd,offsets) > > > > > diff --git a/arch/x86/include/asm/unistd_64.h b/arch/x86/include/asm/unistd_64.h > > > > > index 900e161..70c0c3d 100644 > > > > > --- a/arch/x86/include/asm/unistd_64.h > > > > > +++ b/arch/x86/include/asm/unistd_64.h > > > > > @@ -688,6 +688,12 @@ __SYSCALL(__NR_perf_counter_open, sys_perf_counter_open) > > > > > #endif /* __NO_STUBS */ > > > > > > > > > > #ifdef __KERNEL__ > > > > > + > > > > > +#ifndef CREATE_OFFSETS > > > > > +#include <asm/asm-offsets.h> > > > > > +#define NR_syscalls (__NR_syscall_max + 1) > > > > > +#endif > > > > > + > > > > > /* > > > > > * "Conditional" syscalls > > > > > * > > > > > diff --git a/scripts/Makefile.build b/scripts/Makefile.build > > > > > index 5c4b7a4..4177858 100644 > > > > > --- a/scripts/Makefile.build > > > > > +++ b/scripts/Makefile.build > > > > > @@ -145,6 +145,10 @@ $(multi-objs-y:.o=.lst) : modname = $(modname-multi) > > > > > quiet_cmd_cc_s_c = CC $(quiet_modtag) $@ > > > > > cmd_cc_s_c = $(CC) $(c_flags) -fverbose-asm -S -o $@ $< > > > > > > > > > > +quiet_cmd_cc_s_c_define_offset = CC $(quiet_modtag) $@ > > > > > +cmd_cc_s_c_define_offset = $(CC) $(c_flags) -DCREATE_OFFSETS \ > > > > > + -fverbose-asm -S -o $@ $< > > > > > + > > > > > $(obj)/%.s: $(src)/%.c FORCE > > > > > $(call if_changed_dep,cc_s_c) > > > > > > > > > > > > Ug, yuck yuck yuck. Sometimes "it works" is not good enough ;-) > > > > > > > > How about just adding in asm/unistd.h > > > > > > > > #ifdef __KERNEL__ > > > > # ifdef CONFIG_X86_32 > > > > # include "unistd_32.h" > > > > # else > > > > # include "unistd_64.h" > > > > +# define NR_syscalls (__NR_syscall_max + 1) > > > > # endif > > > > #else > > > > # ifdef __i386__ > > > > # include "unistd_32.h" > > > > # else > > > > # include "unistd_64.h" > > > > # endif > > > > #endif > > > > > > > > And if this is a problem because asm-offset_64.c includes asm/unistd.h, > > > > then make it just include unistd_64.h. > > > > > > > > Or am I missing something? > > > > > > > > -- Steve > > > > > > > > > > > > > > ok, so using the above patch gives me: > > > > > > CC arch/x86/kernel/ftrace.o > > > arch/x86/kernel/ftrace.c: In function ?syscall_nr_to_meta?: > > > arch/x86/kernel/ftrace.c:497:35: error: ?__NR_syscall_max? undeclared > > > (first use in this function) > > > arch/x86/kernel/ftrace.c:497:35: error: (Each undeclared identifier is > > > reported only once > > > arch/x86/kernel/ftrace.c:497:35: error: for each function it appears > > > in.) > > > arch/x86/kernel/ftrace.c: In function ?syscall_name_to_nr?: > > > arch/x86/kernel/ftrace.c:510:19: error: ?__NR_syscall_max? undeclared > > > (first use in this function) > > > arch/x86/kernel/ftrace.c: In function ?arch_init_ftrace_syscalls?: > > > arch/x86/kernel/ftrace.c:536:7: error: ?__NR_syscall_max? undeclared > > > (first use in this function) > > > make[2]: *** [arch/x86/kernel/ftrace.o] Error 1 > > > make[1]: *** [arch/x86/kernel] Error 2 > > > make: *** [arch/x86] Error 2 > > > > > > > > > That is the the first time, I encounter a 'NR_syscalls' usage, we error, b/c > > > unistd.h does not include 'asm/asm-offsets.h'. If I add an #include of > > > 'asm/asm-offsets.h' to ftrace.c the compile is fine. But the point of > > > this was to the 'NR_syscalls' definition just from the unistd.h file... > > > I'll see if I can come up with a simpler patch. > > > > Then add the asm/asm-offests.h to the x86_64 define in unistd.h and have > > the asm-offset_64.c only include the unistd_64.h file. Would that work? > > > > -- Steve > > > > doesn't quite work, b/c the top of asm-offsets_64.c has a bunch of > includes, such as: <linux/sched.h>, which in turn include unistd.h at > a point in time where asm/asm-offests.h does not exist. > > However, a much simpler version of the previous patch I posted does do > the trick, below. I hope this version is more palatable? > > thanks, > > -Jason > > Signed-off-by: Jason Baron <jbaron@redhat.com> > > diff --git a/arch/x86/include/asm/unistd_64.h b/arch/x86/include/asm/unistd_64.h > index 900e161..b9f3c60 100644 > --- a/arch/x86/include/asm/unistd_64.h > +++ b/arch/x86/include/asm/unistd_64.h > @@ -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 > * > diff --git a/arch/x86/kernel/asm-offsets_64.c b/arch/x86/kernel/asm-offsets_64.c > index 898ecc4..4a6aeed 100644 > --- a/arch/x86/kernel/asm-offsets_64.c > +++ b/arch/x86/kernel/asm-offsets_64.c > @@ -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> This is MUCH more acceptable. Acked-by: Steven Rostedt <rostedt@goodmis.org> Thanks! -- Steve ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 2/4] Add NR_syscalls for x86_64 2009-08-26 16:21 ` Steven Rostedt @ 2009-08-26 16:29 ` Frederic Weisbecker 0 siblings, 0 replies; 26+ messages in thread From: Frederic Weisbecker @ 2009-08-26 16:29 UTC (permalink / raw) To: Steven Rostedt Cc: Jason Baron, linux-kernel, x86, lethal, mingo, laijs, peterz, mathieu.desnoyers, jiayingz, mbligh, lizf, jistone, tglx, hpa On Wed, Aug 26, 2009 at 12:21:36PM -0400, Steven Rostedt wrote: > > On Wed, 26 Aug 2009, Jason Baron wrote: > > > On Wed, Aug 26, 2009 at 10:39:26AM -0400, Steven Rostedt wrote: > > > On Wed, 26 Aug 2009, Jason Baron wrote: > > > > > > diff --git a/Kbuild b/Kbuild > > > > > > index f056b4f..5f43d4d 100644 > > > > > > --- a/Kbuild > > > > > > +++ b/Kbuild > > > > > > @@ -78,7 +78,7 @@ endef > > > > > > arch/$(SRCARCH)/kernel/asm-offsets.s: arch/$(SRCARCH)/kernel/asm-offsets.c \ > > > > > > $(obj)/$(bounds-file) FORCE > > > > > > $(Q)mkdir -p $(dir $@) > > > > > > - $(call if_changed_dep,cc_s_c) > > > > > > + $(call if_changed_dep,cc_s_c_define_offset) > > > > > > > > > > > > $(obj)/$(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s Kbuild > > > > > > $(call cmd,offsets) > > > > > > diff --git a/arch/x86/include/asm/unistd_64.h b/arch/x86/include/asm/unistd_64.h > > > > > > index 900e161..70c0c3d 100644 > > > > > > --- a/arch/x86/include/asm/unistd_64.h > > > > > > +++ b/arch/x86/include/asm/unistd_64.h > > > > > > @@ -688,6 +688,12 @@ __SYSCALL(__NR_perf_counter_open, sys_perf_counter_open) > > > > > > #endif /* __NO_STUBS */ > > > > > > > > > > > > #ifdef __KERNEL__ > > > > > > + > > > > > > +#ifndef CREATE_OFFSETS > > > > > > +#include <asm/asm-offsets.h> > > > > > > +#define NR_syscalls (__NR_syscall_max + 1) > > > > > > +#endif > > > > > > + > > > > > > /* > > > > > > * "Conditional" syscalls > > > > > > * > > > > > > diff --git a/scripts/Makefile.build b/scripts/Makefile.build > > > > > > index 5c4b7a4..4177858 100644 > > > > > > --- a/scripts/Makefile.build > > > > > > +++ b/scripts/Makefile.build > > > > > > @@ -145,6 +145,10 @@ $(multi-objs-y:.o=.lst) : modname = $(modname-multi) > > > > > > quiet_cmd_cc_s_c = CC $(quiet_modtag) $@ > > > > > > cmd_cc_s_c = $(CC) $(c_flags) -fverbose-asm -S -o $@ $< > > > > > > > > > > > > +quiet_cmd_cc_s_c_define_offset = CC $(quiet_modtag) $@ > > > > > > +cmd_cc_s_c_define_offset = $(CC) $(c_flags) -DCREATE_OFFSETS \ > > > > > > + -fverbose-asm -S -o $@ $< > > > > > > + > > > > > > $(obj)/%.s: $(src)/%.c FORCE > > > > > > $(call if_changed_dep,cc_s_c) > > > > > > > > > > > > > > > Ug, yuck yuck yuck. Sometimes "it works" is not good enough ;-) > > > > > > > > > > How about just adding in asm/unistd.h > > > > > > > > > > #ifdef __KERNEL__ > > > > > # ifdef CONFIG_X86_32 > > > > > # include "unistd_32.h" > > > > > # else > > > > > # include "unistd_64.h" > > > > > +# define NR_syscalls (__NR_syscall_max + 1) > > > > > # endif > > > > > #else > > > > > # ifdef __i386__ > > > > > # include "unistd_32.h" > > > > > # else > > > > > # include "unistd_64.h" > > > > > # endif > > > > > #endif > > > > > > > > > > And if this is a problem because asm-offset_64.c includes asm/unistd.h, > > > > > then make it just include unistd_64.h. > > > > > > > > > > Or am I missing something? > > > > > > > > > > -- Steve > > > > > > > > > > > > > > > > > > ok, so using the above patch gives me: > > > > > > > > CC arch/x86/kernel/ftrace.o > > > > arch/x86/kernel/ftrace.c: In function ?syscall_nr_to_meta?: > > > > arch/x86/kernel/ftrace.c:497:35: error: ?__NR_syscall_max? undeclared > > > > (first use in this function) > > > > arch/x86/kernel/ftrace.c:497:35: error: (Each undeclared identifier is > > > > reported only once > > > > arch/x86/kernel/ftrace.c:497:35: error: for each function it appears > > > > in.) > > > > arch/x86/kernel/ftrace.c: In function ?syscall_name_to_nr?: > > > > arch/x86/kernel/ftrace.c:510:19: error: ?__NR_syscall_max? undeclared > > > > (first use in this function) > > > > arch/x86/kernel/ftrace.c: In function ?arch_init_ftrace_syscalls?: > > > > arch/x86/kernel/ftrace.c:536:7: error: ?__NR_syscall_max? undeclared > > > > (first use in this function) > > > > make[2]: *** [arch/x86/kernel/ftrace.o] Error 1 > > > > make[1]: *** [arch/x86/kernel] Error 2 > > > > make: *** [arch/x86] Error 2 > > > > > > > > > > > > That is the the first time, I encounter a 'NR_syscalls' usage, we error, b/c > > > > unistd.h does not include 'asm/asm-offsets.h'. If I add an #include of > > > > 'asm/asm-offsets.h' to ftrace.c the compile is fine. But the point of > > > > this was to the 'NR_syscalls' definition just from the unistd.h file... > > > > I'll see if I can come up with a simpler patch. > > > > > > Then add the asm/asm-offests.h to the x86_64 define in unistd.h and have > > > the asm-offset_64.c only include the unistd_64.h file. Would that work? > > > > > > -- Steve > > > > > > > doesn't quite work, b/c the top of asm-offsets_64.c has a bunch of > > includes, such as: <linux/sched.h>, which in turn include unistd.h at > > a point in time where asm/asm-offests.h does not exist. > > > > However, a much simpler version of the previous patch I posted does do > > the trick, below. I hope this version is more palatable? > > > > thanks, > > > > -Jason > > > > Signed-off-by: Jason Baron <jbaron@redhat.com> > > > > diff --git a/arch/x86/include/asm/unistd_64.h b/arch/x86/include/asm/unistd_64.h > > index 900e161..b9f3c60 100644 > > --- a/arch/x86/include/asm/unistd_64.h > > +++ b/arch/x86/include/asm/unistd_64.h > > @@ -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 > > * > > diff --git a/arch/x86/kernel/asm-offsets_64.c b/arch/x86/kernel/asm-offsets_64.c > > index 898ecc4..4a6aeed 100644 > > --- a/arch/x86/kernel/asm-offsets_64.c > > +++ b/arch/x86/kernel/asm-offsets_64.c > > @@ -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> > > This is MUCH more acceptable. > > Acked-by: Steven Rostedt <rostedt@goodmis.org> Great, I'm applying the whole series then, Thanks! > Thanks! > > -- Steve > ^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 2/4] Add NR_syscalls for x86_64 2009-08-26 16:09 ` Jason Baron 2009-08-26 16:21 ` Steven Rostedt @ 2009-08-26 16:24 ` Frederic Weisbecker 2009-08-28 12:28 ` [tip:tracing/core] tracing: Define " tip-bot for Jason Baron 2 siblings, 0 replies; 26+ messages in thread From: Frederic Weisbecker @ 2009-08-26 16:24 UTC (permalink / raw) To: Jason Baron Cc: Steven Rostedt, linux-kernel, x86, lethal, mingo, laijs, peterz, mathieu.desnoyers, jiayingz, mbligh, lizf, jistone, tglx, hpa On Wed, Aug 26, 2009 at 12:09:10PM -0400, Jason Baron wrote: > doesn't quite work, b/c the top of asm-offsets_64.c has a bunch of > includes, such as: <linux/sched.h>, which in turn include unistd.h at > a point in time where asm/asm-offests.h does not exist. > > However, a much simpler version of the previous patch I posted does do > the trick, below. I hope this version is more palatable? > > thanks, > > -Jason > > Signed-off-by: Jason Baron <jbaron@redhat.com> Ah yeah, looks good! > > diff --git a/arch/x86/include/asm/unistd_64.h b/arch/x86/include/asm/unistd_64.h > index 900e161..b9f3c60 100644 > --- a/arch/x86/include/asm/unistd_64.h > +++ b/arch/x86/include/asm/unistd_64.h > @@ -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 > * > diff --git a/arch/x86/kernel/asm-offsets_64.c b/arch/x86/kernel/asm-offsets_64.c > index 898ecc4..4a6aeed 100644 > --- a/arch/x86/kernel/asm-offsets_64.c > +++ b/arch/x86/kernel/asm-offsets_64.c > @@ -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> ^ permalink raw reply [flat|nested] 26+ messages in thread
* [tip:tracing/core] tracing: Define NR_syscalls for x86_64 2009-08-26 16:09 ` Jason Baron 2009-08-26 16:21 ` Steven Rostedt 2009-08-26 16:24 ` Frederic Weisbecker @ 2009-08-28 12:28 ` tip-bot for Jason Baron 2 siblings, 0 replies; 26+ messages in thread From: tip-bot for Jason Baron @ 2009-08-28 12:28 UTC (permalink / raw) To: linux-tip-commits Cc: brueckner, mathieu.desnoyers, mingo, peterz, fweisbec, rostedt, heiko.carstens, tglx, jbaron, laijs, linux-kernel, hpa, jiayingz, lizf, lethal, jistone, mingo, mbligh Commit-ID: a5a2f8e2acb991327952c45a13f5441fc09dffd6 Gitweb: http://git.kernel.org/tip/a5a2f8e2acb991327952c45a13f5441fc09dffd6 Author: Jason Baron <jbaron@redhat.com> AuthorDate: Wed, 26 Aug 2009 12:09:10 -0400 Committer: Frederic Weisbecker <fweisbec@gmail.com> CommitDate: Wed, 26 Aug 2009 21:29:58 +0200 tracing: Define NR_syscalls for x86_64 Express the available number of syscalls in a standard way by defining NR_syscalls. The common way to define it is to place its definition in asm/unistd.h However, the number of syscalls is defined using __NR_syscall_max in x86-64 after building a dynamic header file "asm-offsets.h" The source file that generates this header, asm-offsets-64.c includes unistd.h, then if we want to express NR_syscalls from __NR_syscall_max in unistd.h only after generating the dynamic header file, we need a watchguard. If unistd.h is included from asm-offsets-64.c, then we are generating asm-offset.h which defines __NR_syscall_max. At this time, we don't want to (we can't) define NR_syscalls, then we do nothing. Otherwise we define NR_syscalls because we know asm-offsets.h has been generated. Signed-off-by: Jason Baron <jbaron@redhat.com> Acked-by: Steven Rostedt <rostedt@goodmis.org> Cc: Paul Mundt <lethal@linux-sh.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Lai Jiangshan <laijs@cn.fujitsu.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> Cc: Jiaying Zhang <jiayingz@google.com> Cc: Martin Bligh <mbligh@google.com> Cc: Li Zefan <lizf@cn.fujitsu.com> Cc: Josh Stone <jistone@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: H. Peter Anwin <hpa@zytor.com> Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> LKML-Reference: <20090826160910.GB2658@redhat.com> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> --- arch/x86/include/asm/unistd_64.h | 6 ++++++ arch/x86/kernel/asm-offsets_64.c | 1 + 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/arch/x86/include/asm/unistd_64.h b/arch/x86/include/asm/unistd_64.h index 900e161..b9f3c60 100644 --- a/arch/x86/include/asm/unistd_64.h +++ b/arch/x86/include/asm/unistd_64.h @@ -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 * diff --git a/arch/x86/kernel/asm-offsets_64.c b/arch/x86/kernel/asm-offsets_64.c index 898ecc4..4a6aeed 100644 --- a/arch/x86/kernel/asm-offsets_64.c +++ b/arch/x86/kernel/asm-offsets_64.c @@ -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> ^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 3/4] Convert event tracing code to NR_syscalls 2009-08-24 21:40 [PATCH 0/4] use NR_syscalls instead of FTRACE_SYSCALL_MAX Jason Baron 2009-08-24 21:40 ` [PATCH 1/4] add NR_syscalls define for x86 Jason Baron 2009-08-24 21:40 ` [PATCH 2/4] Add NR_syscalls for x86_64 Jason Baron @ 2009-08-24 21:40 ` Jason Baron 2009-08-28 12:28 ` [tip:tracing/core] tracing: Convert event tracing code to use NR_syscalls tip-bot for Jason Baron 2009-08-24 21:40 ` [PATCH 4/4] remove FTRACE_SYSCALL_MAX definitions Jason Baron 3 siblings, 1 reply; 26+ messages in thread From: Jason Baron @ 2009-08-24 21:40 UTC (permalink / raw) To: linux-kernel, x86 Cc: lethal, fweisbec, mingo, laijs, rostedt, peterz, mathieu.desnoyers, jiayingz, mbligh, lizf, jistone, tglx, hpa Convert the syscalls event tracing code to use NR_syscalls, instead of FTRACE_SYSCALL_MAX. NR_syscalls is standard accross most arches, and reduces code confustion/complexity. Signed-off-by: Jason Baron <jbaron@redhat.com> --- arch/x86/kernel/ftrace.c | 8 ++++---- kernel/trace/trace_syscalls.c | 24 ++++++++++++------------ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c index 3cff121..9dbb527 100644 --- a/arch/x86/kernel/ftrace.c +++ b/arch/x86/kernel/ftrace.c @@ -494,7 +494,7 @@ static struct syscall_metadata *find_syscall_meta(unsigned long *syscall) struct syscall_metadata *syscall_nr_to_meta(int nr) { - if (!syscalls_metadata || nr >= FTRACE_SYSCALL_MAX || nr < 0) + if (!syscalls_metadata || nr >= NR_syscalls || nr < 0) return NULL; return syscalls_metadata[nr]; @@ -507,7 +507,7 @@ int syscall_name_to_nr(char *name) if (!syscalls_metadata) return -1; - for (i = 0; i < FTRACE_SYSCALL_MAX; i++) { + for (i = 0; i < NR_syscalls; i++) { if (syscalls_metadata[i]) { if (!strcmp(syscalls_metadata[i]->name, name)) return i; @@ -533,13 +533,13 @@ static int __init arch_init_ftrace_syscalls(void) unsigned long **psys_syscall_table = &sys_call_table; syscalls_metadata = kzalloc(sizeof(*syscalls_metadata) * - FTRACE_SYSCALL_MAX, GFP_KERNEL); + NR_syscalls, GFP_KERNEL); if (!syscalls_metadata) { WARN_ON(1); return -ENOMEM; } - for (i = 0; i < FTRACE_SYSCALL_MAX; i++) { + for (i = 0; i < NR_syscalls; i++) { meta = find_syscall_meta(psys_syscall_table[i]); syscalls_metadata[i] = meta; } diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c index 46c1b97..f23cd7d 100644 --- a/kernel/trace/trace_syscalls.c +++ b/kernel/trace/trace_syscalls.c @@ -10,8 +10,8 @@ static DEFINE_MUTEX(syscall_trace_lock); static int sys_refcount_enter; static int sys_refcount_exit; -static DECLARE_BITMAP(enabled_enter_syscalls, FTRACE_SYSCALL_MAX); -static DECLARE_BITMAP(enabled_exit_syscalls, FTRACE_SYSCALL_MAX); +static DECLARE_BITMAP(enabled_enter_syscalls, NR_syscalls); +static DECLARE_BITMAP(enabled_exit_syscalls, NR_syscalls); enum print_line_t print_syscall_enter(struct trace_iterator *iter, int flags) @@ -282,7 +282,7 @@ int reg_event_syscall_enter(void *ptr) name = (char *)ptr; num = syscall_name_to_nr(name); - if (num < 0 || num >= FTRACE_SYSCALL_MAX) + if (num < 0 || num >= NR_syscalls) return -ENOSYS; mutex_lock(&syscall_trace_lock); if (!sys_refcount_enter) @@ -305,7 +305,7 @@ void unreg_event_syscall_enter(void *ptr) name = (char *)ptr; num = syscall_name_to_nr(name); - if (num < 0 || num >= FTRACE_SYSCALL_MAX) + if (num < 0 || num >= NR_syscalls) return; mutex_lock(&syscall_trace_lock); sys_refcount_enter--; @@ -323,7 +323,7 @@ int reg_event_syscall_exit(void *ptr) name = (char *)ptr; num = syscall_name_to_nr(name); - if (num < 0 || num >= FTRACE_SYSCALL_MAX) + if (num < 0 || num >= NR_syscalls) return -ENOSYS; mutex_lock(&syscall_trace_lock); if (!sys_refcount_exit) @@ -346,7 +346,7 @@ void unreg_event_syscall_exit(void *ptr) name = (char *)ptr; num = syscall_name_to_nr(name); - if (num < 0 || num >= FTRACE_SYSCALL_MAX) + if (num < 0 || num >= NR_syscalls) return; mutex_lock(&syscall_trace_lock); sys_refcount_exit--; @@ -366,8 +366,8 @@ struct trace_event event_syscall_exit = { #ifdef CONFIG_EVENT_PROFILE -static DECLARE_BITMAP(enabled_prof_enter_syscalls, FTRACE_SYSCALL_MAX); -static DECLARE_BITMAP(enabled_prof_exit_syscalls, FTRACE_SYSCALL_MAX); +static DECLARE_BITMAP(enabled_prof_enter_syscalls, NR_syscalls); +static DECLARE_BITMAP(enabled_prof_exit_syscalls, NR_syscalls); static int sys_prof_refcount_enter; static int sys_prof_refcount_exit; @@ -413,7 +413,7 @@ int reg_prof_syscall_enter(char *name) int num; num = syscall_name_to_nr(name); - if (num < 0 || num >= FTRACE_SYSCALL_MAX) + if (num < 0 || num >= NR_syscalls) return -ENOSYS; mutex_lock(&syscall_trace_lock); @@ -435,7 +435,7 @@ void unreg_prof_syscall_enter(char *name) int num; num = syscall_name_to_nr(name); - if (num < 0 || num >= FTRACE_SYSCALL_MAX) + if (num < 0 || num >= NR_syscalls) return; mutex_lock(&syscall_trace_lock); @@ -474,7 +474,7 @@ int reg_prof_syscall_exit(char *name) int num; num = syscall_name_to_nr(name); - if (num < 0 || num >= FTRACE_SYSCALL_MAX) + if (num < 0 || num >= NR_syscalls) return -ENOSYS; mutex_lock(&syscall_trace_lock); @@ -496,7 +496,7 @@ void unreg_prof_syscall_exit(char *name) int num; num = syscall_name_to_nr(name); - if (num < 0 || num >= FTRACE_SYSCALL_MAX) + if (num < 0 || num >= NR_syscalls) return; mutex_lock(&syscall_trace_lock); -- 1.6.2.5 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* [tip:tracing/core] tracing: Convert event tracing code to use NR_syscalls 2009-08-24 21:40 ` [PATCH 3/4] Convert event tracing code to NR_syscalls Jason Baron @ 2009-08-28 12:28 ` tip-bot for Jason Baron 0 siblings, 0 replies; 26+ messages in thread From: tip-bot for Jason Baron @ 2009-08-28 12:28 UTC (permalink / raw) To: linux-tip-commits Cc: brueckner, mathieu.desnoyers, mingo, peterz, fweisbec, rostedt, heiko.carstens, tglx, jbaron, laijs, linux-kernel, hpa, jiayingz, lizf, lethal, jistone, mingo, mbligh Commit-ID: 57421dbbdc932d65f0e6a41ebb027a2bfe3d0669 Gitweb: http://git.kernel.org/tip/57421dbbdc932d65f0e6a41ebb027a2bfe3d0669 Author: Jason Baron <jbaron@redhat.com> AuthorDate: Mon, 24 Aug 2009 17:40:22 -0400 Committer: Frederic Weisbecker <fweisbec@gmail.com> CommitDate: Wed, 26 Aug 2009 21:30:02 +0200 tracing: Convert event tracing code to use NR_syscalls Convert the syscalls event tracing code to use NR_syscalls, instead of FTRACE_SYSCALL_MAX. NR_syscalls is standard accross most arches, and reduces code confusion/complexity. Signed-off-by: Jason Baron <jbaron@redhat.com> Cc: Paul Mundt <lethal@linux-sh.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Lai Jiangshan <laijs@cn.fujitsu.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> Cc: Jiaying Zhang <jiayingz@google.com> Cc: Martin Bligh <mbligh@google.com> Cc: Li Zefan <lizf@cn.fujitsu.com> Cc: Josh Stone <jistone@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: H. Peter Anwin <hpa@zytor.com> Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> LKML-Reference: <9b4f1a84ecae57cc6599412772efa36f0d2b815b.1251146513.git.jbaron@redhat.com> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> --- arch/x86/kernel/ftrace.c | 8 ++++---- kernel/trace/trace_syscalls.c | 24 ++++++++++++------------ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c index 3cff121..9dbb527 100644 --- a/arch/x86/kernel/ftrace.c +++ b/arch/x86/kernel/ftrace.c @@ -494,7 +494,7 @@ static struct syscall_metadata *find_syscall_meta(unsigned long *syscall) struct syscall_metadata *syscall_nr_to_meta(int nr) { - if (!syscalls_metadata || nr >= FTRACE_SYSCALL_MAX || nr < 0) + if (!syscalls_metadata || nr >= NR_syscalls || nr < 0) return NULL; return syscalls_metadata[nr]; @@ -507,7 +507,7 @@ int syscall_name_to_nr(char *name) if (!syscalls_metadata) return -1; - for (i = 0; i < FTRACE_SYSCALL_MAX; i++) { + for (i = 0; i < NR_syscalls; i++) { if (syscalls_metadata[i]) { if (!strcmp(syscalls_metadata[i]->name, name)) return i; @@ -533,13 +533,13 @@ static int __init arch_init_ftrace_syscalls(void) unsigned long **psys_syscall_table = &sys_call_table; syscalls_metadata = kzalloc(sizeof(*syscalls_metadata) * - FTRACE_SYSCALL_MAX, GFP_KERNEL); + NR_syscalls, GFP_KERNEL); if (!syscalls_metadata) { WARN_ON(1); return -ENOMEM; } - for (i = 0; i < FTRACE_SYSCALL_MAX; i++) { + for (i = 0; i < NR_syscalls; i++) { meta = find_syscall_meta(psys_syscall_table[i]); syscalls_metadata[i] = meta; } diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c index cb7f600..4f5fae6 100644 --- a/kernel/trace/trace_syscalls.c +++ b/kernel/trace/trace_syscalls.c @@ -11,8 +11,8 @@ static DEFINE_MUTEX(syscall_trace_lock); static int sys_refcount_enter; static int sys_refcount_exit; -static DECLARE_BITMAP(enabled_enter_syscalls, FTRACE_SYSCALL_MAX); -static DECLARE_BITMAP(enabled_exit_syscalls, FTRACE_SYSCALL_MAX); +static DECLARE_BITMAP(enabled_enter_syscalls, NR_syscalls); +static DECLARE_BITMAP(enabled_exit_syscalls, NR_syscalls); enum print_line_t print_syscall_enter(struct trace_iterator *iter, int flags) @@ -289,7 +289,7 @@ int reg_event_syscall_enter(void *ptr) name = (char *)ptr; num = syscall_name_to_nr(name); - if (num < 0 || num >= FTRACE_SYSCALL_MAX) + if (num < 0 || num >= NR_syscalls) return -ENOSYS; mutex_lock(&syscall_trace_lock); if (!sys_refcount_enter) @@ -312,7 +312,7 @@ void unreg_event_syscall_enter(void *ptr) name = (char *)ptr; num = syscall_name_to_nr(name); - if (num < 0 || num >= FTRACE_SYSCALL_MAX) + if (num < 0 || num >= NR_syscalls) return; mutex_lock(&syscall_trace_lock); sys_refcount_enter--; @@ -330,7 +330,7 @@ int reg_event_syscall_exit(void *ptr) name = (char *)ptr; num = syscall_name_to_nr(name); - if (num < 0 || num >= FTRACE_SYSCALL_MAX) + if (num < 0 || num >= NR_syscalls) return -ENOSYS; mutex_lock(&syscall_trace_lock); if (!sys_refcount_exit) @@ -353,7 +353,7 @@ void unreg_event_syscall_exit(void *ptr) name = (char *)ptr; num = syscall_name_to_nr(name); - if (num < 0 || num >= FTRACE_SYSCALL_MAX) + if (num < 0 || num >= NR_syscalls) return; mutex_lock(&syscall_trace_lock); sys_refcount_exit--; @@ -373,8 +373,8 @@ struct trace_event event_syscall_exit = { #ifdef CONFIG_EVENT_PROFILE -static DECLARE_BITMAP(enabled_prof_enter_syscalls, FTRACE_SYSCALL_MAX); -static DECLARE_BITMAP(enabled_prof_exit_syscalls, FTRACE_SYSCALL_MAX); +static DECLARE_BITMAP(enabled_prof_enter_syscalls, NR_syscalls); +static DECLARE_BITMAP(enabled_prof_exit_syscalls, NR_syscalls); static int sys_prof_refcount_enter; static int sys_prof_refcount_exit; @@ -420,7 +420,7 @@ int reg_prof_syscall_enter(char *name) int num; num = syscall_name_to_nr(name); - if (num < 0 || num >= FTRACE_SYSCALL_MAX) + if (num < 0 || num >= NR_syscalls) return -ENOSYS; mutex_lock(&syscall_trace_lock); @@ -442,7 +442,7 @@ void unreg_prof_syscall_enter(char *name) int num; num = syscall_name_to_nr(name); - if (num < 0 || num >= FTRACE_SYSCALL_MAX) + if (num < 0 || num >= NR_syscalls) return; mutex_lock(&syscall_trace_lock); @@ -481,7 +481,7 @@ int reg_prof_syscall_exit(char *name) int num; num = syscall_name_to_nr(name); - if (num < 0 || num >= FTRACE_SYSCALL_MAX) + if (num < 0 || num >= NR_syscalls) return -ENOSYS; mutex_lock(&syscall_trace_lock); @@ -503,7 +503,7 @@ void unreg_prof_syscall_exit(char *name) int num; num = syscall_name_to_nr(name); - if (num < 0 || num >= FTRACE_SYSCALL_MAX) + if (num < 0 || num >= NR_syscalls) return; mutex_lock(&syscall_trace_lock); ^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 4/4] remove FTRACE_SYSCALL_MAX definitions 2009-08-24 21:40 [PATCH 0/4] use NR_syscalls instead of FTRACE_SYSCALL_MAX Jason Baron ` (2 preceding siblings ...) 2009-08-24 21:40 ` [PATCH 3/4] Convert event tracing code to NR_syscalls Jason Baron @ 2009-08-24 21:40 ` Jason Baron 2009-08-28 12:28 ` [tip:tracing/core] tracing: Remove " tip-bot for Jason Baron 3 siblings, 1 reply; 26+ messages in thread From: Jason Baron @ 2009-08-24 21:40 UTC (permalink / raw) To: linux-kernel, x86 Cc: lethal, fweisbec, mingo, laijs, rostedt, peterz, mathieu.desnoyers, jiayingz, mbligh, lizf, jistone, tglx, hpa Remove the FTRACE_SYSCALL_MAX definitions now that we have converted the syscall event tracing code to use NR_syscalls. Signed-off-by: Jason Baron <jbaron@redhat.com> --- arch/x86/include/asm/ftrace.h | 7 ------- 1 files changed, 0 insertions(+), 7 deletions(-) diff --git a/arch/x86/include/asm/ftrace.h b/arch/x86/include/asm/ftrace.h index 7113654..db24c22 100644 --- a/arch/x86/include/asm/ftrace.h +++ b/arch/x86/include/asm/ftrace.h @@ -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 */ -- 1.6.2.5 ^ permalink raw reply related [flat|nested] 26+ messages in thread
* [tip:tracing/core] tracing: Remove FTRACE_SYSCALL_MAX definitions 2009-08-24 21:40 ` [PATCH 4/4] remove FTRACE_SYSCALL_MAX definitions Jason Baron @ 2009-08-28 12:28 ` tip-bot for Jason Baron 0 siblings, 0 replies; 26+ messages in thread From: tip-bot for Jason Baron @ 2009-08-28 12:28 UTC (permalink / raw) To: linux-tip-commits Cc: brueckner, mathieu.desnoyers, mingo, peterz, fweisbec, rostedt, heiko.carstens, tglx, jbaron, laijs, linux-kernel, hpa, jiayingz, lizf, lethal, jistone, mingo, mbligh Commit-ID: 117226d15850387b55fd01675917ee4fcb9699e8 Gitweb: http://git.kernel.org/tip/117226d15850387b55fd01675917ee4fcb9699e8 Author: Jason Baron <jbaron@redhat.com> AuthorDate: Mon, 24 Aug 2009 17:40:26 -0400 Committer: Frederic Weisbecker <fweisbec@gmail.com> CommitDate: Wed, 26 Aug 2009 21:30:39 +0200 tracing: Remove FTRACE_SYSCALL_MAX definitions Remove the FTRACE_SYSCALL_MAX definitions now that we have converted the syscall event tracing code to use NR_syscalls. Signed-off-by: Jason Baron <jbaron@redhat.com> Cc: Paul Mundt <lethal@linux-sh.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Lai Jiangshan <laijs@cn.fujitsu.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> Cc: Jiaying Zhang <jiayingz@google.com> Cc: Martin Bligh <mbligh@google.com> Cc: Li Zefan <lizf@cn.fujitsu.com> Cc: Josh Stone <jistone@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: H. Peter Anwin <hpa@zytor.com> Cc: Hendrik Brueckner <brueckner@linux.vnet.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> LKML-Reference: <f2240cdc8f0b1ca7617390c8f5ec90ba2bd348cf.1251146513.git.jbaron@redhat.com> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> --- arch/x86/include/asm/ftrace.h | 7 ------- 1 files changed, 0 insertions(+), 7 deletions(-) diff --git a/arch/x86/include/asm/ftrace.h b/arch/x86/include/asm/ftrace.h index 7113654..db24c22 100644 --- a/arch/x86/include/asm/ftrace.h +++ b/arch/x86/include/asm/ftrace.h @@ -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 */ ^ permalink raw reply related [flat|nested] 26+ messages in thread
end of thread, other threads:[~2009-08-28 12:29 UTC | newest] Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2009-08-24 21:40 [PATCH 0/4] use NR_syscalls instead of FTRACE_SYSCALL_MAX Jason Baron 2009-08-24 21:40 ` [PATCH 1/4] add NR_syscalls define for x86 Jason Baron 2009-08-24 22:05 ` Paul Mundt 2009-08-25 13:37 ` Jason Baron 2009-08-28 12:28 ` [tip:tracing/core] tracing: Define NR_syscalls for x86 (32) tip-bot for Jason Baron 2009-08-24 21:40 ` [PATCH 2/4] Add NR_syscalls for x86_64 Jason Baron 2009-08-24 22:14 ` Frederic Weisbecker 2009-08-24 22:44 ` Steven Rostedt 2009-08-25 13:40 ` Jason Baron 2009-08-25 18:47 ` Jason Baron 2009-08-25 19:04 ` Mathieu Desnoyers 2009-08-25 20:58 ` Jason Baron 2009-08-25 23:28 ` Mathieu Desnoyers 2009-08-25 23:38 ` Frederic Weisbecker 2009-08-26 2:25 ` Steven Rostedt 2009-08-26 13:58 ` Jason Baron 2009-08-26 14:39 ` Steven Rostedt 2009-08-26 16:09 ` Jason Baron 2009-08-26 16:21 ` Steven Rostedt 2009-08-26 16:29 ` Frederic Weisbecker 2009-08-26 16:24 ` Frederic Weisbecker 2009-08-28 12:28 ` [tip:tracing/core] tracing: Define " tip-bot for Jason Baron 2009-08-24 21:40 ` [PATCH 3/4] Convert event tracing code to NR_syscalls Jason Baron 2009-08-28 12:28 ` [tip:tracing/core] tracing: Convert event tracing code to use NR_syscalls tip-bot for Jason Baron 2009-08-24 21:40 ` [PATCH 4/4] remove FTRACE_SYSCALL_MAX definitions Jason Baron 2009-08-28 12:28 ` [tip:tracing/core] tracing: Remove " tip-bot for Jason Baron
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.