Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 304951
b: refs/heads/master
c: 9644302
h: refs/heads/master
i:
  304949: f263aa2
  304947: 2ca4de1
  304943: 28cd2c9
v: v3
  • Loading branch information
Steven Rostedt authored and Steven Rostedt committed May 16, 2012
1 parent 7a108fb commit b17808d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 706c81f87f84adbcf1f6553b9e6b69b3e28fc35a
refs/heads/master: 9644302e3315e7e36495d230d5ac7125a316d33e
22 changes: 16 additions & 6 deletions trunk/kernel/trace/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -1411,6 +1411,8 @@ int ftrace_location(unsigned long ip)
key.ip = ip;

for (pg = ftrace_pages_start; pg; pg = pg->next) {
if (ip < pg->records[0].ip || ip > pg->records[pg->index - 1].ip)
continue;
rec = bsearch(&key, pg->records, pg->index,
sizeof(struct dyn_ftrace),
ftrace_cmp_recs);
Expand Down Expand Up @@ -1571,16 +1573,24 @@ void ftrace_bug(int failed, unsigned long ip)


/* Return 1 if the address range is reserved for ftrace */
int ftrace_text_reserved(void *start, void *end)
int ftrace_text_reserved(void *s, void *e)
{
struct dyn_ftrace *rec;
struct ftrace_page *pg;
unsigned long start = (unsigned long)s;
unsigned long end = (unsigned long)e;
int i;

do_for_each_ftrace_rec(pg, rec) {
if (rec->ip <= (unsigned long)end &&
rec->ip + MCOUNT_INSN_SIZE > (unsigned long)start)
return 1;
} while_for_each_ftrace_rec();
for (pg = ftrace_pages_start; pg; pg = pg->next) {
if (end < pg->records[0].ip ||
start >= (pg->records[pg->index - 1].ip + MCOUNT_INSN_SIZE))
continue;
for (i = 0; i < pg->index; i++) {
rec = &pg->records[i];
if (rec->ip <= end && rec->ip + MCOUNT_INSN_SIZE > start)
return 1;
}
}
return 0;
}

Expand Down

0 comments on commit b17808d

Please sign in to comment.