diff options
author | Adrien Mahieux <adrien.mahieux@gmail.com> | 2020-10-22 12:12:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-22 13:12:08 +0300 |
commit | c4923783ed130c923e780d08ea8c507311a76aad (patch) | |
tree | 783661309b740d13033aa25b44b40fddf863f412 /collectors | |
parent | 9dd503dcd92aba102b1d390e7aed652c7f76e5d7 (diff) |
Fix platform dependent printf format (#10120)
Diffstat (limited to 'collectors')
-rw-r--r-- | collectors/perf.plugin/perf_plugin.c | 2 | ||||
-rw-r--r-- | collectors/slabinfo.plugin/slabinfo.c | 18 |
2 files changed, 10 insertions, 10 deletions
diff --git a/collectors/perf.plugin/perf_plugin.c b/collectors/perf.plugin/perf_plugin.c index c645c2798f..9fe3c5e079 100644 --- a/collectors/perf.plugin/perf_plugin.c +++ b/collectors/perf.plugin/perf_plugin.c @@ -422,7 +422,7 @@ static int perf_collect() { } } - if(unlikely(debug)) fprintf(stderr, "perf.plugin: successfully read event id = %u, value = %lu\n", current_event->id, current_event->value); + if(unlikely(debug)) fprintf(stderr, "perf.plugin: successfully read event id = %u, value = %"PRIu64"\n", current_event->id, current_event->value); } if(unlikely(perf_events[EV_ID_CPU_CYCLES].value == prev_cpu_cycles_value)) diff --git a/collectors/slabinfo.plugin/slabinfo.c b/collectors/slabinfo.plugin/slabinfo.c index b92bc8ac2f..00e0d39134 100644 --- a/collectors/slabinfo.plugin/slabinfo.c +++ b/collectors/slabinfo.plugin/slabinfo.c @@ -163,12 +163,12 @@ struct slabinfo *read_file_slabinfo() { slabdebug("-> Reading procfile %s", PLUGIN_SLABINFO_PROCFILE); static procfile *ff = NULL; - static long slab_pagesize = 0; + static long slab_pagesize = 0; - if (unlikely(!slab_pagesize)) { - slab_pagesize = sysconf(_SC_PAGESIZE); - slabdebug(" Discovered pagesize: %ld", slab_pagesize); - } + if (unlikely(!slab_pagesize)) { + slab_pagesize = sysconf(_SC_PAGESIZE); + slabdebug(" Discovered pagesize: %ld", slab_pagesize); + } if(unlikely(!ff)) { ff = procfile_reopen(ff, PLUGIN_SLABINFO_PROCFILE, " ,:" , PROCFILE_FLAG_DEFAULT); @@ -191,7 +191,7 @@ struct slabinfo *read_file_slabinfo() { slabdebug(" Read %lu lines from procfile", (unsigned long)lines); for(l = 2; l < lines; l++) { if (unlikely(procfile_linewords(ff, l) < 14)) { - slabdebug(" Line %lu has only %lu words, skipping", (unsigned long)l, procfile_linewords(ff,l)); + slabdebug(" Line %zu has only %zu words, skipping", l, procfile_linewords(ff,l)); continue; } @@ -231,7 +231,7 @@ struct slabinfo *read_file_slabinfo() { else s->obj_filling = 0; - slabdebug(" Updated slab %s: %lu %lu %lu %lu %lu / %lu %lu %lu / %lu %lu %lu / %lu %lu %hhu", + slabdebug(" Updated slab %s: %"PRIu64" %"PRIu64" %"PRIu64" %"PRIu64" %"PRIu64" / %"PRIu64" %"PRIu64" %"PRIu64" / %"PRIu64" %"PRIu64" %"PRIu64" / %"PRIu64" %"PRIu64" %hhu", name, s->active_objs, s->num_objs, s->obj_size, s->obj_per_slab, s->pages_per_slab, s->tune_limit, s->tune_batchcnt, s->tune_shared_factor, s->data_active_slabs, s->data_num_slabs, s->data_shared_avail, @@ -304,7 +304,7 @@ unsigned int do_slab_stats(int update_every) { , "slabmemory" ); for (s = sactive; s; s = s->next) { - printf("SET %s = %lu\n" + printf("SET %s = %"PRIu64"\n" , s->name , s->mem_usage ); @@ -334,7 +334,7 @@ unsigned int do_slab_stats(int update_every) { , "slabwaste" ); for (s = sactive; s; s = s->next) { - printf("SET %s = %lu\n" + printf("SET %s = %"PRIu64"\n" , s->name , s->mem_waste ); |