]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
amzn: use PRIu64 printf format string instead of llu
authorTokunori Ikegami <ikegami.t@gmail.com>
Wed, 18 Dec 2024 17:34:22 +0000 (02:34 +0900)
committerDaniel Wagner <wagi@monom.org>
Fri, 20 Dec 2024 08:32:28 +0000 (09:32 +0100)
To fix the cross compiler build fails.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
plugins/amzn/amzn-nvme.c

index 6038171b3805b4a219f042e3a8077c0f197d43d8..bba1cda130ffb1781d3365928737d30e1c8c2350 100644 (file)
@@ -108,8 +108,8 @@ static void amzn_print_latency_histogram(struct amzn_latency_histogram *hist)
        for (int b = 0; b < hist->num_bins && b < 64; b++) {
                struct amzn_latency_histogram_bin *bin = &hist->bins[b];
 
-               printf("[%-8llu - %-8llu] => %-8u\n",
-                      bin->lower, bin->upper, bin->count);
+               printf("[%-8"PRIu64" - %-8"PRIu64"] => %-8u\n",
+                      (uint64_t)bin->lower, (uint64_t)bin->upper, bin->count);
        }
 
        printf("=================================\n\n");
@@ -174,27 +174,27 @@ static void amzn_print_json_stats(struct amzn_latency_log_page *log)
 static void amzn_print_normal_stats(struct amzn_latency_log_page *log)
 {
        printf("Total Ops:\n");
-       printf("  Read: %llu\n", log->total_read_ops);
-       printf("  Write: %llu\n", log->total_write_ops);
+       printf("  Read: %"PRIu64"\n", (uint64_t)log->total_read_ops);
+       printf("  Write: %"PRIu64"\n", (uint64_t)log->total_write_ops);
        printf("Total Bytes:\n");
-       printf("  Read: %llu\n", log->total_read_bytes);
-       printf("  Write: %llu\n", log->total_write_bytes);
+       printf("  Read: %"PRIu64"\n", (uint64_t)log->total_read_bytes);
+       printf("  Write: %"PRIu64"\n", (uint64_t)log->total_write_bytes);
        printf("Total Time (us):\n");
-       printf("  Read: %llu\n", log->total_read_time);
-       printf("  Write: %llu\n\n", log->total_write_time);
+       printf("  Read: %"PRIu64"\n", (uint64_t)log->total_read_time);
+       printf("  Write: %"PRIu64"\n\n", (uint64_t)log->total_write_time);
 
        printf("EBS Volume Performance Exceeded (us):\n");
-       printf("  IOPS: %llu\n", log->ebs_volume_performance_exceeded_iops);
-       printf("  Throughput: %llu\n\n",
-              log->ebs_volume_performance_exceeded_tp);
+       printf("  IOPS: %"PRIu64"\n", (uint64_t)log->ebs_volume_performance_exceeded_iops);
+       printf("  Throughput: %"PRIu64"\n\n",
+              (uint64_t)log->ebs_volume_performance_exceeded_tp);
        printf("EC2 Instance EBS Performance Exceeded (us):\n");
-       printf("  IOPS: %llu\n",
-              log->ec2_instance_ebs_performance_exceeded_iops);
-       printf("  Throughput: %llu\n\n",
-              log->ec2_instance_ebs_performance_exceeded_tp);
+       printf("  IOPS: %"PRIu64"\n",
+              (uint64_t)log->ec2_instance_ebs_performance_exceeded_iops);
+       printf("  Throughput: %"PRIu64"\n\n",
+              (uint64_t)log->ec2_instance_ebs_performance_exceeded_tp);
 
-       printf("Queue Length (point in time): %llu\n\n",
-              log->volume_queue_length);
+       printf("Queue Length (point in time): %"PRIu64"\n\n",
+              (uint64_t)log->volume_queue_length);
 
        printf("Read IO Latency Histogram\n");
        amzn_print_latency_histogram(&log->read_io_latency_histogram);