diff options
author | Steven Rostedt <srostedt@redhat.com> | 2010-02-03 12:22:45 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2010-02-03 12:24:42 -0500 |
commit | a0e84ac41863a6f98ea31fa7d7701b24c5288c4b (patch) | |
tree | e6a2c0d09a90ee9d666a96d50defa8a02368556b | |
parent | 8abd334d53527c279ec17b481323782405b383d1 (diff) |
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 <dvhltc@us.ibm.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | trace-graph.c | 8 | ||||
-rw-r--r-- | 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) | |||
886 | 886 | ||
887 | trace_seq_init(&s); | 887 | trace_seq_init(&s); |
888 | 888 | ||
889 | dprintf(3, "start=%zu end=%zu time=%lu\n", ginfo->start_time, ginfo->end_time, time); | 889 | dprintf(3, "start=%llu end=%llu time=%llu\n", |
890 | (u64)ginfo->start_time, (u64)ginfo->end_time, (u64)time); | ||
890 | 891 | ||
891 | record = find_record_on_cpu(ginfo, cpu, time); | 892 | record = find_record_on_cpu(ginfo, cpu, time); |
892 | 893 | ||
893 | if (record) { | 894 | if (record) { |
894 | 895 | ||
895 | dprintf(3, "record->ts=%llu time=%zu-%zu\n", | 896 | dprintf(3, "record->ts=%llu time=%llu-%llu\n", |
896 | record->ts, time, time-(gint)(1/ginfo->resolution)); | 897 | record->ts, (u64)time, |
898 | (u64)(time-(gint)(1/ginfo->resolution))); | ||
897 | print_rec_info(record, pevent, cpu); | 899 | print_rec_info(record, pevent, cpu); |
898 | 900 | ||
899 | /* | 901 | /* |
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 @@ | |||
3 | 3 | ||
4 | #include "trace-cmd.h" | 4 | #include "trace-cmd.h" |
5 | 5 | ||
6 | /* fix stupid glib guint64 typecasts and printf formats */ | ||
7 | typedef unsigned long long u64; | ||
8 | |||
6 | /* for local shared information with trace-cmd executable */ | 9 | /* for local shared information with trace-cmd executable */ |
7 | 10 | ||
8 | void usage(char **argv); | 11 | void usage(char **argv); |