#include <stdint.h>
#include <unistd.h>
#include <sys/ioctl.h>
+#include <asm/byteorder.h>
+#include <inttypes.h>
#ifdef LIBUDEV_EXISTS
#include <libudev.h>
#endif
{
int i;
- printf("Discovery Log Number of Records %d, Generation counter %lld\n",
- numrec, log->genctr);
+ printf("Discovery Log Number of Records %d, Generation counter %"PRIu64"\n",
+ numrec, __le64_to_cpu(log->genctr));
for (i = 0; i < numrec; i++) {
struct nvmf_disc_rsp_page_entry *e = &log->entries[i];
#include <stdlib.h>
#include <unistd.h>
#include <linux/fs.h>
+#include <inttypes.h>
+#include <asm/byteorder.h>
#include "linux/nvme_ioctl.h"
{
printf(" Intel Temperature Statistics\n");
printf("--------------------------------\n");
- printf("Current temperature : %llu\n", stats->curr);
- printf("Last critical overtemp flag : %llu\n", stats->last_overtemp);
- printf("Life critical overtemp flag : %llu\n", stats->life_overtemp);
- printf("Highest temperature : %llu\n", stats->highest_temp);
- printf("Lowest temperature : %llu\n", stats->lowest_temp);
- printf("Max operating temperature : %llu\n", stats->max_operating_temp);
- printf("Min operating temperature : %llu\n", stats->min_operating_temp);
- printf("Estimated offset : %llu\n", stats->est_offset);
+ printf("Current temperature : %"PRIu64"\n", __le64_to_cpu(stats->curr));
+ printf("Last critical overtemp flag : %"PRIu64"\n", __le64_to_cpu(stats->last_overtemp));
+ printf("Life critical overtemp flag : %"PRIu64"\n", __le64_to_cpu(stats->life_overtemp));
+ printf("Highest temperature : %"PRIu64"\n", __le64_to_cpu(stats->highest_temp));
+ printf("Lowest temperature : %"PRIu64"\n", __le64_to_cpu(stats->lowest_temp));
+ printf("Max operating temperature : %"PRIu64"\n", __le64_to_cpu(stats->max_operating_temp));
+ printf("Min operating temperature : %"PRIu64"\n", __le64_to_cpu(stats->min_operating_temp));
+ printf("Estimated offset : %"PRIu64"\n", __le64_to_cpu(stats->est_offset));
}
static int get_temp_stats_log(int argc, char **argv, struct command *cmd, struct plugin *plugin)