aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-05-12 15:20:48 -0400
committerThomas Gleixner <tglx@linutronix.de>2008-05-23 14:53:09 -0400
commitdcb6308f2b56720599f6b9d5a01c33e67e69bde4 (patch)
treed9d381fac8d58869ccab6e0b873b68f5371a0703 /kernel/trace
parentf0a920d5752e1788c0cba2add103076bcc0f7a49 (diff)
ftrace, locking fix
should be an irq-safe lock ... Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/trace')
-rw-r--r--kernel/trace/trace.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index fa13059eb462..70f94fa92c10 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -691,14 +691,15 @@ ftrace(struct trace_array *tr, struct trace_array_cpu *data,
691 unsigned long ip, unsigned long parent_ip, unsigned long flags) 691 unsigned long ip, unsigned long parent_ip, unsigned long flags)
692{ 692{
693 struct trace_entry *entry; 693 struct trace_entry *entry;
694 unsigned long irq_flags;
694 695
695 spin_lock(&data->lock); 696 spin_lock_irqsave(&data->lock, irq_flags);
696 entry = tracing_get_trace_entry(tr, data); 697 entry = tracing_get_trace_entry(tr, data);
697 tracing_generic_entry_update(entry, flags); 698 tracing_generic_entry_update(entry, flags);
698 entry->type = TRACE_FN; 699 entry->type = TRACE_FN;
699 entry->fn.ip = ip; 700 entry->fn.ip = ip;
700 entry->fn.parent_ip = parent_ip; 701 entry->fn.parent_ip = parent_ip;
701 spin_unlock(&data->lock); 702 spin_unlock_irqrestore(&data->lock, irq_flags);
702} 703}
703 704
704notrace void 705notrace void
@@ -706,15 +707,16 @@ trace_special(struct trace_array *tr, struct trace_array_cpu *data,
706 unsigned long arg1, unsigned long arg2, unsigned long arg3) 707 unsigned long arg1, unsigned long arg2, unsigned long arg3)
707{ 708{
708 struct trace_entry *entry; 709 struct trace_entry *entry;
710 unsigned long irq_flags;
709 711
710 spin_lock(&data->lock); 712 spin_lock_irqsave(&data->lock, irq_flags);
711 entry = tracing_get_trace_entry(tr, data); 713 entry = tracing_get_trace_entry(tr, data);
712 tracing_generic_entry_update(entry, 0); 714 tracing_generic_entry_update(entry, 0);
713 entry->type = TRACE_SPECIAL; 715 entry->type = TRACE_SPECIAL;
714 entry->special.arg1 = arg1; 716 entry->special.arg1 = arg1;
715 entry->special.arg2 = arg2; 717 entry->special.arg2 = arg2;
716 entry->special.arg3 = arg3; 718 entry->special.arg3 = arg3;
717 spin_unlock(&data->lock); 719 spin_unlock_irqrestore(&data->lock, irq_flags);
718} 720}
719 721
720notrace void 722notrace void
@@ -724,8 +726,9 @@ tracing_sched_switch_trace(struct trace_array *tr,
724 unsigned long flags) 726 unsigned long flags)
725{ 727{
726 struct trace_entry *entry; 728 struct trace_entry *entry;
729 unsigned long irq_flags;
727 730
728 spin_lock(&data->lock); 731 spin_lock_irqsave(&data->lock, irq_flags);
729 entry = tracing_get_trace_entry(tr, data); 732 entry = tracing_get_trace_entry(tr, data);
730 tracing_generic_entry_update(entry, flags); 733 tracing_generic_entry_update(entry, flags);
731 entry->type = TRACE_CTX; 734 entry->type = TRACE_CTX;
@@ -734,7 +737,7 @@ tracing_sched_switch_trace(struct trace_array *tr,
734 entry->ctx.prev_state = prev->state; 737 entry->ctx.prev_state = prev->state;
735 entry->ctx.next_pid = next->pid; 738 entry->ctx.next_pid = next->pid;
736 entry->ctx.next_prio = next->prio; 739 entry->ctx.next_prio = next->prio;
737 spin_unlock(&data->lock); 740 spin_unlock_irqrestore(&data->lock, irq_flags);
738} 741}
739 742
740enum trace_file_type { 743enum trace_file_type {