aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-12-17 21:24:09 -0500
committerSteven Rostedt <rostedt@goodmis.org>2009-12-17 22:55:48 -0500
commitf968bf78e41d3ee23fc185c3b12f9990c840641f (patch)
treefc064184c0726c7ba20c90bb9ed4d7cb10a83f04
parent0e861e7f795e33abb4d20e191ba97c36525ed0b3 (diff)
trace-graph: Add new cmdlines via sched_switch
The cmdline cache used by ftrace only saves 100 cmdlines. But if there's more tasks than cmdlines, then we will end up with a lot with <...>. This looks at sched_switch and will add comms if they are found. Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--trace-graph.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/trace-graph.c b/trace-graph.c
index 1f5e4cf..48a41e6 100644
--- a/trace-graph.c
+++ b/trace-graph.c
@@ -705,7 +705,7 @@ static void draw_event_label(struct graph_info *ginfo, gint cpu,
705} 705}
706 706
707static void draw_cpu(struct graph_info *ginfo, gint cpu, 707static void draw_cpu(struct graph_info *ginfo, gint cpu,
708 gint new_width) 708 gint new_width, int read_comms)
709{ 709{
710 static PangoFontDescription *font; 710 static PangoFontDescription *font;
711 PangoLayout *layout; 711 PangoLayout *layout;
@@ -721,6 +721,7 @@ static void draw_cpu(struct graph_info *ginfo, gint cpu,
721 gint p1 = 0, p2 = 0, p3 = 0; 721 gint p1 = 0, p2 = 0, p3 = 0;
722 gint last_event_id = 0; 722 gint last_event_id = 0;
723 gint event_id; 723 gint event_id;
724 const char *comm;
724 725
725 /* Calculate the size of 16 characters */ 726 /* Calculate the size of 16 characters */
726 if (!width_16) { 727 if (!width_16) {
@@ -757,7 +758,17 @@ static void draw_cpu(struct graph_info *ginfo, gint cpu,
757 x = (gint)((gdouble)ts * ginfo->resolution); 758 x = (gint)((gdouble)ts * ginfo->resolution);
758 759
759 760
760 if (!check_sched_switch(ginfo, record, &pid, NULL)) 761 if (check_sched_switch(ginfo, record, &pid, &comm)) {
762 if (read_comms) {
763 /*
764 * First time through, register any missing
765 * comm / pid mappings.
766 */
767 if (!pevent_pid_is_registered(ginfo->pevent, pid))
768 pevent_register_comm(ginfo->pevent,
769 strdup(comm), pid);
770 }
771 } else
761 pid = pevent_data_pid(ginfo->pevent, record); 772 pid = pevent_data_pid(ginfo->pevent, record);
762 773
763 event_id = pevent_data_type(ginfo->pevent, record); 774 event_id = pevent_data_type(ginfo->pevent, record);
@@ -912,6 +923,7 @@ static void draw_timeline(struct graph_info *ginfo, gint width)
912static void draw_info(struct graph_info *ginfo, 923static void draw_info(struct graph_info *ginfo,
913 gint new_width) 924 gint new_width)
914{ 925{
926 static int read_comms = 1;
915 gint cpu; 927 gint cpu;
916 928
917 ginfo->resolution = (gdouble)new_width / (gdouble)(ginfo->view_end_time - 929 ginfo->resolution = (gdouble)new_width / (gdouble)(ginfo->view_end_time -
@@ -921,8 +933,9 @@ static void draw_info(struct graph_info *ginfo,
921 933
922 934
923 for (cpu = 0; cpu < ginfo->cpus; cpu++) 935 for (cpu = 0; cpu < ginfo->cpus; cpu++)
924 draw_cpu(ginfo, cpu, new_width); 936 draw_cpu(ginfo, cpu, new_width, read_comms);
925 937
938 read_comms = 0;
926} 939}
927 940
928static gboolean 941static gboolean