Commit a5a2f8e2 authored by Jason Baron's avatar Jason Baron Committed by Frederic Weisbecker
Browse files

tracing: Define NR_syscalls for x86_64

Express the available number of syscalls in a standard way by defining

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

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: default avatarJason Baron <>
Acked-by: default avatarSteven Rostedt <>
Cc: Paul Mundt <>
Cc: Frederic Weisbecker <>
Cc: Ingo Molnar <>
Cc: Lai Jiangshan <>
Cc: Peter Zijlstra <>
Cc: Mathieu Desnoyers <>
Cc: Jiaying Zhang <>
Cc: Martin Bligh <>
Cc: Li Zefan <>
Cc: Josh Stone <>
Cc: Thomas Gleixner <>
Cc: H. Peter Anwin <>
Cc: Hendrik Brueckner <>
Cc: Heiko Carstens <>
LKML-Reference: <>
Signed-off-by: default avatarFrederic Weisbecker <>
parent dd86dda2
......@@ -688,6 +688,12 @@ __SYSCALL(__NR_perf_counter_open, sys_perf_counter_open)
#endif /* __NO_STUBS */
#ifdef __KERNEL__
#include <asm/asm-offsets.h>
#define NR_syscalls (__NR_syscall_max + 1)
* "Conditional" syscalls
......@@ -3,6 +3,7 @@
* This code generates raw asm output which is post-processed to extract
* and format the required data.
#include <linux/crypto.h>
#include <linux/sched.h>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment