aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-09-11 11:36:23 -0400
committerSteven Rostedt <rostedt@goodmis.org>2009-09-11 11:36:23 -0400
commit48659d31195bb76d688e99dabd816c5472fb1656 (patch)
tree9d7d7f9ac50a6de1be1bfe28a31ee13e369fc04b
parent49ff590390a22c49e9063dcdec4cd5903127526b (diff)
tracing: move tgid out of generic entry and into userstack
The userstack trace required the recording of the tgid entry. Unfortunately, it was added to the generic entry where it wasted 4 bytes of every entry and was only used by one entry. This patch moves it out of the generic field and moves it into the only user (userstack_entry). Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--include/linux/ftrace_event.h1
-rw-r--r--kernel/trace/trace.c2
-rw-r--r--kernel/trace/trace.h1
-rw-r--r--kernel/trace/trace_events.c5
-rw-r--r--kernel/trace/trace_output.c2
5 files changed, 4 insertions, 7 deletions
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index 23f7179bf74e..06c795b536c2 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -34,7 +34,6 @@ struct trace_entry {
34 unsigned char flags; 34 unsigned char flags;
35 unsigned char preempt_count; 35 unsigned char preempt_count;
36 int pid; 36 int pid;
37 int tgid;
38}; 37};
39 38
40#define FTRACE_MAX_EVENT \ 39#define FTRACE_MAX_EVENT \
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 5c75deeefe30..1a37da2e8534 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -886,7 +886,6 @@ tracing_generic_entry_update(struct trace_entry *entry, unsigned long flags,
886 886
887 entry->preempt_count = pc & 0xff; 887 entry->preempt_count = pc & 0xff;
888 entry->pid = (tsk) ? tsk->pid : 0; 888 entry->pid = (tsk) ? tsk->pid : 0;
889 entry->tgid = (tsk) ? tsk->tgid : 0;
890 entry->flags = 889 entry->flags =
891#ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT 890#ifdef CONFIG_TRACE_IRQFLAGS_SUPPORT
892 (irqs_disabled_flags(flags) ? TRACE_FLAG_IRQS_OFF : 0) | 891 (irqs_disabled_flags(flags) ? TRACE_FLAG_IRQS_OFF : 0) |
@@ -1068,6 +1067,7 @@ ftrace_trace_userstack(struct ring_buffer *buffer, unsigned long flags, int pc)
1068 return; 1067 return;
1069 entry = ring_buffer_event_data(event); 1068 entry = ring_buffer_event_data(event);
1070 1069
1070 entry->tgid = current->tgid;
1071 memset(&entry->caller, 0, sizeof(entry->caller)); 1071 memset(&entry->caller, 0, sizeof(entry->caller));
1072 1072
1073 trace.nr_entries = 0; 1073 trace.nr_entries = 0;
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index acaa68060ebc..b69697b4b846 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -101,6 +101,7 @@ struct stack_entry {
101 101
102struct userstack_entry { 102struct userstack_entry {
103 struct trace_entry ent; 103 struct trace_entry ent;
104 unsigned int tgid;
104 unsigned long caller[FTRACE_STACK_ENTRIES]; 105 unsigned long caller[FTRACE_STACK_ENTRIES];
105}; 106};
106 107
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 78b1ed230177..28d92027a93c 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -86,7 +86,6 @@ int trace_define_common_fields(struct ftrace_event_call *call)
86 __common_field(unsigned char, flags); 86 __common_field(unsigned char, flags);
87 __common_field(unsigned char, preempt_count); 87 __common_field(unsigned char, preempt_count);
88 __common_field(int, pid); 88 __common_field(int, pid);
89 __common_field(int, tgid);
90 89
91 return ret; 90 return ret;
92} 91}
@@ -572,13 +571,11 @@ static int trace_write_header(struct trace_seq *s)
572 "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n" 571 "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n"
573 "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n" 572 "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n"
574 "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n" 573 "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n"
575 "\tfield:%s %s;\toffset:%zu;\tsize:%zu;\n"
576 "\n", 574 "\n",
577 FIELD(unsigned short, type), 575 FIELD(unsigned short, type),
578 FIELD(unsigned char, flags), 576 FIELD(unsigned char, flags),
579 FIELD(unsigned char, preempt_count), 577 FIELD(unsigned char, preempt_count),
580 FIELD(int, pid), 578 FIELD(int, pid));
581 FIELD(int, tgid));
582} 579}
583 580
584static ssize_t 581static ssize_t
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c
index e0c2545622e8..be34a6aa7e4d 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,
407 * since individual threads might have already quit! 407 * since individual threads might have already quit!
408 */ 408 */
409 rcu_read_lock(); 409 rcu_read_lock();
410 task = find_task_by_vpid(entry->ent.tgid); 410 task = find_task_by_vpid(entry->tgid);
411 if (task) 411 if (task)
412 mm = get_task_mm(task); 412 mm = get_task_mm(task);
413 rcu_read_unlock(); 413 rcu_read_unlock();