Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 156248
b: refs/heads/master
c: e16852c
h: refs/heads/master
v: v3
  • Loading branch information
Ingo Molnar committed Aug 4, 2009
1 parent 19321b9 commit 3a0a618
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 30 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: 74e7ff8c50b6b022e6ffaa736b16a4dc161d3eaf
refs/heads/master: e16852cfc5580b88cb327413ab8c89375f380592
1 change: 1 addition & 0 deletions trunk/kernel/panic.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ int oops_may_print(void)
*/
void oops_enter(void)
{
tracing_off();
/* can't trust the integrity of the kernel anymore: */
debug_locks_off();
do_oops_enter_exit();
Expand Down
5 changes: 3 additions & 2 deletions trunk/kernel/profile.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,12 @@ int __ref profile_init(void)

cpumask_copy(prof_cpu_mask, cpu_possible_mask);

prof_buffer = kzalloc(buffer_bytes, GFP_KERNEL);
prof_buffer = kzalloc(buffer_bytes, GFP_KERNEL|__GFP_NOWARN);
if (prof_buffer)
return 0;

prof_buffer = alloc_pages_exact(buffer_bytes, GFP_KERNEL|__GFP_ZERO);
prof_buffer = alloc_pages_exact(buffer_bytes,
GFP_KERNEL|__GFP_ZERO|__GFP_NOWARN);
if (prof_buffer)
return 0;

Expand Down
19 changes: 14 additions & 5 deletions trunk/kernel/trace/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -1662,7 +1662,7 @@ ftrace_regex_open(struct inode *inode, struct file *file, int enable)

mutex_lock(&ftrace_regex_lock);
if ((file->f_mode & FMODE_WRITE) &&
!(file->f_flags & O_APPEND))
(file->f_flags & O_TRUNC))
ftrace_filter_reset(enable);

if (file->f_mode & FMODE_READ) {
Expand Down Expand Up @@ -2577,7 +2577,7 @@ ftrace_graph_open(struct inode *inode, struct file *file)

mutex_lock(&graph_lock);
if ((file->f_mode & FMODE_WRITE) &&
!(file->f_flags & O_APPEND)) {
(file->f_flags & O_TRUNC)) {
ftrace_graph_count = 0;
memset(ftrace_graph_funcs, 0, sizeof(ftrace_graph_funcs));
}
Expand All @@ -2595,6 +2595,14 @@ ftrace_graph_open(struct inode *inode, struct file *file)
return ret;
}

static int
ftrace_graph_release(struct inode *inode, struct file *file)
{
if (file->f_mode & FMODE_READ)
seq_release(inode, file);
return 0;
}

static int
ftrace_set_func(unsigned long *array, int *idx, char *buffer)
{
Expand Down Expand Up @@ -2724,9 +2732,10 @@ ftrace_graph_write(struct file *file, const char __user *ubuf,
}

static const struct file_operations ftrace_graph_fops = {
.open = ftrace_graph_open,
.read = seq_read,
.write = ftrace_graph_write,
.open = ftrace_graph_open,
.read = seq_read,
.write = ftrace_graph_write,
.release = ftrace_graph_release,
};
#endif /* CONFIG_FUNCTION_GRAPH_TRACER */

Expand Down
2 changes: 1 addition & 1 deletion trunk/kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -2031,7 +2031,7 @@ static int tracing_open(struct inode *inode, struct file *file)

/* If this file was open for write, then erase contents */
if ((file->f_mode & FMODE_WRITE) &&
!(file->f_flags & O_APPEND)) {
(file->f_flags & O_TRUNC)) {
long cpu = (long) inode->i_private;

if (cpu == TRACE_PIPE_ALL_CPU)
Expand Down
2 changes: 1 addition & 1 deletion trunk/kernel/trace/trace_events.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ ftrace_event_seq_open(struct inode *inode, struct file *file)
const struct seq_operations *seq_ops;

if ((file->f_mode & FMODE_WRITE) &&
!(file->f_flags & O_APPEND))
(file->f_flags & O_TRUNC))
ftrace_clear_events();

seq_ops = inode->i_private;
Expand Down
2 changes: 1 addition & 1 deletion trunk/kernel/trace/trace_printk.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ static int t_show(struct seq_file *m, void *v)
const char *str = *fmt;
int i;

seq_printf(m, "0x%lx : \"", (unsigned long)fmt);
seq_printf(m, "0x%lx : \"", *(unsigned long *)fmt);

/*
* Tabs and new lines need to be converted.
Expand Down
7 changes: 2 additions & 5 deletions trunk/kernel/trace/trace_stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,17 +301,14 @@ static const struct seq_operations stack_trace_seq_ops = {

static int stack_trace_open(struct inode *inode, struct file *file)
{
int ret;

ret = seq_open(file, &stack_trace_seq_ops);

return ret;
return seq_open(file, &stack_trace_seq_ops);
}

static const struct file_operations stack_trace_fops = {
.open = stack_trace_open,
.read = seq_read,
.llseek = seq_lseek,
.release = seq_release,
};

int
Expand Down
34 changes: 22 additions & 12 deletions trunk/kernel/trace/trace_stat.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ static struct rb_node *release_next(struct rb_node *node)
}
}

static void reset_stat_session(struct stat_session *session)
static void __reset_stat_session(struct stat_session *session)
{
struct rb_node *node = session->stat_root.rb_node;

Expand All @@ -83,10 +83,17 @@ static void reset_stat_session(struct stat_session *session)
session->stat_root = RB_ROOT;
}

static void reset_stat_session(struct stat_session *session)
{
mutex_lock(&session->stat_mutex);
__reset_stat_session(session);
mutex_unlock(&session->stat_mutex);
}

static void destroy_session(struct stat_session *session)
{
debugfs_remove(session->file);
reset_stat_session(session);
__reset_stat_session(session);
mutex_destroy(&session->stat_mutex);
kfree(session);
}
Expand Down Expand Up @@ -150,7 +157,7 @@ static int stat_seq_init(struct stat_session *session)
int i;

mutex_lock(&session->stat_mutex);
reset_stat_session(session);
__reset_stat_session(session);

if (!ts->stat_cmp)
ts->stat_cmp = dummy_cmp;
Expand Down Expand Up @@ -183,7 +190,7 @@ static int stat_seq_init(struct stat_session *session)
return ret;

exit_free_rbtree:
reset_stat_session(session);
__reset_stat_session(session);
mutex_unlock(&session->stat_mutex);
return ret;
}
Expand Down Expand Up @@ -250,16 +257,21 @@ static const struct seq_operations trace_stat_seq_ops = {
static int tracing_stat_open(struct inode *inode, struct file *file)
{
int ret;

struct seq_file *m;
struct stat_session *session = inode->i_private;

ret = stat_seq_init(session);
if (ret)
return ret;

ret = seq_open(file, &trace_stat_seq_ops);
if (!ret) {
struct seq_file *m = file->private_data;
m->private = session;
ret = stat_seq_init(session);
if (ret) {
reset_stat_session(session);
return ret;
}

m = file->private_data;
m->private = session;
return ret;
}

Expand All @@ -270,11 +282,9 @@ static int tracing_stat_release(struct inode *i, struct file *f)
{
struct stat_session *session = i->i_private;

mutex_lock(&session->stat_mutex);
reset_stat_session(session);
mutex_unlock(&session->stat_mutex);

return 0;
return seq_release(i, f);
}

static const struct file_operations tracing_stat_fops = {
Expand Down
5 changes: 3 additions & 2 deletions trunk/scripts/recordmcount.pl
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,6 @@ sub update_funcs
# section found, now is this a start of a function?
} elsif ($read_function && /$function_regex/) {
$text_found = 1;
$offset = hex $1;
$text = $2;

# if this is either a local function or a weak function
Expand All @@ -412,10 +411,12 @@ sub update_funcs
if (!defined($locals{$text}) && !defined($weak{$text})) {
$ref_func = $text;
$read_function = 0;
$offset = hex $1;
} else {
# if we already have a function, and this is weak, skip it
if (!defined($ref_func) || !defined($weak{$text})) {
if (!defined($ref_func) && !defined($weak{$text})) {
$ref_func = $text;
$offset = hex $1;
}
}
} elsif ($read_headers && /$mcount_section/) {
Expand Down

0 comments on commit 3a0a618

Please sign in to comment.