forked from mirrors/linux
		
	perf/x86: Fix USER/KERNEL tagging of samples
Several perf interrupt handlers (PEBS,IBS,BTS) re-write regs->ip but do not update the segment registers. So use an regs->ip based test instead of an regs->cs/regs->flags based test. Reported-and-tested-by: Stephane Eranian <eranian@google.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Frederic Weisbecker <fweisbec@gmail.com> Link: http://lkml.kernel.org/n/tip-xxrt0a1zronm1sm36obwc2vy@git.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
		
							parent
							
								
									9e85a6f9dc
								
							
						
					
					
						commit
						ce5c1fe9a9
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
					@ -1863,7 +1863,7 @@ unsigned long perf_misc_flags(struct pt_regs *regs)
 | 
				
			||||||
		else
 | 
							else
 | 
				
			||||||
			misc |= PERF_RECORD_MISC_GUEST_KERNEL;
 | 
								misc |= PERF_RECORD_MISC_GUEST_KERNEL;
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		if (user_mode(regs))
 | 
							if (!kernel_ip(regs->ip))
 | 
				
			||||||
			misc |= PERF_RECORD_MISC_USER;
 | 
								misc |= PERF_RECORD_MISC_USER;
 | 
				
			||||||
		else
 | 
							else
 | 
				
			||||||
			misc |= PERF_RECORD_MISC_KERNEL;
 | 
								misc |= PERF_RECORD_MISC_KERNEL;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue