4b49df65 | 26-Jul-2023 |
Chen Jiahao <chenjiahao16@huawei.com> |
samples/hw_breakpoint: mark sample_hbp as static
There is a sparse warning shown as below:
samples/hw_breakpoint/data_breakpoint.c:24:19: warning: symbol 'sample_hbp' was not declared. Should it be
samples/hw_breakpoint: mark sample_hbp as static
There is a sparse warning shown as below:
samples/hw_breakpoint/data_breakpoint.c:24:19: warning: symbol 'sample_hbp' was not declared. Should it be static?
Since 'sample_hbp' is only called within data_breakpoint.c, mark it as static to fix the warning.
Fixes: 44ee63587dce ("percpu: Add __percpu sparse annotations to hw_breakpoint") Signed-off-by: Chen Jiahao <chenjiahao16@huawei.com> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
show more ...
|
b9080468 | 25-Jul-2023 |
Arnd Bergmann <arnd@arndb.de> |
samples/hw_breakpoint: fix building without module unloading
__symbol_put() is really meant as an internal helper and is not available when module unloading is disabled, unlike the previously used s
samples/hw_breakpoint: fix building without module unloading
__symbol_put() is really meant as an internal helper and is not available when module unloading is disabled, unlike the previously used symbol_put():
samples/hw_breakpoint/data_breakpoint.c: In function 'hw_break_module_exit': samples/hw_breakpoint/data_breakpoint.c:73:9: error: implicit declaration of function '__symbol_put'; did you mean '__symbol_get'? [-Werror=implicit-function-declaration]
The hw_break_module_exit() function is not actually used when module unloading is disabled, but it still causes the build failure for an undefined identifier. Enclose this one call in an appropriate #ifdef to clarify what the requirement is. Leaving out the entire exit function would also work but feels less clar in this case.
Fixes: 910e230d5f1bb ("samples/hw_breakpoint: Fix kernel BUG 'invalid opcode: 0000'") Fixes: d8a84d33a4954 ("samples/hw_breakpoint: drop use of kallsyms_lookup_name()") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Petr Mladek <pmladek@suse.com> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
show more ...
|
d8a84d33 | 06-Apr-2020 |
Will Deacon <will@kernel.org> |
samples/hw_breakpoint: drop use of kallsyms_lookup_name()
The 'data_breakpoint' test code is the only modular user of kallsyms_lookup_name(), which was exported as part of fixing the test in f60d24d
samples/hw_breakpoint: drop use of kallsyms_lookup_name()
The 'data_breakpoint' test code is the only modular user of kallsyms_lookup_name(), which was exported as part of fixing the test in f60d24d2ad04 ("hw-breakpoints: Fix broken hw-breakpoint sample module").
In preparation for un-exporting this symbol, switch the test over to using __symbol_get(), which can be used to place breakpoints on exported symbols.
Signed-off-by: Will Deacon <will@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org> Reviewed-by: Quentin Perret <qperret@google.com> Cc: K.Prasad <prasad@linux.vnet.ibm.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Frederic Weisbecker <frederic@kernel.org> Cc: Alexei Starovoitov <ast@kernel.org> Cc: Miroslav Benes <mbenes@suse.cz> Cc: Petr Mladek <pmladek@suse.com> Cc: Joe Lawrence <joe.lawrence@redhat.com> Link: http://lkml.kernel.org/r/20200221114404.14641-3-will@kernel.org Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
show more ...
|
dd1853c3 | 26-Nov-2009 |
Frederic Weisbecker <fweisbec@gmail.com> |
hw-breakpoints: Use struct perf_event_attr to define kernel breakpoints
Kernel breakpoints are created using functions in which we pass breakpoint parameters as individual variables: address, length
hw-breakpoints: Use struct perf_event_attr to define kernel breakpoints
Kernel breakpoints are created using functions in which we pass breakpoint parameters as individual variables: address, length and type.
Although it fits well for x86, this just does not scale across architectures that may support this api later as these may have more or different needs. Pass in a perf_event_attr structure instead because it is meant to evolve as much as possible into a generic hardware breakpoint parameter structure.
Reported-by: K.Prasad <prasad@linux.vnet.ibm.com> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> LKML-Reference: <1259294154-5197-2-git-send-regression-fweisbec@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
show more ...
|