perf evsel: Display 0x for hex values when printing the attribute
authorAdrian Hunter <adrian.hunter@intel.com>
Thu, 11 Jun 2015 12:51:04 +0000 (15:51 +0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 11 Jun 2015 13:56:01 +0000 (10:56 -0300)
Need to display '0x' prefix for hex values otherwise it is not obvious
they are hex.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/1434027064-7554-1-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/evsel.c

index a3e36fc634dc40005e77f7b228ec8ffb5ad001af..d4f9994ae47fc6f594980ea828c31fb2e9ad4f11 100644 (file)
@@ -1058,7 +1058,7 @@ static void __p_read_format(char *buf, size_t size, u64 value)
 
 #define BUF_SIZE               1024
 
-#define p_hex(val)             snprintf(buf, BUF_SIZE, "%"PRIx64, (uint64_t)(val))
+#define p_hex(val)             snprintf(buf, BUF_SIZE, "%#"PRIx64, (uint64_t)(val))
 #define p_unsigned(val)                snprintf(buf, BUF_SIZE, "%"PRIu64, (uint64_t)(val))
 #define p_signed(val)          snprintf(buf, BUF_SIZE, "%"PRId64, (int64_t)(val))
 #define p_sample_type(val)     __p_sample_type(buf, BUF_SIZE, val)