Skip to contentSkip to conversation

perf tools: Display 0x for hex values when printing the attribute

PATCH Applied Adrian Hunter 3 participants 3 messages Jun 11, 2015 – Jun 12, 2015 perf events

lore
Share & tools
lore

Adrian Hunter

author reviewer
#0 lore raw

PATCH 1/1 perf tools: Display 0x for hex values when printing the attribute

Need to display '0x' prefix for hex values otherwise it is not obvious they are hex.

---
 tools/perf/util/evsel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/evsel.c +1 -1
index a3e36fc634dc..d4f9994ae47f 100644
@@ -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)
Signature · 1 line
1.9.1
maintainer Applied
#1 lore raw

Em Thu, Jun 11, 2015 at 03:51:04PM +0300, Adrian Hunter escreveu:

Quoted 2 lines

Need to display '0x' prefix for hex values otherwise it is not obvious they are hex.

Thanks, applied.

- Arnaldo

Quoted 20 lines
---
 tools/perf/util/evsel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/evsel.c +1 -1
index a3e36fc634dc..d4f9994ae47f 100644
@@ -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)
Signature · 1 line
1.9.1
#2 lore raw

[tip:perf/core] perf evsel: Display 0x for hex values when printing the attribute

In reply to Adrian Hunter
perf evsel: Display 0x for hex values when printing the attribute
Commit-ID:  7310aed77ef2928bcfb8ee5ad71e2b091166b85e
Gitweb:     http://git.kernel.org/tip/7310aed77ef2928bcfb8ee5ad71e2b091166b85e
Author:     Adrian Hunter <[email protected]>
AuthorDate: Thu, 11 Jun 2015 15:51:04 +0300
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Thu, 11 Jun 2015 10:56:01 -0300

perf evsel: Display 0x for hex values when printing the attribute

Need to display '0x' prefix for hex values otherwise it is not obvious they are hex.

---
 tools/perf/util/evsel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/evsel.c +1 -1
index a3e36fc..d4f9994 100644
@@ -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)