perf data: Fix building in 32 bit platform with libbabeltrace
authorWang Nan <wangnan0@huawei.com>
Wed, 28 Sep 2016 03:58:46 +0000 (03:58 +0000)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 28 Sep 2016 13:38:20 +0000 (10:38 -0300)
On ARM32 building it report following error when we build with
libbabeltrace:

  util/data-convert-bt.c: In function 'add_bpf_output_values':
  util/data-convert-bt.c:440:3: error: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'unsigned int' [-Werror=format]
  cc1: all warnings being treated as errors

Fix it by changing %lu to %zu.

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Zefan Li <lizefan@huawei.com>
Cc: pi3orama@163.com
Fixes: 6122d57e9f7c ("perf data: Support converting data from bpf_perf_event_output()")
Link: http://lkml.kernel.org/r/1475035126-146587-1-git-send-email-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/data-convert-bt.c

index 4f979bb27b6ce535c1a1c9c19c1683ed52fcbf1c..7123f4de32ccbc4beb835260b25a9ca08df789f1 100644 (file)
@@ -437,7 +437,7 @@ add_bpf_output_values(struct bt_ctf_event_class *event_class,
        int ret;
 
        if (nr_elements * sizeof(u32) != raw_size)
-               pr_warning("Incorrect raw_size (%u) in bpf output event, skip %lu bytes\n",
+               pr_warning("Incorrect raw_size (%u) in bpf output event, skip %zu bytes\n",
                           raw_size, nr_elements * sizeof(u32) - raw_size);
 
        len_type = bt_ctf_event_class_get_field_by_name(event_class, "raw_len");