aboutsummaryrefslogtreecommitdiffstats
path: root/rt-plot.c
diff options
context:
space:
mode:
Diffstat (limited to 'rt-plot.c')
-rw-r--r--rt-plot.c13
1 files changed, 9 insertions, 4 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)
377 * The @cpu seek location will be placed before the given time, but will 377 * The @cpu seek location will be placed before the given time, but will
378 * not necessarily be placed _right_ before the time. 378 * not necessarily be placed _right_ before the time.
379 */ 379 */
380void 380unsigned long long
381set_cpu_to_rts(struct graph_info *ginfo, unsigned long long rt_target, int cpu) 381set_cpu_to_rts(struct graph_info *ginfo, unsigned long long rt_target, int cpu)
382{ 382{
383 struct record *record; 383 struct record *record;
@@ -429,16 +429,21 @@ set_cpu_to_rts(struct graph_info *ginfo, unsigned long long rt_target, int cpu)
429 free_record(record); 429 free_record(record);
430 } else 430 } else
431 tracecmd_set_cpu_to_timestamp(ginfo->handle, cpu, seek_time); 431 tracecmd_set_cpu_to_timestamp(ginfo->handle, cpu, seek_time);
432 return rts;
432} 433}
433 434
434/** 435/**
435 * set_cpus_to_time - seek all cpus to real-time @rt_target 436 * set_cpus_to_time - seek all cpus to real-time @rt_target
436 */ 437 */
437void set_cpus_to_rts(struct graph_info *ginfo, unsigned long long rt_target) 438unsigned long long set_cpus_to_rts(struct graph_info *ginfo, unsigned long long rt_target)
438{ 439{
439 int cpu; 440 int cpu;
440 for (cpu = 0; cpu < ginfo->cpus; cpu++) 441 unsigned long long min_rts = ULLONG_MAX;
441 set_cpu_to_rts(ginfo, rt_target, cpu); 442 for (cpu = 0; cpu < ginfo->cpus; cpu++) {
443 unsigned long long rts = set_cpu_to_rts(ginfo, rt_target, cpu);
444 min_rts = MIN(min_rts, rts);
445 }
446 return min_rts;
442} 447}
443 448
444 449