Skip to contentSkip to conversation

perf record: fix branch_stack type in perf_record_opts

PATCH In review Stephane Eranian 2 participants 3 messages May 25, 2012 – May 30, 2012 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf record: fix branch_stack type in perf_record_opts

The attr.branch_sample_type field is defined as u64 by the API. As such, we need to ensure the variable holding the value of the branch stack filters is also u64 otherwise we may lose bits in the future.

Note also that the bogus definition of the field in perf_record_opts caused problems on big-endian PPC systems. Thanks to Anshuman Khandual for tracking the problem on PPC.

---

tools/perf/perf.h +1 -1
index 14f1034..f960ccb 100644
@@ -227,7 +227,7 @@ struct perf_record_opts {
 	unsigned int freq;
 	unsigned int mmap_pages;
 	unsigned int user_freq;
-	int	     branch_stack;
+	u64          branch_stack;
 	u64	     default_interval;
 	u64	     user_interval;
 };
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Stephane Eranian

The attr.branch_sample_type field is defined as u64 by the API. As such, we need to ensure the variable holding the value of the branch stack filters is also u64 otherwise we may lose bits in the future.

Note also that the bogus definition of the field in perf_record_opts caused problems on big-endian PPC systems. Thanks to Anshuman Khandual for tracking the problem on PPC.

Quoted 16 lines

---

tools/perf/perf.h +1 -1
index 14f1034..f960ccb 100644
@@ -227,7 +227,7 @@ struct perf_record_opts {
 	unsigned int freq;
 	unsigned int mmap_pages;
 	unsigned int user_freq;
-	int	     branch_stack;
+	u64          branch_stack;
 	u64	     default_interval;
 	u64	     user_interval;
 };
#2 lore raw

[tip:perf/urgent] perf record: Fix branch_stack type in perf_record_opts

In reply to Stephane Eranian
Commit-ID:  a00dc319e98161949aa87f71a17db32e925c3257
Gitweb:     http://git.kernel.org/tip/a00dc319e98161949aa87f71a17db32e925c3257
Author:     Stephane Eranian <[email protected]>
AuthorDate: Fri, 25 May 2012 23:13:44 +0200
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Fri, 25 May 2012 18:32:44 -0300

perf record: Fix branch_stack type in perf_record_opts

The attr.branch_sample_type field is defined as u64 by the API. As such, we need to ensure the variable holding the value of the branch stack filters is also u64 otherwise we may lose bits in the future.

Note also that the bogus definition of the field in perf_record_opts caused problems on big-endian PPC systems. Thanks to Anshuman Khandual for tracking the problem on PPC.

---
 tools/perf/perf.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
tools/perf/perf.h +1 -1
index 14f1034..f960ccb 100644
@@ -227,7 +227,7 @@ struct perf_record_opts {
 	unsigned int freq;
 	unsigned int mmap_pages;
 	unsigned int user_freq;
-	int	     branch_stack;
+	u64          branch_stack;
 	u64	     default_interval;
 	u64	     user_interval;
 };