Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1646613

Re: [PATCH] perf/x86/intel: Drop kernel samples even though :u is specified

From Mark Rutland <mark.rutland@arm.com>
Newsgroups linux.kernel
Subject Re: [PATCH] perf/x86/intel: Drop kernel samples even though :u is specified
Date 2017-05-22 10:50 +0200
Message-ID <tJRcm-3bn-23@gated-at.bofh.it> (permalink)
References (3 earlier) <tIP2V-22w-7@gated-at.bofh.it> <tIPcB-25W-11@gated-at.bofh.it> <tIPmi-2aO-11@gated-at.bofh.it> <tIQil-2MD-1@gated-at.bofh.it> <tJL6V-7OA-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, May 22, 2017 at 10:12:22AM +0800, Jin, Yao wrote:
> Hi Peter,
> 
> Maybe it's not very easy to move the skid checking to generic code
> because we don't have a common kernel_ip() available to determine if
> ip is a kernel address.
> 
> I was trying to move kernel_ip() from arch/x86/events/perf_event.h
> to generic code, but some difficulties I have:
> 
> For example, in new kernel_ip(), we may use many
> conditional-compilation for all arch, for example:
> 
> #ifdef CONFIG_X86_32
>     return ip > PAGE_OFFSET;
> #endif
> 
> #ifdef CONFIG_X86_64
>     return (long)ip < 0;
> #endif
> 
> #ifdef CONFIG_ARM....
> ......
> #ifdef CONFIG_MIPS....
> ......
> 
> But the code is being ugly and hard to maintain. And frankly I don't
> know kernel address space for all arch.
> 
> Any idea? Could we just do at x86 side this time?

Can we not check user_mode(regs) for all architectures?

!user_mode(regs) implies a kernel sample.

Thanks,
Mark.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] perf/x86/intel: Drop kernel samples even though :u is specified Jin Yao <yao.jin@linux.intel.com> - 2017-05-19 04:30 +0200
  Re: [PATCH] perf/x86/intel: Drop kernel samples even though :u is  specified Peter Zijlstra <peterz@infradead.org> - 2017-05-19 11:30 +0200
    Re: [PATCH] perf/x86/intel: Drop kernel samples even though :u is  specified Will Deacon <will.deacon@arm.com> - 2017-05-19 11:50 +0200
    Re: [PATCH] perf/x86/intel: Drop kernel samples even though :u is  specified "Jin, Yao" <yao.jin@linux.intel.com> - 2017-05-19 14:10 +0200
      Re: [PATCH] perf/x86/intel: Drop kernel samples even though :u is  specified Peter Zijlstra <peterz@infradead.org> - 2017-05-19 14:20 +0200
        Re: [PATCH] perf/x86/intel: Drop kernel samples even though :u is  specified "Jin, Yao" <yao.jin@linux.intel.com> - 2017-05-19 14:30 +0200
          Re: [PATCH] perf/x86/intel: Drop kernel samples even though :u is  specified Peter Zijlstra <peterz@infradead.org> - 2017-05-19 14:40 +0200
            Re: [PATCH] perf/x86/intel: Drop kernel samples even though :u is  specified "Jin, Yao" <yao.jin@linux.intel.com> - 2017-05-19 15:40 +0200
              Re: [PATCH] perf/x86/intel: Drop kernel samples even though :u is  specified "Jin, Yao" <yao.jin@linux.intel.com> - 2017-05-22 04:20 +0200
                Re: [PATCH] perf/x86/intel: Drop kernel samples even though :u is  specified Mark Rutland <mark.rutland@arm.com> - 2017-05-22 10:50 +0200
                Re: [PATCH] perf/x86/intel: Drop kernel samples even though :u is  specified Peter Zijlstra <peterz@infradead.org> - 2017-05-22 11:30 +0200
                Re: [PATCH] perf/x86/intel: Drop kernel samples even though :u is  specified "Jin, Yao" <yao.jin@linux.intel.com> - 2017-05-22 14:40 +0200

csiph-web