diff options
Diffstat (limited to 'trace-graph.c')
-rw-r--r-- | trace-graph.c | 82 |
1 files changed, 47 insertions, 35 deletions
diff --git a/trace-graph.c b/trace-graph.c index 1ce3d47..c0f88c9 100644 --- a/trace-graph.c +++ b/trace-graph.c | |||
@@ -1859,7 +1859,7 @@ static void draw_plot(struct graph_info *ginfo, struct graph_plot *plot, | |||
1859 | plot->p1, plot->p2, ginfo->draw_width, width_16, font); | 1859 | plot->p1, plot->p2, ginfo->draw_width, width_16, font); |
1860 | } | 1860 | } |
1861 | 1861 | ||
1862 | static void draw_ft_plots(struct graph_info *ginfo) | 1862 | static void draw_hashed_plots(struct graph_info *ginfo) |
1863 | { | 1863 | { |
1864 | gint cpu, pid; | 1864 | gint cpu, pid; |
1865 | struct record *record; | 1865 | struct record *record; |
@@ -1881,8 +1881,8 @@ static void draw_ft_plots(struct graph_info *ginfo) | |||
1881 | hash = trace_graph_plot_find_cpu(ginfo, cpu); | 1881 | hash = trace_graph_plot_find_cpu(ginfo, cpu); |
1882 | if (hash) { | 1882 | if (hash) { |
1883 | for (list = hash->plots; list; list = list->next) { | 1883 | for (list = hash->plots; list; list = list->next) { |
1884 | if (list->plot->time != TIME_TYPE_FT) | 1884 | /* if (list->plot->time != TIME_TYPE_FT) */ |
1885 | continue; | 1885 | /* continue; */ |
1886 | draw_plot(ginfo, list->plot, record); | 1886 | draw_plot(ginfo, list->plot, record); |
1887 | } | 1887 | } |
1888 | } | 1888 | } |
@@ -1890,44 +1890,52 @@ static void draw_ft_plots(struct graph_info *ginfo) | |||
1890 | hash = trace_graph_plot_find_task(ginfo, pid); | 1890 | hash = trace_graph_plot_find_task(ginfo, pid); |
1891 | if (hash) { | 1891 | if (hash) { |
1892 | for (list = hash->plots; list; list = list->next) { | 1892 | for (list = hash->plots; list; list = list->next) { |
1893 | if (list->plot->time != TIME_TYPE_FT) | 1893 | /* if (list->plot->time != TIME_TYPE_FT) */ |
1894 | continue; | 1894 | /* continue; */ |
1895 | draw_plot(ginfo, list->plot, record); | 1895 | draw_plot(ginfo, list->plot, record); |
1896 | } | 1896 | } |
1897 | } | 1897 | } |
1898 | for (list = ginfo->all_recs; list; list = list->next) { | 1898 | for (list = ginfo->all_recs; list; list = list->next) { |
1899 | if (list->plot->time != TIME_TYPE_FT) | 1899 | /* if (list->plot->time != TIME_TYPE_FT) */ |
1900 | continue; | 1900 | /* continue; */ |
1901 | draw_plot(ginfo, list->plot, record); | 1901 | // TODO: hacky assumption that everything else can be |
1902 | // reached via previous hashes | ||
1903 | // Should be an additional hashed list where things are | ||
1904 | // added with arbitrary numbers, and a pevent_other_id | ||
1905 | // which uses id ranges x < . < y to parse cids or lids | ||
1906 | if (list->plot->type == PLOT_TYPE_SERVER_TASK || | ||
1907 | list->plot->type == PLOT_TYPE_SERVER_CPU) { | ||
1908 | draw_plot(ginfo, list->plot, record); | ||
1909 | } | ||
1902 | } | 1910 | } |
1903 | free_record(record); | 1911 | free_record(record); |
1904 | } | 1912 | } |
1905 | } | 1913 | } |
1906 | 1914 | ||
1907 | static void draw_rt_plots(struct graph_info *ginfo) | 1915 | /* static void draw_rt_plots(struct graph_info *ginfo) */ |
1908 | { | 1916 | /* { */ |
1909 | gint cpu; | 1917 | /* gint cpu; */ |
1910 | struct record *record; | 1918 | /* struct record *record; */ |
1911 | struct plot_list *list; | 1919 | /* struct plot_list *list; */ |
1912 | 1920 | ||
1913 | set_cpus_to_rts(ginfo, ginfo->view_start_time); | 1921 | /* set_cpus_to_rts(ginfo, ginfo->view_start_time); */ |
1914 | while ((record = tracecmd_read_next_data(ginfo->handle, &cpu))) { | 1922 | /* while ((record = tracecmd_read_next_data(ginfo->handle, &cpu))) { */ |
1915 | if (get_rts(ginfo, record) < ginfo->view_start_time) { | 1923 | /* if (get_rts(ginfo, record) < ginfo->view_start_time) { */ |
1916 | free_record(record); | 1924 | /* free_record(record); */ |
1917 | continue; | 1925 | /* continue; */ |
1918 | } | 1926 | /* } */ |
1919 | if (get_rts(ginfo, record) > ginfo->view_end_time) { | 1927 | /* if (get_rts(ginfo, record) > ginfo->view_end_time) { */ |
1920 | free_record(record); | 1928 | /* free_record(record); */ |
1921 | break; | 1929 | /* break; */ |
1922 | } | 1930 | /* } */ |
1923 | for (list = ginfo->all_recs; list; list = list->next) { | 1931 | /* for (list = ginfo->all_recs; list; list = list->next) { */ |
1924 | if (list->plot->time != TIME_TYPE_RT) | 1932 | /* if (list->plot->time != TIME_TYPE_RT) */ |
1925 | continue; | 1933 | /* continue; */ |
1926 | draw_plot(ginfo, list->plot, record); | 1934 | /* draw_plot(ginfo, list->plot, record); */ |
1927 | } | 1935 | /* } */ |
1928 | free_record(record); | 1936 | /* free_record(record); */ |
1929 | } | 1937 | /* } */ |
1930 | } | 1938 | /* } */ |
1931 | 1939 | ||
1932 | static void draw_plots(struct graph_info *ginfo, gint new_width) | 1940 | static void draw_plots(struct graph_info *ginfo, gint new_width) |
1933 | { | 1941 | { |
@@ -1984,8 +1992,7 @@ static void draw_plots(struct graph_info *ginfo, gint new_width) | |||
1984 | goto out; | 1992 | goto out; |
1985 | } | 1993 | } |
1986 | 1994 | ||
1987 | draw_ft_plots(ginfo); | 1995 | draw_hashed_plots(ginfo); |
1988 | draw_rt_plots(ginfo); | ||
1989 | 1996 | ||
1990 | out: | 1997 | out: |
1991 | for (i = 0; i < ginfo->plots; i++) { | 1998 | for (i = 0; i < ginfo->plots; i++) { |
@@ -2324,6 +2331,8 @@ static void redraw_pixmap_backend(struct graph_info *ginfo) | |||
2324 | } | 2331 | } |
2325 | } | 2332 | } |
2326 | 2333 | ||
2334 | static int tries = 0; | ||
2335 | |||
2327 | static gboolean | 2336 | static gboolean |
2328 | configure_event(GtkWidget *widget, GdkEventMotion *event, gpointer data) | 2337 | configure_event(GtkWidget *widget, GdkEventMotion *event, gpointer data) |
2329 | { | 2338 | { |
@@ -2331,7 +2340,10 @@ configure_event(GtkWidget *widget, GdkEventMotion *event, gpointer data) | |||
2331 | 2340 | ||
2332 | gtk_widget_set_size_request(widget, ginfo->draw_width, ginfo->draw_height); | 2341 | gtk_widget_set_size_request(widget, ginfo->draw_width, ginfo->draw_height); |
2333 | 2342 | ||
2334 | redraw_pixmap_backend(ginfo); | 2343 | // TODO: don't do this, compare widget to figure out if we should redraw |
2344 | if (tries != 1 && tries != 2) | ||
2345 | redraw_pixmap_backend(ginfo); | ||
2346 | ++tries; | ||
2335 | 2347 | ||
2336 | /* debug */ | 2348 | /* debug */ |
2337 | ginfo->hadj_value = gtk_adjustment_get_value(ginfo->hadj); | 2349 | ginfo->hadj_value = gtk_adjustment_get_value(ginfo->hadj); |