-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build kernel with KFT instrumentation #1393
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would much appreciate if you renamed kft.{c,h}
to kftrace.{c,h}
respectively.
Please note that most likely kft.h
should be renamed to cpufunc.h
and the function should be renamed to cpu_getcounter
. But that would require some cleanup effort, which we don't want to incur ATM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's work towards integrating it well with launch
script.
config.mk
Outdated
@@ -4,7 +4,7 @@ | |||
# build system for given platform. | |||
# | |||
|
|||
CONFIG_OPTS := KASAN LOCKDEP KGPROF MIPS AARCH64 RISCV KCSAN | |||
CONFIG_OPTS := MIPS AARCH64 RISCV KASAN LOCKDEP KCSAN KGPROF KFTRACE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't reorder the options if you don't need to. What about KGPROF
and KFTRACE
now, shouldn't they be replaced by KFI
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added them to make it possible to include sources that are saved in variables SOURCES_KFTRACE
and SOURCES_KGPROF
. I couldn't figure it out how to do it with single KFI
flag.
I will reorder back the other flags.
sys/kern/kftrace.c
Outdated
static unsigned kft_used = 0; | ||
static bool kft_enabled = false; | ||
|
||
#define PC_MASK 0xFFFFFF /* 24 bits */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please note that lower two bits won't be used on all architectures with 4-byte only instruction words (i.e. all that we support currently).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR contains only changes made to kernel to create data about function calls. There will be another PR with python code which will interpret this data.