Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 146105
b: refs/heads/master
c: 9456f0f
h: refs/heads/master
i:
  146103: b28e5c7
v: v3
  • Loading branch information
Steven Rostedt authored and Steven Rostedt committed May 7, 2009
1 parent 1779551 commit c422ee2
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 71e1c8ac42ae4038ddb1367cce7097ab868dc532
refs/heads/master: 9456f0fa6d3cb944d3b9fc31c9a244e0362c26ea
10 changes: 10 additions & 0 deletions trunk/kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,16 @@ void tracing_reset_online_cpus(struct trace_array *tr)
tracing_reset(tr, cpu);
}

void tracing_reset_current(int cpu)
{
tracing_reset(&global_trace, cpu);
}

void tracing_reset_current_online_cpus(void)
{
tracing_reset_online_cpus(&global_trace);
}

#define SAVED_CMDLINES 128
#define NO_CMDLINE_MAP UINT_MAX
static unsigned map_pid_to_cmdline[PID_MAX_DEFAULT+1];
Expand Down
2 changes: 2 additions & 0 deletions trunk/kernel/trace/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,8 @@ int tracing_is_enabled(void);
void trace_wake_up(void);
void tracing_reset(struct trace_array *tr, int cpu);
void tracing_reset_online_cpus(struct trace_array *tr);
void tracing_reset_current(int cpu);
void tracing_reset_current_online_cpus(void);
int tracing_open_generic(struct inode *inode, struct file *filp);
struct dentry *trace_create_file(const char *name,
mode_t mode,
Expand Down
9 changes: 9 additions & 0 deletions trunk/kernel/trace/trace_events.c
Original file line number Diff line number Diff line change
Expand Up @@ -932,9 +932,11 @@ static void trace_module_remove_events(struct module *mod)
{
struct ftrace_module_file_ops *file_ops;
struct ftrace_event_call *call, *p;
bool found = false;

list_for_each_entry_safe(call, p, &ftrace_events, list) {
if (call->mod == mod) {
found = true;
if (call->enabled) {
call->enabled = 0;
call->unregfunc();
Expand All @@ -957,6 +959,13 @@ static void trace_module_remove_events(struct module *mod)
list_del(&file_ops->list);
kfree(file_ops);
}

/*
* It is safest to reset the ring buffer if the module being unloaded
* registered any events.
*/
if (found)
tracing_reset_current_online_cpus();
}

static int trace_module_notify(struct notifier_block *self,
Expand Down

0 comments on commit c422ee2

Please sign in to comment.