Skip to contentSkip to conversation

Fix trace.h

PATCH In review Alexander Graf 3 participants 3 messages Sep 29, 2009 – Oct 10, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 25/27 Fix trace.h

It looks like the variable "pc" is defined. At least the current code always failed on me stating that "pc" is already defined somewhere else.

Let's use _pc instead, because that doesn't collide.

Is this the right approach? Does it break on 440 too? If not, why not?

---
 arch/powerpc/kvm/trace.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
arch/powerpc/kvm/trace.h +3 -3
index 67f219d..a8e8400 100644
@@ -12,8 +12,8 @@
  * Tracepoint for guest mode entry.
  */
 TRACE_EVENT(kvm_ppc_instr,
-	TP_PROTO(unsigned int inst, unsigned long pc, unsigned int emulate),
-	TP_ARGS(inst, pc, emulate),
+	TP_PROTO(unsigned int inst, unsigned long _pc, unsigned int emulate),
+	TP_ARGS(inst, _pc, emulate),
 
 	TP_STRUCT__entry(
 		__field(	unsigned int,	inst		)
@@ -23,7 +23,7 @@ TRACE_EVENT(kvm_ppc_instr,
 
 	TP_fast_assign(
 		__entry->inst		= inst;
-		__entry->pc		= pc;
+		__entry->pc		= _pc;
 		__entry->emulate	= emulate;
 	),
 
Signature · 1 line
1.6.0.2
#1 lore raw
Quoted 28 lines · Alexander Graf

It looks like the variable "pc" is defined. At least the current code always failed on me stating that "pc" is already defined somewhere else.

Let's use _pc instead, because that doesn't collide.

Is this the right approach? Does it break on 440 too? If not, why not?

---
 arch/powerpc/kvm/trace.h |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
arch/powerpc/kvm/trace.h +2 -2
index 67f219d..a8e8400 100644
@@ -12,8 +12,8 @@
  * Tracepoint for guest mode entry.
  */
 TRACE_EVENT(kvm_ppc_instr,
-	TP_PROTO(unsigned int inst, unsigned long pc, unsigned int emulate),
-	TP_ARGS(inst, pc, emulate),
+	TP_PROTO(unsigned int inst, unsigned long _pc, unsigned int emulate),
+	TP_ARGS(inst, _pc, emulate),
 
 	TP_STRUCT__entry(
 		__field(	unsigned int,	inst		)

arch/powerpc/kvm/trace.h TRACE_EVENT(kvm_ppc_instr, · line 29

Quoted 8 lines
arch/powerpc/kvm/trace.h +1 -1
@@ -23,7 +23,7 @@ TRACE_EVENT(kvm_ppc_instr,
 
 	TP_fast_assign(
 		__entry->inst		= inst;
-		__entry->pc		= pc;
+		__entry->pc		= _pc;
 		__entry->emulate	= emulate;
 	),
 

After much digging, I managed to actually enable CONFIG_TRACEPOINTS. However, I still don't get any build errors from this code. Maybe you could paste the full gcc output?

Signature · 2 lines
Hollis Blanchard
IBM Linux Technology Center
#2 lore raw
In reply to Alexander Graf
Quoted 3 lines · Hollis Blanchard

After much digging, I managed to actually enable CONFIG_TRACEPOINTS. However, I still don't get any build errors from this code. Maybe you could paste the full gcc output?

Another option is to be a bit more "ppc-ish" and call it IAR instead of PC :-)

Cheers,
Ben.