diff options
| author | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-09-19 13:47:57 +0100 | 
|---|---|---|
| committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-09-19 13:47:57 +0100 | 
| commit | 40d743b8c16a8cf6e30c1d941aa6147f9550ea75 (patch) | |
| tree | 9fcdf9a06b18a275253048d1ea7c9803cec38845 /kernel/trace/trace_output.c | |
| parent | 7da18afa423f167e7ef3c9728e584d8bf05bd55a (diff) | |
| parent | 83e686ea0291ee93b87dcdc00b96443b80de56c9 (diff) | |
Merge branch 'for-rmk' of git://linux-arm.org/linux-2.6
Diffstat (limited to 'kernel/trace/trace_output.c')
| -rw-r--r-- | kernel/trace/trace_output.c | 42 | 
1 files changed, 34 insertions, 8 deletions
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c index e0c2545622e..f572f44c6e1 100644 --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c @@ -407,7 +407,7 @@ seq_print_userip_objs(const struct userstack_entry *entry, struct trace_seq *s,  		 * since individual threads might have already quit!  		 */  		rcu_read_lock(); -		task = find_task_by_vpid(entry->ent.tgid); +		task = find_task_by_vpid(entry->tgid);  		if (task)  			mm = get_task_mm(task);  		rcu_read_unlock(); @@ -460,18 +460,23 @@ seq_print_ip_sym(struct trace_seq *s, unsigned long ip, unsigned long sym_flags)  	return ret;  } -static int -lat_print_generic(struct trace_seq *s, struct trace_entry *entry, int cpu) +/** + * trace_print_lat_fmt - print the irq, preempt and lockdep fields + * @s: trace seq struct to write to + * @entry: The trace entry field from the ring buffer + * + * Prints the generic fields of irqs off, in hard or softirq, preempt + * count and lock depth. + */ +int trace_print_lat_fmt(struct trace_seq *s, struct trace_entry *entry)  {  	int hardirq, softirq; -	char comm[TASK_COMM_LEN]; +	int ret; -	trace_find_cmdline(entry->pid, comm);  	hardirq = entry->flags & TRACE_FLAG_HARDIRQ;  	softirq = entry->flags & TRACE_FLAG_SOFTIRQ; -	if (!trace_seq_printf(s, "%8.8s-%-5d %3d%c%c%c", -			      comm, entry->pid, cpu, +	if (!trace_seq_printf(s, "%c%c%c",  			      (entry->flags & TRACE_FLAG_IRQS_OFF) ? 'd' :  				(entry->flags & TRACE_FLAG_IRQS_NOSUPPORT) ?  				  'X' : '.', @@ -481,9 +486,30 @@ lat_print_generic(struct trace_seq *s, struct trace_entry *entry, int cpu)  				hardirq ? 'h' : softirq ? 's' : '.'))  		return 0; +	if (entry->lock_depth < 0) +		ret = trace_seq_putc(s, '.'); +	else +		ret = trace_seq_printf(s, "%d", entry->lock_depth); +	if (!ret) +		return 0; +  	if (entry->preempt_count)  		return trace_seq_printf(s, "%x", entry->preempt_count); -	return trace_seq_puts(s, "."); +	return trace_seq_putc(s, '.'); +} + +static int +lat_print_generic(struct trace_seq *s, struct trace_entry *entry, int cpu) +{ +	char comm[TASK_COMM_LEN]; + +	trace_find_cmdline(entry->pid, comm); + +	if (!trace_seq_printf(s, "%8.8s-%-5d %3d", +			      comm, entry->pid, cpu)) +		return 0; + +	return trace_print_lat_fmt(s, entry);  }  static unsigned long preempt_mark_thresh = 100;  | 
