[PATCH] OProfile: fixed x86_64 incorrect kernel call graphs
[PATCH] OProfile: fixed x86_64 incorrect kernel call graphs

Fix the problem in kernel 2.6.15.1 (and early versions) that OProfile on
x86_64 does not correctly collect the stack traces for kernel functions.

The original code in valid_kernel_stack() in arch/i386/oprofile/backtrace.c
assumes that the frame pointer (headaddr) should be greater than stack
(i.e., regs).

This assumption is wrong for x86_64 because NMIs in x86_64 use a seperate
stack different from the kernel stack.  Therefore, the variable stack now
points to some location on the NMI stack, which turns out to be at a higher
address than the frame pointer (headaddr) on the kernel stack.  The correct
comparison here should be between headaddr and regs->rsp for x86_64.

Signed-off-by: Tong Li <71323bc3d9ec394534a59c4bae38a78d3c0b9a73@intel.com>
Cc: John Levon <002e324a40ac88c85fed843304f29bb68ff6134c@movementarian.org>
Cc: Philippe Elie <7805f5b9cab2bb882f9659fd431ab0c8b7a73aa6@wanadoo.fr>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@osdl.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@osdl.org>

TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas