From 7a67bb21f120fc0da6943a5557ef5af06d881ff0 Mon Sep 17 00:00:00 2001 From: Jonathan Herman Date: Sat, 29 Sep 2012 17:25:55 -0400 Subject: Initial viewing area size determined using rt-timestamps, not ftrace timestamps. --- rt-plot.c | 13 +++++++++---- rt-plot.h | 4 ++-- set_debug.sh | 2 +- trace-graph.c | 6 +++--- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/rt-plot.c b/rt-plot.c index 4065424..a86b7df 100644 --- a/rt-plot.c +++ b/rt-plot.c @@ -377,7 +377,7 @@ next_rts(struct graph_info *ginfo, int cpu, unsigned long long ft_target) * The @cpu seek location will be placed before the given time, but will * not necessarily be placed _right_ before the time. */ -void +unsigned long long set_cpu_to_rts(struct graph_info *ginfo, unsigned long long rt_target, int cpu) { struct record *record; @@ -429,16 +429,21 @@ set_cpu_to_rts(struct graph_info *ginfo, unsigned long long rt_target, int cpu) free_record(record); } else tracecmd_set_cpu_to_timestamp(ginfo->handle, cpu, seek_time); + return rts; } /** * set_cpus_to_time - seek all cpus to real-time @rt_target */ -void set_cpus_to_rts(struct graph_info *ginfo, unsigned long long rt_target) +unsigned long long set_cpus_to_rts(struct graph_info *ginfo, unsigned long long rt_target) { int cpu; - for (cpu = 0; cpu < ginfo->cpus; cpu++) - set_cpu_to_rts(ginfo, rt_target, cpu); + unsigned long long min_rts = ULLONG_MAX; + for (cpu = 0; cpu < ginfo->cpus; cpu++) { + unsigned long long rts = set_cpu_to_rts(ginfo, rt_target, cpu); + min_rts = MIN(min_rts, rts); + } + return min_rts; } diff --git a/rt-plot.h b/rt-plot.h index ef609bb..a1cf98e 100644 --- a/rt-plot.h +++ b/rt-plot.h @@ -70,9 +70,9 @@ find_rt_display_record(struct graph_info *ginfo, unsigned long long next_rts(struct graph_info *ginfo, int cpu, unsigned long long ft_target); -void set_cpu_to_rts(struct graph_info *ginfo, +unsigned long long set_cpu_to_rts(struct graph_info *ginfo, unsigned long long rt_target, int cpu); -void set_cpus_to_rts(struct graph_info *ginfo, +unsigned long long set_cpus_to_rts(struct graph_info *ginfo, unsigned long long rt_target); int is_task_running(struct graph_info *ginfo, unsigned long long time, diff --git a/set_debug.sh b/set_debug.sh index 95a8c74..19bb76c 100755 --- a/set_debug.sh +++ b/set_debug.sh @@ -1,4 +1,4 @@ #!/bin/bash -PATTERN="(define debug[a-z_]+\s*)[0-9]+" +PATTERN="(define debug[a-z_]+\s*)[-0-9]+" sed -ri "s/$PATTERN/\\1$1/gi" *.[ch] grep -HirE "$PATTERN" *.[ch] \ No newline at end of file diff --git a/trace-graph.c b/trace-graph.c index c2f3574..58baf79 100644 --- a/trace-graph.c +++ b/trace-graph.c @@ -1915,7 +1915,7 @@ static void draw_hashed_plots(struct graph_info *ginfo) rt_graph_check_server_param(ARG, &dint, &dull, &dull); #undef ARG if (rt_graph_check_sys_release(ginfo, record, &rel)) { - min_time = rel + ginfo->rtg_info.start_offset * NSECS_PER_SEC; + min_time = rel; ginfo->rtg_info.start_time = min_time; ginfo->view_start_time = min_time; ginfo->start_time = min_time; @@ -2542,7 +2542,7 @@ static int load_handle(struct graph_info *ginfo, continue; if (record->ts < ginfo->start_time) - ginfo->start_time = record->ts; + ginfo->start_time = get_rts(ginfo, record); free_record(record); record = tracecmd_read_cpu_last(handle, cpu); @@ -2550,7 +2550,7 @@ static int load_handle(struct graph_info *ginfo, continue; if (record->ts > ginfo->end_time) - ginfo->end_time = record->ts; + ginfo->end_time = get_rts(ginfo, record); free_record(record); } -- cgit v1.2.2