aboutsummaryrefslogtreecommitdiffstats
path: root/trace-graph.c
diff options
context:
space:
mode:
Diffstat (limited to 'trace-graph.c')
-rw-r--r--trace-graph.c69
1 files changed, 34 insertions, 35 deletions
diff --git a/trace-graph.c b/trace-graph.c
index c0f88c9..f9bd4af 100644
--- a/trace-graph.c
+++ b/trace-graph.c
@@ -1859,30 +1859,57 @@ 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
1862static void draw_hashed_plots(struct graph_info *ginfo) 1863static void draw_hashed_plots(struct graph_info *ginfo)
1863{ 1864{
1864 gint cpu, pid; 1865 gint cpu, pid;
1866 gboolean started;
1865 struct record *record; 1867 struct record *record;
1866 struct plot_hash *hash; 1868 struct plot_hash *hash;
1867 struct plot_list *list; 1869 struct plot_list *list;
1868 1870
1871 set_cpus_to_rts(ginfo, ginfo->view_start_time);
1869 1872
1870 tracecmd_set_all_cpus_to_timestamp(ginfo->handle,
1871 ginfo->view_start_time);
1872 while ((record = tracecmd_read_next_data(ginfo->handle, &cpu))) { 1873 while ((record = tracecmd_read_next_data(ginfo->handle, &cpu))) {
1873 if (record->ts < ginfo->view_start_time) { 1874 if (get_rts(ginfo, record) < ginfo->view_start_time) {
1874 free_record(record); 1875 free_record(record);
1875 continue; 1876 continue;
1876 } 1877 }
1877 if (record->ts > ginfo->view_end_time) { 1878 if (get_rts(ginfo, record) > ginfo->view_end_time) {
1878 free_record(record); 1879 free_record(record);
1879 break; 1880 break;
1880 } 1881 }
1882
1883 // TODO: hack to clean up until first release, make unhacky
1884 if (ginfo->rtg_info.clean_records &&
1885 ginfo->rtg_info.start_time == 0) {
1886 unsigned long long dull, rel = 0;
1887 char *dchar;
1888 int dint;
1889
1890 // These methods add to the lists of tasks / containers
1891 // in the system whenever a new param record is found.
1892 // Skipping these records would be very bad, so parse
1893 // them here if we are cleaning. Otherwise, draw_plot
1894 // will take care of this
1895#define ARG ginfo,record, &pid
1896 rt_graph_check_task_param(ARG, &dull, &dull);
1897 rt_graph_check_container_param(ARG, &dchar);
1898 rt_graph_check_server_param(ARG, &dint, &dull, &dull);
1899#undef ARG
1900 if (rt_graph_check_sys_release(ginfo, record, &rel)) {
1901 dull = rel - .1 * (ginfo->view_end_time - rel);;
1902 ginfo->rtg_info.start_time = dull;
1903 ginfo->view_start_time = dull;
1904 }
1905
1906 free_record(record);
1907 continue;
1908 }
1909
1881 hash = trace_graph_plot_find_cpu(ginfo, cpu); 1910 hash = trace_graph_plot_find_cpu(ginfo, cpu);
1882 if (hash) { 1911 if (hash) {
1883 for (list = hash->plots; list; list = list->next) { 1912 for (list = hash->plots; list; list = list->next) {
1884 /* if (list->plot->time != TIME_TYPE_FT) */
1885 /* continue; */
1886 draw_plot(ginfo, list->plot, record); 1913 draw_plot(ginfo, list->plot, record);
1887 } 1914 }
1888 } 1915 }
@@ -1890,14 +1917,10 @@ static void draw_hashed_plots(struct graph_info *ginfo)
1890 hash = trace_graph_plot_find_task(ginfo, pid); 1917 hash = trace_graph_plot_find_task(ginfo, pid);
1891 if (hash) { 1918 if (hash) {
1892 for (list = hash->plots; list; list = list->next) { 1919 for (list = hash->plots; list; list = list->next) {
1893 /* if (list->plot->time != TIME_TYPE_FT) */
1894 /* continue; */
1895 draw_plot(ginfo, list->plot, record); 1920 draw_plot(ginfo, list->plot, record);
1896 } 1921 }
1897 } 1922 }
1898 for (list = ginfo->all_recs; list; list = list->next) { 1923 for (list = ginfo->all_recs; list; list = list->next) {
1899 /* if (list->plot->time != TIME_TYPE_FT) */
1900 /* continue; */
1901 // TODO: hacky assumption that everything else can be 1924 // TODO: hacky assumption that everything else can be
1902 // reached via previous hashes 1925 // reached via previous hashes
1903 // Should be an additional hashed list where things are 1926 // Should be an additional hashed list where things are
@@ -1912,30 +1935,6 @@ static void draw_hashed_plots(struct graph_info *ginfo)
1912 } 1935 }
1913} 1936}
1914 1937
1915/* static void draw_rt_plots(struct graph_info *ginfo) */
1916/* { */
1917/* gint cpu; */
1918/* struct record *record; */
1919/* struct plot_list *list; */
1920
1921/* set_cpus_to_rts(ginfo, ginfo->view_start_time); */
1922/* while ((record = tracecmd_read_next_data(ginfo->handle, &cpu))) { */
1923/* if (get_rts(ginfo, record) < ginfo->view_start_time) { */
1924/* free_record(record); */
1925/* continue; */
1926/* } */
1927/* if (get_rts(ginfo, record) > ginfo->view_end_time) { */
1928/* free_record(record); */
1929/* break; */
1930/* } */
1931/* for (list = ginfo->all_recs; list; list = list->next) { */
1932/* if (list->plot->time != TIME_TYPE_RT) */
1933/* continue; */
1934/* draw_plot(ginfo, list->plot, record); */
1935/* } */
1936/* free_record(record); */
1937/* } */
1938/* } */
1939 1938
1940static void draw_plots(struct graph_info *ginfo, gint new_width) 1939static void draw_plots(struct graph_info *ginfo, gint new_width)
1941{ 1940{
@@ -2341,7 +2340,7 @@ configure_event(GtkWidget *widget, GdkEventMotion *event, gpointer data)
2341 gtk_widget_set_size_request(widget, ginfo->draw_width, ginfo->draw_height); 2340 gtk_widget_set_size_request(widget, ginfo->draw_width, ginfo->draw_height);
2342 2341
2343 // TODO: don't do this, compare widget to figure out if we should redraw 2342 // TODO: don't do this, compare widget to figure out if we should redraw
2344 if (tries != 1 && tries != 2) 2343 if (tries != 2)
2345 redraw_pixmap_backend(ginfo); 2344 redraw_pixmap_backend(ginfo);
2346 ++tries; 2345 ++tries;
2347 2346