From a0e84ac41863a6f98ea31fa7d7701b24c5288c4b Mon Sep 17 00:00:00 2001 From: Steven Rostedt Date: Wed, 3 Feb 2010 12:22:45 -0500 Subject: trace-graph: Fix compile warning on stupid guint64 and printf formats For some stupid reason glib defines guint64 inconsistantly on different platforms. Probably because the developers don't even test on more than one box. This patch adds u64 as unsigned long long and uses this to typecast the output for printf. Reported-by: Darren Hart Signed-off-by: Steven Rostedt --- trace-graph.c | 8 +++++--- trace-local.h | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/trace-graph.c b/trace-graph.c index 135e516..8e59cfd 100644 --- a/trace-graph.c +++ b/trace-graph.c @@ -886,14 +886,16 @@ static void draw_cpu_info(struct graph_info *ginfo, gint cpu, gint x, gint y) trace_seq_init(&s); - dprintf(3, "start=%zu end=%zu time=%lu\n", ginfo->start_time, ginfo->end_time, time); + dprintf(3, "start=%llu end=%llu time=%llu\n", + (u64)ginfo->start_time, (u64)ginfo->end_time, (u64)time); record = find_record_on_cpu(ginfo, cpu, time); if (record) { - dprintf(3, "record->ts=%llu time=%zu-%zu\n", - record->ts, time, time-(gint)(1/ginfo->resolution)); + dprintf(3, "record->ts=%llu time=%llu-%llu\n", + record->ts, (u64)time, + (u64)(time-(gint)(1/ginfo->resolution))); print_rec_info(record, pevent, cpu); /* diff --git a/trace-local.h b/trace-local.h index 9f49c24..03ef9ef 100644 --- a/trace-local.h +++ b/trace-local.h @@ -3,6 +3,9 @@ #include "trace-cmd.h" +/* fix stupid glib guint64 typecasts and printf formats */ +typedef unsigned long long u64; + /* for local shared information with trace-cmd executable */ void usage(char **argv); -- cgit v1.2.2