kprobes: a couple of trivial changes
Subsystems (3)
cover kprobes: a couple of trivial changes
Two trivial fixes for kprobes:
- one, to document NOKPROBE_SYMBOL() in kprobe tracer doc
- two, change __kprobes to NOKPROBE_SYMBOL() for kprobe_exceptions_notify()
I noticed the latter while making this change for arch/powerpc.
- Naveen
Naveen N. Rao (2):
doc: trace/kprobes: add information about NOKPROBE_SYMBOL
kprobes: Convert kprobe_exceptions_notify to use NOKPROBE_SYMBOL
Documentation/trace/kprobetrace.txt | 5 +++-- kernel/kprobes.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-)
Signature · 1 line
2.11.1
PATCH 1/2 doc: trace/kprobes: add information about NOKPROBE_SYMBOL
Update kprobe tracer documentation to also mention that NOKPROBE_SYMBOL() and nokprobe_inline add symbols to the kprobes blacklist.
--- Documentation/trace/kprobetrace.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
Documentation/trace/kprobetrace.txt +3 -2
@@ -8,8 +8,9 @@ Overview -------- These events are similar to tracepoint based events. Instead of Tracepoint, this is based on kprobes (kprobe and kretprobe). So it can probe wherever -kprobes can probe (this means, all functions body except for __kprobes -functions). Unlike the Tracepoint based event, this can be added and removed +kprobes can probe (this means, all functions except those with +__kprobes/nokprobe_inline annotation and those marked NOKPROBE_SYMBOL). +Unlike the Tracepoint based event, this can be added and removed dynamically, on the fly. To enable this feature, build your kernel with CONFIG_KPROBE_EVENTS=y.
Signature · 1 line
2.11.1
Re: [TRIVIAL PATCH 1/2] doc: trace/kprobes: add information about NOKPROBE_SYMBOL
Quoted 3 lines · On Wed, 8 Mar 2017 22:34:14 +0530 "Naveen N. Rao"…
Update kprobe tracer documentation to also mention that
NOKPROBE_SYMBOL()andnokprobe_inlineadd symbols to the kprobes blacklist.
Thanks for update!
Quoted 25 lines
Signed-off-by Naveen N. Rao <[email protected]>--- Documentation/trace/kprobetrace.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)Documentation/trace/kprobetrace.txt +3
-2@@ -8,8 +8,9 @@ Overview -------- These events are similar to tracepoint based events. Instead of Tracepoint, this is based on kprobes (kprobe and kretprobe). So it can probe wherever -kprobes can probe (this means, all functions body except for __kprobes -functions). Unlike the Tracepoint based event, this can be added and removed +kprobes can probe (this means, all functions except those with +__kprobes/nokprobe_inline annotation and those marked NOKPROBE_SYMBOL). +Unlike the Tracepoint based event, this can be added and removed dynamically, on the fly. To enable this feature, build your kernel with CONFIG_KPROBE_EVENTS=y.Signature · 1 line
2.11.1
Signature · 1 line
Masami Hiramatsu <[email protected]>
tip-bot for Naveen N. Rao
merge bot[tip:perf/core] doc: trace/kprobes: add information about NOKPROBE_SYMBOL
In reply to Naveen N. Raodoc: trace/kprobes: add information about NOKPROBE_SYMBOL
Commit-ID: c1ac094d5061e757624a47217d2195ba24a75450 Gitweb: http://git.kernel.org/tip/c1ac094d5061e757624a47217d2195ba24a75450 Author: Naveen N. Rao <[email protected]> AuthorDate: Wed, 8 Mar 2017 22:34:14 +0530 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Tue, 14 Mar 2017 15:17:40 -0300
doc: trace/kprobes: add information about NOKPROBE_SYMBOL
Update kprobe tracer documentation to also mention that NOKPROBE_SYMBOL() and nokprobe_inline add symbols to the kprobes blacklist.
--- Documentation/trace/kprobetrace.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
Documentation/trace/kprobetrace.txt +3 -2
@@ -8,8 +8,9 @@ Overview -------- These events are similar to tracepoint based events. Instead of Tracepoint, this is based on kprobes (kprobe and kretprobe). So it can probe wherever -kprobes can probe (this means, all functions body except for __kprobes -functions). Unlike the Tracepoint based event, this can be added and removed +kprobes can probe (this means, all functions except those with +__kprobes/nokprobe_inline annotation and those marked NOKPROBE_SYMBOL). +Unlike the Tracepoint based event, this can be added and removed dynamically, on the fly. To enable this feature, build your kernel with CONFIG_KPROBE_EVENTS=y.
PATCH 2/2 kprobes: Convert kprobe_exceptions_notify to use NOKPROBE_SYMBOL
In reply to Naveen N. Raocommit fc62d0207ae0 ("kprobes: Introduce weak variant of kprobe_exceptions_notify()") used the __kprobes annotation to exclude kprobe_exceptions_notify from being probed. Since NOKPROBE_SYMBOL() is a better way to do this enabling the symbol to be discovered as being blacklisted, change over to using NOKPROBE_SYMBOL().
--- kernel/kprobes.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
kernel/kprobes.c +3 -2
@@ -1740,11 +1740,12 @@ void unregister_kprobes(struct kprobe **kps, int num) }EXPORT_SYMBOL_GPL (unregister_kprobes); -int __weak __kprobes kprobe_exceptions_notify (struct notifier_block *self, -unsigned long val,void *data) +int __weak kprobe_exceptions_notify (struct notifier_block *self, +unsigned long val,void *data) {return NOTIFY_DONE ; } +NOKPROBE_SYMBOL (kprobe_exceptions_notify);static struct notifier_block kprobe_exceptions_nb = { .notifier_call = kprobe_exceptions_notify,
Signature · 1 line
2.11.1
Re: [TRIVIAL PATCH 2/2] kprobes: Convert kprobe_exceptions_notify to use NOKPROBE_SYMBOL
Quoted 6 lines · On Wed, 8 Mar 2017 22:34:15 +0530 "Naveen N. Rao"…
commit
fc62d0207ae0("kprobes: Introduce weak variant ofkprobe_exceptions_notify()") used the__kprobesannotation to excludekprobe_exceptions_notifyfrom being probed. SinceNOKPROBE_SYMBOL()is a better way to do this enabling the symbol to be discovered as being blacklisted, change over to usingNOKPROBE_SYMBOL().
Oops, yes it should be.
Thanks,
Quoted 27 lines
Signed-off-by Naveen N. Rao <[email protected]>--- kernel/kprobes.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)kernel/kprobes.c +3
-2@@ -1740,11 +1740,12 @@ void unregister_kprobes(struct kprobe **kps, int num) }EXPORT_SYMBOL_GPL (unregister_kprobes); -int __weak __kprobes kprobe_exceptions_notify (struct notifier_block *self, -unsigned long val,void *data) +int __weak kprobe_exceptions_notify (struct notifier_block *self, +unsigned long val,void *data) {return NOTIFY_DONE ; } +NOKPROBE_SYMBOL (kprobe_exceptions_notify);static struct notifier_block kprobe_exceptions_nb = { .notifier_call = kprobe_exceptions_notify,Signature · 1 line
2.11.1
Signature · 1 line
Masami Hiramatsu <[email protected]>
tip-bot for Naveen N. Rao
merge bot[tip:perf/core] kprobes: Convert kprobe_exceptions_notify to use NOKPROBE_SYMBOL
In reply to Naveen N. Raokprobes: Convert kprobe_exceptions_notify to use NOKPROBE_SYMBOL
Commit-ID: 5f6bee34707973ea7879a7857fd63ddccc92fff3 Gitweb: http://git.kernel.org/tip/5f6bee34707973ea7879a7857fd63ddccc92fff3 Author: Naveen N. Rao <[email protected]> AuthorDate: Wed, 8 Mar 2017 22:34:15 +0530 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Tue, 14 Mar 2017 15:17:40 -0300
kprobes: Convert kprobe_exceptions_notify to use NOKPROBE_SYMBOL
commit fc62d0207ae0 ("kprobes: Introduce weak variant of kprobe_exceptions_notify()") used the __kprobes annotation to exclude kprobe_exceptions_notify from being probed. Since NOKPROBE_SYMBOL() is a better way to do this enabling the symbol to be discovered as being blacklisted, change over to using NOKPROBE_SYMBOL().
--- kernel/kprobes.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
kernel/kprobes.c +3 -2
@@ -1740,11 +1740,12 @@ void unregister_kprobes(struct kprobe **kps, int num) }EXPORT_SYMBOL_GPL (unregister_kprobes); -int __weak __kprobes kprobe_exceptions_notify (struct notifier_block *self, -unsigned long val,void *data) +int __weak kprobe_exceptions_notify (struct notifier_block *self, +unsigned long val,void *data) {return NOTIFY_DONE ; } +NOKPROBE_SYMBOL (kprobe_exceptions_notify);static struct notifier_block kprobe_exceptions_nb = { .notifier_call = kprobe_exceptions_notify,