Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 141036
b: refs/heads/master
c: ee000b7
h: refs/heads/master
v: v3
  • Loading branch information
Lai Jiangshan authored and Ingo Molnar committed Mar 24, 2009
1 parent 354373e commit c794f9d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 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: cc59c9e8d0165c632fd056c4a23e36f917507fb4
refs/heads/master: ee000b7f9fe429d2470c674ccec8d344f6789e0d
12 changes: 9 additions & 3 deletions trunk/include/linux/ftrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,15 @@ enum {
};

struct dyn_ftrace {
unsigned long ip; /* address of mcount call-site */
unsigned long flags;
struct dyn_arch_ftrace arch;
union {
unsigned long ip; /* address of mcount call-site */
struct dyn_ftrace *freelist;
};
union {
unsigned long flags;
struct dyn_ftrace *newlist;
};
struct dyn_arch_ftrace arch;
};

int ftrace_force_update(void);
Expand Down
8 changes: 4 additions & 4 deletions trunk/kernel/trace/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ static inline int record_frozen(struct dyn_ftrace *rec)

static void ftrace_free_rec(struct dyn_ftrace *rec)
{
rec->ip = (unsigned long)ftrace_free_records;
rec->freelist = ftrace_free_records;
ftrace_free_records = rec;
rec->flags |= FTRACE_FL_FREE;
}
Expand Down Expand Up @@ -379,7 +379,7 @@ static struct dyn_ftrace *ftrace_alloc_dyn_node(unsigned long ip)
return NULL;
}

ftrace_free_records = (void *)rec->ip;
ftrace_free_records = rec->freelist;
memset(rec, 0, sizeof(*rec));
return rec;
}
Expand Down Expand Up @@ -411,7 +411,7 @@ ftrace_record_ip(unsigned long ip)
return NULL;

rec->ip = ip;
rec->flags = (unsigned long)ftrace_new_addrs;
rec->newlist = ftrace_new_addrs;
ftrace_new_addrs = rec;

return rec;
Expand Down Expand Up @@ -731,7 +731,7 @@ static int ftrace_update_code(struct module *mod)
return -1;

p = ftrace_new_addrs;
ftrace_new_addrs = (struct dyn_ftrace *)p->flags;
ftrace_new_addrs = p->newlist;
p->flags = 0L;

/* convert record (i.e, patch mcount-call with NOP) */
Expand Down

0 comments on commit c794f9d

Please sign in to comment.