diff options
author | Michael Ellerman <mpe@ellerman.id.au> | 2016-03-24 07:04:01 -0400 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2016-04-14 01:47:05 -0400 |
commit | 04cf31a759ef575f750a63777cee95500e410994 (patch) | |
tree | ee5dbbf8b9ac93c0b0e28a21b59db58cd4b19bcf | |
parent | 8c50b72a3b4f1f7cdfdfebd233b1cbd121262e65 (diff) |
ftrace: Make ftrace_location_range() global
In order to support live patching on powerpc we would like to call
ftrace_location_range(), so make it global.
Signed-off-by: Torsten Duwe <duwe@suse.de>
Signed-off-by: Balbir Singh <bsingharora@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r-- | include/linux/ftrace.h | 1 | ||||
-rw-r--r-- | kernel/trace/ftrace.c | 14 |
2 files changed, 14 insertions, 1 deletions
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 81de7123959d..3481a8e405f9 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -455,6 +455,7 @@ int ftrace_update_record(struct dyn_ftrace *rec, int enable); | |||
455 | int ftrace_test_record(struct dyn_ftrace *rec, int enable); | 455 | int ftrace_test_record(struct dyn_ftrace *rec, int enable); |
456 | void ftrace_run_stop_machine(int command); | 456 | void ftrace_run_stop_machine(int command); |
457 | unsigned long ftrace_location(unsigned long ip); | 457 | unsigned long ftrace_location(unsigned long ip); |
458 | unsigned long ftrace_location_range(unsigned long start, unsigned long end); | ||
458 | unsigned long ftrace_get_addr_new(struct dyn_ftrace *rec); | 459 | unsigned long ftrace_get_addr_new(struct dyn_ftrace *rec); |
459 | unsigned long ftrace_get_addr_curr(struct dyn_ftrace *rec); | 460 | unsigned long ftrace_get_addr_curr(struct dyn_ftrace *rec); |
460 | 461 | ||
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index eca592f977b2..e1b3f2312db0 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -1533,7 +1533,19 @@ static int ftrace_cmp_recs(const void *a, const void *b) | |||
1533 | return 0; | 1533 | return 0; |
1534 | } | 1534 | } |
1535 | 1535 | ||
1536 | static unsigned long ftrace_location_range(unsigned long start, unsigned long end) | 1536 | /** |
1537 | * ftrace_location_range - return the first address of a traced location | ||
1538 | * if it touches the given ip range | ||
1539 | * @start: start of range to search. | ||
1540 | * @end: end of range to search (inclusive). @end points to the last byte | ||
1541 | * to check. | ||
1542 | * | ||
1543 | * Returns rec->ip if the related ftrace location is a least partly within | ||
1544 | * the given address range. That is, the first address of the instruction | ||
1545 | * that is either a NOP or call to the function tracer. It checks the ftrace | ||
1546 | * internal tables to determine if the address belongs or not. | ||
1547 | */ | ||
1548 | unsigned long ftrace_location_range(unsigned long start, unsigned long end) | ||
1537 | { | 1549 | { |
1538 | struct ftrace_page *pg; | 1550 | struct ftrace_page *pg; |
1539 | struct dyn_ftrace *rec; | 1551 | struct dyn_ftrace *rec; |